From 534f3670edc86f7407c0224da4c4a48ea69d18fc Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 11:12:51 -0700 Subject: [PATCH 01/34] feat: Add import / export IssueModel (#7731) feat: Add CMEK InitializeLroSpec feat: Add metadata import to IngestConversations feat: Add sampling to IngestConversations docs: Add a comment for valid `order_by` values in ListConversations docs: Add a comment for valid `update_mask` values in UpdateConversation PiperOrigin-RevId: 683188578 Source-Link: https://github.com/googleapis/googleapis/commit/d0eeab38c8f11c090f05c332f2374b556ae36644 Source-Link: https://github.com/googleapis/googleapis-gen/commit/4d5b300a7249ce24278fbe77c16983a06d6e4a5d Copy-Tag: eyJwIjoiQ29udGFjdENlbnRlckluc2lnaHRzLy5Pd2xCb3QueWFtbCIsImgiOiI0ZDViMzAwYTcyNDljZTI0Mjc4ZmJlNzdjMTY5ODNhMDZkNmU0YTVkIn0= --- .../metadata/V1/ContactCenterInsights.php | Bin 22895 -> 25609 bytes .../metadata/V1/Resources.php | Bin 17721 -> 18494 bytes .../create_conversation.php | 2 + .../export_issue_model.php | 87 ++++ .../get_encryption_spec.php | 71 +++ .../import_issue_model.php | 83 ++++ .../initialize_encryption_spec.php | 93 ++++ .../upload_conversation.php | 4 +- .../AnalysisResult/CallAnalysisMetadata.php | 44 ++ .../SummarizationModel.php | 7 + .../V1/Client/ContactCenterInsightsClient.php | 147 +++++- ContactCenterInsights/src/V1/Conversation.php | 42 ++ .../src/V1/ConversationLevelSilence.php | 111 +++++ .../src/V1/EncryptionSpec.php | 126 +++++ .../src/V1/ExportIssueModelMetadata.php | 165 ++++++ .../src/V1/ExportIssueModelRequest.php | 123 +++++ .../GcsDestination.php | 68 +++ .../src/V1/ExportIssueModelResponse.php | 33 ++ .../src/V1/GetEncryptionSpecRequest.php | 81 +++ .../src/V1/ImportIssueModelMetadata.php | 165 ++++++ .../src/V1/ImportIssueModelRequest.php | 165 ++++++ .../V1/ImportIssueModelRequest/GcsSource.php | 68 +++ .../src/V1/ImportIssueModelResponse.php | 33 ++ .../src/V1/IngestConversationsRequest.php | 56 +++ .../ConversationConfig.php | 30 +- .../IngestConversationsRequest/GcsSource.php | 114 +++++ .../V1/InitializeEncryptionSpecMetadata.php | 203 ++++++++ .../V1/InitializeEncryptionSpecRequest.php | 105 ++++ .../V1/InitializeEncryptionSpecResponse.php | 33 ++ ContactCenterInsights/src/V1/Issue.php | 34 ++ .../src/V1/ListConversationsRequest.php | 90 +++- .../src/V1/RedactionConfig.php | 6 + .../src/V1/RuntimeAnnotation.php | 44 ++ .../src/V1/RuntimeAnnotation/UserInput.php | 144 ++++++ .../UserInput/QuerySource.php | 63 +++ ContactCenterInsights/src/V1/Settings.php | 63 ++- ContactCenterInsights/src/V1/SpeechConfig.php | 4 + .../src/V1/UpdateConversationRequest.php | 71 ++- .../src/V1/UploadConversationMetadata.php | 2 +- .../src/V1/gapic_metadata.json | 20 + ...contact_center_insights_client_config.json | 20 + ...tact_center_insights_descriptor_config.php | 71 +++ ...act_center_insights_rest_client_config.php | 48 ++ .../ContactCenterInsightsClientTest.php | 469 ++++++++++++++++++ 44 files changed, 3370 insertions(+), 38 deletions(-) create mode 100644 ContactCenterInsights/samples/V1/ContactCenterInsightsClient/export_issue_model.php create mode 100644 ContactCenterInsights/samples/V1/ContactCenterInsightsClient/get_encryption_spec.php create mode 100644 ContactCenterInsights/samples/V1/ContactCenterInsightsClient/import_issue_model.php create mode 100644 ContactCenterInsights/samples/V1/ContactCenterInsightsClient/initialize_encryption_spec.php create mode 100644 ContactCenterInsights/src/V1/ConversationLevelSilence.php create mode 100644 ContactCenterInsights/src/V1/EncryptionSpec.php create mode 100644 ContactCenterInsights/src/V1/ExportIssueModelMetadata.php create mode 100644 ContactCenterInsights/src/V1/ExportIssueModelRequest.php create mode 100644 ContactCenterInsights/src/V1/ExportIssueModelRequest/GcsDestination.php create mode 100644 ContactCenterInsights/src/V1/ExportIssueModelResponse.php create mode 100644 ContactCenterInsights/src/V1/GetEncryptionSpecRequest.php create mode 100644 ContactCenterInsights/src/V1/ImportIssueModelMetadata.php create mode 100644 ContactCenterInsights/src/V1/ImportIssueModelRequest.php create mode 100644 ContactCenterInsights/src/V1/ImportIssueModelRequest/GcsSource.php create mode 100644 ContactCenterInsights/src/V1/ImportIssueModelResponse.php create mode 100644 ContactCenterInsights/src/V1/InitializeEncryptionSpecMetadata.php create mode 100644 ContactCenterInsights/src/V1/InitializeEncryptionSpecRequest.php create mode 100644 ContactCenterInsights/src/V1/InitializeEncryptionSpecResponse.php create mode 100644 ContactCenterInsights/src/V1/RuntimeAnnotation/UserInput.php create mode 100644 ContactCenterInsights/src/V1/RuntimeAnnotation/UserInput/QuerySource.php diff --git a/ContactCenterInsights/metadata/V1/ContactCenterInsights.php b/ContactCenterInsights/metadata/V1/ContactCenterInsights.php index d959670b94293ca15a91452d731a0d2bca7db09a..2e0d9949d501e2b921d41218b7388e2f486f3105 100644 GIT binary patch delta 1585 zcmZ`&OH30{6lGrd^%eOHrEMC4GJ>rrzaprB!4{BKEa4Z!f-o7T4;Y~{b!Lj9F$8s? zE==@A6J4l@?o1FIH*Sb=Wzd)yH-;4^t~3TUapTIFX=!Qe>|S#3J@=l^+kQdZcuTB4 z$<4dBPQaeq13k+3+?N*O8-84R%T@sk1u=|7dTP;8;37O`ziG=yC=F#d0eELtUX_mm zimZediHSt#5iM~Sk=~c5_XWUpf^dEYxWx9fkF0~`5hOEVMrP=#7(0h#Iwo=sQxZ0i zqqdVZ(8|UnS%}cd?m4t5If`5+j~TDn#`pSd(3&cypqw1E;fGcmcG*V`O+&Ir;1`f6 zF)}Cc>U)}-Ayq!i4B};)3p%udQ<&@9K7Z3UveIR z#pwmo4xuo07O`=SlBWXy9%$JGKsli!`#dQs@Didni0oo0;Q-kLEv$$b8PPJHbdBK^ z&oS-duFQ+6tEvLQ$p00XgiupJ5@I5Y8~}&R4f_mwHRhvwpGx|*w`-{qmL?A1(Rn(e z39DzJP>+tY7Mhb2#%dJ8{5Ys4ME2%gLSz>4Dc7t$TTmoaF9=v`pkgoo=yFfoBoR2{7~2GWzQEi~c5+6LvB_XhwU zPAd=Ebz8$P-NLi>QmOx1Ko P9bA%)>X>358_)X(uahV; delta 141 zcmV;80CN9{$N}%N0kES41^uW23PX`gL$m7yv<5DExkXJu}5Uuk3*0U!Y= v36nM$Rvz?S=n|jdD(&CS{CgP#sk4>@(fi!KpO^c^tNyZYBY}VbR zl8fR^i(qv;D5&7Eh@h+pg7xp{rL^_f-aQCHceky^<9pxFeBXOt=Gz+hu?{}%K=^cx z?ZNM0%YMggz>zo#wP;7HX&sH+wc5Hgd=5L~@uyekPLHLSi7XApf?emdwfaj6l zsyC@#rBc8F1Ie50vo94a(pB12j|4kE^oE;iASu()asVe)Ow^wt*Ti!+!2!CZa(t} z?8^_(1vco5zK9LkkH;nH^t*HF;Ih}G^o0ZE)g3(3-n z|HFU&lV#UV^{_-41^P;S7D?rbvT&QIbCrdRLMkP7Uda@41tlw^rd{+YxRhy+=;?o%^Isr~!vOCCP++v_(jL9oX*ZykU;Y(t(M d#xWF0%c@c=loT>MmsN^nDM_Y9X#bKk+#!tM(6j&m delta 117 zcmV-*0E+*wE&_6Dj6!Zl|)Um`$R(nQrj%R diff --git a/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/create_conversation.php b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/create_conversation.php index de5e391e5049..351839a113a1 100644 --- a/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/create_conversation.php +++ b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/create_conversation.php @@ -30,6 +30,8 @@ /** * Creates a conversation. + * Note that this method does not support audio transcription or redaction. + * Use `conversations.upload` instead. * * @param string $formattedParent The parent resource of the conversation. Please see * {@see ContactCenterInsightsClient::locationName()} for help formatting this field. diff --git a/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/export_issue_model.php b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/export_issue_model.php new file mode 100644 index 000000000000..5f3b0fbb3c28 --- /dev/null +++ b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/export_issue_model.php @@ -0,0 +1,87 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $contactCenterInsightsClient->exportIssueModel($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ExportIssueModelResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $formattedName = ContactCenterInsightsClient::issueModelName( + '[PROJECT]', + '[LOCATION]', + '[ISSUE_MODEL]' + ); + + export_issue_model_sample($formattedName); +} +// [END contactcenterinsights_v1_generated_ContactCenterInsights_ExportIssueModel_sync] diff --git a/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/get_encryption_spec.php b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/get_encryption_spec.php new file mode 100644 index 000000000000..82178006a7dc --- /dev/null +++ b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/get_encryption_spec.php @@ -0,0 +1,71 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var EncryptionSpec $response */ + $response = $contactCenterInsightsClient->getEncryptionSpec($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 +{ + $formattedName = ContactCenterInsightsClient::encryptionSpecName('[PROJECT]', '[LOCATION]'); + + get_encryption_spec_sample($formattedName); +} +// [END contactcenterinsights_v1_generated_ContactCenterInsights_GetEncryptionSpec_sync] diff --git a/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/import_issue_model.php b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/import_issue_model.php new file mode 100644 index 000000000000..5b023a1d1f7f --- /dev/null +++ b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/import_issue_model.php @@ -0,0 +1,83 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $contactCenterInsightsClient->importIssueModel($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ImportIssueModelResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $formattedParent = ContactCenterInsightsClient::locationName('[PROJECT]', '[LOCATION]'); + + import_issue_model_sample($formattedParent); +} +// [END contactcenterinsights_v1_generated_ContactCenterInsights_ImportIssueModel_sync] diff --git a/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/initialize_encryption_spec.php b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/initialize_encryption_spec.php new file mode 100644 index 000000000000..044a638387ec --- /dev/null +++ b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/initialize_encryption_spec.php @@ -0,0 +1,93 @@ +setKmsKey($encryptionSpecKmsKey); + $request = (new InitializeEncryptionSpecRequest()) + ->setEncryptionSpec($encryptionSpec); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $contactCenterInsightsClient->initializeEncryptionSpec($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var InitializeEncryptionSpecResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $encryptionSpecKmsKey = '[KMS_KEY]'; + + initialize_encryption_spec_sample($encryptionSpecKmsKey); +} +// [END contactcenterinsights_v1_generated_ContactCenterInsights_InitializeEncryptionSpec_sync] diff --git a/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/upload_conversation.php b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/upload_conversation.php index 282718b15db1..61a2fe2f44ad 100644 --- a/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/upload_conversation.php +++ b/ContactCenterInsights/samples/V1/ContactCenterInsightsClient/upload_conversation.php @@ -31,8 +31,8 @@ use Google\Rpc\Status; /** - * Create a longrunning conversation upload operation. This method differs - * from CreateConversation by allowing audio transcription and optional DLP + * Create a long-running conversation upload operation. This method differs + * from `CreateConversation` by allowing audio transcription and optional DLP * redaction. * * @param string $formattedParent The parent resource of the conversation. Please see diff --git a/ContactCenterInsights/src/V1/AnalysisResult/CallAnalysisMetadata.php b/ContactCenterInsights/src/V1/AnalysisResult/CallAnalysisMetadata.php index e5eaf71af190..e3e9ab449b5f 100644 --- a/ContactCenterInsights/src/V1/AnalysisResult/CallAnalysisMetadata.php +++ b/ContactCenterInsights/src/V1/AnalysisResult/CallAnalysisMetadata.php @@ -33,6 +33,12 @@ class CallAnalysisMetadata extends \Google\Protobuf\Internal\Message * Generated from protobuf field repeated .google.cloud.contactcenterinsights.v1.ConversationLevelSentiment sentiments = 4; */ private $sentiments; + /** + * Overall conversation-level silence during the call. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.ConversationLevelSilence silence = 11; + */ + protected $silence = null; /** * All the matched intents in the call. * @@ -64,6 +70,8 @@ class CallAnalysisMetadata extends \Google\Protobuf\Internal\Message * All the entities in the call. * @type array<\Google\Cloud\ContactCenterInsights\V1\ConversationLevelSentiment>|\Google\Protobuf\Internal\RepeatedField $sentiments * Overall conversation-level sentiment for each channel of the call. + * @type \Google\Cloud\ContactCenterInsights\V1\ConversationLevelSilence $silence + * Overall conversation-level silence during the call. * @type array|\Google\Protobuf\Internal\MapField $intents * All the matched intents in the call. * @type array|\Google\Protobuf\Internal\MapField $phrase_matchers @@ -155,6 +163,42 @@ public function setSentiments($var) return $this; } + /** + * Overall conversation-level silence during the call. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.ConversationLevelSilence silence = 11; + * @return \Google\Cloud\ContactCenterInsights\V1\ConversationLevelSilence|null + */ + public function getSilence() + { + return $this->silence; + } + + public function hasSilence() + { + return isset($this->silence); + } + + public function clearSilence() + { + unset($this->silence); + } + + /** + * Overall conversation-level silence during the call. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.ConversationLevelSilence silence = 11; + * @param \Google\Cloud\ContactCenterInsights\V1\ConversationLevelSilence $var + * @return $this + */ + public function setSilence($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\ConversationLevelSilence::class); + $this->silence = $var; + + return $this; + } + /** * All the matched intents in the call. * diff --git a/ContactCenterInsights/src/V1/AnnotatorSelector/SummarizationConfig/SummarizationModel.php b/ContactCenterInsights/src/V1/AnnotatorSelector/SummarizationConfig/SummarizationModel.php index e291cb1d1482..c6be9e6691d7 100644 --- a/ContactCenterInsights/src/V1/AnnotatorSelector/SummarizationConfig/SummarizationModel.php +++ b/ContactCenterInsights/src/V1/AnnotatorSelector/SummarizationConfig/SummarizationModel.php @@ -25,10 +25,17 @@ class SummarizationModel * Generated from protobuf enum BASELINE_MODEL = 1; */ const BASELINE_MODEL = 1; + /** + * The CCAI baseline model, V2.0. + * + * Generated from protobuf enum BASELINE_MODEL_V2_0 = 2; + */ + const BASELINE_MODEL_V2_0 = 2; private static $valueToName = [ self::SUMMARIZATION_MODEL_UNSPECIFIED => 'SUMMARIZATION_MODEL_UNSPECIFIED', self::BASELINE_MODEL => 'BASELINE_MODEL', + self::BASELINE_MODEL_V2_0 => 'BASELINE_MODEL_V2_0', ]; public static function name($value) diff --git a/ContactCenterInsights/src/V1/Client/ContactCenterInsightsClient.php b/ContactCenterInsights/src/V1/Client/ContactCenterInsightsClient.php index fca384bdd4f0..8a87b9d496f1 100644 --- a/ContactCenterInsights/src/V1/Client/ContactCenterInsightsClient.php +++ b/ContactCenterInsights/src/V1/Client/ContactCenterInsightsClient.php @@ -54,15 +54,20 @@ use Google\Cloud\ContactCenterInsights\V1\DeletePhraseMatcherRequest; use Google\Cloud\ContactCenterInsights\V1\DeleteViewRequest; use Google\Cloud\ContactCenterInsights\V1\DeployIssueModelRequest; +use Google\Cloud\ContactCenterInsights\V1\EncryptionSpec; use Google\Cloud\ContactCenterInsights\V1\ExportInsightsDataRequest; +use Google\Cloud\ContactCenterInsights\V1\ExportIssueModelRequest; use Google\Cloud\ContactCenterInsights\V1\GetAnalysisRequest; use Google\Cloud\ContactCenterInsights\V1\GetConversationRequest; +use Google\Cloud\ContactCenterInsights\V1\GetEncryptionSpecRequest; use Google\Cloud\ContactCenterInsights\V1\GetIssueModelRequest; use Google\Cloud\ContactCenterInsights\V1\GetIssueRequest; use Google\Cloud\ContactCenterInsights\V1\GetPhraseMatcherRequest; use Google\Cloud\ContactCenterInsights\V1\GetSettingsRequest; use Google\Cloud\ContactCenterInsights\V1\GetViewRequest; +use Google\Cloud\ContactCenterInsights\V1\ImportIssueModelRequest; use Google\Cloud\ContactCenterInsights\V1\IngestConversationsRequest; +use Google\Cloud\ContactCenterInsights\V1\InitializeEncryptionSpecRequest; use Google\Cloud\ContactCenterInsights\V1\Issue; use Google\Cloud\ContactCenterInsights\V1\IssueModel; use Google\Cloud\ContactCenterInsights\V1\ListAnalysesRequest; @@ -116,14 +121,18 @@ * @method PromiseInterface deleteViewAsync(DeleteViewRequest $request, array $optionalArgs = []) * @method PromiseInterface deployIssueModelAsync(DeployIssueModelRequest $request, array $optionalArgs = []) * @method PromiseInterface exportInsightsDataAsync(ExportInsightsDataRequest $request, array $optionalArgs = []) + * @method PromiseInterface exportIssueModelAsync(ExportIssueModelRequest $request, array $optionalArgs = []) * @method PromiseInterface getAnalysisAsync(GetAnalysisRequest $request, array $optionalArgs = []) * @method PromiseInterface getConversationAsync(GetConversationRequest $request, array $optionalArgs = []) + * @method PromiseInterface getEncryptionSpecAsync(GetEncryptionSpecRequest $request, array $optionalArgs = []) * @method PromiseInterface getIssueAsync(GetIssueRequest $request, array $optionalArgs = []) * @method PromiseInterface getIssueModelAsync(GetIssueModelRequest $request, array $optionalArgs = []) * @method PromiseInterface getPhraseMatcherAsync(GetPhraseMatcherRequest $request, array $optionalArgs = []) * @method PromiseInterface getSettingsAsync(GetSettingsRequest $request, array $optionalArgs = []) * @method PromiseInterface getViewAsync(GetViewRequest $request, array $optionalArgs = []) + * @method PromiseInterface importIssueModelAsync(ImportIssueModelRequest $request, array $optionalArgs = []) * @method PromiseInterface ingestConversationsAsync(IngestConversationsRequest $request, array $optionalArgs = []) + * @method PromiseInterface initializeEncryptionSpecAsync(InitializeEncryptionSpecRequest $request, array $optionalArgs = []) * @method PromiseInterface listAnalysesAsync(ListAnalysesRequest $request, array $optionalArgs = []) * @method PromiseInterface listConversationsAsync(ListConversationsRequest $request, array $optionalArgs = []) * @method PromiseInterface listIssueModelsAsync(ListIssueModelsRequest $request, array $optionalArgs = []) @@ -303,6 +312,23 @@ public static function conversationProfileName( ]); } + /** + * Formats a string containing the fully-qualified path to represent a + * encryption_spec resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted encryption_spec resource. + */ + public static function encryptionSpecName(string $project, string $location): string + { + return self::getPathTemplate('encryptionSpec')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a issue * resource. @@ -507,6 +533,7 @@ public static function viewName(string $project, string $location, string $view) * - analysis: projects/{project}/locations/{location}/conversations/{conversation}/analyses/{analysis} * - conversation: projects/{project}/locations/{location}/conversations/{conversation} * - conversationProfile: projects/{project}/locations/{location}/conversationProfiles/{conversation_profile} + * - encryptionSpec: projects/{project}/locations/{location}/encryptionSpec * - issue: projects/{project}/locations/{location}/issueModels/{issue_model}/issues/{issue} * - issueModel: projects/{project}/locations/{location}/issueModels/{issue_model} * - location: projects/{project}/locations/{location} @@ -750,6 +777,8 @@ public function createAnalysis(CreateAnalysisRequest $request, array $callOption /** * Creates a conversation. + * Note that this method does not support audio transcription or redaction. + * Use `conversations.upload` instead. * * The async variant is * {@see ContactCenterInsightsClient::createConversationAsync()} . @@ -1059,6 +1088,33 @@ public function exportInsightsData(ExportInsightsDataRequest $request, array $ca return $this->startApiCall('ExportInsightsData', $request, $callOptions)->wait(); } + /** + * Exports an issue model to the provided destination. + * + * The async variant is {@see ContactCenterInsightsClient::exportIssueModelAsync()} + * . + * + * @example samples/V1/ContactCenterInsightsClient/export_issue_model.php + * + * @param ExportIssueModelRequest $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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function exportIssueModel(ExportIssueModelRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ExportIssueModel', $request, $callOptions)->wait(); + } + /** * Gets an analysis. * @@ -1112,6 +1168,33 @@ public function getConversation(GetConversationRequest $request, array $callOpti return $this->startApiCall('GetConversation', $request, $callOptions)->wait(); } + /** + * Gets location-level encryption key specification. + * + * The async variant is + * {@see ContactCenterInsightsClient::getEncryptionSpecAsync()} . + * + * @example samples/V1/ContactCenterInsightsClient/get_encryption_spec.php + * + * @param GetEncryptionSpecRequest $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 EncryptionSpec + * + * @throws ApiException Thrown if the API call fails. + */ + public function getEncryptionSpec(GetEncryptionSpecRequest $request, array $callOptions = []): EncryptionSpec + { + return $this->startApiCall('GetEncryptionSpec', $request, $callOptions)->wait(); + } + /** * Gets an issue. * @@ -1243,6 +1326,33 @@ public function getView(GetViewRequest $request, array $callOptions = []): View return $this->startApiCall('GetView', $request, $callOptions)->wait(); } + /** + * Imports an issue model from a Cloud Storage bucket. + * + * The async variant is {@see ContactCenterInsightsClient::importIssueModelAsync()} + * . + * + * @example samples/V1/ContactCenterInsightsClient/import_issue_model.php + * + * @param ImportIssueModelRequest $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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function importIssueModel(ImportIssueModelRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ImportIssueModel', $request, $callOptions)->wait(); + } + /** * Imports conversations and processes them according to the user's * configuration. @@ -1271,6 +1381,39 @@ public function ingestConversations(IngestConversationsRequest $request, array $ return $this->startApiCall('IngestConversations', $request, $callOptions)->wait(); } + /** + * Initializes a location-level encryption key specification. An error will + * be thrown if the location has resources already created before the + * initialization. Once the encryption specification is initialized at a + * location, it is immutable and all newly created resources under the + * location will be encrypted with the existing specification. + * + * The async variant is + * {@see ContactCenterInsightsClient::initializeEncryptionSpecAsync()} . + * + * @example samples/V1/ContactCenterInsightsClient/initialize_encryption_spec.php + * + * @param InitializeEncryptionSpecRequest $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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function initializeEncryptionSpec( + InitializeEncryptionSpecRequest $request, + array $callOptions = [] + ): OperationResponse { + return $this->startApiCall('InitializeEncryptionSpec', $request, $callOptions)->wait(); + } + /** * Lists analyses. * @@ -1618,8 +1761,8 @@ public function updateView(UpdateViewRequest $request, array $callOptions = []): } /** - * Create a longrunning conversation upload operation. This method differs - * from CreateConversation by allowing audio transcription and optional DLP + * Create a long-running conversation upload operation. This method differs + * from `CreateConversation` by allowing audio transcription and optional DLP * redaction. * * The async variant is diff --git a/ContactCenterInsights/src/V1/Conversation.php b/ContactCenterInsights/src/V1/Conversation.php index 1de28cfd8c8d..be3e5078a267 100644 --- a/ContactCenterInsights/src/V1/Conversation.php +++ b/ContactCenterInsights/src/V1/Conversation.php @@ -73,6 +73,14 @@ class Conversation extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.contactcenterinsights.v1.Conversation.QualityMetadata quality_metadata = 24; */ protected $quality_metadata = null; + /** + * Input only. JSON Metadata encoded as a string. + * This field is primarily used by Insights integrations with various telphony + * systems and must be in one of Insights' supported formats. + * + * Generated from protobuf field string metadata_json = 25 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $metadata_json = ''; /** * Output only. The conversation transcript. * @@ -170,6 +178,10 @@ class Conversation extends \Google\Protobuf\Internal\Message * conversation is allowed, with a maximum of 256 characters per entry. * @type \Google\Cloud\ContactCenterInsights\V1\Conversation\QualityMetadata $quality_metadata * Conversation metadata related to quality management. + * @type string $metadata_json + * Input only. JSON Metadata encoded as a string. + * This field is primarily used by Insights integrations with various telphony + * systems and must be in one of Insights' supported formats. * @type \Google\Cloud\ContactCenterInsights\V1\Conversation\Transcript $transcript * Output only. The conversation transcript. * @type int $medium @@ -588,6 +600,36 @@ public function setQualityMetadata($var) return $this; } + /** + * Input only. JSON Metadata encoded as a string. + * This field is primarily used by Insights integrations with various telphony + * systems and must be in one of Insights' supported formats. + * + * Generated from protobuf field string metadata_json = 25 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return string + */ + public function getMetadataJson() + { + return $this->metadata_json; + } + + /** + * Input only. JSON Metadata encoded as a string. + * This field is primarily used by Insights integrations with various telphony + * systems and must be in one of Insights' supported formats. + * + * Generated from protobuf field string metadata_json = 25 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setMetadataJson($var) + { + GPBUtil::checkString($var, True); + $this->metadata_json = $var; + + return $this; + } + /** * Output only. The conversation transcript. * diff --git a/ContactCenterInsights/src/V1/ConversationLevelSilence.php b/ContactCenterInsights/src/V1/ConversationLevelSilence.php new file mode 100644 index 000000000000..859ffc656498 --- /dev/null +++ b/ContactCenterInsights/src/V1/ConversationLevelSilence.php @@ -0,0 +1,111 @@ +google.cloud.contactcenterinsights.v1.ConversationLevelSilence + */ +class ConversationLevelSilence extends \Google\Protobuf\Internal\Message +{ + /** + * Amount of time calculated to be in silence. + * + * Generated from protobuf field .google.protobuf.Duration silence_duration = 1; + */ + protected $silence_duration = null; + /** + * Percentage of the total conversation spent in silence. + * + * Generated from protobuf field float silence_percentage = 2; + */ + protected $silence_percentage = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Duration $silence_duration + * Amount of time calculated to be in silence. + * @type float $silence_percentage + * Percentage of the total conversation spent in silence. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Amount of time calculated to be in silence. + * + * Generated from protobuf field .google.protobuf.Duration silence_duration = 1; + * @return \Google\Protobuf\Duration|null + */ + public function getSilenceDuration() + { + return $this->silence_duration; + } + + public function hasSilenceDuration() + { + return isset($this->silence_duration); + } + + public function clearSilenceDuration() + { + unset($this->silence_duration); + } + + /** + * Amount of time calculated to be in silence. + * + * Generated from protobuf field .google.protobuf.Duration silence_duration = 1; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setSilenceDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->silence_duration = $var; + + return $this; + } + + /** + * Percentage of the total conversation spent in silence. + * + * Generated from protobuf field float silence_percentage = 2; + * @return float + */ + public function getSilencePercentage() + { + return $this->silence_percentage; + } + + /** + * Percentage of the total conversation spent in silence. + * + * Generated from protobuf field float silence_percentage = 2; + * @param float $var + * @return $this + */ + public function setSilencePercentage($var) + { + GPBUtil::checkFloat($var); + $this->silence_percentage = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/EncryptionSpec.php b/ContactCenterInsights/src/V1/EncryptionSpec.php new file mode 100644 index 000000000000..d3efccef926d --- /dev/null +++ b/ContactCenterInsights/src/V1/EncryptionSpec.php @@ -0,0 +1,126 @@ +google.cloud.contactcenterinsights.v1.EncryptionSpec + */ +class EncryptionSpec extends \Google\Protobuf\Internal\Message +{ + /** + * Immutable. The resource name of the encryption key specification resource. + * Format: + * projects/{project}/locations/{location}/encryptionSpec + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $name = ''; + /** + * Required. The name of customer-managed encryption key that is used to + * secure a resource and its sub-resources. If empty, the resource is secured + * by the default Google encryption key. Only the key in the same location as + * this resource is allowed to be used for encryption. Format: + * `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}` + * + * Generated from protobuf field string kms_key = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $kms_key = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Immutable. The resource name of the encryption key specification resource. + * Format: + * projects/{project}/locations/{location}/encryptionSpec + * @type string $kms_key + * Required. The name of customer-managed encryption key that is used to + * secure a resource and its sub-resources. If empty, the resource is secured + * by the default Google encryption key. Only the key in the same location as + * this resource is allowed to be used for encryption. Format: + * `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Immutable. The resource name of the encryption key specification resource. + * Format: + * projects/{project}/locations/{location}/encryptionSpec + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Immutable. The resource name of the encryption key specification resource. + * Format: + * projects/{project}/locations/{location}/encryptionSpec + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The name of customer-managed encryption key that is used to + * secure a resource and its sub-resources. If empty, the resource is secured + * by the default Google encryption key. Only the key in the same location as + * this resource is allowed to be used for encryption. Format: + * `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}` + * + * Generated from protobuf field string kms_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getKmsKey() + { + return $this->kms_key; + } + + /** + * Required. The name of customer-managed encryption key that is used to + * secure a resource and its sub-resources. If empty, the resource is secured + * by the default Google encryption key. Only the key in the same location as + * this resource is allowed to be used for encryption. Format: + * `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}` + * + * Generated from protobuf field string kms_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setKmsKey($var) + { + GPBUtil::checkString($var, True); + $this->kms_key = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/ExportIssueModelMetadata.php b/ContactCenterInsights/src/V1/ExportIssueModelMetadata.php new file mode 100644 index 000000000000..7a6e77bd3038 --- /dev/null +++ b/ContactCenterInsights/src/V1/ExportIssueModelMetadata.php @@ -0,0 +1,165 @@ +google.cloud.contactcenterinsights.v1.ExportIssueModelMetadata + */ +class ExportIssueModelMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; + */ + protected $create_time = null; + /** + * The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + */ + protected $end_time = null; + /** + * The original export request. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.ExportIssueModelRequest request = 3; + */ + protected $request = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * The time the operation was created. + * @type \Google\Protobuf\Timestamp $end_time + * The time the operation finished running. + * @type \Google\Cloud\ContactCenterInsights\V1\ExportIssueModelRequest $request + * The original export request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * The original export request. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.ExportIssueModelRequest request = 3; + * @return \Google\Cloud\ContactCenterInsights\V1\ExportIssueModelRequest|null + */ + public function getRequest() + { + return $this->request; + } + + public function hasRequest() + { + return isset($this->request); + } + + public function clearRequest() + { + unset($this->request); + } + + /** + * The original export request. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.ExportIssueModelRequest request = 3; + * @param \Google\Cloud\ContactCenterInsights\V1\ExportIssueModelRequest $var + * @return $this + */ + public function setRequest($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\ExportIssueModelRequest::class); + $this->request = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/ExportIssueModelRequest.php b/ContactCenterInsights/src/V1/ExportIssueModelRequest.php new file mode 100644 index 000000000000..5fc916d35604 --- /dev/null +++ b/ContactCenterInsights/src/V1/ExportIssueModelRequest.php @@ -0,0 +1,123 @@ +google.cloud.contactcenterinsights.v1.ExportIssueModelRequest + */ +class ExportIssueModelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The issue model to export. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + protected $Destination; + + /** + * @param string $name Required. The issue model to export. Please see + * {@see ContactCenterInsightsClient::issueModelName()} for help formatting this field. + * + * @return \Google\Cloud\ContactCenterInsights\V1\ExportIssueModelRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ContactCenterInsights\V1\ExportIssueModelRequest\GcsDestination $gcs_destination + * Google Cloud Storage URI to export the issue model to. + * @type string $name + * Required. The issue model to export. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Google Cloud Storage URI to export the issue model to. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.ExportIssueModelRequest.GcsDestination gcs_destination = 2; + * @return \Google\Cloud\ContactCenterInsights\V1\ExportIssueModelRequest\GcsDestination|null + */ + public function getGcsDestination() + { + return $this->readOneof(2); + } + + public function hasGcsDestination() + { + return $this->hasOneof(2); + } + + /** + * Google Cloud Storage URI to export the issue model to. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.ExportIssueModelRequest.GcsDestination gcs_destination = 2; + * @param \Google\Cloud\ContactCenterInsights\V1\ExportIssueModelRequest\GcsDestination $var + * @return $this + */ + public function setGcsDestination($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\ExportIssueModelRequest\GcsDestination::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Required. The issue model to export. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The issue model to export. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * @return string + */ + public function getDestination() + { + return $this->whichOneof("Destination"); + } + +} + diff --git a/ContactCenterInsights/src/V1/ExportIssueModelRequest/GcsDestination.php b/ContactCenterInsights/src/V1/ExportIssueModelRequest/GcsDestination.php new file mode 100644 index 000000000000..780157daa136 --- /dev/null +++ b/ContactCenterInsights/src/V1/ExportIssueModelRequest/GcsDestination.php @@ -0,0 +1,68 @@ +google.cloud.contactcenterinsights.v1.ExportIssueModelRequest.GcsDestination + */ +class GcsDestination extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Format: `gs:///` + * + * Generated from protobuf field string object_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $object_uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $object_uri + * Required. Format: `gs:///` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Required. Format: `gs:///` + * + * Generated from protobuf field string object_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getObjectUri() + { + return $this->object_uri; + } + + /** + * Required. Format: `gs:///` + * + * Generated from protobuf field string object_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setObjectUri($var) + { + GPBUtil::checkString($var, True); + $this->object_uri = $var; + + return $this; + } + +} + + diff --git a/ContactCenterInsights/src/V1/ExportIssueModelResponse.php b/ContactCenterInsights/src/V1/ExportIssueModelResponse.php new file mode 100644 index 000000000000..cb2c757dea28 --- /dev/null +++ b/ContactCenterInsights/src/V1/ExportIssueModelResponse.php @@ -0,0 +1,33 @@ +google.cloud.contactcenterinsights.v1.ExportIssueModelResponse + */ +class ExportIssueModelResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + +} + diff --git a/ContactCenterInsights/src/V1/GetEncryptionSpecRequest.php b/ContactCenterInsights/src/V1/GetEncryptionSpecRequest.php new file mode 100644 index 000000000000..c0076eb9be97 --- /dev/null +++ b/ContactCenterInsights/src/V1/GetEncryptionSpecRequest.php @@ -0,0 +1,81 @@ +google.cloud.contactcenterinsights.v1.GetEncryptionSpecRequest + */ +class GetEncryptionSpecRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the encryption spec resource to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the encryption spec resource to get. Please see + * {@see ContactCenterInsightsClient::encryptionSpecName()} for help formatting this field. + * + * @return \Google\Cloud\ContactCenterInsights\V1\GetEncryptionSpecRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the encryption spec resource to get. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the encryption spec resource to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the encryption spec resource to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/ImportIssueModelMetadata.php b/ContactCenterInsights/src/V1/ImportIssueModelMetadata.php new file mode 100644 index 000000000000..ed2259957dce --- /dev/null +++ b/ContactCenterInsights/src/V1/ImportIssueModelMetadata.php @@ -0,0 +1,165 @@ +google.cloud.contactcenterinsights.v1.ImportIssueModelMetadata + */ +class ImportIssueModelMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; + */ + protected $create_time = null; + /** + * The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + */ + protected $end_time = null; + /** + * The original import request. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.ImportIssueModelRequest request = 3; + */ + protected $request = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * The time the operation was created. + * @type \Google\Protobuf\Timestamp $end_time + * The time the operation finished running. + * @type \Google\Cloud\ContactCenterInsights\V1\ImportIssueModelRequest $request + * The original import request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * The original import request. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.ImportIssueModelRequest request = 3; + * @return \Google\Cloud\ContactCenterInsights\V1\ImportIssueModelRequest|null + */ + public function getRequest() + { + return $this->request; + } + + public function hasRequest() + { + return isset($this->request); + } + + public function clearRequest() + { + unset($this->request); + } + + /** + * The original import request. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.ImportIssueModelRequest request = 3; + * @param \Google\Cloud\ContactCenterInsights\V1\ImportIssueModelRequest $var + * @return $this + */ + public function setRequest($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\ImportIssueModelRequest::class); + $this->request = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/ImportIssueModelRequest.php b/ContactCenterInsights/src/V1/ImportIssueModelRequest.php new file mode 100644 index 000000000000..871dd620e2c9 --- /dev/null +++ b/ContactCenterInsights/src/V1/ImportIssueModelRequest.php @@ -0,0 +1,165 @@ +google.cloud.contactcenterinsights.v1.ImportIssueModelRequest + */ +class ImportIssueModelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource of the issue model. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. If set to true, will create an issue model from the imported file + * with randomly generated IDs for the issue model and corresponding issues. + * Otherwise, replaces an existing model with the same ID as the file. + * + * Generated from protobuf field bool create_new_model = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $create_new_model = false; + protected $Source; + + /** + * @param string $parent Required. The parent resource of the issue model. Please see + * {@see ContactCenterInsightsClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\ContactCenterInsights\V1\ImportIssueModelRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ContactCenterInsights\V1\ImportIssueModelRequest\GcsSource $gcs_source + * Google Cloud Storage source message. + * @type string $parent + * Required. The parent resource of the issue model. + * @type bool $create_new_model + * Optional. If set to true, will create an issue model from the imported file + * with randomly generated IDs for the issue model and corresponding issues. + * Otherwise, replaces an existing model with the same ID as the file. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Google Cloud Storage source message. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.ImportIssueModelRequest.GcsSource gcs_source = 2; + * @return \Google\Cloud\ContactCenterInsights\V1\ImportIssueModelRequest\GcsSource|null + */ + public function getGcsSource() + { + return $this->readOneof(2); + } + + public function hasGcsSource() + { + return $this->hasOneof(2); + } + + /** + * Google Cloud Storage source message. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.ImportIssueModelRequest.GcsSource gcs_source = 2; + * @param \Google\Cloud\ContactCenterInsights\V1\ImportIssueModelRequest\GcsSource $var + * @return $this + */ + public function setGcsSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\ImportIssueModelRequest\GcsSource::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Required. The parent resource of the issue model. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource of the issue model. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. If set to true, will create an issue model from the imported file + * with randomly generated IDs for the issue model and corresponding issues. + * Otherwise, replaces an existing model with the same ID as the file. + * + * Generated from protobuf field bool create_new_model = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getCreateNewModel() + { + return $this->create_new_model; + } + + /** + * Optional. If set to true, will create an issue model from the imported file + * with randomly generated IDs for the issue model and corresponding issues. + * Otherwise, replaces an existing model with the same ID as the file. + * + * Generated from protobuf field bool create_new_model = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setCreateNewModel($var) + { + GPBUtil::checkBool($var); + $this->create_new_model = $var; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("Source"); + } + +} + diff --git a/ContactCenterInsights/src/V1/ImportIssueModelRequest/GcsSource.php b/ContactCenterInsights/src/V1/ImportIssueModelRequest/GcsSource.php new file mode 100644 index 000000000000..3080f8b29f24 --- /dev/null +++ b/ContactCenterInsights/src/V1/ImportIssueModelRequest/GcsSource.php @@ -0,0 +1,68 @@ +google.cloud.contactcenterinsights.v1.ImportIssueModelRequest.GcsSource + */ +class GcsSource extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Format: `gs:///` + * + * Generated from protobuf field string object_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $object_uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $object_uri + * Required. Format: `gs:///` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Required. Format: `gs:///` + * + * Generated from protobuf field string object_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getObjectUri() + { + return $this->object_uri; + } + + /** + * Required. Format: `gs:///` + * + * Generated from protobuf field string object_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setObjectUri($var) + { + GPBUtil::checkString($var, True); + $this->object_uri = $var; + + return $this; + } + +} + + diff --git a/ContactCenterInsights/src/V1/ImportIssueModelResponse.php b/ContactCenterInsights/src/V1/ImportIssueModelResponse.php new file mode 100644 index 000000000000..0bd1db15abb5 --- /dev/null +++ b/ContactCenterInsights/src/V1/ImportIssueModelResponse.php @@ -0,0 +1,33 @@ +google.cloud.contactcenterinsights.v1.ImportIssueModelResponse + */ +class ImportIssueModelResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + +} + diff --git a/ContactCenterInsights/src/V1/IngestConversationsRequest.php b/ContactCenterInsights/src/V1/IngestConversationsRequest.php index 96c359e2ee87..435d372507c8 100644 --- a/ContactCenterInsights/src/V1/IngestConversationsRequest.php +++ b/ContactCenterInsights/src/V1/IngestConversationsRequest.php @@ -41,6 +41,15 @@ class IngestConversationsRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.contactcenterinsights.v1.SpeechConfig speech_config = 6 [(.google.api.field_behavior) = OPTIONAL]; */ protected $speech_config = null; + /** + * Optional. If set, this fields indicates the number of objects to ingest + * from the Cloud Storage bucket. If empty, the entire bucket will be + * ingested. Unless they are first deleted, conversations produced through + * sampling won't be ingested by subsequent ingest requests. + * + * Generated from protobuf field optional int32 sample_size = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $sample_size = null; protected $source; protected $object_config; @@ -79,6 +88,11 @@ public static function build(string $parent): self * @type \Google\Cloud\ContactCenterInsights\V1\SpeechConfig $speech_config * Optional. Default Speech-to-Text configuration. Optional, will default to * the config specified in Settings. + * @type int $sample_size + * Optional. If set, this fields indicates the number of objects to ingest + * from the Cloud Storage bucket. If empty, the entire bucket will be + * ingested. Unless they are first deleted, conversations produced through + * sampling won't be ingested by subsequent ingest requests. * } */ public function __construct($data = NULL) { @@ -288,6 +302,48 @@ public function setSpeechConfig($var) return $this; } + /** + * Optional. If set, this fields indicates the number of objects to ingest + * from the Cloud Storage bucket. If empty, the entire bucket will be + * ingested. Unless they are first deleted, conversations produced through + * sampling won't be ingested by subsequent ingest requests. + * + * Generated from protobuf field optional int32 sample_size = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getSampleSize() + { + return isset($this->sample_size) ? $this->sample_size : 0; + } + + public function hasSampleSize() + { + return isset($this->sample_size); + } + + public function clearSampleSize() + { + unset($this->sample_size); + } + + /** + * Optional. If set, this fields indicates the number of objects to ingest + * from the Cloud Storage bucket. If empty, the entire bucket will be + * ingested. Unless they are first deleted, conversations produced through + * sampling won't be ingested by subsequent ingest requests. + * + * Generated from protobuf field optional int32 sample_size = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setSampleSize($var) + { + GPBUtil::checkInt32($var); + $this->sample_size = $var; + + return $this; + } + /** * @return string */ diff --git a/ContactCenterInsights/src/V1/IngestConversationsRequest/ConversationConfig.php b/ContactCenterInsights/src/V1/IngestConversationsRequest/ConversationConfig.php index d1fce0b70425..0c6d03321d54 100644 --- a/ContactCenterInsights/src/V1/IngestConversationsRequest/ConversationConfig.php +++ b/ContactCenterInsights/src/V1/IngestConversationsRequest/ConversationConfig.php @@ -16,10 +16,12 @@ class ConversationConfig extends \Google\Protobuf\Internal\Message { /** - * An opaque, user-specified string representing the human agent who handled - * the conversations. + * Optional. An opaque, user-specified string representing a human agent who + * handled all conversations in the import. Note that this will be + * overridden if per-conversation metadata is provided through the + * `metadata_bucket_uri`. * - * Generated from protobuf field string agent_id = 1; + * Generated from protobuf field string agent_id = 1 [(.google.api.field_behavior) = OPTIONAL]; */ protected $agent_id = ''; /** @@ -46,8 +48,10 @@ class ConversationConfig extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $agent_id - * An opaque, user-specified string representing the human agent who handled - * the conversations. + * Optional. An opaque, user-specified string representing a human agent who + * handled all conversations in the import. Note that this will be + * overridden if per-conversation metadata is provided through the + * `metadata_bucket_uri`. * @type int $agent_channel * Optional. Indicates which of the channels, 1 or 2, contains the agent. * Note that this must be set for conversations to be properly displayed and @@ -64,10 +68,12 @@ public function __construct($data = NULL) { } /** - * An opaque, user-specified string representing the human agent who handled - * the conversations. + * Optional. An opaque, user-specified string representing a human agent who + * handled all conversations in the import. Note that this will be + * overridden if per-conversation metadata is provided through the + * `metadata_bucket_uri`. * - * Generated from protobuf field string agent_id = 1; + * Generated from protobuf field string agent_id = 1 [(.google.api.field_behavior) = OPTIONAL]; * @return string */ public function getAgentId() @@ -76,10 +82,12 @@ public function getAgentId() } /** - * An opaque, user-specified string representing the human agent who handled - * the conversations. + * Optional. An opaque, user-specified string representing a human agent who + * handled all conversations in the import. Note that this will be + * overridden if per-conversation metadata is provided through the + * `metadata_bucket_uri`. * - * Generated from protobuf field string agent_id = 1; + * Generated from protobuf field string agent_id = 1 [(.google.api.field_behavior) = OPTIONAL]; * @param string $var * @return $this */ diff --git a/ContactCenterInsights/src/V1/IngestConversationsRequest/GcsSource.php b/ContactCenterInsights/src/V1/IngestConversationsRequest/GcsSource.php index ac6730cabde1..b09e2ad81e11 100644 --- a/ContactCenterInsights/src/V1/IngestConversationsRequest/GcsSource.php +++ b/ContactCenterInsights/src/V1/IngestConversationsRequest/GcsSource.php @@ -27,6 +27,27 @@ class GcsSource extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource.BucketObjectType bucket_object_type = 2 [(.google.api.field_behavior) = OPTIONAL]; */ protected $bucket_object_type = 0; + /** + * Optional. The Cloud Storage path to the conversation metadata. Note that: + * [1] Metadata files are expected to be in JSON format. + * [2] Metadata and source files (transcripts or audio) must be in + * separate buckets. + * [3] A source file and its corresponding metadata file must share the same + * name to + * be properly ingested, E.g. `gs://bucket/audio/conversation1.mp3` and + * `gs://bucket/metadata/conversation1.json`. + * + * Generated from protobuf field optional string metadata_bucket_uri = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $metadata_bucket_uri = null; + /** + * Optional. Custom keys to extract as conversation labels from metadata + * files in `metadata_bucket_uri`. Keys not included in this field will be + * ignored. Note that there is a limit of 20 labels per conversation. + * + * Generated from protobuf field repeated string custom_metadata_keys = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $custom_metadata_keys; /** * Constructor. @@ -38,6 +59,19 @@ class GcsSource extends \Google\Protobuf\Internal\Message * Required. The Cloud Storage bucket containing source objects. * @type int $bucket_object_type * Optional. Specifies the type of the objects in `bucket_uri`. + * @type string $metadata_bucket_uri + * Optional. The Cloud Storage path to the conversation metadata. Note that: + * [1] Metadata files are expected to be in JSON format. + * [2] Metadata and source files (transcripts or audio) must be in + * separate buckets. + * [3] A source file and its corresponding metadata file must share the same + * name to + * be properly ingested, E.g. `gs://bucket/audio/conversation1.mp3` and + * `gs://bucket/metadata/conversation1.json`. + * @type array|\Google\Protobuf\Internal\RepeatedField $custom_metadata_keys + * Optional. Custom keys to extract as conversation labels from metadata + * files in `metadata_bucket_uri`. Keys not included in this field will be + * ignored. Note that there is a limit of 20 labels per conversation. * } */ public function __construct($data = NULL) { @@ -97,6 +131,86 @@ public function setBucketObjectType($var) return $this; } + /** + * Optional. The Cloud Storage path to the conversation metadata. Note that: + * [1] Metadata files are expected to be in JSON format. + * [2] Metadata and source files (transcripts or audio) must be in + * separate buckets. + * [3] A source file and its corresponding metadata file must share the same + * name to + * be properly ingested, E.g. `gs://bucket/audio/conversation1.mp3` and + * `gs://bucket/metadata/conversation1.json`. + * + * Generated from protobuf field optional string metadata_bucket_uri = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getMetadataBucketUri() + { + return isset($this->metadata_bucket_uri) ? $this->metadata_bucket_uri : ''; + } + + public function hasMetadataBucketUri() + { + return isset($this->metadata_bucket_uri); + } + + public function clearMetadataBucketUri() + { + unset($this->metadata_bucket_uri); + } + + /** + * Optional. The Cloud Storage path to the conversation metadata. Note that: + * [1] Metadata files are expected to be in JSON format. + * [2] Metadata and source files (transcripts or audio) must be in + * separate buckets. + * [3] A source file and its corresponding metadata file must share the same + * name to + * be properly ingested, E.g. `gs://bucket/audio/conversation1.mp3` and + * `gs://bucket/metadata/conversation1.json`. + * + * Generated from protobuf field optional string metadata_bucket_uri = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setMetadataBucketUri($var) + { + GPBUtil::checkString($var, True); + $this->metadata_bucket_uri = $var; + + return $this; + } + + /** + * Optional. Custom keys to extract as conversation labels from metadata + * files in `metadata_bucket_uri`. Keys not included in this field will be + * ignored. Note that there is a limit of 20 labels per conversation. + * + * Generated from protobuf field repeated string custom_metadata_keys = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCustomMetadataKeys() + { + return $this->custom_metadata_keys; + } + + /** + * Optional. Custom keys to extract as conversation labels from metadata + * files in `metadata_bucket_uri`. Keys not included in this field will be + * ignored. Note that there is a limit of 20 labels per conversation. + * + * Generated from protobuf field repeated string custom_metadata_keys = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCustomMetadataKeys($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->custom_metadata_keys = $arr; + + return $this; + } + } diff --git a/ContactCenterInsights/src/V1/InitializeEncryptionSpecMetadata.php b/ContactCenterInsights/src/V1/InitializeEncryptionSpecMetadata.php new file mode 100644 index 000000000000..c0baf71e1a3d --- /dev/null +++ b/ContactCenterInsights/src/V1/InitializeEncryptionSpecMetadata.php @@ -0,0 +1,203 @@ +google.cloud.contactcenterinsights.v1.InitializeEncryptionSpecMetadata + */ +class InitializeEncryptionSpecMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. The original request for initialization. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.InitializeEncryptionSpecRequest request = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $request = null; + /** + * Partial errors during initialising operation that might cause the operation + * output to be incomplete. + * + * Generated from protobuf field repeated .google.rpc.Status partial_errors = 4; + */ + private $partial_errors; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the operation was created. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the operation finished running. + * @type \Google\Cloud\ContactCenterInsights\V1\InitializeEncryptionSpecRequest $request + * Output only. The original request for initialization. + * @type array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $partial_errors + * Partial errors during initialising operation that might cause the operation + * output to be incomplete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. The original request for initialization. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.InitializeEncryptionSpecRequest request = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\ContactCenterInsights\V1\InitializeEncryptionSpecRequest|null + */ + public function getRequest() + { + return $this->request; + } + + public function hasRequest() + { + return isset($this->request); + } + + public function clearRequest() + { + unset($this->request); + } + + /** + * Output only. The original request for initialization. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.InitializeEncryptionSpecRequest request = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\ContactCenterInsights\V1\InitializeEncryptionSpecRequest $var + * @return $this + */ + public function setRequest($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\InitializeEncryptionSpecRequest::class); + $this->request = $var; + + return $this; + } + + /** + * Partial errors during initialising operation that might cause the operation + * output to be incomplete. + * + * Generated from protobuf field repeated .google.rpc.Status partial_errors = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPartialErrors() + { + return $this->partial_errors; + } + + /** + * Partial errors during initialising operation that might cause the operation + * output to be incomplete. + * + * Generated from protobuf field repeated .google.rpc.Status partial_errors = 4; + * @param array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPartialErrors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class); + $this->partial_errors = $arr; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/InitializeEncryptionSpecRequest.php b/ContactCenterInsights/src/V1/InitializeEncryptionSpecRequest.php new file mode 100644 index 000000000000..a140e2788c3e --- /dev/null +++ b/ContactCenterInsights/src/V1/InitializeEncryptionSpecRequest.php @@ -0,0 +1,105 @@ +google.cloud.contactcenterinsights.v1.InitializeEncryptionSpecRequest + */ +class InitializeEncryptionSpecRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The encryption spec used for CMEK encryption. It is required that + * the kms key is in the same region as the endpoint. The same key will be + * used for all provisioned resources, if encryption is available. If the + * kms_key_name is left empty, no encryption will be enforced. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.EncryptionSpec encryption_spec = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $encryption_spec = null; + + /** + * @param \Google\Cloud\ContactCenterInsights\V1\EncryptionSpec $encryptionSpec Required. The encryption spec used for CMEK encryption. It is required that + * the kms key is in the same region as the endpoint. The same key will be + * used for all provisioned resources, if encryption is available. If the + * kms_key_name is left empty, no encryption will be enforced. + * + * @return \Google\Cloud\ContactCenterInsights\V1\InitializeEncryptionSpecRequest + * + * @experimental + */ + public static function build(\Google\Cloud\ContactCenterInsights\V1\EncryptionSpec $encryptionSpec): self + { + return (new self()) + ->setEncryptionSpec($encryptionSpec); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ContactCenterInsights\V1\EncryptionSpec $encryption_spec + * Required. The encryption spec used for CMEK encryption. It is required that + * the kms key is in the same region as the endpoint. The same key will be + * used for all provisioned resources, if encryption is available. If the + * kms_key_name is left empty, no encryption will be enforced. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + + /** + * Required. The encryption spec used for CMEK encryption. It is required that + * the kms key is in the same region as the endpoint. The same key will be + * used for all provisioned resources, if encryption is available. If the + * kms_key_name is left empty, no encryption will be enforced. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.EncryptionSpec encryption_spec = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ContactCenterInsights\V1\EncryptionSpec|null + */ + public function getEncryptionSpec() + { + return $this->encryption_spec; + } + + public function hasEncryptionSpec() + { + return isset($this->encryption_spec); + } + + public function clearEncryptionSpec() + { + unset($this->encryption_spec); + } + + /** + * Required. The encryption spec used for CMEK encryption. It is required that + * the kms key is in the same region as the endpoint. The same key will be + * used for all provisioned resources, if encryption is available. If the + * kms_key_name is left empty, no encryption will be enforced. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.EncryptionSpec encryption_spec = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ContactCenterInsights\V1\EncryptionSpec $var + * @return $this + */ + public function setEncryptionSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\EncryptionSpec::class); + $this->encryption_spec = $var; + + return $this; + } + +} + diff --git a/ContactCenterInsights/src/V1/InitializeEncryptionSpecResponse.php b/ContactCenterInsights/src/V1/InitializeEncryptionSpecResponse.php new file mode 100644 index 000000000000..a56abe51d282 --- /dev/null +++ b/ContactCenterInsights/src/V1/InitializeEncryptionSpecResponse.php @@ -0,0 +1,33 @@ +google.cloud.contactcenterinsights.v1.InitializeEncryptionSpecResponse + */ +class InitializeEncryptionSpecResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\ContactCenterInsights::initOnce(); + parent::__construct($data); + } + +} + diff --git a/ContactCenterInsights/src/V1/Issue.php b/ContactCenterInsights/src/V1/Issue.php index 7c46c7d9df38..710d57742358 100644 --- a/ContactCenterInsights/src/V1/Issue.php +++ b/ContactCenterInsights/src/V1/Issue.php @@ -48,6 +48,12 @@ class Issue extends \Google\Protobuf\Internal\Message * Generated from protobuf field repeated string sample_utterances = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ private $sample_utterances; + /** + * Representative description of the issue. + * + * Generated from protobuf field string display_description = 14; + */ + protected $display_description = ''; /** * Constructor. @@ -68,6 +74,8 @@ class Issue extends \Google\Protobuf\Internal\Message * @type array|\Google\Protobuf\Internal\RepeatedField $sample_utterances * Output only. Resource names of the sample representative utterances that * match to this issue. + * @type string $display_description + * Representative description of the issue. * } */ public function __construct($data = NULL) { @@ -231,5 +239,31 @@ public function setSampleUtterances($var) return $this; } + /** + * Representative description of the issue. + * + * Generated from protobuf field string display_description = 14; + * @return string + */ + public function getDisplayDescription() + { + return $this->display_description; + } + + /** + * Representative description of the issue. + * + * Generated from protobuf field string display_description = 14; + * @param string $var + * @return $this + */ + public function setDisplayDescription($var) + { + GPBUtil::checkString($var, True); + $this->display_description = $var; + + return $this; + } + } diff --git a/ContactCenterInsights/src/V1/ListConversationsRequest.php b/ContactCenterInsights/src/V1/ListConversationsRequest.php index cfe31fa3fb41..42dfc06a5ec7 100644 --- a/ContactCenterInsights/src/V1/ListConversationsRequest.php +++ b/ContactCenterInsights/src/V1/ListConversationsRequest.php @@ -23,7 +23,7 @@ class ListConversationsRequest extends \Google\Protobuf\Internal\Message protected $parent = ''; /** * The maximum number of conversations to return in the response. A valid page - * size ranges from 0 to 1,000 inclusive. If the page size is zero or + * size ranges from 0 to 100,000 inclusive. If the page size is zero or * unspecified, a default page size of 100 will be chosen. Note that a call * might return fewer results than the requested page size. * @@ -45,6 +45,24 @@ class ListConversationsRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field string filter = 4; */ protected $filter = ''; + /** + * Optional. The attribute by which to order conversations in the response. + * If empty, conversations will be ordered by descending creation time. + * Supported values are one of the following: + * * create_time + * * customer_satisfaction_rating + * * duration + * * latest_analysis + * * start_time + * * turn_count + * The default sort order is ascending. To specify order, append `asc` or + * `desc` (`create_time desc`). + * For more details, see [Google AIPs + * Ordering](https://google.aip.dev/132#ordering). + * + * Generated from protobuf field string order_by = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; /** * The level of details of the conversation. Default is `BASIC`. * @@ -76,7 +94,7 @@ public static function build(string $parent): self * Required. The parent resource of the conversation. * @type int $page_size * The maximum number of conversations to return in the response. A valid page - * size ranges from 0 to 1,000 inclusive. If the page size is zero or + * size ranges from 0 to 100,000 inclusive. If the page size is zero or * unspecified, a default page size of 100 will be chosen. Note that a call * might return fewer results than the requested page size. * @type string $page_token @@ -86,6 +104,20 @@ public static function build(string $parent): self * @type string $filter * A filter to reduce results to a specific subset. Useful for querying * conversations with specific properties. + * @type string $order_by + * Optional. The attribute by which to order conversations in the response. + * If empty, conversations will be ordered by descending creation time. + * Supported values are one of the following: + * * create_time + * * customer_satisfaction_rating + * * duration + * * latest_analysis + * * start_time + * * turn_count + * The default sort order is ascending. To specify order, append `asc` or + * `desc` (`create_time desc`). + * For more details, see [Google AIPs + * Ordering](https://google.aip.dev/132#ordering). * @type int $view * The level of details of the conversation. Default is `BASIC`. * } @@ -123,7 +155,7 @@ public function setParent($var) /** * The maximum number of conversations to return in the response. A valid page - * size ranges from 0 to 1,000 inclusive. If the page size is zero or + * size ranges from 0 to 100,000 inclusive. If the page size is zero or * unspecified, a default page size of 100 will be chosen. Note that a call * might return fewer results than the requested page size. * @@ -137,7 +169,7 @@ public function getPageSize() /** * The maximum number of conversations to return in the response. A valid page - * size ranges from 0 to 1,000 inclusive. If the page size is zero or + * size ranges from 0 to 100,000 inclusive. If the page size is zero or * unspecified, a default page size of 100 will be chosen. Note that a call * might return fewer results than the requested page size. * @@ -211,6 +243,56 @@ public function setFilter($var) return $this; } + /** + * Optional. The attribute by which to order conversations in the response. + * If empty, conversations will be ordered by descending creation time. + * Supported values are one of the following: + * * create_time + * * customer_satisfaction_rating + * * duration + * * latest_analysis + * * start_time + * * turn_count + * The default sort order is ascending. To specify order, append `asc` or + * `desc` (`create_time desc`). + * For more details, see [Google AIPs + * Ordering](https://google.aip.dev/132#ordering). + * + * Generated from protobuf field string order_by = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. The attribute by which to order conversations in the response. + * If empty, conversations will be ordered by descending creation time. + * Supported values are one of the following: + * * create_time + * * customer_satisfaction_rating + * * duration + * * latest_analysis + * * start_time + * * turn_count + * The default sort order is ascending. To specify order, append `asc` or + * `desc` (`create_time desc`). + * For more details, see [Google AIPs + * Ordering](https://google.aip.dev/132#ordering). + * + * Generated from protobuf field string order_by = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + /** * The level of details of the conversation. Default is `BASIC`. * diff --git a/ContactCenterInsights/src/V1/RedactionConfig.php b/ContactCenterInsights/src/V1/RedactionConfig.php index ebcf981ef8e4..293547129dc3 100644 --- a/ContactCenterInsights/src/V1/RedactionConfig.php +++ b/ContactCenterInsights/src/V1/RedactionConfig.php @@ -10,6 +10,12 @@ /** * DLP resources used for redaction while ingesting conversations. + * DLP settings are applied to conversations ingested from the + * `UploadConversation` and `IngestConversations` endpoints, including + * conversation coming from CCAI Platform. They are not applied to conversations + * ingested from the `CreateConversation` endpoint or the Dialogflow / Agent + * Assist runtime integrations. When using Dialogflow / Agent Assist runtime + * integrations, redaction should be performed in Dialogflow / Agent Assist. * * Generated from protobuf message google.cloud.contactcenterinsights.v1.RedactionConfig */ diff --git a/ContactCenterInsights/src/V1/RuntimeAnnotation.php b/ContactCenterInsights/src/V1/RuntimeAnnotation.php index 6d27085452d2..4c7f365eabe0 100644 --- a/ContactCenterInsights/src/V1/RuntimeAnnotation.php +++ b/ContactCenterInsights/src/V1/RuntimeAnnotation.php @@ -47,6 +47,12 @@ class RuntimeAnnotation extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.contactcenterinsights.v1.AnswerFeedback answer_feedback = 5; */ protected $answer_feedback = null; + /** + * Explicit input used for generating the answer + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.RuntimeAnnotation.UserInput user_input = 16; + */ + protected $user_input = null; protected $data; /** @@ -79,6 +85,8 @@ class RuntimeAnnotation extends \Google\Protobuf\Internal\Message * The boundary in the conversation where the annotation ends, inclusive. * @type \Google\Cloud\ContactCenterInsights\V1\AnswerFeedback $answer_feedback * The feedback that the customer has about the answer in `data`. + * @type \Google\Cloud\ContactCenterInsights\V1\RuntimeAnnotation\UserInput $user_input + * Explicit input used for generating the answer * } */ public function __construct($data = NULL) { @@ -446,6 +454,42 @@ public function setAnswerFeedback($var) return $this; } + /** + * Explicit input used for generating the answer + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.RuntimeAnnotation.UserInput user_input = 16; + * @return \Google\Cloud\ContactCenterInsights\V1\RuntimeAnnotation\UserInput|null + */ + public function getUserInput() + { + return $this->user_input; + } + + public function hasUserInput() + { + return isset($this->user_input); + } + + public function clearUserInput() + { + unset($this->user_input); + } + + /** + * Explicit input used for generating the answer + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.RuntimeAnnotation.UserInput user_input = 16; + * @param \Google\Cloud\ContactCenterInsights\V1\RuntimeAnnotation\UserInput $var + * @return $this + */ + public function setUserInput($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\RuntimeAnnotation\UserInput::class); + $this->user_input = $var; + + return $this; + } + /** * @return string */ diff --git a/ContactCenterInsights/src/V1/RuntimeAnnotation/UserInput.php b/ContactCenterInsights/src/V1/RuntimeAnnotation/UserInput.php new file mode 100644 index 000000000000..276d80d14d1a --- /dev/null +++ b/ContactCenterInsights/src/V1/RuntimeAnnotation/UserInput.php @@ -0,0 +1,144 @@ +google.cloud.contactcenterinsights.v1.RuntimeAnnotation.UserInput + */ +class UserInput extends \Google\Protobuf\Internal\Message +{ + /** + * Query text. Article Search uses this to store the input query used + * to generate the search results. + * + * Generated from protobuf field string query = 1; + */ + protected $query = ''; + /** + * The resource name of associated generator. Format: + * `projects//locations//generators/` + * + * Generated from protobuf field string generator_name = 2; + */ + protected $generator_name = ''; + /** + * Query source for the answer. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.RuntimeAnnotation.UserInput.QuerySource query_source = 3; + */ + protected $query_source = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $query + * Query text. Article Search uses this to store the input query used + * to generate the search results. + * @type string $generator_name + * The resource name of associated generator. Format: + * `projects//locations//generators/` + * @type int $query_source + * Query source for the answer. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Query text. Article Search uses this to store the input query used + * to generate the search results. + * + * Generated from protobuf field string query = 1; + * @return string + */ + public function getQuery() + { + return $this->query; + } + + /** + * Query text. Article Search uses this to store the input query used + * to generate the search results. + * + * Generated from protobuf field string query = 1; + * @param string $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkString($var, True); + $this->query = $var; + + return $this; + } + + /** + * The resource name of associated generator. Format: + * `projects//locations//generators/` + * + * Generated from protobuf field string generator_name = 2; + * @return string + */ + public function getGeneratorName() + { + return $this->generator_name; + } + + /** + * The resource name of associated generator. Format: + * `projects//locations//generators/` + * + * Generated from protobuf field string generator_name = 2; + * @param string $var + * @return $this + */ + public function setGeneratorName($var) + { + GPBUtil::checkString($var, True); + $this->generator_name = $var; + + return $this; + } + + /** + * Query source for the answer. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.RuntimeAnnotation.UserInput.QuerySource query_source = 3; + * @return int + */ + public function getQuerySource() + { + return $this->query_source; + } + + /** + * Query source for the answer. + * + * Generated from protobuf field .google.cloud.contactcenterinsights.v1.RuntimeAnnotation.UserInput.QuerySource query_source = 3; + * @param int $var + * @return $this + */ + public function setQuerySource($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\ContactCenterInsights\V1\RuntimeAnnotation\UserInput\QuerySource::class); + $this->query_source = $var; + + return $this; + } + +} + + diff --git a/ContactCenterInsights/src/V1/RuntimeAnnotation/UserInput/QuerySource.php b/ContactCenterInsights/src/V1/RuntimeAnnotation/UserInput/QuerySource.php new file mode 100644 index 000000000000..5edc374d4137 --- /dev/null +++ b/ContactCenterInsights/src/V1/RuntimeAnnotation/UserInput/QuerySource.php @@ -0,0 +1,63 @@ +google.cloud.contactcenterinsights.v1.RuntimeAnnotation.UserInput.QuerySource + */ +class QuerySource +{ + /** + * Unknown query source. + * + * Generated from protobuf enum QUERY_SOURCE_UNSPECIFIED = 0; + */ + const QUERY_SOURCE_UNSPECIFIED = 0; + /** + * The query is from agents. + * + * Generated from protobuf enum AGENT_QUERY = 1; + */ + const AGENT_QUERY = 1; + /** + * The query is a query from previous suggestions, e.g. from a preceding + * SuggestKnowledgeAssist response. + * + * Generated from protobuf enum SUGGESTED_QUERY = 2; + */ + const SUGGESTED_QUERY = 2; + + private static $valueToName = [ + self::QUERY_SOURCE_UNSPECIFIED => 'QUERY_SOURCE_UNSPECIFIED', + self::AGENT_QUERY => 'AGENT_QUERY', + self::SUGGESTED_QUERY => 'SUGGESTED_QUERY', + ]; + + 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/ContactCenterInsights/src/V1/Settings.php b/ContactCenterInsights/src/V1/Settings.php index 4c92a6b67f20..a728e5d6bc4f 100644 --- a/ContactCenterInsights/src/V1/Settings.php +++ b/ContactCenterInsights/src/V1/Settings.php @@ -9,7 +9,12 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The settings resource. + * The CCAI Insights project wide settings. + * Use these settings to configure the behavior of Insights. + * View these settings with + * [`getsettings`](https://cloud.google.com/contact-center/insights/docs/reference/rest/v1/projects.locations/getSettings) + * and change the settings with + * [`updateSettings`](https://cloud.google.com/contact-center/insights/docs/reference/rest/v1/projects.locations/updateSettings). * * Generated from protobuf message google.cloud.contactcenterinsights.v1.Settings */ @@ -61,8 +66,11 @@ class Settings extends \Google\Protobuf\Internal\Message * * "create-analysis": Notify each time an analysis is created. * * "create-conversation": Notify each time a conversation is created. * * "export-insights-data": Notify each time an export is complete. + * * "ingest-conversations": Notify each time an IngestConversations LRO is + * complete. * * "update-conversation": Notify each time a conversation is updated via * UpdateConversation. + * * "upload-conversation": Notify when an UploadConversation LRO is complete. * Values are Pub/Sub topics. The format of each Pub/Sub topic is: * projects/{project}/topics/{topic} * @@ -77,14 +85,19 @@ class Settings extends \Google\Protobuf\Internal\Message protected $analysis_config = null; /** * Default DLP redaction resources to be applied while ingesting - * conversations. + * conversations. This applies to conversations ingested from the + * `UploadConversation` and `IngestConversations` endpoints, including + * conversations coming from CCAI Platform. * * Generated from protobuf field .google.cloud.contactcenterinsights.v1.RedactionConfig redaction_config = 10; */ protected $redaction_config = null; /** - * Optional. Default Speech-to-Text resources to be used while ingesting audio - * files. Optional, CCAI Insights will create a default if not provided. + * Optional. Default Speech-to-Text resources to use while ingesting audio + * files. Optional, CCAI Insights will create a default if not provided. This + * applies to conversations ingested from the `UploadConversation` and + * `IngestConversations` endpoints, including conversations coming from CCAI + * Platform. * * Generated from protobuf field .google.cloud.contactcenterinsights.v1.SpeechConfig speech_config = 11 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -122,18 +135,26 @@ class Settings extends \Google\Protobuf\Internal\Message * * "create-analysis": Notify each time an analysis is created. * * "create-conversation": Notify each time a conversation is created. * * "export-insights-data": Notify each time an export is complete. + * * "ingest-conversations": Notify each time an IngestConversations LRO is + * complete. * * "update-conversation": Notify each time a conversation is updated via * UpdateConversation. + * * "upload-conversation": Notify when an UploadConversation LRO is complete. * Values are Pub/Sub topics. The format of each Pub/Sub topic is: * projects/{project}/topics/{topic} * @type \Google\Cloud\ContactCenterInsights\V1\Settings\AnalysisConfig $analysis_config * Default analysis settings. * @type \Google\Cloud\ContactCenterInsights\V1\RedactionConfig $redaction_config * Default DLP redaction resources to be applied while ingesting - * conversations. + * conversations. This applies to conversations ingested from the + * `UploadConversation` and `IngestConversations` endpoints, including + * conversations coming from CCAI Platform. * @type \Google\Cloud\ContactCenterInsights\V1\SpeechConfig $speech_config - * Optional. Default Speech-to-Text resources to be used while ingesting audio - * files. Optional, CCAI Insights will create a default if not provided. + * Optional. Default Speech-to-Text resources to use while ingesting audio + * files. Optional, CCAI Insights will create a default if not provided. This + * applies to conversations ingested from the `UploadConversation` and + * `IngestConversations` endpoints, including conversations coming from CCAI + * Platform. * } */ public function __construct($data = NULL) { @@ -324,8 +345,11 @@ public function setConversationTtl($var) * * "create-analysis": Notify each time an analysis is created. * * "create-conversation": Notify each time a conversation is created. * * "export-insights-data": Notify each time an export is complete. + * * "ingest-conversations": Notify each time an IngestConversations LRO is + * complete. * * "update-conversation": Notify each time a conversation is updated via * UpdateConversation. + * * "upload-conversation": Notify when an UploadConversation LRO is complete. * Values are Pub/Sub topics. The format of each Pub/Sub topic is: * projects/{project}/topics/{topic} * @@ -346,8 +370,11 @@ public function getPubsubNotificationSettings() * * "create-analysis": Notify each time an analysis is created. * * "create-conversation": Notify each time a conversation is created. * * "export-insights-data": Notify each time an export is complete. + * * "ingest-conversations": Notify each time an IngestConversations LRO is + * complete. * * "update-conversation": Notify each time a conversation is updated via * UpdateConversation. + * * "upload-conversation": Notify when an UploadConversation LRO is complete. * Values are Pub/Sub topics. The format of each Pub/Sub topic is: * projects/{project}/topics/{topic} * @@ -401,7 +428,9 @@ public function setAnalysisConfig($var) /** * Default DLP redaction resources to be applied while ingesting - * conversations. + * conversations. This applies to conversations ingested from the + * `UploadConversation` and `IngestConversations` endpoints, including + * conversations coming from CCAI Platform. * * Generated from protobuf field .google.cloud.contactcenterinsights.v1.RedactionConfig redaction_config = 10; * @return \Google\Cloud\ContactCenterInsights\V1\RedactionConfig|null @@ -423,7 +452,9 @@ public function clearRedactionConfig() /** * Default DLP redaction resources to be applied while ingesting - * conversations. + * conversations. This applies to conversations ingested from the + * `UploadConversation` and `IngestConversations` endpoints, including + * conversations coming from CCAI Platform. * * Generated from protobuf field .google.cloud.contactcenterinsights.v1.RedactionConfig redaction_config = 10; * @param \Google\Cloud\ContactCenterInsights\V1\RedactionConfig $var @@ -438,8 +469,11 @@ public function setRedactionConfig($var) } /** - * Optional. Default Speech-to-Text resources to be used while ingesting audio - * files. Optional, CCAI Insights will create a default if not provided. + * Optional. Default Speech-to-Text resources to use while ingesting audio + * files. Optional, CCAI Insights will create a default if not provided. This + * applies to conversations ingested from the `UploadConversation` and + * `IngestConversations` endpoints, including conversations coming from CCAI + * Platform. * * Generated from protobuf field .google.cloud.contactcenterinsights.v1.SpeechConfig speech_config = 11 [(.google.api.field_behavior) = OPTIONAL]; * @return \Google\Cloud\ContactCenterInsights\V1\SpeechConfig|null @@ -460,8 +494,11 @@ public function clearSpeechConfig() } /** - * Optional. Default Speech-to-Text resources to be used while ingesting audio - * files. Optional, CCAI Insights will create a default if not provided. + * Optional. Default Speech-to-Text resources to use while ingesting audio + * files. Optional, CCAI Insights will create a default if not provided. This + * applies to conversations ingested from the `UploadConversation` and + * `IngestConversations` endpoints, including conversations coming from CCAI + * Platform. * * Generated from protobuf field .google.cloud.contactcenterinsights.v1.SpeechConfig speech_config = 11 [(.google.api.field_behavior) = OPTIONAL]; * @param \Google\Cloud\ContactCenterInsights\V1\SpeechConfig $var diff --git a/ContactCenterInsights/src/V1/SpeechConfig.php b/ContactCenterInsights/src/V1/SpeechConfig.php index 26829b4fdee5..714218e8fcc2 100644 --- a/ContactCenterInsights/src/V1/SpeechConfig.php +++ b/ContactCenterInsights/src/V1/SpeechConfig.php @@ -10,6 +10,10 @@ /** * Speech-to-Text configuration. + * Speech-to-Text settings are applied to conversations ingested from the + * `UploadConversation` and `IngestConversations` endpoints, including + * conversation coming from CCAI Platform. They are not applied to conversations + * ingested from the `CreateConversation` endpoint. * * Generated from protobuf message google.cloud.contactcenterinsights.v1.SpeechConfig */ diff --git a/ContactCenterInsights/src/V1/UpdateConversationRequest.php b/ContactCenterInsights/src/V1/UpdateConversationRequest.php index 454731ba405c..94c6827f7a67 100644 --- a/ContactCenterInsights/src/V1/UpdateConversationRequest.php +++ b/ContactCenterInsights/src/V1/UpdateConversationRequest.php @@ -22,7 +22,19 @@ class UpdateConversationRequest extends \Google\Protobuf\Internal\Message */ protected $conversation = null; /** - * The list of fields to be updated. + * The list of fields to be updated. All possible fields can be updated by + * passing `*`, or a subset of the following updateable fields can be + * provided: + * * `agent_id` + * * `language_code` + * * `labels` + * * `metadata` + * * `quality_metadata` + * * `call_metadata` + * * `start_time` + * * `expire_time` or `ttl` + * * `data_source.gcs_source.audio_uri` or + * `data_source.dialogflow_source.audio_uri` * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; */ @@ -30,7 +42,20 @@ class UpdateConversationRequest extends \Google\Protobuf\Internal\Message /** * @param \Google\Cloud\ContactCenterInsights\V1\Conversation $conversation Required. The new values for the conversation. - * @param \Google\Protobuf\FieldMask $updateMask The list of fields to be updated. + * @param \Google\Protobuf\FieldMask $updateMask The list of fields to be updated. All possible fields can be updated by + * passing `*`, or a subset of the following updateable fields can be + * provided: + * + * * `agent_id` + * * `language_code` + * * `labels` + * * `metadata` + * * `quality_metadata` + * * `call_metadata` + * * `start_time` + * * `expire_time` or `ttl` + * * `data_source.gcs_source.audio_uri` or + * `data_source.dialogflow_source.audio_uri` * * @return \Google\Cloud\ContactCenterInsights\V1\UpdateConversationRequest * @@ -52,7 +77,19 @@ public static function build(\Google\Cloud\ContactCenterInsights\V1\Conversation * @type \Google\Cloud\ContactCenterInsights\V1\Conversation $conversation * Required. The new values for the conversation. * @type \Google\Protobuf\FieldMask $update_mask - * The list of fields to be updated. + * The list of fields to be updated. All possible fields can be updated by + * passing `*`, or a subset of the following updateable fields can be + * provided: + * * `agent_id` + * * `language_code` + * * `labels` + * * `metadata` + * * `quality_metadata` + * * `call_metadata` + * * `start_time` + * * `expire_time` or `ttl` + * * `data_source.gcs_source.audio_uri` or + * `data_source.dialogflow_source.audio_uri` * } */ public function __construct($data = NULL) { @@ -97,7 +134,19 @@ public function setConversation($var) } /** - * The list of fields to be updated. + * The list of fields to be updated. All possible fields can be updated by + * passing `*`, or a subset of the following updateable fields can be + * provided: + * * `agent_id` + * * `language_code` + * * `labels` + * * `metadata` + * * `quality_metadata` + * * `call_metadata` + * * `start_time` + * * `expire_time` or `ttl` + * * `data_source.gcs_source.audio_uri` or + * `data_source.dialogflow_source.audio_uri` * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; * @return \Google\Protobuf\FieldMask|null @@ -118,7 +167,19 @@ public function clearUpdateMask() } /** - * The list of fields to be updated. + * The list of fields to be updated. All possible fields can be updated by + * passing `*`, or a subset of the following updateable fields can be + * provided: + * * `agent_id` + * * `language_code` + * * `labels` + * * `metadata` + * * `quality_metadata` + * * `call_metadata` + * * `start_time` + * * `expire_time` or `ttl` + * * `data_source.gcs_source.audio_uri` or + * `data_source.dialogflow_source.audio_uri` * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; * @param \Google\Protobuf\FieldMask $var diff --git a/ContactCenterInsights/src/V1/UploadConversationMetadata.php b/ContactCenterInsights/src/V1/UploadConversationMetadata.php index 3d20791c0681..b893a1d41d46 100644 --- a/ContactCenterInsights/src/V1/UploadConversationMetadata.php +++ b/ContactCenterInsights/src/V1/UploadConversationMetadata.php @@ -9,7 +9,7 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The metadata for an UploadConversation operation. + * The metadata for an `UploadConversation` operation. * * Generated from protobuf message google.cloud.contactcenterinsights.v1.UploadConversationMetadata */ diff --git a/ContactCenterInsights/src/V1/gapic_metadata.json b/ContactCenterInsights/src/V1/gapic_metadata.json index 66263ef3f61f..a1bab090cfad 100644 --- a/ContactCenterInsights/src/V1/gapic_metadata.json +++ b/ContactCenterInsights/src/V1/gapic_metadata.json @@ -95,6 +95,11 @@ "exportInsightsData" ] }, + "ExportIssueModel": { + "methods": [ + "exportIssueModel" + ] + }, "GetAnalysis": { "methods": [ "getAnalysis" @@ -105,6 +110,11 @@ "getConversation" ] }, + "GetEncryptionSpec": { + "methods": [ + "getEncryptionSpec" + ] + }, "GetIssue": { "methods": [ "getIssue" @@ -130,11 +140,21 @@ "getView" ] }, + "ImportIssueModel": { + "methods": [ + "importIssueModel" + ] + }, "IngestConversations": { "methods": [ "ingestConversations" ] }, + "InitializeEncryptionSpec": { + "methods": [ + "initializeEncryptionSpec" + ] + }, "ListAnalyses": { "methods": [ "listAnalyses" diff --git a/ContactCenterInsights/src/V1/resources/contact_center_insights_client_config.json b/ContactCenterInsights/src/V1/resources/contact_center_insights_client_config.json index 38c4895e8611..4f2e84193db6 100644 --- a/ContactCenterInsights/src/V1/resources/contact_center_insights_client_config.json +++ b/ContactCenterInsights/src/V1/resources/contact_center_insights_client_config.json @@ -113,6 +113,11 @@ "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "ExportIssueModel": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "GetAnalysis": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", @@ -123,6 +128,11 @@ "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "GetEncryptionSpec": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "GetIssue": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", @@ -148,11 +158,21 @@ "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "ImportIssueModel": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "IngestConversations": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "InitializeEncryptionSpec": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "ListAnalyses": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", diff --git a/ContactCenterInsights/src/V1/resources/contact_center_insights_descriptor_config.php b/ContactCenterInsights/src/V1/resources/contact_center_insights_descriptor_config.php index aa0bfa54c9d4..b529d00be28f 100644 --- a/ContactCenterInsights/src/V1/resources/contact_center_insights_descriptor_config.php +++ b/ContactCenterInsights/src/V1/resources/contact_center_insights_descriptor_config.php @@ -156,6 +156,44 @@ ], ], ], + 'ExportIssueModel' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ContactCenterInsights\V1\ExportIssueModelResponse', + 'metadataReturnType' => '\Google\Cloud\ContactCenterInsights\V1\ExportIssueModelMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ImportIssueModel' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ContactCenterInsights\V1\ImportIssueModelResponse', + 'metadataReturnType' => '\Google\Cloud\ContactCenterInsights\V1\ImportIssueModelMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'IngestConversations' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Cloud\ContactCenterInsights\V1\IngestConversationsResponse', @@ -175,6 +213,26 @@ ], ], ], + 'InitializeEncryptionSpec' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ContactCenterInsights\V1\InitializeEncryptionSpecResponse', + 'metadataReturnType' => '\Google\Cloud\ContactCenterInsights\V1\InitializeEncryptionSpecMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'encryption_spec.name', + 'fieldAccessors' => [ + 'getEncryptionSpec', + 'getName', + ], + ], + ], + ], 'UndeployIssueModel' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Cloud\ContactCenterInsights\V1\UndeployIssueModelResponse', @@ -357,6 +415,18 @@ ], ], ], + 'GetEncryptionSpec' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ContactCenterInsights\V1\EncryptionSpec', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'GetIssue' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\ContactCenterInsights\V1\Issue', @@ -603,6 +673,7 @@ 'analysis' => 'projects/{project}/locations/{location}/conversations/{conversation}/analyses/{analysis}', 'conversation' => 'projects/{project}/locations/{location}/conversations/{conversation}', 'conversationProfile' => 'projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}', + 'encryptionSpec' => 'projects/{project}/locations/{location}/encryptionSpec', 'issue' => 'projects/{project}/locations/{location}/issueModels/{issue_model}/issues/{issue}', 'issueModel' => 'projects/{project}/locations/{location}/issueModels/{issue_model}', 'location' => 'projects/{project}/locations/{location}', diff --git a/ContactCenterInsights/src/V1/resources/contact_center_insights_rest_client_config.php b/ContactCenterInsights/src/V1/resources/contact_center_insights_rest_client_config.php index 1da13d22d3a7..a3735d966ff5 100644 --- a/ContactCenterInsights/src/V1/resources/contact_center_insights_rest_client_config.php +++ b/ContactCenterInsights/src/V1/resources/contact_center_insights_rest_client_config.php @@ -219,6 +219,18 @@ ], ], ], + 'ExportIssueModel' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/issueModels/*}:export', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetAnalysis' => [ 'method' => 'get', 'uriTemplate' => '/v1/{name=projects/*/locations/*/conversations/*/analyses/*}', @@ -241,6 +253,17 @@ ], ], ], + 'GetEncryptionSpec' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/encryptionSpec}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetIssue' => [ 'method' => 'get', 'uriTemplate' => '/v1/{name=projects/*/locations/*/issueModels/*/issues/*}', @@ -296,6 +319,18 @@ ], ], ], + 'ImportIssueModel' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/issueModels:import', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'IngestConversations' => [ 'method' => 'post', 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/conversations:ingest', @@ -308,6 +343,19 @@ ], ], ], + 'InitializeEncryptionSpec' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{encryption_spec.name=projects/*/locations/*/encryptionSpec}:initialize', + 'body' => '*', + 'placeholders' => [ + 'encryption_spec.name' => [ + 'getters' => [ + 'getEncryptionSpec', + 'getName', + ], + ], + ], + ], 'ListAnalyses' => [ 'method' => 'get', 'uriTemplate' => '/v1/{parent=projects/*/locations/*/conversations/*}/analyses', diff --git a/ContactCenterInsights/tests/Unit/V1/Client/ContactCenterInsightsClientTest.php b/ContactCenterInsights/tests/Unit/V1/Client/ContactCenterInsightsClientTest.php index 3d50510bcf7a..bfce002f77dd 100644 --- a/ContactCenterInsights/tests/Unit/V1/Client/ContactCenterInsightsClientTest.php +++ b/ContactCenterInsights/tests/Unit/V1/Client/ContactCenterInsightsClientTest.php @@ -50,17 +50,25 @@ use Google\Cloud\ContactCenterInsights\V1\DeleteViewRequest; use Google\Cloud\ContactCenterInsights\V1\DeployIssueModelRequest; use Google\Cloud\ContactCenterInsights\V1\DeployIssueModelResponse; +use Google\Cloud\ContactCenterInsights\V1\EncryptionSpec; use Google\Cloud\ContactCenterInsights\V1\ExportInsightsDataRequest; use Google\Cloud\ContactCenterInsights\V1\ExportInsightsDataResponse; +use Google\Cloud\ContactCenterInsights\V1\ExportIssueModelRequest; +use Google\Cloud\ContactCenterInsights\V1\ExportIssueModelResponse; use Google\Cloud\ContactCenterInsights\V1\GetAnalysisRequest; use Google\Cloud\ContactCenterInsights\V1\GetConversationRequest; +use Google\Cloud\ContactCenterInsights\V1\GetEncryptionSpecRequest; use Google\Cloud\ContactCenterInsights\V1\GetIssueModelRequest; use Google\Cloud\ContactCenterInsights\V1\GetIssueRequest; use Google\Cloud\ContactCenterInsights\V1\GetPhraseMatcherRequest; use Google\Cloud\ContactCenterInsights\V1\GetSettingsRequest; use Google\Cloud\ContactCenterInsights\V1\GetViewRequest; +use Google\Cloud\ContactCenterInsights\V1\ImportIssueModelRequest; +use Google\Cloud\ContactCenterInsights\V1\ImportIssueModelResponse; use Google\Cloud\ContactCenterInsights\V1\IngestConversationsRequest; use Google\Cloud\ContactCenterInsights\V1\IngestConversationsResponse; +use Google\Cloud\ContactCenterInsights\V1\InitializeEncryptionSpecRequest; +use Google\Cloud\ContactCenterInsights\V1\InitializeEncryptionSpecResponse; use Google\Cloud\ContactCenterInsights\V1\Issue; use Google\Cloud\ContactCenterInsights\V1\IssueModel; use Google\Cloud\ContactCenterInsights\V1\ListAnalysesRequest; @@ -674,12 +682,14 @@ public function createConversationTest() $name = 'name3373707'; $languageCode = 'languageCode-412800396'; $agentId = 'agentId1469158549'; + $metadataJson = 'metadataJson-2002268168'; $turnCount = 428155597; $obfuscatedUserId = 'obfuscatedUserId-227848300'; $expectedResponse = new Conversation(); $expectedResponse->setName($name); $expectedResponse->setLanguageCode($languageCode); $expectedResponse->setAgentId($agentId); + $expectedResponse->setMetadataJson($metadataJson); $expectedResponse->setTurnCount($turnCount); $expectedResponse->setObfuscatedUserId($obfuscatedUserId); $transport->addResponse($expectedResponse); @@ -1730,6 +1740,131 @@ public function exportInsightsDataExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); } + /** @test */ + public function exportIssueModelTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/exportIssueModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new ExportIssueModelResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/exportIssueModelTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->issueModelName('[PROJECT]', '[LOCATION]', '[ISSUE_MODEL]'); + $request = (new ExportIssueModelRequest())->setName($formattedName); + $response = $gapicClient->exportIssueModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/ExportIssueModel', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/exportIssueModelTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function exportIssueModelExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/exportIssueModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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 + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->issueModelName('[PROJECT]', '[LOCATION]', '[ISSUE_MODEL]'); + $request = (new ExportIssueModelRequest())->setName($formattedName); + $response = $gapicClient->exportIssueModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/exportIssueModelTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + /** @test */ public function getAnalysisTest() { @@ -1807,12 +1942,14 @@ public function getConversationTest() $name2 = 'name2-1052831874'; $languageCode = 'languageCode-412800396'; $agentId = 'agentId1469158549'; + $metadataJson = 'metadataJson-2002268168'; $turnCount = 428155597; $obfuscatedUserId = 'obfuscatedUserId-227848300'; $expectedResponse = new Conversation(); $expectedResponse->setName($name2); $expectedResponse->setLanguageCode($languageCode); $expectedResponse->setAgentId($agentId); + $expectedResponse->setMetadataJson($metadataJson); $expectedResponse->setTurnCount($turnCount); $expectedResponse->setObfuscatedUserId($obfuscatedUserId); $transport->addResponse($expectedResponse); @@ -1871,6 +2008,76 @@ public function getConversationExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function getEncryptionSpecTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $kmsKey = 'kmsKey-591635343'; + $expectedResponse = new EncryptionSpec(); + $expectedResponse->setName($name2); + $expectedResponse->setKmsKey($kmsKey); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->encryptionSpecName('[PROJECT]', '[LOCATION]'); + $request = (new GetEncryptionSpecRequest())->setName($formattedName); + $response = $gapicClient->getEncryptionSpec($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.contactcenterinsights.v1.ContactCenterInsights/GetEncryptionSpec', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEncryptionSpecExceptionTest() + { + $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 + $formattedName = $gapicClient->encryptionSpecName('[PROJECT]', '[LOCATION]'); + $request = (new GetEncryptionSpecRequest())->setName($formattedName); + try { + $gapicClient->getEncryptionSpec($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 getIssueTest() { @@ -1882,9 +2089,11 @@ public function getIssueTest() // Mock response $name2 = 'name2-1052831874'; $displayName = 'displayName1615086568'; + $displayDescription = 'displayDescription-1876039681'; $expectedResponse = new Issue(); $expectedResponse->setName($name2); $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDisplayDescription($displayDescription); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->issueName('[PROJECT]', '[LOCATION]', '[ISSUE_MODEL]', '[ISSUE]'); @@ -2224,6 +2433,131 @@ public function getViewExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function importIssueModelTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/importIssueModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new ImportIssueModelResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/importIssueModelTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ImportIssueModelRequest())->setParent($formattedParent); + $response = $gapicClient->importIssueModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/ImportIssueModel', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importIssueModelTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function importIssueModelExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/importIssueModelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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 + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ImportIssueModelRequest())->setParent($formattedParent); + $response = $gapicClient->importIssueModel($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importIssueModelTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + /** @test */ public function ingestConversationsTest() { @@ -2349,6 +2683,135 @@ public function ingestConversationsExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); } + /** @test */ + public function initializeEncryptionSpecTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/initializeEncryptionSpecTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new InitializeEncryptionSpecResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/initializeEncryptionSpecTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $encryptionSpec = new EncryptionSpec(); + $encryptionSpecKmsKey = 'encryptionSpecKmsKey627607756'; + $encryptionSpec->setKmsKey($encryptionSpecKmsKey); + $request = (new InitializeEncryptionSpecRequest())->setEncryptionSpec($encryptionSpec); + $response = $gapicClient->initializeEncryptionSpec($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.contactcenterinsights.v1.ContactCenterInsights/InitializeEncryptionSpec', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getEncryptionSpec(); + $this->assertProtobufEquals($encryptionSpec, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/initializeEncryptionSpecTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function initializeEncryptionSpecExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/initializeEncryptionSpecTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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 + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $encryptionSpec = new EncryptionSpec(); + $encryptionSpecKmsKey = 'encryptionSpecKmsKey627607756'; + $encryptionSpec->setKmsKey($encryptionSpecKmsKey); + $request = (new InitializeEncryptionSpecRequest())->setEncryptionSpec($encryptionSpec); + $response = $gapicClient->initializeEncryptionSpec($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/initializeEncryptionSpecTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + /** @test */ public function listAnalysesTest() { @@ -2905,12 +3368,14 @@ public function updateConversationTest() $name = 'name3373707'; $languageCode = 'languageCode-412800396'; $agentId = 'agentId1469158549'; + $metadataJson = 'metadataJson-2002268168'; $turnCount = 428155597; $obfuscatedUserId = 'obfuscatedUserId-227848300'; $expectedResponse = new Conversation(); $expectedResponse->setName($name); $expectedResponse->setLanguageCode($languageCode); $expectedResponse->setAgentId($agentId); + $expectedResponse->setMetadataJson($metadataJson); $expectedResponse->setTurnCount($turnCount); $expectedResponse->setObfuscatedUserId($obfuscatedUserId); $transport->addResponse($expectedResponse); @@ -2980,9 +3445,11 @@ public function updateIssueTest() // Mock response $name = 'name3373707'; $displayName = 'displayName1615086568'; + $displayDescription = 'displayDescription-1876039681'; $expectedResponse = new Issue(); $expectedResponse->setName($name); $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDisplayDescription($displayDescription); $transport->addResponse($expectedResponse); // Mock request $issue = new Issue(); @@ -3357,12 +3824,14 @@ public function uploadConversationTest() $name = 'name3373707'; $languageCode = 'languageCode-412800396'; $agentId = 'agentId1469158549'; + $metadataJson = 'metadataJson-2002268168'; $turnCount = 428155597; $obfuscatedUserId = 'obfuscatedUserId-227848300'; $expectedResponse = new Conversation(); $expectedResponse->setName($name); $expectedResponse->setLanguageCode($languageCode); $expectedResponse->setAgentId($agentId); + $expectedResponse->setMetadataJson($metadataJson); $expectedResponse->setTurnCount($turnCount); $expectedResponse->setObfuscatedUserId($obfuscatedUserId); $anyResponse = new Any(); From ce39c2ef70b75bda13fde63335fd6810480d606d Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 11:13:49 -0700 Subject: [PATCH 02/34] feat: Add low latency journey option to proto (#7740) feat: Add CustomPronunciationParams for upcoming feature work PiperOrigin-RevId: 684229364 Source-Link: https://github.com/googleapis/googleapis/commit/10b8dc3b54c9a609dcfda8060b8c4c734a942e8c Source-Link: https://github.com/googleapis/googleapis-gen/commit/deaa9f319f1c6c19a9d36ea233ae307566b60c09 Copy-Tag: eyJwIjoiVGV4dFRvU3BlZWNoLy5Pd2xCb3QueWFtbCIsImgiOiJkZWFhOWYzMTlmMWM2YzE5YTlkMzZlYTIzM2FlMzA3NTY2YjYwYzA5In0= --- TextToSpeech/metadata/V1/CloudTts.php | Bin 3799 -> 4560 bytes TextToSpeech/src/V1/AdvancedVoiceOptions.php | 81 ++++++++ .../src/V1/CustomPronunciationParams.php | 177 ++++++++++++++++++ .../PhoneticEncoding.php | 66 +++++++ TextToSpeech/src/V1/CustomPronunciations.php | 67 +++++++ .../src/V1/Gapic/TextToSpeechGapicClient.php | 9 + TextToSpeech/src/V1/SynthesisInput.php | 80 ++++++++ .../src/V1/SynthesizeSpeechRequest.php | 44 +++++ 8 files changed, 524 insertions(+) create mode 100644 TextToSpeech/src/V1/AdvancedVoiceOptions.php create mode 100644 TextToSpeech/src/V1/CustomPronunciationParams.php create mode 100644 TextToSpeech/src/V1/CustomPronunciationParams/PhoneticEncoding.php create mode 100644 TextToSpeech/src/V1/CustomPronunciations.php diff --git a/TextToSpeech/metadata/V1/CloudTts.php b/TextToSpeech/metadata/V1/CloudTts.php index a86c3cb37db2dccc4318e238459be291e9ab8c95..3125c7df3ed56a36b203843004a7237903f7e3ab 100644 GIT binary patch delta 690 zcmaJ;%SyvQ6m`;8?G;NMtEOtCrY?#U5jU=r8ch(}fY03!(r6-frgT!Jxad;1S`a@& z@DKC{+zEo9OSgW3=|gC>y1Q`hx#ym9o~5Vs-GdN*lpuSxnZ5rME|6PkA*MoEQKkqG>9iG;q=_rT* zPs3=rTU-nU@kDhYz+?vTpCmjFlBpN++K!PUT0U1;Gx8f`H@|IaIb+?>>TB@$r zJBF#m5tbnN8#*A{%2ogiY7~Y@+q9Yh9E?A#s&R;so`2;dNOXBle}~9%0b)Iy&E`Xy vk(JdTrr9paH=`Z9e2W@~k>we@2NQOyn_fLGhMI-<>y4|SHwE3_M3m?k9Sh^o delta 45 zcmV+|0Mh@^Bi9|U!U6=!7YZzqODwbU0*3(t=>e1B1nC4KKnf0%`wJeECkPO;j|f2t Dhyf3l diff --git a/TextToSpeech/src/V1/AdvancedVoiceOptions.php b/TextToSpeech/src/V1/AdvancedVoiceOptions.php new file mode 100644 index 000000000000..ed664e1ba685 --- /dev/null +++ b/TextToSpeech/src/V1/AdvancedVoiceOptions.php @@ -0,0 +1,81 @@ +google.cloud.texttospeech.v1.AdvancedVoiceOptions + */ +class AdvancedVoiceOptions extends \Google\Protobuf\Internal\Message +{ + /** + * Only for Journey voices. If false, the synthesis will be context aware + * and have higher latency. + * + * Generated from protobuf field optional bool low_latency_journey_synthesis = 1; + */ + private $low_latency_journey_synthesis = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $low_latency_journey_synthesis + * Only for Journey voices. If false, the synthesis will be context aware + * and have higher latency. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Only for Journey voices. If false, the synthesis will be context aware + * and have higher latency. + * + * Generated from protobuf field optional bool low_latency_journey_synthesis = 1; + * @return bool + */ + public function getLowLatencyJourneySynthesis() + { + return isset($this->low_latency_journey_synthesis) ? $this->low_latency_journey_synthesis : false; + } + + public function hasLowLatencyJourneySynthesis() + { + return isset($this->low_latency_journey_synthesis); + } + + public function clearLowLatencyJourneySynthesis() + { + unset($this->low_latency_journey_synthesis); + } + + /** + * Only for Journey voices. If false, the synthesis will be context aware + * and have higher latency. + * + * Generated from protobuf field optional bool low_latency_journey_synthesis = 1; + * @param bool $var + * @return $this + */ + public function setLowLatencyJourneySynthesis($var) + { + GPBUtil::checkBool($var); + $this->low_latency_journey_synthesis = $var; + + return $this; + } + +} + diff --git a/TextToSpeech/src/V1/CustomPronunciationParams.php b/TextToSpeech/src/V1/CustomPronunciationParams.php new file mode 100644 index 000000000000..b7ae33a3dadf --- /dev/null +++ b/TextToSpeech/src/V1/CustomPronunciationParams.php @@ -0,0 +1,177 @@ +google.cloud.texttospeech.v1.CustomPronunciationParams + */ +class CustomPronunciationParams extends \Google\Protobuf\Internal\Message +{ + /** + * The phrase to which the customization will be applied. + * The phrase can be multiple words (in the case of proper nouns etc), but + * should not span to a whole sentence. + * + * Generated from protobuf field optional string phrase = 1; + */ + private $phrase = null; + /** + * The phonetic encoding of the phrase. + * + * Generated from protobuf field optional .google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncoding phonetic_encoding = 2; + */ + private $phonetic_encoding = null; + /** + * The pronunciation of the phrase. This must be in the phonetic encoding + * specified above. + * + * Generated from protobuf field optional string pronunciation = 3; + */ + private $pronunciation = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $phrase + * The phrase to which the customization will be applied. + * The phrase can be multiple words (in the case of proper nouns etc), but + * should not span to a whole sentence. + * @type int $phonetic_encoding + * The phonetic encoding of the phrase. + * @type string $pronunciation + * The pronunciation of the phrase. This must be in the phonetic encoding + * specified above. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * The phrase to which the customization will be applied. + * The phrase can be multiple words (in the case of proper nouns etc), but + * should not span to a whole sentence. + * + * Generated from protobuf field optional string phrase = 1; + * @return string + */ + public function getPhrase() + { + return isset($this->phrase) ? $this->phrase : ''; + } + + public function hasPhrase() + { + return isset($this->phrase); + } + + public function clearPhrase() + { + unset($this->phrase); + } + + /** + * The phrase to which the customization will be applied. + * The phrase can be multiple words (in the case of proper nouns etc), but + * should not span to a whole sentence. + * + * Generated from protobuf field optional string phrase = 1; + * @param string $var + * @return $this + */ + public function setPhrase($var) + { + GPBUtil::checkString($var, True); + $this->phrase = $var; + + return $this; + } + + /** + * The phonetic encoding of the phrase. + * + * Generated from protobuf field optional .google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncoding phonetic_encoding = 2; + * @return int + */ + public function getPhoneticEncoding() + { + return isset($this->phonetic_encoding) ? $this->phonetic_encoding : 0; + } + + public function hasPhoneticEncoding() + { + return isset($this->phonetic_encoding); + } + + public function clearPhoneticEncoding() + { + unset($this->phonetic_encoding); + } + + /** + * The phonetic encoding of the phrase. + * + * Generated from protobuf field optional .google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncoding phonetic_encoding = 2; + * @param int $var + * @return $this + */ + public function setPhoneticEncoding($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\TextToSpeech\V1\CustomPronunciationParams\PhoneticEncoding::class); + $this->phonetic_encoding = $var; + + return $this; + } + + /** + * The pronunciation of the phrase. This must be in the phonetic encoding + * specified above. + * + * Generated from protobuf field optional string pronunciation = 3; + * @return string + */ + public function getPronunciation() + { + return isset($this->pronunciation) ? $this->pronunciation : ''; + } + + public function hasPronunciation() + { + return isset($this->pronunciation); + } + + public function clearPronunciation() + { + unset($this->pronunciation); + } + + /** + * The pronunciation of the phrase. This must be in the phonetic encoding + * specified above. + * + * Generated from protobuf field optional string pronunciation = 3; + * @param string $var + * @return $this + */ + public function setPronunciation($var) + { + GPBUtil::checkString($var, True); + $this->pronunciation = $var; + + return $this; + } + +} + diff --git a/TextToSpeech/src/V1/CustomPronunciationParams/PhoneticEncoding.php b/TextToSpeech/src/V1/CustomPronunciationParams/PhoneticEncoding.php new file mode 100644 index 000000000000..d7631a1efee4 --- /dev/null +++ b/TextToSpeech/src/V1/CustomPronunciationParams/PhoneticEncoding.php @@ -0,0 +1,66 @@ +google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncoding + */ +class PhoneticEncoding +{ + /** + * Not specified. + * + * Generated from protobuf enum PHONETIC_ENCODING_UNSPECIFIED = 0; + */ + const PHONETIC_ENCODING_UNSPECIFIED = 0; + /** + * IPA. (e.g. apple -> ˈæpəl ) + * https://en.wikipedia.org/wiki/International_Phonetic_Alphabet + * + * Generated from protobuf enum PHONETIC_ENCODING_IPA = 1; + */ + const PHONETIC_ENCODING_IPA = 1; + /** + * X-SAMPA (e.g. apple -> "{p@l" ) + * https://en.wikipedia.org/wiki/X-SAMPA + * + * Generated from protobuf enum PHONETIC_ENCODING_X_SAMPA = 2; + */ + const PHONETIC_ENCODING_X_SAMPA = 2; + + private static $valueToName = [ + self::PHONETIC_ENCODING_UNSPECIFIED => 'PHONETIC_ENCODING_UNSPECIFIED', + self::PHONETIC_ENCODING_IPA => 'PHONETIC_ENCODING_IPA', + self::PHONETIC_ENCODING_X_SAMPA => 'PHONETIC_ENCODING_X_SAMPA', + ]; + + 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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PhoneticEncoding::class, \Google\Cloud\TextToSpeech\V1\CustomPronunciationParams_PhoneticEncoding::class); + diff --git a/TextToSpeech/src/V1/CustomPronunciations.php b/TextToSpeech/src/V1/CustomPronunciations.php new file mode 100644 index 000000000000..fffc75dae4d1 --- /dev/null +++ b/TextToSpeech/src/V1/CustomPronunciations.php @@ -0,0 +1,67 @@ +google.cloud.texttospeech.v1.CustomPronunciations + */ +class CustomPronunciations extends \Google\Protobuf\Internal\Message +{ + /** + * The pronunciation customizations to be applied. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.CustomPronunciationParams pronunciations = 1; + */ + private $pronunciations; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\TextToSpeech\V1\CustomPronunciationParams>|\Google\Protobuf\Internal\RepeatedField $pronunciations + * The pronunciation customizations to be applied. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * The pronunciation customizations to be applied. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.CustomPronunciationParams pronunciations = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPronunciations() + { + return $this->pronunciations; + } + + /** + * The pronunciation customizations to be applied. + * + * Generated from protobuf field repeated .google.cloud.texttospeech.v1.CustomPronunciationParams pronunciations = 1; + * @param array<\Google\Cloud\TextToSpeech\V1\CustomPronunciationParams>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPronunciations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\TextToSpeech\V1\CustomPronunciationParams::class); + $this->pronunciations = $arr; + + return $this; + } + +} + diff --git a/TextToSpeech/src/V1/Gapic/TextToSpeechGapicClient.php b/TextToSpeech/src/V1/Gapic/TextToSpeechGapicClient.php index ec3eccecb963..04752180f014 100644 --- a/TextToSpeech/src/V1/Gapic/TextToSpeechGapicClient.php +++ b/TextToSpeech/src/V1/Gapic/TextToSpeechGapicClient.php @@ -33,6 +33,7 @@ use Google\ApiCore\Transport\TransportInterface; use Google\ApiCore\ValidationException; use Google\Auth\FetchAuthTokenInterface; +use Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions; use Google\Cloud\TextToSpeech\V1\AudioConfig; use Google\Cloud\TextToSpeech\V1\ListVoicesRequest; use Google\Cloud\TextToSpeech\V1\ListVoicesResponse; @@ -407,6 +408,8 @@ public function streamingSynthesize(array $optionalArgs = []) * @param array $optionalArgs { * Optional. * + * @type AdvancedVoiceOptions $advancedVoiceOptions + * Advanced voice options. * @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 @@ -427,6 +430,12 @@ public function synthesizeSpeech( $request->setInput($input); $request->setVoice($voice); $request->setAudioConfig($audioConfig); + if (isset($optionalArgs['advancedVoiceOptions'])) { + $request->setAdvancedVoiceOptions( + $optionalArgs['advancedVoiceOptions'] + ); + } + return $this->startCall( 'SynthesizeSpeech', SynthesizeSpeechResponse::class, diff --git a/TextToSpeech/src/V1/SynthesisInput.php b/TextToSpeech/src/V1/SynthesisInput.php index 4e8f0065c3c2..8c54e52eaaff 100644 --- a/TextToSpeech/src/V1/SynthesisInput.php +++ b/TextToSpeech/src/V1/SynthesisInput.php @@ -18,6 +18,21 @@ */ class SynthesisInput extends \Google\Protobuf\Internal\Message { + /** + * Optional. The pronunciation customizations to be applied to the input. If + * this is set, the input will be synthesized using the given pronunciation + * customizations. + * The initial support will be for EFIGS (English, French, + * Italian, German, Spanish) languages, as provided in + * VoiceSelectionParams. Journey and Instant Clone voices are + * not supported yet. + * In order to customize the pronunciation of a phrase, there must be an exact + * match of the phrase in the input types. If using SSML, the phrase must not + * be inside a phoneme tag (entirely or partially). + * + * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $custom_pronunciations = null; protected $input_source; /** @@ -34,6 +49,17 @@ class SynthesisInput extends \Google\Protobuf\Internal\Message * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. For * more information, see * [SSML](https://cloud.google.com/text-to-speech/docs/ssml). + * @type \Google\Cloud\TextToSpeech\V1\CustomPronunciations $custom_pronunciations + * Optional. The pronunciation customizations to be applied to the input. If + * this is set, the input will be synthesized using the given pronunciation + * customizations. + * The initial support will be for EFIGS (English, French, + * Italian, German, Spanish) languages, as provided in + * VoiceSelectionParams. Journey and Instant Clone voices are + * not supported yet. + * In order to customize the pronunciation of a phrase, there must be an exact + * match of the phrase in the input types. If using SSML, the phrase must not + * be inside a phoneme tag (entirely or partially). * } */ public function __construct($data = NULL) { @@ -111,6 +137,60 @@ public function setSsml($var) return $this; } + /** + * Optional. The pronunciation customizations to be applied to the input. If + * this is set, the input will be synthesized using the given pronunciation + * customizations. + * The initial support will be for EFIGS (English, French, + * Italian, German, Spanish) languages, as provided in + * VoiceSelectionParams. Journey and Instant Clone voices are + * not supported yet. + * In order to customize the pronunciation of a phrase, there must be an exact + * match of the phrase in the input types. If using SSML, the phrase must not + * be inside a phoneme tag (entirely or partially). + * + * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\TextToSpeech\V1\CustomPronunciations|null + */ + public function getCustomPronunciations() + { + return $this->custom_pronunciations; + } + + public function hasCustomPronunciations() + { + return isset($this->custom_pronunciations); + } + + public function clearCustomPronunciations() + { + unset($this->custom_pronunciations); + } + + /** + * Optional. The pronunciation customizations to be applied to the input. If + * this is set, the input will be synthesized using the given pronunciation + * customizations. + * The initial support will be for EFIGS (English, French, + * Italian, German, Spanish) languages, as provided in + * VoiceSelectionParams. Journey and Instant Clone voices are + * not supported yet. + * In order to customize the pronunciation of a phrase, there must be an exact + * match of the phrase in the input types. If using SSML, the phrase must not + * be inside a phoneme tag (entirely or partially). + * + * Generated from protobuf field .google.cloud.texttospeech.v1.CustomPronunciations custom_pronunciations = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\TextToSpeech\V1\CustomPronunciations $var + * @return $this + */ + public function setCustomPronunciations($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\CustomPronunciations::class); + $this->custom_pronunciations = $var; + + return $this; + } + /** * @return string */ diff --git a/TextToSpeech/src/V1/SynthesizeSpeechRequest.php b/TextToSpeech/src/V1/SynthesizeSpeechRequest.php index b9e1a310aea4..706d3b0e9cb4 100644 --- a/TextToSpeech/src/V1/SynthesizeSpeechRequest.php +++ b/TextToSpeech/src/V1/SynthesizeSpeechRequest.php @@ -33,6 +33,12 @@ class SynthesizeSpeechRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.texttospeech.v1.AudioConfig audio_config = 3 [(.google.api.field_behavior) = REQUIRED]; */ private $audio_config = null; + /** + * Advanced voice options. + * + * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 8; + */ + private $advanced_voice_options = null; /** * @param \Google\Cloud\TextToSpeech\V1\SynthesisInput $input Required. The Synthesizer requires either plain text or SSML as input. @@ -63,6 +69,8 @@ public static function build(\Google\Cloud\TextToSpeech\V1\SynthesisInput $input * Required. The desired voice of the synthesized audio. * @type \Google\Cloud\TextToSpeech\V1\AudioConfig $audio_config * Required. The configuration of the synthesized audio. + * @type \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions $advanced_voice_options + * Advanced voice options. * } */ public function __construct($data = NULL) { @@ -178,5 +186,41 @@ public function setAudioConfig($var) return $this; } + /** + * Advanced voice options. + * + * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 8; + * @return \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions|null + */ + public function getAdvancedVoiceOptions() + { + return $this->advanced_voice_options; + } + + public function hasAdvancedVoiceOptions() + { + return isset($this->advanced_voice_options); + } + + public function clearAdvancedVoiceOptions() + { + unset($this->advanced_voice_options); + } + + /** + * Advanced voice options. + * + * Generated from protobuf field optional .google.cloud.texttospeech.v1.AdvancedVoiceOptions advanced_voice_options = 8; + * @param \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions $var + * @return $this + */ + public function setAdvancedVoiceOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\AdvancedVoiceOptions::class); + $this->advanced_voice_options = $var; + + return $this; + } + } From 438b3e8a540f8b95e24eb10abcb061c90b5dec48 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 11:17:32 -0700 Subject: [PATCH 03/34] feat: Add IngestionFailureEvent to the external proto (#7738) PiperOrigin-RevId: 684152766 Source-Link: https://github.com/googleapis/googleapis/commit/d992b0619ee79a2d32f6954cc29351ed8f15f560 Source-Link: https://github.com/googleapis/googleapis-gen/commit/f7405e1dc75cddd10a6aca96211318586fb61fc0 Copy-Tag: eyJwIjoiUHViU3ViLy5Pd2xCb3QueWFtbCIsImgiOiJmNzQwNWUxZGM3NWNkZGQxMGE2YWNhOTYyMTEzMTg1ODZmYjYxZmMwIn0= --- PubSub/metadata/V1/Pubsub.php | Bin 17089 -> 17622 bytes PubSub/src/V1/IngestionFailureEvent.php | 148 ++++++++++++ .../ApiViolationReason.php | 41 ++++ .../AvroFailureReason.php | 35 +++ .../CloudStorageFailure.php | 222 ++++++++++++++++++ 5 files changed, 446 insertions(+) create mode 100644 PubSub/src/V1/IngestionFailureEvent.php create mode 100644 PubSub/src/V1/IngestionFailureEvent/ApiViolationReason.php create mode 100644 PubSub/src/V1/IngestionFailureEvent/AvroFailureReason.php create mode 100644 PubSub/src/V1/IngestionFailureEvent/CloudStorageFailure.php diff --git a/PubSub/metadata/V1/Pubsub.php b/PubSub/metadata/V1/Pubsub.php index c4ea74873bcf3acd5b572450f5916b8e0ce46111..97038a175348fafc46d33a797451a9d8d62cd80c 100644 GIT binary patch delta 466 zcmX@u%6P4lal=_==B0B*ev9 zl3$RSEWxP2sKM#P{J@b(NQ#R$wWuh+C_Xo}xHvIARe}j2m&hfWoReRg5?@@BUj&qk zPlK2y!8}<|QeyH24$drO^YxrTii06)p%NfV7(E!IM7V?;3o^qp^K%kG&I(FREY8o9 z66O+gEGx=~s)Y)!W8xCVV$$RQd66haAqg(-{G_bZUgoogle.pubsub.v1.IngestionFailureEvent + */ +class IngestionFailureEvent extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the import topic. Format is: + * projects/{project_name}/topics/{topic_name}. + * + * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $topic = ''; + /** + * Required. Error details explaining why ingestion to Pub/Sub has failed. + * + * Generated from protobuf field string error_message = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $error_message = ''; + protected $failure; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $topic + * Required. Name of the import topic. Format is: + * projects/{project_name}/topics/{topic_name}. + * @type string $error_message + * Required. Error details explaining why ingestion to Pub/Sub has failed. + * @type \Google\Cloud\PubSub\V1\IngestionFailureEvent\CloudStorageFailure $cloud_storage_failure + * Optional. Failure when ingesting from Cloud Storage. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the import topic. Format is: + * projects/{project_name}/topics/{topic_name}. + * + * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTopic() + { + return $this->topic; + } + + /** + * Required. Name of the import topic. Format is: + * projects/{project_name}/topics/{topic_name}. + * + * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTopic($var) + { + GPBUtil::checkString($var, True); + $this->topic = $var; + + return $this; + } + + /** + * Required. Error details explaining why ingestion to Pub/Sub has failed. + * + * Generated from protobuf field string error_message = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getErrorMessage() + { + return $this->error_message; + } + + /** + * Required. Error details explaining why ingestion to Pub/Sub has failed. + * + * Generated from protobuf field string error_message = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setErrorMessage($var) + { + GPBUtil::checkString($var, True); + $this->error_message = $var; + + return $this; + } + + /** + * Optional. Failure when ingesting from Cloud Storage. + * + * Generated from protobuf field .google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure cloud_storage_failure = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\PubSub\V1\IngestionFailureEvent\CloudStorageFailure|null + */ + public function getCloudStorageFailure() + { + return $this->readOneof(3); + } + + public function hasCloudStorageFailure() + { + return $this->hasOneof(3); + } + + /** + * Optional. Failure when ingesting from Cloud Storage. + * + * Generated from protobuf field .google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure cloud_storage_failure = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\PubSub\V1\IngestionFailureEvent\CloudStorageFailure $var + * @return $this + */ + public function setCloudStorageFailure($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\IngestionFailureEvent\CloudStorageFailure::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getFailure() + { + return $this->whichOneof("failure"); + } + +} + diff --git a/PubSub/src/V1/IngestionFailureEvent/ApiViolationReason.php b/PubSub/src/V1/IngestionFailureEvent/ApiViolationReason.php new file mode 100644 index 000000000000..d5a1b99f8ce9 --- /dev/null +++ b/PubSub/src/V1/IngestionFailureEvent/ApiViolationReason.php @@ -0,0 +1,41 @@ +google.pubsub.v1.IngestionFailureEvent.ApiViolationReason + */ +class ApiViolationReason extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + +} + + diff --git a/PubSub/src/V1/IngestionFailureEvent/AvroFailureReason.php b/PubSub/src/V1/IngestionFailureEvent/AvroFailureReason.php new file mode 100644 index 000000000000..0a108a77ea73 --- /dev/null +++ b/PubSub/src/V1/IngestionFailureEvent/AvroFailureReason.php @@ -0,0 +1,35 @@ +google.pubsub.v1.IngestionFailureEvent.AvroFailureReason + */ +class AvroFailureReason extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + +} + + diff --git a/PubSub/src/V1/IngestionFailureEvent/CloudStorageFailure.php b/PubSub/src/V1/IngestionFailureEvent/CloudStorageFailure.php new file mode 100644 index 000000000000..7eaece3abda3 --- /dev/null +++ b/PubSub/src/V1/IngestionFailureEvent/CloudStorageFailure.php @@ -0,0 +1,222 @@ +google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure + */ +class CloudStorageFailure extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Name of the Cloud Storage bucket used for ingestion. + * + * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $bucket = ''; + /** + * Optional. Name of the Cloud Storage object which contained the section + * that couldn't be ingested. + * + * Generated from protobuf field string object_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $object_name = ''; + /** + * Optional. Generation of the Cloud Storage object which contained the + * section that couldn't be ingested. + * + * Generated from protobuf field int64 object_generation = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $object_generation = 0; + protected $reason; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $bucket + * Optional. Name of the Cloud Storage bucket used for ingestion. + * @type string $object_name + * Optional. Name of the Cloud Storage object which contained the section + * that couldn't be ingested. + * @type int|string $object_generation + * Optional. Generation of the Cloud Storage object which contained the + * section that couldn't be ingested. + * @type \Google\Cloud\PubSub\V1\IngestionFailureEvent\AvroFailureReason $avro_failure_reason + * Optional. Failure encountered when parsing an Avro file. + * @type \Google\Cloud\PubSub\V1\IngestionFailureEvent\ApiViolationReason $api_violation_reason + * Optional. The Pub/Sub API limits prevented the desired message from + * being published. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Name of the Cloud Storage bucket used for ingestion. + * + * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getBucket() + { + return $this->bucket; + } + + /** + * Optional. Name of the Cloud Storage bucket used for ingestion. + * + * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setBucket($var) + { + GPBUtil::checkString($var, True); + $this->bucket = $var; + + return $this; + } + + /** + * Optional. Name of the Cloud Storage object which contained the section + * that couldn't be ingested. + * + * Generated from protobuf field string object_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getObjectName() + { + return $this->object_name; + } + + /** + * Optional. Name of the Cloud Storage object which contained the section + * that couldn't be ingested. + * + * Generated from protobuf field string object_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setObjectName($var) + { + GPBUtil::checkString($var, True); + $this->object_name = $var; + + return $this; + } + + /** + * Optional. Generation of the Cloud Storage object which contained the + * section that couldn't be ingested. + * + * Generated from protobuf field int64 object_generation = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getObjectGeneration() + { + return $this->object_generation; + } + + /** + * Optional. Generation of the Cloud Storage object which contained the + * section that couldn't be ingested. + * + * Generated from protobuf field int64 object_generation = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setObjectGeneration($var) + { + GPBUtil::checkInt64($var); + $this->object_generation = $var; + + return $this; + } + + /** + * Optional. Failure encountered when parsing an Avro file. + * + * Generated from protobuf field .google.pubsub.v1.IngestionFailureEvent.AvroFailureReason avro_failure_reason = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\PubSub\V1\IngestionFailureEvent\AvroFailureReason|null + */ + public function getAvroFailureReason() + { + return $this->readOneof(5); + } + + public function hasAvroFailureReason() + { + return $this->hasOneof(5); + } + + /** + * Optional. Failure encountered when parsing an Avro file. + * + * Generated from protobuf field .google.pubsub.v1.IngestionFailureEvent.AvroFailureReason avro_failure_reason = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\PubSub\V1\IngestionFailureEvent\AvroFailureReason $var + * @return $this + */ + public function setAvroFailureReason($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\IngestionFailureEvent\AvroFailureReason::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Optional. The Pub/Sub API limits prevented the desired message from + * being published. + * + * Generated from protobuf field .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\PubSub\V1\IngestionFailureEvent\ApiViolationReason|null + */ + public function getApiViolationReason() + { + return $this->readOneof(6); + } + + public function hasApiViolationReason() + { + return $this->hasOneof(6); + } + + /** + * Optional. The Pub/Sub API limits prevented the desired message from + * being published. + * + * Generated from protobuf field .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\PubSub\V1\IngestionFailureEvent\ApiViolationReason $var + * @return $this + */ + public function setApiViolationReason($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\IngestionFailureEvent\ApiViolationReason::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * @return string + */ + public function getReason() + { + return $this->whichOneof("reason"); + } + +} + + From bb22cee327bb8a5a438bde0d39e6e48ae1d51b72 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 11:18:33 -0700 Subject: [PATCH 04/34] feat: add an effective_cgroup_mode field in node config (#7737) feat: add storage pools field to NodePool API feat: Add ControlPlaneEndpointsConfig message to consolidate control plane isolation options feat: Add DNSEndpointConfig for new DNS-based control plane access Moves control plane and node isolation fields to respective objects for better semantics, deprecating former locations. Introduces new DNS-based access to control plane, simplifying control plane access. feat: add API to enable/disable secret manager csi component on GKE clusters feat: Add CompliancePosture field for configuration of GKE Compliance Posture product feat: Add RBACBindingConfig to API feat: Add CompliancePosture field for configuration of GKE Compliance Posture product feat: Add KCP_SSHD and KCP_CONNECTION to the supported values for the --logging flag for the create and update cluster commands feat: surface upgrade_target_version in GetServerConfig for all supported release channels feat: added support for Parallelstore CSI Driver docs: Minor documentation updates PiperOrigin-RevId: 684119299 Source-Link: https://github.com/googleapis/googleapis/commit/1f77391203115a5740dd8815b13842f661f303df Source-Link: https://github.com/googleapis/googleapis-gen/commit/fa5cccba80771b6170d81522d48a6387c29c3c78 Copy-Tag: eyJwIjoiQ29udGFpbmVyLy5Pd2xCb3QueWFtbCIsImgiOiJmYTVjY2NiYTgwNzcxYjYxNzBkODE1MjJkNDhhNjM4N2MyOWMzYzc4In0= --- Container/metadata/V1/ClusterService.php | Bin 55136 -> 59093 bytes Container/src/V1/AddonsConfig.php | 44 ++ .../src/V1/Client/ClusterManagerClient.php | 49 +++ Container/src/V1/Cluster.php | 249 +++++++++++- Container/src/V1/ClusterUpdate.php | 363 ++++++++++++++++- Container/src/V1/CompliancePostureConfig.php | 112 ++++++ .../ComplianceStandard.php | 78 ++++ .../src/V1/CompliancePostureConfig/Mode.php | 62 +++ .../src/V1/ControlPlaneEndpointsConfig.php | 121 ++++++ .../DNSEndpointConfig.php | 132 ++++++ .../IPEndpointsConfig.php | 380 ++++++++++++++++++ Container/src/V1/EnterpriseConfig.php | 8 +- .../V1/LoggingComponentConfig/Component.php | 14 + Container/src/V1/MasterAuth.php | 12 +- .../src/V1/MasterAuthorizedNetworksConfig.php | 44 ++ Container/src/V1/NetworkConfig.php | 60 +++ Container/src/V1/NodeConfig.php | 80 ++++ .../src/V1/NodeConfig/EffectiveCgroupMode.php | 65 +++ Container/src/V1/NodeNetworkConfig.php | 8 +- .../src/V1/ParallelstoreCsiDriverConfig.php | 71 ++++ Container/src/V1/PrivateClusterConfig.php | 144 ++++++- Container/src/V1/RBACBindingConfig.php | 130 ++++++ Container/src/V1/SecretManagerConfig.php | 77 ++++ .../V1/ServerConfig/ReleaseChannelConfig.php | 34 ++ Container/src/V1/UpdateNodePoolRequest.php | 38 ++ Container/src/V1/UserManagedKeysConfig.php | 354 ++++++++++++++++ .../cluster_manager_descriptor_config.php | 2 + 27 files changed, 2689 insertions(+), 42 deletions(-) create mode 100644 Container/src/V1/CompliancePostureConfig.php create mode 100644 Container/src/V1/CompliancePostureConfig/ComplianceStandard.php create mode 100644 Container/src/V1/CompliancePostureConfig/Mode.php create mode 100644 Container/src/V1/ControlPlaneEndpointsConfig.php create mode 100644 Container/src/V1/ControlPlaneEndpointsConfig/DNSEndpointConfig.php create mode 100644 Container/src/V1/ControlPlaneEndpointsConfig/IPEndpointsConfig.php create mode 100644 Container/src/V1/NodeConfig/EffectiveCgroupMode.php create mode 100644 Container/src/V1/ParallelstoreCsiDriverConfig.php create mode 100644 Container/src/V1/RBACBindingConfig.php create mode 100644 Container/src/V1/SecretManagerConfig.php create mode 100644 Container/src/V1/UserManagedKeysConfig.php diff --git a/Container/metadata/V1/ClusterService.php b/Container/metadata/V1/ClusterService.php index 7d7df54cb9ba2ad98b57fb5e7cca9ed8fd5bce8b..8801f61a05bb02d1592b7b804691ce736ba2ff8a 100644 GIT binary patch delta 3831 zcmb7HZ)_W98RyPU?L1Di|k=Z|COe_4|{l~}rV?R<8!WN8v7p&g^$E|Hhz|e|>M72){Dh(L>f;OS?ymvl3 zf1J>MySwNA`#kUO_uTtG^1XM>R7VH zGw3ZSusp-{l52fYKYb)O`(p7ZG45#6!GjEQm;83ukFO|>AdOFB+t zr9H1Q( zw+MXE!WeEWMO;%aS8{!wA&FSWk<%!5!znW;bwf`1zQ!=zG_;s2k}R%hx}xb>FX9{I z`Dka$qL54puApq=CyyTgM@i^_c5%0$LK}p|8b0IyWT1J6NA4Jml!s5#@ziM5UM|*U z9MW~Ms7uAdd2F~QjA~k%p>tn=nCrFb6ah_JrOigU>$!1@=h8j8 zJ`RmiHfyR`*AtfezTB+?b$gh5t8 z(iO>6ES|;F4~?Cq`c=6LL1ot?)sRbNv&cAbJHK+R5cC{7{8B$f@39bqdeQq%Zr_OZ zHb5{vy_6JAO{9?}LlBslb6;2?0Cf&^+ar%0^0TiG*iR+@%Q6?p+4QOlxQ;sK5I&fDw5^zhV75e?~Aiv1^bgLy6-SI z44r$O2H)mPEM@n|9R{N0)7c*TrI&`8m=J}oJ%`=?*~>p~Wv{X1;`KG=d*mdwzK1?}ZG^|}*3tb-1mYzmiKH=;83h|r?whQAGPxotV~RsEIr@Hd_D+?AK1$OUNL83e(~i+~_V z_gnfK!1Y2KZsEqWqIwCJXq*DEU`ngVSUe3MbP=t+1P8?0YLPoEH19}(3q!!$Xr0a5 z#VHI{-f;58m7FG5YIZUzBU1$SXLH61W`e}5S{6+tgqg4u3!Z=o$)!6GUp`GdO#ao^ zP5#gqhJBTK$d&${69MNHAc+2*ty*Zu{A))RnxIkK63@Q%gX_%rL(ozKkZRW@Yzk#x zyz%N#;Hn=E;H@NyhA@fW{;+g6dG6djEJJzIxPZTP*65eYPaC5-!`&V5oA&@B1F#PS0^y~z5d`}L0_G934hgXb17->%le`imll%}tla>*ev!@cA z4FdKDvqd1S1G7#fQ2_zelb|IS0~`tzl2a9v&?N-~5+4c|lYv_o1{eY$0VoKQ{v{y+ z9g`p?83qI3K?4#TlR+jJ0RxjS04cZ0+V1^%K-zEELlGR1d}3KumwUQ3LsyTzEU5P!dt2YB5?{ClaN&!v+`WY z2LaQwykyk{v#4sy2Lkj0lXP.google.container.v1.StatefulHAConfig stateful_ha_config = 18 [(.google.api.field_behavior) = OPTIONAL]; */ protected $stateful_ha_config = null; + /** + * Configuration for the Cloud Storage Parallelstore CSI driver. + * + * Generated from protobuf field .google.container.v1.ParallelstoreCsiDriverConfig parallelstore_csi_driver_config = 19; + */ + protected $parallelstore_csi_driver_config = null; /** * Optional. Configuration for Ray Operator addon. * @@ -148,6 +154,8 @@ class AddonsConfig extends \Google\Protobuf\Internal\Message * Configuration for the Cloud Storage Fuse CSI driver. * @type \Google\Cloud\Container\V1\StatefulHAConfig $stateful_ha_config * Optional. Configuration for the StatefulHA add-on. + * @type \Google\Cloud\Container\V1\ParallelstoreCsiDriverConfig $parallelstore_csi_driver_config + * Configuration for the Cloud Storage Parallelstore CSI driver. * @type \Google\Cloud\Container\V1\RayOperatorConfig $ray_operator_config * Optional. Configuration for Ray Operator addon. * } @@ -617,6 +625,42 @@ public function setStatefulHaConfig($var) return $this; } + /** + * Configuration for the Cloud Storage Parallelstore CSI driver. + * + * Generated from protobuf field .google.container.v1.ParallelstoreCsiDriverConfig parallelstore_csi_driver_config = 19; + * @return \Google\Cloud\Container\V1\ParallelstoreCsiDriverConfig|null + */ + public function getParallelstoreCsiDriverConfig() + { + return $this->parallelstore_csi_driver_config; + } + + public function hasParallelstoreCsiDriverConfig() + { + return isset($this->parallelstore_csi_driver_config); + } + + public function clearParallelstoreCsiDriverConfig() + { + unset($this->parallelstore_csi_driver_config); + } + + /** + * Configuration for the Cloud Storage Parallelstore CSI driver. + * + * Generated from protobuf field .google.container.v1.ParallelstoreCsiDriverConfig parallelstore_csi_driver_config = 19; + * @param \Google\Cloud\Container\V1\ParallelstoreCsiDriverConfig $var + * @return $this + */ + public function setParallelstoreCsiDriverConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\ParallelstoreCsiDriverConfig::class); + $this->parallelstore_csi_driver_config = $var; + + return $this; + } + /** * Optional. Configuration for Ray Operator addon. * diff --git a/Container/src/V1/Client/ClusterManagerClient.php b/Container/src/V1/Client/ClusterManagerClient.php index 5208382934c3..1baf5f0edca0 100644 --- a/Container/src/V1/Client/ClusterManagerClient.php +++ b/Container/src/V1/Client/ClusterManagerClient.php @@ -170,6 +170,53 @@ private static function getClientDefaults() ]; } + /** + * Formats a string containing the fully-qualified path to represent a ca_pool + * resource. + * + * @param string $project + * @param string $location + * @param string $caPool + * + * @return string The formatted ca_pool resource. + */ + public static function caPoolName(string $project, string $location, string $caPool): string + { + return self::getPathTemplate('caPool')->render([ + 'project' => $project, + 'location' => $location, + 'ca_pool' => $caPool, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * crypto_key_version resource. + * + * @param string $project + * @param string $location + * @param string $keyRing + * @param string $cryptoKey + * @param string $cryptoKeyVersion + * + * @return string The formatted crypto_key_version resource. + */ + public static function cryptoKeyVersionName( + string $project, + string $location, + string $keyRing, + string $cryptoKey, + string $cryptoKeyVersion + ): string { + return self::getPathTemplate('cryptoKeyVersion')->render([ + 'project' => $project, + 'location' => $location, + 'key_ring' => $keyRing, + 'crypto_key' => $cryptoKey, + 'crypto_key_version' => $cryptoKeyVersion, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a topic * resource. @@ -191,6 +238,8 @@ public static function topicName(string $project, string $topic): string * Parses a formatted name string and returns an associative array of the components in the name. * The following name formats are supported: * Template: Pattern + * - caPool: projects/{project}/locations/{location}/caPools/{ca_pool} + * - cryptoKeyVersion: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version} * - topic: projects/{project}/topics/{topic} * * The optional $template argument can be supplied to specify a particular pattern, diff --git a/Container/src/V1/Cluster.php b/Container/src/V1/Cluster.php index 2891e69914db..ef01339406ed 100644 --- a/Container/src/V1/Cluster.php +++ b/Container/src/V1/Cluster.php @@ -199,8 +199,12 @@ class Cluster extends \Google\Protobuf\Internal\Message protected $ip_allocation_policy = null; /** * The configuration options for master authorized networks feature. + * Deprecated: Use + * [ControlPlaneEndpointsConfig.IPEndpointsConfig.authorized_networks_config][google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.authorized_networks_config] + * instead. * - * Generated from protobuf field .google.container.v1.MasterAuthorizedNetworksConfig master_authorized_networks_config = 22; + * Generated from protobuf field .google.container.v1.MasterAuthorizedNetworksConfig master_authorized_networks_config = 22 [deprecated = true]; + * @deprecated */ protected $master_authorized_networks_config = null; /** @@ -531,6 +535,12 @@ class Cluster extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.container.v1.SecurityPostureConfig security_posture_config = 145; */ protected $security_posture_config = null; + /** + * Configuration for all cluster's control plane endpoints. + * + * Generated from protobuf field .google.container.v1.ControlPlaneEndpointsConfig control_plane_endpoints_config = 146; + */ + protected $control_plane_endpoints_config = null; /** * Beta APIs Config * @@ -543,6 +553,18 @@ class Cluster extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.container.v1.EnterpriseConfig enterprise_config = 149; */ protected $enterprise_config = null; + /** + * Secret CSI driver configuration. + * + * Generated from protobuf field .google.container.v1.SecretManagerConfig secret_manager_config = 150; + */ + protected $secret_manager_config = null; + /** + * Enable/Disable Compliance Posture features for the cluster. + * + * Generated from protobuf field .google.container.v1.CompliancePostureConfig compliance_posture_config = 151; + */ + protected $compliance_posture_config = null; /** * Output only. Reserved for future use. * @@ -555,6 +577,19 @@ class Cluster extends \Google\Protobuf\Internal\Message * Generated from protobuf field optional bool satisfies_pzi = 153 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ protected $satisfies_pzi = null; + /** + * The Custom keys configuration for the cluster. + * + * Generated from protobuf field optional .google.container.v1.UserManagedKeysConfig user_managed_keys_config = 154; + */ + protected $user_managed_keys_config = null; + /** + * RBACBindingConfig allows user to restrict ClusterRoleBindings an + * RoleBindings that can be created. + * + * Generated from protobuf field optional .google.container.v1.RBACBindingConfig rbac_binding_config = 156; + */ + protected $rbac_binding_config = null; /** * Constructor. @@ -668,6 +703,9 @@ class Cluster extends \Google\Protobuf\Internal\Message * Configuration for cluster IP allocation. * @type \Google\Cloud\Container\V1\MasterAuthorizedNetworksConfig $master_authorized_networks_config * The configuration options for master authorized networks feature. + * Deprecated: Use + * [ControlPlaneEndpointsConfig.IPEndpointsConfig.authorized_networks_config][google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.authorized_networks_config] + * instead. * @type \Google\Cloud\Container\V1\MaintenancePolicy $maintenance_policy * Configure the maintenance policy for this cluster. * @type \Google\Cloud\Container\V1\BinaryAuthorization $binary_authorization @@ -811,14 +849,25 @@ class Cluster extends \Google\Protobuf\Internal\Message * Fleet information for the cluster. * @type \Google\Cloud\Container\V1\SecurityPostureConfig $security_posture_config * Enable/Disable Security Posture API features for the cluster. + * @type \Google\Cloud\Container\V1\ControlPlaneEndpointsConfig $control_plane_endpoints_config + * Configuration for all cluster's control plane endpoints. * @type \Google\Cloud\Container\V1\K8sBetaAPIConfig $enable_k8s_beta_apis * Beta APIs Config * @type \Google\Cloud\Container\V1\EnterpriseConfig $enterprise_config * GKE Enterprise Configuration. + * @type \Google\Cloud\Container\V1\SecretManagerConfig $secret_manager_config + * Secret CSI driver configuration. + * @type \Google\Cloud\Container\V1\CompliancePostureConfig $compliance_posture_config + * Enable/Disable Compliance Posture features for the cluster. * @type bool $satisfies_pzs * Output only. Reserved for future use. * @type bool $satisfies_pzi * Output only. Reserved for future use. + * @type \Google\Cloud\Container\V1\UserManagedKeysConfig $user_managed_keys_config + * The Custom keys configuration for the cluster. + * @type \Google\Cloud\Container\V1\RBACBindingConfig $rbac_binding_config + * RBACBindingConfig allows user to restrict ClusterRoleBindings an + * RoleBindings that can be created. * } */ public function __construct($data = NULL) { @@ -1524,34 +1573,46 @@ public function setIpAllocationPolicy($var) /** * The configuration options for master authorized networks feature. + * Deprecated: Use + * [ControlPlaneEndpointsConfig.IPEndpointsConfig.authorized_networks_config][google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.authorized_networks_config] + * instead. * - * Generated from protobuf field .google.container.v1.MasterAuthorizedNetworksConfig master_authorized_networks_config = 22; + * Generated from protobuf field .google.container.v1.MasterAuthorizedNetworksConfig master_authorized_networks_config = 22 [deprecated = true]; * @return \Google\Cloud\Container\V1\MasterAuthorizedNetworksConfig|null + * @deprecated */ public function getMasterAuthorizedNetworksConfig() { + @trigger_error('master_authorized_networks_config is deprecated.', E_USER_DEPRECATED); return $this->master_authorized_networks_config; } public function hasMasterAuthorizedNetworksConfig() { + @trigger_error('master_authorized_networks_config is deprecated.', E_USER_DEPRECATED); return isset($this->master_authorized_networks_config); } public function clearMasterAuthorizedNetworksConfig() { + @trigger_error('master_authorized_networks_config is deprecated.', E_USER_DEPRECATED); unset($this->master_authorized_networks_config); } /** * The configuration options for master authorized networks feature. + * Deprecated: Use + * [ControlPlaneEndpointsConfig.IPEndpointsConfig.authorized_networks_config][google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.authorized_networks_config] + * instead. * - * Generated from protobuf field .google.container.v1.MasterAuthorizedNetworksConfig master_authorized_networks_config = 22; + * Generated from protobuf field .google.container.v1.MasterAuthorizedNetworksConfig master_authorized_networks_config = 22 [deprecated = true]; * @param \Google\Cloud\Container\V1\MasterAuthorizedNetworksConfig $var * @return $this + * @deprecated */ public function setMasterAuthorizedNetworksConfig($var) { + @trigger_error('master_authorized_networks_config is deprecated.', E_USER_DEPRECATED); GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\MasterAuthorizedNetworksConfig::class); $this->master_authorized_networks_config = $var; @@ -3104,6 +3165,42 @@ public function setSecurityPostureConfig($var) return $this; } + /** + * Configuration for all cluster's control plane endpoints. + * + * Generated from protobuf field .google.container.v1.ControlPlaneEndpointsConfig control_plane_endpoints_config = 146; + * @return \Google\Cloud\Container\V1\ControlPlaneEndpointsConfig|null + */ + public function getControlPlaneEndpointsConfig() + { + return $this->control_plane_endpoints_config; + } + + public function hasControlPlaneEndpointsConfig() + { + return isset($this->control_plane_endpoints_config); + } + + public function clearControlPlaneEndpointsConfig() + { + unset($this->control_plane_endpoints_config); + } + + /** + * Configuration for all cluster's control plane endpoints. + * + * Generated from protobuf field .google.container.v1.ControlPlaneEndpointsConfig control_plane_endpoints_config = 146; + * @param \Google\Cloud\Container\V1\ControlPlaneEndpointsConfig $var + * @return $this + */ + public function setControlPlaneEndpointsConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\ControlPlaneEndpointsConfig::class); + $this->control_plane_endpoints_config = $var; + + return $this; + } + /** * Beta APIs Config * @@ -3176,6 +3273,78 @@ public function setEnterpriseConfig($var) return $this; } + /** + * Secret CSI driver configuration. + * + * Generated from protobuf field .google.container.v1.SecretManagerConfig secret_manager_config = 150; + * @return \Google\Cloud\Container\V1\SecretManagerConfig|null + */ + public function getSecretManagerConfig() + { + return $this->secret_manager_config; + } + + public function hasSecretManagerConfig() + { + return isset($this->secret_manager_config); + } + + public function clearSecretManagerConfig() + { + unset($this->secret_manager_config); + } + + /** + * Secret CSI driver configuration. + * + * Generated from protobuf field .google.container.v1.SecretManagerConfig secret_manager_config = 150; + * @param \Google\Cloud\Container\V1\SecretManagerConfig $var + * @return $this + */ + public function setSecretManagerConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\SecretManagerConfig::class); + $this->secret_manager_config = $var; + + return $this; + } + + /** + * Enable/Disable Compliance Posture features for the cluster. + * + * Generated from protobuf field .google.container.v1.CompliancePostureConfig compliance_posture_config = 151; + * @return \Google\Cloud\Container\V1\CompliancePostureConfig|null + */ + public function getCompliancePostureConfig() + { + return $this->compliance_posture_config; + } + + public function hasCompliancePostureConfig() + { + return isset($this->compliance_posture_config); + } + + public function clearCompliancePostureConfig() + { + unset($this->compliance_posture_config); + } + + /** + * Enable/Disable Compliance Posture features for the cluster. + * + * Generated from protobuf field .google.container.v1.CompliancePostureConfig compliance_posture_config = 151; + * @param \Google\Cloud\Container\V1\CompliancePostureConfig $var + * @return $this + */ + public function setCompliancePostureConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\CompliancePostureConfig::class); + $this->compliance_posture_config = $var; + + return $this; + } + /** * Output only. Reserved for future use. * @@ -3248,5 +3417,79 @@ public function setSatisfiesPzi($var) return $this; } + /** + * The Custom keys configuration for the cluster. + * + * Generated from protobuf field optional .google.container.v1.UserManagedKeysConfig user_managed_keys_config = 154; + * @return \Google\Cloud\Container\V1\UserManagedKeysConfig|null + */ + public function getUserManagedKeysConfig() + { + return $this->user_managed_keys_config; + } + + public function hasUserManagedKeysConfig() + { + return isset($this->user_managed_keys_config); + } + + public function clearUserManagedKeysConfig() + { + unset($this->user_managed_keys_config); + } + + /** + * The Custom keys configuration for the cluster. + * + * Generated from protobuf field optional .google.container.v1.UserManagedKeysConfig user_managed_keys_config = 154; + * @param \Google\Cloud\Container\V1\UserManagedKeysConfig $var + * @return $this + */ + public function setUserManagedKeysConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\UserManagedKeysConfig::class); + $this->user_managed_keys_config = $var; + + return $this; + } + + /** + * RBACBindingConfig allows user to restrict ClusterRoleBindings an + * RoleBindings that can be created. + * + * Generated from protobuf field optional .google.container.v1.RBACBindingConfig rbac_binding_config = 156; + * @return \Google\Cloud\Container\V1\RBACBindingConfig|null + */ + public function getRbacBindingConfig() + { + return $this->rbac_binding_config; + } + + public function hasRbacBindingConfig() + { + return isset($this->rbac_binding_config); + } + + public function clearRbacBindingConfig() + { + unset($this->rbac_binding_config); + } + + /** + * RBACBindingConfig allows user to restrict ClusterRoleBindings an + * RoleBindings that can be created. + * + * Generated from protobuf field optional .google.container.v1.RBACBindingConfig rbac_binding_config = 156; + * @param \Google\Cloud\Container\V1\RBACBindingConfig $var + * @return $this + */ + public function setRbacBindingConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\RBACBindingConfig::class); + $this->rbac_binding_config = $var; + + return $this; + } + } diff --git a/Container/src/V1/ClusterUpdate.php b/Container/src/V1/ClusterUpdate.php index 68b58c0027a3..6ce484dcd5c3 100644 --- a/Container/src/V1/ClusterUpdate.php +++ b/Container/src/V1/ClusterUpdate.php @@ -126,8 +126,12 @@ class ClusterUpdate extends \Google\Protobuf\Internal\Message private $desired_locations; /** * The desired configuration options for master authorized networks feature. + * Deprecated: Use + * desired_control_plane_endpoints_config.ip_endpoints_config.authorized_networks_config + * instead. * - * Generated from protobuf field .google.container.v1.MasterAuthorizedNetworksConfig desired_master_authorized_networks_config = 12; + * Generated from protobuf field .google.container.v1.MasterAuthorizedNetworksConfig desired_master_authorized_networks_config = 12 [deprecated = true]; + * @deprecated */ protected $desired_master_authorized_networks_config = null; /** @@ -175,8 +179,12 @@ class ClusterUpdate extends \Google\Protobuf\Internal\Message * [ClusterUpdate.desired_enable_private_endpoint][google.container.v1.ClusterUpdate.desired_enable_private_endpoint] * for modifying other fields within * [PrivateClusterConfig][google.container.v1.PrivateClusterConfig]. + * Deprecated: Use + * desired_control_plane_endpoints_config.ip_endpoints_config.global_access + * instead. * - * Generated from protobuf field .google.container.v1.PrivateClusterConfig desired_private_cluster_config = 25; + * Generated from protobuf field .google.container.v1.PrivateClusterConfig desired_private_cluster_config = 25 [deprecated = true]; + * @deprecated */ protected $desired_private_cluster_config = null; /** @@ -254,10 +262,31 @@ class ClusterUpdate extends \Google\Protobuf\Internal\Message protected $desired_service_external_ips_config = null; /** * Enable/Disable private endpoint for the cluster's master. + * Deprecated: Use + * desired_control_plane_endpoints_config.ip_endpoints_config.enable_public_endpoint + * instead. Note that the value of enable_public_endpoint is reversed: if + * enable_private_endpoint is false, then enable_public_endpoint will be true. * - * Generated from protobuf field optional bool desired_enable_private_endpoint = 71; + * Generated from protobuf field optional bool desired_enable_private_endpoint = 71 [deprecated = true]; + * @deprecated */ protected $desired_enable_private_endpoint = null; + /** + * Override the default setting of whether future created + * nodes have private IP addresses only, namely + * [NetworkConfig.default_enable_private_nodes][google.container.v1.NetworkConfig.default_enable_private_nodes] + * + * Generated from protobuf field optional bool desired_default_enable_private_nodes = 72; + */ + protected $desired_default_enable_private_nodes = null; + /** + * [Control plane + * endpoints][google.container.v1.Cluster.control_plane_endpoints_config] + * configuration. + * + * Generated from protobuf field .google.container.v1.ControlPlaneEndpointsConfig desired_control_plane_endpoints_config = 73; + */ + protected $desired_control_plane_endpoints_config = null; /** * The Kubernetes version to change the master to. * Users may specify either explicit versions offered by @@ -400,6 +429,18 @@ class ClusterUpdate extends \Google\Protobuf\Internal\Message * Generated from protobuf field optional bool desired_enable_cilium_clusterwide_network_policy = 138; */ protected $desired_enable_cilium_clusterwide_network_policy = null; + /** + * Enable/Disable Secret Manager Config. + * + * Generated from protobuf field optional .google.container.v1.SecretManagerConfig desired_secret_manager_config = 139; + */ + protected $desired_secret_manager_config = null; + /** + * Enable/Disable Compliance Posture features for the cluster. + * + * Generated from protobuf field optional .google.container.v1.CompliancePostureConfig desired_compliance_posture_config = 140; + */ + protected $desired_compliance_posture_config = null; /** * The desired node kubelet config for the cluster. * @@ -413,6 +454,19 @@ class ClusterUpdate extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.container.v1.NodeKubeletConfig desired_node_pool_auto_config_kubelet_config = 142; */ protected $desired_node_pool_auto_config_kubelet_config = null; + /** + * The Custom keys configuration for the cluster. + * + * Generated from protobuf field .google.container.v1.UserManagedKeysConfig user_managed_keys_config = 143; + */ + protected $user_managed_keys_config = null; + /** + * RBACBindingConfig allows user to restrict ClusterRoleBindings an + * RoleBindings that can be created. + * + * Generated from protobuf field optional .google.container.v1.RBACBindingConfig desired_rbac_binding_config = 144; + */ + protected $desired_rbac_binding_config = null; /** * Constructor. @@ -477,6 +531,9 @@ class ClusterUpdate extends \Google\Protobuf\Internal\Message * pools and will result in nodes being added and/or removed. * @type \Google\Cloud\Container\V1\MasterAuthorizedNetworksConfig $desired_master_authorized_networks_config * The desired configuration options for master authorized networks feature. + * Deprecated: Use + * desired_control_plane_endpoints_config.ip_endpoints_config.authorized_networks_config + * instead. * @type \Google\Cloud\Container\V1\ClusterAutoscaling $desired_cluster_autoscaling * Cluster-level autoscaling configuration. * @type \Google\Cloud\Container\V1\BinaryAuthorization $desired_binary_authorization @@ -502,6 +559,9 @@ class ClusterUpdate extends \Google\Protobuf\Internal\Message * [ClusterUpdate.desired_enable_private_endpoint][google.container.v1.ClusterUpdate.desired_enable_private_endpoint] * for modifying other fields within * [PrivateClusterConfig][google.container.v1.PrivateClusterConfig]. + * Deprecated: Use + * desired_control_plane_endpoints_config.ip_endpoints_config.global_access + * instead. * @type \Google\Cloud\Container\V1\IntraNodeVisibilityConfig $desired_intra_node_visibility_config * The desired config of Intra-node visibility. * @type \Google\Cloud\Container\V1\DefaultSnatStatus $desired_default_snat_status @@ -529,6 +589,18 @@ class ClusterUpdate extends \Google\Protobuf\Internal\Message * ExternalIPs field. * @type bool $desired_enable_private_endpoint * Enable/Disable private endpoint for the cluster's master. + * Deprecated: Use + * desired_control_plane_endpoints_config.ip_endpoints_config.enable_public_endpoint + * instead. Note that the value of enable_public_endpoint is reversed: if + * enable_private_endpoint is false, then enable_public_endpoint will be true. + * @type bool $desired_default_enable_private_nodes + * Override the default setting of whether future created + * nodes have private IP addresses only, namely + * [NetworkConfig.default_enable_private_nodes][google.container.v1.NetworkConfig.default_enable_private_nodes] + * @type \Google\Cloud\Container\V1\ControlPlaneEndpointsConfig $desired_control_plane_endpoints_config + * [Control plane + * endpoints][google.container.v1.Cluster.control_plane_endpoints_config] + * configuration. * @type string $desired_master_version * The Kubernetes version to change the master to. * Users may specify either explicit versions offered by @@ -587,11 +659,20 @@ class ClusterUpdate extends \Google\Protobuf\Internal\Message * Specify the details of in-transit encryption. * @type bool $desired_enable_cilium_clusterwide_network_policy * Enable/Disable Cilium Clusterwide Network Policy for the cluster. + * @type \Google\Cloud\Container\V1\SecretManagerConfig $desired_secret_manager_config + * Enable/Disable Secret Manager Config. + * @type \Google\Cloud\Container\V1\CompliancePostureConfig $desired_compliance_posture_config + * Enable/Disable Compliance Posture features for the cluster. * @type \Google\Cloud\Container\V1\NodeKubeletConfig $desired_node_kubelet_config * The desired node kubelet config for the cluster. * @type \Google\Cloud\Container\V1\NodeKubeletConfig $desired_node_pool_auto_config_kubelet_config * The desired node kubelet config for all auto-provisioned node pools * in autopilot clusters and node auto-provisioning enabled clusters. + * @type \Google\Cloud\Container\V1\UserManagedKeysConfig $user_managed_keys_config + * The Custom keys configuration for the cluster. + * @type \Google\Cloud\Container\V1\RBACBindingConfig $desired_rbac_binding_config + * RBACBindingConfig allows user to restrict ClusterRoleBindings an + * RoleBindings that can be created. * } */ public function __construct($data = NULL) { @@ -1077,34 +1158,46 @@ public function setDesiredLocations($var) /** * The desired configuration options for master authorized networks feature. + * Deprecated: Use + * desired_control_plane_endpoints_config.ip_endpoints_config.authorized_networks_config + * instead. * - * Generated from protobuf field .google.container.v1.MasterAuthorizedNetworksConfig desired_master_authorized_networks_config = 12; + * Generated from protobuf field .google.container.v1.MasterAuthorizedNetworksConfig desired_master_authorized_networks_config = 12 [deprecated = true]; * @return \Google\Cloud\Container\V1\MasterAuthorizedNetworksConfig|null + * @deprecated */ public function getDesiredMasterAuthorizedNetworksConfig() { + @trigger_error('desired_master_authorized_networks_config is deprecated.', E_USER_DEPRECATED); return $this->desired_master_authorized_networks_config; } public function hasDesiredMasterAuthorizedNetworksConfig() { + @trigger_error('desired_master_authorized_networks_config is deprecated.', E_USER_DEPRECATED); return isset($this->desired_master_authorized_networks_config); } public function clearDesiredMasterAuthorizedNetworksConfig() { + @trigger_error('desired_master_authorized_networks_config is deprecated.', E_USER_DEPRECATED); unset($this->desired_master_authorized_networks_config); } /** * The desired configuration options for master authorized networks feature. + * Deprecated: Use + * desired_control_plane_endpoints_config.ip_endpoints_config.authorized_networks_config + * instead. * - * Generated from protobuf field .google.container.v1.MasterAuthorizedNetworksConfig desired_master_authorized_networks_config = 12; + * Generated from protobuf field .google.container.v1.MasterAuthorizedNetworksConfig desired_master_authorized_networks_config = 12 [deprecated = true]; * @param \Google\Cloud\Container\V1\MasterAuthorizedNetworksConfig $var * @return $this + * @deprecated */ public function setDesiredMasterAuthorizedNetworksConfig($var) { + @trigger_error('desired_master_authorized_networks_config is deprecated.', E_USER_DEPRECATED); GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\MasterAuthorizedNetworksConfig::class); $this->desired_master_authorized_networks_config = $var; @@ -1304,22 +1397,29 @@ public function setDesiredVerticalPodAutoscaling($var) * [ClusterUpdate.desired_enable_private_endpoint][google.container.v1.ClusterUpdate.desired_enable_private_endpoint] * for modifying other fields within * [PrivateClusterConfig][google.container.v1.PrivateClusterConfig]. + * Deprecated: Use + * desired_control_plane_endpoints_config.ip_endpoints_config.global_access + * instead. * - * Generated from protobuf field .google.container.v1.PrivateClusterConfig desired_private_cluster_config = 25; + * Generated from protobuf field .google.container.v1.PrivateClusterConfig desired_private_cluster_config = 25 [deprecated = true]; * @return \Google\Cloud\Container\V1\PrivateClusterConfig|null + * @deprecated */ public function getDesiredPrivateClusterConfig() { + @trigger_error('desired_private_cluster_config is deprecated.', E_USER_DEPRECATED); return $this->desired_private_cluster_config; } public function hasDesiredPrivateClusterConfig() { + @trigger_error('desired_private_cluster_config is deprecated.', E_USER_DEPRECATED); return isset($this->desired_private_cluster_config); } public function clearDesiredPrivateClusterConfig() { + @trigger_error('desired_private_cluster_config is deprecated.', E_USER_DEPRECATED); unset($this->desired_private_cluster_config); } @@ -1330,13 +1430,18 @@ public function clearDesiredPrivateClusterConfig() * [ClusterUpdate.desired_enable_private_endpoint][google.container.v1.ClusterUpdate.desired_enable_private_endpoint] * for modifying other fields within * [PrivateClusterConfig][google.container.v1.PrivateClusterConfig]. + * Deprecated: Use + * desired_control_plane_endpoints_config.ip_endpoints_config.global_access + * instead. * - * Generated from protobuf field .google.container.v1.PrivateClusterConfig desired_private_cluster_config = 25; + * Generated from protobuf field .google.container.v1.PrivateClusterConfig desired_private_cluster_config = 25 [deprecated = true]; * @param \Google\Cloud\Container\V1\PrivateClusterConfig $var * @return $this + * @deprecated */ public function setDesiredPrivateClusterConfig($var) { + @trigger_error('desired_private_cluster_config is deprecated.', E_USER_DEPRECATED); GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\PrivateClusterConfig::class); $this->desired_private_cluster_config = $var; @@ -1759,40 +1864,134 @@ public function setDesiredServiceExternalIpsConfig($var) /** * Enable/Disable private endpoint for the cluster's master. + * Deprecated: Use + * desired_control_plane_endpoints_config.ip_endpoints_config.enable_public_endpoint + * instead. Note that the value of enable_public_endpoint is reversed: if + * enable_private_endpoint is false, then enable_public_endpoint will be true. * - * Generated from protobuf field optional bool desired_enable_private_endpoint = 71; + * Generated from protobuf field optional bool desired_enable_private_endpoint = 71 [deprecated = true]; * @return bool + * @deprecated */ public function getDesiredEnablePrivateEndpoint() { + @trigger_error('desired_enable_private_endpoint is deprecated.', E_USER_DEPRECATED); return isset($this->desired_enable_private_endpoint) ? $this->desired_enable_private_endpoint : false; } public function hasDesiredEnablePrivateEndpoint() { + @trigger_error('desired_enable_private_endpoint is deprecated.', E_USER_DEPRECATED); return isset($this->desired_enable_private_endpoint); } public function clearDesiredEnablePrivateEndpoint() { + @trigger_error('desired_enable_private_endpoint is deprecated.', E_USER_DEPRECATED); unset($this->desired_enable_private_endpoint); } /** * Enable/Disable private endpoint for the cluster's master. + * Deprecated: Use + * desired_control_plane_endpoints_config.ip_endpoints_config.enable_public_endpoint + * instead. Note that the value of enable_public_endpoint is reversed: if + * enable_private_endpoint is false, then enable_public_endpoint will be true. * - * Generated from protobuf field optional bool desired_enable_private_endpoint = 71; + * Generated from protobuf field optional bool desired_enable_private_endpoint = 71 [deprecated = true]; * @param bool $var * @return $this + * @deprecated */ public function setDesiredEnablePrivateEndpoint($var) { + @trigger_error('desired_enable_private_endpoint is deprecated.', E_USER_DEPRECATED); GPBUtil::checkBool($var); $this->desired_enable_private_endpoint = $var; return $this; } + /** + * Override the default setting of whether future created + * nodes have private IP addresses only, namely + * [NetworkConfig.default_enable_private_nodes][google.container.v1.NetworkConfig.default_enable_private_nodes] + * + * Generated from protobuf field optional bool desired_default_enable_private_nodes = 72; + * @return bool + */ + public function getDesiredDefaultEnablePrivateNodes() + { + return isset($this->desired_default_enable_private_nodes) ? $this->desired_default_enable_private_nodes : false; + } + + public function hasDesiredDefaultEnablePrivateNodes() + { + return isset($this->desired_default_enable_private_nodes); + } + + public function clearDesiredDefaultEnablePrivateNodes() + { + unset($this->desired_default_enable_private_nodes); + } + + /** + * Override the default setting of whether future created + * nodes have private IP addresses only, namely + * [NetworkConfig.default_enable_private_nodes][google.container.v1.NetworkConfig.default_enable_private_nodes] + * + * Generated from protobuf field optional bool desired_default_enable_private_nodes = 72; + * @param bool $var + * @return $this + */ + public function setDesiredDefaultEnablePrivateNodes($var) + { + GPBUtil::checkBool($var); + $this->desired_default_enable_private_nodes = $var; + + return $this; + } + + /** + * [Control plane + * endpoints][google.container.v1.Cluster.control_plane_endpoints_config] + * configuration. + * + * Generated from protobuf field .google.container.v1.ControlPlaneEndpointsConfig desired_control_plane_endpoints_config = 73; + * @return \Google\Cloud\Container\V1\ControlPlaneEndpointsConfig|null + */ + public function getDesiredControlPlaneEndpointsConfig() + { + return $this->desired_control_plane_endpoints_config; + } + + public function hasDesiredControlPlaneEndpointsConfig() + { + return isset($this->desired_control_plane_endpoints_config); + } + + public function clearDesiredControlPlaneEndpointsConfig() + { + unset($this->desired_control_plane_endpoints_config); + } + + /** + * [Control plane + * endpoints][google.container.v1.Cluster.control_plane_endpoints_config] + * configuration. + * + * Generated from protobuf field .google.container.v1.ControlPlaneEndpointsConfig desired_control_plane_endpoints_config = 73; + * @param \Google\Cloud\Container\V1\ControlPlaneEndpointsConfig $var + * @return $this + */ + public function setDesiredControlPlaneEndpointsConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\ControlPlaneEndpointsConfig::class); + $this->desired_control_plane_endpoints_config = $var; + + return $this; + } + /** * The Kubernetes version to change the master to. * Users may specify either explicit versions offered by @@ -2551,6 +2750,78 @@ public function setDesiredEnableCiliumClusterwideNetworkPolicy($var) return $this; } + /** + * Enable/Disable Secret Manager Config. + * + * Generated from protobuf field optional .google.container.v1.SecretManagerConfig desired_secret_manager_config = 139; + * @return \Google\Cloud\Container\V1\SecretManagerConfig|null + */ + public function getDesiredSecretManagerConfig() + { + return $this->desired_secret_manager_config; + } + + public function hasDesiredSecretManagerConfig() + { + return isset($this->desired_secret_manager_config); + } + + public function clearDesiredSecretManagerConfig() + { + unset($this->desired_secret_manager_config); + } + + /** + * Enable/Disable Secret Manager Config. + * + * Generated from protobuf field optional .google.container.v1.SecretManagerConfig desired_secret_manager_config = 139; + * @param \Google\Cloud\Container\V1\SecretManagerConfig $var + * @return $this + */ + public function setDesiredSecretManagerConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\SecretManagerConfig::class); + $this->desired_secret_manager_config = $var; + + return $this; + } + + /** + * Enable/Disable Compliance Posture features for the cluster. + * + * Generated from protobuf field optional .google.container.v1.CompliancePostureConfig desired_compliance_posture_config = 140; + * @return \Google\Cloud\Container\V1\CompliancePostureConfig|null + */ + public function getDesiredCompliancePostureConfig() + { + return $this->desired_compliance_posture_config; + } + + public function hasDesiredCompliancePostureConfig() + { + return isset($this->desired_compliance_posture_config); + } + + public function clearDesiredCompliancePostureConfig() + { + unset($this->desired_compliance_posture_config); + } + + /** + * Enable/Disable Compliance Posture features for the cluster. + * + * Generated from protobuf field optional .google.container.v1.CompliancePostureConfig desired_compliance_posture_config = 140; + * @param \Google\Cloud\Container\V1\CompliancePostureConfig $var + * @return $this + */ + public function setDesiredCompliancePostureConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\CompliancePostureConfig::class); + $this->desired_compliance_posture_config = $var; + + return $this; + } + /** * The desired node kubelet config for the cluster. * @@ -2625,5 +2896,79 @@ public function setDesiredNodePoolAutoConfigKubeletConfig($var) return $this; } + /** + * The Custom keys configuration for the cluster. + * + * Generated from protobuf field .google.container.v1.UserManagedKeysConfig user_managed_keys_config = 143; + * @return \Google\Cloud\Container\V1\UserManagedKeysConfig|null + */ + public function getUserManagedKeysConfig() + { + return $this->user_managed_keys_config; + } + + public function hasUserManagedKeysConfig() + { + return isset($this->user_managed_keys_config); + } + + public function clearUserManagedKeysConfig() + { + unset($this->user_managed_keys_config); + } + + /** + * The Custom keys configuration for the cluster. + * + * Generated from protobuf field .google.container.v1.UserManagedKeysConfig user_managed_keys_config = 143; + * @param \Google\Cloud\Container\V1\UserManagedKeysConfig $var + * @return $this + */ + public function setUserManagedKeysConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\UserManagedKeysConfig::class); + $this->user_managed_keys_config = $var; + + return $this; + } + + /** + * RBACBindingConfig allows user to restrict ClusterRoleBindings an + * RoleBindings that can be created. + * + * Generated from protobuf field optional .google.container.v1.RBACBindingConfig desired_rbac_binding_config = 144; + * @return \Google\Cloud\Container\V1\RBACBindingConfig|null + */ + public function getDesiredRbacBindingConfig() + { + return $this->desired_rbac_binding_config; + } + + public function hasDesiredRbacBindingConfig() + { + return isset($this->desired_rbac_binding_config); + } + + public function clearDesiredRbacBindingConfig() + { + unset($this->desired_rbac_binding_config); + } + + /** + * RBACBindingConfig allows user to restrict ClusterRoleBindings an + * RoleBindings that can be created. + * + * Generated from protobuf field optional .google.container.v1.RBACBindingConfig desired_rbac_binding_config = 144; + * @param \Google\Cloud\Container\V1\RBACBindingConfig $var + * @return $this + */ + public function setDesiredRbacBindingConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\RBACBindingConfig::class); + $this->desired_rbac_binding_config = $var; + + return $this; + } + } diff --git a/Container/src/V1/CompliancePostureConfig.php b/Container/src/V1/CompliancePostureConfig.php new file mode 100644 index 000000000000..f0ba2f3a20b9 --- /dev/null +++ b/Container/src/V1/CompliancePostureConfig.php @@ -0,0 +1,112 @@ +google.container.v1.CompliancePostureConfig + */ +class CompliancePostureConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Defines the enablement mode for Compliance Posture. + * + * Generated from protobuf field optional .google.container.v1.CompliancePostureConfig.Mode mode = 1; + */ + protected $mode = null; + /** + * List of enabled compliance standards. + * + * Generated from protobuf field repeated .google.container.v1.CompliancePostureConfig.ComplianceStandard compliance_standards = 2; + */ + private $compliance_standards; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $mode + * Defines the enablement mode for Compliance Posture. + * @type array<\Google\Cloud\Container\V1\CompliancePostureConfig\ComplianceStandard>|\Google\Protobuf\Internal\RepeatedField $compliance_standards + * List of enabled compliance standards. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Container\V1\ClusterService::initOnce(); + parent::__construct($data); + } + + /** + * Defines the enablement mode for Compliance Posture. + * + * Generated from protobuf field optional .google.container.v1.CompliancePostureConfig.Mode mode = 1; + * @return int + */ + public function getMode() + { + return isset($this->mode) ? $this->mode : 0; + } + + public function hasMode() + { + return isset($this->mode); + } + + public function clearMode() + { + unset($this->mode); + } + + /** + * Defines the enablement mode for Compliance Posture. + * + * Generated from protobuf field optional .google.container.v1.CompliancePostureConfig.Mode mode = 1; + * @param int $var + * @return $this + */ + public function setMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Container\V1\CompliancePostureConfig\Mode::class); + $this->mode = $var; + + return $this; + } + + /** + * List of enabled compliance standards. + * + * Generated from protobuf field repeated .google.container.v1.CompliancePostureConfig.ComplianceStandard compliance_standards = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getComplianceStandards() + { + return $this->compliance_standards; + } + + /** + * List of enabled compliance standards. + * + * Generated from protobuf field repeated .google.container.v1.CompliancePostureConfig.ComplianceStandard compliance_standards = 2; + * @param array<\Google\Cloud\Container\V1\CompliancePostureConfig\ComplianceStandard>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setComplianceStandards($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Container\V1\CompliancePostureConfig\ComplianceStandard::class); + $this->compliance_standards = $arr; + + return $this; + } + +} + diff --git a/Container/src/V1/CompliancePostureConfig/ComplianceStandard.php b/Container/src/V1/CompliancePostureConfig/ComplianceStandard.php new file mode 100644 index 000000000000..4657961a0143 --- /dev/null +++ b/Container/src/V1/CompliancePostureConfig/ComplianceStandard.php @@ -0,0 +1,78 @@ +google.container.v1.CompliancePostureConfig.ComplianceStandard + */ +class ComplianceStandard extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the compliance standard. + * + * Generated from protobuf field optional string standard = 1; + */ + protected $standard = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $standard + * Name of the compliance standard. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Container\V1\ClusterService::initOnce(); + parent::__construct($data); + } + + /** + * Name of the compliance standard. + * + * Generated from protobuf field optional string standard = 1; + * @return string + */ + public function getStandard() + { + return isset($this->standard) ? $this->standard : ''; + } + + public function hasStandard() + { + return isset($this->standard); + } + + public function clearStandard() + { + unset($this->standard); + } + + /** + * Name of the compliance standard. + * + * Generated from protobuf field optional string standard = 1; + * @param string $var + * @return $this + */ + public function setStandard($var) + { + GPBUtil::checkString($var, True); + $this->standard = $var; + + return $this; + } + +} + + diff --git a/Container/src/V1/CompliancePostureConfig/Mode.php b/Container/src/V1/CompliancePostureConfig/Mode.php new file mode 100644 index 000000000000..e5ad0c416219 --- /dev/null +++ b/Container/src/V1/CompliancePostureConfig/Mode.php @@ -0,0 +1,62 @@ +google.container.v1.CompliancePostureConfig.Mode + */ +class Mode +{ + /** + * Default value not specified. + * + * Generated from protobuf enum MODE_UNSPECIFIED = 0; + */ + const MODE_UNSPECIFIED = 0; + /** + * Disables Compliance Posture features on the cluster. + * + * Generated from protobuf enum DISABLED = 1; + */ + const DISABLED = 1; + /** + * Enables Compliance Posture features on the cluster. + * + * Generated from protobuf enum ENABLED = 2; + */ + const ENABLED = 2; + + private static $valueToName = [ + self::MODE_UNSPECIFIED => 'MODE_UNSPECIFIED', + self::DISABLED => 'DISABLED', + self::ENABLED => 'ENABLED', + ]; + + 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/Container/src/V1/ControlPlaneEndpointsConfig.php b/Container/src/V1/ControlPlaneEndpointsConfig.php new file mode 100644 index 000000000000..fccd4802d779 --- /dev/null +++ b/Container/src/V1/ControlPlaneEndpointsConfig.php @@ -0,0 +1,121 @@ +google.container.v1.ControlPlaneEndpointsConfig + */ +class ControlPlaneEndpointsConfig extends \Google\Protobuf\Internal\Message +{ + /** + * DNS endpoint configuration. + * + * Generated from protobuf field .google.container.v1.ControlPlaneEndpointsConfig.DNSEndpointConfig dns_endpoint_config = 1; + */ + protected $dns_endpoint_config = null; + /** + * IP endpoints configuration. + * + * Generated from protobuf field .google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig ip_endpoints_config = 3; + */ + protected $ip_endpoints_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Container\V1\ControlPlaneEndpointsConfig\DNSEndpointConfig $dns_endpoint_config + * DNS endpoint configuration. + * @type \Google\Cloud\Container\V1\ControlPlaneEndpointsConfig\IPEndpointsConfig $ip_endpoints_config + * IP endpoints configuration. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Container\V1\ClusterService::initOnce(); + parent::__construct($data); + } + + /** + * DNS endpoint configuration. + * + * Generated from protobuf field .google.container.v1.ControlPlaneEndpointsConfig.DNSEndpointConfig dns_endpoint_config = 1; + * @return \Google\Cloud\Container\V1\ControlPlaneEndpointsConfig\DNSEndpointConfig|null + */ + public function getDnsEndpointConfig() + { + return $this->dns_endpoint_config; + } + + public function hasDnsEndpointConfig() + { + return isset($this->dns_endpoint_config); + } + + public function clearDnsEndpointConfig() + { + unset($this->dns_endpoint_config); + } + + /** + * DNS endpoint configuration. + * + * Generated from protobuf field .google.container.v1.ControlPlaneEndpointsConfig.DNSEndpointConfig dns_endpoint_config = 1; + * @param \Google\Cloud\Container\V1\ControlPlaneEndpointsConfig\DNSEndpointConfig $var + * @return $this + */ + public function setDnsEndpointConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\ControlPlaneEndpointsConfig\DNSEndpointConfig::class); + $this->dns_endpoint_config = $var; + + return $this; + } + + /** + * IP endpoints configuration. + * + * Generated from protobuf field .google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig ip_endpoints_config = 3; + * @return \Google\Cloud\Container\V1\ControlPlaneEndpointsConfig\IPEndpointsConfig|null + */ + public function getIpEndpointsConfig() + { + return $this->ip_endpoints_config; + } + + public function hasIpEndpointsConfig() + { + return isset($this->ip_endpoints_config); + } + + public function clearIpEndpointsConfig() + { + unset($this->ip_endpoints_config); + } + + /** + * IP endpoints configuration. + * + * Generated from protobuf field .google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig ip_endpoints_config = 3; + * @param \Google\Cloud\Container\V1\ControlPlaneEndpointsConfig\IPEndpointsConfig $var + * @return $this + */ + public function setIpEndpointsConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\ControlPlaneEndpointsConfig\IPEndpointsConfig::class); + $this->ip_endpoints_config = $var; + + return $this; + } + +} + diff --git a/Container/src/V1/ControlPlaneEndpointsConfig/DNSEndpointConfig.php b/Container/src/V1/ControlPlaneEndpointsConfig/DNSEndpointConfig.php new file mode 100644 index 000000000000..ac13124bb104 --- /dev/null +++ b/Container/src/V1/ControlPlaneEndpointsConfig/DNSEndpointConfig.php @@ -0,0 +1,132 @@ +google.container.v1.ControlPlaneEndpointsConfig.DNSEndpointConfig + */ +class DNSEndpointConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The cluster's DNS endpoint configuration. + * A DNS format address. This is accessible from the public internet. + * Ex: uid.us-central1.gke.goog. + * Always present, but the behavior may change according to the value of + * [DNSEndpointConfig.allow_external_traffic][google.container.v1.ControlPlaneEndpointsConfig.DNSEndpointConfig.allow_external_traffic]. + * + * Generated from protobuf field string endpoint = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $endpoint = ''; + /** + * Controls whether user traffic is allowed over this endpoint. Note that + * GCP-managed services may still use the endpoint even if this is false. + * + * Generated from protobuf field optional bool allow_external_traffic = 3; + */ + protected $allow_external_traffic = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $endpoint + * Output only. The cluster's DNS endpoint configuration. + * A DNS format address. This is accessible from the public internet. + * Ex: uid.us-central1.gke.goog. + * Always present, but the behavior may change according to the value of + * [DNSEndpointConfig.allow_external_traffic][google.container.v1.ControlPlaneEndpointsConfig.DNSEndpointConfig.allow_external_traffic]. + * @type bool $allow_external_traffic + * Controls whether user traffic is allowed over this endpoint. Note that + * GCP-managed services may still use the endpoint even if this is false. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Container\V1\ClusterService::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The cluster's DNS endpoint configuration. + * A DNS format address. This is accessible from the public internet. + * Ex: uid.us-central1.gke.goog. + * Always present, but the behavior may change according to the value of + * [DNSEndpointConfig.allow_external_traffic][google.container.v1.ControlPlaneEndpointsConfig.DNSEndpointConfig.allow_external_traffic]. + * + * Generated from protobuf field string endpoint = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getEndpoint() + { + return $this->endpoint; + } + + /** + * Output only. The cluster's DNS endpoint configuration. + * A DNS format address. This is accessible from the public internet. + * Ex: uid.us-central1.gke.goog. + * Always present, but the behavior may change according to the value of + * [DNSEndpointConfig.allow_external_traffic][google.container.v1.ControlPlaneEndpointsConfig.DNSEndpointConfig.allow_external_traffic]. + * + * Generated from protobuf field string endpoint = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setEndpoint($var) + { + GPBUtil::checkString($var, True); + $this->endpoint = $var; + + return $this; + } + + /** + * Controls whether user traffic is allowed over this endpoint. Note that + * GCP-managed services may still use the endpoint even if this is false. + * + * Generated from protobuf field optional bool allow_external_traffic = 3; + * @return bool + */ + public function getAllowExternalTraffic() + { + return isset($this->allow_external_traffic) ? $this->allow_external_traffic : false; + } + + public function hasAllowExternalTraffic() + { + return isset($this->allow_external_traffic); + } + + public function clearAllowExternalTraffic() + { + unset($this->allow_external_traffic); + } + + /** + * Controls whether user traffic is allowed over this endpoint. Note that + * GCP-managed services may still use the endpoint even if this is false. + * + * Generated from protobuf field optional bool allow_external_traffic = 3; + * @param bool $var + * @return $this + */ + public function setAllowExternalTraffic($var) + { + GPBUtil::checkBool($var); + $this->allow_external_traffic = $var; + + return $this; + } + +} + + diff --git a/Container/src/V1/ControlPlaneEndpointsConfig/IPEndpointsConfig.php b/Container/src/V1/ControlPlaneEndpointsConfig/IPEndpointsConfig.php new file mode 100644 index 000000000000..aef655946583 --- /dev/null +++ b/Container/src/V1/ControlPlaneEndpointsConfig/IPEndpointsConfig.php @@ -0,0 +1,380 @@ +google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig + */ +class IPEndpointsConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Controls whether to allow direct IP access. + * + * Generated from protobuf field optional bool enabled = 1; + */ + protected $enabled = null; + /** + * Controls whether the control plane allows access through a public IP. + * It is invalid to specify both + * [PrivateClusterConfig.enablePrivateEndpoint][] and this field at the same + * time. + * + * Generated from protobuf field optional bool enable_public_endpoint = 2; + */ + protected $enable_public_endpoint = null; + /** + * Controls whether the control plane's private endpoint is accessible from + * sources in other regions. + * It is invalid to specify both + * [PrivateClusterMasterGlobalAccessConfig.enabled][google.container.v1.PrivateClusterMasterGlobalAccessConfig.enabled] + * and this field at the same time. + * + * Generated from protobuf field optional bool global_access = 3; + */ + protected $global_access = null; + /** + * Configuration of authorized networks. If enabled, restricts access to the + * control plane based on source IP. + * It is invalid to specify both + * [Cluster.masterAuthorizedNetworksConfig][] and this field at the same + * time. + * + * Generated from protobuf field .google.container.v1.MasterAuthorizedNetworksConfig authorized_networks_config = 4; + */ + protected $authorized_networks_config = null; + /** + * Output only. The external IP address of this cluster's control plane. + * Only populated if enabled. + * + * Generated from protobuf field string public_endpoint = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $public_endpoint = ''; + /** + * Output only. The internal IP address of this cluster's control plane. + * Only populated if enabled. + * + * Generated from protobuf field string private_endpoint = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $private_endpoint = ''; + /** + * Subnet to provision the master's private endpoint during cluster + * creation. Specified in projects/*/regions/*/subnetworks/* format. It is + * invalid to specify both + * [PrivateClusterConfig.privateEndpointSubnetwork][] and this field at the + * same time. + * + * Generated from protobuf field string private_endpoint_subnetwork = 7; + */ + protected $private_endpoint_subnetwork = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enabled + * Controls whether to allow direct IP access. + * @type bool $enable_public_endpoint + * Controls whether the control plane allows access through a public IP. + * It is invalid to specify both + * [PrivateClusterConfig.enablePrivateEndpoint][] and this field at the same + * time. + * @type bool $global_access + * Controls whether the control plane's private endpoint is accessible from + * sources in other regions. + * It is invalid to specify both + * [PrivateClusterMasterGlobalAccessConfig.enabled][google.container.v1.PrivateClusterMasterGlobalAccessConfig.enabled] + * and this field at the same time. + * @type \Google\Cloud\Container\V1\MasterAuthorizedNetworksConfig $authorized_networks_config + * Configuration of authorized networks. If enabled, restricts access to the + * control plane based on source IP. + * It is invalid to specify both + * [Cluster.masterAuthorizedNetworksConfig][] and this field at the same + * time. + * @type string $public_endpoint + * Output only. The external IP address of this cluster's control plane. + * Only populated if enabled. + * @type string $private_endpoint + * Output only. The internal IP address of this cluster's control plane. + * Only populated if enabled. + * @type string $private_endpoint_subnetwork + * Subnet to provision the master's private endpoint during cluster + * creation. Specified in projects/*/regions/*/subnetworks/* format. It is + * invalid to specify both + * [PrivateClusterConfig.privateEndpointSubnetwork][] and this field at the + * same time. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Container\V1\ClusterService::initOnce(); + parent::__construct($data); + } + + /** + * Controls whether to allow direct IP access. + * + * Generated from protobuf field optional bool enabled = 1; + * @return bool + */ + public function getEnabled() + { + return isset($this->enabled) ? $this->enabled : false; + } + + public function hasEnabled() + { + return isset($this->enabled); + } + + public function clearEnabled() + { + unset($this->enabled); + } + + /** + * Controls whether to allow direct IP access. + * + * Generated from protobuf field optional bool enabled = 1; + * @param bool $var + * @return $this + */ + public function setEnabled($var) + { + GPBUtil::checkBool($var); + $this->enabled = $var; + + return $this; + } + + /** + * Controls whether the control plane allows access through a public IP. + * It is invalid to specify both + * [PrivateClusterConfig.enablePrivateEndpoint][] and this field at the same + * time. + * + * Generated from protobuf field optional bool enable_public_endpoint = 2; + * @return bool + */ + public function getEnablePublicEndpoint() + { + return isset($this->enable_public_endpoint) ? $this->enable_public_endpoint : false; + } + + public function hasEnablePublicEndpoint() + { + return isset($this->enable_public_endpoint); + } + + public function clearEnablePublicEndpoint() + { + unset($this->enable_public_endpoint); + } + + /** + * Controls whether the control plane allows access through a public IP. + * It is invalid to specify both + * [PrivateClusterConfig.enablePrivateEndpoint][] and this field at the same + * time. + * + * Generated from protobuf field optional bool enable_public_endpoint = 2; + * @param bool $var + * @return $this + */ + public function setEnablePublicEndpoint($var) + { + GPBUtil::checkBool($var); + $this->enable_public_endpoint = $var; + + return $this; + } + + /** + * Controls whether the control plane's private endpoint is accessible from + * sources in other regions. + * It is invalid to specify both + * [PrivateClusterMasterGlobalAccessConfig.enabled][google.container.v1.PrivateClusterMasterGlobalAccessConfig.enabled] + * and this field at the same time. + * + * Generated from protobuf field optional bool global_access = 3; + * @return bool + */ + public function getGlobalAccess() + { + return isset($this->global_access) ? $this->global_access : false; + } + + public function hasGlobalAccess() + { + return isset($this->global_access); + } + + public function clearGlobalAccess() + { + unset($this->global_access); + } + + /** + * Controls whether the control plane's private endpoint is accessible from + * sources in other regions. + * It is invalid to specify both + * [PrivateClusterMasterGlobalAccessConfig.enabled][google.container.v1.PrivateClusterMasterGlobalAccessConfig.enabled] + * and this field at the same time. + * + * Generated from protobuf field optional bool global_access = 3; + * @param bool $var + * @return $this + */ + public function setGlobalAccess($var) + { + GPBUtil::checkBool($var); + $this->global_access = $var; + + return $this; + } + + /** + * Configuration of authorized networks. If enabled, restricts access to the + * control plane based on source IP. + * It is invalid to specify both + * [Cluster.masterAuthorizedNetworksConfig][] and this field at the same + * time. + * + * Generated from protobuf field .google.container.v1.MasterAuthorizedNetworksConfig authorized_networks_config = 4; + * @return \Google\Cloud\Container\V1\MasterAuthorizedNetworksConfig|null + */ + public function getAuthorizedNetworksConfig() + { + return $this->authorized_networks_config; + } + + public function hasAuthorizedNetworksConfig() + { + return isset($this->authorized_networks_config); + } + + public function clearAuthorizedNetworksConfig() + { + unset($this->authorized_networks_config); + } + + /** + * Configuration of authorized networks. If enabled, restricts access to the + * control plane based on source IP. + * It is invalid to specify both + * [Cluster.masterAuthorizedNetworksConfig][] and this field at the same + * time. + * + * Generated from protobuf field .google.container.v1.MasterAuthorizedNetworksConfig authorized_networks_config = 4; + * @param \Google\Cloud\Container\V1\MasterAuthorizedNetworksConfig $var + * @return $this + */ + public function setAuthorizedNetworksConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\MasterAuthorizedNetworksConfig::class); + $this->authorized_networks_config = $var; + + return $this; + } + + /** + * Output only. The external IP address of this cluster's control plane. + * Only populated if enabled. + * + * Generated from protobuf field string public_endpoint = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getPublicEndpoint() + { + return $this->public_endpoint; + } + + /** + * Output only. The external IP address of this cluster's control plane. + * Only populated if enabled. + * + * Generated from protobuf field string public_endpoint = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setPublicEndpoint($var) + { + GPBUtil::checkString($var, True); + $this->public_endpoint = $var; + + return $this; + } + + /** + * Output only. The internal IP address of this cluster's control plane. + * Only populated if enabled. + * + * Generated from protobuf field string private_endpoint = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getPrivateEndpoint() + { + return $this->private_endpoint; + } + + /** + * Output only. The internal IP address of this cluster's control plane. + * Only populated if enabled. + * + * Generated from protobuf field string private_endpoint = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setPrivateEndpoint($var) + { + GPBUtil::checkString($var, True); + $this->private_endpoint = $var; + + return $this; + } + + /** + * Subnet to provision the master's private endpoint during cluster + * creation. Specified in projects/*/regions/*/subnetworks/* format. It is + * invalid to specify both + * [PrivateClusterConfig.privateEndpointSubnetwork][] and this field at the + * same time. + * + * Generated from protobuf field string private_endpoint_subnetwork = 7; + * @return string + */ + public function getPrivateEndpointSubnetwork() + { + return $this->private_endpoint_subnetwork; + } + + /** + * Subnet to provision the master's private endpoint during cluster + * creation. Specified in projects/*/regions/*/subnetworks/* format. It is + * invalid to specify both + * [PrivateClusterConfig.privateEndpointSubnetwork][] and this field at the + * same time. + * + * Generated from protobuf field string private_endpoint_subnetwork = 7; + * @param string $var + * @return $this + */ + public function setPrivateEndpointSubnetwork($var) + { + GPBUtil::checkString($var, True); + $this->private_endpoint_subnetwork = $var; + + return $this; + } + +} + + diff --git a/Container/src/V1/EnterpriseConfig.php b/Container/src/V1/EnterpriseConfig.php index 87d37561f0e8..8f53cca0b529 100644 --- a/Container/src/V1/EnterpriseConfig.php +++ b/Container/src/V1/EnterpriseConfig.php @@ -16,7 +16,7 @@ class EnterpriseConfig extends \Google\Protobuf\Internal\Message { /** - * Output only. cluster_tier specifies the premium tier of the cluster. + * Output only. cluster_tier indicates the effective tier of the cluster. * * Generated from protobuf field .google.container.v1.EnterpriseConfig.ClusterTier cluster_tier = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ @@ -29,7 +29,7 @@ class EnterpriseConfig extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type int $cluster_tier - * Output only. cluster_tier specifies the premium tier of the cluster. + * Output only. cluster_tier indicates the effective tier of the cluster. * } */ public function __construct($data = NULL) { @@ -38,7 +38,7 @@ public function __construct($data = NULL) { } /** - * Output only. cluster_tier specifies the premium tier of the cluster. + * Output only. cluster_tier indicates the effective tier of the cluster. * * Generated from protobuf field .google.container.v1.EnterpriseConfig.ClusterTier cluster_tier = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return int @@ -49,7 +49,7 @@ public function getClusterTier() } /** - * Output only. cluster_tier specifies the premium tier of the cluster. + * Output only. cluster_tier indicates the effective tier of the cluster. * * Generated from protobuf field .google.container.v1.EnterpriseConfig.ClusterTier cluster_tier = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param int $var diff --git a/Container/src/V1/LoggingComponentConfig/Component.php b/Container/src/V1/LoggingComponentConfig/Component.php index 2e72c43ef696..20604f85a96c 100644 --- a/Container/src/V1/LoggingComponentConfig/Component.php +++ b/Container/src/V1/LoggingComponentConfig/Component.php @@ -49,6 +49,18 @@ class Component * Generated from protobuf enum CONTROLLER_MANAGER = 5; */ const CONTROLLER_MANAGER = 5; + /** + * kcp-sshd + * + * Generated from protobuf enum KCP_SSHD = 7; + */ + const KCP_SSHD = 7; + /** + * kcp connection logs + * + * Generated from protobuf enum KCP_CONNECTION = 8; + */ + const KCP_CONNECTION = 8; private static $valueToName = [ self::COMPONENT_UNSPECIFIED => 'COMPONENT_UNSPECIFIED', @@ -57,6 +69,8 @@ class Component self::APISERVER => 'APISERVER', self::SCHEDULER => 'SCHEDULER', self::CONTROLLER_MANAGER => 'CONTROLLER_MANAGER', + self::KCP_SSHD => 'KCP_SSHD', + self::KCP_CONNECTION => 'KCP_CONNECTION', ]; public static function name($value) diff --git a/Container/src/V1/MasterAuth.php b/Container/src/V1/MasterAuth.php index 0637bf5ebdb2..86f08f6ce5dd 100644 --- a/Container/src/V1/MasterAuth.php +++ b/Container/src/V1/MasterAuth.php @@ -61,7 +61,8 @@ class MasterAuth extends \Google\Protobuf\Internal\Message protected $cluster_ca_certificate = ''; /** * Output only. Base64-encoded public certificate used by clients to - * authenticate to the cluster endpoint. + * authenticate to the cluster endpoint. Issued only if + * client_certificate_config is set. * * Generated from protobuf field string client_certificate = 101 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ @@ -106,7 +107,8 @@ class MasterAuth extends \Google\Protobuf\Internal\Message * trust for the cluster. * @type string $client_certificate * Output only. Base64-encoded public certificate used by clients to - * authenticate to the cluster endpoint. + * authenticate to the cluster endpoint. Issued only if + * client_certificate_config is set. * @type string $client_key * Output only. Base64-encoded private key used by clients to authenticate * to the cluster endpoint. @@ -273,7 +275,8 @@ public function setClusterCaCertificate($var) /** * Output only. Base64-encoded public certificate used by clients to - * authenticate to the cluster endpoint. + * authenticate to the cluster endpoint. Issued only if + * client_certificate_config is set. * * Generated from protobuf field string client_certificate = 101 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return string @@ -285,7 +288,8 @@ public function getClientCertificate() /** * Output only. Base64-encoded public certificate used by clients to - * authenticate to the cluster endpoint. + * authenticate to the cluster endpoint. Issued only if + * client_certificate_config is set. * * Generated from protobuf field string client_certificate = 101 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param string $var diff --git a/Container/src/V1/MasterAuthorizedNetworksConfig.php b/Container/src/V1/MasterAuthorizedNetworksConfig.php index f2d4ee45311c..f136b3f0d8b6 100644 --- a/Container/src/V1/MasterAuthorizedNetworksConfig.php +++ b/Container/src/V1/MasterAuthorizedNetworksConfig.php @@ -37,6 +37,12 @@ class MasterAuthorizedNetworksConfig extends \Google\Protobuf\Internal\Message * Generated from protobuf field optional bool gcp_public_cidrs_access_enabled = 3; */ protected $gcp_public_cidrs_access_enabled = null; + /** + * Whether master authorized networks is enforced on private endpoint or not. + * + * Generated from protobuf field optional bool private_endpoint_enforcement_enabled = 5; + */ + protected $private_endpoint_enforcement_enabled = null; /** * Constructor. @@ -51,6 +57,8 @@ class MasterAuthorizedNetworksConfig extends \Google\Protobuf\Internal\Message * Kubernetes master through HTTPS. * @type bool $gcp_public_cidrs_access_enabled * Whether master is accessbile via Google Compute Engine Public IP addresses. + * @type bool $private_endpoint_enforcement_enabled + * Whether master authorized networks is enforced on private endpoint or not. * } */ public function __construct($data = NULL) { @@ -148,5 +156,41 @@ public function setGcpPublicCidrsAccessEnabled($var) return $this; } + /** + * Whether master authorized networks is enforced on private endpoint or not. + * + * Generated from protobuf field optional bool private_endpoint_enforcement_enabled = 5; + * @return bool + */ + public function getPrivateEndpointEnforcementEnabled() + { + return isset($this->private_endpoint_enforcement_enabled) ? $this->private_endpoint_enforcement_enabled : false; + } + + public function hasPrivateEndpointEnforcementEnabled() + { + return isset($this->private_endpoint_enforcement_enabled); + } + + public function clearPrivateEndpointEnforcementEnabled() + { + unset($this->private_endpoint_enforcement_enabled); + } + + /** + * Whether master authorized networks is enforced on private endpoint or not. + * + * Generated from protobuf field optional bool private_endpoint_enforcement_enabled = 5; + * @param bool $var + * @return $this + */ + public function setPrivateEndpointEnforcementEnabled($var) + { + GPBUtil::checkBool($var); + $this->private_endpoint_enforcement_enabled = $var; + + return $this; + } + } diff --git a/Container/src/V1/NetworkConfig.php b/Container/src/V1/NetworkConfig.php index c10adc09c0bc..033e3ca44126 100644 --- a/Container/src/V1/NetworkConfig.php +++ b/Container/src/V1/NetworkConfig.php @@ -121,6 +121,16 @@ class NetworkConfig extends \Google\Protobuf\Internal\Message * Generated from protobuf field optional bool enable_cilium_clusterwide_network_policy = 21; */ protected $enable_cilium_clusterwide_network_policy = null; + /** + * Controls whether by default nodes have private IP addresses only. + * It is invalid to specify both [PrivateClusterConfig.enablePrivateNodes][] + * and this field at the same time. + * To update the default setting, use + * [ClusterUpdate.desired_default_enable_private_nodes][google.container.v1.ClusterUpdate.desired_default_enable_private_nodes] + * + * Generated from protobuf field optional bool default_enable_private_nodes = 22; + */ + protected $default_enable_private_nodes = null; /** * Constructor. @@ -174,6 +184,12 @@ class NetworkConfig extends \Google\Protobuf\Internal\Message * Now named inter-node transparent encryption. * @type bool $enable_cilium_clusterwide_network_policy * Whether CiliumClusterwideNetworkPolicy is enabled on this cluster. + * @type bool $default_enable_private_nodes + * Controls whether by default nodes have private IP addresses only. + * It is invalid to specify both [PrivateClusterConfig.enablePrivateNodes][] + * and this field at the same time. + * To update the default setting, use + * [ClusterUpdate.desired_default_enable_private_nodes][google.container.v1.ClusterUpdate.desired_default_enable_private_nodes] * } */ public function __construct($data = NULL) { @@ -683,5 +699,49 @@ public function setEnableCiliumClusterwideNetworkPolicy($var) return $this; } + /** + * Controls whether by default nodes have private IP addresses only. + * It is invalid to specify both [PrivateClusterConfig.enablePrivateNodes][] + * and this field at the same time. + * To update the default setting, use + * [ClusterUpdate.desired_default_enable_private_nodes][google.container.v1.ClusterUpdate.desired_default_enable_private_nodes] + * + * Generated from protobuf field optional bool default_enable_private_nodes = 22; + * @return bool + */ + public function getDefaultEnablePrivateNodes() + { + return isset($this->default_enable_private_nodes) ? $this->default_enable_private_nodes : false; + } + + public function hasDefaultEnablePrivateNodes() + { + return isset($this->default_enable_private_nodes); + } + + public function clearDefaultEnablePrivateNodes() + { + unset($this->default_enable_private_nodes); + } + + /** + * Controls whether by default nodes have private IP addresses only. + * It is invalid to specify both [PrivateClusterConfig.enablePrivateNodes][] + * and this field at the same time. + * To update the default setting, use + * [ClusterUpdate.desired_default_enable_private_nodes][google.container.v1.ClusterUpdate.desired_default_enable_private_nodes] + * + * Generated from protobuf field optional bool default_enable_private_nodes = 22; + * @param bool $var + * @return $this + */ + public function setDefaultEnablePrivateNodes($var) + { + GPBUtil::checkBool($var); + $this->default_enable_private_nodes = $var; + + return $this; + } + } diff --git a/Container/src/V1/NodeConfig.php b/Container/src/V1/NodeConfig.php index e3168f9ed1d5..57436b5cb6c3 100644 --- a/Container/src/V1/NodeConfig.php +++ b/Container/src/V1/NodeConfig.php @@ -337,12 +337,27 @@ class NodeConfig extends \Google\Protobuf\Internal\Message * Generated from protobuf field repeated .google.container.v1.SecondaryBootDisk secondary_boot_disks = 48; */ private $secondary_boot_disks; + /** + * List of Storage Pools where boot disks are provisioned. + * + * Generated from protobuf field repeated string storage_pools = 49; + */ + private $storage_pools; /** * Secondary boot disk update strategy. * * Generated from protobuf field optional .google.container.v1.SecondaryBootDiskUpdateStrategy secondary_boot_disk_update_strategy = 50; */ protected $secondary_boot_disk_update_strategy = null; + /** + * Output only. effective_cgroup_mode is the cgroup mode actually used by the + * node pool. It is determined by the cgroup mode specified in the + * LinuxNodeConfig or the default cgroup mode based on the cluster creation + * version. + * + * Generated from protobuf field .google.container.v1.NodeConfig.EffectiveCgroupMode effective_cgroup_mode = 55 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $effective_cgroup_mode = 0; /** * Constructor. @@ -516,8 +531,15 @@ class NodeConfig extends \Google\Protobuf\Internal\Message * Optional. Reserved for future use. * @type array<\Google\Cloud\Container\V1\SecondaryBootDisk>|\Google\Protobuf\Internal\RepeatedField $secondary_boot_disks * List of secondary boot disks attached to the nodes. + * @type array|\Google\Protobuf\Internal\RepeatedField $storage_pools + * List of Storage Pools where boot disks are provisioned. * @type \Google\Cloud\Container\V1\SecondaryBootDiskUpdateStrategy $secondary_boot_disk_update_strategy * Secondary boot disk update strategy. + * @type int $effective_cgroup_mode + * Output only. effective_cgroup_mode is the cgroup mode actually used by the + * node pool. It is determined by the cgroup mode specified in the + * LinuxNodeConfig or the default cgroup mode based on the cluster creation + * version. * } */ public function __construct($data = NULL) { @@ -1873,6 +1895,32 @@ public function setSecondaryBootDisks($var) return $this; } + /** + * List of Storage Pools where boot disks are provisioned. + * + * Generated from protobuf field repeated string storage_pools = 49; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getStoragePools() + { + return $this->storage_pools; + } + + /** + * List of Storage Pools where boot disks are provisioned. + * + * Generated from protobuf field repeated string storage_pools = 49; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setStoragePools($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->storage_pools = $arr; + + return $this; + } + /** * Secondary boot disk update strategy. * @@ -1909,5 +1957,37 @@ public function setSecondaryBootDiskUpdateStrategy($var) return $this; } + /** + * Output only. effective_cgroup_mode is the cgroup mode actually used by the + * node pool. It is determined by the cgroup mode specified in the + * LinuxNodeConfig or the default cgroup mode based on the cluster creation + * version. + * + * Generated from protobuf field .google.container.v1.NodeConfig.EffectiveCgroupMode effective_cgroup_mode = 55 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getEffectiveCgroupMode() + { + return $this->effective_cgroup_mode; + } + + /** + * Output only. effective_cgroup_mode is the cgroup mode actually used by the + * node pool. It is determined by the cgroup mode specified in the + * LinuxNodeConfig or the default cgroup mode based on the cluster creation + * version. + * + * Generated from protobuf field .google.container.v1.NodeConfig.EffectiveCgroupMode effective_cgroup_mode = 55 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setEffectiveCgroupMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Container\V1\NodeConfig\EffectiveCgroupMode::class); + $this->effective_cgroup_mode = $var; + + return $this; + } + } diff --git a/Container/src/V1/NodeConfig/EffectiveCgroupMode.php b/Container/src/V1/NodeConfig/EffectiveCgroupMode.php new file mode 100644 index 000000000000..aafc283b18a3 --- /dev/null +++ b/Container/src/V1/NodeConfig/EffectiveCgroupMode.php @@ -0,0 +1,65 @@ +google.container.v1.NodeConfig.EffectiveCgroupMode + */ +class EffectiveCgroupMode +{ + /** + * EFFECTIVE_CGROUP_MODE_UNSPECIFIED means the cgroup configuration for the + * node pool is unspecified, i.e. the node pool is a Windows node pool. + * + * Generated from protobuf enum EFFECTIVE_CGROUP_MODE_UNSPECIFIED = 0; + */ + const EFFECTIVE_CGROUP_MODE_UNSPECIFIED = 0; + /** + * CGROUP_MODE_V1 means the node pool is configured to use cgroupv1 for the + * cgroup configuration. + * + * Generated from protobuf enum EFFECTIVE_CGROUP_MODE_V1 = 1; + */ + const EFFECTIVE_CGROUP_MODE_V1 = 1; + /** + * CGROUP_MODE_V2 means the node pool is configured to use cgroupv2 for the + * cgroup configuration. + * + * Generated from protobuf enum EFFECTIVE_CGROUP_MODE_V2 = 2; + */ + const EFFECTIVE_CGROUP_MODE_V2 = 2; + + private static $valueToName = [ + self::EFFECTIVE_CGROUP_MODE_UNSPECIFIED => 'EFFECTIVE_CGROUP_MODE_UNSPECIFIED', + self::EFFECTIVE_CGROUP_MODE_V1 => 'EFFECTIVE_CGROUP_MODE_V1', + self::EFFECTIVE_CGROUP_MODE_V2 => 'EFFECTIVE_CGROUP_MODE_V2', + ]; + + 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/Container/src/V1/NodeNetworkConfig.php b/Container/src/V1/NodeNetworkConfig.php index 834f9cc666dd..b038dcc5e28d 100644 --- a/Container/src/V1/NodeNetworkConfig.php +++ b/Container/src/V1/NodeNetworkConfig.php @@ -57,7 +57,7 @@ class NodeNetworkConfig extends \Google\Protobuf\Internal\Message /** * Whether nodes have internal IP addresses only. * If enable_private_nodes is not specified, then the value is derived from - * [cluster.privateClusterConfig.enablePrivateNodes][google.container.v1beta1.PrivateClusterConfig.enablePrivateNodes] + * [Cluster.NetworkConfig.default_enable_private_nodes][] * * Generated from protobuf field optional bool enable_private_nodes = 9; */ @@ -142,7 +142,7 @@ class NodeNetworkConfig extends \Google\Protobuf\Internal\Message * @type bool $enable_private_nodes * Whether nodes have internal IP addresses only. * If enable_private_nodes is not specified, then the value is derived from - * [cluster.privateClusterConfig.enablePrivateNodes][google.container.v1beta1.PrivateClusterConfig.enablePrivateNodes] + * [Cluster.NetworkConfig.default_enable_private_nodes][] * @type \Google\Cloud\Container\V1\NodeNetworkConfig\NetworkPerformanceConfig $network_performance_config * Network bandwidth tier configuration. * @type \Google\Cloud\Container\V1\PodCIDROverprovisionConfig $pod_cidr_overprovision_config @@ -296,7 +296,7 @@ public function setPodIpv4CidrBlock($var) /** * Whether nodes have internal IP addresses only. * If enable_private_nodes is not specified, then the value is derived from - * [cluster.privateClusterConfig.enablePrivateNodes][google.container.v1beta1.PrivateClusterConfig.enablePrivateNodes] + * [Cluster.NetworkConfig.default_enable_private_nodes][] * * Generated from protobuf field optional bool enable_private_nodes = 9; * @return bool @@ -319,7 +319,7 @@ public function clearEnablePrivateNodes() /** * Whether nodes have internal IP addresses only. * If enable_private_nodes is not specified, then the value is derived from - * [cluster.privateClusterConfig.enablePrivateNodes][google.container.v1beta1.PrivateClusterConfig.enablePrivateNodes] + * [Cluster.NetworkConfig.default_enable_private_nodes][] * * Generated from protobuf field optional bool enable_private_nodes = 9; * @param bool $var diff --git a/Container/src/V1/ParallelstoreCsiDriverConfig.php b/Container/src/V1/ParallelstoreCsiDriverConfig.php new file mode 100644 index 000000000000..b793bd25dcb2 --- /dev/null +++ b/Container/src/V1/ParallelstoreCsiDriverConfig.php @@ -0,0 +1,71 @@ +google.container.v1.ParallelstoreCsiDriverConfig + */ +class ParallelstoreCsiDriverConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Whether the Cloud Storage Parallelstore CSI driver is enabled for this + * cluster. + * + * Generated from protobuf field bool enabled = 1; + */ + protected $enabled = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enabled + * Whether the Cloud Storage Parallelstore CSI driver is enabled for this + * cluster. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Container\V1\ClusterService::initOnce(); + parent::__construct($data); + } + + /** + * Whether the Cloud Storage Parallelstore CSI driver is enabled for this + * cluster. + * + * Generated from protobuf field bool enabled = 1; + * @return bool + */ + public function getEnabled() + { + return $this->enabled; + } + + /** + * Whether the Cloud Storage Parallelstore CSI driver is enabled for this + * cluster. + * + * Generated from protobuf field bool enabled = 1; + * @param bool $var + * @return $this + */ + public function setEnabled($var) + { + GPBUtil::checkBool($var); + $this->enabled = $var; + + return $this; + } + +} + diff --git a/Container/src/V1/PrivateClusterConfig.php b/Container/src/V1/PrivateClusterConfig.php index 77b0254d7b4a..a6c52fc08e08 100644 --- a/Container/src/V1/PrivateClusterConfig.php +++ b/Container/src/V1/PrivateClusterConfig.php @@ -19,14 +19,23 @@ class PrivateClusterConfig extends \Google\Protobuf\Internal\Message * Whether nodes have internal IP addresses only. If enabled, all nodes are * given only RFC 1918 private addresses and communicate with the master via * private networking. + * Deprecated: Use + * [NetworkConfig.default_enable_private_nodes][google.container.v1.NetworkConfig.default_enable_private_nodes] + * instead. * - * Generated from protobuf field bool enable_private_nodes = 1; + * Generated from protobuf field bool enable_private_nodes = 1 [deprecated = true]; + * @deprecated */ protected $enable_private_nodes = false; /** * Whether the master's internal IP address is used as the cluster endpoint. + * Deprecated: Use + * [ControlPlaneEndpointsConfig.IPEndpointsConfig.enable_public_endpoint][google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.enable_public_endpoint] + * instead. Note that the value of enable_public_endpoint is reversed: if + * enable_private_endpoint is false, then enable_public_endpoint will be true. * - * Generated from protobuf field bool enable_private_endpoint = 2; + * Generated from protobuf field bool enable_private_endpoint = 2 [deprecated = true]; + * @deprecated */ protected $enable_private_endpoint = false; /** @@ -40,14 +49,22 @@ class PrivateClusterConfig extends \Google\Protobuf\Internal\Message protected $master_ipv4_cidr_block = ''; /** * Output only. The internal IP address of this cluster's master endpoint. + * Deprecated: Use + * [ControlPlaneEndpointsConfig.IPEndpointsConfig.private_endpoint][google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.private_endpoint] + * instead. * - * Generated from protobuf field string private_endpoint = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * Generated from protobuf field string private_endpoint = 4 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @deprecated */ protected $private_endpoint = ''; /** * Output only. The external IP address of this cluster's master endpoint. + * Deprecated:Use + * [ControlPlaneEndpointsConfig.IPEndpointsConfig.public_endpoint][google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.public_endpoint] + * instead. * - * Generated from protobuf field string public_endpoint = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * Generated from protobuf field string public_endpoint = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @deprecated */ protected $public_endpoint = ''; /** @@ -58,15 +75,23 @@ class PrivateClusterConfig extends \Google\Protobuf\Internal\Message protected $peering_name = ''; /** * Controls master global access settings. + * Deprecated: Use + * [ControlPlaneEndpointsConfig.IPEndpointsConfig.enable_global_access][] + * instead. * - * Generated from protobuf field .google.container.v1.PrivateClusterMasterGlobalAccessConfig master_global_access_config = 8; + * Generated from protobuf field .google.container.v1.PrivateClusterMasterGlobalAccessConfig master_global_access_config = 8 [deprecated = true]; + * @deprecated */ protected $master_global_access_config = null; /** * Subnet to provision the master's private endpoint during cluster creation. * Specified in projects/*/regions/*/subnetworks/* format. + * Deprecated: Use + * [ControlPlaneEndpointsConfig.IPEndpointsConfig.private_endpoint_subnetwork][google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.private_endpoint_subnetwork] + * instead. * - * Generated from protobuf field string private_endpoint_subnetwork = 10; + * Generated from protobuf field string private_endpoint_subnetwork = 10 [deprecated = true]; + * @deprecated */ protected $private_endpoint_subnetwork = ''; @@ -80,8 +105,15 @@ class PrivateClusterConfig extends \Google\Protobuf\Internal\Message * Whether nodes have internal IP addresses only. If enabled, all nodes are * given only RFC 1918 private addresses and communicate with the master via * private networking. + * Deprecated: Use + * [NetworkConfig.default_enable_private_nodes][google.container.v1.NetworkConfig.default_enable_private_nodes] + * instead. * @type bool $enable_private_endpoint * Whether the master's internal IP address is used as the cluster endpoint. + * Deprecated: Use + * [ControlPlaneEndpointsConfig.IPEndpointsConfig.enable_public_endpoint][google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.enable_public_endpoint] + * instead. Note that the value of enable_public_endpoint is reversed: if + * enable_private_endpoint is false, then enable_public_endpoint will be true. * @type string $master_ipv4_cidr_block * The IP range in CIDR notation to use for the hosted master network. This * range will be used for assigning internal IP addresses to the master or @@ -89,15 +121,27 @@ class PrivateClusterConfig extends \Google\Protobuf\Internal\Message * any other ranges in use within the cluster's network. * @type string $private_endpoint * Output only. The internal IP address of this cluster's master endpoint. + * Deprecated: Use + * [ControlPlaneEndpointsConfig.IPEndpointsConfig.private_endpoint][google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.private_endpoint] + * instead. * @type string $public_endpoint * Output only. The external IP address of this cluster's master endpoint. + * Deprecated:Use + * [ControlPlaneEndpointsConfig.IPEndpointsConfig.public_endpoint][google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.public_endpoint] + * instead. * @type string $peering_name * Output only. The peering name in the customer VPC used by this cluster. * @type \Google\Cloud\Container\V1\PrivateClusterMasterGlobalAccessConfig $master_global_access_config * Controls master global access settings. + * Deprecated: Use + * [ControlPlaneEndpointsConfig.IPEndpointsConfig.enable_global_access][] + * instead. * @type string $private_endpoint_subnetwork * Subnet to provision the master's private endpoint during cluster creation. * Specified in projects/*/regions/*/subnetworks/* format. + * Deprecated: Use + * [ControlPlaneEndpointsConfig.IPEndpointsConfig.private_endpoint_subnetwork][google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.private_endpoint_subnetwork] + * instead. * } */ public function __construct($data = NULL) { @@ -109,12 +153,17 @@ public function __construct($data = NULL) { * Whether nodes have internal IP addresses only. If enabled, all nodes are * given only RFC 1918 private addresses and communicate with the master via * private networking. + * Deprecated: Use + * [NetworkConfig.default_enable_private_nodes][google.container.v1.NetworkConfig.default_enable_private_nodes] + * instead. * - * Generated from protobuf field bool enable_private_nodes = 1; + * Generated from protobuf field bool enable_private_nodes = 1 [deprecated = true]; * @return bool + * @deprecated */ public function getEnablePrivateNodes() { + @trigger_error('enable_private_nodes is deprecated.', E_USER_DEPRECATED); return $this->enable_private_nodes; } @@ -122,13 +171,18 @@ public function getEnablePrivateNodes() * Whether nodes have internal IP addresses only. If enabled, all nodes are * given only RFC 1918 private addresses and communicate with the master via * private networking. + * Deprecated: Use + * [NetworkConfig.default_enable_private_nodes][google.container.v1.NetworkConfig.default_enable_private_nodes] + * instead. * - * Generated from protobuf field bool enable_private_nodes = 1; + * Generated from protobuf field bool enable_private_nodes = 1 [deprecated = true]; * @param bool $var * @return $this + * @deprecated */ public function setEnablePrivateNodes($var) { + @trigger_error('enable_private_nodes is deprecated.', E_USER_DEPRECATED); GPBUtil::checkBool($var); $this->enable_private_nodes = $var; @@ -137,24 +191,36 @@ public function setEnablePrivateNodes($var) /** * Whether the master's internal IP address is used as the cluster endpoint. + * Deprecated: Use + * [ControlPlaneEndpointsConfig.IPEndpointsConfig.enable_public_endpoint][google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.enable_public_endpoint] + * instead. Note that the value of enable_public_endpoint is reversed: if + * enable_private_endpoint is false, then enable_public_endpoint will be true. * - * Generated from protobuf field bool enable_private_endpoint = 2; + * Generated from protobuf field bool enable_private_endpoint = 2 [deprecated = true]; * @return bool + * @deprecated */ public function getEnablePrivateEndpoint() { + @trigger_error('enable_private_endpoint is deprecated.', E_USER_DEPRECATED); return $this->enable_private_endpoint; } /** * Whether the master's internal IP address is used as the cluster endpoint. + * Deprecated: Use + * [ControlPlaneEndpointsConfig.IPEndpointsConfig.enable_public_endpoint][google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.enable_public_endpoint] + * instead. Note that the value of enable_public_endpoint is reversed: if + * enable_private_endpoint is false, then enable_public_endpoint will be true. * - * Generated from protobuf field bool enable_private_endpoint = 2; + * Generated from protobuf field bool enable_private_endpoint = 2 [deprecated = true]; * @param bool $var * @return $this + * @deprecated */ public function setEnablePrivateEndpoint($var) { + @trigger_error('enable_private_endpoint is deprecated.', E_USER_DEPRECATED); GPBUtil::checkBool($var); $this->enable_private_endpoint = $var; @@ -195,24 +261,34 @@ public function setMasterIpv4CidrBlock($var) /** * Output only. The internal IP address of this cluster's master endpoint. + * Deprecated: Use + * [ControlPlaneEndpointsConfig.IPEndpointsConfig.private_endpoint][google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.private_endpoint] + * instead. * - * Generated from protobuf field string private_endpoint = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * Generated from protobuf field string private_endpoint = 4 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * @return string + * @deprecated */ public function getPrivateEndpoint() { + @trigger_error('private_endpoint is deprecated.', E_USER_DEPRECATED); return $this->private_endpoint; } /** * Output only. The internal IP address of this cluster's master endpoint. + * Deprecated: Use + * [ControlPlaneEndpointsConfig.IPEndpointsConfig.private_endpoint][google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.private_endpoint] + * instead. * - * Generated from protobuf field string private_endpoint = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * Generated from protobuf field string private_endpoint = 4 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * @param string $var * @return $this + * @deprecated */ public function setPrivateEndpoint($var) { + @trigger_error('private_endpoint is deprecated.', E_USER_DEPRECATED); GPBUtil::checkString($var, True); $this->private_endpoint = $var; @@ -221,24 +297,34 @@ public function setPrivateEndpoint($var) /** * Output only. The external IP address of this cluster's master endpoint. + * Deprecated:Use + * [ControlPlaneEndpointsConfig.IPEndpointsConfig.public_endpoint][google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.public_endpoint] + * instead. * - * Generated from protobuf field string public_endpoint = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * Generated from protobuf field string public_endpoint = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * @return string + * @deprecated */ public function getPublicEndpoint() { + @trigger_error('public_endpoint is deprecated.', E_USER_DEPRECATED); return $this->public_endpoint; } /** * Output only. The external IP address of this cluster's master endpoint. + * Deprecated:Use + * [ControlPlaneEndpointsConfig.IPEndpointsConfig.public_endpoint][google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.public_endpoint] + * instead. * - * Generated from protobuf field string public_endpoint = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * Generated from protobuf field string public_endpoint = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; * @param string $var * @return $this + * @deprecated */ public function setPublicEndpoint($var) { + @trigger_error('public_endpoint is deprecated.', E_USER_DEPRECATED); GPBUtil::checkString($var, True); $this->public_endpoint = $var; @@ -273,34 +359,46 @@ public function setPeeringName($var) /** * Controls master global access settings. + * Deprecated: Use + * [ControlPlaneEndpointsConfig.IPEndpointsConfig.enable_global_access][] + * instead. * - * Generated from protobuf field .google.container.v1.PrivateClusterMasterGlobalAccessConfig master_global_access_config = 8; + * Generated from protobuf field .google.container.v1.PrivateClusterMasterGlobalAccessConfig master_global_access_config = 8 [deprecated = true]; * @return \Google\Cloud\Container\V1\PrivateClusterMasterGlobalAccessConfig|null + * @deprecated */ public function getMasterGlobalAccessConfig() { + @trigger_error('master_global_access_config is deprecated.', E_USER_DEPRECATED); return $this->master_global_access_config; } public function hasMasterGlobalAccessConfig() { + @trigger_error('master_global_access_config is deprecated.', E_USER_DEPRECATED); return isset($this->master_global_access_config); } public function clearMasterGlobalAccessConfig() { + @trigger_error('master_global_access_config is deprecated.', E_USER_DEPRECATED); unset($this->master_global_access_config); } /** * Controls master global access settings. + * Deprecated: Use + * [ControlPlaneEndpointsConfig.IPEndpointsConfig.enable_global_access][] + * instead. * - * Generated from protobuf field .google.container.v1.PrivateClusterMasterGlobalAccessConfig master_global_access_config = 8; + * Generated from protobuf field .google.container.v1.PrivateClusterMasterGlobalAccessConfig master_global_access_config = 8 [deprecated = true]; * @param \Google\Cloud\Container\V1\PrivateClusterMasterGlobalAccessConfig $var * @return $this + * @deprecated */ public function setMasterGlobalAccessConfig($var) { + @trigger_error('master_global_access_config is deprecated.', E_USER_DEPRECATED); GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\PrivateClusterMasterGlobalAccessConfig::class); $this->master_global_access_config = $var; @@ -310,25 +408,35 @@ public function setMasterGlobalAccessConfig($var) /** * Subnet to provision the master's private endpoint during cluster creation. * Specified in projects/*/regions/*/subnetworks/* format. + * Deprecated: Use + * [ControlPlaneEndpointsConfig.IPEndpointsConfig.private_endpoint_subnetwork][google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.private_endpoint_subnetwork] + * instead. * - * Generated from protobuf field string private_endpoint_subnetwork = 10; + * Generated from protobuf field string private_endpoint_subnetwork = 10 [deprecated = true]; * @return string + * @deprecated */ public function getPrivateEndpointSubnetwork() { + @trigger_error('private_endpoint_subnetwork is deprecated.', E_USER_DEPRECATED); return $this->private_endpoint_subnetwork; } /** * Subnet to provision the master's private endpoint during cluster creation. * Specified in projects/*/regions/*/subnetworks/* format. + * Deprecated: Use + * [ControlPlaneEndpointsConfig.IPEndpointsConfig.private_endpoint_subnetwork][google.container.v1.ControlPlaneEndpointsConfig.IPEndpointsConfig.private_endpoint_subnetwork] + * instead. * - * Generated from protobuf field string private_endpoint_subnetwork = 10; + * Generated from protobuf field string private_endpoint_subnetwork = 10 [deprecated = true]; * @param string $var * @return $this + * @deprecated */ public function setPrivateEndpointSubnetwork($var) { + @trigger_error('private_endpoint_subnetwork is deprecated.', E_USER_DEPRECATED); GPBUtil::checkString($var, True); $this->private_endpoint_subnetwork = $var; diff --git a/Container/src/V1/RBACBindingConfig.php b/Container/src/V1/RBACBindingConfig.php new file mode 100644 index 000000000000..27a645f8e165 --- /dev/null +++ b/Container/src/V1/RBACBindingConfig.php @@ -0,0 +1,130 @@ +google.container.v1.RBACBindingConfig + */ +class RBACBindingConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Setting this to true will allow any ClusterRoleBinding and RoleBinding + * with subjets system:anonymous or system:unauthenticated. + * + * Generated from protobuf field optional bool enable_insecure_binding_system_unauthenticated = 1; + */ + protected $enable_insecure_binding_system_unauthenticated = null; + /** + * Setting this to true will allow any ClusterRoleBinding and RoleBinding + * with subjects system:authenticated. + * + * Generated from protobuf field optional bool enable_insecure_binding_system_authenticated = 2; + */ + protected $enable_insecure_binding_system_authenticated = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enable_insecure_binding_system_unauthenticated + * Setting this to true will allow any ClusterRoleBinding and RoleBinding + * with subjets system:anonymous or system:unauthenticated. + * @type bool $enable_insecure_binding_system_authenticated + * Setting this to true will allow any ClusterRoleBinding and RoleBinding + * with subjects system:authenticated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Container\V1\ClusterService::initOnce(); + parent::__construct($data); + } + + /** + * Setting this to true will allow any ClusterRoleBinding and RoleBinding + * with subjets system:anonymous or system:unauthenticated. + * + * Generated from protobuf field optional bool enable_insecure_binding_system_unauthenticated = 1; + * @return bool + */ + public function getEnableInsecureBindingSystemUnauthenticated() + { + return isset($this->enable_insecure_binding_system_unauthenticated) ? $this->enable_insecure_binding_system_unauthenticated : false; + } + + public function hasEnableInsecureBindingSystemUnauthenticated() + { + return isset($this->enable_insecure_binding_system_unauthenticated); + } + + public function clearEnableInsecureBindingSystemUnauthenticated() + { + unset($this->enable_insecure_binding_system_unauthenticated); + } + + /** + * Setting this to true will allow any ClusterRoleBinding and RoleBinding + * with subjets system:anonymous or system:unauthenticated. + * + * Generated from protobuf field optional bool enable_insecure_binding_system_unauthenticated = 1; + * @param bool $var + * @return $this + */ + public function setEnableInsecureBindingSystemUnauthenticated($var) + { + GPBUtil::checkBool($var); + $this->enable_insecure_binding_system_unauthenticated = $var; + + return $this; + } + + /** + * Setting this to true will allow any ClusterRoleBinding and RoleBinding + * with subjects system:authenticated. + * + * Generated from protobuf field optional bool enable_insecure_binding_system_authenticated = 2; + * @return bool + */ + public function getEnableInsecureBindingSystemAuthenticated() + { + return isset($this->enable_insecure_binding_system_authenticated) ? $this->enable_insecure_binding_system_authenticated : false; + } + + public function hasEnableInsecureBindingSystemAuthenticated() + { + return isset($this->enable_insecure_binding_system_authenticated); + } + + public function clearEnableInsecureBindingSystemAuthenticated() + { + unset($this->enable_insecure_binding_system_authenticated); + } + + /** + * Setting this to true will allow any ClusterRoleBinding and RoleBinding + * with subjects system:authenticated. + * + * Generated from protobuf field optional bool enable_insecure_binding_system_authenticated = 2; + * @param bool $var + * @return $this + */ + public function setEnableInsecureBindingSystemAuthenticated($var) + { + GPBUtil::checkBool($var); + $this->enable_insecure_binding_system_authenticated = $var; + + return $this; + } + +} + diff --git a/Container/src/V1/SecretManagerConfig.php b/Container/src/V1/SecretManagerConfig.php new file mode 100644 index 000000000000..413ae666b79b --- /dev/null +++ b/Container/src/V1/SecretManagerConfig.php @@ -0,0 +1,77 @@ +google.container.v1.SecretManagerConfig + */ +class SecretManagerConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Enable/Disable Secret Manager Config. + * + * Generated from protobuf field optional bool enabled = 1; + */ + protected $enabled = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enabled + * Enable/Disable Secret Manager Config. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Container\V1\ClusterService::initOnce(); + parent::__construct($data); + } + + /** + * Enable/Disable Secret Manager Config. + * + * Generated from protobuf field optional bool enabled = 1; + * @return bool + */ + public function getEnabled() + { + return isset($this->enabled) ? $this->enabled : false; + } + + public function hasEnabled() + { + return isset($this->enabled); + } + + public function clearEnabled() + { + unset($this->enabled); + } + + /** + * Enable/Disable Secret Manager Config. + * + * Generated from protobuf field optional bool enabled = 1; + * @param bool $var + * @return $this + */ + public function setEnabled($var) + { + GPBUtil::checkBool($var); + $this->enabled = $var; + + return $this; + } + +} + diff --git a/Container/src/V1/ServerConfig/ReleaseChannelConfig.php b/Container/src/V1/ServerConfig/ReleaseChannelConfig.php index 1f57633a601e..ba13f0b6f1d2 100644 --- a/Container/src/V1/ServerConfig/ReleaseChannelConfig.php +++ b/Container/src/V1/ServerConfig/ReleaseChannelConfig.php @@ -33,6 +33,12 @@ class ReleaseChannelConfig extends \Google\Protobuf\Internal\Message * Generated from protobuf field repeated string valid_versions = 4; */ private $valid_versions; + /** + * The auto upgrade target version for clusters on the channel. + * + * Generated from protobuf field string upgrade_target_version = 5; + */ + protected $upgrade_target_version = ''; /** * Constructor. @@ -46,6 +52,8 @@ class ReleaseChannelConfig extends \Google\Protobuf\Internal\Message * The default version for newly created clusters on the channel. * @type array|\Google\Protobuf\Internal\RepeatedField $valid_versions * List of valid versions for the channel. + * @type string $upgrade_target_version + * The auto upgrade target version for clusters on the channel. * } */ public function __construct($data = NULL) { @@ -131,6 +139,32 @@ public function setValidVersions($var) return $this; } + /** + * The auto upgrade target version for clusters on the channel. + * + * Generated from protobuf field string upgrade_target_version = 5; + * @return string + */ + public function getUpgradeTargetVersion() + { + return $this->upgrade_target_version; + } + + /** + * The auto upgrade target version for clusters on the channel. + * + * Generated from protobuf field string upgrade_target_version = 5; + * @param string $var + * @return $this + */ + public function setUpgradeTargetVersion($var) + { + GPBUtil::checkString($var, True); + $this->upgrade_target_version = $var; + + return $this; + } + } diff --git a/Container/src/V1/UpdateNodePoolRequest.php b/Container/src/V1/UpdateNodePoolRequest.php index f87357ecffba..819f61b0d04a 100644 --- a/Container/src/V1/UpdateNodePoolRequest.php +++ b/Container/src/V1/UpdateNodePoolRequest.php @@ -253,6 +253,13 @@ class UpdateNodePoolRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.container.v1.NodePool.QueuedProvisioning queued_provisioning = 42; */ protected $queued_provisioning = null; + /** + * List of Storage Pools where boot disks are provisioned. + * Existing Storage Pools will be replaced with storage-pools. + * + * Generated from protobuf field repeated string storage_pools = 43; + */ + private $storage_pools; /** * Constructor. @@ -370,6 +377,9 @@ class UpdateNodePoolRequest extends \Google\Protobuf\Internal\Message * config. * @type \Google\Cloud\Container\V1\NodePool\QueuedProvisioning $queued_provisioning * Specifies the configuration of queued provisioning. + * @type array|\Google\Protobuf\Internal\RepeatedField $storage_pools + * List of Storage Pools where boot disks are provisioned. + * Existing Storage Pools will be replaced with storage-pools. * } */ public function __construct($data = NULL) { @@ -1475,5 +1485,33 @@ public function setQueuedProvisioning($var) return $this; } + /** + * List of Storage Pools where boot disks are provisioned. + * Existing Storage Pools will be replaced with storage-pools. + * + * Generated from protobuf field repeated string storage_pools = 43; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getStoragePools() + { + return $this->storage_pools; + } + + /** + * List of Storage Pools where boot disks are provisioned. + * Existing Storage Pools will be replaced with storage-pools. + * + * Generated from protobuf field repeated string storage_pools = 43; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setStoragePools($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->storage_pools = $arr; + + return $this; + } + } diff --git a/Container/src/V1/UserManagedKeysConfig.php b/Container/src/V1/UserManagedKeysConfig.php new file mode 100644 index 000000000000..60c2e5353c30 --- /dev/null +++ b/Container/src/V1/UserManagedKeysConfig.php @@ -0,0 +1,354 @@ +google.container.v1.UserManagedKeysConfig + */ +class UserManagedKeysConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The Certificate Authority Service caPool to use for the cluster CA in this + * cluster. + * + * Generated from protobuf field string cluster_ca = 10 [(.google.api.resource_reference) = { + */ + protected $cluster_ca = ''; + /** + * Resource path of the Certificate Authority Service caPool to use for the + * etcd API CA in this cluster. + * + * Generated from protobuf field string etcd_api_ca = 11 [(.google.api.resource_reference) = { + */ + protected $etcd_api_ca = ''; + /** + * Resource path of the Certificate Authority Service caPool to use for the + * etcd peer CA in this cluster. + * + * Generated from protobuf field string etcd_peer_ca = 12 [(.google.api.resource_reference) = { + */ + protected $etcd_peer_ca = ''; + /** + * The Cloud KMS cryptoKeyVersions to use for signing service account JWTs + * issued by this cluster. + * Format: + * `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{cryptoKey}/cryptoKeyVersions/{cryptoKeyVersion}` + * + * Generated from protobuf field repeated string service_account_signing_keys = 13 [(.google.api.resource_reference) = { + */ + private $service_account_signing_keys; + /** + * The Cloud KMS cryptoKeyVersions to use for verifying service account JWTs + * issued by this cluster. + * Format: + * `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{cryptoKey}/cryptoKeyVersions/{cryptoKeyVersion}` + * + * Generated from protobuf field repeated string service_account_verification_keys = 14 [(.google.api.resource_reference) = { + */ + private $service_account_verification_keys; + /** + * The Certificate Authority Service caPool to use for the aggregation CA in + * this cluster. + * + * Generated from protobuf field string aggregation_ca = 15 [(.google.api.resource_reference) = { + */ + protected $aggregation_ca = ''; + /** + * The Cloud KMS cryptoKey to use for Confidential Hyperdisk on the control + * plane nodes. + * + * Generated from protobuf field string control_plane_disk_encryption_key = 16 [(.google.api.resource_reference) = { + */ + protected $control_plane_disk_encryption_key = ''; + /** + * Resource path of the Cloud KMS cryptoKey to use for encryption of internal + * etcd backups. + * + * Generated from protobuf field string gkeops_etcd_backup_encryption_key = 17 [(.google.api.resource_reference) = { + */ + protected $gkeops_etcd_backup_encryption_key = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $cluster_ca + * The Certificate Authority Service caPool to use for the cluster CA in this + * cluster. + * @type string $etcd_api_ca + * Resource path of the Certificate Authority Service caPool to use for the + * etcd API CA in this cluster. + * @type string $etcd_peer_ca + * Resource path of the Certificate Authority Service caPool to use for the + * etcd peer CA in this cluster. + * @type array|\Google\Protobuf\Internal\RepeatedField $service_account_signing_keys + * The Cloud KMS cryptoKeyVersions to use for signing service account JWTs + * issued by this cluster. + * Format: + * `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{cryptoKey}/cryptoKeyVersions/{cryptoKeyVersion}` + * @type array|\Google\Protobuf\Internal\RepeatedField $service_account_verification_keys + * The Cloud KMS cryptoKeyVersions to use for verifying service account JWTs + * issued by this cluster. + * Format: + * `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{cryptoKey}/cryptoKeyVersions/{cryptoKeyVersion}` + * @type string $aggregation_ca + * The Certificate Authority Service caPool to use for the aggregation CA in + * this cluster. + * @type string $control_plane_disk_encryption_key + * The Cloud KMS cryptoKey to use for Confidential Hyperdisk on the control + * plane nodes. + * @type string $gkeops_etcd_backup_encryption_key + * Resource path of the Cloud KMS cryptoKey to use for encryption of internal + * etcd backups. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Container\V1\ClusterService::initOnce(); + parent::__construct($data); + } + + /** + * The Certificate Authority Service caPool to use for the cluster CA in this + * cluster. + * + * Generated from protobuf field string cluster_ca = 10 [(.google.api.resource_reference) = { + * @return string + */ + public function getClusterCa() + { + return $this->cluster_ca; + } + + /** + * The Certificate Authority Service caPool to use for the cluster CA in this + * cluster. + * + * Generated from protobuf field string cluster_ca = 10 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setClusterCa($var) + { + GPBUtil::checkString($var, True); + $this->cluster_ca = $var; + + return $this; + } + + /** + * Resource path of the Certificate Authority Service caPool to use for the + * etcd API CA in this cluster. + * + * Generated from protobuf field string etcd_api_ca = 11 [(.google.api.resource_reference) = { + * @return string + */ + public function getEtcdApiCa() + { + return $this->etcd_api_ca; + } + + /** + * Resource path of the Certificate Authority Service caPool to use for the + * etcd API CA in this cluster. + * + * Generated from protobuf field string etcd_api_ca = 11 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setEtcdApiCa($var) + { + GPBUtil::checkString($var, True); + $this->etcd_api_ca = $var; + + return $this; + } + + /** + * Resource path of the Certificate Authority Service caPool to use for the + * etcd peer CA in this cluster. + * + * Generated from protobuf field string etcd_peer_ca = 12 [(.google.api.resource_reference) = { + * @return string + */ + public function getEtcdPeerCa() + { + return $this->etcd_peer_ca; + } + + /** + * Resource path of the Certificate Authority Service caPool to use for the + * etcd peer CA in this cluster. + * + * Generated from protobuf field string etcd_peer_ca = 12 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setEtcdPeerCa($var) + { + GPBUtil::checkString($var, True); + $this->etcd_peer_ca = $var; + + return $this; + } + + /** + * The Cloud KMS cryptoKeyVersions to use for signing service account JWTs + * issued by this cluster. + * Format: + * `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{cryptoKey}/cryptoKeyVersions/{cryptoKeyVersion}` + * + * Generated from protobuf field repeated string service_account_signing_keys = 13 [(.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getServiceAccountSigningKeys() + { + return $this->service_account_signing_keys; + } + + /** + * The Cloud KMS cryptoKeyVersions to use for signing service account JWTs + * issued by this cluster. + * Format: + * `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{cryptoKey}/cryptoKeyVersions/{cryptoKeyVersion}` + * + * Generated from protobuf field repeated string service_account_signing_keys = 13 [(.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setServiceAccountSigningKeys($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->service_account_signing_keys = $arr; + + return $this; + } + + /** + * The Cloud KMS cryptoKeyVersions to use for verifying service account JWTs + * issued by this cluster. + * Format: + * `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{cryptoKey}/cryptoKeyVersions/{cryptoKeyVersion}` + * + * Generated from protobuf field repeated string service_account_verification_keys = 14 [(.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getServiceAccountVerificationKeys() + { + return $this->service_account_verification_keys; + } + + /** + * The Cloud KMS cryptoKeyVersions to use for verifying service account JWTs + * issued by this cluster. + * Format: + * `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{cryptoKey}/cryptoKeyVersions/{cryptoKeyVersion}` + * + * Generated from protobuf field repeated string service_account_verification_keys = 14 [(.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setServiceAccountVerificationKeys($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->service_account_verification_keys = $arr; + + return $this; + } + + /** + * The Certificate Authority Service caPool to use for the aggregation CA in + * this cluster. + * + * Generated from protobuf field string aggregation_ca = 15 [(.google.api.resource_reference) = { + * @return string + */ + public function getAggregationCa() + { + return $this->aggregation_ca; + } + + /** + * The Certificate Authority Service caPool to use for the aggregation CA in + * this cluster. + * + * Generated from protobuf field string aggregation_ca = 15 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAggregationCa($var) + { + GPBUtil::checkString($var, True); + $this->aggregation_ca = $var; + + return $this; + } + + /** + * The Cloud KMS cryptoKey to use for Confidential Hyperdisk on the control + * plane nodes. + * + * Generated from protobuf field string control_plane_disk_encryption_key = 16 [(.google.api.resource_reference) = { + * @return string + */ + public function getControlPlaneDiskEncryptionKey() + { + return $this->control_plane_disk_encryption_key; + } + + /** + * The Cloud KMS cryptoKey to use for Confidential Hyperdisk on the control + * plane nodes. + * + * Generated from protobuf field string control_plane_disk_encryption_key = 16 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setControlPlaneDiskEncryptionKey($var) + { + GPBUtil::checkString($var, True); + $this->control_plane_disk_encryption_key = $var; + + return $this; + } + + /** + * Resource path of the Cloud KMS cryptoKey to use for encryption of internal + * etcd backups. + * + * Generated from protobuf field string gkeops_etcd_backup_encryption_key = 17 [(.google.api.resource_reference) = { + * @return string + */ + public function getGkeopsEtcdBackupEncryptionKey() + { + return $this->gkeops_etcd_backup_encryption_key; + } + + /** + * Resource path of the Cloud KMS cryptoKey to use for encryption of internal + * etcd backups. + * + * Generated from protobuf field string gkeops_etcd_backup_encryption_key = 17 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setGkeopsEtcdBackupEncryptionKey($var) + { + GPBUtil::checkString($var, True); + $this->gkeops_etcd_backup_encryption_key = $var; + + return $this; + } + +} + diff --git a/Container/src/V1/resources/cluster_manager_descriptor_config.php b/Container/src/V1/resources/cluster_manager_descriptor_config.php index 1b330b402c69..3d5643144725 100644 --- a/Container/src/V1/resources/cluster_manager_descriptor_config.php +++ b/Container/src/V1/resources/cluster_manager_descriptor_config.php @@ -998,6 +998,8 @@ ], ], 'templateMap' => [ + 'caPool' => 'projects/{project}/locations/{location}/caPools/{ca_pool}', + 'cryptoKeyVersion' => 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}', 'topic' => 'projects/{project}/topics/{topic}', ], ], From dd48f72f8ca75bb3d038fc717338a5a39d24c977 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 11:20:33 -0700 Subject: [PATCH 05/34] feat: protos for R/W transaction support on multiplexed sessions (#7736) PiperOrigin-RevId: 683879049 Source-Link: https://github.com/googleapis/googleapis/commit/2b6b93bc89ecf122e1bd230e6d07312b0185cbe5 Source-Link: https://github.com/googleapis/googleapis-gen/commit/2f0c933b003164d5cd120505a98c87c95888d98f Copy-Tag: eyJwIjoiU3Bhbm5lci8uT3dsQm90LnlhbWwiLCJoIjoiMmYwYzkzM2IwMDMxNjRkNWNkMTIwNTA1YTk4Yzg3Yzk1ODg4ZDk4ZiJ9 --- Spanner/metadata/V1/CommitResponse.php | Bin 1043 -> 1251 bytes Spanner/metadata/V1/ResultSet.php | Bin 1875 -> 2130 bytes Spanner/metadata/V1/Spanner.php | Bin 11742 -> 11965 bytes Spanner/metadata/V1/Transaction.php | Bin 1977 -> 2283 bytes Spanner/src/V1/BeginTransactionRequest.php | 64 ++++++++++ Spanner/src/V1/CommitRequest.php | 64 ++++++++++ Spanner/src/V1/CommitResponse.php | 45 +++++++ Spanner/src/V1/ExecuteBatchDmlResponse.php | 68 +++++++++++ Spanner/src/V1/Gapic/SpannerGapicClient.php | 23 ++++ .../V1/MultiplexedSessionPrecommitToken.php | 112 ++++++++++++++++++ Spanner/src/V1/PartialResultSet.php | 68 +++++++++++ Spanner/src/V1/ResultSet.php | 68 +++++++++++ Spanner/src/V1/Transaction.php | 76 ++++++++++++ .../src/V1/TransactionOptions/ReadWrite.php | 50 ++++++++ 14 files changed, 638 insertions(+) create mode 100644 Spanner/src/V1/MultiplexedSessionPrecommitToken.php diff --git a/Spanner/metadata/V1/CommitResponse.php b/Spanner/metadata/V1/CommitResponse.php index 46823eb678dc24db91fcbc2c3b4b5eafd7d7e340..b5451ada8ff4d3bfe0d4b58d7492dfdfb04719dd 100644 GIT binary patch delta 198 zcmbQt@tAYNb4JFPiFL9(F(E~XdBuszC7JnolP@y5G96->EWu=}A*Gz2pP!zSs$X1? zn3tDYq+e#JUxHAoS5TB+lCLzEX>tTpcYu%|7k@!fYI1&VZe~e*Nq%-}o&<{mqXxH; zu^z-2J*Y8yWrljbr8y;;1v#k|sVTv!#l=9217LbXKw3Q*CO>A+? delta 35 rcmaFNIhkX_bH>T)O!`clm?uXt*)l6_Vw}8}seAGaW{u6anK>8%+BOT3 diff --git a/Spanner/metadata/V1/ResultSet.php b/Spanner/metadata/V1/ResultSet.php index 2f63b0c51704ac35eabe39b9dac1ce59ebb6d5c1..f702c5d7c9b996b7be3244ba42e87fc6bc90906b 100644 GIT binary patch delta 245 zcmcc2cS&HwRz^X`g3K7V%+#C|r__wZvdsLV$wwHqHg9F*W@PE*;!>LEtu*-=lZdQL zdVYR-PO5%EQGQ8&QfZogaY<2Wa)}<8Klvw92FoW#F3!n(EKZY`Ge=7c1#N7W9I^u<{Q|Q( L9c}@$`yRp%5P%aD diff --git a/Spanner/metadata/V1/Transaction.php b/Spanner/metadata/V1/Transaction.php index be467b14b3f65800f51d924335d6c3558e7c7cf9..d7fd2b4b2856ca6c6f997e98272764124bdcd02f 100644 GIT binary patch delta 327 zcmdnV|5|Xv4n{%8g3K7V%+#C|r__wZvdsLV$tM|&Cm&?&WSY%0*@wweUM@X9KRqW^ zzo00;BtNM%O+TfyD6u3nKTi)VGP#9GiSgX#.google.spanner.v1.RequestOptions request_options = 3; */ private $request_options = null; + /** + * Optional. Required for read-write transactions on a multiplexed session + * that commit mutations but do not perform any reads or queries. Clients + * should randomly select one of the mutations from the mutation set and send + * it as a part of this request. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field .google.spanner.v1.Mutation mutation_key = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $mutation_key = null; /** * @param string $session Required. The session in which the transaction runs. Please see @@ -71,6 +82,13 @@ public static function build(string $session, \Google\Cloud\Spanner\V1\Transacti * request_options struct will not do anything. To set the priority for a * transaction, set it on the reads and writes that are part of this * transaction instead. + * @type \Google\Cloud\Spanner\V1\Mutation $mutation_key + * Optional. Required for read-write transactions on a multiplexed session + * that commit mutations but do not perform any reads or queries. Clients + * should randomly select one of the mutations from the mutation set and send + * it as a part of this request. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. * } */ public function __construct($data = NULL) { @@ -184,5 +202,51 @@ public function setRequestOptions($var) return $this; } + /** + * Optional. Required for read-write transactions on a multiplexed session + * that commit mutations but do not perform any reads or queries. Clients + * should randomly select one of the mutations from the mutation set and send + * it as a part of this request. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field .google.spanner.v1.Mutation mutation_key = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Spanner\V1\Mutation|null + */ + public function getMutationKey() + { + return $this->mutation_key; + } + + public function hasMutationKey() + { + return isset($this->mutation_key); + } + + public function clearMutationKey() + { + unset($this->mutation_key); + } + + /** + * Optional. Required for read-write transactions on a multiplexed session + * that commit mutations but do not perform any reads or queries. Clients + * should randomly select one of the mutations from the mutation set and send + * it as a part of this request. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field .google.spanner.v1.Mutation mutation_key = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Spanner\V1\Mutation $var + * @return $this + */ + public function setMutationKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Spanner\V1\Mutation::class); + $this->mutation_key = $var; + + return $this; + } + } diff --git a/Spanner/src/V1/CommitRequest.php b/Spanner/src/V1/CommitRequest.php index b1e61d74be46..7c3e8d1a8e5e 100644 --- a/Spanner/src/V1/CommitRequest.php +++ b/Spanner/src/V1/CommitRequest.php @@ -53,6 +53,17 @@ class CommitRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.spanner.v1.RequestOptions request_options = 6; */ private $request_options = null; + /** + * Optional. If the read-write transaction was executed on a multiplexed + * session, the precommit token with the highest sequence number received in + * this transaction attempt, should be included here. Failing to do so will + * result in a FailedPrecondition error. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field .google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $precommit_token = null; protected $transaction; /** @@ -139,6 +150,13 @@ public static function buildFromSessionSingleUseTransactionMutations(string $ses * and 500 ms. * @type \Google\Cloud\Spanner\V1\RequestOptions $request_options * Common options for this request. + * @type \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken $precommit_token + * Optional. If the read-write transaction was executed on a multiplexed + * session, the precommit token with the highest sequence number received in + * this transaction attempt, should be included here. Failing to do so will + * result in a FailedPrecondition error. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. * } */ public function __construct($data = NULL) { @@ -390,6 +408,52 @@ public function setRequestOptions($var) return $this; } + /** + * Optional. If the read-write transaction was executed on a multiplexed + * session, the precommit token with the highest sequence number received in + * this transaction attempt, should be included here. Failing to do so will + * result in a FailedPrecondition error. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field .google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken|null + */ + public function getPrecommitToken() + { + return $this->precommit_token; + } + + public function hasPrecommitToken() + { + return isset($this->precommit_token); + } + + public function clearPrecommitToken() + { + unset($this->precommit_token); + } + + /** + * Optional. If the read-write transaction was executed on a multiplexed + * session, the precommit token with the highest sequence number received in + * this transaction attempt, should be included here. Failing to do so will + * result in a FailedPrecondition error. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field .google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken $var + * @return $this + */ + public function setPrecommitToken($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken::class); + $this->precommit_token = $var; + + return $this; + } + /** * @return string */ diff --git a/Spanner/src/V1/CommitResponse.php b/Spanner/src/V1/CommitResponse.php index fd2bb2d3d365..a6d684a73fbe 100644 --- a/Spanner/src/V1/CommitResponse.php +++ b/Spanner/src/V1/CommitResponse.php @@ -29,6 +29,7 @@ class CommitResponse extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.spanner.v1.CommitResponse.CommitStats commit_stats = 2; */ private $commit_stats = null; + protected $MultiplexedSessionRetry; /** * Constructor. @@ -42,6 +43,9 @@ class CommitResponse extends \Google\Protobuf\Internal\Message * The statistics about this Commit. Not returned by default. * For more information, see * [CommitRequest.return_commit_stats][google.spanner.v1.CommitRequest.return_commit_stats]. + * @type \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken $precommit_token + * If specified, transaction has not committed yet. + * Clients must retry the commit with the new precommit token. * } */ public function __construct($data = NULL) { @@ -125,5 +129,46 @@ public function setCommitStats($var) return $this; } + /** + * If specified, transaction has not committed yet. + * Clients must retry the commit with the new precommit token. + * + * Generated from protobuf field .google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 4; + * @return \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken|null + */ + public function getPrecommitToken() + { + return $this->readOneof(4); + } + + public function hasPrecommitToken() + { + return $this->hasOneof(4); + } + + /** + * If specified, transaction has not committed yet. + * Clients must retry the commit with the new precommit token. + * + * Generated from protobuf field .google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 4; + * @param \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken $var + * @return $this + */ + public function setPrecommitToken($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getMultiplexedSessionRetry() + { + return $this->whichOneof("MultiplexedSessionRetry"); + } + } diff --git a/Spanner/src/V1/ExecuteBatchDmlResponse.php b/Spanner/src/V1/ExecuteBatchDmlResponse.php index d6ca0ae8042f..e1564ca76883 100644 --- a/Spanner/src/V1/ExecuteBatchDmlResponse.php +++ b/Spanner/src/V1/ExecuteBatchDmlResponse.php @@ -59,6 +59,18 @@ class ExecuteBatchDmlResponse extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.rpc.Status status = 2; */ private $status = null; + /** + * Optional. A precommit token will be included if the read-write transaction + * is on a multiplexed session. + * The precommit token with the highest sequence number from this transaction + * attempt should be passed to the + * [Commit][google.spanner.v1.Spanner.Commit] request for this transaction. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field .google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $precommit_token = null; /** * Constructor. @@ -78,6 +90,14 @@ class ExecuteBatchDmlResponse extends \Google\Protobuf\Internal\Message * @type \Google\Rpc\Status $status * If all DML statements are executed successfully, the status is `OK`. * Otherwise, the error status of the first failed statement. + * @type \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken $precommit_token + * Optional. A precommit token will be included if the read-write transaction + * is on a multiplexed session. + * The precommit token with the highest sequence number from this transaction + * attempt should be passed to the + * [Commit][google.spanner.v1.Spanner.Commit] request for this transaction. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. * } */ public function __construct($data = NULL) { @@ -163,5 +183,53 @@ public function setStatus($var) return $this; } + /** + * Optional. A precommit token will be included if the read-write transaction + * is on a multiplexed session. + * The precommit token with the highest sequence number from this transaction + * attempt should be passed to the + * [Commit][google.spanner.v1.Spanner.Commit] request for this transaction. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field .google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken|null + */ + public function getPrecommitToken() + { + return $this->precommit_token; + } + + public function hasPrecommitToken() + { + return isset($this->precommit_token); + } + + public function clearPrecommitToken() + { + unset($this->precommit_token); + } + + /** + * Optional. A precommit token will be included if the read-write transaction + * is on a multiplexed session. + * The precommit token with the highest sequence number from this transaction + * attempt should be passed to the + * [Commit][google.spanner.v1.Spanner.Commit] request for this transaction. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field .google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken $var + * @return $this + */ + public function setPrecommitToken($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken::class); + $this->precommit_token = $var; + + return $this; + } + } diff --git a/Spanner/src/V1/Gapic/SpannerGapicClient.php b/Spanner/src/V1/Gapic/SpannerGapicClient.php index 7b28cd26a3f0..fc2159eb9d3e 100644 --- a/Spanner/src/V1/Gapic/SpannerGapicClient.php +++ b/Spanner/src/V1/Gapic/SpannerGapicClient.php @@ -55,6 +55,7 @@ use Google\Cloud\Spanner\V1\KeySet; use Google\Cloud\Spanner\V1\ListSessionsRequest; use Google\Cloud\Spanner\V1\ListSessionsResponse; +use Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken; use Google\Cloud\Spanner\V1\Mutation; use Google\Cloud\Spanner\V1\PartialResultSet; use Google\Cloud\Spanner\V1\PartitionOptions; @@ -534,6 +535,13 @@ public function batchWrite( * request_options struct will not do anything. To set the priority for a * transaction, set it on the reads and writes that are part of this * transaction instead. + * @type Mutation $mutationKey + * Optional. Required for read-write transactions on a multiplexed session + * that commit mutations but do not perform any reads or queries. Clients + * should randomly select one of the mutations from the mutation set and send + * it as a part of this request. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. * @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 @@ -558,6 +566,10 @@ public function beginTransaction( $request->setRequestOptions($optionalArgs['requestOptions']); } + if (isset($optionalArgs['mutationKey'])) { + $request->setMutationKey($optionalArgs['mutationKey']); + } + $requestParams = new RequestParamsHeaderDescriptor( $requestParamHeaders ); @@ -631,6 +643,13 @@ public function beginTransaction( * and 500 ms. * @type RequestOptions $requestOptions * Common options for this request. + * @type MultiplexedSessionPrecommitToken $precommitToken + * Optional. If the read-write transaction was executed on a multiplexed + * session, the precommit token with the highest sequence number received in + * this transaction attempt, should be included here. Failing to do so will + * result in a FailedPrecondition error. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. * @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 @@ -670,6 +689,10 @@ public function commit($session, $mutations, array $optionalArgs = []) $request->setRequestOptions($optionalArgs['requestOptions']); } + if (isset($optionalArgs['precommitToken'])) { + $request->setPrecommitToken($optionalArgs['precommitToken']); + } + $requestParams = new RequestParamsHeaderDescriptor( $requestParamHeaders ); diff --git a/Spanner/src/V1/MultiplexedSessionPrecommitToken.php b/Spanner/src/V1/MultiplexedSessionPrecommitToken.php new file mode 100644 index 000000000000..120fb93f232b --- /dev/null +++ b/Spanner/src/V1/MultiplexedSessionPrecommitToken.php @@ -0,0 +1,112 @@ +google.spanner.v1.MultiplexedSessionPrecommitToken + */ +class MultiplexedSessionPrecommitToken extends \Google\Protobuf\Internal\Message +{ + /** + * Opaque precommit token. + * + * Generated from protobuf field bytes precommit_token = 1; + */ + private $precommit_token = ''; + /** + * An incrementing seq number is generated on every precommit token + * that is returned. Clients should remember the precommit token with the + * highest sequence number from the current transaction attempt. + * + * Generated from protobuf field int32 seq_num = 2; + */ + private $seq_num = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $precommit_token + * Opaque precommit token. + * @type int $seq_num + * An incrementing seq number is generated on every precommit token + * that is returned. Clients should remember the precommit token with the + * highest sequence number from the current transaction attempt. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Spanner\V1\Transaction::initOnce(); + parent::__construct($data); + } + + /** + * Opaque precommit token. + * + * Generated from protobuf field bytes precommit_token = 1; + * @return string + */ + public function getPrecommitToken() + { + return $this->precommit_token; + } + + /** + * Opaque precommit token. + * + * Generated from protobuf field bytes precommit_token = 1; + * @param string $var + * @return $this + */ + public function setPrecommitToken($var) + { + GPBUtil::checkString($var, False); + $this->precommit_token = $var; + + return $this; + } + + /** + * An incrementing seq number is generated on every precommit token + * that is returned. Clients should remember the precommit token with the + * highest sequence number from the current transaction attempt. + * + * Generated from protobuf field int32 seq_num = 2; + * @return int + */ + public function getSeqNum() + { + return $this->seq_num; + } + + /** + * An incrementing seq number is generated on every precommit token + * that is returned. Clients should remember the precommit token with the + * highest sequence number from the current transaction attempt. + * + * Generated from protobuf field int32 seq_num = 2; + * @param int $var + * @return $this + */ + public function setSeqNum($var) + { + GPBUtil::checkInt32($var); + $this->seq_num = $var; + + return $this; + } + +} + diff --git a/Spanner/src/V1/PartialResultSet.php b/Spanner/src/V1/PartialResultSet.php index e85ac14eb057..f82b53a2f1a8 100644 --- a/Spanner/src/V1/PartialResultSet.php +++ b/Spanner/src/V1/PartialResultSet.php @@ -117,6 +117,18 @@ class PartialResultSet extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.spanner.v1.ResultSetStats stats = 5; */ private $stats = null; + /** + * Optional. A precommit token will be included if the read-write transaction + * is on a multiplexed session. + * The precommit token with the highest sequence number from this transaction + * attempt should be passed to the + * [Commit][google.spanner.v1.Spanner.Commit] request for this transaction. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field .google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $precommit_token = null; /** * Constructor. @@ -204,6 +216,14 @@ class PartialResultSet extends \Google\Protobuf\Internal\Message * only once with the last response in the stream. * This field will also be present in the last response for DML * statements. + * @type \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken $precommit_token + * Optional. A precommit token will be included if the read-write transaction + * is on a multiplexed session. + * The precommit token with the highest sequence number from this transaction + * attempt should be passed to the + * [Commit][google.spanner.v1.Spanner.Commit] request for this transaction. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. * } */ public function __construct($data = NULL) { @@ -501,5 +521,53 @@ public function setStats($var) return $this; } + /** + * Optional. A precommit token will be included if the read-write transaction + * is on a multiplexed session. + * The precommit token with the highest sequence number from this transaction + * attempt should be passed to the + * [Commit][google.spanner.v1.Spanner.Commit] request for this transaction. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field .google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken|null + */ + public function getPrecommitToken() + { + return $this->precommit_token; + } + + public function hasPrecommitToken() + { + return isset($this->precommit_token); + } + + public function clearPrecommitToken() + { + unset($this->precommit_token); + } + + /** + * Optional. A precommit token will be included if the read-write transaction + * is on a multiplexed session. + * The precommit token with the highest sequence number from this transaction + * attempt should be passed to the + * [Commit][google.spanner.v1.Spanner.Commit] request for this transaction. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field .google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken $var + * @return $this + */ + public function setPrecommitToken($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken::class); + $this->precommit_token = $var; + + return $this; + } + } diff --git a/Spanner/src/V1/ResultSet.php b/Spanner/src/V1/ResultSet.php index dd8bce450a52..995b37ac22ea 100644 --- a/Spanner/src/V1/ResultSet.php +++ b/Spanner/src/V1/ResultSet.php @@ -46,6 +46,18 @@ class ResultSet extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.spanner.v1.ResultSetStats stats = 3; */ private $stats = null; + /** + * Optional. A precommit token will be included if the read-write transaction + * is on a multiplexed session. + * The precommit token with the highest sequence number from this transaction + * attempt should be passed to the + * [Commit][google.spanner.v1.Spanner.Commit] request for this transaction. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field .google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $precommit_token = null; /** * Constructor. @@ -71,6 +83,14 @@ class ResultSet extends \Google\Protobuf\Internal\Message * [ExecuteSqlRequest.QueryMode.PLAN][google.spanner.v1.ExecuteSqlRequest.QueryMode.PLAN] [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. * Other fields may or may not be populated, based on the * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. + * @type \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken $precommit_token + * Optional. A precommit token will be included if the read-write transaction + * is on a multiplexed session. + * The precommit token with the highest sequence number from this transaction + * attempt should be passed to the + * [Commit][google.spanner.v1.Spanner.Commit] request for this transaction. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. * } */ public function __construct($data = NULL) { @@ -200,5 +220,53 @@ public function setStats($var) return $this; } + /** + * Optional. A precommit token will be included if the read-write transaction + * is on a multiplexed session. + * The precommit token with the highest sequence number from this transaction + * attempt should be passed to the + * [Commit][google.spanner.v1.Spanner.Commit] request for this transaction. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field .google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken|null + */ + public function getPrecommitToken() + { + return $this->precommit_token; + } + + public function hasPrecommitToken() + { + return isset($this->precommit_token); + } + + public function clearPrecommitToken() + { + unset($this->precommit_token); + } + + /** + * Optional. A precommit token will be included if the read-write transaction + * is on a multiplexed session. + * The precommit token with the highest sequence number from this transaction + * attempt should be passed to the + * [Commit][google.spanner.v1.Spanner.Commit] request for this transaction. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field .google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken $var + * @return $this + */ + public function setPrecommitToken($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken::class); + $this->precommit_token = $var; + + return $this; + } + } diff --git a/Spanner/src/V1/Transaction.php b/Spanner/src/V1/Transaction.php index 7907d4aa6d78..52a69eaaf99e 100644 --- a/Spanner/src/V1/Transaction.php +++ b/Spanner/src/V1/Transaction.php @@ -37,6 +37,20 @@ class Transaction extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.protobuf.Timestamp read_timestamp = 2; */ private $read_timestamp = null; + /** + * A precommit token will be included in the response of a BeginTransaction + * request if the read-write transaction is on a multiplexed session and + * a mutation_key was specified in the + * [BeginTransaction][google.spanner.v1.BeginTransactionRequest]. + * The precommit token with the highest sequence number from this transaction + * attempt should be passed to the [Commit][google.spanner.v1.Spanner.Commit] + * request for this transaction. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field .google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 3; + */ + private $precommit_token = null; /** * Constructor. @@ -58,6 +72,16 @@ class Transaction extends \Google\Protobuf\Internal\Message * [TransactionOptions.ReadOnly.return_read_timestamp][google.spanner.v1.TransactionOptions.ReadOnly.return_read_timestamp]. * A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. * Example: `"2014-10-02T15:01:23.045123456Z"`. + * @type \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken $precommit_token + * A precommit token will be included in the response of a BeginTransaction + * request if the read-write transaction is on a multiplexed session and + * a mutation_key was specified in the + * [BeginTransaction][google.spanner.v1.BeginTransactionRequest]. + * The precommit token with the highest sequence number from this transaction + * attempt should be passed to the [Commit][google.spanner.v1.Spanner.Commit] + * request for this transaction. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. * } */ public function __construct($data = NULL) { @@ -147,5 +171,57 @@ public function setReadTimestamp($var) return $this; } + /** + * A precommit token will be included in the response of a BeginTransaction + * request if the read-write transaction is on a multiplexed session and + * a mutation_key was specified in the + * [BeginTransaction][google.spanner.v1.BeginTransactionRequest]. + * The precommit token with the highest sequence number from this transaction + * attempt should be passed to the [Commit][google.spanner.v1.Spanner.Commit] + * request for this transaction. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field .google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 3; + * @return \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken|null + */ + public function getPrecommitToken() + { + return $this->precommit_token; + } + + public function hasPrecommitToken() + { + return isset($this->precommit_token); + } + + public function clearPrecommitToken() + { + unset($this->precommit_token); + } + + /** + * A precommit token will be included in the response of a BeginTransaction + * request if the read-write transaction is on a multiplexed session and + * a mutation_key was specified in the + * [BeginTransaction][google.spanner.v1.BeginTransactionRequest]. + * The precommit token with the highest sequence number from this transaction + * attempt should be passed to the [Commit][google.spanner.v1.Spanner.Commit] + * request for this transaction. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field .google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 3; + * @param \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken $var + * @return $this + */ + public function setPrecommitToken($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken::class); + $this->precommit_token = $var; + + return $this; + } + } diff --git a/Spanner/src/V1/TransactionOptions/ReadWrite.php b/Spanner/src/V1/TransactionOptions/ReadWrite.php index debc2477f577..cec00ef88464 100644 --- a/Spanner/src/V1/TransactionOptions/ReadWrite.php +++ b/Spanner/src/V1/TransactionOptions/ReadWrite.php @@ -22,6 +22,16 @@ class ReadWrite extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode read_lock_mode = 1; */ private $read_lock_mode = 0; + /** + * Optional. Clients should pass the transaction ID of the previous + * transaction attempt that was aborted if this transaction is being + * executed on a multiplexed session. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field bytes multiplexed_session_previous_transaction_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $multiplexed_session_previous_transaction_id = ''; /** * Constructor. @@ -31,6 +41,12 @@ class ReadWrite extends \Google\Protobuf\Internal\Message * * @type int $read_lock_mode * Read lock mode for the transaction. + * @type string $multiplexed_session_previous_transaction_id + * Optional. Clients should pass the transaction ID of the previous + * transaction attempt that was aborted if this transaction is being + * executed on a multiplexed session. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. * } */ public function __construct($data = NULL) { @@ -64,6 +80,40 @@ public function setReadLockMode($var) return $this; } + /** + * Optional. Clients should pass the transaction ID of the previous + * transaction attempt that was aborted if this transaction is being + * executed on a multiplexed session. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field bytes multiplexed_session_previous_transaction_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getMultiplexedSessionPreviousTransactionId() + { + return $this->multiplexed_session_previous_transaction_id; + } + + /** + * Optional. Clients should pass the transaction ID of the previous + * transaction attempt that was aborted if this transaction is being + * executed on a multiplexed session. + * This feature is not yet supported and will result in an UNIMPLEMENTED + * error. + * + * Generated from protobuf field bytes multiplexed_session_previous_transaction_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setMultiplexedSessionPreviousTransactionId($var) + { + GPBUtil::checkString($var, False); + $this->multiplexed_session_previous_transaction_id = $var; + + return $this; + } + } // Adding a class alias for backwards compatibility with the previous class name. From 7c553c279fdd3eee3eb07c062007f9b4f1aa6e20 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 11:21:07 -0700 Subject: [PATCH 06/34] feat: add conversational search (#7734) feat: add tile navigation docs: keep the API doc up-to-date with recent changes PiperOrigin-RevId: 683821686 Source-Link: https://github.com/googleapis/googleapis/commit/d01eb4689472766df6822cdfcdb4412bfb4c2789 Source-Link: https://github.com/googleapis/googleapis-gen/commit/1db3459f3dfa9347a5811d72b12e1714da75ed93 Copy-Tag: eyJwIjoiUmV0YWlsLy5Pd2xCb3QueWFtbCIsImgiOiIxZGIzNDU5ZjNkZmE5MzQ3YTU4MTFkNzJiMTJlMTcxNGRhNzVlZDkzIn0= --- Retail/metadata/V2/CompletionService.php | 14 +- Retail/metadata/V2/GenerativeQuestion.php | 40 ++ .../metadata/V2/GenerativeQuestionService.php | 59 +++ Retail/metadata/V2/SearchService.php | Bin 6303 -> 8443 bytes ...tch_update_generative_question_configs.php | 86 ++++ ...et_generative_questions_feature_config.php | 77 +++ .../list_generative_question_configs.php | 76 +++ .../update_generative_question_config.php | 81 +++ ...te_generative_questions_feature_config.php | 75 +++ ...UpdateGenerativeQuestionConfigsRequest.php | 121 +++++ ...pdateGenerativeQuestionConfigsResponse.php | 67 +++ .../GenerativeQuestionServiceClient.php | 373 ++++++++++++++ Retail/src/V2/CompleteQueryRequest.php | 16 +- Retail/src/V2/CompleteQueryResponse.php | 50 ++ .../CompleteQueryResponse/AttributeResult.php | 62 +++ Retail/src/V2/GenerativeQuestionConfig.php | 283 +++++++++++ .../V2/GenerativeQuestionsFeatureConfig.php | 151 ++++++ ...enerativeQuestionsFeatureConfigRequest.php | 86 ++++ .../ListGenerativeQuestionConfigsRequest.php | 86 ++++ .../ListGenerativeQuestionConfigsResponse.php | 67 +++ Retail/src/V2/Product.php | 36 +- Retail/src/V2/ProductAttributeInterval.php | 111 ++++ Retail/src/V2/ProductAttributeValue.php | 103 ++++ Retail/src/V2/Rule/ForceReturnFacetAction.php | 8 +- Retail/src/V2/SearchRequest.php | 92 ++++ .../ConversationalSearchSpec.php | 179 +++++++ .../ConversationalSearchSpec/UserAnswer.php | 120 +++++ .../UserAnswer/SelectedAnswer.php | 122 +++++ .../V2/SearchRequest/TileNavigationSpec.php | 118 +++++ Retail/src/V2/SearchResponse.php | 96 ++++ .../ConversationalSearchResult.php | 322 ++++++++++++ .../AdditionalFilter.php | 82 +++ .../SuggestedAnswer.php | 82 +++ .../SearchResponse/TileNavigationResult.php | 73 +++ Retail/src/V2/Tile.php | 144 ++++++ .../UpdateGenerativeQuestionConfigRequest.php | 158 ++++++ ...enerativeQuestionsFeatureConfigRequest.php | 146 ++++++ Retail/src/V2/gapic_metadata.json | 34 ++ ...rative_question_service_client_config.json | 47 ++ ...ive_question_service_descriptor_config.php | 93 ++++ ...ve_question_service_rest_client_config.php | 137 +++++ .../GenerativeQuestionServiceClientTest.php | 474 ++++++++++++++++++ 42 files changed, 4623 insertions(+), 24 deletions(-) create mode 100644 Retail/metadata/V2/GenerativeQuestion.php create mode 100644 Retail/metadata/V2/GenerativeQuestionService.php create mode 100644 Retail/samples/V2/GenerativeQuestionServiceClient/batch_update_generative_question_configs.php create mode 100644 Retail/samples/V2/GenerativeQuestionServiceClient/get_generative_questions_feature_config.php create mode 100644 Retail/samples/V2/GenerativeQuestionServiceClient/list_generative_question_configs.php create mode 100644 Retail/samples/V2/GenerativeQuestionServiceClient/update_generative_question_config.php create mode 100644 Retail/samples/V2/GenerativeQuestionServiceClient/update_generative_questions_feature_config.php create mode 100644 Retail/src/V2/BatchUpdateGenerativeQuestionConfigsRequest.php create mode 100644 Retail/src/V2/BatchUpdateGenerativeQuestionConfigsResponse.php create mode 100644 Retail/src/V2/Client/GenerativeQuestionServiceClient.php create mode 100644 Retail/src/V2/CompleteQueryResponse/AttributeResult.php create mode 100644 Retail/src/V2/GenerativeQuestionConfig.php create mode 100644 Retail/src/V2/GenerativeQuestionsFeatureConfig.php create mode 100644 Retail/src/V2/GetGenerativeQuestionsFeatureConfigRequest.php create mode 100644 Retail/src/V2/ListGenerativeQuestionConfigsRequest.php create mode 100644 Retail/src/V2/ListGenerativeQuestionConfigsResponse.php create mode 100644 Retail/src/V2/ProductAttributeInterval.php create mode 100644 Retail/src/V2/ProductAttributeValue.php create mode 100644 Retail/src/V2/SearchRequest/ConversationalSearchSpec.php create mode 100644 Retail/src/V2/SearchRequest/ConversationalSearchSpec/UserAnswer.php create mode 100644 Retail/src/V2/SearchRequest/ConversationalSearchSpec/UserAnswer/SelectedAnswer.php create mode 100644 Retail/src/V2/SearchRequest/TileNavigationSpec.php create mode 100644 Retail/src/V2/SearchResponse/ConversationalSearchResult.php create mode 100644 Retail/src/V2/SearchResponse/ConversationalSearchResult/AdditionalFilter.php create mode 100644 Retail/src/V2/SearchResponse/ConversationalSearchResult/SuggestedAnswer.php create mode 100644 Retail/src/V2/SearchResponse/TileNavigationResult.php create mode 100644 Retail/src/V2/Tile.php create mode 100644 Retail/src/V2/UpdateGenerativeQuestionConfigRequest.php create mode 100644 Retail/src/V2/UpdateGenerativeQuestionsFeatureConfigRequest.php create mode 100644 Retail/src/V2/resources/generative_question_service_client_config.json create mode 100644 Retail/src/V2/resources/generative_question_service_descriptor_config.php create mode 100644 Retail/src/V2/resources/generative_question_service_rest_client_config.php create mode 100644 Retail/tests/Unit/V2/Client/GenerativeQuestionServiceClientTest.php diff --git a/Retail/metadata/V2/CompletionService.php b/Retail/metadata/V2/CompletionService.php index 4cce3456ec40..182f6b8d5551 100644 --- a/Retail/metadata/V2/CompletionService.php +++ b/Retail/metadata/V2/CompletionService.php @@ -23,7 +23,7 @@ public static function initOnce() { \GPBMetadata\Google\Longrunning\Operations::initOnce(); $pool->internalAddGeneratedFile( ' - + /google/cloud/retail/v2/completion_service.protogoogle.cloud.retail.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto#google/cloud/retail/v2/common.proto*google/cloud/retail/v2/import_config.proto#google/longrunning/operations.proto" CompleteQueryRequest6 catalog ( B%AA @@ -37,11 +37,12 @@ public static function initOnce() { max_suggestions ($ enable_attribute_suggestions ( entity - ( " + ( " CompleteQueryResponseZ completion_results ( 2>.google.cloud.retail.v2.CompleteQueryResponse.CompletionResult attribution_token ( c -recent_search_results ( 2@.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResultB +recent_search_results ( 2@.google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResultB^ +attribute_results ( 2C.google.cloud.retail.v2.CompleteQueryResponse.AttributeResultsEntry CompletionResult suggestion ( b @@ -51,7 +52,12 @@ public static function initOnce() { key ( 6 value ( 2\'.google.cloud.retail.v2.CustomAttribute:8/ RecentSearchResult - recent_search ( :2 + recent_search ( :& +AttributeResult + suggestions ( v +AttributeResultsEntry +key ( L +value ( 2=.google.cloud.retail.v2.CompleteQueryResponse.AttributeResult:82 CompletionService CompleteQuery,.google.cloud.retail.v2.CompleteQueryRequest-.google.cloud.retail.v2.CompleteQueryResponse"E?=/v2/{catalog=projects/*/locations/*/catalogs/*}:completeQuery ImportCompletionData3.google.cloud.retail.v2.ImportCompletionDataRequest.google.longrunning.Operation"A\\ diff --git a/Retail/metadata/V2/GenerativeQuestion.php b/Retail/metadata/V2/GenerativeQuestion.php new file mode 100644 index 000000000000..6eae16d42959 --- /dev/null +++ b/Retail/metadata/V2/GenerativeQuestion.php @@ -0,0 +1,40 @@ +internalAddGeneratedFile( + ' + +0google/cloud/retail/v2/generative_question.protogoogle.cloud.retail.v2"u + GenerativeQuestionsFeatureConfig +catalog ( BA +feature_enabled (BA +minimum_products (BA" +GenerativeQuestionConfig +catalog ( BA +facet ( BA +generated_question ( BA +final_question ( BA +example_values ( BA + frequency (BA$ +allowed_in_conversation (BAB +com.google.cloud.retail.v2BGenerativeQuestionProtoPZ2cloud.google.com/go/retail/apiv2/retailpb;retailpbRETAILGoogle.Cloud.Retail.V2Google\\Cloud\\Retail\\V2Google::Cloud::Retail::V2bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/Retail/metadata/V2/GenerativeQuestionService.php b/Retail/metadata/V2/GenerativeQuestionService.php new file mode 100644 index 000000000000..a3d9d98c38ed --- /dev/null +++ b/Retail/metadata/V2/GenerativeQuestionService.php @@ -0,0 +1,59 @@ +internalAddGeneratedFile( + ' + +8google/cloud/retail/v2/generative_question_service.protogoogle.cloud.retail.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto0google/cloud/retail/v2/generative_question.proto google/protobuf/field_mask.proto" +-UpdateGenerativeQuestionsFeatureConfigRequestj +#generative_questions_feature_config ( 28.google.cloud.retail.v2.GenerativeQuestionsFeatureConfigBA4 + update_mask ( 2.google.protobuf.FieldMaskBA"d +*GetGenerativeQuestionsFeatureConfigRequest6 +catalog ( B%AA +retail.googleapis.com/Catalog"] +$ListGenerativeQuestionConfigsRequest5 +parent ( B%AA +retail.googleapis.com/Catalog"~ +%ListGenerativeQuestionConfigsResponseU +generative_question_configs ( 20.google.cloud.retail.v2.GenerativeQuestionConfig" +%UpdateGenerativeQuestionConfigRequestY +generative_question_config ( 20.google.cloud.retail.v2.GenerativeQuestionConfigBA4 + update_mask ( 2.google.protobuf.FieldMaskBA" ++BatchUpdateGenerativeQuestionConfigsRequest5 +parent ( B%AA +retail.googleapis.com/CatalogT +requests ( 2=.google.cloud.retail.v2.UpdateGenerativeQuestionConfigRequestBA" +,BatchUpdateGenerativeQuestionConfigsResponseZ +generative_question_configs ( 20.google.cloud.retail.v2.GenerativeQuestionConfigBA2 +GenerativeQuestionService +&UpdateGenerativeQuestionsFeatureConfigE.google.cloud.retail.v2.UpdateGenerativeQuestionsFeatureConfigRequest8.google.cloud.retail.v2.GenerativeQuestionsFeatureConfig"A/generative_questions_feature_config,update_mask2m/v2/{generative_questions_feature_config.catalog=projects/*/locations/*/catalogs/*}/generativeQuestionFeature:#generative_questions_feature_config +#GetGenerativeQuestionsFeatureConfigB.google.cloud.retail.v2.GetGenerativeQuestionsFeatureConfigRequest8.google.cloud.retail.v2.GenerativeQuestionsFeatureConfig"[AcatalogKI/v2/{catalog=projects/*/locations/*/catalogs/*}/generativeQuestionFeature +ListGenerativeQuestionConfigs<.google.cloud.retail.v2.ListGenerativeQuestionConfigsRequest=.google.cloud.retail.v2.ListGenerativeQuestionConfigsResponse"SAparentDB/v2/{parent=projects/*/locations/*/catalogs/*}/generativeQuestions +UpdateGenerativeQuestionConfig=.google.cloud.retail.v2.UpdateGenerativeQuestionConfigRequest0.google.cloud.retail.v2.GenerativeQuestionConfig"A&generative_question_config,update_mask{2]/v2/{generative_question_config.catalog=projects/*/locations/*/catalogs/*}/generativeQuestion:generative_question_config +$BatchUpdateGenerativeQuestionConfigsC.google.cloud.retail.v2.BatchUpdateGenerativeQuestionConfigsRequestD.google.cloud.retail.v2.BatchUpdateGenerativeQuestionConfigsResponse"jAparent,requestsR"M/v2/{parent=projects/*/locations/*/catalogs/*}/generativeQuestion:batchUpdate:*IAretail.googleapis.comA.https://www.googleapis.com/auth/cloud-platformB +com.google.cloud.retail.v2BGenerativeQuestionServiceProtoPZ2cloud.google.com/go/retail/apiv2/retailpb;retailpbRETAILGoogle.Cloud.Retail.V2Google\\Cloud\\Retail\\V2Google::Cloud::Retail::V2bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/Retail/metadata/V2/SearchService.php b/Retail/metadata/V2/SearchService.php index 68633c90cd26d70df2a8dc4965696dd1885676a9..4af2d655f344f299a75149ce9cf251fda8337465 100644 GIT binary patch delta 1712 zcma)6K~K|Q7-nmk@D4Wiu|a822M0xvMyCf2U@}MyL}QQ%F_GAm?qf8Tw)Xovc$D_Itf%L()h@{}2(T3X$xaiS1^ zEtsKnhq-WNJaFt$>w62^_%<-#|N6ZM(s>eS`zl=CwN2AL@ErAQx2lU@dYDjL<$e#K zamcoPXC?$T4x;Cf_6T-W%_0Zb<<6u_Yf8QcodY-wR&C=7ri5LGNq*R*tP-sbjNY{0Q?y zV9xXWEynZ1^S7Lo66n$S0S+7H1a^0V6o~ZD!LkXcbGJb<lO@aj$<0krJ$6s zT?I`~21mmW%s&}EN*~c?|%Hr>tR6;y#Wri;L#j(_q(#_`$UdsYI z*4Z6r8RaYs5lca7pDn~UzK%G;zWi4Nxra!XG=~3?0t~x&*Ra^&EWhqyGo&scty(pj zcerbq>?cH6Rs&NuqK5W*jHQ%Y@cSIimplQv*7fjnVRtTx{47k!5wBL`C)7+Tk@~sd z<4AC|mtZAAhdD+2kn0#hN^whD6YTUNj87nIkd2G$GdM$d auRGxihKg#Q{7n1>*7Bgoi~~Q delta 54 zcmV-60LlORL7y?OwgUv7DGDo*ODmJ*1Nj2J6SH6j?E|wD3oQkc$r7dlnhUdW6Dk6; MVHR)$vzQ!X1UX?7SpWb4 diff --git a/Retail/samples/V2/GenerativeQuestionServiceClient/batch_update_generative_question_configs.php b/Retail/samples/V2/GenerativeQuestionServiceClient/batch_update_generative_question_configs.php new file mode 100644 index 000000000000..80df18e6762d --- /dev/null +++ b/Retail/samples/V2/GenerativeQuestionServiceClient/batch_update_generative_question_configs.php @@ -0,0 +1,86 @@ +setCatalog($requestsGenerativeQuestionConfigCatalog) + ->setFacet($requestsGenerativeQuestionConfigFacet); + $updateGenerativeQuestionConfigRequest = (new UpdateGenerativeQuestionConfigRequest()) + ->setGenerativeQuestionConfig($requestsGenerativeQuestionConfig); + $requests = [$updateGenerativeQuestionConfigRequest,]; + $request = (new BatchUpdateGenerativeQuestionConfigsRequest()) + ->setRequests($requests); + + // Call the API and handle any network failures. + try { + /** @var BatchUpdateGenerativeQuestionConfigsResponse $response */ + $response = $generativeQuestionServiceClient->batchUpdateGenerativeQuestionConfigs($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 +{ + $requestsGenerativeQuestionConfigCatalog = '[CATALOG]'; + $requestsGenerativeQuestionConfigFacet = '[FACET]'; + + batch_update_generative_question_configs_sample( + $requestsGenerativeQuestionConfigCatalog, + $requestsGenerativeQuestionConfigFacet + ); +} +// [END retail_v2_generated_GenerativeQuestionService_BatchUpdateGenerativeQuestionConfigs_sync] diff --git a/Retail/samples/V2/GenerativeQuestionServiceClient/get_generative_questions_feature_config.php b/Retail/samples/V2/GenerativeQuestionServiceClient/get_generative_questions_feature_config.php new file mode 100644 index 000000000000..a2c319426e89 --- /dev/null +++ b/Retail/samples/V2/GenerativeQuestionServiceClient/get_generative_questions_feature_config.php @@ -0,0 +1,77 @@ +setCatalog($formattedCatalog); + + // Call the API and handle any network failures. + try { + /** @var GenerativeQuestionsFeatureConfig $response */ + $response = $generativeQuestionServiceClient->getGenerativeQuestionsFeatureConfig($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 +{ + $formattedCatalog = GenerativeQuestionServiceClient::catalogName( + '[PROJECT]', + '[LOCATION]', + '[CATALOG]' + ); + + get_generative_questions_feature_config_sample($formattedCatalog); +} +// [END retail_v2_generated_GenerativeQuestionService_GetGenerativeQuestionsFeatureConfig_sync] diff --git a/Retail/samples/V2/GenerativeQuestionServiceClient/list_generative_question_configs.php b/Retail/samples/V2/GenerativeQuestionServiceClient/list_generative_question_configs.php new file mode 100644 index 000000000000..75edd24a1c46 --- /dev/null +++ b/Retail/samples/V2/GenerativeQuestionServiceClient/list_generative_question_configs.php @@ -0,0 +1,76 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var ListGenerativeQuestionConfigsResponse $response */ + $response = $generativeQuestionServiceClient->listGenerativeQuestionConfigs($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 +{ + $formattedParent = GenerativeQuestionServiceClient::catalogName( + '[PROJECT]', + '[LOCATION]', + '[CATALOG]' + ); + + list_generative_question_configs_sample($formattedParent); +} +// [END retail_v2_generated_GenerativeQuestionService_ListGenerativeQuestionConfigs_sync] diff --git a/Retail/samples/V2/GenerativeQuestionServiceClient/update_generative_question_config.php b/Retail/samples/V2/GenerativeQuestionServiceClient/update_generative_question_config.php new file mode 100644 index 000000000000..238fd35b1e25 --- /dev/null +++ b/Retail/samples/V2/GenerativeQuestionServiceClient/update_generative_question_config.php @@ -0,0 +1,81 @@ +setCatalog($generativeQuestionConfigCatalog) + ->setFacet($generativeQuestionConfigFacet); + $request = (new UpdateGenerativeQuestionConfigRequest()) + ->setGenerativeQuestionConfig($generativeQuestionConfig); + + // Call the API and handle any network failures. + try { + /** @var GenerativeQuestionConfig $response */ + $response = $generativeQuestionServiceClient->updateGenerativeQuestionConfig($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 +{ + $generativeQuestionConfigCatalog = '[CATALOG]'; + $generativeQuestionConfigFacet = '[FACET]'; + + update_generative_question_config_sample( + $generativeQuestionConfigCatalog, + $generativeQuestionConfigFacet + ); +} +// [END retail_v2_generated_GenerativeQuestionService_UpdateGenerativeQuestionConfig_sync] diff --git a/Retail/samples/V2/GenerativeQuestionServiceClient/update_generative_questions_feature_config.php b/Retail/samples/V2/GenerativeQuestionServiceClient/update_generative_questions_feature_config.php new file mode 100644 index 000000000000..3bca45526e4d --- /dev/null +++ b/Retail/samples/V2/GenerativeQuestionServiceClient/update_generative_questions_feature_config.php @@ -0,0 +1,75 @@ +setCatalog($generativeQuestionsFeatureConfigCatalog); + $request = (new UpdateGenerativeQuestionsFeatureConfigRequest()) + ->setGenerativeQuestionsFeatureConfig($generativeQuestionsFeatureConfig); + + // Call the API and handle any network failures. + try { + /** @var GenerativeQuestionsFeatureConfig $response */ + $response = $generativeQuestionServiceClient->updateGenerativeQuestionsFeatureConfig($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 +{ + $generativeQuestionsFeatureConfigCatalog = '[CATALOG]'; + + update_generative_questions_feature_config_sample($generativeQuestionsFeatureConfigCatalog); +} +// [END retail_v2_generated_GenerativeQuestionService_UpdateGenerativeQuestionsFeatureConfig_sync] diff --git a/Retail/src/V2/BatchUpdateGenerativeQuestionConfigsRequest.php b/Retail/src/V2/BatchUpdateGenerativeQuestionConfigsRequest.php new file mode 100644 index 000000000000..a45ef2bbec39 --- /dev/null +++ b/Retail/src/V2/BatchUpdateGenerativeQuestionConfigsRequest.php @@ -0,0 +1,121 @@ +google.cloud.retail.v2.BatchUpdateGenerativeQuestionConfigsRequest + */ +class BatchUpdateGenerativeQuestionConfigsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Resource name of the parent catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The updates question configs. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.UpdateGenerativeQuestionConfigRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $requests; + + /** + * @param string $parent Optional. Resource name of the parent catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * @param \Google\Cloud\Retail\V2\UpdateGenerativeQuestionConfigRequest[] $requests Required. The updates question configs. + * + * @return \Google\Cloud\Retail\V2\BatchUpdateGenerativeQuestionConfigsRequest + * + * @experimental + */ + public static function build(string $parent, array $requests): self + { + return (new self()) + ->setParent($parent) + ->setRequests($requests); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Optional. Resource name of the parent catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * @type array<\Google\Cloud\Retail\V2\UpdateGenerativeQuestionConfigRequest>|\Google\Protobuf\Internal\RepeatedField $requests + * Required. The updates question configs. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\GenerativeQuestionService::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Resource name of the parent catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Optional. Resource name of the parent catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The updates question configs. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.UpdateGenerativeQuestionConfigRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRequests() + { + return $this->requests; + } + + /** + * Required. The updates question configs. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.UpdateGenerativeQuestionConfigRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\Retail\V2\UpdateGenerativeQuestionConfigRequest>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRequests($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\UpdateGenerativeQuestionConfigRequest::class); + $this->requests = $arr; + + return $this; + } + +} + diff --git a/Retail/src/V2/BatchUpdateGenerativeQuestionConfigsResponse.php b/Retail/src/V2/BatchUpdateGenerativeQuestionConfigsResponse.php new file mode 100644 index 000000000000..3fe2b844ef85 --- /dev/null +++ b/Retail/src/V2/BatchUpdateGenerativeQuestionConfigsResponse.php @@ -0,0 +1,67 @@ +google.cloud.retail.v2.BatchUpdateGenerativeQuestionConfigsResponse + */ +class BatchUpdateGenerativeQuestionConfigsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The updates question configs. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.GenerativeQuestionConfig generative_question_configs = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $generative_question_configs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Retail\V2\GenerativeQuestionConfig>|\Google\Protobuf\Internal\RepeatedField $generative_question_configs + * Optional. The updates question configs. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\GenerativeQuestionService::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The updates question configs. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.GenerativeQuestionConfig generative_question_configs = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGenerativeQuestionConfigs() + { + return $this->generative_question_configs; + } + + /** + * Optional. The updates question configs. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.GenerativeQuestionConfig generative_question_configs = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Retail\V2\GenerativeQuestionConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGenerativeQuestionConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\GenerativeQuestionConfig::class); + $this->generative_question_configs = $arr; + + return $this; + } + +} + diff --git a/Retail/src/V2/Client/GenerativeQuestionServiceClient.php b/Retail/src/V2/Client/GenerativeQuestionServiceClient.php new file mode 100644 index 000000000000..d7023d8f0d52 --- /dev/null +++ b/Retail/src/V2/Client/GenerativeQuestionServiceClient.php @@ -0,0 +1,373 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/generative_question_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/generative_question_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/generative_question_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => + __DIR__ . '/../resources/generative_question_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a catalog + * resource. + * + * @param string $project + * @param string $location + * @param string $catalog + * + * @return string The formatted catalog resource. + */ + public static function catalogName(string $project, string $location, string $catalog): string + { + return self::getPathTemplate('catalog')->render([ + 'project' => $project, + 'location' => $location, + 'catalog' => $catalog, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - catalog: projects/{project}/locations/{location}/catalogs/{catalog} + * + * 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 'retail.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); + } + + /** + * Allows management of multiple questions. + * + * The async variant is + * {@see GenerativeQuestionServiceClient::batchUpdateGenerativeQuestionConfigsAsync()} + * . + * + * @example samples/V2/GenerativeQuestionServiceClient/batch_update_generative_question_configs.php + * + * @param BatchUpdateGenerativeQuestionConfigsRequest $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 BatchUpdateGenerativeQuestionConfigsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function batchUpdateGenerativeQuestionConfigs( + BatchUpdateGenerativeQuestionConfigsRequest $request, + array $callOptions = [] + ): BatchUpdateGenerativeQuestionConfigsResponse { + return $this->startApiCall('BatchUpdateGenerativeQuestionConfigs', $request, $callOptions)->wait(); + } + + /** + * Manages overal generative question feature state -- enables toggling + * feature on and off. + * + * The async variant is + * {@see GenerativeQuestionServiceClient::getGenerativeQuestionsFeatureConfigAsync()} + * . + * + * @example samples/V2/GenerativeQuestionServiceClient/get_generative_questions_feature_config.php + * + * @param GetGenerativeQuestionsFeatureConfigRequest $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 GenerativeQuestionsFeatureConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function getGenerativeQuestionsFeatureConfig( + GetGenerativeQuestionsFeatureConfigRequest $request, + array $callOptions = [] + ): GenerativeQuestionsFeatureConfig { + return $this->startApiCall('GetGenerativeQuestionsFeatureConfig', $request, $callOptions)->wait(); + } + + /** + * Returns all questions for a given catalog. + * + * The async variant is + * {@see GenerativeQuestionServiceClient::listGenerativeQuestionConfigsAsync()} . + * + * @example samples/V2/GenerativeQuestionServiceClient/list_generative_question_configs.php + * + * @param ListGenerativeQuestionConfigsRequest $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 ListGenerativeQuestionConfigsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listGenerativeQuestionConfigs( + ListGenerativeQuestionConfigsRequest $request, + array $callOptions = [] + ): ListGenerativeQuestionConfigsResponse { + return $this->startApiCall('ListGenerativeQuestionConfigs', $request, $callOptions)->wait(); + } + + /** + * Allows management of individual questions. + * + * The async variant is + * {@see GenerativeQuestionServiceClient::updateGenerativeQuestionConfigAsync()} . + * + * @example samples/V2/GenerativeQuestionServiceClient/update_generative_question_config.php + * + * @param UpdateGenerativeQuestionConfigRequest $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 GenerativeQuestionConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateGenerativeQuestionConfig( + UpdateGenerativeQuestionConfigRequest $request, + array $callOptions = [] + ): GenerativeQuestionConfig { + return $this->startApiCall('UpdateGenerativeQuestionConfig', $request, $callOptions)->wait(); + } + + /** + * Manages overal generative question feature state -- enables toggling + * feature on and off. + * + * The async variant is + * {@see GenerativeQuestionServiceClient::updateGenerativeQuestionsFeatureConfigAsync()} + * . + * + * @example samples/V2/GenerativeQuestionServiceClient/update_generative_questions_feature_config.php + * + * @param UpdateGenerativeQuestionsFeatureConfigRequest $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 GenerativeQuestionsFeatureConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateGenerativeQuestionsFeatureConfig( + UpdateGenerativeQuestionsFeatureConfigRequest $request, + array $callOptions = [] + ): GenerativeQuestionsFeatureConfig { + return $this->startApiCall('UpdateGenerativeQuestionsFeatureConfig', $request, $callOptions)->wait(); + } +} diff --git a/Retail/src/V2/CompleteQueryRequest.php b/Retail/src/V2/CompleteQueryRequest.php index 8e57791a191c..2118cf1f06f7 100644 --- a/Retail/src/V2/CompleteQueryRequest.php +++ b/Retail/src/V2/CompleteQueryRequest.php @@ -95,8 +95,8 @@ class CompleteQueryRequest extends \Google\Protobuf\Internal\Message */ protected $max_suggestions = 0; /** - * If true, attribute suggestions are enabled and provided in response. - * This field is only available for "cloud-retail" dataset. + * If true, attribute suggestions are enabled and provided in the response. + * This field is only available for the "cloud-retail" dataset. * * Generated from protobuf field bool enable_attribute_suggestions = 9; */ @@ -171,8 +171,8 @@ class CompleteQueryRequest extends \Google\Protobuf\Internal\Message * The maximum allowed max suggestions is 20. If it is set higher, it will be * capped by 20. * @type bool $enable_attribute_suggestions - * If true, attribute suggestions are enabled and provided in response. - * This field is only available for "cloud-retail" dataset. + * If true, attribute suggestions are enabled and provided in the response. + * This field is only available for the "cloud-retail" dataset. * @type string $entity * The entity for customers who run multiple entities, domains, sites, or * regions, for example, `Google US`, `Google Ads`, `Waymo`, @@ -444,8 +444,8 @@ public function setMaxSuggestions($var) } /** - * If true, attribute suggestions are enabled and provided in response. - * This field is only available for "cloud-retail" dataset. + * If true, attribute suggestions are enabled and provided in the response. + * This field is only available for the "cloud-retail" dataset. * * Generated from protobuf field bool enable_attribute_suggestions = 9; * @return bool @@ -456,8 +456,8 @@ public function getEnableAttributeSuggestions() } /** - * If true, attribute suggestions are enabled and provided in response. - * This field is only available for "cloud-retail" dataset. + * If true, attribute suggestions are enabled and provided in the response. + * This field is only available for the "cloud-retail" dataset. * * Generated from protobuf field bool enable_attribute_suggestions = 9; * @param bool $var diff --git a/Retail/src/V2/CompleteQueryResponse.php b/Retail/src/V2/CompleteQueryResponse.php index f4b5b4c2bdd5..2aa2c0bf0cd8 100644 --- a/Retail/src/V2/CompleteQueryResponse.php +++ b/Retail/src/V2/CompleteQueryResponse.php @@ -52,6 +52,16 @@ class CompleteQueryResponse extends \Google\Protobuf\Internal\Message * @deprecated */ private $recent_search_results; + /** + * A map of matched attribute suggestions. This field is only available for + * "cloud-retail" dataset. + * Current supported keys: + * * `brands` + * * `categories` + * + * Generated from protobuf field map attribute_results = 4; + */ + private $attribute_results; /** * Constructor. @@ -83,6 +93,12 @@ class CompleteQueryResponse extends \Google\Protobuf\Internal\Message * * They are UTF-8 safe. * Recent searches are deduplicated. More recent searches will be reserved * when duplication happens. + * @type array|\Google\Protobuf\Internal\MapField $attribute_results + * A map of matched attribute suggestions. This field is only available for + * "cloud-retail" dataset. + * Current supported keys: + * * `brands` + * * `categories` * } */ public function __construct($data = NULL) { @@ -208,5 +224,39 @@ public function setRecentSearchResults($var) return $this; } + /** + * A map of matched attribute suggestions. This field is only available for + * "cloud-retail" dataset. + * Current supported keys: + * * `brands` + * * `categories` + * + * Generated from protobuf field map attribute_results = 4; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAttributeResults() + { + return $this->attribute_results; + } + + /** + * A map of matched attribute suggestions. This field is only available for + * "cloud-retail" dataset. + * Current supported keys: + * * `brands` + * * `categories` + * + * Generated from protobuf field map attribute_results = 4; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAttributeResults($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\CompleteQueryResponse\AttributeResult::class); + $this->attribute_results = $arr; + + return $this; + } + } diff --git a/Retail/src/V2/CompleteQueryResponse/AttributeResult.php b/Retail/src/V2/CompleteQueryResponse/AttributeResult.php new file mode 100644 index 000000000000..fd1625f7a852 --- /dev/null +++ b/Retail/src/V2/CompleteQueryResponse/AttributeResult.php @@ -0,0 +1,62 @@ +google.cloud.retail.v2.CompleteQueryResponse.AttributeResult + */ +class AttributeResult extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field repeated string suggestions = 1; + */ + private $suggestions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $suggestions + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\CompletionService::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field repeated string suggestions = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSuggestions() + { + return $this->suggestions; + } + + /** + * Generated from protobuf field repeated string suggestions = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSuggestions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->suggestions = $arr; + + return $this; + } + +} + + diff --git a/Retail/src/V2/GenerativeQuestionConfig.php b/Retail/src/V2/GenerativeQuestionConfig.php new file mode 100644 index 000000000000..3735bded7aae --- /dev/null +++ b/Retail/src/V2/GenerativeQuestionConfig.php @@ -0,0 +1,283 @@ +google.cloud.retail.v2.GenerativeQuestionConfig + */ +class GenerativeQuestionConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * + * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $catalog = ''; + /** + * Required. The facet to which the question is associated. + * + * Generated from protobuf field string facet = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $facet = ''; + /** + * Output only. The LLM generated question. + * + * Generated from protobuf field string generated_question = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $generated_question = ''; + /** + * Optional. The question that will be used at serving time. + * Question can have a max length of 300 bytes. + * When not populated, generated_question should be used. + * + * Generated from protobuf field string final_question = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $final_question = ''; + /** + * Output only. Values that can be used to answer the question. + * + * Generated from protobuf field repeated string example_values = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $example_values; + /** + * Output only. The ratio of how often a question was asked. + * + * Generated from protobuf field float frequency = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $frequency = 0.0; + /** + * Optional. Whether the question is asked at serving time. + * + * Generated from protobuf field bool allowed_in_conversation = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $allowed_in_conversation = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $catalog + * Required. Resource name of the catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * @type string $facet + * Required. The facet to which the question is associated. + * @type string $generated_question + * Output only. The LLM generated question. + * @type string $final_question + * Optional. The question that will be used at serving time. + * Question can have a max length of 300 bytes. + * When not populated, generated_question should be used. + * @type array|\Google\Protobuf\Internal\RepeatedField $example_values + * Output only. Values that can be used to answer the question. + * @type float $frequency + * Output only. The ratio of how often a question was asked. + * @type bool $allowed_in_conversation + * Optional. Whether the question is asked at serving time. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\GenerativeQuestion::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * + * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getCatalog() + { + return $this->catalog; + } + + /** + * Required. Resource name of the catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * + * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setCatalog($var) + { + GPBUtil::checkString($var, True); + $this->catalog = $var; + + return $this; + } + + /** + * Required. The facet to which the question is associated. + * + * Generated from protobuf field string facet = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFacet() + { + return $this->facet; + } + + /** + * Required. The facet to which the question is associated. + * + * Generated from protobuf field string facet = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFacet($var) + { + GPBUtil::checkString($var, True); + $this->facet = $var; + + return $this; + } + + /** + * Output only. The LLM generated question. + * + * Generated from protobuf field string generated_question = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getGeneratedQuestion() + { + return $this->generated_question; + } + + /** + * Output only. The LLM generated question. + * + * Generated from protobuf field string generated_question = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setGeneratedQuestion($var) + { + GPBUtil::checkString($var, True); + $this->generated_question = $var; + + return $this; + } + + /** + * Optional. The question that will be used at serving time. + * Question can have a max length of 300 bytes. + * When not populated, generated_question should be used. + * + * Generated from protobuf field string final_question = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFinalQuestion() + { + return $this->final_question; + } + + /** + * Optional. The question that will be used at serving time. + * Question can have a max length of 300 bytes. + * When not populated, generated_question should be used. + * + * Generated from protobuf field string final_question = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFinalQuestion($var) + { + GPBUtil::checkString($var, True); + $this->final_question = $var; + + return $this; + } + + /** + * Output only. Values that can be used to answer the question. + * + * Generated from protobuf field repeated string example_values = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExampleValues() + { + return $this->example_values; + } + + /** + * Output only. Values that can be used to answer the question. + * + * Generated from protobuf field repeated string example_values = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExampleValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->example_values = $arr; + + return $this; + } + + /** + * Output only. The ratio of how often a question was asked. + * + * Generated from protobuf field float frequency = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return float + */ + public function getFrequency() + { + return $this->frequency; + } + + /** + * Output only. The ratio of how often a question was asked. + * + * Generated from protobuf field float frequency = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param float $var + * @return $this + */ + public function setFrequency($var) + { + GPBUtil::checkFloat($var); + $this->frequency = $var; + + return $this; + } + + /** + * Optional. Whether the question is asked at serving time. + * + * Generated from protobuf field bool allowed_in_conversation = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowedInConversation() + { + return $this->allowed_in_conversation; + } + + /** + * Optional. Whether the question is asked at serving time. + * + * Generated from protobuf field bool allowed_in_conversation = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowedInConversation($var) + { + GPBUtil::checkBool($var); + $this->allowed_in_conversation = $var; + + return $this; + } + +} + diff --git a/Retail/src/V2/GenerativeQuestionsFeatureConfig.php b/Retail/src/V2/GenerativeQuestionsFeatureConfig.php new file mode 100644 index 000000000000..a2efd07cd0b8 --- /dev/null +++ b/Retail/src/V2/GenerativeQuestionsFeatureConfig.php @@ -0,0 +1,151 @@ +google.cloud.retail.v2.GenerativeQuestionsFeatureConfig + */ +class GenerativeQuestionsFeatureConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the affected catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * + * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $catalog = ''; + /** + * Optional. Determines whether questions will be used at serving time. + * Note: This feature cannot be enabled until initial data requirements are + * satisfied. + * + * Generated from protobuf field bool feature_enabled = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $feature_enabled = false; + /** + * Optional. Minimum number of products in the response to trigger follow-up + * questions. Value must be 0 or positive. + * + * Generated from protobuf field int32 minimum_products = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $minimum_products = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $catalog + * Required. Resource name of the affected catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * @type bool $feature_enabled + * Optional. Determines whether questions will be used at serving time. + * Note: This feature cannot be enabled until initial data requirements are + * satisfied. + * @type int $minimum_products + * Optional. Minimum number of products in the response to trigger follow-up + * questions. Value must be 0 or positive. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\GenerativeQuestion::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the affected catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * + * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getCatalog() + { + return $this->catalog; + } + + /** + * Required. Resource name of the affected catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * + * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setCatalog($var) + { + GPBUtil::checkString($var, True); + $this->catalog = $var; + + return $this; + } + + /** + * Optional. Determines whether questions will be used at serving time. + * Note: This feature cannot be enabled until initial data requirements are + * satisfied. + * + * Generated from protobuf field bool feature_enabled = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getFeatureEnabled() + { + return $this->feature_enabled; + } + + /** + * Optional. Determines whether questions will be used at serving time. + * Note: This feature cannot be enabled until initial data requirements are + * satisfied. + * + * Generated from protobuf field bool feature_enabled = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setFeatureEnabled($var) + { + GPBUtil::checkBool($var); + $this->feature_enabled = $var; + + return $this; + } + + /** + * Optional. Minimum number of products in the response to trigger follow-up + * questions. Value must be 0 or positive. + * + * Generated from protobuf field int32 minimum_products = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMinimumProducts() + { + return $this->minimum_products; + } + + /** + * Optional. Minimum number of products in the response to trigger follow-up + * questions. Value must be 0 or positive. + * + * Generated from protobuf field int32 minimum_products = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMinimumProducts($var) + { + GPBUtil::checkInt32($var); + $this->minimum_products = $var; + + return $this; + } + +} + diff --git a/Retail/src/V2/GetGenerativeQuestionsFeatureConfigRequest.php b/Retail/src/V2/GetGenerativeQuestionsFeatureConfigRequest.php new file mode 100644 index 000000000000..3187270c7c16 --- /dev/null +++ b/Retail/src/V2/GetGenerativeQuestionsFeatureConfigRequest.php @@ -0,0 +1,86 @@ +google.cloud.retail.v2.GetGenerativeQuestionsFeatureConfigRequest + */ +class GetGenerativeQuestionsFeatureConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the parent catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * + * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $catalog = ''; + + /** + * @param string $catalog Required. Resource name of the parent catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * Please see {@see GenerativeQuestionServiceClient::catalogName()} for help formatting this field. + * + * @return \Google\Cloud\Retail\V2\GetGenerativeQuestionsFeatureConfigRequest + * + * @experimental + */ + public static function build(string $catalog): self + { + return (new self()) + ->setCatalog($catalog); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $catalog + * Required. Resource name of the parent catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\GenerativeQuestionService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the parent catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * + * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getCatalog() + { + return $this->catalog; + } + + /** + * Required. Resource name of the parent catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * + * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setCatalog($var) + { + GPBUtil::checkString($var, True); + $this->catalog = $var; + + return $this; + } + +} + diff --git a/Retail/src/V2/ListGenerativeQuestionConfigsRequest.php b/Retail/src/V2/ListGenerativeQuestionConfigsRequest.php new file mode 100644 index 000000000000..b68f5f75f2d9 --- /dev/null +++ b/Retail/src/V2/ListGenerativeQuestionConfigsRequest.php @@ -0,0 +1,86 @@ +google.cloud.retail.v2.ListGenerativeQuestionConfigsRequest + */ +class ListGenerativeQuestionConfigsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the parent catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + + /** + * @param string $parent Required. Resource name of the parent catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * Please see {@see GenerativeQuestionServiceClient::catalogName()} for help formatting this field. + * + * @return \Google\Cloud\Retail\V2\ListGenerativeQuestionConfigsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Resource name of the parent catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\GenerativeQuestionService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the parent catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Resource name of the parent catalog. + * Format: projects/{project}/locations/{location}/catalogs/{catalog} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + +} + diff --git a/Retail/src/V2/ListGenerativeQuestionConfigsResponse.php b/Retail/src/V2/ListGenerativeQuestionConfigsResponse.php new file mode 100644 index 000000000000..cbec187cb9cd --- /dev/null +++ b/Retail/src/V2/ListGenerativeQuestionConfigsResponse.php @@ -0,0 +1,67 @@ +google.cloud.retail.v2.ListGenerativeQuestionConfigsResponse + */ +class ListGenerativeQuestionConfigsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * All the questions for a given catalog. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.GenerativeQuestionConfig generative_question_configs = 1; + */ + private $generative_question_configs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Retail\V2\GenerativeQuestionConfig>|\Google\Protobuf\Internal\RepeatedField $generative_question_configs + * All the questions for a given catalog. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\GenerativeQuestionService::initOnce(); + parent::__construct($data); + } + + /** + * All the questions for a given catalog. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.GenerativeQuestionConfig generative_question_configs = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGenerativeQuestionConfigs() + { + return $this->generative_question_configs; + } + + /** + * All the questions for a given catalog. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.GenerativeQuestionConfig generative_question_configs = 1; + * @param array<\Google\Cloud\Retail\V2\GenerativeQuestionConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGenerativeQuestionConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\GenerativeQuestionConfig::class); + $this->generative_question_configs = $arr; + + return $this; + } + +} + diff --git a/Retail/src/V2/Product.php b/Retail/src/V2/Product.php index 3f51475923ce..0d56e63f4e47 100644 --- a/Retail/src/V2/Product.php +++ b/Retail/src/V2/Product.php @@ -254,6 +254,13 @@ class Product extends \Google\Protobuf\Internal\Message * The online availability of the [Product][google.cloud.retail.v2.Product]. * Default to * [Availability.IN_STOCK][google.cloud.retail.v2.Product.Availability.IN_STOCK]. + * For primary products with variants set the availability of the primary as + * [Availability.OUT_OF_STOCK][google.cloud.retail.v2.Product.Availability.OUT_OF_STOCK] + * and set the true availability at the variant level. This way the primary + * product will be considered "in stock" as long as it has at least one + * variant in stock. + * For primary products with no variants set the true availability at the + * primary level. * Corresponding properties: Google Merchant Center property * [availability](https://support.google.com/merchants/answer/6324448). * Schema.org property [Offer.availability](https://schema.org/availability). @@ -438,8 +445,6 @@ class Product extends \Google\Protobuf\Internal\Message * following fields are always returned in by default: * * [name][google.cloud.retail.v2.Product.name] * * [color_info][google.cloud.retail.v2.Product.color_info] - * The maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is - * returned. * Note: Returning more fields in * [SearchResponse][google.cloud.retail.v2.SearchResponse] can increase * response payload size and serving latency. @@ -697,6 +702,13 @@ class Product extends \Google\Protobuf\Internal\Message * The online availability of the [Product][google.cloud.retail.v2.Product]. * Default to * [Availability.IN_STOCK][google.cloud.retail.v2.Product.Availability.IN_STOCK]. + * For primary products with variants set the availability of the primary as + * [Availability.OUT_OF_STOCK][google.cloud.retail.v2.Product.Availability.OUT_OF_STOCK] + * and set the true availability at the variant level. This way the primary + * product will be considered "in stock" as long as it has at least one + * variant in stock. + * For primary products with no variants set the true availability at the + * primary level. * Corresponding properties: Google Merchant Center property * [availability](https://support.google.com/merchants/answer/6324448). * Schema.org property [Offer.availability](https://schema.org/availability). @@ -829,8 +841,6 @@ class Product extends \Google\Protobuf\Internal\Message * following fields are always returned in by default: * * [name][google.cloud.retail.v2.Product.name] * * [color_info][google.cloud.retail.v2.Product.color_info] - * The maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is - * returned. * Note: Returning more fields in * [SearchResponse][google.cloud.retail.v2.SearchResponse] can increase * response payload size and serving latency. @@ -1721,6 +1731,13 @@ public function setAvailableTime($var) * The online availability of the [Product][google.cloud.retail.v2.Product]. * Default to * [Availability.IN_STOCK][google.cloud.retail.v2.Product.Availability.IN_STOCK]. + * For primary products with variants set the availability of the primary as + * [Availability.OUT_OF_STOCK][google.cloud.retail.v2.Product.Availability.OUT_OF_STOCK] + * and set the true availability at the variant level. This way the primary + * product will be considered "in stock" as long as it has at least one + * variant in stock. + * For primary products with no variants set the true availability at the + * primary level. * Corresponding properties: Google Merchant Center property * [availability](https://support.google.com/merchants/answer/6324448). * Schema.org property [Offer.availability](https://schema.org/availability). @@ -1737,6 +1754,13 @@ public function getAvailability() * The online availability of the [Product][google.cloud.retail.v2.Product]. * Default to * [Availability.IN_STOCK][google.cloud.retail.v2.Product.Availability.IN_STOCK]. + * For primary products with variants set the availability of the primary as + * [Availability.OUT_OF_STOCK][google.cloud.retail.v2.Product.Availability.OUT_OF_STOCK] + * and set the true availability at the variant level. This way the primary + * product will be considered "in stock" as long as it has at least one + * variant in stock. + * For primary products with no variants set the true availability at the + * primary level. * Corresponding properties: Google Merchant Center property * [availability](https://support.google.com/merchants/answer/6324448). * Schema.org property [Offer.availability](https://schema.org/availability). @@ -2302,8 +2326,6 @@ public function setPublishTime($var) * following fields are always returned in by default: * * [name][google.cloud.retail.v2.Product.name] * * [color_info][google.cloud.retail.v2.Product.color_info] - * The maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is - * returned. * Note: Returning more fields in * [SearchResponse][google.cloud.retail.v2.SearchResponse] can increase * response payload size and serving latency. @@ -2371,8 +2393,6 @@ public function clearRetrievableFields() * following fields are always returned in by default: * * [name][google.cloud.retail.v2.Product.name] * * [color_info][google.cloud.retail.v2.Product.color_info] - * The maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is - * returned. * Note: Returning more fields in * [SearchResponse][google.cloud.retail.v2.SearchResponse] can increase * response payload size and serving latency. diff --git a/Retail/src/V2/ProductAttributeInterval.php b/Retail/src/V2/ProductAttributeInterval.php new file mode 100644 index 000000000000..d077bbd3ea7d --- /dev/null +++ b/Retail/src/V2/ProductAttributeInterval.php @@ -0,0 +1,111 @@ +google.cloud.retail.v2.ProductAttributeInterval + */ +class ProductAttributeInterval extends \Google\Protobuf\Internal\Message +{ + /** + * The attribute name (e.g. "length") + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The numeric interval (e.g. [10, 20)) + * + * Generated from protobuf field .google.cloud.retail.v2.Interval interval = 2; + */ + protected $interval = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The attribute name (e.g. "length") + * @type \Google\Cloud\Retail\V2\Interval $interval + * The numeric interval (e.g. [10, 20)) + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); + parent::__construct($data); + } + + /** + * The attribute name (e.g. "length") + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The attribute name (e.g. "length") + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The numeric interval (e.g. [10, 20)) + * + * Generated from protobuf field .google.cloud.retail.v2.Interval interval = 2; + * @return \Google\Cloud\Retail\V2\Interval|null + */ + public function getInterval() + { + return $this->interval; + } + + public function hasInterval() + { + return isset($this->interval); + } + + public function clearInterval() + { + unset($this->interval); + } + + /** + * The numeric interval (e.g. [10, 20)) + * + * Generated from protobuf field .google.cloud.retail.v2.Interval interval = 2; + * @param \Google\Cloud\Retail\V2\Interval $var + * @return $this + */ + public function setInterval($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\Interval::class); + $this->interval = $var; + + return $this; + } + +} + diff --git a/Retail/src/V2/ProductAttributeValue.php b/Retail/src/V2/ProductAttributeValue.php new file mode 100644 index 000000000000..0e258e59b22b --- /dev/null +++ b/Retail/src/V2/ProductAttributeValue.php @@ -0,0 +1,103 @@ +google.cloud.retail.v2.ProductAttributeValue + */ +class ProductAttributeValue extends \Google\Protobuf\Internal\Message +{ + /** + * The attribute name. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The attribute value. + * + * Generated from protobuf field string value = 2; + */ + protected $value = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The attribute name. + * @type string $value + * The attribute value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); + parent::__construct($data); + } + + /** + * The attribute name. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The attribute name. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The attribute value. + * + * Generated from protobuf field string value = 2; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * The attribute value. + * + * Generated from protobuf field string value = 2; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + +} + diff --git a/Retail/src/V2/Rule/ForceReturnFacetAction.php b/Retail/src/V2/Rule/ForceReturnFacetAction.php index 24238cc30930..034e39e1d160 100644 --- a/Retail/src/V2/Rule/ForceReturnFacetAction.php +++ b/Retail/src/V2/Rule/ForceReturnFacetAction.php @@ -38,7 +38,7 @@ class ForceReturnFacetAction extends \Google\Protobuf\Internal\Message { /** * Each instance corresponds to a force return attribute for the given - * condition. There can't be more 3 instances here. + * condition. There can't be more 15 instances here. * * Generated from protobuf field repeated .google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment facet_position_adjustments = 1; */ @@ -52,7 +52,7 @@ class ForceReturnFacetAction extends \Google\Protobuf\Internal\Message * * @type array<\Google\Cloud\Retail\V2\Rule\ForceReturnFacetAction\FacetPositionAdjustment>|\Google\Protobuf\Internal\RepeatedField $facet_position_adjustments * Each instance corresponds to a force return attribute for the given - * condition. There can't be more 3 instances here. + * condition. There can't be more 15 instances here. * } */ public function __construct($data = NULL) { @@ -62,7 +62,7 @@ public function __construct($data = NULL) { /** * Each instance corresponds to a force return attribute for the given - * condition. There can't be more 3 instances here. + * condition. There can't be more 15 instances here. * * Generated from protobuf field repeated .google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment facet_position_adjustments = 1; * @return \Google\Protobuf\Internal\RepeatedField @@ -74,7 +74,7 @@ public function getFacetPositionAdjustments() /** * Each instance corresponds to a force return attribute for the given - * condition. There can't be more 3 instances here. + * condition. There can't be more 15 instances here. * * Generated from protobuf field repeated .google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment facet_position_adjustments = 1; * @param array<\Google\Cloud\Retail\V2\Rule\ForceReturnFacetAction\FacetPositionAdjustment>|\Google\Protobuf\Internal\RepeatedField $var diff --git a/Retail/src/V2/SearchRequest.php b/Retail/src/V2/SearchRequest.php index 54a05c2617d5..b948fc40243f 100644 --- a/Retail/src/V2/SearchRequest.php +++ b/Retail/src/V2/SearchRequest.php @@ -320,6 +320,19 @@ class SearchRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field string entity = 38; */ protected $entity = ''; + /** + * Optional. This field specifies all conversational related parameters + * addition to traditional retail search. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec conversational_search_spec = 40 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $conversational_search_spec = null; + /** + * Optional. This field specifies tile navigation related parameters. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.TileNavigationSpec tile_navigation_spec = 41 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $tile_navigation_spec = null; /** * Constructor. @@ -542,6 +555,11 @@ class SearchRequest extends \Google\Protobuf\Internal\Message * If this is set, it should be exactly matched with * [UserEvent.entity][google.cloud.retail.v2.UserEvent.entity] to get search * results boosted by entity. + * @type \Google\Cloud\Retail\V2\SearchRequest\ConversationalSearchSpec $conversational_search_spec + * Optional. This field specifies all conversational related parameters + * addition to traditional retail search. + * @type \Google\Cloud\Retail\V2\SearchRequest\TileNavigationSpec $tile_navigation_spec + * Optional. This field specifies tile navigation related parameters. * } */ public function __construct($data = NULL) { @@ -1529,5 +1547,79 @@ public function setEntity($var) return $this; } + /** + * Optional. This field specifies all conversational related parameters + * addition to traditional retail search. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec conversational_search_spec = 40 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Retail\V2\SearchRequest\ConversationalSearchSpec|null + */ + public function getConversationalSearchSpec() + { + return $this->conversational_search_spec; + } + + public function hasConversationalSearchSpec() + { + return isset($this->conversational_search_spec); + } + + public function clearConversationalSearchSpec() + { + unset($this->conversational_search_spec); + } + + /** + * Optional. This field specifies all conversational related parameters + * addition to traditional retail search. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec conversational_search_spec = 40 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Retail\V2\SearchRequest\ConversationalSearchSpec $var + * @return $this + */ + public function setConversationalSearchSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\SearchRequest\ConversationalSearchSpec::class); + $this->conversational_search_spec = $var; + + return $this; + } + + /** + * Optional. This field specifies tile navigation related parameters. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.TileNavigationSpec tile_navigation_spec = 41 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Retail\V2\SearchRequest\TileNavigationSpec|null + */ + public function getTileNavigationSpec() + { + return $this->tile_navigation_spec; + } + + public function hasTileNavigationSpec() + { + return isset($this->tile_navigation_spec); + } + + public function clearTileNavigationSpec() + { + unset($this->tile_navigation_spec); + } + + /** + * Optional. This field specifies tile navigation related parameters. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.TileNavigationSpec tile_navigation_spec = 41 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Retail\V2\SearchRequest\TileNavigationSpec $var + * @return $this + */ + public function setTileNavigationSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\SearchRequest\TileNavigationSpec::class); + $this->tile_navigation_spec = $var; + + return $this; + } + } diff --git a/Retail/src/V2/SearchRequest/ConversationalSearchSpec.php b/Retail/src/V2/SearchRequest/ConversationalSearchSpec.php new file mode 100644 index 000000000000..5552df53e5a3 --- /dev/null +++ b/Retail/src/V2/SearchRequest/ConversationalSearchSpec.php @@ -0,0 +1,179 @@ +google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec + */ +class ConversationalSearchSpec extends \Google\Protobuf\Internal\Message +{ + /** + * This field specifies whether the customer would like to do conversational + * search. If this field is set to true, conversational related extra + * information will be returned from server side, including follow-up + * question, answer options, etc. + * + * Generated from protobuf field bool followup_conversation_requested = 1; + */ + protected $followup_conversation_requested = false; + /** + * This field specifies the conversation id, which maintains the state of + * the conversation between client side and server side. Use the value from + * the previous [ConversationalSearchResult.conversation_id][]. For the + * initial request, this should be empty. + * + * Generated from protobuf field string conversation_id = 2; + */ + protected $conversation_id = ''; + /** + * This field specifies the current user answer during the conversational + * search. This can be either user selected from suggested answers or user + * input plain text. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer user_answer = 3; + */ + protected $user_answer = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $followup_conversation_requested + * This field specifies whether the customer would like to do conversational + * search. If this field is set to true, conversational related extra + * information will be returned from server side, including follow-up + * question, answer options, etc. + * @type string $conversation_id + * This field specifies the conversation id, which maintains the state of + * the conversation between client side and server side. Use the value from + * the previous [ConversationalSearchResult.conversation_id][]. For the + * initial request, this should be empty. + * @type \Google\Cloud\Retail\V2\SearchRequest\ConversationalSearchSpec\UserAnswer $user_answer + * This field specifies the current user answer during the conversational + * search. This can be either user selected from suggested answers or user + * input plain text. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); + parent::__construct($data); + } + + /** + * This field specifies whether the customer would like to do conversational + * search. If this field is set to true, conversational related extra + * information will be returned from server side, including follow-up + * question, answer options, etc. + * + * Generated from protobuf field bool followup_conversation_requested = 1; + * @return bool + */ + public function getFollowupConversationRequested() + { + return $this->followup_conversation_requested; + } + + /** + * This field specifies whether the customer would like to do conversational + * search. If this field is set to true, conversational related extra + * information will be returned from server side, including follow-up + * question, answer options, etc. + * + * Generated from protobuf field bool followup_conversation_requested = 1; + * @param bool $var + * @return $this + */ + public function setFollowupConversationRequested($var) + { + GPBUtil::checkBool($var); + $this->followup_conversation_requested = $var; + + return $this; + } + + /** + * This field specifies the conversation id, which maintains the state of + * the conversation between client side and server side. Use the value from + * the previous [ConversationalSearchResult.conversation_id][]. For the + * initial request, this should be empty. + * + * Generated from protobuf field string conversation_id = 2; + * @return string + */ + public function getConversationId() + { + return $this->conversation_id; + } + + /** + * This field specifies the conversation id, which maintains the state of + * the conversation between client side and server side. Use the value from + * the previous [ConversationalSearchResult.conversation_id][]. For the + * initial request, this should be empty. + * + * Generated from protobuf field string conversation_id = 2; + * @param string $var + * @return $this + */ + public function setConversationId($var) + { + GPBUtil::checkString($var, True); + $this->conversation_id = $var; + + return $this; + } + + /** + * This field specifies the current user answer during the conversational + * search. This can be either user selected from suggested answers or user + * input plain text. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer user_answer = 3; + * @return \Google\Cloud\Retail\V2\SearchRequest\ConversationalSearchSpec\UserAnswer|null + */ + public function getUserAnswer() + { + return $this->user_answer; + } + + public function hasUserAnswer() + { + return isset($this->user_answer); + } + + public function clearUserAnswer() + { + unset($this->user_answer); + } + + /** + * This field specifies the current user answer during the conversational + * search. This can be either user selected from suggested answers or user + * input plain text. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer user_answer = 3; + * @param \Google\Cloud\Retail\V2\SearchRequest\ConversationalSearchSpec\UserAnswer $var + * @return $this + */ + public function setUserAnswer($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\SearchRequest\ConversationalSearchSpec\UserAnswer::class); + $this->user_answer = $var; + + return $this; + } + +} + + diff --git a/Retail/src/V2/SearchRequest/ConversationalSearchSpec/UserAnswer.php b/Retail/src/V2/SearchRequest/ConversationalSearchSpec/UserAnswer.php new file mode 100644 index 000000000000..5d651b48079c --- /dev/null +++ b/Retail/src/V2/SearchRequest/ConversationalSearchSpec/UserAnswer.php @@ -0,0 +1,120 @@ +google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer + */ +class UserAnswer extends \Google\Protobuf\Internal\Message +{ + protected $type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text_answer + * This field specifies the incremental input text from the user during + * the conversational search. + * @type \Google\Cloud\Retail\V2\SearchRequest\ConversationalSearchSpec\UserAnswer\SelectedAnswer $selected_answer + * This field specifies the selected attributes during the + * conversational search. This should be a subset of + * [ConversationalSearchResult.suggested_answers][]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); + parent::__construct($data); + } + + /** + * This field specifies the incremental input text from the user during + * the conversational search. + * + * Generated from protobuf field string text_answer = 1; + * @return string + */ + public function getTextAnswer() + { + return $this->readOneof(1); + } + + public function hasTextAnswer() + { + return $this->hasOneof(1); + } + + /** + * This field specifies the incremental input text from the user during + * the conversational search. + * + * Generated from protobuf field string text_answer = 1; + * @param string $var + * @return $this + */ + public function setTextAnswer($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * This field specifies the selected attributes during the + * conversational search. This should be a subset of + * [ConversationalSearchResult.suggested_answers][]. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer.SelectedAnswer selected_answer = 2; + * @return \Google\Cloud\Retail\V2\SearchRequest\ConversationalSearchSpec\UserAnswer\SelectedAnswer|null + */ + public function getSelectedAnswer() + { + return $this->readOneof(2); + } + + public function hasSelectedAnswer() + { + return $this->hasOneof(2); + } + + /** + * This field specifies the selected attributes during the + * conversational search. This should be a subset of + * [ConversationalSearchResult.suggested_answers][]. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer.SelectedAnswer selected_answer = 2; + * @param \Google\Cloud\Retail\V2\SearchRequest\ConversationalSearchSpec\UserAnswer\SelectedAnswer $var + * @return $this + */ + public function setSelectedAnswer($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\SearchRequest\ConversationalSearchSpec\UserAnswer\SelectedAnswer::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getType() + { + return $this->whichOneof("type"); + } + +} + + diff --git a/Retail/src/V2/SearchRequest/ConversationalSearchSpec/UserAnswer/SelectedAnswer.php b/Retail/src/V2/SearchRequest/ConversationalSearchSpec/UserAnswer/SelectedAnswer.php new file mode 100644 index 000000000000..75d013fe8008 --- /dev/null +++ b/Retail/src/V2/SearchRequest/ConversationalSearchSpec/UserAnswer/SelectedAnswer.php @@ -0,0 +1,122 @@ +google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer.SelectedAnswer + */ +class SelectedAnswer extends \Google\Protobuf\Internal\Message +{ + /** + * This field is deprecated and should not be set. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.ProductAttributeValue product_attribute_values = 1 [deprecated = true]; + * @deprecated + */ + private $product_attribute_values; + /** + * This field specifies the selected answer which is a attribute + * key-value. + * + * Generated from protobuf field .google.cloud.retail.v2.ProductAttributeValue product_attribute_value = 2; + */ + protected $product_attribute_value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Retail\V2\ProductAttributeValue>|\Google\Protobuf\Internal\RepeatedField $product_attribute_values + * This field is deprecated and should not be set. + * @type \Google\Cloud\Retail\V2\ProductAttributeValue $product_attribute_value + * This field specifies the selected answer which is a attribute + * key-value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); + parent::__construct($data); + } + + /** + * This field is deprecated and should not be set. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.ProductAttributeValue product_attribute_values = 1 [deprecated = true]; + * @return \Google\Protobuf\Internal\RepeatedField + * @deprecated + */ + public function getProductAttributeValues() + { + @trigger_error('product_attribute_values is deprecated.', E_USER_DEPRECATED); + return $this->product_attribute_values; + } + + /** + * This field is deprecated and should not be set. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.ProductAttributeValue product_attribute_values = 1 [deprecated = true]; + * @param array<\Google\Cloud\Retail\V2\ProductAttributeValue>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + * @deprecated + */ + public function setProductAttributeValues($var) + { + @trigger_error('product_attribute_values is deprecated.', E_USER_DEPRECATED); + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\ProductAttributeValue::class); + $this->product_attribute_values = $arr; + + return $this; + } + + /** + * This field specifies the selected answer which is a attribute + * key-value. + * + * Generated from protobuf field .google.cloud.retail.v2.ProductAttributeValue product_attribute_value = 2; + * @return \Google\Cloud\Retail\V2\ProductAttributeValue|null + */ + public function getProductAttributeValue() + { + return $this->product_attribute_value; + } + + public function hasProductAttributeValue() + { + return isset($this->product_attribute_value); + } + + public function clearProductAttributeValue() + { + unset($this->product_attribute_value); + } + + /** + * This field specifies the selected answer which is a attribute + * key-value. + * + * Generated from protobuf field .google.cloud.retail.v2.ProductAttributeValue product_attribute_value = 2; + * @param \Google\Cloud\Retail\V2\ProductAttributeValue $var + * @return $this + */ + public function setProductAttributeValue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\ProductAttributeValue::class); + $this->product_attribute_value = $var; + + return $this; + } + +} + + diff --git a/Retail/src/V2/SearchRequest/TileNavigationSpec.php b/Retail/src/V2/SearchRequest/TileNavigationSpec.php new file mode 100644 index 000000000000..c2369b992a20 --- /dev/null +++ b/Retail/src/V2/SearchRequest/TileNavigationSpec.php @@ -0,0 +1,118 @@ +google.cloud.retail.v2.SearchRequest.TileNavigationSpec + */ +class TileNavigationSpec extends \Google\Protobuf\Internal\Message +{ + /** + * This field specifies whether the customer would like to request tile + * navigation. + * + * Generated from protobuf field bool tile_navigation_requested = 1; + */ + protected $tile_navigation_requested = false; + /** + * This field specifies the tiles which are already clicked in client side. + * NOTE: This field is not being used for filtering search products. Client + * side should also put all the applied tiles in + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Tile applied_tiles = 2; + */ + private $applied_tiles; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $tile_navigation_requested + * This field specifies whether the customer would like to request tile + * navigation. + * @type array<\Google\Cloud\Retail\V2\Tile>|\Google\Protobuf\Internal\RepeatedField $applied_tiles + * This field specifies the tiles which are already clicked in client side. + * NOTE: This field is not being used for filtering search products. Client + * side should also put all the applied tiles in + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); + parent::__construct($data); + } + + /** + * This field specifies whether the customer would like to request tile + * navigation. + * + * Generated from protobuf field bool tile_navigation_requested = 1; + * @return bool + */ + public function getTileNavigationRequested() + { + return $this->tile_navigation_requested; + } + + /** + * This field specifies whether the customer would like to request tile + * navigation. + * + * Generated from protobuf field bool tile_navigation_requested = 1; + * @param bool $var + * @return $this + */ + public function setTileNavigationRequested($var) + { + GPBUtil::checkBool($var); + $this->tile_navigation_requested = $var; + + return $this; + } + + /** + * This field specifies the tiles which are already clicked in client side. + * NOTE: This field is not being used for filtering search products. Client + * side should also put all the applied tiles in + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Tile applied_tiles = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAppliedTiles() + { + return $this->applied_tiles; + } + + /** + * This field specifies the tiles which are already clicked in client side. + * NOTE: This field is not being used for filtering search products. Client + * side should also put all the applied tiles in + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Tile applied_tiles = 2; + * @param array<\Google\Cloud\Retail\V2\Tile>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAppliedTiles($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\Tile::class); + $this->applied_tiles = $arr; + + return $this; + } + +} + + diff --git a/Retail/src/V2/SearchResponse.php b/Retail/src/V2/SearchResponse.php index c87e0c07238c..f8508be2ccc4 100644 --- a/Retail/src/V2/SearchResponse.php +++ b/Retail/src/V2/SearchResponse.php @@ -101,6 +101,20 @@ class SearchResponse extends \Google\Protobuf\Internal\Message * Generated from protobuf field repeated .google.cloud.retail.v2.ExperimentInfo experiment_info = 17; */ private $experiment_info; + /** + * This field specifies all related information that is needed on client + * side for UI rendering of conversational retail search. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchResponse.ConversationalSearchResult conversational_search_result = 18; + */ + protected $conversational_search_result = null; + /** + * This field specifies all related information for tile navigation that will + * be used in client side. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchResponse.TileNavigationResult tile_navigation_result = 19; + */ + protected $tile_navigation_result = null; /** * Constructor. @@ -149,6 +163,12 @@ class SearchResponse extends \Google\Protobuf\Internal\Message * @type array<\Google\Cloud\Retail\V2\ExperimentInfo>|\Google\Protobuf\Internal\RepeatedField $experiment_info * Metadata related to A/B testing [Experiment][] associated with this * response. Only exists when an experiment is triggered. + * @type \Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult $conversational_search_result + * This field specifies all related information that is needed on client + * side for UI rendering of conversational retail search. + * @type \Google\Cloud\Retail\V2\SearchResponse\TileNavigationResult $tile_navigation_result + * This field specifies all related information for tile navigation that will + * be used in client side. * } */ public function __construct($data = NULL) { @@ -490,5 +510,81 @@ public function setExperimentInfo($var) return $this; } + /** + * This field specifies all related information that is needed on client + * side for UI rendering of conversational retail search. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchResponse.ConversationalSearchResult conversational_search_result = 18; + * @return \Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult|null + */ + public function getConversationalSearchResult() + { + return $this->conversational_search_result; + } + + public function hasConversationalSearchResult() + { + return isset($this->conversational_search_result); + } + + public function clearConversationalSearchResult() + { + unset($this->conversational_search_result); + } + + /** + * This field specifies all related information that is needed on client + * side for UI rendering of conversational retail search. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchResponse.ConversationalSearchResult conversational_search_result = 18; + * @param \Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult $var + * @return $this + */ + public function setConversationalSearchResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult::class); + $this->conversational_search_result = $var; + + return $this; + } + + /** + * This field specifies all related information for tile navigation that will + * be used in client side. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchResponse.TileNavigationResult tile_navigation_result = 19; + * @return \Google\Cloud\Retail\V2\SearchResponse\TileNavigationResult|null + */ + public function getTileNavigationResult() + { + return $this->tile_navigation_result; + } + + public function hasTileNavigationResult() + { + return isset($this->tile_navigation_result); + } + + public function clearTileNavigationResult() + { + unset($this->tile_navigation_result); + } + + /** + * This field specifies all related information for tile navigation that will + * be used in client side. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchResponse.TileNavigationResult tile_navigation_result = 19; + * @param \Google\Cloud\Retail\V2\SearchResponse\TileNavigationResult $var + * @return $this + */ + public function setTileNavigationResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\SearchResponse\TileNavigationResult::class); + $this->tile_navigation_result = $var; + + return $this; + } + } diff --git a/Retail/src/V2/SearchResponse/ConversationalSearchResult.php b/Retail/src/V2/SearchResponse/ConversationalSearchResult.php new file mode 100644 index 000000000000..a41fd134efd0 --- /dev/null +++ b/Retail/src/V2/SearchResponse/ConversationalSearchResult.php @@ -0,0 +1,322 @@ +google.cloud.retail.v2.SearchResponse.ConversationalSearchResult + */ +class ConversationalSearchResult extends \Google\Protobuf\Internal\Message +{ + /** + * Conversation UUID. This field will be stored in client side storage to + * maintain the conversation session with server and will be used for next + * search request's + * [SearchRequest.ConversationalSearchSpec.conversation_id][google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.conversation_id] + * to restore conversation state in server. + * + * Generated from protobuf field string conversation_id = 1; + */ + protected $conversation_id = ''; + /** + * The current refined query for the conversational search. This field + * will be used in customer UI that the query in the search bar should be + * replaced with the refined query. For example, if + * [SearchRequest.query][google.cloud.retail.v2.SearchRequest.query] is + * `dress` and next + * [SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer][google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer] + * is `red color`, which does not match any product attribute value filters, + * the refined query will be `dress, red color`. + * + * Generated from protobuf field string refined_query = 2; + */ + protected $refined_query = ''; + /** + * This field is deprecated but will be kept for backward compatibility. + * There is expected to have only one additional filter and the value will + * be the same to the same as field `additional_filter`. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.AdditionalFilter additional_filters = 3 [deprecated = true]; + * @deprecated + */ + private $additional_filters; + /** + * The follow-up question. e.g., `What is the color?` + * + * Generated from protobuf field string followup_question = 4; + */ + protected $followup_question = ''; + /** + * The answer options provided to client for the follow-up question. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.SuggestedAnswer suggested_answers = 5; + */ + private $suggested_answers; + /** + * This is the incremental additional filters implied from the current + * user answer. User should add the suggested addition filters to the + * previous + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter], and + * use the merged filter in the follow up search request. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.AdditionalFilter additional_filter = 6; + */ + protected $additional_filter = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $conversation_id + * Conversation UUID. This field will be stored in client side storage to + * maintain the conversation session with server and will be used for next + * search request's + * [SearchRequest.ConversationalSearchSpec.conversation_id][google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.conversation_id] + * to restore conversation state in server. + * @type string $refined_query + * The current refined query for the conversational search. This field + * will be used in customer UI that the query in the search bar should be + * replaced with the refined query. For example, if + * [SearchRequest.query][google.cloud.retail.v2.SearchRequest.query] is + * `dress` and next + * [SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer][google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer] + * is `red color`, which does not match any product attribute value filters, + * the refined query will be `dress, red color`. + * @type array<\Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult\AdditionalFilter>|\Google\Protobuf\Internal\RepeatedField $additional_filters + * This field is deprecated but will be kept for backward compatibility. + * There is expected to have only one additional filter and the value will + * be the same to the same as field `additional_filter`. + * @type string $followup_question + * The follow-up question. e.g., `What is the color?` + * @type array<\Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult\SuggestedAnswer>|\Google\Protobuf\Internal\RepeatedField $suggested_answers + * The answer options provided to client for the follow-up question. + * @type \Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult\AdditionalFilter $additional_filter + * This is the incremental additional filters implied from the current + * user answer. User should add the suggested addition filters to the + * previous + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter], and + * use the merged filter in the follow up search request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); + parent::__construct($data); + } + + /** + * Conversation UUID. This field will be stored in client side storage to + * maintain the conversation session with server and will be used for next + * search request's + * [SearchRequest.ConversationalSearchSpec.conversation_id][google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.conversation_id] + * to restore conversation state in server. + * + * Generated from protobuf field string conversation_id = 1; + * @return string + */ + public function getConversationId() + { + return $this->conversation_id; + } + + /** + * Conversation UUID. This field will be stored in client side storage to + * maintain the conversation session with server and will be used for next + * search request's + * [SearchRequest.ConversationalSearchSpec.conversation_id][google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.conversation_id] + * to restore conversation state in server. + * + * Generated from protobuf field string conversation_id = 1; + * @param string $var + * @return $this + */ + public function setConversationId($var) + { + GPBUtil::checkString($var, True); + $this->conversation_id = $var; + + return $this; + } + + /** + * The current refined query for the conversational search. This field + * will be used in customer UI that the query in the search bar should be + * replaced with the refined query. For example, if + * [SearchRequest.query][google.cloud.retail.v2.SearchRequest.query] is + * `dress` and next + * [SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer][google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer] + * is `red color`, which does not match any product attribute value filters, + * the refined query will be `dress, red color`. + * + * Generated from protobuf field string refined_query = 2; + * @return string + */ + public function getRefinedQuery() + { + return $this->refined_query; + } + + /** + * The current refined query for the conversational search. This field + * will be used in customer UI that the query in the search bar should be + * replaced with the refined query. For example, if + * [SearchRequest.query][google.cloud.retail.v2.SearchRequest.query] is + * `dress` and next + * [SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer][google.cloud.retail.v2.SearchRequest.ConversationalSearchSpec.UserAnswer.text_answer] + * is `red color`, which does not match any product attribute value filters, + * the refined query will be `dress, red color`. + * + * Generated from protobuf field string refined_query = 2; + * @param string $var + * @return $this + */ + public function setRefinedQuery($var) + { + GPBUtil::checkString($var, True); + $this->refined_query = $var; + + return $this; + } + + /** + * This field is deprecated but will be kept for backward compatibility. + * There is expected to have only one additional filter and the value will + * be the same to the same as field `additional_filter`. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.AdditionalFilter additional_filters = 3 [deprecated = true]; + * @return \Google\Protobuf\Internal\RepeatedField + * @deprecated + */ + public function getAdditionalFilters() + { + @trigger_error('additional_filters is deprecated.', E_USER_DEPRECATED); + return $this->additional_filters; + } + + /** + * This field is deprecated but will be kept for backward compatibility. + * There is expected to have only one additional filter and the value will + * be the same to the same as field `additional_filter`. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.AdditionalFilter additional_filters = 3 [deprecated = true]; + * @param array<\Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult\AdditionalFilter>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + * @deprecated + */ + public function setAdditionalFilters($var) + { + @trigger_error('additional_filters is deprecated.', E_USER_DEPRECATED); + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult\AdditionalFilter::class); + $this->additional_filters = $arr; + + return $this; + } + + /** + * The follow-up question. e.g., `What is the color?` + * + * Generated from protobuf field string followup_question = 4; + * @return string + */ + public function getFollowupQuestion() + { + return $this->followup_question; + } + + /** + * The follow-up question. e.g., `What is the color?` + * + * Generated from protobuf field string followup_question = 4; + * @param string $var + * @return $this + */ + public function setFollowupQuestion($var) + { + GPBUtil::checkString($var, True); + $this->followup_question = $var; + + return $this; + } + + /** + * The answer options provided to client for the follow-up question. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.SuggestedAnswer suggested_answers = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSuggestedAnswers() + { + return $this->suggested_answers; + } + + /** + * The answer options provided to client for the follow-up question. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.SuggestedAnswer suggested_answers = 5; + * @param array<\Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult\SuggestedAnswer>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSuggestedAnswers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult\SuggestedAnswer::class); + $this->suggested_answers = $arr; + + return $this; + } + + /** + * This is the incremental additional filters implied from the current + * user answer. User should add the suggested addition filters to the + * previous + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter], and + * use the merged filter in the follow up search request. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.AdditionalFilter additional_filter = 6; + * @return \Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult\AdditionalFilter|null + */ + public function getAdditionalFilter() + { + return $this->additional_filter; + } + + public function hasAdditionalFilter() + { + return isset($this->additional_filter); + } + + public function clearAdditionalFilter() + { + unset($this->additional_filter); + } + + /** + * This is the incremental additional filters implied from the current + * user answer. User should add the suggested addition filters to the + * previous + * [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter], and + * use the merged filter in the follow up search request. + * + * Generated from protobuf field .google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.AdditionalFilter additional_filter = 6; + * @param \Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult\AdditionalFilter $var + * @return $this + */ + public function setAdditionalFilter($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\SearchResponse\ConversationalSearchResult\AdditionalFilter::class); + $this->additional_filter = $var; + + return $this; + } + +} + + diff --git a/Retail/src/V2/SearchResponse/ConversationalSearchResult/AdditionalFilter.php b/Retail/src/V2/SearchResponse/ConversationalSearchResult/AdditionalFilter.php new file mode 100644 index 000000000000..a68e9cc7d57a --- /dev/null +++ b/Retail/src/V2/SearchResponse/ConversationalSearchResult/AdditionalFilter.php @@ -0,0 +1,82 @@ +google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.AdditionalFilter + */ +class AdditionalFilter extends \Google\Protobuf\Internal\Message +{ + /** + * Product attribute value, including an attribute key and an + * attribute value. Other types can be added here in the future. + * + * Generated from protobuf field .google.cloud.retail.v2.ProductAttributeValue product_attribute_value = 1; + */ + protected $product_attribute_value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Retail\V2\ProductAttributeValue $product_attribute_value + * Product attribute value, including an attribute key and an + * attribute value. Other types can be added here in the future. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); + parent::__construct($data); + } + + /** + * Product attribute value, including an attribute key and an + * attribute value. Other types can be added here in the future. + * + * Generated from protobuf field .google.cloud.retail.v2.ProductAttributeValue product_attribute_value = 1; + * @return \Google\Cloud\Retail\V2\ProductAttributeValue|null + */ + public function getProductAttributeValue() + { + return $this->product_attribute_value; + } + + public function hasProductAttributeValue() + { + return isset($this->product_attribute_value); + } + + public function clearProductAttributeValue() + { + unset($this->product_attribute_value); + } + + /** + * Product attribute value, including an attribute key and an + * attribute value. Other types can be added here in the future. + * + * Generated from protobuf field .google.cloud.retail.v2.ProductAttributeValue product_attribute_value = 1; + * @param \Google\Cloud\Retail\V2\ProductAttributeValue $var + * @return $this + */ + public function setProductAttributeValue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\ProductAttributeValue::class); + $this->product_attribute_value = $var; + + return $this; + } + +} + + diff --git a/Retail/src/V2/SearchResponse/ConversationalSearchResult/SuggestedAnswer.php b/Retail/src/V2/SearchResponse/ConversationalSearchResult/SuggestedAnswer.php new file mode 100644 index 000000000000..8f92198beec5 --- /dev/null +++ b/Retail/src/V2/SearchResponse/ConversationalSearchResult/SuggestedAnswer.php @@ -0,0 +1,82 @@ +google.cloud.retail.v2.SearchResponse.ConversationalSearchResult.SuggestedAnswer + */ +class SuggestedAnswer extends \Google\Protobuf\Internal\Message +{ + /** + * Product attribute value, including an attribute key and an + * attribute value. Other types can be added here in the future. + * + * Generated from protobuf field .google.cloud.retail.v2.ProductAttributeValue product_attribute_value = 1; + */ + protected $product_attribute_value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Retail\V2\ProductAttributeValue $product_attribute_value + * Product attribute value, including an attribute key and an + * attribute value. Other types can be added here in the future. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); + parent::__construct($data); + } + + /** + * Product attribute value, including an attribute key and an + * attribute value. Other types can be added here in the future. + * + * Generated from protobuf field .google.cloud.retail.v2.ProductAttributeValue product_attribute_value = 1; + * @return \Google\Cloud\Retail\V2\ProductAttributeValue|null + */ + public function getProductAttributeValue() + { + return $this->product_attribute_value; + } + + public function hasProductAttributeValue() + { + return isset($this->product_attribute_value); + } + + public function clearProductAttributeValue() + { + unset($this->product_attribute_value); + } + + /** + * Product attribute value, including an attribute key and an + * attribute value. Other types can be added here in the future. + * + * Generated from protobuf field .google.cloud.retail.v2.ProductAttributeValue product_attribute_value = 1; + * @param \Google\Cloud\Retail\V2\ProductAttributeValue $var + * @return $this + */ + public function setProductAttributeValue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\ProductAttributeValue::class); + $this->product_attribute_value = $var; + + return $this; + } + +} + + diff --git a/Retail/src/V2/SearchResponse/TileNavigationResult.php b/Retail/src/V2/SearchResponse/TileNavigationResult.php new file mode 100644 index 000000000000..585a811d5a81 --- /dev/null +++ b/Retail/src/V2/SearchResponse/TileNavigationResult.php @@ -0,0 +1,73 @@ +google.cloud.retail.v2.SearchResponse.TileNavigationResult + */ +class TileNavigationResult extends \Google\Protobuf\Internal\Message +{ + /** + * The current tiles that are used for tile navigation, sorted by + * engagement. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Tile tiles = 1; + */ + private $tiles; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Retail\V2\Tile>|\Google\Protobuf\Internal\RepeatedField $tiles + * The current tiles that are used for tile navigation, sorted by + * engagement. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); + parent::__construct($data); + } + + /** + * The current tiles that are used for tile navigation, sorted by + * engagement. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Tile tiles = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTiles() + { + return $this->tiles; + } + + /** + * The current tiles that are used for tile navigation, sorted by + * engagement. + * + * Generated from protobuf field repeated .google.cloud.retail.v2.Tile tiles = 1; + * @param array<\Google\Cloud\Retail\V2\Tile>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTiles($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\Tile::class); + $this->tiles = $arr; + + return $this; + } + +} + + diff --git a/Retail/src/V2/Tile.php b/Retail/src/V2/Tile.php new file mode 100644 index 000000000000..cd96719b01d0 --- /dev/null +++ b/Retail/src/V2/Tile.php @@ -0,0 +1,144 @@ +google.cloud.retail.v2.Tile + */ +class Tile extends \Google\Protobuf\Internal\Message +{ + /** + * The representative product id for this tile. + * + * Generated from protobuf field string representative_product_id = 3; + */ + protected $representative_product_id = ''; + protected $product_attribute; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Retail\V2\ProductAttributeValue $product_attribute_value + * The product attribute key-value. + * @type \Google\Cloud\Retail\V2\ProductAttributeInterval $product_attribute_interval + * The product attribute key-numeric interval. + * @type string $representative_product_id + * The representative product id for this tile. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce(); + parent::__construct($data); + } + + /** + * The product attribute key-value. + * + * Generated from protobuf field .google.cloud.retail.v2.ProductAttributeValue product_attribute_value = 1; + * @return \Google\Cloud\Retail\V2\ProductAttributeValue|null + */ + public function getProductAttributeValue() + { + return $this->readOneof(1); + } + + public function hasProductAttributeValue() + { + return $this->hasOneof(1); + } + + /** + * The product attribute key-value. + * + * Generated from protobuf field .google.cloud.retail.v2.ProductAttributeValue product_attribute_value = 1; + * @param \Google\Cloud\Retail\V2\ProductAttributeValue $var + * @return $this + */ + public function setProductAttributeValue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\ProductAttributeValue::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * The product attribute key-numeric interval. + * + * Generated from protobuf field .google.cloud.retail.v2.ProductAttributeInterval product_attribute_interval = 2; + * @return \Google\Cloud\Retail\V2\ProductAttributeInterval|null + */ + public function getProductAttributeInterval() + { + return $this->readOneof(2); + } + + public function hasProductAttributeInterval() + { + return $this->hasOneof(2); + } + + /** + * The product attribute key-numeric interval. + * + * Generated from protobuf field .google.cloud.retail.v2.ProductAttributeInterval product_attribute_interval = 2; + * @param \Google\Cloud\Retail\V2\ProductAttributeInterval $var + * @return $this + */ + public function setProductAttributeInterval($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\ProductAttributeInterval::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The representative product id for this tile. + * + * Generated from protobuf field string representative_product_id = 3; + * @return string + */ + public function getRepresentativeProductId() + { + return $this->representative_product_id; + } + + /** + * The representative product id for this tile. + * + * Generated from protobuf field string representative_product_id = 3; + * @param string $var + * @return $this + */ + public function setRepresentativeProductId($var) + { + GPBUtil::checkString($var, True); + $this->representative_product_id = $var; + + return $this; + } + + /** + * @return string + */ + public function getProductAttribute() + { + return $this->whichOneof("product_attribute"); + } + +} + diff --git a/Retail/src/V2/UpdateGenerativeQuestionConfigRequest.php b/Retail/src/V2/UpdateGenerativeQuestionConfigRequest.php new file mode 100644 index 000000000000..63d052fd0322 --- /dev/null +++ b/Retail/src/V2/UpdateGenerativeQuestionConfigRequest.php @@ -0,0 +1,158 @@ +google.cloud.retail.v2.UpdateGenerativeQuestionConfigRequest + */ +class UpdateGenerativeQuestionConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The question to update. + * + * Generated from protobuf field .google.cloud.retail.v2.GenerativeQuestionConfig generative_question_config = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $generative_question_config = null; + /** + * Optional. Indicates which fields in the provided + * [GenerativeQuestionConfig][google.cloud.retail.v2.GenerativeQuestionConfig] + * to update. The following are NOT supported: + * * [GenerativeQuestionConfig.frequency][google.cloud.retail.v2.GenerativeQuestionConfig.frequency] + * If not set or empty, all supported fields are updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Retail\V2\GenerativeQuestionConfig $generativeQuestionConfig Required. The question to update. + * @param \Google\Protobuf\FieldMask $updateMask Optional. Indicates which fields in the provided + * [GenerativeQuestionConfig][google.cloud.retail.v2.GenerativeQuestionConfig] + * to update. The following are NOT supported: + * + * * [GenerativeQuestionConfig.frequency][google.cloud.retail.v2.GenerativeQuestionConfig.frequency] + * + * If not set or empty, all supported fields are updated. + * + * @return \Google\Cloud\Retail\V2\UpdateGenerativeQuestionConfigRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Retail\V2\GenerativeQuestionConfig $generativeQuestionConfig, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setGenerativeQuestionConfig($generativeQuestionConfig) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Retail\V2\GenerativeQuestionConfig $generative_question_config + * Required. The question to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Indicates which fields in the provided + * [GenerativeQuestionConfig][google.cloud.retail.v2.GenerativeQuestionConfig] + * to update. The following are NOT supported: + * * [GenerativeQuestionConfig.frequency][google.cloud.retail.v2.GenerativeQuestionConfig.frequency] + * If not set or empty, all supported fields are updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\GenerativeQuestionService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The question to update. + * + * Generated from protobuf field .google.cloud.retail.v2.GenerativeQuestionConfig generative_question_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Retail\V2\GenerativeQuestionConfig|null + */ + public function getGenerativeQuestionConfig() + { + return $this->generative_question_config; + } + + public function hasGenerativeQuestionConfig() + { + return isset($this->generative_question_config); + } + + public function clearGenerativeQuestionConfig() + { + unset($this->generative_question_config); + } + + /** + * Required. The question to update. + * + * Generated from protobuf field .google.cloud.retail.v2.GenerativeQuestionConfig generative_question_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Retail\V2\GenerativeQuestionConfig $var + * @return $this + */ + public function setGenerativeQuestionConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\GenerativeQuestionConfig::class); + $this->generative_question_config = $var; + + return $this; + } + + /** + * Optional. Indicates which fields in the provided + * [GenerativeQuestionConfig][google.cloud.retail.v2.GenerativeQuestionConfig] + * to update. The following are NOT supported: + * * [GenerativeQuestionConfig.frequency][google.cloud.retail.v2.GenerativeQuestionConfig.frequency] + * If not set or empty, all supported fields are updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. Indicates which fields in the provided + * [GenerativeQuestionConfig][google.cloud.retail.v2.GenerativeQuestionConfig] + * to update. The following are NOT supported: + * * [GenerativeQuestionConfig.frequency][google.cloud.retail.v2.GenerativeQuestionConfig.frequency] + * If not set or empty, all supported fields are updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/Retail/src/V2/UpdateGenerativeQuestionsFeatureConfigRequest.php b/Retail/src/V2/UpdateGenerativeQuestionsFeatureConfigRequest.php new file mode 100644 index 000000000000..29dfb439aa90 --- /dev/null +++ b/Retail/src/V2/UpdateGenerativeQuestionsFeatureConfigRequest.php @@ -0,0 +1,146 @@ +google.cloud.retail.v2.UpdateGenerativeQuestionsFeatureConfigRequest + */ +class UpdateGenerativeQuestionsFeatureConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The configuration managing the feature state. + * + * Generated from protobuf field .google.cloud.retail.v2.GenerativeQuestionsFeatureConfig generative_questions_feature_config = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $generative_questions_feature_config = null; + /** + * Optional. Indicates which fields in the provided + * [GenerativeQuestionsFeatureConfig][google.cloud.retail.v2.GenerativeQuestionsFeatureConfig] + * to update. If not set or empty, all supported fields are updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Retail\V2\GenerativeQuestionsFeatureConfig $generativeQuestionsFeatureConfig Required. The configuration managing the feature state. + * @param \Google\Protobuf\FieldMask $updateMask Optional. Indicates which fields in the provided + * [GenerativeQuestionsFeatureConfig][google.cloud.retail.v2.GenerativeQuestionsFeatureConfig] + * to update. If not set or empty, all supported fields are updated. + * + * @return \Google\Cloud\Retail\V2\UpdateGenerativeQuestionsFeatureConfigRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Retail\V2\GenerativeQuestionsFeatureConfig $generativeQuestionsFeatureConfig, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setGenerativeQuestionsFeatureConfig($generativeQuestionsFeatureConfig) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Retail\V2\GenerativeQuestionsFeatureConfig $generative_questions_feature_config + * Required. The configuration managing the feature state. + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Indicates which fields in the provided + * [GenerativeQuestionsFeatureConfig][google.cloud.retail.v2.GenerativeQuestionsFeatureConfig] + * to update. If not set or empty, all supported fields are updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Retail\V2\GenerativeQuestionService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The configuration managing the feature state. + * + * Generated from protobuf field .google.cloud.retail.v2.GenerativeQuestionsFeatureConfig generative_questions_feature_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Retail\V2\GenerativeQuestionsFeatureConfig|null + */ + public function getGenerativeQuestionsFeatureConfig() + { + return $this->generative_questions_feature_config; + } + + public function hasGenerativeQuestionsFeatureConfig() + { + return isset($this->generative_questions_feature_config); + } + + public function clearGenerativeQuestionsFeatureConfig() + { + unset($this->generative_questions_feature_config); + } + + /** + * Required. The configuration managing the feature state. + * + * Generated from protobuf field .google.cloud.retail.v2.GenerativeQuestionsFeatureConfig generative_questions_feature_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Retail\V2\GenerativeQuestionsFeatureConfig $var + * @return $this + */ + public function setGenerativeQuestionsFeatureConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\GenerativeQuestionsFeatureConfig::class); + $this->generative_questions_feature_config = $var; + + return $this; + } + + /** + * Optional. Indicates which fields in the provided + * [GenerativeQuestionsFeatureConfig][google.cloud.retail.v2.GenerativeQuestionsFeatureConfig] + * to update. If not set or empty, all supported fields are updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. Indicates which fields in the provided + * [GenerativeQuestionsFeatureConfig][google.cloud.retail.v2.GenerativeQuestionsFeatureConfig] + * to update. If not set or empty, all supported fields are updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/Retail/src/V2/gapic_metadata.json b/Retail/src/V2/gapic_metadata.json index 7c30c861c0d5..a4ab5df79825 100644 --- a/Retail/src/V2/gapic_metadata.json +++ b/Retail/src/V2/gapic_metadata.json @@ -136,6 +136,40 @@ } } }, + "GenerativeQuestionService": { + "clients": { + "grpc": { + "libraryClient": "GenerativeQuestionServiceGapicClient", + "rpcs": { + "BatchUpdateGenerativeQuestionConfigs": { + "methods": [ + "batchUpdateGenerativeQuestionConfigs" + ] + }, + "GetGenerativeQuestionsFeatureConfig": { + "methods": [ + "getGenerativeQuestionsFeatureConfig" + ] + }, + "ListGenerativeQuestionConfigs": { + "methods": [ + "listGenerativeQuestionConfigs" + ] + }, + "UpdateGenerativeQuestionConfig": { + "methods": [ + "updateGenerativeQuestionConfig" + ] + }, + "UpdateGenerativeQuestionsFeatureConfig": { + "methods": [ + "updateGenerativeQuestionsFeatureConfig" + ] + } + } + } + } + }, "ModelService": { "clients": { "grpc": { diff --git a/Retail/src/V2/resources/generative_question_service_client_config.json b/Retail/src/V2/resources/generative_question_service_client_config.json new file mode 100644 index 000000000000..a22e14095f73 --- /dev/null +++ b/Retail/src/V2/resources/generative_question_service_client_config.json @@ -0,0 +1,47 @@ +{ + "interfaces": { + "google.cloud.retail.v2.GenerativeQuestionService": { + "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": { + "BatchUpdateGenerativeQuestionConfigs": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetGenerativeQuestionsFeatureConfig": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListGenerativeQuestionConfigs": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateGenerativeQuestionConfig": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateGenerativeQuestionsFeatureConfig": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/Retail/src/V2/resources/generative_question_service_descriptor_config.php b/Retail/src/V2/resources/generative_question_service_descriptor_config.php new file mode 100644 index 000000000000..56b813c71536 --- /dev/null +++ b/Retail/src/V2/resources/generative_question_service_descriptor_config.php @@ -0,0 +1,93 @@ + [ + 'google.cloud.retail.v2.GenerativeQuestionService' => [ + 'BatchUpdateGenerativeQuestionConfigs' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\BatchUpdateGenerativeQuestionConfigsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetGenerativeQuestionsFeatureConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\GenerativeQuestionsFeatureConfig', + 'headerParams' => [ + [ + 'keyName' => 'catalog', + 'fieldAccessors' => [ + 'getCatalog', + ], + ], + ], + ], + 'ListGenerativeQuestionConfigs' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\ListGenerativeQuestionConfigsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateGenerativeQuestionConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\GenerativeQuestionConfig', + 'headerParams' => [ + [ + 'keyName' => 'generative_question_config.catalog', + 'fieldAccessors' => [ + 'getGenerativeQuestionConfig', + 'getCatalog', + ], + ], + ], + ], + 'UpdateGenerativeQuestionsFeatureConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Retail\V2\GenerativeQuestionsFeatureConfig', + 'headerParams' => [ + [ + 'keyName' => 'generative_questions_feature_config.catalog', + 'fieldAccessors' => [ + 'getGenerativeQuestionsFeatureConfig', + 'getCatalog', + ], + ], + ], + ], + 'templateMap' => [ + 'catalog' => 'projects/{project}/locations/{location}/catalogs/{catalog}', + ], + ], + ], +]; diff --git a/Retail/src/V2/resources/generative_question_service_rest_client_config.php b/Retail/src/V2/resources/generative_question_service_rest_client_config.php new file mode 100644 index 000000000000..eef5c95d149f --- /dev/null +++ b/Retail/src/V2/resources/generative_question_service_rest_client_config.php @@ -0,0 +1,137 @@ + [ + 'google.cloud.retail.v2.GenerativeQuestionService' => [ + 'BatchUpdateGenerativeQuestionConfigs' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/catalogs/*}/generativeQuestion:batchUpdate', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'GetGenerativeQuestionsFeatureConfig' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{catalog=projects/*/locations/*/catalogs/*}/generativeQuestionFeature', + 'placeholders' => [ + 'catalog' => [ + 'getters' => [ + 'getCatalog', + ], + ], + ], + ], + 'ListGenerativeQuestionConfigs' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/catalogs/*}/generativeQuestions', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateGenerativeQuestionConfig' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{generative_question_config.catalog=projects/*/locations/*/catalogs/*}/generativeQuestion', + 'body' => 'generative_question_config', + 'placeholders' => [ + 'generative_question_config.catalog' => [ + 'getters' => [ + 'getGenerativeQuestionConfig', + 'getCatalog', + ], + ], + ], + ], + 'UpdateGenerativeQuestionsFeatureConfig' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{generative_questions_feature_config.catalog=projects/*/locations/*/catalogs/*}/generativeQuestionFeature', + 'body' => 'generative_questions_feature_config', + 'placeholders' => [ + 'generative_questions_feature_config.catalog' => [ + 'getters' => [ + 'getGenerativeQuestionsFeatureConfig', + 'getCatalog', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/branches/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*/operations/*}', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/catalogs/*}/operations', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/Retail/tests/Unit/V2/Client/GenerativeQuestionServiceClientTest.php b/Retail/tests/Unit/V2/Client/GenerativeQuestionServiceClientTest.php new file mode 100644 index 000000000000..e4675523e6c3 --- /dev/null +++ b/Retail/tests/Unit/V2/Client/GenerativeQuestionServiceClientTest.php @@ -0,0 +1,474 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return GenerativeQuestionServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new GenerativeQuestionServiceClient($options); + } + + /** @test */ + public function batchUpdateGenerativeQuestionConfigsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new BatchUpdateGenerativeQuestionConfigsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $requests = []; + $request = (new BatchUpdateGenerativeQuestionConfigsRequest())->setRequests($requests); + $response = $gapicClient->batchUpdateGenerativeQuestionConfigs($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.retail.v2.GenerativeQuestionService/BatchUpdateGenerativeQuestionConfigs', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getRequests(); + $this->assertProtobufEquals($requests, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function batchUpdateGenerativeQuestionConfigsExceptionTest() + { + $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 + $requests = []; + $request = (new BatchUpdateGenerativeQuestionConfigsRequest())->setRequests($requests); + try { + $gapicClient->batchUpdateGenerativeQuestionConfigs($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 getGenerativeQuestionsFeatureConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $catalog2 = 'catalog21455933836'; + $featureEnabled = true; + $minimumProducts = 417095051; + $expectedResponse = new GenerativeQuestionsFeatureConfig(); + $expectedResponse->setCatalog($catalog2); + $expectedResponse->setFeatureEnabled($featureEnabled); + $expectedResponse->setMinimumProducts($minimumProducts); + $transport->addResponse($expectedResponse); + // Mock request + $formattedCatalog = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $request = (new GetGenerativeQuestionsFeatureConfigRequest())->setCatalog($formattedCatalog); + $response = $gapicClient->getGenerativeQuestionsFeatureConfig($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.retail.v2.GenerativeQuestionService/GetGenerativeQuestionsFeatureConfig', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getCatalog(); + $this->assertProtobufEquals($formattedCatalog, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getGenerativeQuestionsFeatureConfigExceptionTest() + { + $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 + $formattedCatalog = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $request = (new GetGenerativeQuestionsFeatureConfigRequest())->setCatalog($formattedCatalog); + try { + $gapicClient->getGenerativeQuestionsFeatureConfig($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 listGenerativeQuestionConfigsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ListGenerativeQuestionConfigsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $request = (new ListGenerativeQuestionConfigsRequest())->setParent($formattedParent); + $response = $gapicClient->listGenerativeQuestionConfigs($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.retail.v2.GenerativeQuestionService/ListGenerativeQuestionConfigs', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listGenerativeQuestionConfigsExceptionTest() + { + $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 + $formattedParent = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $request = (new ListGenerativeQuestionConfigsRequest())->setParent($formattedParent); + try { + $gapicClient->listGenerativeQuestionConfigs($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 updateGenerativeQuestionConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $catalog = 'catalog555704345'; + $facet = 'facet97187255'; + $generatedQuestion = 'generatedQuestion-1515248490'; + $finalQuestion = 'finalQuestion1509683343'; + $frequency = -7002384; + $allowedInConversation = true; + $expectedResponse = new GenerativeQuestionConfig(); + $expectedResponse->setCatalog($catalog); + $expectedResponse->setFacet($facet); + $expectedResponse->setGeneratedQuestion($generatedQuestion); + $expectedResponse->setFinalQuestion($finalQuestion); + $expectedResponse->setFrequency($frequency); + $expectedResponse->setAllowedInConversation($allowedInConversation); + $transport->addResponse($expectedResponse); + // Mock request + $generativeQuestionConfig = new GenerativeQuestionConfig(); + $generativeQuestionConfigCatalog = 'generativeQuestionConfigCatalog-1000208599'; + $generativeQuestionConfig->setCatalog($generativeQuestionConfigCatalog); + $generativeQuestionConfigFacet = 'generativeQuestionConfigFacet-592699193'; + $generativeQuestionConfig->setFacet($generativeQuestionConfigFacet); + $request = (new UpdateGenerativeQuestionConfigRequest())->setGenerativeQuestionConfig( + $generativeQuestionConfig + ); + $response = $gapicClient->updateGenerativeQuestionConfig($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.retail.v2.GenerativeQuestionService/UpdateGenerativeQuestionConfig', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getGenerativeQuestionConfig(); + $this->assertProtobufEquals($generativeQuestionConfig, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateGenerativeQuestionConfigExceptionTest() + { + $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 + $generativeQuestionConfig = new GenerativeQuestionConfig(); + $generativeQuestionConfigCatalog = 'generativeQuestionConfigCatalog-1000208599'; + $generativeQuestionConfig->setCatalog($generativeQuestionConfigCatalog); + $generativeQuestionConfigFacet = 'generativeQuestionConfigFacet-592699193'; + $generativeQuestionConfig->setFacet($generativeQuestionConfigFacet); + $request = (new UpdateGenerativeQuestionConfigRequest())->setGenerativeQuestionConfig( + $generativeQuestionConfig + ); + try { + $gapicClient->updateGenerativeQuestionConfig($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 updateGenerativeQuestionsFeatureConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $catalog = 'catalog555704345'; + $featureEnabled = true; + $minimumProducts = 417095051; + $expectedResponse = new GenerativeQuestionsFeatureConfig(); + $expectedResponse->setCatalog($catalog); + $expectedResponse->setFeatureEnabled($featureEnabled); + $expectedResponse->setMinimumProducts($minimumProducts); + $transport->addResponse($expectedResponse); + // Mock request + $generativeQuestionsFeatureConfig = new GenerativeQuestionsFeatureConfig(); + $generativeQuestionsFeatureConfigCatalog = 'generativeQuestionsFeatureConfigCatalog-1230760186'; + $generativeQuestionsFeatureConfig->setCatalog($generativeQuestionsFeatureConfigCatalog); + $request = (new UpdateGenerativeQuestionsFeatureConfigRequest())->setGenerativeQuestionsFeatureConfig( + $generativeQuestionsFeatureConfig + ); + $response = $gapicClient->updateGenerativeQuestionsFeatureConfig($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.retail.v2.GenerativeQuestionService/UpdateGenerativeQuestionsFeatureConfig', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getGenerativeQuestionsFeatureConfig(); + $this->assertProtobufEquals($generativeQuestionsFeatureConfig, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateGenerativeQuestionsFeatureConfigExceptionTest() + { + $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 + $generativeQuestionsFeatureConfig = new GenerativeQuestionsFeatureConfig(); + $generativeQuestionsFeatureConfigCatalog = 'generativeQuestionsFeatureConfigCatalog-1230760186'; + $generativeQuestionsFeatureConfig->setCatalog($generativeQuestionsFeatureConfigCatalog); + $request = (new UpdateGenerativeQuestionsFeatureConfigRequest())->setGenerativeQuestionsFeatureConfig( + $generativeQuestionsFeatureConfig + ); + try { + $gapicClient->updateGenerativeQuestionsFeatureConfig($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 batchUpdateGenerativeQuestionConfigsAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new BatchUpdateGenerativeQuestionConfigsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $requests = []; + $request = (new BatchUpdateGenerativeQuestionConfigsRequest())->setRequests($requests); + $response = $gapicClient->batchUpdateGenerativeQuestionConfigsAsync($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.retail.v2.GenerativeQuestionService/BatchUpdateGenerativeQuestionConfigs', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getRequests(); + $this->assertProtobufEquals($requests, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} From c4a0d8d12ac9210d8b6a767133edb5bce1a0e20a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 11:21:26 -0700 Subject: [PATCH 07/34] feat: Support for field update operators in the Datastore API and resolution strategies when there is a conflict at write time (#7733) PiperOrigin-RevId: 683253625 Source-Link: https://github.com/googleapis/googleapis/commit/3effbf23b1a1d1fe1306356e94397e20d01d31a0 Source-Link: https://github.com/googleapis/googleapis-gen/commit/5dd983c76417f2ad88f9d47438c48c27d5ac0e27 Copy-Tag: eyJwIjoiRGF0YXN0b3JlLy5Pd2xCb3QueWFtbCIsImgiOiI1ZGQ5ODNjNzY0MTdmMmFkODhmOWQ0NzQzOGM0OGMyN2Q1YWMwZTI3In0= --- Datastore/metadata/V1/Datastore.php | Bin 7423 -> 8218 bytes Datastore/src/V1/Mutation.php | 88 ++++ .../Mutation/ConflictResolutionStrategy.php | 64 +++ Datastore/src/V1/MutationResult.php | 42 ++ Datastore/src/V1/PropertyTransform.php | 432 ++++++++++++++++++ .../src/V1/PropertyTransform/ServerValue.php | 59 +++ .../V1/resources/datastore_client_config.json | 12 +- 7 files changed, 696 insertions(+), 1 deletion(-) create mode 100644 Datastore/src/V1/Mutation/ConflictResolutionStrategy.php create mode 100644 Datastore/src/V1/PropertyTransform.php create mode 100644 Datastore/src/V1/PropertyTransform/ServerValue.php diff --git a/Datastore/metadata/V1/Datastore.php b/Datastore/metadata/V1/Datastore.php index b06ea5d20319711fd1059809e592d3e73774c20a..5fd0a98c20b1eccf60b4003d2554ea7d8db9aa71 100644 GIT binary patch delta 672 zcmZ{iUu)A)7{-?+TeG*NP0m_&*dI2k=nz_=ApQYi?aa2~lr2dM-gt=hbOiE`b54r| zZ^REEk~=@epw}Ya_!Ybr`~u>&ph;-Dig^8d-sgSJbKc+gKO9{Ckd?1@;aYsDRNs@z zbVF&DmVYYKW33|Hd=A@#Fc^C7KoCZG=#7LM280Xd2zoKWuqW-8TleBOP>V}tb*p(e zQ=4nbj&(I{Kf^yXEo@#RZPH#N^E`xqH zi!)z|YM|yBv6MV;EenCpVVzS!L`XPgW6H?b@kSIcXBD*a=-1~yO)Hc2Q`N~5x(#b? zFksZDfrvj9cB(mOK*4ujx&FwB%e8eTCzJFQ{s3Y8M4qPPReoNYJx0I)E`1|;RR?L@M4$$Hft|6n2}5v~7hgPKyp+gPjIYe2e6suUdbX)-=f#>2V=d@ AssI20 delta 51 zcmV-30L=fIK>s.google.datastore.v1.Mutation.ConflictResolutionStrategy conflict_resolution_strategy = 10; + */ + private $conflict_resolution_strategy = 0; /** * The properties to write in this mutation. * None of the properties in the mask may have a reserved name, except for @@ -27,6 +35,15 @@ class Mutation extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.datastore.v1.PropertyMask property_mask = 9; */ private $property_mask = null; + /** + * Optional. The transforms to perform on the entity. + * This field can be set only when the operation is `insert`, `update`, + * or `upsert`. If present, the transforms are be applied to the entity + * regardless of the property mask, in order, after the operation. + * + * Generated from protobuf field repeated .google.datastore.v1.PropertyTransform property_transforms = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $property_transforms; protected $operation; protected $conflict_detection_strategy; @@ -56,6 +73,10 @@ class Mutation extends \Google\Protobuf\Internal\Message * The update time of the entity that this mutation is being applied * to. If this does not match the current update time on the server, the * mutation conflicts. + * @type int $conflict_resolution_strategy + * The strategy to use when a conflict is detected. Defaults to + * `SERVER_VALUE`. + * If this is set, then `conflict_detection_strategy` must also be set. * @type \Google\Cloud\Datastore\V1\PropertyMask $property_mask * The properties to write in this mutation. * None of the properties in the mask may have a reserved name, except for @@ -64,6 +85,11 @@ class Mutation extends \Google\Protobuf\Internal\Message * If the entity already exists, only properties referenced in the mask are * updated, others are left untouched. * Properties referenced in the mask but not in the entity are deleted. + * @type array<\Google\Cloud\Datastore\V1\PropertyTransform>|\Google\Protobuf\Internal\RepeatedField $property_transforms + * Optional. The transforms to perform on the entity. + * This field can be set only when the operation is `insert`, `update`, + * or `upsert`. If present, the transforms are be applied to the entity + * regardless of the property mask, in order, after the operation. * } */ public function __construct($data = NULL) { @@ -273,6 +299,36 @@ public function setUpdateTime($var) return $this; } + /** + * The strategy to use when a conflict is detected. Defaults to + * `SERVER_VALUE`. + * If this is set, then `conflict_detection_strategy` must also be set. + * + * Generated from protobuf field .google.datastore.v1.Mutation.ConflictResolutionStrategy conflict_resolution_strategy = 10; + * @return int + */ + public function getConflictResolutionStrategy() + { + return $this->conflict_resolution_strategy; + } + + /** + * The strategy to use when a conflict is detected. Defaults to + * `SERVER_VALUE`. + * If this is set, then `conflict_detection_strategy` must also be set. + * + * Generated from protobuf field .google.datastore.v1.Mutation.ConflictResolutionStrategy conflict_resolution_strategy = 10; + * @param int $var + * @return $this + */ + public function setConflictResolutionStrategy($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Datastore\V1\Mutation\ConflictResolutionStrategy::class); + $this->conflict_resolution_strategy = $var; + + return $this; + } + /** * The properties to write in this mutation. * None of the properties in the mask may have a reserved name, except for @@ -321,6 +377,38 @@ public function setPropertyMask($var) return $this; } + /** + * Optional. The transforms to perform on the entity. + * This field can be set only when the operation is `insert`, `update`, + * or `upsert`. If present, the transforms are be applied to the entity + * regardless of the property mask, in order, after the operation. + * + * Generated from protobuf field repeated .google.datastore.v1.PropertyTransform property_transforms = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPropertyTransforms() + { + return $this->property_transforms; + } + + /** + * Optional. The transforms to perform on the entity. + * This field can be set only when the operation is `insert`, `update`, + * or `upsert`. If present, the transforms are be applied to the entity + * regardless of the property mask, in order, after the operation. + * + * Generated from protobuf field repeated .google.datastore.v1.PropertyTransform property_transforms = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Datastore\V1\PropertyTransform>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPropertyTransforms($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\PropertyTransform::class); + $this->property_transforms = $arr; + + return $this; + } + /** * @return string */ diff --git a/Datastore/src/V1/Mutation/ConflictResolutionStrategy.php b/Datastore/src/V1/Mutation/ConflictResolutionStrategy.php new file mode 100644 index 000000000000..f2809890ebe1 --- /dev/null +++ b/Datastore/src/V1/Mutation/ConflictResolutionStrategy.php @@ -0,0 +1,64 @@ +google.datastore.v1.Mutation.ConflictResolutionStrategy + */ +class ConflictResolutionStrategy +{ + /** + * Unspecified. Defaults to `SERVER_VALUE`. + * + * Generated from protobuf enum STRATEGY_UNSPECIFIED = 0; + */ + const STRATEGY_UNSPECIFIED = 0; + /** + * The server entity is kept. + * + * Generated from protobuf enum SERVER_VALUE = 1; + */ + const SERVER_VALUE = 1; + /** + * The whole commit request fails. + * + * Generated from protobuf enum FAIL = 3; + */ + const FAIL = 3; + + private static $valueToName = [ + self::STRATEGY_UNSPECIFIED => 'STRATEGY_UNSPECIFIED', + self::SERVER_VALUE => 'SERVER_VALUE', + self::FAIL => 'FAIL', + ]; + + 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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ConflictResolutionStrategy::class, \Google\Cloud\Datastore\V1\Mutation_ConflictResolutionStrategy::class); + diff --git a/Datastore/src/V1/MutationResult.php b/Datastore/src/V1/MutationResult.php index a5a507fbbd95..388e3aae280f 100644 --- a/Datastore/src/V1/MutationResult.php +++ b/Datastore/src/V1/MutationResult.php @@ -54,6 +54,14 @@ class MutationResult extends \Google\Protobuf\Internal\Message * Generated from protobuf field bool conflict_detected = 5; */ private $conflict_detected = false; + /** + * The results of applying each + * [PropertyTransform][google.datastore.v1.PropertyTransform], in the same + * order of the request. + * + * Generated from protobuf field repeated .google.datastore.v1.Value transform_results = 8; + */ + private $transform_results; /** * Constructor. @@ -80,6 +88,10 @@ class MutationResult extends \Google\Protobuf\Internal\Message * @type bool $conflict_detected * Whether a conflict was detected for this mutation. Always false when a * conflict detection strategy field is not set in the mutation. + * @type array<\Google\Cloud\Datastore\V1\Value>|\Google\Protobuf\Internal\RepeatedField $transform_results + * The results of applying each + * [PropertyTransform][google.datastore.v1.PropertyTransform], in the same + * order of the request. * } */ public function __construct($data = NULL) { @@ -265,5 +277,35 @@ public function setConflictDetected($var) return $this; } + /** + * The results of applying each + * [PropertyTransform][google.datastore.v1.PropertyTransform], in the same + * order of the request. + * + * Generated from protobuf field repeated .google.datastore.v1.Value transform_results = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTransformResults() + { + return $this->transform_results; + } + + /** + * The results of applying each + * [PropertyTransform][google.datastore.v1.PropertyTransform], in the same + * order of the request. + * + * Generated from protobuf field repeated .google.datastore.v1.Value transform_results = 8; + * @param array<\Google\Cloud\Datastore\V1\Value>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTransformResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\Value::class); + $this->transform_results = $arr; + + return $this; + } + } diff --git a/Datastore/src/V1/PropertyTransform.php b/Datastore/src/V1/PropertyTransform.php new file mode 100644 index 000000000000..5be9066dcaa6 --- /dev/null +++ b/Datastore/src/V1/PropertyTransform.php @@ -0,0 +1,432 @@ +google.datastore.v1.PropertyTransform + */ +class PropertyTransform extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The name of the property. + * Property paths (a list of property names separated by dots (`.`)) may be + * used to refer to properties inside entity values. For example `foo.bar` + * means the property `bar` inside the entity property `foo`. + * If a property name contains a dot `.` or a backlslash `\`, then that name + * must be escaped. + * + * Generated from protobuf field string property = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $property = ''; + protected $transform_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $property + * Optional. The name of the property. + * Property paths (a list of property names separated by dots (`.`)) may be + * used to refer to properties inside entity values. For example `foo.bar` + * means the property `bar` inside the entity property `foo`. + * If a property name contains a dot `.` or a backlslash `\`, then that name + * must be escaped. + * @type int $set_to_server_value + * Sets the property to the given server value. + * @type \Google\Cloud\Datastore\V1\Value $increment + * Adds the given value to the property's current value. + * This must be an integer or a double value. + * If the property is not an integer or double, or if the property does not + * yet exist, the transformation will set the property to the given value. + * If either of the given value or the current property value are doubles, + * both values will be interpreted as doubles. Double arithmetic and + * representation of double values follows IEEE 754 semantics. + * If there is positive/negative integer overflow, the property is resolved + * to the largest magnitude positive/negative integer. + * @type \Google\Cloud\Datastore\V1\Value $maximum + * Sets the property to the maximum of its current value and the given + * value. + * This must be an integer or a double value. + * If the property is not an integer or double, or if the property does not + * yet exist, the transformation will set the property to the given value. + * If a maximum operation is applied where the property and the input value + * are of mixed types (that is - one is an integer and one is a double) + * the property takes on the type of the larger operand. If the operands are + * equivalent (e.g. 3 and 3.0), the property does not change. + * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and + * zero input value is always the stored value. + * The maximum of any numeric value x and NaN is NaN. + * @type \Google\Cloud\Datastore\V1\Value $minimum + * Sets the property to the minimum of its current value and the given + * value. + * This must be an integer or a double value. + * If the property is not an integer or double, or if the property does not + * yet exist, the transformation will set the property to the input value. + * If a minimum operation is applied where the property and the input value + * are of mixed types (that is - one is an integer and one is a double) + * the property takes on the type of the smaller operand. If the operands + * are equivalent (e.g. 3 and 3.0), the property does not change. 0, 0.0, + * and -0.0 are all zero. The minimum of a zero stored value and zero input + * value is always the stored value. The minimum of any numeric value x and + * NaN is NaN. + * @type \Google\Cloud\Datastore\V1\ArrayValue $append_missing_elements + * Appends the given elements in order if they are not already present in + * the current property value. + * If the property is not an array, or if the property does not yet exist, + * it is first set to the empty array. + * Equivalent numbers of different types (e.g. 3L and 3.0) are + * considered equal when checking if a value is missing. + * NaN is equal to NaN, and the null value is equal to the null value. + * If the input contains multiple equivalent values, only the first will + * be considered. + * The corresponding transform result will be the null value. + * @type \Google\Cloud\Datastore\V1\ArrayValue $remove_all_from_array + * Removes all of the given elements from the array in the property. + * If the property is not an array, or if the property does not yet exist, + * it is set to the empty array. + * Equivalent numbers of different types (e.g. 3L and 3.0) are + * considered equal when deciding whether an element should be removed. + * NaN is equal to NaN, and the null value is equal to the null value. + * This will remove all equivalent values if there are duplicates. + * The corresponding transform result will be the null value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The name of the property. + * Property paths (a list of property names separated by dots (`.`)) may be + * used to refer to properties inside entity values. For example `foo.bar` + * means the property `bar` inside the entity property `foo`. + * If a property name contains a dot `.` or a backlslash `\`, then that name + * must be escaped. + * + * Generated from protobuf field string property = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getProperty() + { + return $this->property; + } + + /** + * Optional. The name of the property. + * Property paths (a list of property names separated by dots (`.`)) may be + * used to refer to properties inside entity values. For example `foo.bar` + * means the property `bar` inside the entity property `foo`. + * If a property name contains a dot `.` or a backlslash `\`, then that name + * must be escaped. + * + * Generated from protobuf field string property = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setProperty($var) + { + GPBUtil::checkString($var, True); + $this->property = $var; + + return $this; + } + + /** + * Sets the property to the given server value. + * + * Generated from protobuf field .google.datastore.v1.PropertyTransform.ServerValue set_to_server_value = 2; + * @return int + */ + public function getSetToServerValue() + { + return $this->readOneof(2); + } + + public function hasSetToServerValue() + { + return $this->hasOneof(2); + } + + /** + * Sets the property to the given server value. + * + * Generated from protobuf field .google.datastore.v1.PropertyTransform.ServerValue set_to_server_value = 2; + * @param int $var + * @return $this + */ + public function setSetToServerValue($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Datastore\V1\PropertyTransform\ServerValue::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Adds the given value to the property's current value. + * This must be an integer or a double value. + * If the property is not an integer or double, or if the property does not + * yet exist, the transformation will set the property to the given value. + * If either of the given value or the current property value are doubles, + * both values will be interpreted as doubles. Double arithmetic and + * representation of double values follows IEEE 754 semantics. + * If there is positive/negative integer overflow, the property is resolved + * to the largest magnitude positive/negative integer. + * + * Generated from protobuf field .google.datastore.v1.Value increment = 3; + * @return \Google\Cloud\Datastore\V1\Value|null + */ + public function getIncrement() + { + return $this->readOneof(3); + } + + public function hasIncrement() + { + return $this->hasOneof(3); + } + + /** + * Adds the given value to the property's current value. + * This must be an integer or a double value. + * If the property is not an integer or double, or if the property does not + * yet exist, the transformation will set the property to the given value. + * If either of the given value or the current property value are doubles, + * both values will be interpreted as doubles. Double arithmetic and + * representation of double values follows IEEE 754 semantics. + * If there is positive/negative integer overflow, the property is resolved + * to the largest magnitude positive/negative integer. + * + * Generated from protobuf field .google.datastore.v1.Value increment = 3; + * @param \Google\Cloud\Datastore\V1\Value $var + * @return $this + */ + public function setIncrement($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Value::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Sets the property to the maximum of its current value and the given + * value. + * This must be an integer or a double value. + * If the property is not an integer or double, or if the property does not + * yet exist, the transformation will set the property to the given value. + * If a maximum operation is applied where the property and the input value + * are of mixed types (that is - one is an integer and one is a double) + * the property takes on the type of the larger operand. If the operands are + * equivalent (e.g. 3 and 3.0), the property does not change. + * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and + * zero input value is always the stored value. + * The maximum of any numeric value x and NaN is NaN. + * + * Generated from protobuf field .google.datastore.v1.Value maximum = 4; + * @return \Google\Cloud\Datastore\V1\Value|null + */ + public function getMaximum() + { + return $this->readOneof(4); + } + + public function hasMaximum() + { + return $this->hasOneof(4); + } + + /** + * Sets the property to the maximum of its current value and the given + * value. + * This must be an integer or a double value. + * If the property is not an integer or double, or if the property does not + * yet exist, the transformation will set the property to the given value. + * If a maximum operation is applied where the property and the input value + * are of mixed types (that is - one is an integer and one is a double) + * the property takes on the type of the larger operand. If the operands are + * equivalent (e.g. 3 and 3.0), the property does not change. + * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and + * zero input value is always the stored value. + * The maximum of any numeric value x and NaN is NaN. + * + * Generated from protobuf field .google.datastore.v1.Value maximum = 4; + * @param \Google\Cloud\Datastore\V1\Value $var + * @return $this + */ + public function setMaximum($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Value::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Sets the property to the minimum of its current value and the given + * value. + * This must be an integer or a double value. + * If the property is not an integer or double, or if the property does not + * yet exist, the transformation will set the property to the input value. + * If a minimum operation is applied where the property and the input value + * are of mixed types (that is - one is an integer and one is a double) + * the property takes on the type of the smaller operand. If the operands + * are equivalent (e.g. 3 and 3.0), the property does not change. 0, 0.0, + * and -0.0 are all zero. The minimum of a zero stored value and zero input + * value is always the stored value. The minimum of any numeric value x and + * NaN is NaN. + * + * Generated from protobuf field .google.datastore.v1.Value minimum = 5; + * @return \Google\Cloud\Datastore\V1\Value|null + */ + public function getMinimum() + { + return $this->readOneof(5); + } + + public function hasMinimum() + { + return $this->hasOneof(5); + } + + /** + * Sets the property to the minimum of its current value and the given + * value. + * This must be an integer or a double value. + * If the property is not an integer or double, or if the property does not + * yet exist, the transformation will set the property to the input value. + * If a minimum operation is applied where the property and the input value + * are of mixed types (that is - one is an integer and one is a double) + * the property takes on the type of the smaller operand. If the operands + * are equivalent (e.g. 3 and 3.0), the property does not change. 0, 0.0, + * and -0.0 are all zero. The minimum of a zero stored value and zero input + * value is always the stored value. The minimum of any numeric value x and + * NaN is NaN. + * + * Generated from protobuf field .google.datastore.v1.Value minimum = 5; + * @param \Google\Cloud\Datastore\V1\Value $var + * @return $this + */ + public function setMinimum($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Value::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Appends the given elements in order if they are not already present in + * the current property value. + * If the property is not an array, or if the property does not yet exist, + * it is first set to the empty array. + * Equivalent numbers of different types (e.g. 3L and 3.0) are + * considered equal when checking if a value is missing. + * NaN is equal to NaN, and the null value is equal to the null value. + * If the input contains multiple equivalent values, only the first will + * be considered. + * The corresponding transform result will be the null value. + * + * Generated from protobuf field .google.datastore.v1.ArrayValue append_missing_elements = 6; + * @return \Google\Cloud\Datastore\V1\ArrayValue|null + */ + public function getAppendMissingElements() + { + return $this->readOneof(6); + } + + public function hasAppendMissingElements() + { + return $this->hasOneof(6); + } + + /** + * Appends the given elements in order if they are not already present in + * the current property value. + * If the property is not an array, or if the property does not yet exist, + * it is first set to the empty array. + * Equivalent numbers of different types (e.g. 3L and 3.0) are + * considered equal when checking if a value is missing. + * NaN is equal to NaN, and the null value is equal to the null value. + * If the input contains multiple equivalent values, only the first will + * be considered. + * The corresponding transform result will be the null value. + * + * Generated from protobuf field .google.datastore.v1.ArrayValue append_missing_elements = 6; + * @param \Google\Cloud\Datastore\V1\ArrayValue $var + * @return $this + */ + public function setAppendMissingElements($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\ArrayValue::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Removes all of the given elements from the array in the property. + * If the property is not an array, or if the property does not yet exist, + * it is set to the empty array. + * Equivalent numbers of different types (e.g. 3L and 3.0) are + * considered equal when deciding whether an element should be removed. + * NaN is equal to NaN, and the null value is equal to the null value. + * This will remove all equivalent values if there are duplicates. + * The corresponding transform result will be the null value. + * + * Generated from protobuf field .google.datastore.v1.ArrayValue remove_all_from_array = 7; + * @return \Google\Cloud\Datastore\V1\ArrayValue|null + */ + public function getRemoveAllFromArray() + { + return $this->readOneof(7); + } + + public function hasRemoveAllFromArray() + { + return $this->hasOneof(7); + } + + /** + * Removes all of the given elements from the array in the property. + * If the property is not an array, or if the property does not yet exist, + * it is set to the empty array. + * Equivalent numbers of different types (e.g. 3L and 3.0) are + * considered equal when deciding whether an element should be removed. + * NaN is equal to NaN, and the null value is equal to the null value. + * This will remove all equivalent values if there are duplicates. + * The corresponding transform result will be the null value. + * + * Generated from protobuf field .google.datastore.v1.ArrayValue remove_all_from_array = 7; + * @param \Google\Cloud\Datastore\V1\ArrayValue $var + * @return $this + */ + public function setRemoveAllFromArray($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\ArrayValue::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * @return string + */ + public function getTransformType() + { + return $this->whichOneof("transform_type"); + } + +} + diff --git a/Datastore/src/V1/PropertyTransform/ServerValue.php b/Datastore/src/V1/PropertyTransform/ServerValue.php new file mode 100644 index 000000000000..6162f10f4c4d --- /dev/null +++ b/Datastore/src/V1/PropertyTransform/ServerValue.php @@ -0,0 +1,59 @@ +google.datastore.v1.PropertyTransform.ServerValue + */ +class ServerValue +{ + /** + * Unspecified. This value must not be used. + * + * Generated from protobuf enum SERVER_VALUE_UNSPECIFIED = 0; + */ + const SERVER_VALUE_UNSPECIFIED = 0; + /** + * The time at which the server processed the request, with millisecond + * precision. If used on multiple properties (same or different entities) + * in a transaction, all the properties will get the same server timestamp. + * + * Generated from protobuf enum REQUEST_TIME = 1; + */ + const REQUEST_TIME = 1; + + private static $valueToName = [ + self::SERVER_VALUE_UNSPECIFIED => 'SERVER_VALUE_UNSPECIFIED', + self::REQUEST_TIME => 'REQUEST_TIME', + ]; + + 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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ServerValue::class, \Google\Cloud\Datastore\V1\PropertyTransform_ServerValue::class); + diff --git a/Datastore/src/V1/resources/datastore_client_config.json b/Datastore/src/V1/resources/datastore_client_config.json index 135281a0a986..081d5f9f6b62 100644 --- a/Datastore/src/V1/resources/datastore_client_config.json +++ b/Datastore/src/V1/resources/datastore_client_config.json @@ -7,7 +7,8 @@ "UNAVAILABLE", "DEADLINE_EXCEEDED" ], - "no_retry_1_codes": [] + "no_retry_1_codes": [], + "no_retry_2_codes": [] }, "retry_params": { "no_retry_params": { @@ -36,6 +37,15 @@ "rpc_timeout_multiplier": 1.0, "max_rpc_timeout_millis": 60000, "total_timeout_millis": 60000 + }, + "no_retry_2_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": { From 3252d24783823082ea5e0af837be3cbd84854639 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 18:23:13 +0000 Subject: [PATCH 08/34] feat: add Order modification RPCs and License Management Service (#7729) docs: A comment for enum value `LINE_ITEM_CHANGE_STATE_PENDING_APPROVAL` in enum `LineItemChangeState` is changed docs: A comment for enum value `LINE_ITEM_CHANGE_STATE_APPROVED` in enum `LineItemChangeState` is changed docs: A comment for enum value `LINE_ITEM_CHANGE_STATE_COMPLETED` in enum `LineItemChangeState` is changed docs: A comment for enum value `LINE_ITEM_CHANGE_STATE_REJECTED` in enum `LineItemChangeState` is changed docs: A comment for enum value `LINE_ITEM_CHANGE_STATE_ABANDONED` in enum `LineItemChangeState` is changed docs: A comment for enum value `LINE_ITEM_CHANGE_STATE_ACTIVATING` in enum `LineItemChangeState` is changed docs: A comment for field `request_id` in message `.google.cloud.commerce.consumer.procurement.v1.PlaceOrderRequest` is changed docs: A comment for field `filter` in message `.google.cloud.commerce.consumer.procurement.v1.ListOrdersRequest` is changed PiperOrigin-RevId: 682457622 Source-Link: https://github.com/googleapis/googleapis/commit/1f8352cf46df74d7db6fd544181655c590689b8c Source-Link: https://github.com/googleapis/googleapis-gen/commit/172720068f2259b365a56a22a0c7c2a6d446c732 Copy-Tag: eyJwIjoiQ29tbWVyY2VDb25zdW1lclByb2N1cmVtZW50Ly5Pd2xCb3QueWFtbCIsImgiOiIxNzI3MjAwNjhmMjI1OWIzNjVhNTZhMjJhMGM3YzJhNmQ0NDZjNzMyIn0= --- .../metadata/V1/LicenseManagementService.php | Bin 0 -> 4558 bytes .../metadata/V1/ProcurementService.php | Bin 2812 -> 4255 bytes .../cancel_order.php | 84 ++++ .../modify_order.php | 83 +++ .../LicenseManagementServiceClient/assign.php | 75 +++ .../enumerate_licensed_users.php | 75 +++ .../get_license_pool.php | 71 +++ .../unassign.php | 75 +++ .../update_license_pool.php | 65 +++ .../src/V1/AssignRequest.php | 122 +++++ .../src/V1/AssignResponse.php | 34 ++ .../src/V1/AssignmentProtocol.php | 108 ++++ .../AssignmentProtocol/AutoAssignmentType.php | 86 ++++ .../ManualAssignmentType.php | 34 ++ .../src/V1/AutoRenewalBehavior.php | 61 +++ .../src/V1/CancelOrderMetadata.php | 34 ++ .../src/V1/CancelOrderRequest.php | 144 ++++++ .../CancelOrderRequest/CancellationPolicy.php | 68 +++ .../ConsumerProcurementServiceClient.php | 61 +++ .../Client/LicenseManagementServiceClient.php | 357 +++++++++++++ .../src/V1/EnumerateLicensedUsersRequest.php | 157 ++++++ .../src/V1/EnumerateLicensedUsersResponse.php | 106 ++++ .../src/V1/GetLicensePoolRequest.php | 85 ++++ .../src/V1/LicensePool.php | 183 +++++++ .../src/V1/LicensedUser.php | 167 +++++++ .../src/V1/LineItemChangeState.php | 24 +- .../src/V1/ModifyOrderMetadata.php | 34 ++ .../src/V1/ModifyOrderRequest.php | 190 +++++++ .../V1/ModifyOrderRequest/Modification.php | 216 ++++++++ .../src/V1/PlaceOrderRequest.php | 8 +- .../src/V1/UnassignRequest.php | 122 +++++ .../src/V1/UnassignResponse.php | 34 ++ .../src/V1/UpdateLicensePoolRequest.php | 152 ++++++ .../src/V1/gapic_metadata.json | 44 ++ ...mer_procurement_service_client_config.json | 10 + ..._procurement_service_descriptor_config.php | 38 ++ ...procurement_service_rest_client_config.php | 24 + ...ense_management_service_client_config.json | 47 ++ ...e_management_service_descriptor_config.php | 100 ++++ ..._management_service_rest_client_config.php | 104 ++++ .../ConsumerProcurementServiceClientTest.php | 329 +++++++++++- .../LicenseManagementServiceClientTest.php | 472 ++++++++++++++++++ 42 files changed, 4255 insertions(+), 28 deletions(-) create mode 100644 CommerceConsumerProcurement/metadata/V1/LicenseManagementService.php create mode 100644 CommerceConsumerProcurement/samples/V1/ConsumerProcurementServiceClient/cancel_order.php create mode 100644 CommerceConsumerProcurement/samples/V1/ConsumerProcurementServiceClient/modify_order.php create mode 100644 CommerceConsumerProcurement/samples/V1/LicenseManagementServiceClient/assign.php create mode 100644 CommerceConsumerProcurement/samples/V1/LicenseManagementServiceClient/enumerate_licensed_users.php create mode 100644 CommerceConsumerProcurement/samples/V1/LicenseManagementServiceClient/get_license_pool.php create mode 100644 CommerceConsumerProcurement/samples/V1/LicenseManagementServiceClient/unassign.php create mode 100644 CommerceConsumerProcurement/samples/V1/LicenseManagementServiceClient/update_license_pool.php create mode 100644 CommerceConsumerProcurement/src/V1/AssignRequest.php create mode 100644 CommerceConsumerProcurement/src/V1/AssignResponse.php create mode 100644 CommerceConsumerProcurement/src/V1/AssignmentProtocol.php create mode 100644 CommerceConsumerProcurement/src/V1/AssignmentProtocol/AutoAssignmentType.php create mode 100644 CommerceConsumerProcurement/src/V1/AssignmentProtocol/ManualAssignmentType.php create mode 100644 CommerceConsumerProcurement/src/V1/AutoRenewalBehavior.php create mode 100644 CommerceConsumerProcurement/src/V1/CancelOrderMetadata.php create mode 100644 CommerceConsumerProcurement/src/V1/CancelOrderRequest.php create mode 100644 CommerceConsumerProcurement/src/V1/CancelOrderRequest/CancellationPolicy.php create mode 100644 CommerceConsumerProcurement/src/V1/Client/LicenseManagementServiceClient.php create mode 100644 CommerceConsumerProcurement/src/V1/EnumerateLicensedUsersRequest.php create mode 100644 CommerceConsumerProcurement/src/V1/EnumerateLicensedUsersResponse.php create mode 100644 CommerceConsumerProcurement/src/V1/GetLicensePoolRequest.php create mode 100644 CommerceConsumerProcurement/src/V1/LicensePool.php create mode 100644 CommerceConsumerProcurement/src/V1/LicensedUser.php create mode 100644 CommerceConsumerProcurement/src/V1/ModifyOrderMetadata.php create mode 100644 CommerceConsumerProcurement/src/V1/ModifyOrderRequest.php create mode 100644 CommerceConsumerProcurement/src/V1/ModifyOrderRequest/Modification.php create mode 100644 CommerceConsumerProcurement/src/V1/UnassignRequest.php create mode 100644 CommerceConsumerProcurement/src/V1/UnassignResponse.php create mode 100644 CommerceConsumerProcurement/src/V1/UpdateLicensePoolRequest.php create mode 100644 CommerceConsumerProcurement/src/V1/resources/license_management_service_client_config.json create mode 100644 CommerceConsumerProcurement/src/V1/resources/license_management_service_descriptor_config.php create mode 100644 CommerceConsumerProcurement/src/V1/resources/license_management_service_rest_client_config.php create mode 100644 CommerceConsumerProcurement/tests/Unit/V1/Client/LicenseManagementServiceClientTest.php diff --git a/CommerceConsumerProcurement/metadata/V1/LicenseManagementService.php b/CommerceConsumerProcurement/metadata/V1/LicenseManagementService.php new file mode 100644 index 0000000000000000000000000000000000000000..35aced28e7f0829a92dadae768219623ba3feed1 GIT binary patch literal 4558 zcmb_gPjAy^7@t#y;4OpJu(kxjybOs_QAa5|xh>$f&@oYnpsgkr$$I0wNv%4zv0oP$ z%4IuF+JQ+s>V9-rt(k1~d?^Vja=aL{HP8$cf#qT-^iTB{H z$)OPnaGN9%c8RfGUD+TMH!#Jub&gV7Whk{(i2@e_rB>~t)V3>&2)RB^662mg+sMEk z2`uyi8SodSb@0bXD5mi5vX?ks;873z-ZzkuWuuAxgn+Sr*=8EJ)C&WHDLe>VGJDk! zHks_@D1;0y8_H|&j)suX+TDPXIKX~wjU;aDMKp}7AZl4HLbFn^JF{0MEHmddjalKN zW%W6^Y|uC*d33{w2~Fc*k^9XIbh4}3fSlTqSF?j4WLbcGT2?ovu8G4GSA7pEJDScN zkNAxhvV-@$Fdj|yA(3r2w3Aux*HUP72yl47OqDylfs@@M=x%z@&J?$!!MeOv=5Khi zG3-Vo>w`Nmce7dLSRJpRR~OLz_d9Uu=$DL#bk^vUZ>=$sc|V7fixDCVZrpV7FF z=ar8t>86^om9c+pZDkUjIgr%Sn*th_q|9hepG3zP-*bZ}nbrw?7hO!ML=i|EHjnEC#fX=Wwe8{B6bOW8GK#zWw10iuNldyi)UfVxu zXpy_4W=M??_?}IW=q4DRgpFD`pNpls=lfpJvR!UIDZh|694zj1%3<6fF+AY^JL+Z1 zGC6ljCXM|_7RGbGN^|JrbwYDc56P1hNU1;jh0-q?n%Rorl}iT5Zy|-^L;xe(z#6d@ zIm4m|pQG`VL&8>&?8*ukmDQ}dG8X1qr6u%{=x!CwS#&(YF${ONn+p0AI+?PwphUA!HzHK?1<#um7fybU3O<;Y23 z4dL0~ZK&zf2=V(g+$90;Pacd`da0pPGOOIYK7mfCs6{e#$gzmcVZ?Z7jZA$ti0cZ1>aS0)Zs`XNT{fV4Oh@U~zRl_J+du#Pv2b0l zum$=BYvtvGR57QhVJ=S!9sTh+}&Q=rI#6K8Sxh}x1CzS_4Z1XW#AW18@gZaDU>ysABZB*%7X*AkY6`|p6zDal~+o>CQll=M-APxhMvO)IBj@cSP&qV w#Zlm&gke_#$Fg!jmbG1}9|uQic>PNDfp<-O$mhQM5B=unlH%LEgE|QP4=IX5a{vGU literal 0 HcmV?d00001 diff --git a/CommerceConsumerProcurement/metadata/V1/ProcurementService.php b/CommerceConsumerProcurement/metadata/V1/ProcurementService.php index 7be6cab52a7b1bd3c08f5b7f793e1d2d4c09608b..f71ca250fd217982a381b89c4289a0f7a74c6879 100644 GIT binary patch delta 1033 zcmaiz!Ee$~9LH@7+jwjQA0cCk5m=^#EF|k?37#J18Jm$pIfA91C_WS$3*I(K9#Sd=<{?pcMB0LnN z(j*38)9ISMackJ6!w!9MK}RmU4Pv(5r#Y^`l@oR08u9Qs*y#J9Y3Q!$*rVJ^K`19h zbvj8@ud0h4!DvqV7989H>s@m+u=Fuu?(xu_^FK&k{VW%|8QuBDgLP&*_wePGX;Wgl zv`@@#B-|!E0ZHRrx6deX#{-({A~MG#S_V%Mq+^God+A8o&spomn33p_ne&I zX_Mk3Upsvj&lGwft6#Vd8B!0{E%J<>>zAf8WLZ;UJtzQqNGBlbbAT;f%7RR!oTj&B zS9kT&XC6RFw+(9julTSUegJ~^x7i6&ESf(*%(Nm%pBwBQ@2BSdKW|AP| zJ1z_pJ%iiezJyc>D+iDt?L-LhASlI+9zRzw#D9 z{txa3!z!vP*b7+%_m&e4`G6t3c)d3JxMK1Ue&Ikea=nl}xz+jaFul9FTR!@V@*vJG z87_MXZ@&MW@_VJ->E7B-zSd{|VvVaX=g9t{b1+(Tj-X*xQD;yy*n{z$XWNM%+;2=H BIL`n8 delta 29 lcmbQQ_(ya@A2ZVezReSu)tQ-%&aiGi$(6~p`550#MgX7<3X1>$ diff --git a/CommerceConsumerProcurement/samples/V1/ConsumerProcurementServiceClient/cancel_order.php b/CommerceConsumerProcurement/samples/V1/ConsumerProcurementServiceClient/cancel_order.php new file mode 100644 index 000000000000..34945b1ab793 --- /dev/null +++ b/CommerceConsumerProcurement/samples/V1/ConsumerProcurementServiceClient/cancel_order.php @@ -0,0 +1,84 @@ +setName($name); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $consumerProcurementServiceClient->cancelOrder($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Order $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $name = '[NAME]'; + + cancel_order_sample($name); +} +// [END cloudcommerceconsumerprocurement_v1_generated_ConsumerProcurementService_CancelOrder_sync] diff --git a/CommerceConsumerProcurement/samples/V1/ConsumerProcurementServiceClient/modify_order.php b/CommerceConsumerProcurement/samples/V1/ConsumerProcurementServiceClient/modify_order.php new file mode 100644 index 000000000000..2ea79ce79c8f --- /dev/null +++ b/CommerceConsumerProcurement/samples/V1/ConsumerProcurementServiceClient/modify_order.php @@ -0,0 +1,83 @@ +setName($name); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $consumerProcurementServiceClient->modifyOrder($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Order $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $name = '[NAME]'; + + modify_order_sample($name); +} +// [END cloudcommerceconsumerprocurement_v1_generated_ConsumerProcurementService_ModifyOrder_sync] diff --git a/CommerceConsumerProcurement/samples/V1/LicenseManagementServiceClient/assign.php b/CommerceConsumerProcurement/samples/V1/LicenseManagementServiceClient/assign.php new file mode 100644 index 000000000000..c33ec70102dc --- /dev/null +++ b/CommerceConsumerProcurement/samples/V1/LicenseManagementServiceClient/assign.php @@ -0,0 +1,75 @@ +setParent($parent) + ->setUsernames($usernames); + + // Call the API and handle any network failures. + try { + /** @var AssignResponse $response */ + $response = $licenseManagementServiceClient->assign($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]'; + $usernamesElement = '[USERNAMES]'; + + assign_sample($parent, $usernamesElement); +} +// [END cloudcommerceconsumerprocurement_v1_generated_LicenseManagementService_Assign_sync] diff --git a/CommerceConsumerProcurement/samples/V1/LicenseManagementServiceClient/enumerate_licensed_users.php b/CommerceConsumerProcurement/samples/V1/LicenseManagementServiceClient/enumerate_licensed_users.php new file mode 100644 index 000000000000..c5a983d791d4 --- /dev/null +++ b/CommerceConsumerProcurement/samples/V1/LicenseManagementServiceClient/enumerate_licensed_users.php @@ -0,0 +1,75 @@ +setParent($parent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $licenseManagementServiceClient->enumerateLicensedUsers($request); + + /** @var LicensedUser $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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]'; + + enumerate_licensed_users_sample($parent); +} +// [END cloudcommerceconsumerprocurement_v1_generated_LicenseManagementService_EnumerateLicensedUsers_sync] diff --git a/CommerceConsumerProcurement/samples/V1/LicenseManagementServiceClient/get_license_pool.php b/CommerceConsumerProcurement/samples/V1/LicenseManagementServiceClient/get_license_pool.php new file mode 100644 index 000000000000..623e2151ab21 --- /dev/null +++ b/CommerceConsumerProcurement/samples/V1/LicenseManagementServiceClient/get_license_pool.php @@ -0,0 +1,71 @@ +setName($name); + + // Call the API and handle any network failures. + try { + /** @var LicensePool $response */ + $response = $licenseManagementServiceClient->getLicensePool($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 +{ + $name = '[NAME]'; + + get_license_pool_sample($name); +} +// [END cloudcommerceconsumerprocurement_v1_generated_LicenseManagementService_GetLicensePool_sync] diff --git a/CommerceConsumerProcurement/samples/V1/LicenseManagementServiceClient/unassign.php b/CommerceConsumerProcurement/samples/V1/LicenseManagementServiceClient/unassign.php new file mode 100644 index 000000000000..2843103ad5d2 --- /dev/null +++ b/CommerceConsumerProcurement/samples/V1/LicenseManagementServiceClient/unassign.php @@ -0,0 +1,75 @@ +setParent($parent) + ->setUsernames($usernames); + + // Call the API and handle any network failures. + try { + /** @var UnassignResponse $response */ + $response = $licenseManagementServiceClient->unassign($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]'; + $usernamesElement = '[USERNAMES]'; + + unassign_sample($parent, $usernamesElement); +} +// [END cloudcommerceconsumerprocurement_v1_generated_LicenseManagementService_Unassign_sync] diff --git a/CommerceConsumerProcurement/samples/V1/LicenseManagementServiceClient/update_license_pool.php b/CommerceConsumerProcurement/samples/V1/LicenseManagementServiceClient/update_license_pool.php new file mode 100644 index 000000000000..29d7325e6ec6 --- /dev/null +++ b/CommerceConsumerProcurement/samples/V1/LicenseManagementServiceClient/update_license_pool.php @@ -0,0 +1,65 @@ +setLicenseAssignmentProtocol($licensePoolLicenseAssignmentProtocol); + $updateMask = new FieldMask(); + $request = (new UpdateLicensePoolRequest()) + ->setLicensePool($licensePool) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var LicensePool $response */ + $response = $licenseManagementServiceClient->updateLicensePool($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END cloudcommerceconsumerprocurement_v1_generated_LicenseManagementService_UpdateLicensePool_sync] diff --git a/CommerceConsumerProcurement/src/V1/AssignRequest.php b/CommerceConsumerProcurement/src/V1/AssignRequest.php new file mode 100644 index 000000000000..7cad3988cfd4 --- /dev/null +++ b/CommerceConsumerProcurement/src/V1/AssignRequest.php @@ -0,0 +1,122 @@ +google.cloud.commerce.consumer.procurement.v1.AssignRequest + */ +class AssignRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. License pool name. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * Required. Username. + * Format: `name@domain.com`. + * + * Generated from protobuf field repeated string usernames = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $usernames; + + /** + * @param string $parent Required. License pool name. + * @param string[] $usernames Required. Username. + * Format: `name@domain.com`. + * + * @return \Google\Cloud\Commerce\Consumer\Procurement\V1\AssignRequest + * + * @experimental + */ + public static function build(string $parent, array $usernames): self + { + return (new self()) + ->setParent($parent) + ->setUsernames($usernames); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. License pool name. + * @type array|\Google\Protobuf\Internal\RepeatedField $usernames + * Required. Username. + * Format: `name@domain.com`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Commerce\Consumer\Procurement\V1\LicenseManagementService::initOnce(); + parent::__construct($data); + } + + /** + * Required. License pool name. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. License pool name. + * + * 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. Username. + * Format: `name@domain.com`. + * + * Generated from protobuf field repeated string usernames = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUsernames() + { + return $this->usernames; + } + + /** + * Required. Username. + * Format: `name@domain.com`. + * + * Generated from protobuf field repeated string usernames = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUsernames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->usernames = $arr; + + return $this; + } + +} + diff --git a/CommerceConsumerProcurement/src/V1/AssignResponse.php b/CommerceConsumerProcurement/src/V1/AssignResponse.php new file mode 100644 index 000000000000..8dc2ea6b662b --- /dev/null +++ b/CommerceConsumerProcurement/src/V1/AssignResponse.php @@ -0,0 +1,34 @@ +google.cloud.commerce.consumer.procurement.v1.AssignResponse + */ +class AssignResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Commerce\Consumer\Procurement\V1\LicenseManagementService::initOnce(); + parent::__construct($data); + } + +} + diff --git a/CommerceConsumerProcurement/src/V1/AssignmentProtocol.php b/CommerceConsumerProcurement/src/V1/AssignmentProtocol.php new file mode 100644 index 000000000000..1d068020ee10 --- /dev/null +++ b/CommerceConsumerProcurement/src/V1/AssignmentProtocol.php @@ -0,0 +1,108 @@ +google.cloud.commerce.consumer.procurement.v1.AssignmentProtocol + */ +class AssignmentProtocol extends \Google\Protobuf\Internal\Message +{ + protected $assignment_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Commerce\Consumer\Procurement\V1\AssignmentProtocol\ManualAssignmentType $manual_assignment_type + * Allow manual assignments triggered by administrative operations only. + * @type \Google\Cloud\Commerce\Consumer\Procurement\V1\AssignmentProtocol\AutoAssignmentType $auto_assignment_type + * Allow automatic assignments triggered by data plane operations. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Commerce\Consumer\Procurement\V1\LicenseManagementService::initOnce(); + parent::__construct($data); + } + + /** + * Allow manual assignments triggered by administrative operations only. + * + * Generated from protobuf field .google.cloud.commerce.consumer.procurement.v1.AssignmentProtocol.ManualAssignmentType manual_assignment_type = 2; + * @return \Google\Cloud\Commerce\Consumer\Procurement\V1\AssignmentProtocol\ManualAssignmentType|null + */ + public function getManualAssignmentType() + { + return $this->readOneof(2); + } + + public function hasManualAssignmentType() + { + return $this->hasOneof(2); + } + + /** + * Allow manual assignments triggered by administrative operations only. + * + * Generated from protobuf field .google.cloud.commerce.consumer.procurement.v1.AssignmentProtocol.ManualAssignmentType manual_assignment_type = 2; + * @param \Google\Cloud\Commerce\Consumer\Procurement\V1\AssignmentProtocol\ManualAssignmentType $var + * @return $this + */ + public function setManualAssignmentType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Commerce\Consumer\Procurement\V1\AssignmentProtocol\ManualAssignmentType::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Allow automatic assignments triggered by data plane operations. + * + * Generated from protobuf field .google.cloud.commerce.consumer.procurement.v1.AssignmentProtocol.AutoAssignmentType auto_assignment_type = 3; + * @return \Google\Cloud\Commerce\Consumer\Procurement\V1\AssignmentProtocol\AutoAssignmentType|null + */ + public function getAutoAssignmentType() + { + return $this->readOneof(3); + } + + public function hasAutoAssignmentType() + { + return $this->hasOneof(3); + } + + /** + * Allow automatic assignments triggered by data plane operations. + * + * Generated from protobuf field .google.cloud.commerce.consumer.procurement.v1.AssignmentProtocol.AutoAssignmentType auto_assignment_type = 3; + * @param \Google\Cloud\Commerce\Consumer\Procurement\V1\AssignmentProtocol\AutoAssignmentType $var + * @return $this + */ + public function setAutoAssignmentType($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Commerce\Consumer\Procurement\V1\AssignmentProtocol\AutoAssignmentType::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getAssignmentType() + { + return $this->whichOneof("assignment_type"); + } + +} + diff --git a/CommerceConsumerProcurement/src/V1/AssignmentProtocol/AutoAssignmentType.php b/CommerceConsumerProcurement/src/V1/AssignmentProtocol/AutoAssignmentType.php new file mode 100644 index 000000000000..14e80415f81d --- /dev/null +++ b/CommerceConsumerProcurement/src/V1/AssignmentProtocol/AutoAssignmentType.php @@ -0,0 +1,86 @@ +google.cloud.commerce.consumer.procurement.v1.AssignmentProtocol.AutoAssignmentType + */ +class AutoAssignmentType extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The time to live for an inactive license. After this time has + * passed, the license will be automatically unassigned from the user. Must + * be at least 7 days, if set. If unset, the license will never expire. + * + * Generated from protobuf field .google.protobuf.Duration inactive_license_ttl = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $inactive_license_ttl = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Duration $inactive_license_ttl + * Optional. The time to live for an inactive license. After this time has + * passed, the license will be automatically unassigned from the user. Must + * be at least 7 days, if set. If unset, the license will never expire. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Commerce\Consumer\Procurement\V1\LicenseManagementService::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The time to live for an inactive license. After this time has + * passed, the license will be automatically unassigned from the user. Must + * be at least 7 days, if set. If unset, the license will never expire. + * + * Generated from protobuf field .google.protobuf.Duration inactive_license_ttl = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Duration|null + */ + public function getInactiveLicenseTtl() + { + return $this->inactive_license_ttl; + } + + public function hasInactiveLicenseTtl() + { + return isset($this->inactive_license_ttl); + } + + public function clearInactiveLicenseTtl() + { + unset($this->inactive_license_ttl); + } + + /** + * Optional. The time to live for an inactive license. After this time has + * passed, the license will be automatically unassigned from the user. Must + * be at least 7 days, if set. If unset, the license will never expire. + * + * Generated from protobuf field .google.protobuf.Duration inactive_license_ttl = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setInactiveLicenseTtl($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->inactive_license_ttl = $var; + + return $this; + } + +} + + diff --git a/CommerceConsumerProcurement/src/V1/AssignmentProtocol/ManualAssignmentType.php b/CommerceConsumerProcurement/src/V1/AssignmentProtocol/ManualAssignmentType.php new file mode 100644 index 000000000000..25d147e3b0ab --- /dev/null +++ b/CommerceConsumerProcurement/src/V1/AssignmentProtocol/ManualAssignmentType.php @@ -0,0 +1,34 @@ +google.cloud.commerce.consumer.procurement.v1.AssignmentProtocol.ManualAssignmentType + */ +class ManualAssignmentType extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Commerce\Consumer\Procurement\V1\LicenseManagementService::initOnce(); + parent::__construct($data); + } + +} + + diff --git a/CommerceConsumerProcurement/src/V1/AutoRenewalBehavior.php b/CommerceConsumerProcurement/src/V1/AutoRenewalBehavior.php new file mode 100644 index 000000000000..ac3e70593302 --- /dev/null +++ b/CommerceConsumerProcurement/src/V1/AutoRenewalBehavior.php @@ -0,0 +1,61 @@ +google.cloud.commerce.consumer.procurement.v1.AutoRenewalBehavior + */ +class AutoRenewalBehavior +{ + /** + * If unspecified, the auto renewal behavior will follow the default config. + * + * Generated from protobuf enum AUTO_RENEWAL_BEHAVIOR_UNSPECIFIED = 0; + */ + const AUTO_RENEWAL_BEHAVIOR_UNSPECIFIED = 0; + /** + * Auto Renewal will be enabled on subscription. + * + * Generated from protobuf enum AUTO_RENEWAL_BEHAVIOR_ENABLE = 1; + */ + const AUTO_RENEWAL_BEHAVIOR_ENABLE = 1; + /** + * Auto Renewal will be disabled on subscription. + * + * Generated from protobuf enum AUTO_RENEWAL_BEHAVIOR_DISABLE = 2; + */ + const AUTO_RENEWAL_BEHAVIOR_DISABLE = 2; + + private static $valueToName = [ + self::AUTO_RENEWAL_BEHAVIOR_UNSPECIFIED => 'AUTO_RENEWAL_BEHAVIOR_UNSPECIFIED', + self::AUTO_RENEWAL_BEHAVIOR_ENABLE => 'AUTO_RENEWAL_BEHAVIOR_ENABLE', + self::AUTO_RENEWAL_BEHAVIOR_DISABLE => 'AUTO_RENEWAL_BEHAVIOR_DISABLE', + ]; + + 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/CommerceConsumerProcurement/src/V1/CancelOrderMetadata.php b/CommerceConsumerProcurement/src/V1/CancelOrderMetadata.php new file mode 100644 index 000000000000..58e2200fed76 --- /dev/null +++ b/CommerceConsumerProcurement/src/V1/CancelOrderMetadata.php @@ -0,0 +1,34 @@ +google.cloud.commerce.consumer.procurement.v1.CancelOrderMetadata + */ +class CancelOrderMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Commerce\Consumer\Procurement\V1\ProcurementService::initOnce(); + parent::__construct($data); + } + +} + diff --git a/CommerceConsumerProcurement/src/V1/CancelOrderRequest.php b/CommerceConsumerProcurement/src/V1/CancelOrderRequest.php new file mode 100644 index 000000000000..bf6be9598319 --- /dev/null +++ b/CommerceConsumerProcurement/src/V1/CancelOrderRequest.php @@ -0,0 +1,144 @@ +google.cloud.commerce.consumer.procurement.v1.CancelOrderRequest + */ +class CancelOrderRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the order. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Optional. The weak etag, which can be optionally populated, of the order + * that this cancel request is based on. Validation checking will only happen + * if the invoker supplies this field. + * + * Generated from protobuf field string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + /** + * Optional. Cancellation policy of this request. + * + * Generated from protobuf field .google.cloud.commerce.consumer.procurement.v1.CancelOrderRequest.CancellationPolicy cancellation_policy = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $cancellation_policy = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the order. + * @type string $etag + * Optional. The weak etag, which can be optionally populated, of the order + * that this cancel request is based on. Validation checking will only happen + * if the invoker supplies this field. + * @type int $cancellation_policy + * Optional. Cancellation policy of this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Commerce\Consumer\Procurement\V1\ProcurementService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the order. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the order. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The weak etag, which can be optionally populated, of the order + * that this cancel request is based on. Validation checking will only happen + * if the invoker supplies this field. + * + * Generated from protobuf field string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. The weak etag, which can be optionally populated, of the order + * that this cancel request is based on. Validation checking will only happen + * if the invoker supplies this field. + * + * Generated from protobuf field string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Optional. Cancellation policy of this request. + * + * Generated from protobuf field .google.cloud.commerce.consumer.procurement.v1.CancelOrderRequest.CancellationPolicy cancellation_policy = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getCancellationPolicy() + { + return $this->cancellation_policy; + } + + /** + * Optional. Cancellation policy of this request. + * + * Generated from protobuf field .google.cloud.commerce.consumer.procurement.v1.CancelOrderRequest.CancellationPolicy cancellation_policy = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setCancellationPolicy($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Commerce\Consumer\Procurement\V1\CancelOrderRequest\CancellationPolicy::class); + $this->cancellation_policy = $var; + + return $this; + } + +} + diff --git a/CommerceConsumerProcurement/src/V1/CancelOrderRequest/CancellationPolicy.php b/CommerceConsumerProcurement/src/V1/CancelOrderRequest/CancellationPolicy.php new file mode 100644 index 000000000000..3044ad0c4f8f --- /dev/null +++ b/CommerceConsumerProcurement/src/V1/CancelOrderRequest/CancellationPolicy.php @@ -0,0 +1,68 @@ +google.cloud.commerce.consumer.procurement.v1.CancelOrderRequest.CancellationPolicy + */ +class CancellationPolicy +{ + /** + * If unspecified, cancellation will try to cancel the order, if order + * cannot be immediately cancelled, auto renewal will be turned off. + * However, caller should avoid using the value as it will yield a + * non-deterministic result. This is still supported mainly to maintain + * existing integrated usages and ensure backwards compatibility. + * + * Generated from protobuf enum CANCELLATION_POLICY_UNSPECIFIED = 0; + */ + const CANCELLATION_POLICY_UNSPECIFIED = 0; + /** + * Request will cancel the whole order immediately, if order cannot be + * immediately cancelled, the request will fail. + * + * Generated from protobuf enum CANCELLATION_POLICY_CANCEL_IMMEDIATELY = 1; + */ + const CANCELLATION_POLICY_CANCEL_IMMEDIATELY = 1; + /** + * Request will cancel the auto renewal, if order is not subscription based, + * the request will fail. + * + * Generated from protobuf enum CANCELLATION_POLICY_CANCEL_AT_TERM_END = 2; + */ + const CANCELLATION_POLICY_CANCEL_AT_TERM_END = 2; + + private static $valueToName = [ + self::CANCELLATION_POLICY_UNSPECIFIED => 'CANCELLATION_POLICY_UNSPECIFIED', + self::CANCELLATION_POLICY_CANCEL_IMMEDIATELY => 'CANCELLATION_POLICY_CANCEL_IMMEDIATELY', + self::CANCELLATION_POLICY_CANCEL_AT_TERM_END => 'CANCELLATION_POLICY_CANCEL_AT_TERM_END', + ]; + + 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/CommerceConsumerProcurement/src/V1/Client/ConsumerProcurementServiceClient.php b/CommerceConsumerProcurement/src/V1/Client/ConsumerProcurementServiceClient.php index 2130ace770de..201f8e45d39b 100644 --- a/CommerceConsumerProcurement/src/V1/Client/ConsumerProcurementServiceClient.php +++ b/CommerceConsumerProcurement/src/V1/Client/ConsumerProcurementServiceClient.php @@ -34,8 +34,10 @@ use Google\ApiCore\Transport\TransportInterface; use Google\ApiCore\ValidationException; use Google\Auth\FetchAuthTokenInterface; +use Google\Cloud\Commerce\Consumer\Procurement\V1\CancelOrderRequest; use Google\Cloud\Commerce\Consumer\Procurement\V1\GetOrderRequest; use Google\Cloud\Commerce\Consumer\Procurement\V1\ListOrdersRequest; +use Google\Cloud\Commerce\Consumer\Procurement\V1\ModifyOrderRequest; use Google\Cloud\Commerce\Consumer\Procurement\V1\Order; use Google\Cloud\Commerce\Consumer\Procurement\V1\PlaceOrderRequest; use Google\LongRunning\Client\OperationsClient; @@ -62,8 +64,10 @@ * name, and additionally a parseName method to extract the individual identifiers * contained within formatted names that are returned by the API. * + * @method PromiseInterface cancelOrderAsync(CancelOrderRequest $request, array $optionalArgs = []) * @method PromiseInterface getOrderAsync(GetOrderRequest $request, array $optionalArgs = []) * @method PromiseInterface listOrdersAsync(ListOrdersRequest $request, array $optionalArgs = []) + * @method PromiseInterface modifyOrderAsync(ModifyOrderRequest $request, array $optionalArgs = []) * @method PromiseInterface placeOrderAsync(PlaceOrderRequest $request, array $optionalArgs = []) */ final class ConsumerProcurementServiceClient @@ -331,6 +335,35 @@ public function __call($method, $args) return call_user_func_array([$this, 'startAsyncCall'], $args); } + /** + * Cancels an existing + * [Order][google.cloud.commerce.consumer.procurement.v1.Order]. Every product + * procured in the Order will be cancelled. + * + * The async variant is {@see ConsumerProcurementServiceClient::cancelOrderAsync()} + * . + * + * @example samples/V1/ConsumerProcurementServiceClient/cancel_order.php + * + * @param CancelOrderRequest $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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function cancelOrder(CancelOrderRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CancelOrder', $request, $callOptions)->wait(); + } + /** * Returns the requested * [Order][google.cloud.commerce.consumer.procurement.v1.Order] resource. @@ -387,6 +420,34 @@ public function listOrders(ListOrdersRequest $request, array $callOptions = []): return $this->startApiCall('ListOrders', $request, $callOptions); } + /** + * Modifies an existing + * [Order][google.cloud.commerce.consumer.procurement.v1.Order] resource. + * + * The async variant is {@see ConsumerProcurementServiceClient::modifyOrderAsync()} + * . + * + * @example samples/V1/ConsumerProcurementServiceClient/modify_order.php + * + * @param ModifyOrderRequest $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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function modifyOrder(ModifyOrderRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ModifyOrder', $request, $callOptions)->wait(); + } + /** * Creates a new [Order][google.cloud.commerce.consumer.procurement.v1.Order]. * diff --git a/CommerceConsumerProcurement/src/V1/Client/LicenseManagementServiceClient.php b/CommerceConsumerProcurement/src/V1/Client/LicenseManagementServiceClient.php new file mode 100644 index 000000000000..e0e8cf45cd8a --- /dev/null +++ b/CommerceConsumerProcurement/src/V1/Client/LicenseManagementServiceClient.php @@ -0,0 +1,357 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/license_management_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/license_management_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/license_management_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => + __DIR__ . '/../resources/license_management_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a license_pool + * resource. + * + * @param string $billingAccount + * @param string $order + * + * @return string The formatted license_pool resource. + */ + public static function licensePoolName(string $billingAccount, string $order): string + { + return self::getPathTemplate('licensePool')->render([ + 'billing_account' => $billingAccount, + 'order' => $order, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - licensePool: billingAccounts/{billing_account}/orders/{order}/licensePool + * + * 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 + * 'cloudcommerceconsumerprocurement.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); + } + + /** + * Assigns a license to a user. + * + * The async variant is {@see LicenseManagementServiceClient::assignAsync()} . + * + * @example samples/V1/LicenseManagementServiceClient/assign.php + * + * @param AssignRequest $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 AssignResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function assign(AssignRequest $request, array $callOptions = []): AssignResponse + { + return $this->startApiCall('Assign', $request, $callOptions)->wait(); + } + + /** + * Enumerates all users assigned a license. + * + * The async variant is + * {@see LicenseManagementServiceClient::enumerateLicensedUsersAsync()} . + * + * @example samples/V1/LicenseManagementServiceClient/enumerate_licensed_users.php + * + * @param EnumerateLicensedUsersRequest $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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function enumerateLicensedUsers( + EnumerateLicensedUsersRequest $request, + array $callOptions = [] + ): PagedListResponse { + return $this->startApiCall('EnumerateLicensedUsers', $request, $callOptions); + } + + /** + * Gets the license pool. + * + * The async variant is + * {@see LicenseManagementServiceClient::getLicensePoolAsync()} . + * + * @example samples/V1/LicenseManagementServiceClient/get_license_pool.php + * + * @param GetLicensePoolRequest $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 LicensePool + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLicensePool(GetLicensePoolRequest $request, array $callOptions = []): LicensePool + { + return $this->startApiCall('GetLicensePool', $request, $callOptions)->wait(); + } + + /** + * Unassigns a license from a user. + * + * The async variant is {@see LicenseManagementServiceClient::unassignAsync()} . + * + * @example samples/V1/LicenseManagementServiceClient/unassign.php + * + * @param UnassignRequest $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 UnassignResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function unassign(UnassignRequest $request, array $callOptions = []): UnassignResponse + { + return $this->startApiCall('Unassign', $request, $callOptions)->wait(); + } + + /** + * Updates the license pool if one exists for this Order. + * + * The async variant is + * {@see LicenseManagementServiceClient::updateLicensePoolAsync()} . + * + * @example samples/V1/LicenseManagementServiceClient/update_license_pool.php + * + * @param UpdateLicensePoolRequest $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 LicensePool + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateLicensePool(UpdateLicensePoolRequest $request, array $callOptions = []): LicensePool + { + return $this->startApiCall('UpdateLicensePool', $request, $callOptions)->wait(); + } +} diff --git a/CommerceConsumerProcurement/src/V1/EnumerateLicensedUsersRequest.php b/CommerceConsumerProcurement/src/V1/EnumerateLicensedUsersRequest.php new file mode 100644 index 000000000000..37bb56e1839a --- /dev/null +++ b/CommerceConsumerProcurement/src/V1/EnumerateLicensedUsersRequest.php @@ -0,0 +1,157 @@ +google.cloud.commerce.consumer.procurement.v1.EnumerateLicensedUsersRequest + */ +class EnumerateLicensedUsersRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. License pool name. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * Optional. The maximum number of users to return. The service may return + * fewer than this value. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous `EnumerateLicensedUsers` + * call. Provide this to retrieve the subsequent page. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. License pool name. + * + * @return \Google\Cloud\Commerce\Consumer\Procurement\V1\EnumerateLicensedUsersRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. License pool name. + * @type int $page_size + * Optional. The maximum number of users to return. The service may return + * fewer than this value. + * @type string $page_token + * Optional. A page token, received from a previous `EnumerateLicensedUsers` + * call. Provide this to retrieve the subsequent page. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Commerce\Consumer\Procurement\V1\LicenseManagementService::initOnce(); + parent::__construct($data); + } + + /** + * Required. License pool name. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. License pool name. + * + * 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; + } + + /** + * Optional. The maximum number of users to return. The service may return + * fewer than this value. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of users to return. The service may return + * fewer than this value. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from a previous `EnumerateLicensedUsers` + * call. Provide this to retrieve the subsequent page. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous `EnumerateLicensedUsers` + * call. Provide this to retrieve the subsequent page. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/CommerceConsumerProcurement/src/V1/EnumerateLicensedUsersResponse.php b/CommerceConsumerProcurement/src/V1/EnumerateLicensedUsersResponse.php new file mode 100644 index 000000000000..ad994465605b --- /dev/null +++ b/CommerceConsumerProcurement/src/V1/EnumerateLicensedUsersResponse.php @@ -0,0 +1,106 @@ +google.cloud.commerce.consumer.procurement.v1.EnumerateLicensedUsersResponse + */ +class EnumerateLicensedUsersResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of licensed users. + * + * Generated from protobuf field repeated .google.cloud.commerce.consumer.procurement.v1.LicensedUser licensed_users = 1; + */ + private $licensed_users; + /** + * A token that can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Commerce\Consumer\Procurement\V1\LicensedUser>|\Google\Protobuf\Internal\RepeatedField $licensed_users + * The list of licensed users. + * @type string $next_page_token + * A token that can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Commerce\Consumer\Procurement\V1\LicenseManagementService::initOnce(); + parent::__construct($data); + } + + /** + * The list of licensed users. + * + * Generated from protobuf field repeated .google.cloud.commerce.consumer.procurement.v1.LicensedUser licensed_users = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLicensedUsers() + { + return $this->licensed_users; + } + + /** + * The list of licensed users. + * + * Generated from protobuf field repeated .google.cloud.commerce.consumer.procurement.v1.LicensedUser licensed_users = 1; + * @param array<\Google\Cloud\Commerce\Consumer\Procurement\V1\LicensedUser>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLicensedUsers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Commerce\Consumer\Procurement\V1\LicensedUser::class); + $this->licensed_users = $arr; + + return $this; + } + + /** + * A token that can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token that can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/CommerceConsumerProcurement/src/V1/GetLicensePoolRequest.php b/CommerceConsumerProcurement/src/V1/GetLicensePoolRequest.php new file mode 100644 index 000000000000..23e2d4af8b0e --- /dev/null +++ b/CommerceConsumerProcurement/src/V1/GetLicensePoolRequest.php @@ -0,0 +1,85 @@ +google.cloud.commerce.consumer.procurement.v1.GetLicensePoolRequest + */ +class GetLicensePoolRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the license pool to get. + * Format: `billingAccounts/{billing_account}/orders/{order}/licensePool` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the license pool to get. + * Format: `billingAccounts/{billing_account}/orders/{order}/licensePool` + * + * @return \Google\Cloud\Commerce\Consumer\Procurement\V1\GetLicensePoolRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the license pool to get. + * Format: `billingAccounts/{billing_account}/orders/{order}/licensePool` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Commerce\Consumer\Procurement\V1\LicenseManagementService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the license pool to get. + * Format: `billingAccounts/{billing_account}/orders/{order}/licensePool` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the license pool to get. + * Format: `billingAccounts/{billing_account}/orders/{order}/licensePool` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/CommerceConsumerProcurement/src/V1/LicensePool.php b/CommerceConsumerProcurement/src/V1/LicensePool.php new file mode 100644 index 000000000000..cc37fd0582f8 --- /dev/null +++ b/CommerceConsumerProcurement/src/V1/LicensePool.php @@ -0,0 +1,183 @@ +google.cloud.commerce.consumer.procurement.v1.LicensePool + */ +class LicensePool extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. Format: + * `billingAccounts/{billing_account}/orders/{order}/licensePool` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Required. Assignment protocol for the license pool. + * + * Generated from protobuf field .google.cloud.commerce.consumer.procurement.v1.AssignmentProtocol license_assignment_protocol = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $license_assignment_protocol = null; + /** + * Output only. Licenses count that are available to be assigned. + * + * Generated from protobuf field int32 available_license_count = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $available_license_count = 0; + /** + * Output only. Total number of licenses in the pool. + * + * Generated from protobuf field int32 total_license_count = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $total_license_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. Format: + * `billingAccounts/{billing_account}/orders/{order}/licensePool` + * @type \Google\Cloud\Commerce\Consumer\Procurement\V1\AssignmentProtocol $license_assignment_protocol + * Required. Assignment protocol for the license pool. + * @type int $available_license_count + * Output only. Licenses count that are available to be assigned. + * @type int $total_license_count + * Output only. Total number of licenses in the pool. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Commerce\Consumer\Procurement\V1\LicenseManagementService::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. Format: + * `billingAccounts/{billing_account}/orders/{order}/licensePool` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. Format: + * `billingAccounts/{billing_account}/orders/{order}/licensePool` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Assignment protocol for the license pool. + * + * Generated from protobuf field .google.cloud.commerce.consumer.procurement.v1.AssignmentProtocol license_assignment_protocol = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Commerce\Consumer\Procurement\V1\AssignmentProtocol|null + */ + public function getLicenseAssignmentProtocol() + { + return $this->license_assignment_protocol; + } + + public function hasLicenseAssignmentProtocol() + { + return isset($this->license_assignment_protocol); + } + + public function clearLicenseAssignmentProtocol() + { + unset($this->license_assignment_protocol); + } + + /** + * Required. Assignment protocol for the license pool. + * + * Generated from protobuf field .google.cloud.commerce.consumer.procurement.v1.AssignmentProtocol license_assignment_protocol = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Commerce\Consumer\Procurement\V1\AssignmentProtocol $var + * @return $this + */ + public function setLicenseAssignmentProtocol($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Commerce\Consumer\Procurement\V1\AssignmentProtocol::class); + $this->license_assignment_protocol = $var; + + return $this; + } + + /** + * Output only. Licenses count that are available to be assigned. + * + * Generated from protobuf field int32 available_license_count = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getAvailableLicenseCount() + { + return $this->available_license_count; + } + + /** + * Output only. Licenses count that are available to be assigned. + * + * Generated from protobuf field int32 available_license_count = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setAvailableLicenseCount($var) + { + GPBUtil::checkInt32($var); + $this->available_license_count = $var; + + return $this; + } + + /** + * Output only. Total number of licenses in the pool. + * + * Generated from protobuf field int32 total_license_count = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getTotalLicenseCount() + { + return $this->total_license_count; + } + + /** + * Output only. Total number of licenses in the pool. + * + * Generated from protobuf field int32 total_license_count = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setTotalLicenseCount($var) + { + GPBUtil::checkInt32($var); + $this->total_license_count = $var; + + return $this; + } + +} + diff --git a/CommerceConsumerProcurement/src/V1/LicensedUser.php b/CommerceConsumerProcurement/src/V1/LicensedUser.php new file mode 100644 index 000000000000..959c7b3cd26e --- /dev/null +++ b/CommerceConsumerProcurement/src/V1/LicensedUser.php @@ -0,0 +1,167 @@ +google.cloud.commerce.consumer.procurement.v1.LicensedUser + */ +class LicensedUser extends \Google\Protobuf\Internal\Message +{ + /** + * Username. + * Format: `name@domain.com`. + * + * Generated from protobuf field string username = 1; + */ + protected $username = ''; + /** + * Output only. Timestamp when the license was assigned. + * + * Generated from protobuf field .google.protobuf.Timestamp assign_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $assign_time = null; + /** + * Output only. Timestamp when the license was recently used. This may not be + * the most recent usage time, and will be updated regularly (within 24 + * hours). + * + * Generated from protobuf field .google.protobuf.Timestamp recent_usage_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $recent_usage_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $username + * Username. + * Format: `name@domain.com`. + * @type \Google\Protobuf\Timestamp $assign_time + * Output only. Timestamp when the license was assigned. + * @type \Google\Protobuf\Timestamp $recent_usage_time + * Output only. Timestamp when the license was recently used. This may not be + * the most recent usage time, and will be updated regularly (within 24 + * hours). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Commerce\Consumer\Procurement\V1\LicenseManagementService::initOnce(); + parent::__construct($data); + } + + /** + * Username. + * Format: `name@domain.com`. + * + * Generated from protobuf field string username = 1; + * @return string + */ + public function getUsername() + { + return $this->username; + } + + /** + * Username. + * Format: `name@domain.com`. + * + * Generated from protobuf field string username = 1; + * @param string $var + * @return $this + */ + public function setUsername($var) + { + GPBUtil::checkString($var, True); + $this->username = $var; + + return $this; + } + + /** + * Output only. Timestamp when the license was assigned. + * + * Generated from protobuf field .google.protobuf.Timestamp assign_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getAssignTime() + { + return $this->assign_time; + } + + public function hasAssignTime() + { + return isset($this->assign_time); + } + + public function clearAssignTime() + { + unset($this->assign_time); + } + + /** + * Output only. Timestamp when the license was assigned. + * + * Generated from protobuf field .google.protobuf.Timestamp assign_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setAssignTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->assign_time = $var; + + return $this; + } + + /** + * Output only. Timestamp when the license was recently used. This may not be + * the most recent usage time, and will be updated regularly (within 24 + * hours). + * + * Generated from protobuf field .google.protobuf.Timestamp recent_usage_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getRecentUsageTime() + { + return $this->recent_usage_time; + } + + public function hasRecentUsageTime() + { + return isset($this->recent_usage_time); + } + + public function clearRecentUsageTime() + { + unset($this->recent_usage_time); + } + + /** + * Output only. Timestamp when the license was recently used. This may not be + * the most recent usage time, and will be updated regularly (within 24 + * hours). + * + * Generated from protobuf field .google.protobuf.Timestamp recent_usage_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setRecentUsageTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->recent_usage_time = $var; + + return $this; + } + +} + diff --git a/CommerceConsumerProcurement/src/V1/LineItemChangeState.php b/CommerceConsumerProcurement/src/V1/LineItemChangeState.php index 357ddcaba7c8..0f578e994c1a 100644 --- a/CommerceConsumerProcurement/src/V1/LineItemChangeState.php +++ b/CommerceConsumerProcurement/src/V1/LineItemChangeState.php @@ -20,43 +20,47 @@ class LineItemChangeState */ const LINE_ITEM_CHANGE_STATE_UNSPECIFIED = 0; /** - * Change is in this state when a change is initiated and waiting for - * partner approval. + * Change is in this state when a change is initiated and waiting for partner + * approval. This state is only applicable for pending change. * * Generated from protobuf enum LINE_ITEM_CHANGE_STATE_PENDING_APPROVAL = 1; */ const LINE_ITEM_CHANGE_STATE_PENDING_APPROVAL = 1; /** * Change is in this state after it's approved by the partner or auto-approved - * but before it takes effect. The change can be overwritten - * or cancelled depending on the new line item info property (pending Private - * Offer change cannot be cancelled and can only be overwritten by another - * Private Offer). + * but before it takes effect. The change can be overwritten or cancelled + * depending on the new line item info property (pending Private Offer change + * cannot be cancelled and can only be overwritten by another Private Offer). + * This state is only applicable for pending change. * * Generated from protobuf enum LINE_ITEM_CHANGE_STATE_APPROVED = 2; */ const LINE_ITEM_CHANGE_STATE_APPROVED = 2; /** - * Change is in this state after it's been activated. + * Change is in this state after it's been activated. This state is only + * applicable for change in history. * * Generated from protobuf enum LINE_ITEM_CHANGE_STATE_COMPLETED = 3; */ const LINE_ITEM_CHANGE_STATE_COMPLETED = 3; /** - * Change is in this state if it was rejected by the partner. + * Change is in this state if it was rejected by the partner. This state is + * only applicable for change in history. * * Generated from protobuf enum LINE_ITEM_CHANGE_STATE_REJECTED = 4; */ const LINE_ITEM_CHANGE_STATE_REJECTED = 4; /** - * Change is in this state if it was abandoned by the user. + * Change is in this state if it was abandoned by the user. This state is only + * applicable for change in history. * * Generated from protobuf enum LINE_ITEM_CHANGE_STATE_ABANDONED = 5; */ const LINE_ITEM_CHANGE_STATE_ABANDONED = 5; /** * Change is in this state if it's currently being provisioned downstream. The - * change can't be overwritten or cancelled when it's in this state. + * change can't be overwritten or cancelled when it's in this state. This + * state is only applicable for pending change. * * Generated from protobuf enum LINE_ITEM_CHANGE_STATE_ACTIVATING = 6; */ diff --git a/CommerceConsumerProcurement/src/V1/ModifyOrderMetadata.php b/CommerceConsumerProcurement/src/V1/ModifyOrderMetadata.php new file mode 100644 index 000000000000..e457f78bd1eb --- /dev/null +++ b/CommerceConsumerProcurement/src/V1/ModifyOrderMetadata.php @@ -0,0 +1,34 @@ +google.cloud.commerce.consumer.procurement.v1.ModifyOrderMetadata + */ +class ModifyOrderMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Commerce\Consumer\Procurement\V1\ProcurementService::initOnce(); + parent::__construct($data); + } + +} + diff --git a/CommerceConsumerProcurement/src/V1/ModifyOrderRequest.php b/CommerceConsumerProcurement/src/V1/ModifyOrderRequest.php new file mode 100644 index 000000000000..f9638efd58e9 --- /dev/null +++ b/CommerceConsumerProcurement/src/V1/ModifyOrderRequest.php @@ -0,0 +1,190 @@ +google.cloud.commerce.consumer.procurement.v1.ModifyOrderRequest + */ +class ModifyOrderRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the order to update. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Optional. Modifications for an existing Order created by an Offer. + * Required when Offer based Order is being modified, except for when going + * from an offer to a public plan. + * + * Generated from protobuf field repeated .google.cloud.commerce.consumer.procurement.v1.ModifyOrderRequest.Modification modifications = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $modifications; + /** + * Optional. Updated display name of the order, leave as empty if you do not + * want to update current display name. + * + * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_name = ''; + /** + * Optional. The weak etag, which can be optionally populated, of the order + * that this modify request is based on. Validation checking will only happen + * if the invoker supplies this field. + * + * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the order to update. + * @type array<\Google\Cloud\Commerce\Consumer\Procurement\V1\ModifyOrderRequest\Modification>|\Google\Protobuf\Internal\RepeatedField $modifications + * Optional. Modifications for an existing Order created by an Offer. + * Required when Offer based Order is being modified, except for when going + * from an offer to a public plan. + * @type string $display_name + * Optional. Updated display name of the order, leave as empty if you do not + * want to update current display name. + * @type string $etag + * Optional. The weak etag, which can be optionally populated, of the order + * that this modify request is based on. Validation checking will only happen + * if the invoker supplies this field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Commerce\Consumer\Procurement\V1\ProcurementService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the order to update. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the order to update. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Modifications for an existing Order created by an Offer. + * Required when Offer based Order is being modified, except for when going + * from an offer to a public plan. + * + * Generated from protobuf field repeated .google.cloud.commerce.consumer.procurement.v1.ModifyOrderRequest.Modification modifications = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getModifications() + { + return $this->modifications; + } + + /** + * Optional. Modifications for an existing Order created by an Offer. + * Required when Offer based Order is being modified, except for when going + * from an offer to a public plan. + * + * Generated from protobuf field repeated .google.cloud.commerce.consumer.procurement.v1.ModifyOrderRequest.Modification modifications = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Commerce\Consumer\Procurement\V1\ModifyOrderRequest\Modification>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setModifications($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Commerce\Consumer\Procurement\V1\ModifyOrderRequest\Modification::class); + $this->modifications = $arr; + + return $this; + } + + /** + * Optional. Updated display name of the order, leave as empty if you do not + * want to update current display name. + * + * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Optional. Updated display name of the order, leave as empty if you do not + * want to update current display name. + * + * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Optional. The weak etag, which can be optionally populated, of the order + * that this modify request is based on. Validation checking will only happen + * if the invoker supplies this field. + * + * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. The weak etag, which can be optionally populated, of the order + * that this modify request is based on. Validation checking will only happen + * if the invoker supplies this field. + * + * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/CommerceConsumerProcurement/src/V1/ModifyOrderRequest/Modification.php b/CommerceConsumerProcurement/src/V1/ModifyOrderRequest/Modification.php new file mode 100644 index 000000000000..51db5bb537e3 --- /dev/null +++ b/CommerceConsumerProcurement/src/V1/ModifyOrderRequest/Modification.php @@ -0,0 +1,216 @@ +google.cloud.commerce.consumer.procurement.v1.ModifyOrderRequest.Modification + */ +class Modification extends \Google\Protobuf\Internal\Message +{ + /** + * Required. ID of the existing line item to make change to. + * Required when change type is + * [LineItemChangeType.LINE_ITEM_CHANGE_TYPE_UPDATE] or + * [LineItemChangeType.LINE_ITEM_CHANGE_TYPE_CANCEL]. + * + * Generated from protobuf field string line_item_id = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $line_item_id = ''; + /** + * Required. Type of change to make. + * + * Generated from protobuf field .google.cloud.commerce.consumer.procurement.v1.LineItemChangeType change_type = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $change_type = 0; + /** + * Optional. The line item to update to. + * Required when change_type is + * [LineItemChangeType.LINE_ITEM_CHANGE_TYPE_CREATE] or + * [LineItemChangeType.LINE_ITEM_CHANGE_TYPE_UPDATE]. + * + * Generated from protobuf field .google.cloud.commerce.consumer.procurement.v1.LineItemInfo new_line_item_info = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $new_line_item_info = null; + /** + * Optional. Auto renewal behavior of the subscription for the update. + * Applied when change_type is + * [LineItemChangeType.LINE_ITEM_CHANGE_TYPE_UPDATE]. Follows plan default + * config when this field is not specified. + * + * Generated from protobuf field .google.cloud.commerce.consumer.procurement.v1.AutoRenewalBehavior auto_renewal_behavior = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $auto_renewal_behavior = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $line_item_id + * Required. ID of the existing line item to make change to. + * Required when change type is + * [LineItemChangeType.LINE_ITEM_CHANGE_TYPE_UPDATE] or + * [LineItemChangeType.LINE_ITEM_CHANGE_TYPE_CANCEL]. + * @type int $change_type + * Required. Type of change to make. + * @type \Google\Cloud\Commerce\Consumer\Procurement\V1\LineItemInfo $new_line_item_info + * Optional. The line item to update to. + * Required when change_type is + * [LineItemChangeType.LINE_ITEM_CHANGE_TYPE_CREATE] or + * [LineItemChangeType.LINE_ITEM_CHANGE_TYPE_UPDATE]. + * @type int $auto_renewal_behavior + * Optional. Auto renewal behavior of the subscription for the update. + * Applied when change_type is + * [LineItemChangeType.LINE_ITEM_CHANGE_TYPE_UPDATE]. Follows plan default + * config when this field is not specified. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Commerce\Consumer\Procurement\V1\ProcurementService::initOnce(); + parent::__construct($data); + } + + /** + * Required. ID of the existing line item to make change to. + * Required when change type is + * [LineItemChangeType.LINE_ITEM_CHANGE_TYPE_UPDATE] or + * [LineItemChangeType.LINE_ITEM_CHANGE_TYPE_CANCEL]. + * + * Generated from protobuf field string line_item_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getLineItemId() + { + return $this->line_item_id; + } + + /** + * Required. ID of the existing line item to make change to. + * Required when change type is + * [LineItemChangeType.LINE_ITEM_CHANGE_TYPE_UPDATE] or + * [LineItemChangeType.LINE_ITEM_CHANGE_TYPE_CANCEL]. + * + * Generated from protobuf field string line_item_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setLineItemId($var) + { + GPBUtil::checkString($var, True); + $this->line_item_id = $var; + + return $this; + } + + /** + * Required. Type of change to make. + * + * Generated from protobuf field .google.cloud.commerce.consumer.procurement.v1.LineItemChangeType change_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getChangeType() + { + return $this->change_type; + } + + /** + * Required. Type of change to make. + * + * Generated from protobuf field .google.cloud.commerce.consumer.procurement.v1.LineItemChangeType change_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setChangeType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Commerce\Consumer\Procurement\V1\LineItemChangeType::class); + $this->change_type = $var; + + return $this; + } + + /** + * Optional. The line item to update to. + * Required when change_type is + * [LineItemChangeType.LINE_ITEM_CHANGE_TYPE_CREATE] or + * [LineItemChangeType.LINE_ITEM_CHANGE_TYPE_UPDATE]. + * + * Generated from protobuf field .google.cloud.commerce.consumer.procurement.v1.LineItemInfo new_line_item_info = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Commerce\Consumer\Procurement\V1\LineItemInfo|null + */ + public function getNewLineItemInfo() + { + return $this->new_line_item_info; + } + + public function hasNewLineItemInfo() + { + return isset($this->new_line_item_info); + } + + public function clearNewLineItemInfo() + { + unset($this->new_line_item_info); + } + + /** + * Optional. The line item to update to. + * Required when change_type is + * [LineItemChangeType.LINE_ITEM_CHANGE_TYPE_CREATE] or + * [LineItemChangeType.LINE_ITEM_CHANGE_TYPE_UPDATE]. + * + * Generated from protobuf field .google.cloud.commerce.consumer.procurement.v1.LineItemInfo new_line_item_info = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Commerce\Consumer\Procurement\V1\LineItemInfo $var + * @return $this + */ + public function setNewLineItemInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Commerce\Consumer\Procurement\V1\LineItemInfo::class); + $this->new_line_item_info = $var; + + return $this; + } + + /** + * Optional. Auto renewal behavior of the subscription for the update. + * Applied when change_type is + * [LineItemChangeType.LINE_ITEM_CHANGE_TYPE_UPDATE]. Follows plan default + * config when this field is not specified. + * + * Generated from protobuf field .google.cloud.commerce.consumer.procurement.v1.AutoRenewalBehavior auto_renewal_behavior = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getAutoRenewalBehavior() + { + return $this->auto_renewal_behavior; + } + + /** + * Optional. Auto renewal behavior of the subscription for the update. + * Applied when change_type is + * [LineItemChangeType.LINE_ITEM_CHANGE_TYPE_UPDATE]. Follows plan default + * config when this field is not specified. + * + * Generated from protobuf field .google.cloud.commerce.consumer.procurement.v1.AutoRenewalBehavior auto_renewal_behavior = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setAutoRenewalBehavior($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Commerce\Consumer\Procurement\V1\AutoRenewalBehavior::class); + $this->auto_renewal_behavior = $var; + + return $this; + } + +} + + diff --git a/CommerceConsumerProcurement/src/V1/PlaceOrderRequest.php b/CommerceConsumerProcurement/src/V1/PlaceOrderRequest.php index 1821ffd71844..38716b51963c 100644 --- a/CommerceConsumerProcurement/src/V1/PlaceOrderRequest.php +++ b/CommerceConsumerProcurement/src/V1/PlaceOrderRequest.php @@ -39,7 +39,7 @@ class PlaceOrderRequest extends \Google\Protobuf\Internal\Message /** * Optional. A unique identifier for this request. * The server will ignore subsequent requests that provide a duplicate request - * ID for at least 120 minutes after the first request. + * ID for at least 24 hours after the first request. * The request ID must be a valid * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). * @@ -64,7 +64,7 @@ class PlaceOrderRequest extends \Google\Protobuf\Internal\Message * @type string $request_id * Optional. A unique identifier for this request. * The server will ignore subsequent requests that provide a duplicate request - * ID for at least 120 minutes after the first request. + * ID for at least 24 hours after the first request. * The request ID must be a valid * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). * } @@ -159,7 +159,7 @@ public function setLineItemInfo($var) /** * Optional. A unique identifier for this request. * The server will ignore subsequent requests that provide a duplicate request - * ID for at least 120 minutes after the first request. + * ID for at least 24 hours after the first request. * The request ID must be a valid * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). * @@ -174,7 +174,7 @@ public function getRequestId() /** * Optional. A unique identifier for this request. * The server will ignore subsequent requests that provide a duplicate request - * ID for at least 120 minutes after the first request. + * ID for at least 24 hours after the first request. * The request ID must be a valid * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). * diff --git a/CommerceConsumerProcurement/src/V1/UnassignRequest.php b/CommerceConsumerProcurement/src/V1/UnassignRequest.php new file mode 100644 index 000000000000..b61d1f46d9bb --- /dev/null +++ b/CommerceConsumerProcurement/src/V1/UnassignRequest.php @@ -0,0 +1,122 @@ +google.cloud.commerce.consumer.procurement.v1.UnassignRequest + */ +class UnassignRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. License pool name. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * Required. Username. + * Format: `name@domain.com`. + * + * Generated from protobuf field repeated string usernames = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $usernames; + + /** + * @param string $parent Required. License pool name. + * @param string[] $usernames Required. Username. + * Format: `name@domain.com`. + * + * @return \Google\Cloud\Commerce\Consumer\Procurement\V1\UnassignRequest + * + * @experimental + */ + public static function build(string $parent, array $usernames): self + { + return (new self()) + ->setParent($parent) + ->setUsernames($usernames); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. License pool name. + * @type array|\Google\Protobuf\Internal\RepeatedField $usernames + * Required. Username. + * Format: `name@domain.com`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Commerce\Consumer\Procurement\V1\LicenseManagementService::initOnce(); + parent::__construct($data); + } + + /** + * Required. License pool name. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. License pool name. + * + * 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. Username. + * Format: `name@domain.com`. + * + * Generated from protobuf field repeated string usernames = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUsernames() + { + return $this->usernames; + } + + /** + * Required. Username. + * Format: `name@domain.com`. + * + * Generated from protobuf field repeated string usernames = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUsernames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->usernames = $arr; + + return $this; + } + +} + diff --git a/CommerceConsumerProcurement/src/V1/UnassignResponse.php b/CommerceConsumerProcurement/src/V1/UnassignResponse.php new file mode 100644 index 000000000000..80b8d97dccc0 --- /dev/null +++ b/CommerceConsumerProcurement/src/V1/UnassignResponse.php @@ -0,0 +1,34 @@ +google.cloud.commerce.consumer.procurement.v1.UnassignResponse + */ +class UnassignResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Commerce\Consumer\Procurement\V1\LicenseManagementService::initOnce(); + parent::__construct($data); + } + +} + diff --git a/CommerceConsumerProcurement/src/V1/UpdateLicensePoolRequest.php b/CommerceConsumerProcurement/src/V1/UpdateLicensePoolRequest.php new file mode 100644 index 000000000000..58377294310c --- /dev/null +++ b/CommerceConsumerProcurement/src/V1/UpdateLicensePoolRequest.php @@ -0,0 +1,152 @@ +google.cloud.commerce.consumer.procurement.v1.UpdateLicensePoolRequest + */ +class UpdateLicensePoolRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The license pool to update. + * The license pool's name field is used to identify the license pool to + * update. Format: + * `billingAccounts/{billing_account}/orders/{order}/licensePool`. + * + * Generated from protobuf field .google.cloud.commerce.consumer.procurement.v1.LicensePool license_pool = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $license_pool = null; + /** + * Required. The list of fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Commerce\Consumer\Procurement\V1\LicensePool $licensePool Required. The license pool to update. + * + * The license pool's name field is used to identify the license pool to + * update. Format: + * `billingAccounts/{billing_account}/orders/{order}/licensePool`. + * @param \Google\Protobuf\FieldMask $updateMask Required. The list of fields to update. + * + * @return \Google\Cloud\Commerce\Consumer\Procurement\V1\UpdateLicensePoolRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Commerce\Consumer\Procurement\V1\LicensePool $licensePool, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setLicensePool($licensePool) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Commerce\Consumer\Procurement\V1\LicensePool $license_pool + * Required. The license pool to update. + * The license pool's name field is used to identify the license pool to + * update. Format: + * `billingAccounts/{billing_account}/orders/{order}/licensePool`. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The list of fields to update. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Commerce\Consumer\Procurement\V1\LicenseManagementService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The license pool to update. + * The license pool's name field is used to identify the license pool to + * update. Format: + * `billingAccounts/{billing_account}/orders/{order}/licensePool`. + * + * Generated from protobuf field .google.cloud.commerce.consumer.procurement.v1.LicensePool license_pool = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Commerce\Consumer\Procurement\V1\LicensePool|null + */ + public function getLicensePool() + { + return $this->license_pool; + } + + public function hasLicensePool() + { + return isset($this->license_pool); + } + + public function clearLicensePool() + { + unset($this->license_pool); + } + + /** + * Required. The license pool to update. + * The license pool's name field is used to identify the license pool to + * update. Format: + * `billingAccounts/{billing_account}/orders/{order}/licensePool`. + * + * Generated from protobuf field .google.cloud.commerce.consumer.procurement.v1.LicensePool license_pool = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Commerce\Consumer\Procurement\V1\LicensePool $var + * @return $this + */ + public function setLicensePool($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Commerce\Consumer\Procurement\V1\LicensePool::class); + $this->license_pool = $var; + + return $this; + } + + /** + * Required. The list of fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The list of fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/CommerceConsumerProcurement/src/V1/gapic_metadata.json b/CommerceConsumerProcurement/src/V1/gapic_metadata.json index cb38272d584e..eade9d314231 100644 --- a/CommerceConsumerProcurement/src/V1/gapic_metadata.json +++ b/CommerceConsumerProcurement/src/V1/gapic_metadata.json @@ -5,11 +5,50 @@ "protoPackage": "google.cloud.commerce.consumer.procurement.v1", "libraryPackage": "Google\\Cloud\\Commerce\\Consumer\\Procurement\\V1", "services": { + "LicenseManagementService": { + "clients": { + "grpc": { + "libraryClient": "LicenseManagementServiceGapicClient", + "rpcs": { + "Assign": { + "methods": [ + "assign" + ] + }, + "EnumerateLicensedUsers": { + "methods": [ + "enumerateLicensedUsers" + ] + }, + "GetLicensePool": { + "methods": [ + "getLicensePool" + ] + }, + "Unassign": { + "methods": [ + "unassign" + ] + }, + "UpdateLicensePool": { + "methods": [ + "updateLicensePool" + ] + } + } + } + } + }, "ConsumerProcurementService": { "clients": { "grpc": { "libraryClient": "ConsumerProcurementServiceGapicClient", "rpcs": { + "CancelOrder": { + "methods": [ + "cancelOrder" + ] + }, "GetOrder": { "methods": [ "getOrder" @@ -20,6 +59,11 @@ "listOrders" ] }, + "ModifyOrder": { + "methods": [ + "modifyOrder" + ] + }, "PlaceOrder": { "methods": [ "placeOrder" diff --git a/CommerceConsumerProcurement/src/V1/resources/consumer_procurement_service_client_config.json b/CommerceConsumerProcurement/src/V1/resources/consumer_procurement_service_client_config.json index 620c6d0fc1d4..e35a772bd53f 100644 --- a/CommerceConsumerProcurement/src/V1/resources/consumer_procurement_service_client_config.json +++ b/CommerceConsumerProcurement/src/V1/resources/consumer_procurement_service_client_config.json @@ -38,6 +38,11 @@ } }, "methods": { + "CancelOrder": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, "GetOrder": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", @@ -48,6 +53,11 @@ "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "ModifyOrder": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, "PlaceOrder": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", diff --git a/CommerceConsumerProcurement/src/V1/resources/consumer_procurement_service_descriptor_config.php b/CommerceConsumerProcurement/src/V1/resources/consumer_procurement_service_descriptor_config.php index c49b87798bc3..1c547a193562 100644 --- a/CommerceConsumerProcurement/src/V1/resources/consumer_procurement_service_descriptor_config.php +++ b/CommerceConsumerProcurement/src/V1/resources/consumer_procurement_service_descriptor_config.php @@ -23,6 +23,44 @@ return [ 'interfaces' => [ 'google.cloud.commerce.consumer.procurement.v1.ConsumerProcurementService' => [ + 'CancelOrder' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Commerce\Consumer\Procurement\V1\Order', + 'metadataReturnType' => '\Google\Cloud\Commerce\Consumer\Procurement\V1\CancelOrderMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ModifyOrder' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Commerce\Consumer\Procurement\V1\Order', + 'metadataReturnType' => '\Google\Cloud\Commerce\Consumer\Procurement\V1\ModifyOrderMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'PlaceOrder' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Cloud\Commerce\Consumer\Procurement\V1\Order', diff --git a/CommerceConsumerProcurement/src/V1/resources/consumer_procurement_service_rest_client_config.php b/CommerceConsumerProcurement/src/V1/resources/consumer_procurement_service_rest_client_config.php index 940b479b9f04..b29e89ae9fbc 100644 --- a/CommerceConsumerProcurement/src/V1/resources/consumer_procurement_service_rest_client_config.php +++ b/CommerceConsumerProcurement/src/V1/resources/consumer_procurement_service_rest_client_config.php @@ -23,6 +23,18 @@ return [ 'interfaces' => [ 'google.cloud.commerce.consumer.procurement.v1.ConsumerProcurementService' => [ + 'CancelOrder' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=billingAccounts/*/orders/*}:cancel', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetOrder' => [ 'method' => 'get', 'uriTemplate' => '/v1/{name=billingAccounts/*/orders/*}', @@ -45,6 +57,18 @@ ], ], ], + 'ModifyOrder' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=billingAccounts/*/orders/*}:modify', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'PlaceOrder' => [ 'method' => 'post', 'uriTemplate' => '/v1/{parent=billingAccounts/*}/orders:place', diff --git a/CommerceConsumerProcurement/src/V1/resources/license_management_service_client_config.json b/CommerceConsumerProcurement/src/V1/resources/license_management_service_client_config.json new file mode 100644 index 000000000000..98dd2f4c2dd0 --- /dev/null +++ b/CommerceConsumerProcurement/src/V1/resources/license_management_service_client_config.json @@ -0,0 +1,47 @@ +{ + "interfaces": { + "google.cloud.commerce.consumer.procurement.v1.LicenseManagementService": { + "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": { + "Assign": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "EnumerateLicensedUsers": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetLicensePool": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "Unassign": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateLicensePool": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/CommerceConsumerProcurement/src/V1/resources/license_management_service_descriptor_config.php b/CommerceConsumerProcurement/src/V1/resources/license_management_service_descriptor_config.php new file mode 100644 index 000000000000..6e93fa011f59 --- /dev/null +++ b/CommerceConsumerProcurement/src/V1/resources/license_management_service_descriptor_config.php @@ -0,0 +1,100 @@ + [ + 'google.cloud.commerce.consumer.procurement.v1.LicenseManagementService' => [ + 'Assign' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Commerce\Consumer\Procurement\V1\AssignResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'EnumerateLicensedUsers' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLicensedUsers', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Commerce\Consumer\Procurement\V1\EnumerateLicensedUsersResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetLicensePool' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Commerce\Consumer\Procurement\V1\LicensePool', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'Unassign' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Commerce\Consumer\Procurement\V1\UnassignResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateLicensePool' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Commerce\Consumer\Procurement\V1\LicensePool', + 'headerParams' => [ + [ + 'keyName' => 'license_pool.name', + 'fieldAccessors' => [ + 'getLicensePool', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'licensePool' => 'billingAccounts/{billing_account}/orders/{order}/licensePool', + ], + ], + ], +]; diff --git a/CommerceConsumerProcurement/src/V1/resources/license_management_service_rest_client_config.php b/CommerceConsumerProcurement/src/V1/resources/license_management_service_rest_client_config.php new file mode 100644 index 000000000000..c8a2ad883774 --- /dev/null +++ b/CommerceConsumerProcurement/src/V1/resources/license_management_service_rest_client_config.php @@ -0,0 +1,104 @@ + [ + 'google.cloud.commerce.consumer.procurement.v1.LicenseManagementService' => [ + 'Assign' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=billingAccounts/*/orders/*/licensePool}:assign', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'EnumerateLicensedUsers' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=billingAccounts/*/orders/*/licensePool}:enumerateLicensedUsers', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'GetLicensePool' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=billingAccounts/*/orders/*/licensePool}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'Unassign' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=billingAccounts/*/orders/*/licensePool}:unassign', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateLicensePool' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{license_pool.name=billingAccounts/*/orders/*/licensePool/*}', + 'body' => 'license_pool', + 'placeholders' => [ + 'license_pool.name' => [ + 'getters' => [ + 'getLicensePool', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=billingAccounts/*/orders/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/CommerceConsumerProcurement/tests/Unit/V1/Client/ConsumerProcurementServiceClientTest.php b/CommerceConsumerProcurement/tests/Unit/V1/Client/ConsumerProcurementServiceClientTest.php index 5832dc58b3ee..0b8e62ec30b5 100644 --- a/CommerceConsumerProcurement/tests/Unit/V1/Client/ConsumerProcurementServiceClientTest.php +++ b/CommerceConsumerProcurement/tests/Unit/V1/Client/ConsumerProcurementServiceClientTest.php @@ -26,10 +26,12 @@ use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; +use Google\Cloud\Commerce\Consumer\Procurement\V1\CancelOrderRequest; use Google\Cloud\Commerce\Consumer\Procurement\V1\Client\ConsumerProcurementServiceClient; use Google\Cloud\Commerce\Consumer\Procurement\V1\GetOrderRequest; use Google\Cloud\Commerce\Consumer\Procurement\V1\ListOrdersRequest; use Google\Cloud\Commerce\Consumer\Procurement\V1\ListOrdersResponse; +use Google\Cloud\Commerce\Consumer\Procurement\V1\ModifyOrderRequest; use Google\Cloud\Commerce\Consumer\Procurement\V1\Order; use Google\Cloud\Commerce\Consumer\Procurement\V1\PlaceOrderRequest; use Google\LongRunning\Client\OperationsClient; @@ -69,6 +71,137 @@ private function createClient(array $options = []) return new ConsumerProcurementServiceClient($options); } + /** @test */ + public function cancelOrderTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/cancelOrderTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $etag2 = 'etag2-1293302904'; + $expectedResponse = new Order(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setEtag($etag2); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/cancelOrderTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $name = 'name3373707'; + $request = (new CancelOrderRequest())->setName($name); + $response = $gapicClient->cancelOrder($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.commerce.consumer.procurement.v1.ConsumerProcurementService/CancelOrder', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/cancelOrderTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function cancelOrderExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/cancelOrderTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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 + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + $request = (new CancelOrderRequest())->setName($name); + $response = $gapicClient->cancelOrder($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/cancelOrderTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + /** @test */ public function getOrderTest() { @@ -215,6 +348,137 @@ public function listOrdersExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function modifyOrderTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/modifyOrderTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $displayName2 = 'displayName21615000987'; + $etag2 = 'etag2-1293302904'; + $expectedResponse = new Order(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName2); + $expectedResponse->setEtag($etag2); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/modifyOrderTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $name = 'name3373707'; + $request = (new ModifyOrderRequest())->setName($name); + $response = $gapicClient->modifyOrder($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.commerce.consumer.procurement.v1.ConsumerProcurementService/ModifyOrder', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/modifyOrderTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function modifyOrderExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/modifyOrderTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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 + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + $request = (new ModifyOrderRequest())->setName($name); + $response = $gapicClient->modifyOrder($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/modifyOrderTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + /** @test */ public function placeOrderTest() { @@ -351,37 +615,74 @@ public function placeOrderExceptionTest() } /** @test */ - public function getOrderAsyncTest() + public function cancelOrderAsyncTest() { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); $transport = $this->createTransport(); $gapicClient = $this->createClient([ 'transport' => $transport, + 'operationsClient' => $operationsClient, ]); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/cancelOrderTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); $name2 = 'name2-1052831874'; $displayName = 'displayName1615086568'; - $etag = 'etag3123477'; + $etag2 = 'etag2-1293302904'; $expectedResponse = new Order(); $expectedResponse->setName($name2); $expectedResponse->setDisplayName($displayName); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); + $expectedResponse->setEtag($etag2); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/cancelOrderTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); // Mock request $name = 'name3373707'; - $request = (new GetOrderRequest())->setName($name); - $response = $gapicClient->getOrderAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); + $request = (new CancelOrderRequest())->setName($name); + $response = $gapicClient->cancelOrderAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); $this->assertSame( - '/google.cloud.commerce.consumer.procurement.v1.ConsumerProcurementService/GetOrder', - $actualFuncCall + '/google.cloud.commerce.consumer.procurement.v1.ConsumerProcurementService/CancelOrder', + $actualApiFuncCall ); - $actualValue = $actualRequestObject->getName(); + $actualValue = $actualApiRequestObject->getName(); $this->assertProtobufEquals($name, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/cancelOrderTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); } } diff --git a/CommerceConsumerProcurement/tests/Unit/V1/Client/LicenseManagementServiceClientTest.php b/CommerceConsumerProcurement/tests/Unit/V1/Client/LicenseManagementServiceClientTest.php new file mode 100644 index 000000000000..a0dcd999b2ea --- /dev/null +++ b/CommerceConsumerProcurement/tests/Unit/V1/Client/LicenseManagementServiceClientTest.php @@ -0,0 +1,472 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return LicenseManagementServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new LicenseManagementServiceClient($options); + } + + /** @test */ + public function assignTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new AssignResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $usernames = []; + $request = (new AssignRequest())->setParent($parent)->setUsernames($usernames); + $response = $gapicClient->assign($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.commerce.consumer.procurement.v1.LicenseManagementService/Assign', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualRequestObject->getUsernames(); + $this->assertProtobufEquals($usernames, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function assignExceptionTest() + { + $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'; + $usernames = []; + $request = (new AssignRequest())->setParent($parent)->setUsernames($usernames); + try { + $gapicClient->assign($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 enumerateLicensedUsersTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $licensedUsersElement = new LicensedUser(); + $licensedUsers = [$licensedUsersElement]; + $expectedResponse = new EnumerateLicensedUsersResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLicensedUsers($licensedUsers); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $request = (new EnumerateLicensedUsersRequest())->setParent($parent); + $response = $gapicClient->enumerateLicensedUsers($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLicensedUsers()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.commerce.consumer.procurement.v1.LicenseManagementService/EnumerateLicensedUsers', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function enumerateLicensedUsersExceptionTest() + { + $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'; + $request = (new EnumerateLicensedUsersRequest())->setParent($parent); + try { + $gapicClient->enumerateLicensedUsers($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 getLicensePoolTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $availableLicenseCount = 387091611; + $totalLicenseCount = 834147882; + $expectedResponse = new LicensePool(); + $expectedResponse->setName($name2); + $expectedResponse->setAvailableLicenseCount($availableLicenseCount); + $expectedResponse->setTotalLicenseCount($totalLicenseCount); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $request = (new GetLicensePoolRequest())->setName($name); + $response = $gapicClient->getLicensePool($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.commerce.consumer.procurement.v1.LicenseManagementService/GetLicensePool', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLicensePoolExceptionTest() + { + $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 + $name = 'name3373707'; + $request = (new GetLicensePoolRequest())->setName($name); + try { + $gapicClient->getLicensePool($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 unassignTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new UnassignResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $usernames = []; + $request = (new UnassignRequest())->setParent($parent)->setUsernames($usernames); + $response = $gapicClient->unassign($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.commerce.consumer.procurement.v1.LicenseManagementService/Unassign', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualRequestObject->getUsernames(); + $this->assertProtobufEquals($usernames, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function unassignExceptionTest() + { + $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'; + $usernames = []; + $request = (new UnassignRequest())->setParent($parent)->setUsernames($usernames); + try { + $gapicClient->unassign($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 updateLicensePoolTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $availableLicenseCount = 387091611; + $totalLicenseCount = 834147882; + $expectedResponse = new LicensePool(); + $expectedResponse->setName($name); + $expectedResponse->setAvailableLicenseCount($availableLicenseCount); + $expectedResponse->setTotalLicenseCount($totalLicenseCount); + $transport->addResponse($expectedResponse); + // Mock request + $licensePool = new LicensePool(); + $licensePoolLicenseAssignmentProtocol = new AssignmentProtocol(); + $licensePool->setLicenseAssignmentProtocol($licensePoolLicenseAssignmentProtocol); + $updateMask = new FieldMask(); + $request = (new UpdateLicensePoolRequest())->setLicensePool($licensePool)->setUpdateMask($updateMask); + $response = $gapicClient->updateLicensePool($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.commerce.consumer.procurement.v1.LicenseManagementService/UpdateLicensePool', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getLicensePool(); + $this->assertProtobufEquals($licensePool, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateLicensePoolExceptionTest() + { + $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 + $licensePool = new LicensePool(); + $licensePoolLicenseAssignmentProtocol = new AssignmentProtocol(); + $licensePool->setLicenseAssignmentProtocol($licensePoolLicenseAssignmentProtocol); + $updateMask = new FieldMask(); + $request = (new UpdateLicensePoolRequest())->setLicensePool($licensePool)->setUpdateMask($updateMask); + try { + $gapicClient->updateLicensePool($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 assignAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new AssignResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $usernames = []; + $request = (new AssignRequest())->setParent($parent)->setUsernames($usernames); + $response = $gapicClient->assignAsync($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.commerce.consumer.procurement.v1.LicenseManagementService/Assign', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualRequestObject->getUsernames(); + $this->assertProtobufEquals($usernames, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} From a93ec74d89b046e5fd0f751c17eca18b840ac74a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 18:29:18 +0000 Subject: [PATCH 09/34] fix: location type annotation (#7739) PiperOrigin-RevId: 684535402 Source-Link: https://github.com/googleapis/googleapis/commit/d544df712edd6fcb39970dff0dbda2123fe2589e Source-Link: https://github.com/googleapis/googleapis-gen/commit/8bdbcef851073f49cf96e45864c4eadb37cd7d69 Copy-Tag: eyJwIjoiRGlzY292ZXJ5RW5naW5lLy5Pd2xCb3QueWFtbCIsImgiOiI4YmRiY2VmODUxMDczZjQ5Y2Y5NmU0NTg2NGM0ZWFkYjM3Y2Q3ZDY5In0= feat: Add GroundedGenerationService API feat: Add BillingEstimation in data store feat: Support Google Workspace search feat: Support advanced boost search feat: Add one_box_page_size on search feat: Add site_credential for site search config docs: Update documentation PiperOrigin-RevId: 684224724 Source-Link: https://github.com/googleapis/googleapis/commit/72be1383924aa4c59828ffd1e716d8d528825983 Source-Link: https://github.com/googleapis/googleapis-gen/commit/eecf784b020fdac5e75884fd3634b1aa40022aca Copy-Tag: eyJwIjoiRGlzY292ZXJ5RW5naW5lLy5Pd2xCb3QueWFtbCIsImgiOiJlZWNmNzg0YjAyMGZkYWM1ZTc1ODg0ZmQzNjM0YjFhYTQwMDIyYWNhIn0= --- DiscoveryEngine/metadata/V1/Answer.php | Bin 5570 -> 5646 bytes DiscoveryEngine/metadata/V1/Common.php | Bin 2908 -> 3076 bytes .../V1/ConversationalSearchService.php | Bin 13815 -> 14097 bytes .../metadata/V1/CustomTuningModel.php | Bin 2137 -> 2160 bytes DiscoveryEngine/metadata/V1/DataStore.php | Bin 2405 -> 3260 bytes .../metadata/V1/DocumentService.php | Bin 6575 -> 6836 bytes DiscoveryEngine/metadata/V1/Engine.php | Bin 2637 -> 2669 bytes .../metadata/V1/GroundedGenerationService.php | Bin 2654 -> 7834 bytes DiscoveryEngine/metadata/V1/SearchService.php | Bin 9248 -> 10162 bytes .../metadata/V1/SiteSearchEngineService.php | Bin 10297 -> 10328 bytes .../ControlServiceClient/create_control.php | 4 +- .../ControlServiceClient/delete_control.php | 2 +- .../V1/ControlServiceClient/get_control.php | 2 +- .../V1/ControlServiceClient/list_controls.php | 4 +- .../converse_conversation.php | 4 +- .../create_conversation.php | 2 +- .../create_session.php | 2 +- .../delete_conversation.php | 2 +- .../delete_session.php | 2 +- .../get_answer.php | 2 +- .../get_conversation.php | 2 +- .../get_session.php | 2 +- .../list_conversations.php | 2 +- .../list_sessions.php | 2 +- .../generate_grounded_content.php | 73 ++++ .../stream_generate_grounded_content.php | 79 ++++ .../samples/V1/RankServiceClient/rank.php | 2 +- .../purge_user_events.php | 4 +- .../src/V1/Answer/AnswerSkippedReason.php | 11 +- .../QueryClassificationInfo/Type.php | 9 +- DiscoveryEngine/src/V1/AnswerQueryRequest.php | 19 +- .../AnswerGenerationSpec.php | 70 ++++ .../QueryClassificationSpec/Type.php | 9 +- .../SearchResult/ChunkInfo.php | 44 +++ .../ChunkInfo/DocumentMetadata.php | 103 +++++ .../SearchResult/UnstructuredDocumentInfo.php | 39 +- .../DocumentContext.php | 8 +- .../ExtractiveSegment.php | 2 + .../FhirMatcher.php | 77 ++++ .../Matcher.php | 33 ++ .../DocumentMetadata/MatcherValue.php | 36 ++ .../src/V1/Client/DocumentServiceClient.php | 32 ++ .../GroundedGenerationServiceClient.php | 182 +++++++++ .../src/V1/ConverseConversationRequest.php | 28 +- .../src/V1/CreateControlRequest.php | 20 +- .../src/V1/CreateConversationRequest.php | 10 +- .../src/V1/CreateSessionRequest.php | 10 +- DiscoveryEngine/src/V1/CustomTuningModel.php | 62 ++- DiscoveryEngine/src/V1/DataStore.php | 104 +++++ .../src/V1/DataStore/BillingEstimation.php | 268 +++++++++++++ .../src/V1/DataStore/ContentConfig.php | 9 + .../src/V1/DeleteControlRequest.php | 10 +- .../src/V1/DeleteConversationRequest.php | 10 +- .../src/V1/DeleteSessionRequest.php | 10 +- DiscoveryEngine/src/V1/DocumentInfo.php | 6 +- .../src/V1/DocumentProcessingConfig.php | 18 +- DiscoveryEngine/src/V1/Engine.php | 46 ++- .../src/V1/GenerateGroundedContentRequest.php | 352 +++++++++++++++++ .../DynamicRetrievalConfiguration.php | 78 ++++ .../DynamicRetrievalPredictor.php | 116 ++++++ .../DynamicRetrievalPredictor/Version.php | 55 +++ .../GenerationSpec.php | 370 ++++++++++++++++++ .../GroundingSource.php | 142 +++++++ .../GroundingSource/GoogleSearchSource.php | 82 ++++ .../GroundingSource/InlineSource.php | 110 ++++++ .../GroundingSource/SearchSource.php | 190 +++++++++ .../GroundingSpec.php | 68 ++++ .../V1/GenerateGroundedContentResponse.php | 65 +++ .../Candidate.php | 200 ++++++++++ .../Candidate/GroundingMetadata.php | 238 +++++++++++ .../DynamicRetrievalMetadata.php | 78 ++++ .../DynamicRetrievalPredictorMetadata.php | 128 ++++++ .../Version.php | 55 +++ .../GroundingMetadata/GroundingSupport.php | 170 ++++++++ .../GroundingMetadata/RetrievalMetadata.php | 112 ++++++ .../RetrievalMetadata/Source.php | 76 ++++ .../GroundingMetadata/SearchEntryPoint.php | 110 ++++++ DiscoveryEngine/src/V1/GetAnswerRequest.php | 10 +- DiscoveryEngine/src/V1/GetControlRequest.php | 10 +- .../src/V1/GetConversationRequest.php | 10 +- DiscoveryEngine/src/V1/GetSessionRequest.php | 10 +- .../src/V1/GroundedGenerationContent.php | 109 ++++++ .../src/V1/GroundedGenerationContent/Part.php | 76 ++++ .../src/V1/ListControlsRequest.php | 20 +- .../src/V1/ListConversationsRequest.php | 10 +- .../src/V1/ListSessionsRequest.php | 10 +- DiscoveryEngine/src/V1/Project.php | 8 +- .../src/V1/PurgeUserEventsRequest.php | 8 +- DiscoveryEngine/src/V1/RankRequest.php | 8 +- DiscoveryEngine/src/V1/RecrawlUrisRequest.php | 42 ++ DiscoveryEngine/src/V1/SearchRequest.php | 42 ++ .../BoostSpec/ConditionBoostSpec.php | 48 +++ .../ConditionBoostSpec/BoostControlSpec.php | 204 ++++++++++ .../BoostControlSpec/AttributeType.php | 71 ++++ .../BoostControlSpec/ControlPoint.php | 128 ++++++ .../BoostControlSpec/InterpolationType.php | 57 +++ .../ContentSearchSpec/SummarySpec.php | 70 ++++ .../src/V1/SearchRequest/DataStoreSpec.php | 42 ++ .../Summary/SummarySkippedReason.php | 12 + DiscoveryEngine/src/V1/WorkspaceConfig.php | 185 +++++++++ .../src/V1/WorkspaceConfig/Type.php | 97 +++++ DiscoveryEngine/src/V1/gapic_metadata.json | 10 + .../completion_service_rest_client_config.php | 4 +- .../control_service_rest_client_config.php | 4 +- ...onal_search_service_rest_client_config.php | 4 +- .../data_store_service_rest_client_config.php | 4 +- .../document_service_descriptor_config.php | 1 + .../document_service_rest_client_config.php | 4 +- .../engine_service_rest_client_config.php | 4 +- ...nded_generation_service_client_config.json | 8 + ...d_generation_service_descriptor_config.php | 32 ++ ..._generation_service_rest_client_config.php | 16 +- .../project_service_rest_client_config.php | 4 +- .../rank_service_rest_client_config.php | 4 +- ...ommendation_service_rest_client_config.php | 4 +- .../schema_service_rest_client_config.php | 4 +- .../search_service_rest_client_config.php | 4 +- ...arch_tuning_service_rest_client_config.php | 4 +- ...arch_engine_service_rest_client_config.php | 4 +- .../user_event_service_rest_client_config.php | 4 +- .../V1/Client/EngineServiceClientTest.php | 8 + .../GroundedGenerationServiceClientTest.php | 166 ++++++++ 122 files changed, 5664 insertions(+), 192 deletions(-) create mode 100644 DiscoveryEngine/samples/V1/GroundedGenerationServiceClient/generate_grounded_content.php create mode 100644 DiscoveryEngine/samples/V1/GroundedGenerationServiceClient/stream_generate_grounded_content.php create mode 100644 DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult/ChunkInfo/DocumentMetadata.php create mode 100644 DiscoveryEngine/src/V1/BatchGetDocumentsMetadataRequest/FhirMatcher.php create mode 100644 DiscoveryEngine/src/V1/DataStore/BillingEstimation.php create mode 100644 DiscoveryEngine/src/V1/GenerateGroundedContentRequest.php create mode 100644 DiscoveryEngine/src/V1/GenerateGroundedContentRequest/DynamicRetrievalConfiguration.php create mode 100644 DiscoveryEngine/src/V1/GenerateGroundedContentRequest/DynamicRetrievalConfiguration/DynamicRetrievalPredictor.php create mode 100644 DiscoveryEngine/src/V1/GenerateGroundedContentRequest/DynamicRetrievalConfiguration/DynamicRetrievalPredictor/Version.php create mode 100644 DiscoveryEngine/src/V1/GenerateGroundedContentRequest/GenerationSpec.php create mode 100644 DiscoveryEngine/src/V1/GenerateGroundedContentRequest/GroundingSource.php create mode 100644 DiscoveryEngine/src/V1/GenerateGroundedContentRequest/GroundingSource/GoogleSearchSource.php create mode 100644 DiscoveryEngine/src/V1/GenerateGroundedContentRequest/GroundingSource/InlineSource.php create mode 100644 DiscoveryEngine/src/V1/GenerateGroundedContentRequest/GroundingSource/SearchSource.php create mode 100644 DiscoveryEngine/src/V1/GenerateGroundedContentRequest/GroundingSpec.php create mode 100644 DiscoveryEngine/src/V1/GenerateGroundedContentResponse.php create mode 100644 DiscoveryEngine/src/V1/GenerateGroundedContentResponse/Candidate.php create mode 100644 DiscoveryEngine/src/V1/GenerateGroundedContentResponse/Candidate/GroundingMetadata.php create mode 100644 DiscoveryEngine/src/V1/GenerateGroundedContentResponse/Candidate/GroundingMetadata/DynamicRetrievalMetadata.php create mode 100644 DiscoveryEngine/src/V1/GenerateGroundedContentResponse/Candidate/GroundingMetadata/DynamicRetrievalPredictorMetadata.php create mode 100644 DiscoveryEngine/src/V1/GenerateGroundedContentResponse/Candidate/GroundingMetadata/DynamicRetrievalPredictorMetadata/Version.php create mode 100644 DiscoveryEngine/src/V1/GenerateGroundedContentResponse/Candidate/GroundingMetadata/GroundingSupport.php create mode 100644 DiscoveryEngine/src/V1/GenerateGroundedContentResponse/Candidate/GroundingMetadata/RetrievalMetadata.php create mode 100644 DiscoveryEngine/src/V1/GenerateGroundedContentResponse/Candidate/GroundingMetadata/RetrievalMetadata/Source.php create mode 100644 DiscoveryEngine/src/V1/GenerateGroundedContentResponse/Candidate/GroundingMetadata/SearchEntryPoint.php create mode 100644 DiscoveryEngine/src/V1/GroundedGenerationContent.php create mode 100644 DiscoveryEngine/src/V1/GroundedGenerationContent/Part.php create mode 100644 DiscoveryEngine/src/V1/SearchRequest/BoostSpec/ConditionBoostSpec/BoostControlSpec.php create mode 100644 DiscoveryEngine/src/V1/SearchRequest/BoostSpec/ConditionBoostSpec/BoostControlSpec/AttributeType.php create mode 100644 DiscoveryEngine/src/V1/SearchRequest/BoostSpec/ConditionBoostSpec/BoostControlSpec/ControlPoint.php create mode 100644 DiscoveryEngine/src/V1/SearchRequest/BoostSpec/ConditionBoostSpec/BoostControlSpec/InterpolationType.php create mode 100644 DiscoveryEngine/src/V1/WorkspaceConfig.php create mode 100644 DiscoveryEngine/src/V1/WorkspaceConfig/Type.php diff --git a/DiscoveryEngine/metadata/V1/Answer.php b/DiscoveryEngine/metadata/V1/Answer.php index e163c2d7c02d738c303067ed4e247d37dfdf2cd4..35be0444f496955fd25ebed50f673099e021e8f4 100644 GIT binary patch delta 93 zcmX@4-KVqRG!x_3$!C~WGaXRcT*;in!?KH+OKkEv0kO&d`D+-LOs)}_!PLz-SyV8K xMM$1Yda|yNBuki)0L$chL0`rro6ic$FtQ58sB`<=1egN~7L(2p7L)%Ed;x-!d=QucYLgZb UYLlT6O#z#;?-3jUvo#ah0_F4;n*aa+ diff --git a/DiscoveryEngine/metadata/V1/Common.php b/DiscoveryEngine/metadata/V1/Common.php index f32e9c49d835dee42e127027c98476bfad00512a..47891dd4cd599bfc0288882f53d70b5a3efd46e9 100644 GIT binary patch delta 97 zcmca3)*`V%nu%$y@Mc*i4`!y*Je$*5SFp0Za$Lg5r8ap6mmF76YH@yPQF5wK)#P;? n8k3)LX{qa{Wn>oVR~JEL;!7$EQfu|AL89?+!OWD&eB6EjF5Ds$ delta 27 jcmZpXxFfbfnu+PF;AUAS4`!yt+?&%`SFldr&g}~TdCCZ% diff --git a/DiscoveryEngine/metadata/V1/ConversationalSearchService.php b/DiscoveryEngine/metadata/V1/ConversationalSearchService.php index a908b1cf059a240816ee85832293c4c0554a63a9..2cd4e6bad36e1eabd9dd5c800c9a806d29cd6e90 100644 GIT binary patch delta 332 zcmeyKJuz>?3>KDUDO}Ez-?J)g-op~k!E{4$vncOLCPvxG_xUARoR}mSC;#Bz$+Vbd z^JanRjG96*>ReKp>3R7@sqtBfnK|)EMX8C|nR)5)g{7%Ql@c5Zj2awH%nuwVdkUp7 z-4NKkQOJ#nshwx?PmwOBKU|wzMYS0jmu=oCc9fBE`Q&nmB@ip5C3iE;W}19mGE7cr z5+j#jN`7)_Zfaghd~Rw%xB^fpL|wIVsf2y1yeWU BW)A=W delta 145 zcmV;C0B--0Zue`jm;?lkVhTf(?*$;UyaZPW0>2-#6%EM(0U49u4;hpE54i;T0}2$A zfDsh4%@BbBlXwzk0*()}-x5Xw0=){8Cl!hUvI(=Z6)OP&qO;!?#Q_1MlcgA>lT8`B z0alX=8dj4f8x;iL1PT_DFdP=MR2v2X1pNUD7n9K(7n5}yc>!vZ@EmHhdmWY;o=q`= diff --git a/DiscoveryEngine/metadata/V1/CustomTuningModel.php b/DiscoveryEngine/metadata/V1/CustomTuningModel.php index b1a833e457ea20e4ff21f7f8a2b8faad4782b88a..4a60172f88093a4b803fb1314e17ec35c0d130ad 100644 GIT binary patch delta 49 zcmca9@Ihe1DkjE1lUFm%Vm!Oqjd?DkxR59pZ)#Cdeo=gGYH@L5da4A60;2}!=Ep2$ F%mB~Q5X}Gp delta 25 hcmew$a8qEzDkjFKlUFm%V%)abjd?EP=3gvj%m9*23V{Fs diff --git a/DiscoveryEngine/metadata/V1/DataStore.php b/DiscoveryEngine/metadata/V1/DataStore.php index 37038364070b25bdfface4703ed715ec9bbf6bb1..878fa114d0ee1e299092250ede8de34da3748773 100644 GIT binary patch delta 784 zcmaKpPm9w)7{*PLrtYk6r{l7wT@?)?i-%Gc1i=N#rem$G+tOrRycp7CwhlIb$V^=H z(u3e#a`fg05MeJOegg3$co4ypU%`XZY?Zhx-iCR8&-3y=?|1aE{_dr${HTG}t6nSn zApb0V0*CLF7t%T!)9I9k6NfNP1DDe%)Xra)HkLQHvPY_Z%jK@cql7fKk2w4X+m^o? zGP(!gL6kgUvFj1Xi^6?6(dxOsm93PoRQG<1X0By7)i<-o+Y+dq$U_&vD&tA&@iZa6 zPPWPL(5E*xa7;ORVuhB)f`hT|)#QH4zqS7_A3Seh2 z==8C(HyHJ-pn{AcXT~3N<*$Gb7+2N30(vAB1r<5PKC=)2xECg zf}06Ye=PwepDXsU9}cmzyJHQp*}c=nZFmYnaAvV(d(?e^p@gbndGT}K==Nc$fLL7{ xTTn*lKy`tbMj!9AjS*A|KJ%_&!!oMr;OqkHj0U?y3#tXEhw%_r4r`}v=@;Fg?NI;# delta 47 zcmV+~0MP%u8RZhNh64nY3kooiOE8nV1N;Km2D7*Xg8`G~2A={VX_L4JX_Gez%(G|< FQ~|9p5sv@> diff --git a/DiscoveryEngine/metadata/V1/DocumentService.php b/DiscoveryEngine/metadata/V1/DocumentService.php index 06077227204995e4663ad835101a4328dc639e62..96eaaabe568a5eacb9bdb30782692fa0084470ea 100644 GIT binary patch delta 282 zcmZ2)yv20GMi!RM+FWK6z0EeiX6a>Nna#qbFj)YI=Wy%g8M9O)N>yNG%d_ zh;ecZSAm33Di;sfyj+O+5=;t=8r(*{lizbX$s*b7!QjNn#ST@Z zw1AaM5$Hha$=|sum^LwQF66dlWGtDyo=4V2$c2j+#erZGIi0jgaNOooJWqK55R+X$ delta 87 zcmV-d0I2`8HLo+Uu>=IJDGD}`OE$CX1dRj)+yV+9lhGF-lbi{^0eh3Q3UClY2?_^o tVRU0?WpX0g1PURO(H9$&FBk@sybE#y>;khe3_Sq>E|YEz9kbC5;|wgl9UuSz diff --git a/DiscoveryEngine/metadata/V1/Engine.php b/DiscoveryEngine/metadata/V1/Engine.php index dc42397e8e7ea4843f5c59771367f157e6b859be..227b9d7477417f014f77341e25457a058d835614 100644 GIT binary patch delta 59 zcmX>r@>XQSZ6?MOlkYI?W@_f%Jd=4VlY)>Omtaa}abi+VYJ6f|VoqgAW^%EFlmep$ PhZFMyN5;*5Z2y@7miZJ^ delta 26 icmaDWa#m!+Z6?MQlkYI?W_rxEc_#B#rp%WoV>8BdQrethHD8Tm_ zy4~H|4<{xHpcSA6fdoQGz)B!-0r3xT;D9)?Hy#q#Js^8ko(^?kqZQJ;O&-E-k3WtH00(*xR2>PJejM-|s|0>^MHr5-k$)Kd)Sz%?!Esfx0^ zscdZCRVvHXyD#EV-w8c~7L=Cbv@Du8EGKN_8>VkKhtxZwcFVMB{%|4R@|@6a(1z9$ zyiCW|eCi#V230vX09!wxzN;HlS=}n#p@H7e1HHD&3D?SuaBaDpaBX+t7Jy;tzOSrC z3?f~S{*E9I4?)2{ZdkWWL-7MWz<*vgea*DZz|<}CYpC~<($p=VBDMa#&CoUiq^Gb0 zo3=scuPcHk+xxQXpq-YKSkNtIIy76YY6sM_b*r{aeZw=|!11Y!&clhcXW^`l4MkBeP z6?FUg#H7r?*Wf2Np?GS4Cszdtm4}Sl6Ef=If_y3Bp}Qu=6*Ikv6gfJXXA4bcU#%V) zINETzf?TuK?4 z&n&*F4pC7ZNLbxMI`S15W&e_C7!BxyKyX<*QyPO&h7Gwtor5d!O~s@l$+qb`A@u`N zgbB+rxVMYrrTmA*)JMhZP`lP^b0IBS)mIVl^6Sw#vJ1pN@&kH+kl|wlax|Drqsp1Z z!qe+W)?vaBc8o1{8fq<=X?0+$OO3e^F5<>;5hMIR-iB&qVg{*5l~9;&aj-=v(R{{d zl=HcBYCbVl&ZYsG5Ho~k>2+%Pb7S14Hc!jr9+F(=6f1V%9m#)4!E}#)S(rF*8r0Iv z2DjiOxd3M^-EM_?i)scgp?@=XpMwlKh09WB=uvKk)Y_T%B#9762ac<`+(}YvQpdOb zxp6$4UQ4lWS75g3F;BIPBh96lErO%D30zODjj;6>AnRfP<1$T_C;9Sdbo@YnpgCdS zhJhA1`_%U5fRj(-dTAP_vZo`JM!mNUUKRm;-qfW)|DZ ztK^3gjAP;Aqu5-~>BVn+OoFPrLJV>dCWAe6f<4D-aK{rqmb(e#@s>+)Znv_%Q{CLq z?rrRBRm#( z!op1x2{^j4TJ5x^=wYN*ITyio?F{4VQ{6N6V!kZQGKn4B!!rVFk{zUs>OtzK-mSD>G?!5FtSgNxNA+4vyevA2qR!Eq&_3bKb2sr(?p~S z)4XB8q=Q)#;YFM+Eqqi|;gun|oc98DOW+a$cb4H8232SUNG-Gj9$9IuG{%~yg@t>B z{O2I!>rD& zCf0xG%OW5?_w-g3RMm1!QvTO8OeX(heraOY`hdGyn%stQbUjx1a(6jh_4mon_{M%2 zD+q=+Q3de;Nc*Y|qGmWMv`zzvy$VMqID&uNam#<6g4yIYkHh8`V@lqWx}sL7jsC|vtmi9A;siT_sr>5^ znC-ueZ%Z-a@GzNP448bF9Ut&qG{S1S>c)C?qoS2JH}0~UE=6V_ z6K%Uw+}g>G%D=;0G)NfobM)?{9@i2Bu^v9N`1R*{dA%|vb$M(l`4=g8ap*3B)j?04 z{vGM#6+EfeF9AfxWlaS0x>FYHXCcFSG1fjIMfnZL_F)7TG#Q?d`)-oQqmVpCM}0K3I_%!0k=g)WT6;RlKkL1Y@?^K85PQWmDQ zuEi38tk%wF{6KCUNO_MM`)z4hjdB%;VT$o&yG`N1BJtk3bOFw3{X25M9Dxhn`5~H9T?-@?PCIGx3Y9%8^l!;ixK&c5~R!Q7i-ONR*yx9>#z!hjdl3= z=RAyKH1e-3D$?-)s58h|t;a@4*~FLQ_+mn)$){kh!)sZbU{mo35LCoZ7Aip zhTh5m*0C4mHs1Z~KYpBA%az%K)5Cb|yM)h6Z&Pfa^EdMGH~jsmfTP^O`V^!a^U`Y) z`KJVz2JroVPuK<-Lf0JOkJ37hDp*PZfAi@gy(yJOb!puqR$M zUv(`#Xgc0O=|?Ge2_FcCX<51=@&=7xlQ4Tn@x&hqx1=xK5syD2-S9_;mecooin5?T z_bB1kZ}oloRcdCrx>Mf7I`WH^ja4iWf1A201{ErQ8dI0!_tOf0m{oTdK8SbJq9@k& z8>`q;!$;PCr*eW!p}^@B3O$4hh24ev7=Ooo{aW%`_KJ9}?0DTA__E1&iWkU7@Ce|4 DW(aYC delta 31 ncmbPbdrxG8IWyB;-pQ8CuQ%6;^)WLYW17q-C9|1FrjH2#wcQFn diff --git a/DiscoveryEngine/metadata/V1/SearchService.php b/DiscoveryEngine/metadata/V1/SearchService.php index 4a6c0325c9a1719c37bf404913e748615b7ce26e..84d04cc513f5e80902e7c79f85ba2a7f46902dcb 100644 GIT binary patch delta 731 zcmaKqF>ljA6o5H93FKn8&H=@>sy0MOq)RI@bU*^+1V^=$I>B)wkU%G=Tp|a@XB-Do z1_}%eEDZhuM63)TJXNZM#K_DJ5=e;Oz=E9+Q5uQy-Fxr5_r1IE_WRnqA1w2$68>ac zfcdf>%E?P$X&GjzLvWjpuxoY+9$1fvxEc0SuM(ga@R{aWbQ-2QmhBTyOy)o#U1Gn= zAZ%xz0Os&y@SPhmA5*~{eoI6nh}x76e7s8?-=j7jxMWvk1B$kSYy3)cqZDV$(_|yc zNiUO7IDUu_gdL06cd=vki3s95(K7%SOyBpc_RuHT-*bt`M2UrBF94~{n0|GRz9G*V zjHn*H01#PDq~TKA^eyU4G3*56{0E~RZJMB-M$^n3T^d0LVj{;DGDT~K*`J^0k9R$; zm##qWXpGLm#lLzFOnW#JKLfexPR%|YI{w6($?rh^U%6E%$%dh;rKX`^<5qoN!A-4E zSITNdRjvys5D(K@b4StDvRoBF99DFtv8^eMhQQ>@FgtIVhpVb)D0;nCl?}C~#oXgq z2vb#6Q)FEL(&uQwH-^O9Q$}t$<{tv)H5V=~K4-vTFwP#V-@XVXtLspY;GSvOxa|@1 zp5=7${kTbl(LPoPM!=K})kKeOorRsjO}BC|mSF#)rU2ATu`Rg)+SRkM-{fB^!p0h1IB zcmXz(jtw@m(GY|I0{IKGR}zK-0h5#76uGm(6=ehgkFzHls{;b*3$xT6uLJ?PvxFi# J0kh~M$^(t!C2Rly diff --git a/DiscoveryEngine/metadata/V1/SiteSearchEngineService.php b/DiscoveryEngine/metadata/V1/SiteSearchEngineService.php index 190cb1f40a19c06c94f907302f5a60d7ac04d310..9a1bc9de605154667014edc4df5c21e0c9e8d703 100644 GIT binary patch delta 83 zcmV-Z0IdJHP}oqg@&g2%ND4rct^_iXeGaoW1iJ|ingI$DQe|UuVRvj*a%q!+5@3^F p4iFv^910I}X>?^@V{&C=Wo~q7VQd%$AOR=|LIdDI0kdun%Nf3!8zcY# delta 51 zcmV-30L=f`P`OaB@&g3@M+!ibt^_iXeGaoW1iJ|hdsetLocation($formattedLocation); + + // Call the API and handle any network failures. + try { + /** @var GenerateGroundedContentResponse $response */ + $response = $groundedGenerationServiceClient->generateGroundedContent($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 +{ + $formattedLocation = GroundedGenerationServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + generate_grounded_content_sample($formattedLocation); +} +// [END discoveryengine_v1_generated_GroundedGenerationService_GenerateGroundedContent_sync] diff --git a/DiscoveryEngine/samples/V1/GroundedGenerationServiceClient/stream_generate_grounded_content.php b/DiscoveryEngine/samples/V1/GroundedGenerationServiceClient/stream_generate_grounded_content.php new file mode 100644 index 000000000000..ea57f6a63064 --- /dev/null +++ b/DiscoveryEngine/samples/V1/GroundedGenerationServiceClient/stream_generate_grounded_content.php @@ -0,0 +1,79 @@ +setLocation($formattedLocation); + + // Call the API and handle any network failures. + try { + /** @var BidiStream $stream */ + $stream = $groundedGenerationServiceClient->streamGenerateGroundedContent(); + $stream->writeAll([$request,]); + + /** @var GenerateGroundedContentResponse $element */ + foreach ($stream->closeWriteAndReadAll() as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedLocation = GroundedGenerationServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + stream_generate_grounded_content_sample($formattedLocation); +} +// [END discoveryengine_v1_generated_GroundedGenerationService_StreamGenerateGroundedContent_sync] diff --git a/DiscoveryEngine/samples/V1/RankServiceClient/rank.php b/DiscoveryEngine/samples/V1/RankServiceClient/rank.php index c827628b944d..41a011e4e30e 100644 --- a/DiscoveryEngine/samples/V1/RankServiceClient/rank.php +++ b/DiscoveryEngine/samples/V1/RankServiceClient/rank.php @@ -33,7 +33,7 @@ * Ranks a list of text records based on the given input query. * * @param string $formattedRankingConfig The resource name of the rank service config, such as - * `projects/{project_num}/locations/{location_id}/rankingConfigs/default_ranking_config`. Please see + * `projects/{project_num}/locations/{location}/rankingConfigs/default_ranking_config`. Please see * {@see RankServiceClient::rankingConfigName()} for help formatting this field. */ function rank_sample(string $formattedRankingConfig): void diff --git a/DiscoveryEngine/samples/V1/UserEventServiceClient/purge_user_events.php b/DiscoveryEngine/samples/V1/UserEventServiceClient/purge_user_events.php index d66083dd37ad..7e5de6f5ae7d 100644 --- a/DiscoveryEngine/samples/V1/UserEventServiceClient/purge_user_events.php +++ b/DiscoveryEngine/samples/V1/UserEventServiceClient/purge_user_events.php @@ -38,8 +38,8 @@ * * @param string $formattedParent The resource name of the catalog under which the events are * created. The format is - * `projects/{project}/locations/global/collections/{collection}/dataStores/{dataStore}` - * Please see {@see UserEventServiceClient::dataStoreName()} for help formatting this field. + * `projects/{project}/locations/global/collections/{collection}/dataStores/{dataStore}`. Please see + * {@see UserEventServiceClient::dataStoreName()} for help formatting this field. * @param string $filter The filter string to specify the events to be deleted with a * length limit of 5,000 characters. The eligible fields for filtering are: * diff --git a/DiscoveryEngine/src/V1/Answer/AnswerSkippedReason.php b/DiscoveryEngine/src/V1/Answer/AnswerSkippedReason.php index 4cf04de06fac..ef1da4f5f4bb 100644 --- a/DiscoveryEngine/src/V1/Answer/AnswerSkippedReason.php +++ b/DiscoveryEngine/src/V1/Answer/AnswerSkippedReason.php @@ -26,7 +26,8 @@ class AnswerSkippedReason */ const ADVERSARIAL_QUERY_IGNORED = 1; /** - * The non-answer seeking query ignored case. + * The non-answer seeking query ignored case + * Google skips the answer if the query is chit chat. * * Generated from protobuf enum NON_ANSWER_SEEKING_QUERY_IGNORED = 2; */ @@ -71,6 +72,13 @@ class AnswerSkippedReason * Generated from protobuf enum CUSTOMER_POLICY_VIOLATION = 7; */ const CUSTOMER_POLICY_VIOLATION = 7; + /** + * The non-answer seeking query ignored case. + * Google skips the answer if the query doesn't have clear intent. + * + * Generated from protobuf enum NON_ANSWER_SEEKING_QUERY_IGNORED_V2 = 8; + */ + const NON_ANSWER_SEEKING_QUERY_IGNORED_V2 = 8; private static $valueToName = [ self::ANSWER_SKIPPED_REASON_UNSPECIFIED => 'ANSWER_SKIPPED_REASON_UNSPECIFIED', @@ -81,6 +89,7 @@ class AnswerSkippedReason self::NO_RELEVANT_CONTENT => 'NO_RELEVANT_CONTENT', self::JAIL_BREAKING_QUERY_IGNORED => 'JAIL_BREAKING_QUERY_IGNORED', self::CUSTOMER_POLICY_VIOLATION => 'CUSTOMER_POLICY_VIOLATION', + self::NON_ANSWER_SEEKING_QUERY_IGNORED_V2 => 'NON_ANSWER_SEEKING_QUERY_IGNORED_V2', ]; public static function name($value) diff --git a/DiscoveryEngine/src/V1/Answer/QueryUnderstandingInfo/QueryClassificationInfo/Type.php b/DiscoveryEngine/src/V1/Answer/QueryUnderstandingInfo/QueryClassificationInfo/Type.php index 1e25779cc343..2359554eb2b2 100644 --- a/DiscoveryEngine/src/V1/Answer/QueryUnderstandingInfo/QueryClassificationInfo/Type.php +++ b/DiscoveryEngine/src/V1/Answer/QueryUnderstandingInfo/QueryClassificationInfo/Type.php @@ -26,7 +26,7 @@ class Type */ const ADVERSARIAL_QUERY = 1; /** - * Non-answer-seeking query classification type. + * Non-answer-seeking query classification type, for chit chat. * * Generated from protobuf enum NON_ANSWER_SEEKING_QUERY = 2; */ @@ -37,12 +37,19 @@ class Type * Generated from protobuf enum JAIL_BREAKING_QUERY = 3; */ const JAIL_BREAKING_QUERY = 3; + /** + * Non-answer-seeking query classification type, for no clear intent. + * + * Generated from protobuf enum NON_ANSWER_SEEKING_QUERY_V2 = 4; + */ + const NON_ANSWER_SEEKING_QUERY_V2 = 4; private static $valueToName = [ self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', self::ADVERSARIAL_QUERY => 'ADVERSARIAL_QUERY', self::NON_ANSWER_SEEKING_QUERY => 'NON_ANSWER_SEEKING_QUERY', self::JAIL_BREAKING_QUERY => 'JAIL_BREAKING_QUERY', + self::NON_ANSWER_SEEKING_QUERY_V2 => 'NON_ANSWER_SEEKING_QUERY_V2', ]; public static function name($value) diff --git a/DiscoveryEngine/src/V1/AnswerQueryRequest.php b/DiscoveryEngine/src/V1/AnswerQueryRequest.php index 56bead21686c..9b11d0f2349c 100644 --- a/DiscoveryEngine/src/V1/AnswerQueryRequest.php +++ b/DiscoveryEngine/src/V1/AnswerQueryRequest.php @@ -74,6 +74,8 @@ class AnswerQueryRequest extends \Google\Protobuf\Internal\Message */ protected $query_understanding_spec = null; /** + * Deprecated: This field is deprecated. Streaming Answer API will be + * supported. * Asynchronous mode control. * If enabled, the response will be returned with answer/session resource * name without final answer. The API users need to do the polling to get @@ -83,7 +85,8 @@ class AnswerQueryRequest extends \Google\Protobuf\Internal\Message * [ConversationalSearchService.GetSession][google.cloud.discoveryengine.v1.ConversationalSearchService.GetSession] * method. * - * Generated from protobuf field bool asynchronous_mode = 10; + * Generated from protobuf field bool asynchronous_mode = 10 [deprecated = true]; + * @deprecated */ protected $asynchronous_mode = false; /** @@ -150,6 +153,8 @@ class AnswerQueryRequest extends \Google\Protobuf\Internal\Message * @type \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\QueryUnderstandingSpec $query_understanding_spec * Query understanding specification. * @type bool $asynchronous_mode + * Deprecated: This field is deprecated. Streaming Answer API will be + * supported. * Asynchronous mode control. * If enabled, the response will be returned with answer/session resource * name without final answer. The API users need to do the polling to get @@ -474,6 +479,8 @@ public function setQueryUnderstandingSpec($var) } /** + * Deprecated: This field is deprecated. Streaming Answer API will be + * supported. * Asynchronous mode control. * If enabled, the response will be returned with answer/session resource * name without final answer. The API users need to do the polling to get @@ -483,15 +490,19 @@ public function setQueryUnderstandingSpec($var) * [ConversationalSearchService.GetSession][google.cloud.discoveryengine.v1.ConversationalSearchService.GetSession] * method. * - * Generated from protobuf field bool asynchronous_mode = 10; + * Generated from protobuf field bool asynchronous_mode = 10 [deprecated = true]; * @return bool + * @deprecated */ public function getAsynchronousMode() { + @trigger_error('asynchronous_mode is deprecated.', E_USER_DEPRECATED); return $this->asynchronous_mode; } /** + * Deprecated: This field is deprecated. Streaming Answer API will be + * supported. * Asynchronous mode control. * If enabled, the response will be returned with answer/session resource * name without final answer. The API users need to do the polling to get @@ -501,12 +512,14 @@ public function getAsynchronousMode() * [ConversationalSearchService.GetSession][google.cloud.discoveryengine.v1.ConversationalSearchService.GetSession] * method. * - * Generated from protobuf field bool asynchronous_mode = 10; + * Generated from protobuf field bool asynchronous_mode = 10 [deprecated = true]; * @param bool $var * @return $this + * @deprecated */ public function setAsynchronousMode($var) { + @trigger_error('asynchronous_mode is deprecated.', E_USER_DEPRECATED); GPBUtil::checkBool($var); $this->asynchronous_mode = $var; diff --git a/DiscoveryEngine/src/V1/AnswerQueryRequest/AnswerGenerationSpec.php b/DiscoveryEngine/src/V1/AnswerQueryRequest/AnswerGenerationSpec.php index 0bd500071a5d..fbc6526be641 100644 --- a/DiscoveryEngine/src/V1/AnswerQueryRequest/AnswerGenerationSpec.php +++ b/DiscoveryEngine/src/V1/AnswerQueryRequest/AnswerGenerationSpec.php @@ -77,6 +77,21 @@ class AnswerGenerationSpec extends \Google\Protobuf\Internal\Message * Generated from protobuf field optional bool ignore_low_relevant_content = 7; */ protected $ignore_low_relevant_content = null; + /** + * Optional. Specifies whether to filter out jail-breaking queries. The + * default value is `false`. + * Google employs search-query classification to detect jail-breaking + * queries. No summary is returned if the search query is classified as a + * jail-breaking query. A user might add instructions to the query to + * change the tone, style, language, content of the answer, or ask the + * model to act as a different entity, e.g. "Reply in the tone of a + * competing company's CEO". If this field is set to `true`, we skip + * generating summaries for jail-breaking queries and return fallback + * messages instead. + * + * Generated from protobuf field bool ignore_jail_breaking_query = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ignore_jail_breaking_query = false; /** * Constructor. @@ -118,6 +133,17 @@ class AnswerGenerationSpec extends \Google\Protobuf\Internal\Message * If this field is set to `false`, all search results are used regardless * of relevance to generate answers. If set to `true` or unset, the behavior * will be determined automatically by the service. + * @type bool $ignore_jail_breaking_query + * Optional. Specifies whether to filter out jail-breaking queries. The + * default value is `false`. + * Google employs search-query classification to detect jail-breaking + * queries. No summary is returned if the search query is classified as a + * jail-breaking query. A user might add instructions to the query to + * change the tone, style, language, content of the answer, or ask the + * model to act as a different entity, e.g. "Reply in the tone of a + * competing company's CEO". If this field is set to `true`, we skip + * generating summaries for jail-breaking queries and return fallback + * messages instead. * } */ public function __construct($data = NULL) { @@ -377,6 +403,50 @@ public function setIgnoreLowRelevantContent($var) return $this; } + /** + * Optional. Specifies whether to filter out jail-breaking queries. The + * default value is `false`. + * Google employs search-query classification to detect jail-breaking + * queries. No summary is returned if the search query is classified as a + * jail-breaking query. A user might add instructions to the query to + * change the tone, style, language, content of the answer, or ask the + * model to act as a different entity, e.g. "Reply in the tone of a + * competing company's CEO". If this field is set to `true`, we skip + * generating summaries for jail-breaking queries and return fallback + * messages instead. + * + * Generated from protobuf field bool ignore_jail_breaking_query = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getIgnoreJailBreakingQuery() + { + return $this->ignore_jail_breaking_query; + } + + /** + * Optional. Specifies whether to filter out jail-breaking queries. The + * default value is `false`. + * Google employs search-query classification to detect jail-breaking + * queries. No summary is returned if the search query is classified as a + * jail-breaking query. A user might add instructions to the query to + * change the tone, style, language, content of the answer, or ask the + * model to act as a different entity, e.g. "Reply in the tone of a + * competing company's CEO". If this field is set to `true`, we skip + * generating summaries for jail-breaking queries and return fallback + * messages instead. + * + * Generated from protobuf field bool ignore_jail_breaking_query = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setIgnoreJailBreakingQuery($var) + { + GPBUtil::checkBool($var); + $this->ignore_jail_breaking_query = $var; + + return $this; + } + } diff --git a/DiscoveryEngine/src/V1/AnswerQueryRequest/QueryUnderstandingSpec/QueryClassificationSpec/Type.php b/DiscoveryEngine/src/V1/AnswerQueryRequest/QueryUnderstandingSpec/QueryClassificationSpec/Type.php index 145547c22087..3e762d2414b8 100644 --- a/DiscoveryEngine/src/V1/AnswerQueryRequest/QueryUnderstandingSpec/QueryClassificationSpec/Type.php +++ b/DiscoveryEngine/src/V1/AnswerQueryRequest/QueryUnderstandingSpec/QueryClassificationSpec/Type.php @@ -26,7 +26,7 @@ class Type */ const ADVERSARIAL_QUERY = 1; /** - * Non-answer-seeking query classification type. + * Non-answer-seeking query classification type, for chit chat. * * Generated from protobuf enum NON_ANSWER_SEEKING_QUERY = 2; */ @@ -37,12 +37,19 @@ class Type * Generated from protobuf enum JAIL_BREAKING_QUERY = 3; */ const JAIL_BREAKING_QUERY = 3; + /** + * Non-answer-seeking query classification type, for no clear intent. + * + * Generated from protobuf enum NON_ANSWER_SEEKING_QUERY_V2 = 4; + */ + const NON_ANSWER_SEEKING_QUERY_V2 = 4; private static $valueToName = [ self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', self::ADVERSARIAL_QUERY => 'ADVERSARIAL_QUERY', self::NON_ANSWER_SEEKING_QUERY => 'NON_ANSWER_SEEKING_QUERY', self::JAIL_BREAKING_QUERY => 'JAIL_BREAKING_QUERY', + self::NON_ANSWER_SEEKING_QUERY_V2 => 'NON_ANSWER_SEEKING_QUERY_V2', ]; public static function name($value) diff --git a/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult/ChunkInfo.php b/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult/ChunkInfo.php index b35fda5b1b26..c26ca5b29b05 100644 --- a/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult/ChunkInfo.php +++ b/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult/ChunkInfo.php @@ -27,6 +27,12 @@ class ChunkInfo extends \Google\Protobuf\Internal\Message * Generated from protobuf field string content = 2; */ protected $content = ''; + /** + * Metadata of the document from the current chunk. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.ChunkInfo.DocumentMetadata document_metadata = 4; + */ + protected $document_metadata = null; /** * Constructor. @@ -38,6 +44,8 @@ class ChunkInfo extends \Google\Protobuf\Internal\Message * Chunk resource name. * @type string $content * Chunk textual content. + * @type \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec\SearchResultList\SearchResult\ChunkInfo\DocumentMetadata $document_metadata + * Metadata of the document from the current chunk. * } */ public function __construct($data = NULL) { @@ -97,6 +105,42 @@ public function setContent($var) return $this; } + /** + * Metadata of the document from the current chunk. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.ChunkInfo.DocumentMetadata document_metadata = 4; + * @return \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec\SearchResultList\SearchResult\ChunkInfo\DocumentMetadata|null + */ + public function getDocumentMetadata() + { + return $this->document_metadata; + } + + public function hasDocumentMetadata() + { + return isset($this->document_metadata); + } + + public function clearDocumentMetadata() + { + unset($this->document_metadata); + } + + /** + * Metadata of the document from the current chunk. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.ChunkInfo.DocumentMetadata document_metadata = 4; + * @param \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec\SearchResultList\SearchResult\ChunkInfo\DocumentMetadata $var + * @return $this + */ + public function setDocumentMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec\SearchResultList\SearchResult\ChunkInfo\DocumentMetadata::class); + $this->document_metadata = $var; + + return $this; + } + } diff --git a/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult/ChunkInfo/DocumentMetadata.php b/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult/ChunkInfo/DocumentMetadata.php new file mode 100644 index 000000000000..0f7227b608b8 --- /dev/null +++ b/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult/ChunkInfo/DocumentMetadata.php @@ -0,0 +1,103 @@ +google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.ChunkInfo.DocumentMetadata + */ +class DocumentMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Uri of the document. + * + * Generated from protobuf field string uri = 1; + */ + protected $uri = ''; + /** + * Title of the document. + * + * Generated from protobuf field string title = 2; + */ + protected $title = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * Uri of the document. + * @type string $title + * Title of the document. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\ConversationalSearchService::initOnce(); + parent::__construct($data); + } + + /** + * Uri of the document. + * + * Generated from protobuf field string uri = 1; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * Uri of the document. + * + * Generated from protobuf field string uri = 1; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + + /** + * Title of the document. + * + * Generated from protobuf field string title = 2; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Title of the document. + * + * Generated from protobuf field string title = 2; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult/UnstructuredDocumentInfo.php b/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult/UnstructuredDocumentInfo.php index 532d17bbfe72..e19d82364cfe 100644 --- a/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult/UnstructuredDocumentInfo.php +++ b/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult/UnstructuredDocumentInfo.php @@ -34,7 +34,9 @@ class UnstructuredDocumentInfo extends \Google\Protobuf\Internal\Message */ protected $title = ''; /** - * List of document contexts. + * List of document contexts. The content will be used for Answer + * Generation. This is supposed to be the main content of the document + * that can be long and comprehensive. * * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.UnstructuredDocumentInfo.DocumentContext document_contexts = 4; */ @@ -46,9 +48,13 @@ class UnstructuredDocumentInfo extends \Google\Protobuf\Internal\Message */ private $extractive_segments; /** + * Deprecated: This field is deprecated and will have no effect on + * the Answer generation. + * Please use document_contexts and extractive_segments fields. * List of extractive answers. * - * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.UnstructuredDocumentInfo.ExtractiveAnswer extractive_answers = 6; + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.UnstructuredDocumentInfo.ExtractiveAnswer extractive_answers = 6 [deprecated = true]; + * @deprecated */ private $extractive_answers; @@ -65,10 +71,15 @@ class UnstructuredDocumentInfo extends \Google\Protobuf\Internal\Message * @type string $title * Title. * @type array<\Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec\SearchResultList\SearchResult\UnstructuredDocumentInfo\DocumentContext>|\Google\Protobuf\Internal\RepeatedField $document_contexts - * List of document contexts. + * List of document contexts. The content will be used for Answer + * Generation. This is supposed to be the main content of the document + * that can be long and comprehensive. * @type array<\Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec\SearchResultList\SearchResult\UnstructuredDocumentInfo\ExtractiveSegment>|\Google\Protobuf\Internal\RepeatedField $extractive_segments * List of extractive segments. * @type array<\Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec\SearchResultList\SearchResult\UnstructuredDocumentInfo\ExtractiveAnswer>|\Google\Protobuf\Internal\RepeatedField $extractive_answers + * Deprecated: This field is deprecated and will have no effect on + * the Answer generation. + * Please use document_contexts and extractive_segments fields. * List of extractive answers. * } */ @@ -156,7 +167,9 @@ public function setTitle($var) } /** - * List of document contexts. + * List of document contexts. The content will be used for Answer + * Generation. This is supposed to be the main content of the document + * that can be long and comprehensive. * * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.UnstructuredDocumentInfo.DocumentContext document_contexts = 4; * @return \Google\Protobuf\Internal\RepeatedField @@ -167,7 +180,9 @@ public function getDocumentContexts() } /** - * List of document contexts. + * List of document contexts. The content will be used for Answer + * Generation. This is supposed to be the main content of the document + * that can be long and comprehensive. * * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.UnstructuredDocumentInfo.DocumentContext document_contexts = 4; * @param array<\Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec\SearchResultList\SearchResult\UnstructuredDocumentInfo\DocumentContext>|\Google\Protobuf\Internal\RepeatedField $var @@ -208,25 +223,35 @@ public function setExtractiveSegments($var) } /** + * Deprecated: This field is deprecated and will have no effect on + * the Answer generation. + * Please use document_contexts and extractive_segments fields. * List of extractive answers. * - * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.UnstructuredDocumentInfo.ExtractiveAnswer extractive_answers = 6; + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.UnstructuredDocumentInfo.ExtractiveAnswer extractive_answers = 6 [deprecated = true]; * @return \Google\Protobuf\Internal\RepeatedField + * @deprecated */ public function getExtractiveAnswers() { + @trigger_error('extractive_answers is deprecated.', E_USER_DEPRECATED); return $this->extractive_answers; } /** + * Deprecated: This field is deprecated and will have no effect on + * the Answer generation. + * Please use document_contexts and extractive_segments fields. * List of extractive answers. * - * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.UnstructuredDocumentInfo.ExtractiveAnswer extractive_answers = 6; + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.UnstructuredDocumentInfo.ExtractiveAnswer extractive_answers = 6 [deprecated = true]; * @param array<\Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec\SearchResultList\SearchResult\UnstructuredDocumentInfo\ExtractiveAnswer>|\Google\Protobuf\Internal\RepeatedField $var * @return $this + * @deprecated */ public function setExtractiveAnswers($var) { + @trigger_error('extractive_answers is deprecated.', E_USER_DEPRECATED); $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\SearchSpec\SearchResultList\SearchResult\UnstructuredDocumentInfo\ExtractiveAnswer::class); $this->extractive_answers = $arr; diff --git a/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult/UnstructuredDocumentInfo/DocumentContext.php b/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult/UnstructuredDocumentInfo/DocumentContext.php index 6c15269c9a25..36d3af1a6faa 100644 --- a/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult/UnstructuredDocumentInfo/DocumentContext.php +++ b/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult/UnstructuredDocumentInfo/DocumentContext.php @@ -22,7 +22,7 @@ class DocumentContext extends \Google\Protobuf\Internal\Message */ protected $page_identifier = ''; /** - * Document content. + * Document content to be used for answer generation. * * Generated from protobuf field string content = 2; */ @@ -37,7 +37,7 @@ class DocumentContext extends \Google\Protobuf\Internal\Message * @type string $page_identifier * Page identifier. * @type string $content - * Document content. + * Document content to be used for answer generation. * } */ public function __construct($data = NULL) { @@ -72,7 +72,7 @@ public function setPageIdentifier($var) } /** - * Document content. + * Document content to be used for answer generation. * * Generated from protobuf field string content = 2; * @return string @@ -83,7 +83,7 @@ public function getContent() } /** - * Document content. + * Document content to be used for answer generation. * * Generated from protobuf field string content = 2; * @param string $var diff --git a/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult/UnstructuredDocumentInfo/ExtractiveSegment.php b/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult/UnstructuredDocumentInfo/ExtractiveSegment.php index 4857b57330d6..5cd3964e36f9 100644 --- a/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult/UnstructuredDocumentInfo/ExtractiveSegment.php +++ b/DiscoveryEngine/src/V1/AnswerQueryRequest/SearchSpec/SearchResultList/SearchResult/UnstructuredDocumentInfo/ExtractiveSegment.php @@ -11,6 +11,8 @@ /** * Extractive segment. * [Guide](https://cloud.google.com/generative-ai-app-builder/docs/snippets#extractive-segments) + * Answer generation will only use it if document_contexts is empty. + * This is supposed to be shorter snippets. * * Generated from protobuf message google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.UnstructuredDocumentInfo.ExtractiveSegment */ diff --git a/DiscoveryEngine/src/V1/BatchGetDocumentsMetadataRequest/FhirMatcher.php b/DiscoveryEngine/src/V1/BatchGetDocumentsMetadataRequest/FhirMatcher.php new file mode 100644 index 000000000000..6d5544b6fc57 --- /dev/null +++ b/DiscoveryEngine/src/V1/BatchGetDocumentsMetadataRequest/FhirMatcher.php @@ -0,0 +1,77 @@ +google.cloud.discoveryengine.v1.BatchGetDocumentsMetadataRequest.FhirMatcher + */ +class FhirMatcher extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The FHIR resources to match by. + * Format: + * projects/{project}/locations/{location}/datasets/{dataset}/fhirStores/{fhir_store}/fhir/{resource_type}/{fhir_resource_id} + * + * Generated from protobuf field repeated string fhir_resources = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $fhir_resources; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $fhir_resources + * Required. The FHIR resources to match by. + * Format: + * projects/{project}/locations/{location}/datasets/{dataset}/fhirStores/{fhir_store}/fhir/{resource_type}/{fhir_resource_id} + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\DocumentService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The FHIR resources to match by. + * Format: + * projects/{project}/locations/{location}/datasets/{dataset}/fhirStores/{fhir_store}/fhir/{resource_type}/{fhir_resource_id} + * + * Generated from protobuf field repeated string fhir_resources = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFhirResources() + { + return $this->fhir_resources; + } + + /** + * Required. The FHIR resources to match by. + * Format: + * projects/{project}/locations/{location}/datasets/{dataset}/fhirStores/{fhir_store}/fhir/{resource_type}/{fhir_resource_id} + * + * Generated from protobuf field repeated string fhir_resources = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFhirResources($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->fhir_resources = $arr; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/BatchGetDocumentsMetadataRequest/Matcher.php b/DiscoveryEngine/src/V1/BatchGetDocumentsMetadataRequest/Matcher.php index 4b2170341859..837f67795cc6 100644 --- a/DiscoveryEngine/src/V1/BatchGetDocumentsMetadataRequest/Matcher.php +++ b/DiscoveryEngine/src/V1/BatchGetDocumentsMetadataRequest/Matcher.php @@ -26,6 +26,8 @@ class Matcher extends \Google\Protobuf\Internal\Message * * @type \Google\Cloud\DiscoveryEngine\V1\BatchGetDocumentsMetadataRequest\UrisMatcher $uris_matcher * Matcher by exact URIs. + * @type \Google\Cloud\DiscoveryEngine\V1\BatchGetDocumentsMetadataRequest\FhirMatcher $fhir_matcher + * Matcher by FHIR resource names. * } */ public function __construct($data = NULL) { @@ -64,6 +66,37 @@ public function setUrisMatcher($var) return $this; } + /** + * Matcher by FHIR resource names. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.BatchGetDocumentsMetadataRequest.FhirMatcher fhir_matcher = 2; + * @return \Google\Cloud\DiscoveryEngine\V1\BatchGetDocumentsMetadataRequest\FhirMatcher|null + */ + public function getFhirMatcher() + { + return $this->readOneof(2); + } + + public function hasFhirMatcher() + { + return $this->hasOneof(2); + } + + /** + * Matcher by FHIR resource names. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.BatchGetDocumentsMetadataRequest.FhirMatcher fhir_matcher = 2; + * @param \Google\Cloud\DiscoveryEngine\V1\BatchGetDocumentsMetadataRequest\FhirMatcher $var + * @return $this + */ + public function setFhirMatcher($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\BatchGetDocumentsMetadataRequest\FhirMatcher::class); + $this->writeOneof(2, $var); + + return $this; + } + /** * @return string */ diff --git a/DiscoveryEngine/src/V1/BatchGetDocumentsMetadataResponse/DocumentMetadata/MatcherValue.php b/DiscoveryEngine/src/V1/BatchGetDocumentsMetadataResponse/DocumentMetadata/MatcherValue.php index 4cdaea6507df..214dde886286 100644 --- a/DiscoveryEngine/src/V1/BatchGetDocumentsMetadataResponse/DocumentMetadata/MatcherValue.php +++ b/DiscoveryEngine/src/V1/BatchGetDocumentsMetadataResponse/DocumentMetadata/MatcherValue.php @@ -27,6 +27,9 @@ class MatcherValue extends \Google\Protobuf\Internal\Message * @type string $uri * If match by URI, the URI of the * [Document][google.cloud.discoveryengine.v1.Document]. + * @type string $fhir_resource + * Required. Format: + * projects/{project}/locations/{location}/datasets/{dataset}/fhirStores/{fhir_store}/fhir/{resource_type}/{fhir_resource_id} * } */ public function __construct($data = NULL) { @@ -67,6 +70,39 @@ public function setUri($var) return $this; } + /** + * Required. Format: + * projects/{project}/locations/{location}/datasets/{dataset}/fhirStores/{fhir_store}/fhir/{resource_type}/{fhir_resource_id} + * + * Generated from protobuf field string fhir_resource = 2 [(.google.api.resource_reference) = { + * @return string + */ + public function getFhirResource() + { + return $this->readOneof(2); + } + + public function hasFhirResource() + { + return $this->hasOneof(2); + } + + /** + * Required. Format: + * projects/{project}/locations/{location}/datasets/{dataset}/fhirStores/{fhir_store}/fhir/{resource_type}/{fhir_resource_id} + * + * Generated from protobuf field string fhir_resource = 2 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setFhirResource($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + /** * @return string */ diff --git a/DiscoveryEngine/src/V1/Client/DocumentServiceClient.php b/DiscoveryEngine/src/V1/Client/DocumentServiceClient.php index fc2a8721ac4f..c51bd037fcde 100644 --- a/DiscoveryEngine/src/V1/Client/DocumentServiceClient.php +++ b/DiscoveryEngine/src/V1/Client/DocumentServiceClient.php @@ -216,6 +216,37 @@ public static function documentName( ]); } + /** + * Formats a string containing the fully-qualified path to represent a + * fhir_resource resource. + * + * @param string $project + * @param string $location + * @param string $dataset + * @param string $fhirStore + * @param string $resourceType + * @param string $fhirResourceId + * + * @return string The formatted fhir_resource resource. + */ + public static function fhirResourceName( + string $project, + string $location, + string $dataset, + string $fhirStore, + string $resourceType, + string $fhirResourceId + ): string { + return self::getPathTemplate('fhirResource')->render([ + 'project' => $project, + 'location' => $location, + 'dataset' => $dataset, + 'fhir_store' => $fhirStore, + 'resource_type' => $resourceType, + 'fhir_resource_id' => $fhirResourceId, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a fhir_store * resource. @@ -355,6 +386,7 @@ public static function projectLocationDataStoreBranchDocumentName( * Template: Pattern * - branch: projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch} * - document: projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document} + * - fhirResource: projects/{project}/locations/{location}/datasets/{dataset}/fhirStores/{fhir_store}/fhir/{resource_type}/{fhir_resource_id} * - fhirStore: projects/{project}/locations/{location}/datasets/{dataset}/fhirStores/{fhir_store} * - projectLocationCollectionDataStoreBranch: projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch} * - projectLocationCollectionDataStoreBranchDocument: projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document} diff --git a/DiscoveryEngine/src/V1/Client/GroundedGenerationServiceClient.php b/DiscoveryEngine/src/V1/Client/GroundedGenerationServiceClient.php index 85d09fe3c447..3db7e4412924 100644 --- a/DiscoveryEngine/src/V1/Client/GroundedGenerationServiceClient.php +++ b/DiscoveryEngine/src/V1/Client/GroundedGenerationServiceClient.php @@ -25,6 +25,7 @@ namespace Google\Cloud\DiscoveryEngine\V1\Client; use Google\ApiCore\ApiException; +use Google\ApiCore\BidiStream; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; use Google\ApiCore\ResourceHelperTrait; @@ -34,6 +35,8 @@ use Google\Auth\FetchAuthTokenInterface; use Google\Cloud\DiscoveryEngine\V1\CheckGroundingRequest; use Google\Cloud\DiscoveryEngine\V1\CheckGroundingResponse; +use Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentRequest; +use Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse; use GuzzleHttp\Promise\PromiseInterface; /** @@ -48,6 +51,7 @@ * contained within formatted names that are returned by the API. * * @method PromiseInterface checkGroundingAsync(CheckGroundingRequest $request, array $optionalArgs = []) + * @method PromiseInterface generateGroundedContentAsync(GenerateGroundedContentRequest $request, array $optionalArgs = []) */ final class GroundedGenerationServiceClient { @@ -115,11 +119,139 @@ public static function groundingConfigName(string $project, string $location, st ]); } + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_collection_data_store_serving_config resource. + * + * @param string $project + * @param string $location + * @param string $collection + * @param string $dataStore + * @param string $servingConfig + * + * @return string The formatted project_location_collection_data_store_serving_config resource. + */ + public static function projectLocationCollectionDataStoreServingConfigName( + string $project, + string $location, + string $collection, + string $dataStore, + string $servingConfig + ): string { + return self::getPathTemplate('projectLocationCollectionDataStoreServingConfig')->render([ + 'project' => $project, + 'location' => $location, + 'collection' => $collection, + 'data_store' => $dataStore, + 'serving_config' => $servingConfig, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_collection_engine_serving_config resource. + * + * @param string $project + * @param string $location + * @param string $collection + * @param string $engine + * @param string $servingConfig + * + * @return string The formatted project_location_collection_engine_serving_config resource. + */ + public static function projectLocationCollectionEngineServingConfigName( + string $project, + string $location, + string $collection, + string $engine, + string $servingConfig + ): string { + return self::getPathTemplate('projectLocationCollectionEngineServingConfig')->render([ + 'project' => $project, + 'location' => $location, + 'collection' => $collection, + 'engine' => $engine, + 'serving_config' => $servingConfig, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_data_store_serving_config resource. + * + * @param string $project + * @param string $location + * @param string $dataStore + * @param string $servingConfig + * + * @return string The formatted project_location_data_store_serving_config resource. + */ + public static function projectLocationDataStoreServingConfigName( + string $project, + string $location, + string $dataStore, + string $servingConfig + ): string { + return self::getPathTemplate('projectLocationDataStoreServingConfig')->render([ + 'project' => $project, + 'location' => $location, + 'data_store' => $dataStore, + 'serving_config' => $servingConfig, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * serving_config resource. + * + * @param string $project + * @param string $location + * @param string $dataStore + * @param string $servingConfig + * + * @return string The formatted serving_config resource. + */ + public static function servingConfigName( + string $project, + string $location, + string $dataStore, + string $servingConfig + ): string { + return self::getPathTemplate('servingConfig')->render([ + 'project' => $project, + 'location' => $location, + 'data_store' => $dataStore, + 'serving_config' => $servingConfig, + ]); + } + /** * Parses a formatted name string and returns an associative array of the components in the name. * The following name formats are supported: * Template: Pattern * - groundingConfig: projects/{project}/locations/{location}/groundingConfigs/{grounding_config} + * - location: projects/{project}/locations/{location} + * - projectLocationCollectionDataStoreServingConfig: projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config} + * - projectLocationCollectionEngineServingConfig: projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/servingConfigs/{serving_config} + * - projectLocationDataStoreServingConfig: projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config} + * - servingConfig: projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config} * * 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 @@ -236,4 +368,54 @@ public function checkGrounding(CheckGroundingRequest $request, array $callOption { return $this->startApiCall('CheckGrounding', $request, $callOptions)->wait(); } + + /** + * Generates grounded content. + * + * The async variant is + * {@see GroundedGenerationServiceClient::generateGroundedContentAsync()} . + * + * @example samples/V1/GroundedGenerationServiceClient/generate_grounded_content.php + * + * @param GenerateGroundedContentRequest $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 GenerateGroundedContentResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function generateGroundedContent( + GenerateGroundedContentRequest $request, + array $callOptions = [] + ): GenerateGroundedContentResponse { + return $this->startApiCall('GenerateGroundedContent', $request, $callOptions)->wait(); + } + + /** + * Generates grounded content in a streaming fashion. + * + * @example samples/V1/GroundedGenerationServiceClient/stream_generate_grounded_content.php + * + * @param array $callOptions { + * Optional. + * + * @type int $timeoutMillis + * Timeout to use for this call. + * } + * + * @return BidiStream + * + * @throws ApiException Thrown if the API call fails. + */ + public function streamGenerateGroundedContent(array $callOptions = []): BidiStream + { + return $this->startApiCall('StreamGenerateGroundedContent', null, $callOptions); + } } diff --git a/DiscoveryEngine/src/V1/ConverseConversationRequest.php b/DiscoveryEngine/src/V1/ConverseConversationRequest.php index 77e933fd05aa..46ba1bb88e60 100644 --- a/DiscoveryEngine/src/V1/ConverseConversationRequest.php +++ b/DiscoveryEngine/src/V1/ConverseConversationRequest.php @@ -19,9 +19,9 @@ class ConverseConversationRequest extends \Google\Protobuf\Internal\Message { /** * Required. The resource name of the Conversation to get. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`. + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`. * Use - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/-` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/-` * to activate auto session mode, which automatically creates a new * conversation inside a ConverseConversation session. * @@ -36,7 +36,7 @@ class ConverseConversationRequest extends \Google\Protobuf\Internal\Message protected $query = null; /** * The resource name of the Serving Config to use. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}` * If this is not set, the default serving config will be used. * * Generated from protobuf field string serving_config = 3 [(.google.api.resource_reference) = { @@ -111,9 +111,9 @@ class ConverseConversationRequest extends \Google\Protobuf\Internal\Message /** * @param string $name Required. The resource name of the Conversation to get. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`. + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`. * Use - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/-` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/-` * to activate auto session mode, which automatically creates a new * conversation inside a ConverseConversation session. Please see * {@see ConversationalSearchServiceClient::conversationName()} for help formatting this field. @@ -138,16 +138,16 @@ public static function build(string $name, \Google\Cloud\DiscoveryEngine\V1\Text * * @type string $name * Required. The resource name of the Conversation to get. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`. + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`. * Use - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/-` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/-` * to activate auto session mode, which automatically creates a new * conversation inside a ConverseConversation session. * @type \Google\Cloud\DiscoveryEngine\V1\TextInput $query * Required. Current user input. * @type string $serving_config * The resource name of the Serving Config to use. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}` * If this is not set, the default serving config will be used. * @type \Google\Cloud\DiscoveryEngine\V1\Conversation $conversation * The conversation to be used by auto session only. The name field will be @@ -200,9 +200,9 @@ public function __construct($data = NULL) { /** * Required. The resource name of the Conversation to get. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`. + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`. * Use - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/-` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/-` * to activate auto session mode, which automatically creates a new * conversation inside a ConverseConversation session. * @@ -216,9 +216,9 @@ public function getName() /** * Required. The resource name of the Conversation to get. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`. + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`. * Use - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/-` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/-` * to activate auto session mode, which automatically creates a new * conversation inside a ConverseConversation session. * @@ -272,7 +272,7 @@ public function setQuery($var) /** * The resource name of the Serving Config to use. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}` * If this is not set, the default serving config will be used. * * Generated from protobuf field string serving_config = 3 [(.google.api.resource_reference) = { @@ -285,7 +285,7 @@ public function getServingConfig() /** * The resource name of the Serving Config to use. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}` * If this is not set, the default serving config will be used. * * Generated from protobuf field string serving_config = 3 [(.google.api.resource_reference) = { diff --git a/DiscoveryEngine/src/V1/CreateControlRequest.php b/DiscoveryEngine/src/V1/CreateControlRequest.php index 98ecea4bb311..723fe141d957 100644 --- a/DiscoveryEngine/src/V1/CreateControlRequest.php +++ b/DiscoveryEngine/src/V1/CreateControlRequest.php @@ -17,9 +17,9 @@ class CreateControlRequest extends \Google\Protobuf\Internal\Message { /** * Required. Full resource name of parent data store. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}` + * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}` * or - * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`. + * `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -42,9 +42,9 @@ class CreateControlRequest extends \Google\Protobuf\Internal\Message /** * @param string $parent Required. Full resource name of parent data store. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}` + * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}` * or - * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`. Please see + * `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. Please see * {@see ControlServiceClient::dataStoreName()} for help formatting this field. * @param \Google\Cloud\DiscoveryEngine\V1\Control $control Required. The Control to create. * @param string $controlId Required. The ID to use for the Control, which will become the final @@ -73,9 +73,9 @@ public static function build(string $parent, \Google\Cloud\DiscoveryEngine\V1\Co * * @type string $parent * Required. Full resource name of parent data store. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}` + * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}` * or - * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`. + * `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. * @type \Google\Cloud\DiscoveryEngine\V1\Control $control * Required. The Control to create. * @type string $control_id @@ -92,9 +92,9 @@ public function __construct($data = NULL) { /** * Required. Full resource name of parent data store. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}` + * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}` * or - * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`. + * `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -106,9 +106,9 @@ public function getParent() /** * Required. Full resource name of parent data store. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}` + * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}` * or - * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`. + * `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/DiscoveryEngine/src/V1/CreateConversationRequest.php b/DiscoveryEngine/src/V1/CreateConversationRequest.php index b0fa4f4ed674..541c714940dd 100644 --- a/DiscoveryEngine/src/V1/CreateConversationRequest.php +++ b/DiscoveryEngine/src/V1/CreateConversationRequest.php @@ -17,7 +17,7 @@ class CreateConversationRequest extends \Google\Protobuf\Internal\Message { /** * Required. Full resource name of parent data store. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -31,7 +31,7 @@ class CreateConversationRequest extends \Google\Protobuf\Internal\Message /** * @param string $parent Required. Full resource name of parent data store. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` * Please see {@see ConversationalSearchServiceClient::dataStoreName()} for help formatting this field. * @param \Google\Cloud\DiscoveryEngine\V1\Conversation $conversation Required. The conversation to create. * @@ -54,7 +54,7 @@ public static function build(string $parent, \Google\Cloud\DiscoveryEngine\V1\Co * * @type string $parent * Required. Full resource name of parent data store. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` * @type \Google\Cloud\DiscoveryEngine\V1\Conversation $conversation * Required. The conversation to create. * } @@ -66,7 +66,7 @@ public function __construct($data = NULL) { /** * Required. Full resource name of parent data store. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -78,7 +78,7 @@ public function getParent() /** * Required. Full resource name of parent data store. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/DiscoveryEngine/src/V1/CreateSessionRequest.php b/DiscoveryEngine/src/V1/CreateSessionRequest.php index 068ad30fa60c..297971632e1f 100644 --- a/DiscoveryEngine/src/V1/CreateSessionRequest.php +++ b/DiscoveryEngine/src/V1/CreateSessionRequest.php @@ -17,7 +17,7 @@ class CreateSessionRequest extends \Google\Protobuf\Internal\Message { /** * Required. Full resource name of parent data store. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -31,7 +31,7 @@ class CreateSessionRequest extends \Google\Protobuf\Internal\Message /** * @param string $parent Required. Full resource name of parent data store. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` * Please see {@see ConversationalSearchServiceClient::dataStoreName()} for help formatting this field. * @param \Google\Cloud\DiscoveryEngine\V1\Session $session Required. The session to create. * @@ -54,7 +54,7 @@ public static function build(string $parent, \Google\Cloud\DiscoveryEngine\V1\Se * * @type string $parent * Required. Full resource name of parent data store. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` * @type \Google\Cloud\DiscoveryEngine\V1\Session $session * Required. The session to create. * } @@ -66,7 +66,7 @@ public function __construct($data = NULL) { /** * Required. Full resource name of parent data store. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -78,7 +78,7 @@ public function getParent() /** * Required. Full resource name of parent data store. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/DiscoveryEngine/src/V1/CustomTuningModel.php b/DiscoveryEngine/src/V1/CustomTuningModel.php index 2af5c01b2139..4f939490e339 100644 --- a/DiscoveryEngine/src/V1/CustomTuningModel.php +++ b/DiscoveryEngine/src/V1/CustomTuningModel.php @@ -18,8 +18,8 @@ class CustomTuningModel extends \Google\Protobuf\Internal\Message /** * Required. The fully qualified resource name of the model. * Format: - * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/customTuningModels/{custom_tuning_model}` - * model must be an alpha-numerical string with limit of 40 characters. + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/customTuningModels/{custom_tuning_model}`. + * Model must be an alpha-numerical string with limit of 40 characters. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -43,7 +43,7 @@ class CustomTuningModel extends \Google\Protobuf\Internal\Message */ protected $model_state = 0; /** - * Deprecated: timestamp the Model was created at. + * Deprecated: Timestamp the Model was created at. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [deprecated = true]; * @deprecated @@ -61,6 +61,13 @@ class CustomTuningModel extends \Google\Protobuf\Internal\Message * Generated from protobuf field map metrics = 7; */ private $metrics; + /** + * Currently this is only populated if the model state is + * `INPUT_VALIDATION_FAILED`. + * + * Generated from protobuf field string error_message = 8; + */ + protected $error_message = ''; /** * Constructor. @@ -71,8 +78,8 @@ class CustomTuningModel extends \Google\Protobuf\Internal\Message * @type string $name * Required. The fully qualified resource name of the model. * Format: - * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/customTuningModels/{custom_tuning_model}` - * model must be an alpha-numerical string with limit of 40 characters. + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/customTuningModels/{custom_tuning_model}`. + * Model must be an alpha-numerical string with limit of 40 characters. * @type string $display_name * The display name of the model. * @type int|string $model_version @@ -80,11 +87,14 @@ class CustomTuningModel extends \Google\Protobuf\Internal\Message * @type int $model_state * The state that the model is in (e.g.`TRAINING` or `TRAINING_FAILED`). * @type \Google\Protobuf\Timestamp $create_time - * Deprecated: timestamp the Model was created at. + * Deprecated: Timestamp the Model was created at. * @type \Google\Protobuf\Timestamp $training_start_time * Timestamp the model training was initiated. * @type array|\Google\Protobuf\Internal\MapField $metrics * The metrics of the trained model. + * @type string $error_message + * Currently this is only populated if the model state is + * `INPUT_VALIDATION_FAILED`. * } */ public function __construct($data = NULL) { @@ -95,8 +105,8 @@ public function __construct($data = NULL) { /** * Required. The fully qualified resource name of the model. * Format: - * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/customTuningModels/{custom_tuning_model}` - * model must be an alpha-numerical string with limit of 40 characters. + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/customTuningModels/{custom_tuning_model}`. + * Model must be an alpha-numerical string with limit of 40 characters. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -109,8 +119,8 @@ public function getName() /** * Required. The fully qualified resource name of the model. * Format: - * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/customTuningModels/{custom_tuning_model}` - * model must be an alpha-numerical string with limit of 40 characters. + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/customTuningModels/{custom_tuning_model}`. + * Model must be an alpha-numerical string with limit of 40 characters. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var @@ -203,7 +213,7 @@ public function setModelState($var) } /** - * Deprecated: timestamp the Model was created at. + * Deprecated: Timestamp the Model was created at. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [deprecated = true]; * @return \Google\Protobuf\Timestamp|null @@ -228,7 +238,7 @@ public function clearCreateTime() } /** - * Deprecated: timestamp the Model was created at. + * Deprecated: Timestamp the Model was created at. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [deprecated = true]; * @param \Google\Protobuf\Timestamp $var @@ -306,5 +316,33 @@ public function setMetrics($var) return $this; } + /** + * Currently this is only populated if the model state is + * `INPUT_VALIDATION_FAILED`. + * + * Generated from protobuf field string error_message = 8; + * @return string + */ + public function getErrorMessage() + { + return $this->error_message; + } + + /** + * Currently this is only populated if the model state is + * `INPUT_VALIDATION_FAILED`. + * + * Generated from protobuf field string error_message = 8; + * @param string $var + * @return $this + */ + public function setErrorMessage($var) + { + GPBUtil::checkString($var, True); + $this->error_message = $var; + + return $this; + } + } diff --git a/DiscoveryEngine/src/V1/DataStore.php b/DiscoveryEngine/src/V1/DataStore.php index 73c19db07f00..464d6673ab2d 100644 --- a/DiscoveryEngine/src/V1/DataStore.php +++ b/DiscoveryEngine/src/V1/DataStore.php @@ -72,6 +72,22 @@ class DataStore extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ protected $create_time = null; + /** + * Output only. Data size estimation for billing. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.DataStore.BillingEstimation billing_estimation = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $billing_estimation = null; + /** + * Config to store data store type configuration for workspace data. This + * must be set when + * [DataStore.content_config][google.cloud.discoveryengine.v1.DataStore.content_config] + * is set as + * [DataStore.ContentConfig.GOOGLE_WORKSPACE][google.cloud.discoveryengine.v1.DataStore.ContentConfig.GOOGLE_WORKSPACE]. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.WorkspaceConfig workspace_config = 25; + */ + protected $workspace_config = null; /** * Configuration for Document understanding and enrichment. * @@ -131,6 +147,14 @@ class DataStore extends \Google\Protobuf\Internal\Message * @type \Google\Protobuf\Timestamp $create_time * Output only. Timestamp the * [DataStore][google.cloud.discoveryengine.v1.DataStore] was created at. + * @type \Google\Cloud\DiscoveryEngine\V1\DataStore\BillingEstimation $billing_estimation + * Output only. Data size estimation for billing. + * @type \Google\Cloud\DiscoveryEngine\V1\WorkspaceConfig $workspace_config + * Config to store data store type configuration for workspace data. This + * must be set when + * [DataStore.content_config][google.cloud.discoveryengine.v1.DataStore.content_config] + * is set as + * [DataStore.ContentConfig.GOOGLE_WORKSPACE][google.cloud.discoveryengine.v1.DataStore.ContentConfig.GOOGLE_WORKSPACE]. * @type \Google\Cloud\DiscoveryEngine\V1\DocumentProcessingConfig $document_processing_config * Configuration for Document understanding and enrichment. * @type \Google\Cloud\DiscoveryEngine\V1\Schema $starting_schema @@ -375,6 +399,86 @@ public function setCreateTime($var) return $this; } + /** + * Output only. Data size estimation for billing. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.DataStore.BillingEstimation billing_estimation = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\DiscoveryEngine\V1\DataStore\BillingEstimation|null + */ + public function getBillingEstimation() + { + return $this->billing_estimation; + } + + public function hasBillingEstimation() + { + return isset($this->billing_estimation); + } + + public function clearBillingEstimation() + { + unset($this->billing_estimation); + } + + /** + * Output only. Data size estimation for billing. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.DataStore.BillingEstimation billing_estimation = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\DiscoveryEngine\V1\DataStore\BillingEstimation $var + * @return $this + */ + public function setBillingEstimation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\DataStore\BillingEstimation::class); + $this->billing_estimation = $var; + + return $this; + } + + /** + * Config to store data store type configuration for workspace data. This + * must be set when + * [DataStore.content_config][google.cloud.discoveryengine.v1.DataStore.content_config] + * is set as + * [DataStore.ContentConfig.GOOGLE_WORKSPACE][google.cloud.discoveryengine.v1.DataStore.ContentConfig.GOOGLE_WORKSPACE]. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.WorkspaceConfig workspace_config = 25; + * @return \Google\Cloud\DiscoveryEngine\V1\WorkspaceConfig|null + */ + public function getWorkspaceConfig() + { + return $this->workspace_config; + } + + public function hasWorkspaceConfig() + { + return isset($this->workspace_config); + } + + public function clearWorkspaceConfig() + { + unset($this->workspace_config); + } + + /** + * Config to store data store type configuration for workspace data. This + * must be set when + * [DataStore.content_config][google.cloud.discoveryengine.v1.DataStore.content_config] + * is set as + * [DataStore.ContentConfig.GOOGLE_WORKSPACE][google.cloud.discoveryengine.v1.DataStore.ContentConfig.GOOGLE_WORKSPACE]. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.WorkspaceConfig workspace_config = 25; + * @param \Google\Cloud\DiscoveryEngine\V1\WorkspaceConfig $var + * @return $this + */ + public function setWorkspaceConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\WorkspaceConfig::class); + $this->workspace_config = $var; + + return $this; + } + /** * Configuration for Document understanding and enrichment. * diff --git a/DiscoveryEngine/src/V1/DataStore/BillingEstimation.php b/DiscoveryEngine/src/V1/DataStore/BillingEstimation.php new file mode 100644 index 000000000000..1442b27407a8 --- /dev/null +++ b/DiscoveryEngine/src/V1/DataStore/BillingEstimation.php @@ -0,0 +1,268 @@ +google.cloud.discoveryengine.v1.DataStore.BillingEstimation + */ +class BillingEstimation extends \Google\Protobuf\Internal\Message +{ + /** + * Data size for structured data in terms of bytes. + * + * Generated from protobuf field int64 structured_data_size = 1; + */ + protected $structured_data_size = 0; + /** + * Data size for unstructured data in terms of bytes. + * + * Generated from protobuf field int64 unstructured_data_size = 2; + */ + protected $unstructured_data_size = 0; + /** + * Data size for websites in terms of bytes. + * + * Generated from protobuf field int64 website_data_size = 3; + */ + protected $website_data_size = 0; + /** + * Last updated timestamp for structured data. + * + * Generated from protobuf field .google.protobuf.Timestamp structured_data_update_time = 4; + */ + protected $structured_data_update_time = null; + /** + * Last updated timestamp for unstructured data. + * + * Generated from protobuf field .google.protobuf.Timestamp unstructured_data_update_time = 5; + */ + protected $unstructured_data_update_time = null; + /** + * Last updated timestamp for websites. + * + * Generated from protobuf field .google.protobuf.Timestamp website_data_update_time = 6; + */ + protected $website_data_update_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $structured_data_size + * Data size for structured data in terms of bytes. + * @type int|string $unstructured_data_size + * Data size for unstructured data in terms of bytes. + * @type int|string $website_data_size + * Data size for websites in terms of bytes. + * @type \Google\Protobuf\Timestamp $structured_data_update_time + * Last updated timestamp for structured data. + * @type \Google\Protobuf\Timestamp $unstructured_data_update_time + * Last updated timestamp for unstructured data. + * @type \Google\Protobuf\Timestamp $website_data_update_time + * Last updated timestamp for websites. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\DataStore::initOnce(); + parent::__construct($data); + } + + /** + * Data size for structured data in terms of bytes. + * + * Generated from protobuf field int64 structured_data_size = 1; + * @return int|string + */ + public function getStructuredDataSize() + { + return $this->structured_data_size; + } + + /** + * Data size for structured data in terms of bytes. + * + * Generated from protobuf field int64 structured_data_size = 1; + * @param int|string $var + * @return $this + */ + public function setStructuredDataSize($var) + { + GPBUtil::checkInt64($var); + $this->structured_data_size = $var; + + return $this; + } + + /** + * Data size for unstructured data in terms of bytes. + * + * Generated from protobuf field int64 unstructured_data_size = 2; + * @return int|string + */ + public function getUnstructuredDataSize() + { + return $this->unstructured_data_size; + } + + /** + * Data size for unstructured data in terms of bytes. + * + * Generated from protobuf field int64 unstructured_data_size = 2; + * @param int|string $var + * @return $this + */ + public function setUnstructuredDataSize($var) + { + GPBUtil::checkInt64($var); + $this->unstructured_data_size = $var; + + return $this; + } + + /** + * Data size for websites in terms of bytes. + * + * Generated from protobuf field int64 website_data_size = 3; + * @return int|string + */ + public function getWebsiteDataSize() + { + return $this->website_data_size; + } + + /** + * Data size for websites in terms of bytes. + * + * Generated from protobuf field int64 website_data_size = 3; + * @param int|string $var + * @return $this + */ + public function setWebsiteDataSize($var) + { + GPBUtil::checkInt64($var); + $this->website_data_size = $var; + + return $this; + } + + /** + * Last updated timestamp for structured data. + * + * Generated from protobuf field .google.protobuf.Timestamp structured_data_update_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStructuredDataUpdateTime() + { + return $this->structured_data_update_time; + } + + public function hasStructuredDataUpdateTime() + { + return isset($this->structured_data_update_time); + } + + public function clearStructuredDataUpdateTime() + { + unset($this->structured_data_update_time); + } + + /** + * Last updated timestamp for structured data. + * + * Generated from protobuf field .google.protobuf.Timestamp structured_data_update_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStructuredDataUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->structured_data_update_time = $var; + + return $this; + } + + /** + * Last updated timestamp for unstructured data. + * + * Generated from protobuf field .google.protobuf.Timestamp unstructured_data_update_time = 5; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUnstructuredDataUpdateTime() + { + return $this->unstructured_data_update_time; + } + + public function hasUnstructuredDataUpdateTime() + { + return isset($this->unstructured_data_update_time); + } + + public function clearUnstructuredDataUpdateTime() + { + unset($this->unstructured_data_update_time); + } + + /** + * Last updated timestamp for unstructured data. + * + * Generated from protobuf field .google.protobuf.Timestamp unstructured_data_update_time = 5; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUnstructuredDataUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->unstructured_data_update_time = $var; + + return $this; + } + + /** + * Last updated timestamp for websites. + * + * Generated from protobuf field .google.protobuf.Timestamp website_data_update_time = 6; + * @return \Google\Protobuf\Timestamp|null + */ + public function getWebsiteDataUpdateTime() + { + return $this->website_data_update_time; + } + + public function hasWebsiteDataUpdateTime() + { + return isset($this->website_data_update_time); + } + + public function clearWebsiteDataUpdateTime() + { + unset($this->website_data_update_time); + } + + /** + * Last updated timestamp for websites. + * + * Generated from protobuf field .google.protobuf.Timestamp website_data_update_time = 6; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setWebsiteDataUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->website_data_update_time = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/DataStore/ContentConfig.php b/DiscoveryEngine/src/V1/DataStore/ContentConfig.php index ee0c678f6ecd..0adade69e8df 100644 --- a/DiscoveryEngine/src/V1/DataStore/ContentConfig.php +++ b/DiscoveryEngine/src/V1/DataStore/ContentConfig.php @@ -39,12 +39,21 @@ class ContentConfig * Generated from protobuf enum PUBLIC_WEBSITE = 3; */ const PUBLIC_WEBSITE = 3; + /** + * The data store is used for workspace search. Details of workspace + * data store are specified in the + * [WorkspaceConfig][google.cloud.discoveryengine.v1.WorkspaceConfig]. + * + * Generated from protobuf enum GOOGLE_WORKSPACE = 4; + */ + const GOOGLE_WORKSPACE = 4; private static $valueToName = [ self::CONTENT_CONFIG_UNSPECIFIED => 'CONTENT_CONFIG_UNSPECIFIED', self::NO_CONTENT => 'NO_CONTENT', self::CONTENT_REQUIRED => 'CONTENT_REQUIRED', self::PUBLIC_WEBSITE => 'PUBLIC_WEBSITE', + self::GOOGLE_WORKSPACE => 'GOOGLE_WORKSPACE', ]; public static function name($value) diff --git a/DiscoveryEngine/src/V1/DeleteControlRequest.php b/DiscoveryEngine/src/V1/DeleteControlRequest.php index e8a08f540dff..b0f69214b856 100644 --- a/DiscoveryEngine/src/V1/DeleteControlRequest.php +++ b/DiscoveryEngine/src/V1/DeleteControlRequest.php @@ -17,7 +17,7 @@ class DeleteControlRequest extends \Google\Protobuf\Internal\Message { /** * Required. The resource name of the Control to delete. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` + * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -25,7 +25,7 @@ class DeleteControlRequest extends \Google\Protobuf\Internal\Message /** * @param string $name Required. The resource name of the Control to delete. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` + * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` * Please see {@see ControlServiceClient::controlName()} for help formatting this field. * * @return \Google\Cloud\DiscoveryEngine\V1\DeleteControlRequest @@ -46,7 +46,7 @@ public static function build(string $name): self * * @type string $name * Required. The resource name of the Control to delete. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` + * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` * } */ public function __construct($data = NULL) { @@ -56,7 +56,7 @@ public function __construct($data = NULL) { /** * Required. The resource name of the Control to delete. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` + * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -68,7 +68,7 @@ public function getName() /** * Required. The resource name of the Control to delete. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` + * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/DiscoveryEngine/src/V1/DeleteConversationRequest.php b/DiscoveryEngine/src/V1/DeleteConversationRequest.php index 594b7c155630..0407ba5aac86 100644 --- a/DiscoveryEngine/src/V1/DeleteConversationRequest.php +++ b/DiscoveryEngine/src/V1/DeleteConversationRequest.php @@ -17,7 +17,7 @@ class DeleteConversationRequest extends \Google\Protobuf\Internal\Message { /** * Required. The resource name of the Conversation to delete. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -25,7 +25,7 @@ class DeleteConversationRequest extends \Google\Protobuf\Internal\Message /** * @param string $name Required. The resource name of the Conversation to delete. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` * Please see {@see ConversationalSearchServiceClient::conversationName()} for help formatting this field. * * @return \Google\Cloud\DiscoveryEngine\V1\DeleteConversationRequest @@ -46,7 +46,7 @@ public static function build(string $name): self * * @type string $name * Required. The resource name of the Conversation to delete. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` * } */ public function __construct($data = NULL) { @@ -56,7 +56,7 @@ public function __construct($data = NULL) { /** * Required. The resource name of the Conversation to delete. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -68,7 +68,7 @@ public function getName() /** * Required. The resource name of the Conversation to delete. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/DiscoveryEngine/src/V1/DeleteSessionRequest.php b/DiscoveryEngine/src/V1/DeleteSessionRequest.php index 248bc92618cc..9cdb049a1385 100644 --- a/DiscoveryEngine/src/V1/DeleteSessionRequest.php +++ b/DiscoveryEngine/src/V1/DeleteSessionRequest.php @@ -17,7 +17,7 @@ class DeleteSessionRequest extends \Google\Protobuf\Internal\Message { /** * Required. The resource name of the Session to delete. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -25,7 +25,7 @@ class DeleteSessionRequest extends \Google\Protobuf\Internal\Message /** * @param string $name Required. The resource name of the Session to delete. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` * Please see {@see ConversationalSearchServiceClient::sessionName()} for help formatting this field. * * @return \Google\Cloud\DiscoveryEngine\V1\DeleteSessionRequest @@ -46,7 +46,7 @@ public static function build(string $name): self * * @type string $name * Required. The resource name of the Session to delete. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` * } */ public function __construct($data = NULL) { @@ -56,7 +56,7 @@ public function __construct($data = NULL) { /** * Required. The resource name of the Session to delete. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -68,7 +68,7 @@ public function getName() /** * Required. The resource name of the Session to delete. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/DiscoveryEngine/src/V1/DocumentInfo.php b/DiscoveryEngine/src/V1/DocumentInfo.php index d38dadf1851d..7fc6f5f76793 100644 --- a/DiscoveryEngine/src/V1/DocumentInfo.php +++ b/DiscoveryEngine/src/V1/DocumentInfo.php @@ -53,7 +53,7 @@ class DocumentInfo extends \Google\Protobuf\Internal\Message * @type string $name * The [Document][google.cloud.discoveryengine.v1.Document] resource full * name, of the form: - * `projects/{project_id}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}` + * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}` * @type string $uri * The [Document][google.cloud.discoveryengine.v1.Document] URI - only * allowed for website data stores. @@ -111,7 +111,7 @@ public function setId($var) /** * The [Document][google.cloud.discoveryengine.v1.Document] resource full * name, of the form: - * `projects/{project_id}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}` + * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}` * * Generated from protobuf field string name = 2 [(.google.api.resource_reference) = { * @return string @@ -129,7 +129,7 @@ public function hasName() /** * The [Document][google.cloud.discoveryengine.v1.Document] resource full * name, of the form: - * `projects/{project_id}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}` + * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}` * * Generated from protobuf field string name = 2 [(.google.api.resource_reference) = { * @param string $var diff --git a/DiscoveryEngine/src/V1/DocumentProcessingConfig.php b/DiscoveryEngine/src/V1/DocumentProcessingConfig.php index 8ab3a3fffa9d..1fa538c15c1d 100644 --- a/DiscoveryEngine/src/V1/DocumentProcessingConfig.php +++ b/DiscoveryEngine/src/V1/DocumentProcessingConfig.php @@ -10,11 +10,11 @@ /** * A singleton resource of - * [DataStore][google.cloud.discoveryengine.v1.DataStore]. It's empty when - * [DataStore][google.cloud.discoveryengine.v1.DataStore] is created, which - * defaults to digital parser. The first call to - * [DataStoreService.UpdateDocumentProcessingConfig][] method will initialize - * the config. + * [DataStore][google.cloud.discoveryengine.v1.DataStore]. If it's empty when + * [DataStore][google.cloud.discoveryengine.v1.DataStore] is created and + * [DataStore][google.cloud.discoveryengine.v1.DataStore] is set to + * [DataStore.ContentConfig.CONTENT_REQUIRED][google.cloud.discoveryengine.v1.DataStore.ContentConfig.CONTENT_REQUIRED], + * the default parser will default to digital parser. * * Generated from protobuf message google.cloud.discoveryengine.v1.DocumentProcessingConfig */ @@ -54,6 +54,8 @@ class DocumentProcessingConfig extends \Google\Protobuf\Internal\Message * layout parsing are supported. * * `pptx`: Override parsing config for PPTX files, only digital parsing and * layout parsing are supported. + * * `xlsm`: Override parsing config for XLSM files, only digital parsing and + * layout parsing are supported. * * `xlsx`: Override parsing config for XLSX files, only digital parsing and * layout parsing are supported. * @@ -89,6 +91,8 @@ class DocumentProcessingConfig extends \Google\Protobuf\Internal\Message * layout parsing are supported. * * `pptx`: Override parsing config for PPTX files, only digital parsing and * layout parsing are supported. + * * `xlsm`: Override parsing config for XLSM files, only digital parsing and + * layout parsing are supported. * * `xlsx`: Override parsing config for XLSX files, only digital parsing and * layout parsing are supported. * } @@ -217,6 +221,8 @@ public function setDefaultParsingConfig($var) * layout parsing are supported. * * `pptx`: Override parsing config for PPTX files, only digital parsing and * layout parsing are supported. + * * `xlsm`: Override parsing config for XLSM files, only digital parsing and + * layout parsing are supported. * * `xlsx`: Override parsing config for XLSX files, only digital parsing and * layout parsing are supported. * @@ -239,6 +245,8 @@ public function getParsingConfigOverrides() * layout parsing are supported. * * `pptx`: Override parsing config for PPTX files, only digital parsing and * layout parsing are supported. + * * `xlsm`: Override parsing config for XLSM files, only digital parsing and + * layout parsing are supported. * * `xlsx`: Override parsing config for XLSX files, only digital parsing and * layout parsing are supported. * diff --git a/DiscoveryEngine/src/V1/Engine.php b/DiscoveryEngine/src/V1/Engine.php index b5d7db997a93..ed9ff51d0f6c 100644 --- a/DiscoveryEngine/src/V1/Engine.php +++ b/DiscoveryEngine/src/V1/Engine.php @@ -21,7 +21,7 @@ class Engine extends \Google\Protobuf\Internal\Message * This field must be a UTF-8 encoded string with a length limit of 1024 * characters. * Format: - * `projects/{project_number}/locations/{location}/collections/{collection}/engines/{engine}` + * `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}` * engine should be 1-63 characters, and valid characters are * /[a-z0-9][a-z0-9-_]*/. Otherwise, an INVALID_ARGUMENT error is returned. * @@ -89,6 +89,13 @@ class Engine extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.discoveryengine.v1.Engine.CommonConfig common_config = 15; */ protected $common_config = null; + /** + * Optional. Whether to disable analytics for searches performed on this + * engine. + * + * Generated from protobuf field bool disable_analytics = 26 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $disable_analytics = false; protected $engine_config; protected $engine_metadata; @@ -116,7 +123,7 @@ class Engine extends \Google\Protobuf\Internal\Message * This field must be a UTF-8 encoded string with a length limit of 1024 * characters. * Format: - * `projects/{project_number}/locations/{location}/collections/{collection}/engines/{engine}` + * `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}` * engine should be 1-63 characters, and valid characters are * /[a-z0-9][a-z0-9-_]*/. Otherwise, an INVALID_ARGUMENT error is returned. * @type string $display_name @@ -152,6 +159,9 @@ class Engine extends \Google\Protobuf\Internal\Message * DataStore linked to the engine. * @type \Google\Cloud\DiscoveryEngine\V1\Engine\CommonConfig $common_config * Common config spec that specifies the metadata of the engine. + * @type bool $disable_analytics + * Optional. Whether to disable analytics for searches performed on this + * engine. * } */ public function __construct($data = NULL) { @@ -271,7 +281,7 @@ public function setChatEngineMetadata($var) * This field must be a UTF-8 encoded string with a length limit of 1024 * characters. * Format: - * `projects/{project_number}/locations/{location}/collections/{collection}/engines/{engine}` + * `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}` * engine should be 1-63 characters, and valid characters are * /[a-z0-9][a-z0-9-_]*/. Otherwise, an INVALID_ARGUMENT error is returned. * @@ -288,7 +298,7 @@ public function getName() * This field must be a UTF-8 encoded string with a length limit of 1024 * characters. * Format: - * `projects/{project_number}/locations/{location}/collections/{collection}/engines/{engine}` + * `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}` * engine should be 1-63 characters, and valid characters are * /[a-z0-9][a-z0-9-_]*/. Otherwise, an INVALID_ARGUMENT error is returned. * @@ -554,6 +564,34 @@ public function setCommonConfig($var) return $this; } + /** + * Optional. Whether to disable analytics for searches performed on this + * engine. + * + * Generated from protobuf field bool disable_analytics = 26 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getDisableAnalytics() + { + return $this->disable_analytics; + } + + /** + * Optional. Whether to disable analytics for searches performed on this + * engine. + * + * Generated from protobuf field bool disable_analytics = 26 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setDisableAnalytics($var) + { + GPBUtil::checkBool($var); + $this->disable_analytics = $var; + + return $this; + } + /** * @return string */ diff --git a/DiscoveryEngine/src/V1/GenerateGroundedContentRequest.php b/DiscoveryEngine/src/V1/GenerateGroundedContentRequest.php new file mode 100644 index 000000000000..53bf90431c9a --- /dev/null +++ b/DiscoveryEngine/src/V1/GenerateGroundedContentRequest.php @@ -0,0 +1,352 @@ +google.cloud.discoveryengine.v1.GenerateGroundedContentRequest + */ +class GenerateGroundedContentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Location resource. + * Format: `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string location = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $location = ''; + /** + * Content of the system instruction for the current API. + * These instructions will take priority over any other prompt instructions + * if the selected model is supporting them. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GroundedGenerationContent system_instruction = 5; + */ + protected $system_instruction = null; + /** + * Content of the current conversation with the model. + * For single-turn queries, this is a single instance. For multi-turn queries, + * this is a repeated field that contains conversation history + latest + * request. + * Only a single-turn query is supported currently. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.GroundedGenerationContent contents = 2; + */ + private $contents; + /** + * Content generation specification. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GenerationSpec generation_spec = 3; + */ + protected $generation_spec = null; + /** + * Grounding specification. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSpec grounding_spec = 4; + */ + protected $grounding_spec = null; + /** + * The user labels applied to a resource must meet the following requirements: + * * Each resource can have multiple labels, up to a maximum of 64. + * * Each label must be a key-value pair. + * * Keys have a minimum length of 1 character and a maximum length of 63 + * characters and cannot be empty. Values can be empty and have a maximum + * length of 63 characters. + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. All characters must use UTF-8 encoding, and + * international characters are allowed. + * * The key portion of a label must be unique. However, you can use the same + * key with multiple resources. + * * Keys must start with a lowercase letter or international character. + * See [Google Cloud + * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * for more details. + * + * Generated from protobuf field map user_labels = 6; + */ + private $user_labels; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $location + * Required. Location resource. + * Format: `projects/{project}/locations/{location}`. + * @type \Google\Cloud\DiscoveryEngine\V1\GroundedGenerationContent $system_instruction + * Content of the system instruction for the current API. + * These instructions will take priority over any other prompt instructions + * if the selected model is supporting them. + * @type array<\Google\Cloud\DiscoveryEngine\V1\GroundedGenerationContent>|\Google\Protobuf\Internal\RepeatedField $contents + * Content of the current conversation with the model. + * For single-turn queries, this is a single instance. For multi-turn queries, + * this is a repeated field that contains conversation history + latest + * request. + * Only a single-turn query is supported currently. + * @type \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentRequest\GenerationSpec $generation_spec + * Content generation specification. + * @type \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentRequest\GroundingSpec $grounding_spec + * Grounding specification. + * @type array|\Google\Protobuf\Internal\MapField $user_labels + * The user labels applied to a resource must meet the following requirements: + * * Each resource can have multiple labels, up to a maximum of 64. + * * Each label must be a key-value pair. + * * Keys have a minimum length of 1 character and a maximum length of 63 + * characters and cannot be empty. Values can be empty and have a maximum + * length of 63 characters. + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. All characters must use UTF-8 encoding, and + * international characters are allowed. + * * The key portion of a label must be unique. However, you can use the same + * key with multiple resources. + * * Keys must start with a lowercase letter or international character. + * See [Google Cloud + * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * for more details. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\GroundedGenerationService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Location resource. + * Format: `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string location = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getLocation() + { + return $this->location; + } + + /** + * Required. Location resource. + * Format: `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string location = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkString($var, True); + $this->location = $var; + + return $this; + } + + /** + * Content of the system instruction for the current API. + * These instructions will take priority over any other prompt instructions + * if the selected model is supporting them. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GroundedGenerationContent system_instruction = 5; + * @return \Google\Cloud\DiscoveryEngine\V1\GroundedGenerationContent|null + */ + public function getSystemInstruction() + { + return $this->system_instruction; + } + + public function hasSystemInstruction() + { + return isset($this->system_instruction); + } + + public function clearSystemInstruction() + { + unset($this->system_instruction); + } + + /** + * Content of the system instruction for the current API. + * These instructions will take priority over any other prompt instructions + * if the selected model is supporting them. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GroundedGenerationContent system_instruction = 5; + * @param \Google\Cloud\DiscoveryEngine\V1\GroundedGenerationContent $var + * @return $this + */ + public function setSystemInstruction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\GroundedGenerationContent::class); + $this->system_instruction = $var; + + return $this; + } + + /** + * Content of the current conversation with the model. + * For single-turn queries, this is a single instance. For multi-turn queries, + * this is a repeated field that contains conversation history + latest + * request. + * Only a single-turn query is supported currently. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.GroundedGenerationContent contents = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getContents() + { + return $this->contents; + } + + /** + * Content of the current conversation with the model. + * For single-turn queries, this is a single instance. For multi-turn queries, + * this is a repeated field that contains conversation history + latest + * request. + * Only a single-turn query is supported currently. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.GroundedGenerationContent contents = 2; + * @param array<\Google\Cloud\DiscoveryEngine\V1\GroundedGenerationContent>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setContents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\GroundedGenerationContent::class); + $this->contents = $arr; + + return $this; + } + + /** + * Content generation specification. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GenerationSpec generation_spec = 3; + * @return \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentRequest\GenerationSpec|null + */ + public function getGenerationSpec() + { + return $this->generation_spec; + } + + public function hasGenerationSpec() + { + return isset($this->generation_spec); + } + + public function clearGenerationSpec() + { + unset($this->generation_spec); + } + + /** + * Content generation specification. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GenerationSpec generation_spec = 3; + * @param \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentRequest\GenerationSpec $var + * @return $this + */ + public function setGenerationSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentRequest\GenerationSpec::class); + $this->generation_spec = $var; + + return $this; + } + + /** + * Grounding specification. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSpec grounding_spec = 4; + * @return \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentRequest\GroundingSpec|null + */ + public function getGroundingSpec() + { + return $this->grounding_spec; + } + + public function hasGroundingSpec() + { + return isset($this->grounding_spec); + } + + public function clearGroundingSpec() + { + unset($this->grounding_spec); + } + + /** + * Grounding specification. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSpec grounding_spec = 4; + * @param \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentRequest\GroundingSpec $var + * @return $this + */ + public function setGroundingSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentRequest\GroundingSpec::class); + $this->grounding_spec = $var; + + return $this; + } + + /** + * The user labels applied to a resource must meet the following requirements: + * * Each resource can have multiple labels, up to a maximum of 64. + * * Each label must be a key-value pair. + * * Keys have a minimum length of 1 character and a maximum length of 63 + * characters and cannot be empty. Values can be empty and have a maximum + * length of 63 characters. + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. All characters must use UTF-8 encoding, and + * international characters are allowed. + * * The key portion of a label must be unique. However, you can use the same + * key with multiple resources. + * * Keys must start with a lowercase letter or international character. + * See [Google Cloud + * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * for more details. + * + * Generated from protobuf field map user_labels = 6; + * @return \Google\Protobuf\Internal\MapField + */ + public function getUserLabels() + { + return $this->user_labels; + } + + /** + * The user labels applied to a resource must meet the following requirements: + * * Each resource can have multiple labels, up to a maximum of 64. + * * Each label must be a key-value pair. + * * Keys have a minimum length of 1 character and a maximum length of 63 + * characters and cannot be empty. Values can be empty and have a maximum + * length of 63 characters. + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. All characters must use UTF-8 encoding, and + * international characters are allowed. + * * The key portion of a label must be unique. However, you can use the same + * key with multiple resources. + * * Keys must start with a lowercase letter or international character. + * See [Google Cloud + * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * for more details. + * + * Generated from protobuf field map user_labels = 6; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setUserLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->user_labels = $arr; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1/GenerateGroundedContentRequest/DynamicRetrievalConfiguration.php b/DiscoveryEngine/src/V1/GenerateGroundedContentRequest/DynamicRetrievalConfiguration.php new file mode 100644 index 000000000000..ce0b1477ab70 --- /dev/null +++ b/DiscoveryEngine/src/V1/GenerateGroundedContentRequest/DynamicRetrievalConfiguration.php @@ -0,0 +1,78 @@ +google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.DynamicRetrievalConfiguration + */ +class DynamicRetrievalConfiguration extends \Google\Protobuf\Internal\Message +{ + /** + * Specification for the predictor for dynamic retrieval. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.DynamicRetrievalConfiguration.DynamicRetrievalPredictor predictor = 1; + */ + protected $predictor = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentRequest\DynamicRetrievalConfiguration\DynamicRetrievalPredictor $predictor + * Specification for the predictor for dynamic retrieval. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\GroundedGenerationService::initOnce(); + parent::__construct($data); + } + + /** + * Specification for the predictor for dynamic retrieval. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.DynamicRetrievalConfiguration.DynamicRetrievalPredictor predictor = 1; + * @return \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentRequest\DynamicRetrievalConfiguration\DynamicRetrievalPredictor|null + */ + public function getPredictor() + { + return $this->predictor; + } + + public function hasPredictor() + { + return isset($this->predictor); + } + + public function clearPredictor() + { + unset($this->predictor); + } + + /** + * Specification for the predictor for dynamic retrieval. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.DynamicRetrievalConfiguration.DynamicRetrievalPredictor predictor = 1; + * @param \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentRequest\DynamicRetrievalConfiguration\DynamicRetrievalPredictor $var + * @return $this + */ + public function setPredictor($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentRequest\DynamicRetrievalConfiguration\DynamicRetrievalPredictor::class); + $this->predictor = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/GenerateGroundedContentRequest/DynamicRetrievalConfiguration/DynamicRetrievalPredictor.php b/DiscoveryEngine/src/V1/GenerateGroundedContentRequest/DynamicRetrievalConfiguration/DynamicRetrievalPredictor.php new file mode 100644 index 000000000000..4eb8ab405fa4 --- /dev/null +++ b/DiscoveryEngine/src/V1/GenerateGroundedContentRequest/DynamicRetrievalConfiguration/DynamicRetrievalPredictor.php @@ -0,0 +1,116 @@ +google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.DynamicRetrievalConfiguration.DynamicRetrievalPredictor + */ +class DynamicRetrievalPredictor extends \Google\Protobuf\Internal\Message +{ + /** + * The version of the predictor to be used in dynamic retrieval. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.DynamicRetrievalConfiguration.DynamicRetrievalPredictor.Version version = 1; + */ + protected $version = 0; + /** + * The value of the threshold. If the predictor will predict a + * value smaller than this, it would suppress grounding in the source. + * + * Generated from protobuf field optional float threshold = 2; + */ + protected $threshold = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $version + * The version of the predictor to be used in dynamic retrieval. + * @type float $threshold + * The value of the threshold. If the predictor will predict a + * value smaller than this, it would suppress grounding in the source. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\GroundedGenerationService::initOnce(); + parent::__construct($data); + } + + /** + * The version of the predictor to be used in dynamic retrieval. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.DynamicRetrievalConfiguration.DynamicRetrievalPredictor.Version version = 1; + * @return int + */ + public function getVersion() + { + return $this->version; + } + + /** + * The version of the predictor to be used in dynamic retrieval. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.DynamicRetrievalConfiguration.DynamicRetrievalPredictor.Version version = 1; + * @param int $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentRequest\DynamicRetrievalConfiguration\DynamicRetrievalPredictor\Version::class); + $this->version = $var; + + return $this; + } + + /** + * The value of the threshold. If the predictor will predict a + * value smaller than this, it would suppress grounding in the source. + * + * Generated from protobuf field optional float threshold = 2; + * @return float + */ + public function getThreshold() + { + return isset($this->threshold) ? $this->threshold : 0.0; + } + + public function hasThreshold() + { + return isset($this->threshold); + } + + public function clearThreshold() + { + unset($this->threshold); + } + + /** + * The value of the threshold. If the predictor will predict a + * value smaller than this, it would suppress grounding in the source. + * + * Generated from protobuf field optional float threshold = 2; + * @param float $var + * @return $this + */ + public function setThreshold($var) + { + GPBUtil::checkFloat($var); + $this->threshold = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/GenerateGroundedContentRequest/DynamicRetrievalConfiguration/DynamicRetrievalPredictor/Version.php b/DiscoveryEngine/src/V1/GenerateGroundedContentRequest/DynamicRetrievalConfiguration/DynamicRetrievalPredictor/Version.php new file mode 100644 index 000000000000..0e2e497ea8c9 --- /dev/null +++ b/DiscoveryEngine/src/V1/GenerateGroundedContentRequest/DynamicRetrievalConfiguration/DynamicRetrievalPredictor/Version.php @@ -0,0 +1,55 @@ +google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.DynamicRetrievalConfiguration.DynamicRetrievalPredictor.Version + */ +class Version +{ + /** + * Automatically choose the best version of the retrieval predictor. + * + * Generated from protobuf enum VERSION_UNSPECIFIED = 0; + */ + const VERSION_UNSPECIFIED = 0; + /** + * The V1 model which is evaluating each source independently. + * + * Generated from protobuf enum V1_INDEPENDENT = 1; + */ + const V1_INDEPENDENT = 1; + + private static $valueToName = [ + self::VERSION_UNSPECIFIED => 'VERSION_UNSPECIFIED', + self::V1_INDEPENDENT => 'V1_INDEPENDENT', + ]; + + 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/DiscoveryEngine/src/V1/GenerateGroundedContentRequest/GenerationSpec.php b/DiscoveryEngine/src/V1/GenerateGroundedContentRequest/GenerationSpec.php new file mode 100644 index 000000000000..ae4538bcf438 --- /dev/null +++ b/DiscoveryEngine/src/V1/GenerateGroundedContentRequest/GenerationSpec.php @@ -0,0 +1,370 @@ +google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GenerationSpec + */ +class GenerationSpec extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies which Vertex model id to use for generation. + * + * Generated from protobuf field string model_id = 3; + */ + protected $model_id = ''; + /** + * Language code for content. Use language tags defined by + * [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). + * + * Generated from protobuf field string language_code = 2; + */ + protected $language_code = ''; + /** + * If specified, custom value for the temperature will be used. + * + * Generated from protobuf field optional float temperature = 4; + */ + protected $temperature = null; + /** + * If specified, custom value for nucleus sampling will be used. + * + * Generated from protobuf field optional float top_p = 5; + */ + protected $top_p = null; + /** + * If specified, custom value for top-k sampling will be used. + * + * Generated from protobuf field optional int32 top_k = 7; + */ + protected $top_k = null; + /** + * If specified, custom value for frequency penalty will be used. + * + * Generated from protobuf field optional float frequency_penalty = 8; + */ + protected $frequency_penalty = null; + /** + * If specified, custom value for presence penalty will be used. + * + * Generated from protobuf field optional float presence_penalty = 9; + */ + protected $presence_penalty = null; + /** + * If specified, custom value for max output tokens will be used. + * + * Generated from protobuf field optional int32 max_output_tokens = 10; + */ + protected $max_output_tokens = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $model_id + * Specifies which Vertex model id to use for generation. + * @type string $language_code + * Language code for content. Use language tags defined by + * [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). + * @type float $temperature + * If specified, custom value for the temperature will be used. + * @type float $top_p + * If specified, custom value for nucleus sampling will be used. + * @type int $top_k + * If specified, custom value for top-k sampling will be used. + * @type float $frequency_penalty + * If specified, custom value for frequency penalty will be used. + * @type float $presence_penalty + * If specified, custom value for presence penalty will be used. + * @type int $max_output_tokens + * If specified, custom value for max output tokens will be used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\GroundedGenerationService::initOnce(); + parent::__construct($data); + } + + /** + * Specifies which Vertex model id to use for generation. + * + * Generated from protobuf field string model_id = 3; + * @return string + */ + public function getModelId() + { + return $this->model_id; + } + + /** + * Specifies which Vertex model id to use for generation. + * + * Generated from protobuf field string model_id = 3; + * @param string $var + * @return $this + */ + public function setModelId($var) + { + GPBUtil::checkString($var, True); + $this->model_id = $var; + + return $this; + } + + /** + * Language code for content. Use language tags defined by + * [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). + * + * Generated from protobuf field string language_code = 2; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Language code for content. Use language tags defined by + * [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). + * + * Generated from protobuf field string language_code = 2; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * If specified, custom value for the temperature will be used. + * + * Generated from protobuf field optional float temperature = 4; + * @return float + */ + public function getTemperature() + { + return isset($this->temperature) ? $this->temperature : 0.0; + } + + public function hasTemperature() + { + return isset($this->temperature); + } + + public function clearTemperature() + { + unset($this->temperature); + } + + /** + * If specified, custom value for the temperature will be used. + * + * Generated from protobuf field optional float temperature = 4; + * @param float $var + * @return $this + */ + public function setTemperature($var) + { + GPBUtil::checkFloat($var); + $this->temperature = $var; + + return $this; + } + + /** + * If specified, custom value for nucleus sampling will be used. + * + * Generated from protobuf field optional float top_p = 5; + * @return float + */ + public function getTopP() + { + return isset($this->top_p) ? $this->top_p : 0.0; + } + + public function hasTopP() + { + return isset($this->top_p); + } + + public function clearTopP() + { + unset($this->top_p); + } + + /** + * If specified, custom value for nucleus sampling will be used. + * + * Generated from protobuf field optional float top_p = 5; + * @param float $var + * @return $this + */ + public function setTopP($var) + { + GPBUtil::checkFloat($var); + $this->top_p = $var; + + return $this; + } + + /** + * If specified, custom value for top-k sampling will be used. + * + * Generated from protobuf field optional int32 top_k = 7; + * @return int + */ + public function getTopK() + { + return isset($this->top_k) ? $this->top_k : 0; + } + + public function hasTopK() + { + return isset($this->top_k); + } + + public function clearTopK() + { + unset($this->top_k); + } + + /** + * If specified, custom value for top-k sampling will be used. + * + * Generated from protobuf field optional int32 top_k = 7; + * @param int $var + * @return $this + */ + public function setTopK($var) + { + GPBUtil::checkInt32($var); + $this->top_k = $var; + + return $this; + } + + /** + * If specified, custom value for frequency penalty will be used. + * + * Generated from protobuf field optional float frequency_penalty = 8; + * @return float + */ + public function getFrequencyPenalty() + { + return isset($this->frequency_penalty) ? $this->frequency_penalty : 0.0; + } + + public function hasFrequencyPenalty() + { + return isset($this->frequency_penalty); + } + + public function clearFrequencyPenalty() + { + unset($this->frequency_penalty); + } + + /** + * If specified, custom value for frequency penalty will be used. + * + * Generated from protobuf field optional float frequency_penalty = 8; + * @param float $var + * @return $this + */ + public function setFrequencyPenalty($var) + { + GPBUtil::checkFloat($var); + $this->frequency_penalty = $var; + + return $this; + } + + /** + * If specified, custom value for presence penalty will be used. + * + * Generated from protobuf field optional float presence_penalty = 9; + * @return float + */ + public function getPresencePenalty() + { + return isset($this->presence_penalty) ? $this->presence_penalty : 0.0; + } + + public function hasPresencePenalty() + { + return isset($this->presence_penalty); + } + + public function clearPresencePenalty() + { + unset($this->presence_penalty); + } + + /** + * If specified, custom value for presence penalty will be used. + * + * Generated from protobuf field optional float presence_penalty = 9; + * @param float $var + * @return $this + */ + public function setPresencePenalty($var) + { + GPBUtil::checkFloat($var); + $this->presence_penalty = $var; + + return $this; + } + + /** + * If specified, custom value for max output tokens will be used. + * + * Generated from protobuf field optional int32 max_output_tokens = 10; + * @return int + */ + public function getMaxOutputTokens() + { + return isset($this->max_output_tokens) ? $this->max_output_tokens : 0; + } + + public function hasMaxOutputTokens() + { + return isset($this->max_output_tokens); + } + + public function clearMaxOutputTokens() + { + unset($this->max_output_tokens); + } + + /** + * If specified, custom value for max output tokens will be used. + * + * Generated from protobuf field optional int32 max_output_tokens = 10; + * @param int $var + * @return $this + */ + public function setMaxOutputTokens($var) + { + GPBUtil::checkInt32($var); + $this->max_output_tokens = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/GenerateGroundedContentRequest/GroundingSource.php b/DiscoveryEngine/src/V1/GenerateGroundedContentRequest/GroundingSource.php new file mode 100644 index 000000000000..d430aa462d6c --- /dev/null +++ b/DiscoveryEngine/src/V1/GenerateGroundedContentRequest/GroundingSource.php @@ -0,0 +1,142 @@ +google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSource + */ +class GroundingSource extends \Google\Protobuf\Internal\Message +{ + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentRequest\GroundingSource\InlineSource $inline_source + * If set, grounding is performed with inline content. + * @type \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentRequest\GroundingSource\SearchSource $search_source + * If set, grounding is performed with Vertex AI Search. + * @type \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentRequest\GroundingSource\GoogleSearchSource $google_search_source + * If set, grounding is performed with Google Search. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\GroundedGenerationService::initOnce(); + parent::__construct($data); + } + + /** + * If set, grounding is performed with inline content. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSource.InlineSource inline_source = 1; + * @return \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentRequest\GroundingSource\InlineSource|null + */ + public function getInlineSource() + { + return $this->readOneof(1); + } + + public function hasInlineSource() + { + return $this->hasOneof(1); + } + + /** + * If set, grounding is performed with inline content. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSource.InlineSource inline_source = 1; + * @param \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentRequest\GroundingSource\InlineSource $var + * @return $this + */ + public function setInlineSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentRequest\GroundingSource\InlineSource::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * If set, grounding is performed with Vertex AI Search. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSource.SearchSource search_source = 2; + * @return \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentRequest\GroundingSource\SearchSource|null + */ + public function getSearchSource() + { + return $this->readOneof(2); + } + + public function hasSearchSource() + { + return $this->hasOneof(2); + } + + /** + * If set, grounding is performed with Vertex AI Search. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSource.SearchSource search_source = 2; + * @param \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentRequest\GroundingSource\SearchSource $var + * @return $this + */ + public function setSearchSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentRequest\GroundingSource\SearchSource::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * If set, grounding is performed with Google Search. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSource.GoogleSearchSource google_search_source = 3; + * @return \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentRequest\GroundingSource\GoogleSearchSource|null + */ + public function getGoogleSearchSource() + { + return $this->readOneof(3); + } + + public function hasGoogleSearchSource() + { + return $this->hasOneof(3); + } + + /** + * If set, grounding is performed with Google Search. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSource.GoogleSearchSource google_search_source = 3; + * @param \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentRequest\GroundingSource\GoogleSearchSource $var + * @return $this + */ + public function setGoogleSearchSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentRequest\GroundingSource\GoogleSearchSource::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + + diff --git a/DiscoveryEngine/src/V1/GenerateGroundedContentRequest/GroundingSource/GoogleSearchSource.php b/DiscoveryEngine/src/V1/GenerateGroundedContentRequest/GroundingSource/GoogleSearchSource.php new file mode 100644 index 000000000000..17da05eb8ce0 --- /dev/null +++ b/DiscoveryEngine/src/V1/GenerateGroundedContentRequest/GroundingSource/GoogleSearchSource.php @@ -0,0 +1,82 @@ +google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSource.GoogleSearchSource + */ +class GoogleSearchSource extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Specifies the dynamic retrieval configuration for the given + * source. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.DynamicRetrievalConfiguration dynamic_retrieval_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $dynamic_retrieval_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentRequest\DynamicRetrievalConfiguration $dynamic_retrieval_config + * Optional. Specifies the dynamic retrieval configuration for the given + * source. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\GroundedGenerationService::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Specifies the dynamic retrieval configuration for the given + * source. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.DynamicRetrievalConfiguration dynamic_retrieval_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentRequest\DynamicRetrievalConfiguration|null + */ + public function getDynamicRetrievalConfig() + { + return $this->dynamic_retrieval_config; + } + + public function hasDynamicRetrievalConfig() + { + return isset($this->dynamic_retrieval_config); + } + + public function clearDynamicRetrievalConfig() + { + unset($this->dynamic_retrieval_config); + } + + /** + * Optional. Specifies the dynamic retrieval configuration for the given + * source. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.DynamicRetrievalConfiguration dynamic_retrieval_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentRequest\DynamicRetrievalConfiguration $var + * @return $this + */ + public function setDynamicRetrievalConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentRequest\DynamicRetrievalConfiguration::class); + $this->dynamic_retrieval_config = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/GenerateGroundedContentRequest/GroundingSource/InlineSource.php b/DiscoveryEngine/src/V1/GenerateGroundedContentRequest/GroundingSource/InlineSource.php new file mode 100644 index 000000000000..591966907408 --- /dev/null +++ b/DiscoveryEngine/src/V1/GenerateGroundedContentRequest/GroundingSource/InlineSource.php @@ -0,0 +1,110 @@ +google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSource.InlineSource + */ +class InlineSource extends \Google\Protobuf\Internal\Message +{ + /** + * List of facts to be used for grounding. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.GroundingFact grounding_facts = 1; + */ + private $grounding_facts; + /** + * Attributes associated with the content. + * Common attributes include `source` (indicating where the content was + * sourced from) and `author` (indicating the author of the content). + * + * Generated from protobuf field map attributes = 2; + */ + private $attributes; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DiscoveryEngine\V1\GroundingFact>|\Google\Protobuf\Internal\RepeatedField $grounding_facts + * List of facts to be used for grounding. + * @type array|\Google\Protobuf\Internal\MapField $attributes + * Attributes associated with the content. + * Common attributes include `source` (indicating where the content was + * sourced from) and `author` (indicating the author of the content). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\GroundedGenerationService::initOnce(); + parent::__construct($data); + } + + /** + * List of facts to be used for grounding. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.GroundingFact grounding_facts = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGroundingFacts() + { + return $this->grounding_facts; + } + + /** + * List of facts to be used for grounding. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.GroundingFact grounding_facts = 1; + * @param array<\Google\Cloud\DiscoveryEngine\V1\GroundingFact>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGroundingFacts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\GroundingFact::class); + $this->grounding_facts = $arr; + + return $this; + } + + /** + * Attributes associated with the content. + * Common attributes include `source` (indicating where the content was + * sourced from) and `author` (indicating the author of the content). + * + * Generated from protobuf field map attributes = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * Attributes associated with the content. + * Common attributes include `source` (indicating where the content was + * sourced from) and `author` (indicating the author of the content). + * + * Generated from protobuf field map attributes = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAttributes($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->attributes = $arr; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/GenerateGroundedContentRequest/GroundingSource/SearchSource.php b/DiscoveryEngine/src/V1/GenerateGroundedContentRequest/GroundingSource/SearchSource.php new file mode 100644 index 000000000000..b55ac4302b74 --- /dev/null +++ b/DiscoveryEngine/src/V1/GenerateGroundedContentRequest/GroundingSource/SearchSource.php @@ -0,0 +1,190 @@ +google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSource.SearchSource + */ +class SearchSource extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the Engine to use. + * Format: + * `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}/servingConfigs/{serving_config_id}` + * + * Generated from protobuf field string serving_config = 1 [(.google.api.resource_reference) = { + */ + protected $serving_config = ''; + /** + * Number of search results to return. + * The default value is 10. The maximumm allowed value is 10. + * + * Generated from protobuf field int32 max_result_count = 2; + */ + protected $max_result_count = 0; + /** + * Filter expression to be applied to the search. + * The syntax is the same as + * [SearchRequest.filter][google.cloud.discoveryengine.v1.SearchRequest.filter]. + * + * Generated from protobuf field string filter = 3; + */ + protected $filter = ''; + /** + * If set, safe search is enabled in Vertex AI Search requests. + * + * Generated from protobuf field bool safe_search = 5; + */ + protected $safe_search = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $serving_config + * The resource name of the Engine to use. + * Format: + * `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}/servingConfigs/{serving_config_id}` + * @type int $max_result_count + * Number of search results to return. + * The default value is 10. The maximumm allowed value is 10. + * @type string $filter + * Filter expression to be applied to the search. + * The syntax is the same as + * [SearchRequest.filter][google.cloud.discoveryengine.v1.SearchRequest.filter]. + * @type bool $safe_search + * If set, safe search is enabled in Vertex AI Search requests. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\GroundedGenerationService::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the Engine to use. + * Format: + * `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}/servingConfigs/{serving_config_id}` + * + * Generated from protobuf field string serving_config = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getServingConfig() + { + return $this->serving_config; + } + + /** + * The resource name of the Engine to use. + * Format: + * `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}/servingConfigs/{serving_config_id}` + * + * Generated from protobuf field string serving_config = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setServingConfig($var) + { + GPBUtil::checkString($var, True); + $this->serving_config = $var; + + return $this; + } + + /** + * Number of search results to return. + * The default value is 10. The maximumm allowed value is 10. + * + * Generated from protobuf field int32 max_result_count = 2; + * @return int + */ + public function getMaxResultCount() + { + return $this->max_result_count; + } + + /** + * Number of search results to return. + * The default value is 10. The maximumm allowed value is 10. + * + * Generated from protobuf field int32 max_result_count = 2; + * @param int $var + * @return $this + */ + public function setMaxResultCount($var) + { + GPBUtil::checkInt32($var); + $this->max_result_count = $var; + + return $this; + } + + /** + * Filter expression to be applied to the search. + * The syntax is the same as + * [SearchRequest.filter][google.cloud.discoveryengine.v1.SearchRequest.filter]. + * + * Generated from protobuf field string filter = 3; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Filter expression to be applied to the search. + * The syntax is the same as + * [SearchRequest.filter][google.cloud.discoveryengine.v1.SearchRequest.filter]. + * + * Generated from protobuf field string filter = 3; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * If set, safe search is enabled in Vertex AI Search requests. + * + * Generated from protobuf field bool safe_search = 5; + * @return bool + */ + public function getSafeSearch() + { + return $this->safe_search; + } + + /** + * If set, safe search is enabled in Vertex AI Search requests. + * + * Generated from protobuf field bool safe_search = 5; + * @param bool $var + * @return $this + */ + public function setSafeSearch($var) + { + GPBUtil::checkBool($var); + $this->safe_search = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/GenerateGroundedContentRequest/GroundingSpec.php b/DiscoveryEngine/src/V1/GenerateGroundedContentRequest/GroundingSpec.php new file mode 100644 index 000000000000..fc371d8552df --- /dev/null +++ b/DiscoveryEngine/src/V1/GenerateGroundedContentRequest/GroundingSpec.php @@ -0,0 +1,68 @@ +google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSpec + */ +class GroundingSpec extends \Google\Protobuf\Internal\Message +{ + /** + * Grounding sources. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSource grounding_sources = 1; + */ + private $grounding_sources; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentRequest\GroundingSource>|\Google\Protobuf\Internal\RepeatedField $grounding_sources + * Grounding sources. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\GroundedGenerationService::initOnce(); + parent::__construct($data); + } + + /** + * Grounding sources. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSource grounding_sources = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGroundingSources() + { + return $this->grounding_sources; + } + + /** + * Grounding sources. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSource grounding_sources = 1; + * @param array<\Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentRequest\GroundingSource>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGroundingSources($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentRequest\GroundingSource::class); + $this->grounding_sources = $arr; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/GenerateGroundedContentResponse.php b/DiscoveryEngine/src/V1/GenerateGroundedContentResponse.php new file mode 100644 index 000000000000..7fccd238f7af --- /dev/null +++ b/DiscoveryEngine/src/V1/GenerateGroundedContentResponse.php @@ -0,0 +1,65 @@ +google.cloud.discoveryengine.v1.GenerateGroundedContentResponse + */ +class GenerateGroundedContentResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Generated candidates. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate candidates = 1; + */ + private $candidates; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate>|\Google\Protobuf\Internal\RepeatedField $candidates + * Generated candidates. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\GroundedGenerationService::initOnce(); + parent::__construct($data); + } + + /** + * Generated candidates. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate candidates = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCandidates() + { + return $this->candidates; + } + + /** + * Generated candidates. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate candidates = 1; + * @param array<\Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCandidates($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate::class); + $this->candidates = $arr; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1/GenerateGroundedContentResponse/Candidate.php b/DiscoveryEngine/src/V1/GenerateGroundedContentResponse/Candidate.php new file mode 100644 index 000000000000..794673fedb97 --- /dev/null +++ b/DiscoveryEngine/src/V1/GenerateGroundedContentResponse/Candidate.php @@ -0,0 +1,200 @@ +google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate + */ +class Candidate extends \Google\Protobuf\Internal\Message +{ + /** + * Index of the candidate. + * + * Generated from protobuf field int32 index = 1; + */ + protected $index = 0; + /** + * Content of the candidate. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GroundedGenerationContent content = 2; + */ + protected $content = null; + /** + * The overall grounding score for the candidate, in the range of [0, 1]. + * + * Generated from protobuf field optional float grounding_score = 3; + */ + protected $grounding_score = null; + /** + * Grounding metadata for the generated content. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata grounding_metadata = 4; + */ + protected $grounding_metadata = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $index + * Index of the candidate. + * @type \Google\Cloud\DiscoveryEngine\V1\GroundedGenerationContent $content + * Content of the candidate. + * @type float $grounding_score + * The overall grounding score for the candidate, in the range of [0, 1]. + * @type \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata $grounding_metadata + * Grounding metadata for the generated content. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\GroundedGenerationService::initOnce(); + parent::__construct($data); + } + + /** + * Index of the candidate. + * + * Generated from protobuf field int32 index = 1; + * @return int + */ + public function getIndex() + { + return $this->index; + } + + /** + * Index of the candidate. + * + * Generated from protobuf field int32 index = 1; + * @param int $var + * @return $this + */ + public function setIndex($var) + { + GPBUtil::checkInt32($var); + $this->index = $var; + + return $this; + } + + /** + * Content of the candidate. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GroundedGenerationContent content = 2; + * @return \Google\Cloud\DiscoveryEngine\V1\GroundedGenerationContent|null + */ + public function getContent() + { + return $this->content; + } + + public function hasContent() + { + return isset($this->content); + } + + public function clearContent() + { + unset($this->content); + } + + /** + * Content of the candidate. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GroundedGenerationContent content = 2; + * @param \Google\Cloud\DiscoveryEngine\V1\GroundedGenerationContent $var + * @return $this + */ + public function setContent($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\GroundedGenerationContent::class); + $this->content = $var; + + return $this; + } + + /** + * The overall grounding score for the candidate, in the range of [0, 1]. + * + * Generated from protobuf field optional float grounding_score = 3; + * @return float + */ + public function getGroundingScore() + { + return isset($this->grounding_score) ? $this->grounding_score : 0.0; + } + + public function hasGroundingScore() + { + return isset($this->grounding_score); + } + + public function clearGroundingScore() + { + unset($this->grounding_score); + } + + /** + * The overall grounding score for the candidate, in the range of [0, 1]. + * + * Generated from protobuf field optional float grounding_score = 3; + * @param float $var + * @return $this + */ + public function setGroundingScore($var) + { + GPBUtil::checkFloat($var); + $this->grounding_score = $var; + + return $this; + } + + /** + * Grounding metadata for the generated content. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata grounding_metadata = 4; + * @return \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata|null + */ + public function getGroundingMetadata() + { + return $this->grounding_metadata; + } + + public function hasGroundingMetadata() + { + return isset($this->grounding_metadata); + } + + public function clearGroundingMetadata() + { + unset($this->grounding_metadata); + } + + /** + * Grounding metadata for the generated content. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata grounding_metadata = 4; + * @param \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata $var + * @return $this + */ + public function setGroundingMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata::class); + $this->grounding_metadata = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/GenerateGroundedContentResponse/Candidate/GroundingMetadata.php b/DiscoveryEngine/src/V1/GenerateGroundedContentResponse/Candidate/GroundingMetadata.php new file mode 100644 index 000000000000..e3964f7c856f --- /dev/null +++ b/DiscoveryEngine/src/V1/GenerateGroundedContentResponse/Candidate/GroundingMetadata.php @@ -0,0 +1,238 @@ +google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata + */ +class GroundingMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Retrieval metadata to provide an understanding in the + * retrieval steps performed by the model. There can be multiple such + * messages which can correspond to different parts of the retrieval. This + * is a mechanism used to ensure transparency to our users. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.RetrievalMetadata retrieval_metadata = 5; + */ + private $retrieval_metadata; + /** + * List of chunks to be attributed across all claims in the candidate. + * These are derived from the grounding sources supplied in the request. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.FactChunk support_chunks = 1; + */ + private $support_chunks; + /** + * Web search queries for the following-up web search. + * + * Generated from protobuf field repeated string web_search_queries = 3; + */ + private $web_search_queries; + /** + * Google search entry for the following-up web searches. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.SearchEntryPoint search_entry_point = 4; + */ + protected $search_entry_point = null; + /** + * GroundingSupport across all claims in the answer candidate. + * An support to a fact indicates that the claim is supported by + * the fact. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.GroundingSupport grounding_support = 2; + */ + private $grounding_support; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata\RetrievalMetadata>|\Google\Protobuf\Internal\RepeatedField $retrieval_metadata + * Retrieval metadata to provide an understanding in the + * retrieval steps performed by the model. There can be multiple such + * messages which can correspond to different parts of the retrieval. This + * is a mechanism used to ensure transparency to our users. + * @type array<\Google\Cloud\DiscoveryEngine\V1\FactChunk>|\Google\Protobuf\Internal\RepeatedField $support_chunks + * List of chunks to be attributed across all claims in the candidate. + * These are derived from the grounding sources supplied in the request. + * @type array|\Google\Protobuf\Internal\RepeatedField $web_search_queries + * Web search queries for the following-up web search. + * @type \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata\SearchEntryPoint $search_entry_point + * Google search entry for the following-up web searches. + * @type array<\Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata\GroundingSupport>|\Google\Protobuf\Internal\RepeatedField $grounding_support + * GroundingSupport across all claims in the answer candidate. + * An support to a fact indicates that the claim is supported by + * the fact. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\GroundedGenerationService::initOnce(); + parent::__construct($data); + } + + /** + * Retrieval metadata to provide an understanding in the + * retrieval steps performed by the model. There can be multiple such + * messages which can correspond to different parts of the retrieval. This + * is a mechanism used to ensure transparency to our users. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.RetrievalMetadata retrieval_metadata = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRetrievalMetadata() + { + return $this->retrieval_metadata; + } + + /** + * Retrieval metadata to provide an understanding in the + * retrieval steps performed by the model. There can be multiple such + * messages which can correspond to different parts of the retrieval. This + * is a mechanism used to ensure transparency to our users. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.RetrievalMetadata retrieval_metadata = 5; + * @param array<\Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata\RetrievalMetadata>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRetrievalMetadata($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata\RetrievalMetadata::class); + $this->retrieval_metadata = $arr; + + return $this; + } + + /** + * List of chunks to be attributed across all claims in the candidate. + * These are derived from the grounding sources supplied in the request. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.FactChunk support_chunks = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSupportChunks() + { + return $this->support_chunks; + } + + /** + * List of chunks to be attributed across all claims in the candidate. + * These are derived from the grounding sources supplied in the request. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.FactChunk support_chunks = 1; + * @param array<\Google\Cloud\DiscoveryEngine\V1\FactChunk>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSupportChunks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\FactChunk::class); + $this->support_chunks = $arr; + + return $this; + } + + /** + * Web search queries for the following-up web search. + * + * Generated from protobuf field repeated string web_search_queries = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getWebSearchQueries() + { + return $this->web_search_queries; + } + + /** + * Web search queries for the following-up web search. + * + * Generated from protobuf field repeated string web_search_queries = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setWebSearchQueries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->web_search_queries = $arr; + + return $this; + } + + /** + * Google search entry for the following-up web searches. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.SearchEntryPoint search_entry_point = 4; + * @return \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata\SearchEntryPoint|null + */ + public function getSearchEntryPoint() + { + return $this->search_entry_point; + } + + public function hasSearchEntryPoint() + { + return isset($this->search_entry_point); + } + + public function clearSearchEntryPoint() + { + unset($this->search_entry_point); + } + + /** + * Google search entry for the following-up web searches. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.SearchEntryPoint search_entry_point = 4; + * @param \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata\SearchEntryPoint $var + * @return $this + */ + public function setSearchEntryPoint($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata\SearchEntryPoint::class); + $this->search_entry_point = $var; + + return $this; + } + + /** + * GroundingSupport across all claims in the answer candidate. + * An support to a fact indicates that the claim is supported by + * the fact. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.GroundingSupport grounding_support = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGroundingSupport() + { + return $this->grounding_support; + } + + /** + * GroundingSupport across all claims in the answer candidate. + * An support to a fact indicates that the claim is supported by + * the fact. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.GroundingSupport grounding_support = 2; + * @param array<\Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata\GroundingSupport>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGroundingSupport($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata\GroundingSupport::class); + $this->grounding_support = $arr; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/GenerateGroundedContentResponse/Candidate/GroundingMetadata/DynamicRetrievalMetadata.php b/DiscoveryEngine/src/V1/GenerateGroundedContentResponse/Candidate/GroundingMetadata/DynamicRetrievalMetadata.php new file mode 100644 index 000000000000..1a4f54402b27 --- /dev/null +++ b/DiscoveryEngine/src/V1/GenerateGroundedContentResponse/Candidate/GroundingMetadata/DynamicRetrievalMetadata.php @@ -0,0 +1,78 @@ +google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.DynamicRetrievalMetadata + */ +class DynamicRetrievalMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Metadata for the dynamic retrieval predictor. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.DynamicRetrievalPredictorMetadata predictor_metadata = 1; + */ + protected $predictor_metadata = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata\DynamicRetrievalPredictorMetadata $predictor_metadata + * Metadata for the dynamic retrieval predictor. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\GroundedGenerationService::initOnce(); + parent::__construct($data); + } + + /** + * Metadata for the dynamic retrieval predictor. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.DynamicRetrievalPredictorMetadata predictor_metadata = 1; + * @return \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata\DynamicRetrievalPredictorMetadata|null + */ + public function getPredictorMetadata() + { + return $this->predictor_metadata; + } + + public function hasPredictorMetadata() + { + return isset($this->predictor_metadata); + } + + public function clearPredictorMetadata() + { + unset($this->predictor_metadata); + } + + /** + * Metadata for the dynamic retrieval predictor. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.DynamicRetrievalPredictorMetadata predictor_metadata = 1; + * @param \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata\DynamicRetrievalPredictorMetadata $var + * @return $this + */ + public function setPredictorMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata\DynamicRetrievalPredictorMetadata::class); + $this->predictor_metadata = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/GenerateGroundedContentResponse/Candidate/GroundingMetadata/DynamicRetrievalPredictorMetadata.php b/DiscoveryEngine/src/V1/GenerateGroundedContentResponse/Candidate/GroundingMetadata/DynamicRetrievalPredictorMetadata.php new file mode 100644 index 000000000000..09207799172c --- /dev/null +++ b/DiscoveryEngine/src/V1/GenerateGroundedContentResponse/Candidate/GroundingMetadata/DynamicRetrievalPredictorMetadata.php @@ -0,0 +1,128 @@ +google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.DynamicRetrievalPredictorMetadata + */ +class DynamicRetrievalPredictorMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The version of the predictor which was used in dynamic retrieval. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.DynamicRetrievalPredictorMetadata.Version version = 1; + */ + protected $version = 0; + /** + * The value of the predictor. This should be between [0, 1] where + * a value of 0 means that the query would not benefit from grounding, + * while a value of 1.0 means that the query would benefit the most. + * In between values allow to differentiate between different usefulness + * scores for grounding. + * + * Generated from protobuf field optional float prediction = 2; + */ + protected $prediction = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $version + * The version of the predictor which was used in dynamic retrieval. + * @type float $prediction + * The value of the predictor. This should be between [0, 1] where + * a value of 0 means that the query would not benefit from grounding, + * while a value of 1.0 means that the query would benefit the most. + * In between values allow to differentiate between different usefulness + * scores for grounding. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\GroundedGenerationService::initOnce(); + parent::__construct($data); + } + + /** + * The version of the predictor which was used in dynamic retrieval. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.DynamicRetrievalPredictorMetadata.Version version = 1; + * @return int + */ + public function getVersion() + { + return $this->version; + } + + /** + * The version of the predictor which was used in dynamic retrieval. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.DynamicRetrievalPredictorMetadata.Version version = 1; + * @param int $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata\DynamicRetrievalPredictorMetadata\Version::class); + $this->version = $var; + + return $this; + } + + /** + * The value of the predictor. This should be between [0, 1] where + * a value of 0 means that the query would not benefit from grounding, + * while a value of 1.0 means that the query would benefit the most. + * In between values allow to differentiate between different usefulness + * scores for grounding. + * + * Generated from protobuf field optional float prediction = 2; + * @return float + */ + public function getPrediction() + { + return isset($this->prediction) ? $this->prediction : 0.0; + } + + public function hasPrediction() + { + return isset($this->prediction); + } + + public function clearPrediction() + { + unset($this->prediction); + } + + /** + * The value of the predictor. This should be between [0, 1] where + * a value of 0 means that the query would not benefit from grounding, + * while a value of 1.0 means that the query would benefit the most. + * In between values allow to differentiate between different usefulness + * scores for grounding. + * + * Generated from protobuf field optional float prediction = 2; + * @param float $var + * @return $this + */ + public function setPrediction($var) + { + GPBUtil::checkFloat($var); + $this->prediction = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/GenerateGroundedContentResponse/Candidate/GroundingMetadata/DynamicRetrievalPredictorMetadata/Version.php b/DiscoveryEngine/src/V1/GenerateGroundedContentResponse/Candidate/GroundingMetadata/DynamicRetrievalPredictorMetadata/Version.php new file mode 100644 index 000000000000..30ec19cc89e1 --- /dev/null +++ b/DiscoveryEngine/src/V1/GenerateGroundedContentResponse/Candidate/GroundingMetadata/DynamicRetrievalPredictorMetadata/Version.php @@ -0,0 +1,55 @@ +google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.DynamicRetrievalPredictorMetadata.Version + */ +class Version +{ + /** + * Unspecified version, should never be used. + * + * Generated from protobuf enum VERSION_UNSPECIFIED = 0; + */ + const VERSION_UNSPECIFIED = 0; + /** + * The V1 model which is evaluating each source independently. + * + * Generated from protobuf enum V1_INDEPENDENT = 1; + */ + const V1_INDEPENDENT = 1; + + private static $valueToName = [ + self::VERSION_UNSPECIFIED => 'VERSION_UNSPECIFIED', + self::V1_INDEPENDENT => 'V1_INDEPENDENT', + ]; + + 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/DiscoveryEngine/src/V1/GenerateGroundedContentResponse/Candidate/GroundingMetadata/GroundingSupport.php b/DiscoveryEngine/src/V1/GenerateGroundedContentResponse/Candidate/GroundingMetadata/GroundingSupport.php new file mode 100644 index 000000000000..4e68b69f4502 --- /dev/null +++ b/DiscoveryEngine/src/V1/GenerateGroundedContentResponse/Candidate/GroundingMetadata/GroundingSupport.php @@ -0,0 +1,170 @@ +google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.GroundingSupport + */ +class GroundingSupport extends \Google\Protobuf\Internal\Message +{ + /** + * Text for the claim in the candidate. Always provided when a + * support is found. + * + * Generated from protobuf field string claim_text = 1; + */ + protected $claim_text = ''; + /** + * A list of indices (into 'support_chunks') specifying the + * citations associated with the claim. For instance [1,3,4] means + * that support_chunks[1], support_chunks[3], + * support_chunks[4] are the chunks attributed to the claim. + * + * Generated from protobuf field repeated int32 support_chunk_indices = 3; + */ + private $support_chunk_indices; + /** + * A score in the range of [0, 1] describing how grounded is a specific + * claim in the support chunks indicated. + * Higher value means that the claim is better supported by the chunks. + * + * Generated from protobuf field optional float support_score = 2; + */ + protected $support_score = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $claim_text + * Text for the claim in the candidate. Always provided when a + * support is found. + * @type array|\Google\Protobuf\Internal\RepeatedField $support_chunk_indices + * A list of indices (into 'support_chunks') specifying the + * citations associated with the claim. For instance [1,3,4] means + * that support_chunks[1], support_chunks[3], + * support_chunks[4] are the chunks attributed to the claim. + * @type float $support_score + * A score in the range of [0, 1] describing how grounded is a specific + * claim in the support chunks indicated. + * Higher value means that the claim is better supported by the chunks. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\GroundedGenerationService::initOnce(); + parent::__construct($data); + } + + /** + * Text for the claim in the candidate. Always provided when a + * support is found. + * + * Generated from protobuf field string claim_text = 1; + * @return string + */ + public function getClaimText() + { + return $this->claim_text; + } + + /** + * Text for the claim in the candidate. Always provided when a + * support is found. + * + * Generated from protobuf field string claim_text = 1; + * @param string $var + * @return $this + */ + public function setClaimText($var) + { + GPBUtil::checkString($var, True); + $this->claim_text = $var; + + return $this; + } + + /** + * A list of indices (into 'support_chunks') specifying the + * citations associated with the claim. For instance [1,3,4] means + * that support_chunks[1], support_chunks[3], + * support_chunks[4] are the chunks attributed to the claim. + * + * Generated from protobuf field repeated int32 support_chunk_indices = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSupportChunkIndices() + { + return $this->support_chunk_indices; + } + + /** + * A list of indices (into 'support_chunks') specifying the + * citations associated with the claim. For instance [1,3,4] means + * that support_chunks[1], support_chunks[3], + * support_chunks[4] are the chunks attributed to the claim. + * + * Generated from protobuf field repeated int32 support_chunk_indices = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSupportChunkIndices($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); + $this->support_chunk_indices = $arr; + + return $this; + } + + /** + * A score in the range of [0, 1] describing how grounded is a specific + * claim in the support chunks indicated. + * Higher value means that the claim is better supported by the chunks. + * + * Generated from protobuf field optional float support_score = 2; + * @return float + */ + public function getSupportScore() + { + return isset($this->support_score) ? $this->support_score : 0.0; + } + + public function hasSupportScore() + { + return isset($this->support_score); + } + + public function clearSupportScore() + { + unset($this->support_score); + } + + /** + * A score in the range of [0, 1] describing how grounded is a specific + * claim in the support chunks indicated. + * Higher value means that the claim is better supported by the chunks. + * + * Generated from protobuf field optional float support_score = 2; + * @param float $var + * @return $this + */ + public function setSupportScore($var) + { + GPBUtil::checkFloat($var); + $this->support_score = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/GenerateGroundedContentResponse/Candidate/GroundingMetadata/RetrievalMetadata.php b/DiscoveryEngine/src/V1/GenerateGroundedContentResponse/Candidate/GroundingMetadata/RetrievalMetadata.php new file mode 100644 index 000000000000..e6273801e7e6 --- /dev/null +++ b/DiscoveryEngine/src/V1/GenerateGroundedContentResponse/Candidate/GroundingMetadata/RetrievalMetadata.php @@ -0,0 +1,112 @@ +google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.RetrievalMetadata + */ +class RetrievalMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Describes the source to which the metadata is referring to. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.RetrievalMetadata.Source source = 1; + */ + protected $source = 0; + /** + * Metadata for dynamic retrieval. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.DynamicRetrievalMetadata dynamic_retrieval_metadata = 2; + */ + protected $dynamic_retrieval_metadata = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $source + * Describes the source to which the metadata is referring to. + * @type \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata\DynamicRetrievalMetadata $dynamic_retrieval_metadata + * Metadata for dynamic retrieval. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\GroundedGenerationService::initOnce(); + parent::__construct($data); + } + + /** + * Describes the source to which the metadata is referring to. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.RetrievalMetadata.Source source = 1; + * @return int + */ + public function getSource() + { + return $this->source; + } + + /** + * Describes the source to which the metadata is referring to. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.RetrievalMetadata.Source source = 1; + * @param int $var + * @return $this + */ + public function setSource($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata\RetrievalMetadata\Source::class); + $this->source = $var; + + return $this; + } + + /** + * Metadata for dynamic retrieval. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.DynamicRetrievalMetadata dynamic_retrieval_metadata = 2; + * @return \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata\DynamicRetrievalMetadata|null + */ + public function getDynamicRetrievalMetadata() + { + return $this->dynamic_retrieval_metadata; + } + + public function hasDynamicRetrievalMetadata() + { + return isset($this->dynamic_retrieval_metadata); + } + + public function clearDynamicRetrievalMetadata() + { + unset($this->dynamic_retrieval_metadata); + } + + /** + * Metadata for dynamic retrieval. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.DynamicRetrievalMetadata dynamic_retrieval_metadata = 2; + * @param \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata\DynamicRetrievalMetadata $var + * @return $this + */ + public function setDynamicRetrievalMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse\Candidate\GroundingMetadata\DynamicRetrievalMetadata::class); + $this->dynamic_retrieval_metadata = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/GenerateGroundedContentResponse/Candidate/GroundingMetadata/RetrievalMetadata/Source.php b/DiscoveryEngine/src/V1/GenerateGroundedContentResponse/Candidate/GroundingMetadata/RetrievalMetadata/Source.php new file mode 100644 index 000000000000..f635460ed8dd --- /dev/null +++ b/DiscoveryEngine/src/V1/GenerateGroundedContentResponse/Candidate/GroundingMetadata/RetrievalMetadata/Source.php @@ -0,0 +1,76 @@ +google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.RetrievalMetadata.Source + */ +class Source +{ + /** + * Unspecified source. + * + * Generated from protobuf enum SOURCE_UNSPECIFIED = 0; + */ + const SOURCE_UNSPECIFIED = 0; + /** + * Vertex AI search. + * + * Generated from protobuf enum VERTEX_AI_SEARCH = 1; + */ + const VERTEX_AI_SEARCH = 1; + /** + * Google Search. + * + * Generated from protobuf enum GOOGLE_SEARCH = 3; + */ + const GOOGLE_SEARCH = 3; + /** + * User inline provided content. + * + * Generated from protobuf enum INLINE_CONTENT = 2; + */ + const INLINE_CONTENT = 2; + /** + * Google Maps. + * + * Generated from protobuf enum GOOGLE_MAPS = 4; + */ + const GOOGLE_MAPS = 4; + + private static $valueToName = [ + self::SOURCE_UNSPECIFIED => 'SOURCE_UNSPECIFIED', + self::VERTEX_AI_SEARCH => 'VERTEX_AI_SEARCH', + self::GOOGLE_SEARCH => 'GOOGLE_SEARCH', + self::INLINE_CONTENT => 'INLINE_CONTENT', + self::GOOGLE_MAPS => 'GOOGLE_MAPS', + ]; + + 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/DiscoveryEngine/src/V1/GenerateGroundedContentResponse/Candidate/GroundingMetadata/SearchEntryPoint.php b/DiscoveryEngine/src/V1/GenerateGroundedContentResponse/Candidate/GroundingMetadata/SearchEntryPoint.php new file mode 100644 index 000000000000..1e61988c5f57 --- /dev/null +++ b/DiscoveryEngine/src/V1/GenerateGroundedContentResponse/Candidate/GroundingMetadata/SearchEntryPoint.php @@ -0,0 +1,110 @@ +google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.SearchEntryPoint + */ +class SearchEntryPoint extends \Google\Protobuf\Internal\Message +{ + /** + * Web content snippet that can be embedded in a web page or an app + * webview. + * + * Generated from protobuf field string rendered_content = 1; + */ + protected $rendered_content = ''; + /** + * Base64 encoded JSON representing array of + * tuple. + * + * Generated from protobuf field bytes sdk_blob = 2; + */ + protected $sdk_blob = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $rendered_content + * Web content snippet that can be embedded in a web page or an app + * webview. + * @type string $sdk_blob + * Base64 encoded JSON representing array of + * tuple. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\GroundedGenerationService::initOnce(); + parent::__construct($data); + } + + /** + * Web content snippet that can be embedded in a web page or an app + * webview. + * + * Generated from protobuf field string rendered_content = 1; + * @return string + */ + public function getRenderedContent() + { + return $this->rendered_content; + } + + /** + * Web content snippet that can be embedded in a web page or an app + * webview. + * + * Generated from protobuf field string rendered_content = 1; + * @param string $var + * @return $this + */ + public function setRenderedContent($var) + { + GPBUtil::checkString($var, True); + $this->rendered_content = $var; + + return $this; + } + + /** + * Base64 encoded JSON representing array of + * tuple. + * + * Generated from protobuf field bytes sdk_blob = 2; + * @return string + */ + public function getSdkBlob() + { + return $this->sdk_blob; + } + + /** + * Base64 encoded JSON representing array of + * tuple. + * + * Generated from protobuf field bytes sdk_blob = 2; + * @param string $var + * @return $this + */ + public function setSdkBlob($var) + { + GPBUtil::checkString($var, False); + $this->sdk_blob = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/GetAnswerRequest.php b/DiscoveryEngine/src/V1/GetAnswerRequest.php index 15f35eb2bc75..624260872ffc 100644 --- a/DiscoveryEngine/src/V1/GetAnswerRequest.php +++ b/DiscoveryEngine/src/V1/GetAnswerRequest.php @@ -17,7 +17,7 @@ class GetAnswerRequest extends \Google\Protobuf\Internal\Message { /** * Required. The resource name of the Answer to get. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/engines/{engine_id}/sessions/{session_id}/answers/{answer_id}` + * `projects/{project}/locations/{location}/collections/{collection}/engines/{engine_id}/sessions/{session_id}/answers/{answer_id}` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -25,7 +25,7 @@ class GetAnswerRequest extends \Google\Protobuf\Internal\Message /** * @param string $name Required. The resource name of the Answer to get. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/engines/{engine_id}/sessions/{session_id}/answers/{answer_id}` + * `projects/{project}/locations/{location}/collections/{collection}/engines/{engine_id}/sessions/{session_id}/answers/{answer_id}` * Please see {@see ConversationalSearchServiceClient::answerName()} for help formatting this field. * * @return \Google\Cloud\DiscoveryEngine\V1\GetAnswerRequest @@ -46,7 +46,7 @@ public static function build(string $name): self * * @type string $name * Required. The resource name of the Answer to get. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/engines/{engine_id}/sessions/{session_id}/answers/{answer_id}` + * `projects/{project}/locations/{location}/collections/{collection}/engines/{engine_id}/sessions/{session_id}/answers/{answer_id}` * } */ public function __construct($data = NULL) { @@ -56,7 +56,7 @@ public function __construct($data = NULL) { /** * Required. The resource name of the Answer to get. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/engines/{engine_id}/sessions/{session_id}/answers/{answer_id}` + * `projects/{project}/locations/{location}/collections/{collection}/engines/{engine_id}/sessions/{session_id}/answers/{answer_id}` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -68,7 +68,7 @@ public function getName() /** * Required. The resource name of the Answer to get. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/engines/{engine_id}/sessions/{session_id}/answers/{answer_id}` + * `projects/{project}/locations/{location}/collections/{collection}/engines/{engine_id}/sessions/{session_id}/answers/{answer_id}` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/DiscoveryEngine/src/V1/GetControlRequest.php b/DiscoveryEngine/src/V1/GetControlRequest.php index 083e30a65dfc..a477700e21c1 100644 --- a/DiscoveryEngine/src/V1/GetControlRequest.php +++ b/DiscoveryEngine/src/V1/GetControlRequest.php @@ -17,7 +17,7 @@ class GetControlRequest extends \Google\Protobuf\Internal\Message { /** * Required. The resource name of the Control to get. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` + * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -25,7 +25,7 @@ class GetControlRequest extends \Google\Protobuf\Internal\Message /** * @param string $name Required. The resource name of the Control to get. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` + * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` * Please see {@see ControlServiceClient::controlName()} for help formatting this field. * * @return \Google\Cloud\DiscoveryEngine\V1\GetControlRequest @@ -46,7 +46,7 @@ public static function build(string $name): self * * @type string $name * Required. The resource name of the Control to get. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` + * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` * } */ public function __construct($data = NULL) { @@ -56,7 +56,7 @@ public function __construct($data = NULL) { /** * Required. The resource name of the Control to get. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` + * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -68,7 +68,7 @@ public function getName() /** * Required. The resource name of the Control to get. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` + * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/DiscoveryEngine/src/V1/GetConversationRequest.php b/DiscoveryEngine/src/V1/GetConversationRequest.php index 833c847e2909..52237d85f733 100644 --- a/DiscoveryEngine/src/V1/GetConversationRequest.php +++ b/DiscoveryEngine/src/V1/GetConversationRequest.php @@ -17,7 +17,7 @@ class GetConversationRequest extends \Google\Protobuf\Internal\Message { /** * Required. The resource name of the Conversation to get. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -25,7 +25,7 @@ class GetConversationRequest extends \Google\Protobuf\Internal\Message /** * @param string $name Required. The resource name of the Conversation to get. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` * Please see {@see ConversationalSearchServiceClient::conversationName()} for help formatting this field. * * @return \Google\Cloud\DiscoveryEngine\V1\GetConversationRequest @@ -46,7 +46,7 @@ public static function build(string $name): self * * @type string $name * Required. The resource name of the Conversation to get. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` * } */ public function __construct($data = NULL) { @@ -56,7 +56,7 @@ public function __construct($data = NULL) { /** * Required. The resource name of the Conversation to get. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -68,7 +68,7 @@ public function getName() /** * Required. The resource name of the Conversation to get. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/DiscoveryEngine/src/V1/GetSessionRequest.php b/DiscoveryEngine/src/V1/GetSessionRequest.php index dd3fa5c5da5f..cee01b9265bc 100644 --- a/DiscoveryEngine/src/V1/GetSessionRequest.php +++ b/DiscoveryEngine/src/V1/GetSessionRequest.php @@ -17,7 +17,7 @@ class GetSessionRequest extends \Google\Protobuf\Internal\Message { /** * Required. The resource name of the Session to get. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -25,7 +25,7 @@ class GetSessionRequest extends \Google\Protobuf\Internal\Message /** * @param string $name Required. The resource name of the Session to get. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` * Please see {@see ConversationalSearchServiceClient::sessionName()} for help formatting this field. * * @return \Google\Cloud\DiscoveryEngine\V1\GetSessionRequest @@ -46,7 +46,7 @@ public static function build(string $name): self * * @type string $name * Required. The resource name of the Session to get. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` * } */ public function __construct($data = NULL) { @@ -56,7 +56,7 @@ public function __construct($data = NULL) { /** * Required. The resource name of the Session to get. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -68,7 +68,7 @@ public function getName() /** * Required. The resource name of the Session to get. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/DiscoveryEngine/src/V1/GroundedGenerationContent.php b/DiscoveryEngine/src/V1/GroundedGenerationContent.php new file mode 100644 index 000000000000..b0e40bee2852 --- /dev/null +++ b/DiscoveryEngine/src/V1/GroundedGenerationContent.php @@ -0,0 +1,109 @@ +google.cloud.discoveryengine.v1.GroundedGenerationContent + */ +class GroundedGenerationContent extends \Google\Protobuf\Internal\Message +{ + /** + * Producer of the content. Must be either `user` or `model`. + * Intended to be used for multi-turn conversations. Otherwise, it can be left + * unset. + * + * Generated from protobuf field string role = 1; + */ + protected $role = ''; + /** + * Ordered `Parts` that constitute a single message. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.GroundedGenerationContent.Part parts = 2; + */ + private $parts; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $role + * Producer of the content. Must be either `user` or `model`. + * Intended to be used for multi-turn conversations. Otherwise, it can be left + * unset. + * @type array<\Google\Cloud\DiscoveryEngine\V1\GroundedGenerationContent\Part>|\Google\Protobuf\Internal\RepeatedField $parts + * Ordered `Parts` that constitute a single message. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\GroundedGenerationService::initOnce(); + parent::__construct($data); + } + + /** + * Producer of the content. Must be either `user` or `model`. + * Intended to be used for multi-turn conversations. Otherwise, it can be left + * unset. + * + * Generated from protobuf field string role = 1; + * @return string + */ + public function getRole() + { + return $this->role; + } + + /** + * Producer of the content. Must be either `user` or `model`. + * Intended to be used for multi-turn conversations. Otherwise, it can be left + * unset. + * + * Generated from protobuf field string role = 1; + * @param string $var + * @return $this + */ + public function setRole($var) + { + GPBUtil::checkString($var, True); + $this->role = $var; + + return $this; + } + + /** + * Ordered `Parts` that constitute a single message. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.GroundedGenerationContent.Part parts = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getParts() + { + return $this->parts; + } + + /** + * Ordered `Parts` that constitute a single message. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.GroundedGenerationContent.Part parts = 2; + * @param array<\Google\Cloud\DiscoveryEngine\V1\GroundedGenerationContent\Part>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setParts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\GroundedGenerationContent\Part::class); + $this->parts = $arr; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1/GroundedGenerationContent/Part.php b/DiscoveryEngine/src/V1/GroundedGenerationContent/Part.php new file mode 100644 index 000000000000..8cea7f9b48b6 --- /dev/null +++ b/DiscoveryEngine/src/V1/GroundedGenerationContent/Part.php @@ -0,0 +1,76 @@ +google.cloud.discoveryengine.v1.GroundedGenerationContent.Part + */ +class Part extends \Google\Protobuf\Internal\Message +{ + protected $data; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * Inline text. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\GroundedGenerationService::initOnce(); + parent::__construct($data); + } + + /** + * Inline text. + * + * Generated from protobuf field string text = 1; + * @return string + */ + public function getText() + { + return $this->readOneof(1); + } + + public function hasText() + { + return $this->hasOneof(1); + } + + /** + * Inline text. + * + * Generated from protobuf field string text = 1; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getData() + { + return $this->whichOneof("data"); + } + +} + + diff --git a/DiscoveryEngine/src/V1/ListControlsRequest.php b/DiscoveryEngine/src/V1/ListControlsRequest.php index c980c9323f2d..6f617ecbea6f 100644 --- a/DiscoveryEngine/src/V1/ListControlsRequest.php +++ b/DiscoveryEngine/src/V1/ListControlsRequest.php @@ -17,9 +17,9 @@ class ListControlsRequest extends \Google\Protobuf\Internal\Message { /** * Required. The data store resource name. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}` + * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}` * or - * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`. + * `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -50,9 +50,9 @@ class ListControlsRequest extends \Google\Protobuf\Internal\Message /** * @param string $parent Required. The data store resource name. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}` + * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}` * or - * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`. Please see + * `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. Please see * {@see ControlServiceClient::dataStoreName()} for help formatting this field. * * @return \Google\Cloud\DiscoveryEngine\V1\ListControlsRequest @@ -73,9 +73,9 @@ public static function build(string $parent): self * * @type string $parent * Required. The data store resource name. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}` + * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}` * or - * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`. + * `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. * @type int $page_size * Optional. Maximum number of results to return. If unspecified, defaults * to 50. Max allowed value is 1000. @@ -96,9 +96,9 @@ public function __construct($data = NULL) { /** * Required. The data store resource name. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}` + * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}` * or - * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`. + * `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -110,9 +110,9 @@ public function getParent() /** * Required. The data store resource name. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}` + * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}` * or - * `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`. + * `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/DiscoveryEngine/src/V1/ListConversationsRequest.php b/DiscoveryEngine/src/V1/ListConversationsRequest.php index 8a934e8645dd..0168464597dd 100644 --- a/DiscoveryEngine/src/V1/ListConversationsRequest.php +++ b/DiscoveryEngine/src/V1/ListConversationsRequest.php @@ -17,7 +17,7 @@ class ListConversationsRequest extends \Google\Protobuf\Internal\Message { /** * Required. The data store resource name. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -62,7 +62,7 @@ class ListConversationsRequest extends \Google\Protobuf\Internal\Message /** * @param string $parent Required. The data store resource name. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` * Please see {@see ConversationalSearchServiceClient::dataStoreName()} for help formatting this field. * * @return \Google\Cloud\DiscoveryEngine\V1\ListConversationsRequest @@ -83,7 +83,7 @@ public static function build(string $parent): self * * @type string $parent * Required. The data store resource name. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` * @type int $page_size * Maximum number of results to return. If unspecified, defaults * to 50. Max allowed value is 1000. @@ -114,7 +114,7 @@ public function __construct($data = NULL) { /** * Required. The data store resource name. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -126,7 +126,7 @@ public function getParent() /** * Required. The data store resource name. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/DiscoveryEngine/src/V1/ListSessionsRequest.php b/DiscoveryEngine/src/V1/ListSessionsRequest.php index ce9a4ffb95c8..9788fe85f40c 100644 --- a/DiscoveryEngine/src/V1/ListSessionsRequest.php +++ b/DiscoveryEngine/src/V1/ListSessionsRequest.php @@ -17,7 +17,7 @@ class ListSessionsRequest extends \Google\Protobuf\Internal\Message { /** * Required. The data store resource name. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -62,7 +62,7 @@ class ListSessionsRequest extends \Google\Protobuf\Internal\Message /** * @param string $parent Required. The data store resource name. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` * Please see {@see ConversationalSearchServiceClient::dataStoreName()} for help formatting this field. * * @return \Google\Cloud\DiscoveryEngine\V1\ListSessionsRequest @@ -83,7 +83,7 @@ public static function build(string $parent): self * * @type string $parent * Required. The data store resource name. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` * @type int $page_size * Maximum number of results to return. If unspecified, defaults * to 50. Max allowed value is 1000. @@ -114,7 +114,7 @@ public function __construct($data = NULL) { /** * Required. The data store resource name. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -126,7 +126,7 @@ public function getParent() /** * Required. The data store resource name. Format: - * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}` + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/DiscoveryEngine/src/V1/Project.php b/DiscoveryEngine/src/V1/Project.php index bb68bc5df75e..5af8ff910b7e 100644 --- a/DiscoveryEngine/src/V1/Project.php +++ b/DiscoveryEngine/src/V1/Project.php @@ -17,7 +17,7 @@ class Project extends \Google\Protobuf\Internal\Message { /** * Output only. Full resource name of the project, for example - * `projects/{project_number}`. + * `projects/{project}`. * Note that when making requests, project number and project id are both * acceptable, but the server will always respond in project number. * @@ -54,7 +54,7 @@ class Project extends \Google\Protobuf\Internal\Message * * @type string $name * Output only. Full resource name of the project, for example - * `projects/{project_number}`. + * `projects/{project}`. * Note that when making requests, project number and project id are both * acceptable, but the server will always respond in project number. * @type \Google\Protobuf\Timestamp $create_time @@ -75,7 +75,7 @@ public function __construct($data = NULL) { /** * Output only. Full resource name of the project, for example - * `projects/{project_number}`. + * `projects/{project}`. * Note that when making requests, project number and project id are both * acceptable, but the server will always respond in project number. * @@ -89,7 +89,7 @@ public function getName() /** * Output only. Full resource name of the project, for example - * `projects/{project_number}`. + * `projects/{project}`. * Note that when making requests, project number and project id are both * acceptable, but the server will always respond in project number. * diff --git a/DiscoveryEngine/src/V1/PurgeUserEventsRequest.php b/DiscoveryEngine/src/V1/PurgeUserEventsRequest.php index c9549b1fd46e..7557c8a63bdc 100644 --- a/DiscoveryEngine/src/V1/PurgeUserEventsRequest.php +++ b/DiscoveryEngine/src/V1/PurgeUserEventsRequest.php @@ -18,7 +18,7 @@ class PurgeUserEventsRequest extends \Google\Protobuf\Internal\Message /** * Required. The resource name of the catalog under which the events are * created. The format is - * `projects/{project}/locations/global/collections/{collection}/dataStores/{dataStore}` + * `projects/{project}/locations/global/collections/{collection}/dataStores/{dataStore}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -70,7 +70,7 @@ class PurgeUserEventsRequest extends \Google\Protobuf\Internal\Message * @type string $parent * Required. The resource name of the catalog under which the events are * created. The format is - * `projects/{project}/locations/global/collections/{collection}/dataStores/{dataStore}` + * `projects/{project}/locations/global/collections/{collection}/dataStores/{dataStore}`. * @type string $filter * Required. The filter string to specify the events to be deleted with a * length limit of 5,000 characters. The eligible fields for filtering are: @@ -110,7 +110,7 @@ public function __construct($data = NULL) { /** * Required. The resource name of the catalog under which the events are * created. The format is - * `projects/{project}/locations/global/collections/{collection}/dataStores/{dataStore}` + * `projects/{project}/locations/global/collections/{collection}/dataStores/{dataStore}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -123,7 +123,7 @@ public function getParent() /** * Required. The resource name of the catalog under which the events are * created. The format is - * `projects/{project}/locations/global/collections/{collection}/dataStores/{dataStore}` + * `projects/{project}/locations/global/collections/{collection}/dataStores/{dataStore}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/DiscoveryEngine/src/V1/RankRequest.php b/DiscoveryEngine/src/V1/RankRequest.php index 2a243f093ecb..37ff3389d13c 100644 --- a/DiscoveryEngine/src/V1/RankRequest.php +++ b/DiscoveryEngine/src/V1/RankRequest.php @@ -18,7 +18,7 @@ class RankRequest extends \Google\Protobuf\Internal\Message { /** * Required. The resource name of the rank service config, such as - * `projects/{project_num}/locations/{location_id}/rankingConfigs/default_ranking_config`. + * `projects/{project_num}/locations/{location}/rankingConfigs/default_ranking_config`. * * Generated from protobuf field string ranking_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -87,7 +87,7 @@ class RankRequest extends \Google\Protobuf\Internal\Message * * @type string $ranking_config * Required. The resource name of the rank service config, such as - * `projects/{project_num}/locations/{location_id}/rankingConfigs/default_ranking_config`. + * `projects/{project_num}/locations/{location}/rankingConfigs/default_ranking_config`. * @type string $model * The identifier of the model to use. It is one of: * * `semantic-ranker-512@latest`: Semantic ranking model with maxiumn input @@ -128,7 +128,7 @@ public function __construct($data = NULL) { /** * Required. The resource name of the rank service config, such as - * `projects/{project_num}/locations/{location_id}/rankingConfigs/default_ranking_config`. + * `projects/{project_num}/locations/{location}/rankingConfigs/default_ranking_config`. * * Generated from protobuf field string ranking_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -140,7 +140,7 @@ public function getRankingConfig() /** * Required. The resource name of the rank service config, such as - * `projects/{project_num}/locations/{location_id}/rankingConfigs/default_ranking_config`. + * `projects/{project_num}/locations/{location}/rankingConfigs/default_ranking_config`. * * Generated from protobuf field string ranking_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/DiscoveryEngine/src/V1/RecrawlUrisRequest.php b/DiscoveryEngine/src/V1/RecrawlUrisRequest.php index 4074c86d35e8..c06134acc221 100644 --- a/DiscoveryEngine/src/V1/RecrawlUrisRequest.php +++ b/DiscoveryEngine/src/V1/RecrawlUrisRequest.php @@ -34,6 +34,14 @@ class RecrawlUrisRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field repeated string uris = 2 [(.google.api.field_behavior) = REQUIRED]; */ private $uris; + /** + * Optional. Full resource name of the [SiteCredential][], such as + * `projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/siteCredentials/*`. + * Only set to crawl private URIs. + * + * Generated from protobuf field string site_credential = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $site_credential = ''; /** * Constructor. @@ -50,6 +58,10 @@ class RecrawlUrisRequest extends \Google\Protobuf\Internal\Message * an INVALID_ARGUMENT error is thrown. Each URI should match at least one * [TargetSite][google.cloud.discoveryengine.v1.TargetSite] in * `site_search_engine`. + * @type string $site_credential + * Optional. Full resource name of the [SiteCredential][], such as + * `projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/siteCredentials/*`. + * Only set to crawl private URIs. * } */ public function __construct($data = NULL) { @@ -119,5 +131,35 @@ public function setUris($var) return $this; } + /** + * Optional. Full resource name of the [SiteCredential][], such as + * `projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/siteCredentials/*`. + * Only set to crawl private URIs. + * + * Generated from protobuf field string site_credential = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSiteCredential() + { + return $this->site_credential; + } + + /** + * Optional. Full resource name of the [SiteCredential][], such as + * `projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/siteCredentials/*`. + * Only set to crawl private URIs. + * + * Generated from protobuf field string site_credential = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSiteCredential($var) + { + GPBUtil::checkString($var, True); + $this->site_credential = $var; + + return $this; + } + } diff --git a/DiscoveryEngine/src/V1/SearchRequest.php b/DiscoveryEngine/src/V1/SearchRequest.php index 7a7ce92eeccb..64d4084b0fcd 100644 --- a/DiscoveryEngine/src/V1/SearchRequest.php +++ b/DiscoveryEngine/src/V1/SearchRequest.php @@ -85,6 +85,14 @@ class SearchRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field int32 offset = 6; */ protected $offset = 0; + /** + * The maximum number of results to return for OneBox. + * This applies to each OneBox type individually. + * Default number is 10. + * + * Generated from protobuf field int32 one_box_page_size = 47; + */ + protected $one_box_page_size = 0; /** * Specs defining dataStores to filter on in a search call and configurations * for those dataStores. This is only considered for engines with multiple @@ -344,6 +352,10 @@ class SearchRequest extends \Google\Protobuf\Internal\Message * [page_token][google.cloud.discoveryengine.v1.SearchRequest.page_token] is * unset. * If this field is negative, an `INVALID_ARGUMENT` is returned. + * @type int $one_box_page_size + * The maximum number of results to return for OneBox. + * This applies to each OneBox type individually. + * Default number is 10. * @type array<\Google\Cloud\DiscoveryEngine\V1\SearchRequest\DataStoreSpec>|\Google\Protobuf\Internal\RepeatedField $data_store_specs * Specs defining dataStores to filter on in a search call and configurations * for those dataStores. This is only considered for engines with multiple @@ -735,6 +747,36 @@ public function setOffset($var) return $this; } + /** + * The maximum number of results to return for OneBox. + * This applies to each OneBox type individually. + * Default number is 10. + * + * Generated from protobuf field int32 one_box_page_size = 47; + * @return int + */ + public function getOneBoxPageSize() + { + return $this->one_box_page_size; + } + + /** + * The maximum number of results to return for OneBox. + * This applies to each OneBox type individually. + * Default number is 10. + * + * Generated from protobuf field int32 one_box_page_size = 47; + * @param int $var + * @return $this + */ + public function setOneBoxPageSize($var) + { + GPBUtil::checkInt32($var); + $this->one_box_page_size = $var; + + return $this; + } + /** * Specs defining dataStores to filter on in a search call and configurations * for those dataStores. This is only considered for engines with multiple diff --git a/DiscoveryEngine/src/V1/SearchRequest/BoostSpec/ConditionBoostSpec.php b/DiscoveryEngine/src/V1/SearchRequest/BoostSpec/ConditionBoostSpec.php index 8326b453bf08..2c903bbd62ba 100644 --- a/DiscoveryEngine/src/V1/SearchRequest/BoostSpec/ConditionBoostSpec.php +++ b/DiscoveryEngine/src/V1/SearchRequest/BoostSpec/ConditionBoostSpec.php @@ -49,6 +49,13 @@ class ConditionBoostSpec extends \Google\Protobuf\Internal\Message * Generated from protobuf field float boost = 2; */ protected $boost = 0.0; + /** + * Complex specification for custom ranking based on customer defined + * attribute value. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec boost_control_spec = 3; + */ + protected $boost_control_spec = null; /** * Constructor. @@ -82,6 +89,9 @@ class ConditionBoostSpec extends \Google\Protobuf\Internal\Message * ignored. Only one of the (condition, boost) combination or the * boost_control_spec below are set. If both are set then the global boost * is ignored and the more fine-grained boost_control_spec is applied. + * @type \Google\Cloud\DiscoveryEngine\V1\SearchRequest\BoostSpec\ConditionBoostSpec\BoostControlSpec $boost_control_spec + * Complex specification for custom ranking based on customer defined + * attribute value. * } */ public function __construct($data = NULL) { @@ -185,6 +195,44 @@ public function setBoost($var) return $this; } + /** + * Complex specification for custom ranking based on customer defined + * attribute value. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec boost_control_spec = 3; + * @return \Google\Cloud\DiscoveryEngine\V1\SearchRequest\BoostSpec\ConditionBoostSpec\BoostControlSpec|null + */ + public function getBoostControlSpec() + { + return $this->boost_control_spec; + } + + public function hasBoostControlSpec() + { + return isset($this->boost_control_spec); + } + + public function clearBoostControlSpec() + { + unset($this->boost_control_spec); + } + + /** + * Complex specification for custom ranking based on customer defined + * attribute value. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec boost_control_spec = 3; + * @param \Google\Cloud\DiscoveryEngine\V1\SearchRequest\BoostSpec\ConditionBoostSpec\BoostControlSpec $var + * @return $this + */ + public function setBoostControlSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\SearchRequest\BoostSpec\ConditionBoostSpec\BoostControlSpec::class); + $this->boost_control_spec = $var; + + return $this; + } + } diff --git a/DiscoveryEngine/src/V1/SearchRequest/BoostSpec/ConditionBoostSpec/BoostControlSpec.php b/DiscoveryEngine/src/V1/SearchRequest/BoostSpec/ConditionBoostSpec/BoostControlSpec.php new file mode 100644 index 000000000000..ac9f682896a5 --- /dev/null +++ b/DiscoveryEngine/src/V1/SearchRequest/BoostSpec/ConditionBoostSpec/BoostControlSpec.php @@ -0,0 +1,204 @@ +google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec + */ +class BoostControlSpec extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the field whose value will be used to determine the + * boost amount. + * + * Generated from protobuf field string field_name = 1; + */ + protected $field_name = ''; + /** + * The attribute type to be used to determine the boost amount. The + * attribute value can be derived from the field value of the specified + * field_name. In the case of numerical it is straightforward i.e. + * attribute_value = numerical_field_value. In the case of freshness + * however, attribute_value = (time.now() - datetime_field_value). + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType attribute_type = 2; + */ + protected $attribute_type = 0; + /** + * The interpolation type to be applied to connect the control points + * listed below. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType interpolation_type = 3; + */ + protected $interpolation_type = 0; + /** + * The control points used to define the curve. The monotonic function + * (defined through the interpolation_type above) passes through the + * control points listed here. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint control_points = 4; + */ + private $control_points; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $field_name + * The name of the field whose value will be used to determine the + * boost amount. + * @type int $attribute_type + * The attribute type to be used to determine the boost amount. The + * attribute value can be derived from the field value of the specified + * field_name. In the case of numerical it is straightforward i.e. + * attribute_value = numerical_field_value. In the case of freshness + * however, attribute_value = (time.now() - datetime_field_value). + * @type int $interpolation_type + * The interpolation type to be applied to connect the control points + * listed below. + * @type array<\Google\Cloud\DiscoveryEngine\V1\SearchRequest\BoostSpec\ConditionBoostSpec\BoostControlSpec\ControlPoint>|\Google\Protobuf\Internal\RepeatedField $control_points + * The control points used to define the curve. The monotonic function + * (defined through the interpolation_type above) passes through the + * control points listed here. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\SearchService::initOnce(); + parent::__construct($data); + } + + /** + * The name of the field whose value will be used to determine the + * boost amount. + * + * Generated from protobuf field string field_name = 1; + * @return string + */ + public function getFieldName() + { + return $this->field_name; + } + + /** + * The name of the field whose value will be used to determine the + * boost amount. + * + * Generated from protobuf field string field_name = 1; + * @param string $var + * @return $this + */ + public function setFieldName($var) + { + GPBUtil::checkString($var, True); + $this->field_name = $var; + + return $this; + } + + /** + * The attribute type to be used to determine the boost amount. The + * attribute value can be derived from the field value of the specified + * field_name. In the case of numerical it is straightforward i.e. + * attribute_value = numerical_field_value. In the case of freshness + * however, attribute_value = (time.now() - datetime_field_value). + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType attribute_type = 2; + * @return int + */ + public function getAttributeType() + { + return $this->attribute_type; + } + + /** + * The attribute type to be used to determine the boost amount. The + * attribute value can be derived from the field value of the specified + * field_name. In the case of numerical it is straightforward i.e. + * attribute_value = numerical_field_value. In the case of freshness + * however, attribute_value = (time.now() - datetime_field_value). + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType attribute_type = 2; + * @param int $var + * @return $this + */ + public function setAttributeType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DiscoveryEngine\V1\SearchRequest\BoostSpec\ConditionBoostSpec\BoostControlSpec\AttributeType::class); + $this->attribute_type = $var; + + return $this; + } + + /** + * The interpolation type to be applied to connect the control points + * listed below. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType interpolation_type = 3; + * @return int + */ + public function getInterpolationType() + { + return $this->interpolation_type; + } + + /** + * The interpolation type to be applied to connect the control points + * listed below. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType interpolation_type = 3; + * @param int $var + * @return $this + */ + public function setInterpolationType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DiscoveryEngine\V1\SearchRequest\BoostSpec\ConditionBoostSpec\BoostControlSpec\InterpolationType::class); + $this->interpolation_type = $var; + + return $this; + } + + /** + * The control points used to define the curve. The monotonic function + * (defined through the interpolation_type above) passes through the + * control points listed here. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint control_points = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getControlPoints() + { + return $this->control_points; + } + + /** + * The control points used to define the curve. The monotonic function + * (defined through the interpolation_type above) passes through the + * control points listed here. + * + * Generated from protobuf field repeated .google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint control_points = 4; + * @param array<\Google\Cloud\DiscoveryEngine\V1\SearchRequest\BoostSpec\ConditionBoostSpec\BoostControlSpec\ControlPoint>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setControlPoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\SearchRequest\BoostSpec\ConditionBoostSpec\BoostControlSpec\ControlPoint::class); + $this->control_points = $arr; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/SearchRequest/BoostSpec/ConditionBoostSpec/BoostControlSpec/AttributeType.php b/DiscoveryEngine/src/V1/SearchRequest/BoostSpec/ConditionBoostSpec/BoostControlSpec/AttributeType.php new file mode 100644 index 000000000000..34a5c6593803 --- /dev/null +++ b/DiscoveryEngine/src/V1/SearchRequest/BoostSpec/ConditionBoostSpec/BoostControlSpec/AttributeType.php @@ -0,0 +1,71 @@ +google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType + */ +class AttributeType +{ + /** + * Unspecified AttributeType. + * + * Generated from protobuf enum ATTRIBUTE_TYPE_UNSPECIFIED = 0; + */ + const ATTRIBUTE_TYPE_UNSPECIFIED = 0; + /** + * The value of the numerical field will be used to dynamically update + * the boost amount. In this case, the attribute_value (the x value) + * of the control point will be the actual value of the numerical + * field for which the boost_amount is specified. + * + * Generated from protobuf enum NUMERICAL = 1; + */ + const NUMERICAL = 1; + /** + * For the freshness use case the attribute value will be the duration + * between the current time and the date in the datetime field + * specified. The value must be formatted as an XSD `dayTimeDuration` + * value (a restricted subset of an ISO 8601 duration value). The + * pattern for this is: `[nD][T[nH][nM][nS]]`. + * For example, `5D`, `3DT12H30M`, `T24H`. + * + * Generated from protobuf enum FRESHNESS = 2; + */ + const FRESHNESS = 2; + + private static $valueToName = [ + self::ATTRIBUTE_TYPE_UNSPECIFIED => 'ATTRIBUTE_TYPE_UNSPECIFIED', + self::NUMERICAL => 'NUMERICAL', + self::FRESHNESS => 'FRESHNESS', + ]; + + 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/DiscoveryEngine/src/V1/SearchRequest/BoostSpec/ConditionBoostSpec/BoostControlSpec/ControlPoint.php b/DiscoveryEngine/src/V1/SearchRequest/BoostSpec/ConditionBoostSpec/BoostControlSpec/ControlPoint.php new file mode 100644 index 000000000000..a7f6686d99f0 --- /dev/null +++ b/DiscoveryEngine/src/V1/SearchRequest/BoostSpec/ConditionBoostSpec/BoostControlSpec/ControlPoint.php @@ -0,0 +1,128 @@ +google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + */ +class ControlPoint extends \Google\Protobuf\Internal\Message +{ + /** + * Can be one of: + * 1. The numerical field value. + * 2. The duration spec for freshness: + * The value must be formatted as an XSD `dayTimeDuration` value (a + * restricted subset of an ISO 8601 duration value). The pattern for + * this is: `[nD][T[nH][nM][nS]]`. + * + * Generated from protobuf field string attribute_value = 1; + */ + protected $attribute_value = ''; + /** + * The value between -1 to 1 by which to boost the score if the + * attribute_value evaluates to the value specified above. + * + * Generated from protobuf field float boost_amount = 2; + */ + protected $boost_amount = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $attribute_value + * Can be one of: + * 1. The numerical field value. + * 2. The duration spec for freshness: + * The value must be formatted as an XSD `dayTimeDuration` value (a + * restricted subset of an ISO 8601 duration value). The pattern for + * this is: `[nD][T[nH][nM][nS]]`. + * @type float $boost_amount + * The value between -1 to 1 by which to boost the score if the + * attribute_value evaluates to the value specified above. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\SearchService::initOnce(); + parent::__construct($data); + } + + /** + * Can be one of: + * 1. The numerical field value. + * 2. The duration spec for freshness: + * The value must be formatted as an XSD `dayTimeDuration` value (a + * restricted subset of an ISO 8601 duration value). The pattern for + * this is: `[nD][T[nH][nM][nS]]`. + * + * Generated from protobuf field string attribute_value = 1; + * @return string + */ + public function getAttributeValue() + { + return $this->attribute_value; + } + + /** + * Can be one of: + * 1. The numerical field value. + * 2. The duration spec for freshness: + * The value must be formatted as an XSD `dayTimeDuration` value (a + * restricted subset of an ISO 8601 duration value). The pattern for + * this is: `[nD][T[nH][nM][nS]]`. + * + * Generated from protobuf field string attribute_value = 1; + * @param string $var + * @return $this + */ + public function setAttributeValue($var) + { + GPBUtil::checkString($var, True); + $this->attribute_value = $var; + + return $this; + } + + /** + * The value between -1 to 1 by which to boost the score if the + * attribute_value evaluates to the value specified above. + * + * Generated from protobuf field float boost_amount = 2; + * @return float + */ + public function getBoostAmount() + { + return $this->boost_amount; + } + + /** + * The value between -1 to 1 by which to boost the score if the + * attribute_value evaluates to the value specified above. + * + * Generated from protobuf field float boost_amount = 2; + * @param float $var + * @return $this + */ + public function setBoostAmount($var) + { + GPBUtil::checkFloat($var); + $this->boost_amount = $var; + + return $this; + } + +} + + diff --git a/DiscoveryEngine/src/V1/SearchRequest/BoostSpec/ConditionBoostSpec/BoostControlSpec/InterpolationType.php b/DiscoveryEngine/src/V1/SearchRequest/BoostSpec/ConditionBoostSpec/BoostControlSpec/InterpolationType.php new file mode 100644 index 000000000000..121bd8d5936e --- /dev/null +++ b/DiscoveryEngine/src/V1/SearchRequest/BoostSpec/ConditionBoostSpec/BoostControlSpec/InterpolationType.php @@ -0,0 +1,57 @@ +google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType + */ +class InterpolationType +{ + /** + * Interpolation type is unspecified. In this case, it defaults to + * Linear. + * + * Generated from protobuf enum INTERPOLATION_TYPE_UNSPECIFIED = 0; + */ + const INTERPOLATION_TYPE_UNSPECIFIED = 0; + /** + * Piecewise linear interpolation will be applied. + * + * Generated from protobuf enum LINEAR = 1; + */ + const LINEAR = 1; + + private static $valueToName = [ + self::INTERPOLATION_TYPE_UNSPECIFIED => 'INTERPOLATION_TYPE_UNSPECIFIED', + self::LINEAR => 'LINEAR', + ]; + + 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/DiscoveryEngine/src/V1/SearchRequest/ContentSearchSpec/SummarySpec.php b/DiscoveryEngine/src/V1/SearchRequest/ContentSearchSpec/SummarySpec.php index 24a64d3c8253..28e3138cf661 100644 --- a/DiscoveryEngine/src/V1/SearchRequest/ContentSearchSpec/SummarySpec.php +++ b/DiscoveryEngine/src/V1/SearchRequest/ContentSearchSpec/SummarySpec.php @@ -86,6 +86,21 @@ class SummarySpec extends \Google\Protobuf\Internal\Message * Generated from protobuf field bool ignore_low_relevant_content = 9; */ protected $ignore_low_relevant_content = false; + /** + * Optional. Specifies whether to filter out jail-breaking queries. The + * default value is `false`. + * Google employs search-query classification to detect jail-breaking + * queries. No summary is returned if the search query is classified as a + * jail-breaking query. A user might add instructions to the query to + * change the tone, style, language, content of the answer, or ask the + * model to act as a different entity, e.g. "Reply in the tone of a + * competing company's CEO". If this field is set to `true`, we skip + * generating summaries for jail-breaking queries and return fallback + * messages instead. + * + * Generated from protobuf field bool ignore_jail_breaking_query = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ignore_jail_breaking_query = false; /** * If specified, the spec will be used to modify the prompt provided to * the LLM. @@ -176,6 +191,17 @@ class SummarySpec extends \Google\Protobuf\Internal\Message * If this field is set to `false`, all search results are used regardless * of relevance to generate answers. If set to `true`, only queries with * high relevance search results will generate answers. + * @type bool $ignore_jail_breaking_query + * Optional. Specifies whether to filter out jail-breaking queries. The + * default value is `false`. + * Google employs search-query classification to detect jail-breaking + * queries. No summary is returned if the search query is classified as a + * jail-breaking query. A user might add instructions to the query to + * change the tone, style, language, content of the answer, or ask the + * model to act as a different entity, e.g. "Reply in the tone of a + * competing company's CEO". If this field is set to `true`, we skip + * generating summaries for jail-breaking queries and return fallback + * messages instead. * @type \Google\Cloud\DiscoveryEngine\V1\SearchRequest\ContentSearchSpec\SummarySpec\ModelPromptSpec $model_prompt_spec * If specified, the spec will be used to modify the prompt provided to * the LLM. @@ -410,6 +436,50 @@ public function setIgnoreLowRelevantContent($var) return $this; } + /** + * Optional. Specifies whether to filter out jail-breaking queries. The + * default value is `false`. + * Google employs search-query classification to detect jail-breaking + * queries. No summary is returned if the search query is classified as a + * jail-breaking query. A user might add instructions to the query to + * change the tone, style, language, content of the answer, or ask the + * model to act as a different entity, e.g. "Reply in the tone of a + * competing company's CEO". If this field is set to `true`, we skip + * generating summaries for jail-breaking queries and return fallback + * messages instead. + * + * Generated from protobuf field bool ignore_jail_breaking_query = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getIgnoreJailBreakingQuery() + { + return $this->ignore_jail_breaking_query; + } + + /** + * Optional. Specifies whether to filter out jail-breaking queries. The + * default value is `false`. + * Google employs search-query classification to detect jail-breaking + * queries. No summary is returned if the search query is classified as a + * jail-breaking query. A user might add instructions to the query to + * change the tone, style, language, content of the answer, or ask the + * model to act as a different entity, e.g. "Reply in the tone of a + * competing company's CEO". If this field is set to `true`, we skip + * generating summaries for jail-breaking queries and return fallback + * messages instead. + * + * Generated from protobuf field bool ignore_jail_breaking_query = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setIgnoreJailBreakingQuery($var) + { + GPBUtil::checkBool($var); + $this->ignore_jail_breaking_query = $var; + + return $this; + } + /** * If specified, the spec will be used to modify the prompt provided to * the LLM. diff --git a/DiscoveryEngine/src/V1/SearchRequest/DataStoreSpec.php b/DiscoveryEngine/src/V1/SearchRequest/DataStoreSpec.php index e2097d0612a5..bb8b0728e012 100644 --- a/DiscoveryEngine/src/V1/SearchRequest/DataStoreSpec.php +++ b/DiscoveryEngine/src/V1/SearchRequest/DataStoreSpec.php @@ -25,6 +25,14 @@ class DataStoreSpec extends \Google\Protobuf\Internal\Message * Generated from protobuf field string data_store = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ protected $data_store = ''; + /** + * Optional. Filter specification to filter documents in the data store + * specified by data_store field. For more information on filtering, see + * [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) + * + * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; /** * Constructor. @@ -36,6 +44,10 @@ class DataStoreSpec extends \Google\Protobuf\Internal\Message * Required. Full resource name of * [DataStore][google.cloud.discoveryengine.v1.DataStore], such as * `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. + * @type string $filter + * Optional. Filter specification to filter documents in the data store + * specified by data_store field. For more information on filtering, see + * [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) * } */ public function __construct($data = NULL) { @@ -73,6 +85,36 @@ public function setDataStore($var) return $this; } + /** + * Optional. Filter specification to filter documents in the data store + * specified by data_store field. For more information on filtering, see + * [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) + * + * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filter specification to filter documents in the data store + * specified by data_store field. For more information on filtering, see + * [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) + * + * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + } diff --git a/DiscoveryEngine/src/V1/SearchResponse/Summary/SummarySkippedReason.php b/DiscoveryEngine/src/V1/SearchResponse/Summary/SummarySkippedReason.php index 607ba3713278..d780e736cd93 100644 --- a/DiscoveryEngine/src/V1/SearchResponse/Summary/SummarySkippedReason.php +++ b/DiscoveryEngine/src/V1/SearchResponse/Summary/SummarySkippedReason.php @@ -30,6 +30,7 @@ class SummarySkippedReason const ADVERSARIAL_QUERY_IGNORED = 1; /** * The non-summary seeking query ignored case. + * Google skips the summary if the query is chit chat. * Only used when * [SummarySpec.ignore_non_summary_seeking_query][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec.ignore_non_summary_seeking_query] * is set to `true`. @@ -87,6 +88,16 @@ class SummarySkippedReason * Generated from protobuf enum CUSTOMER_POLICY_VIOLATION = 8; */ const CUSTOMER_POLICY_VIOLATION = 8; + /** + * The non-answer seeking query ignored case. + * Google skips the summary if the query doesn't have clear intent. + * Only used when + * [SearchRequest.ContentSearchSpec.SummarySpec.ignore_non_answer_seeking_query] + * is set to `true`. + * + * Generated from protobuf enum NON_SUMMARY_SEEKING_QUERY_IGNORED_V2 = 9; + */ + const NON_SUMMARY_SEEKING_QUERY_IGNORED_V2 = 9; private static $valueToName = [ self::SUMMARY_SKIPPED_REASON_UNSPECIFIED => 'SUMMARY_SKIPPED_REASON_UNSPECIFIED', @@ -98,6 +109,7 @@ class SummarySkippedReason self::NO_RELEVANT_CONTENT => 'NO_RELEVANT_CONTENT', self::JAIL_BREAKING_QUERY_IGNORED => 'JAIL_BREAKING_QUERY_IGNORED', self::CUSTOMER_POLICY_VIOLATION => 'CUSTOMER_POLICY_VIOLATION', + self::NON_SUMMARY_SEEKING_QUERY_IGNORED_V2 => 'NON_SUMMARY_SEEKING_QUERY_IGNORED_V2', ]; public static function name($value) diff --git a/DiscoveryEngine/src/V1/WorkspaceConfig.php b/DiscoveryEngine/src/V1/WorkspaceConfig.php new file mode 100644 index 000000000000..eebbfc3e2900 --- /dev/null +++ b/DiscoveryEngine/src/V1/WorkspaceConfig.php @@ -0,0 +1,185 @@ +google.cloud.discoveryengine.v1.WorkspaceConfig + */ +class WorkspaceConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The Google Workspace data source. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.WorkspaceConfig.Type type = 1; + */ + protected $type = 0; + /** + * Obfuscated Dasher customer ID. + * + * Generated from protobuf field string dasher_customer_id = 2; + */ + protected $dasher_customer_id = ''; + /** + * Optional. The super admin service account for the workspace that will be + * used for access token generation. For now we only use it for Native Google + * Drive connector data ingestion. + * + * Generated from protobuf field string super_admin_service_account = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $super_admin_service_account = ''; + /** + * Optional. The super admin email address for the workspace that will be used + * for access token generation. For now we only use it for Native Google Drive + * connector data ingestion. + * + * Generated from protobuf field string super_admin_email_address = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $super_admin_email_address = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $type + * The Google Workspace data source. + * @type string $dasher_customer_id + * Obfuscated Dasher customer ID. + * @type string $super_admin_service_account + * Optional. The super admin service account for the workspace that will be + * used for access token generation. For now we only use it for Native Google + * Drive connector data ingestion. + * @type string $super_admin_email_address + * Optional. The super admin email address for the workspace that will be used + * for access token generation. For now we only use it for Native Google Drive + * connector data ingestion. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Discoveryengine\V1\DataStore::initOnce(); + parent::__construct($data); + } + + /** + * The Google Workspace data source. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.WorkspaceConfig.Type type = 1; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * The Google Workspace data source. + * + * Generated from protobuf field .google.cloud.discoveryengine.v1.WorkspaceConfig.Type type = 1; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DiscoveryEngine\V1\WorkspaceConfig\Type::class); + $this->type = $var; + + return $this; + } + + /** + * Obfuscated Dasher customer ID. + * + * Generated from protobuf field string dasher_customer_id = 2; + * @return string + */ + public function getDasherCustomerId() + { + return $this->dasher_customer_id; + } + + /** + * Obfuscated Dasher customer ID. + * + * Generated from protobuf field string dasher_customer_id = 2; + * @param string $var + * @return $this + */ + public function setDasherCustomerId($var) + { + GPBUtil::checkString($var, True); + $this->dasher_customer_id = $var; + + return $this; + } + + /** + * Optional. The super admin service account for the workspace that will be + * used for access token generation. For now we only use it for Native Google + * Drive connector data ingestion. + * + * Generated from protobuf field string super_admin_service_account = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSuperAdminServiceAccount() + { + return $this->super_admin_service_account; + } + + /** + * Optional. The super admin service account for the workspace that will be + * used for access token generation. For now we only use it for Native Google + * Drive connector data ingestion. + * + * Generated from protobuf field string super_admin_service_account = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSuperAdminServiceAccount($var) + { + GPBUtil::checkString($var, True); + $this->super_admin_service_account = $var; + + return $this; + } + + /** + * Optional. The super admin email address for the workspace that will be used + * for access token generation. For now we only use it for Native Google Drive + * connector data ingestion. + * + * Generated from protobuf field string super_admin_email_address = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSuperAdminEmailAddress() + { + return $this->super_admin_email_address; + } + + /** + * Optional. The super admin email address for the workspace that will be used + * for access token generation. For now we only use it for Native Google Drive + * connector data ingestion. + * + * Generated from protobuf field string super_admin_email_address = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSuperAdminEmailAddress($var) + { + GPBUtil::checkString($var, True); + $this->super_admin_email_address = $var; + + return $this; + } + +} + diff --git a/DiscoveryEngine/src/V1/WorkspaceConfig/Type.php b/DiscoveryEngine/src/V1/WorkspaceConfig/Type.php new file mode 100644 index 000000000000..b9e4b7e4570d --- /dev/null +++ b/DiscoveryEngine/src/V1/WorkspaceConfig/Type.php @@ -0,0 +1,97 @@ +google.cloud.discoveryengine.v1.WorkspaceConfig.Type + */ +class Type +{ + /** + * Defaults to an unspecified Workspace type. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * Workspace Data Store contains Drive data + * + * Generated from protobuf enum GOOGLE_DRIVE = 1; + */ + const GOOGLE_DRIVE = 1; + /** + * Workspace Data Store contains Mail data + * + * Generated from protobuf enum GOOGLE_MAIL = 2; + */ + const GOOGLE_MAIL = 2; + /** + * Workspace Data Store contains Sites data + * + * Generated from protobuf enum GOOGLE_SITES = 3; + */ + const GOOGLE_SITES = 3; + /** + * Workspace Data Store contains Calendar data + * + * Generated from protobuf enum GOOGLE_CALENDAR = 4; + */ + const GOOGLE_CALENDAR = 4; + /** + * Workspace Data Store contains Chat data + * + * Generated from protobuf enum GOOGLE_CHAT = 5; + */ + const GOOGLE_CHAT = 5; + /** + * Workspace Data Store contains Groups data + * + * Generated from protobuf enum GOOGLE_GROUPS = 6; + */ + const GOOGLE_GROUPS = 6; + /** + * Workspace Data Store contains Keep data + * + * Generated from protobuf enum GOOGLE_KEEP = 7; + */ + const GOOGLE_KEEP = 7; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::GOOGLE_DRIVE => 'GOOGLE_DRIVE', + self::GOOGLE_MAIL => 'GOOGLE_MAIL', + self::GOOGLE_SITES => 'GOOGLE_SITES', + self::GOOGLE_CALENDAR => 'GOOGLE_CALENDAR', + self::GOOGLE_CHAT => 'GOOGLE_CHAT', + self::GOOGLE_GROUPS => 'GOOGLE_GROUPS', + self::GOOGLE_KEEP => 'GOOGLE_KEEP', + ]; + + 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/DiscoveryEngine/src/V1/gapic_metadata.json b/DiscoveryEngine/src/V1/gapic_metadata.json index cf51e0e4954a..b7befe39ec3f 100644 --- a/DiscoveryEngine/src/V1/gapic_metadata.json +++ b/DiscoveryEngine/src/V1/gapic_metadata.json @@ -287,6 +287,16 @@ "methods": [ "checkGrounding" ] + }, + "GenerateGroundedContent": { + "methods": [ + "generateGroundedContent" + ] + }, + "StreamGenerateGroundedContent": { + "methods": [ + "streamGenerateGroundedContent" + ] } } } diff --git a/DiscoveryEngine/src/V1/resources/completion_service_rest_client_config.php b/DiscoveryEngine/src/V1/resources/completion_service_rest_client_config.php index e06351c17fa0..77562ec9af55 100644 --- a/DiscoveryEngine/src/V1/resources/completion_service_rest_client_config.php +++ b/DiscoveryEngine/src/V1/resources/completion_service_rest_client_config.php @@ -196,7 +196,7 @@ ], [ 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/identity_mapping_stores/*/operations/*}', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/identityMappingStores/*/operations/*}', ], [ 'method' => 'get', @@ -269,7 +269,7 @@ ], [ 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/identity_mapping_stores/*}/operations', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/identityMappingStores/*}/operations', ], [ 'method' => 'get', diff --git a/DiscoveryEngine/src/V1/resources/control_service_rest_client_config.php b/DiscoveryEngine/src/V1/resources/control_service_rest_client_config.php index 26212d2a414d..744ce1c6caa2 100644 --- a/DiscoveryEngine/src/V1/resources/control_service_rest_client_config.php +++ b/DiscoveryEngine/src/V1/resources/control_service_rest_client_config.php @@ -224,7 +224,7 @@ ], [ 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/identity_mapping_stores/*/operations/*}', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/identityMappingStores/*/operations/*}', ], [ 'method' => 'get', @@ -297,7 +297,7 @@ ], [ 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/identity_mapping_stores/*}/operations', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/identityMappingStores/*}/operations', ], [ 'method' => 'get', diff --git a/DiscoveryEngine/src/V1/resources/conversational_search_service_rest_client_config.php b/DiscoveryEngine/src/V1/resources/conversational_search_service_rest_client_config.php index 0377adfbd825..72f19e677eea 100644 --- a/DiscoveryEngine/src/V1/resources/conversational_search_service_rest_client_config.php +++ b/DiscoveryEngine/src/V1/resources/conversational_search_service_rest_client_config.php @@ -396,7 +396,7 @@ ], [ 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/identity_mapping_stores/*/operations/*}', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/identityMappingStores/*/operations/*}', ], [ 'method' => 'get', @@ -469,7 +469,7 @@ ], [ 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/identity_mapping_stores/*}/operations', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/identityMappingStores/*}/operations', ], [ 'method' => 'get', diff --git a/DiscoveryEngine/src/V1/resources/data_store_service_rest_client_config.php b/DiscoveryEngine/src/V1/resources/data_store_service_rest_client_config.php index 44ba3f283e60..80dec2169fdb 100644 --- a/DiscoveryEngine/src/V1/resources/data_store_service_rest_client_config.php +++ b/DiscoveryEngine/src/V1/resources/data_store_service_rest_client_config.php @@ -199,7 +199,7 @@ ], [ 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/identity_mapping_stores/*/operations/*}', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/identityMappingStores/*/operations/*}', ], [ 'method' => 'get', @@ -272,7 +272,7 @@ ], [ 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/identity_mapping_stores/*}/operations', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/identityMappingStores/*}/operations', ], [ 'method' => 'get', diff --git a/DiscoveryEngine/src/V1/resources/document_service_descriptor_config.php b/DiscoveryEngine/src/V1/resources/document_service_descriptor_config.php index 4c0c33b5f6b5..0ce6edcf1c89 100644 --- a/DiscoveryEngine/src/V1/resources/document_service_descriptor_config.php +++ b/DiscoveryEngine/src/V1/resources/document_service_descriptor_config.php @@ -145,6 +145,7 @@ 'templateMap' => [ 'branch' => 'projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}', 'document' => 'projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}', + 'fhirResource' => 'projects/{project}/locations/{location}/datasets/{dataset}/fhirStores/{fhir_store}/fhir/{resource_type}/{fhir_resource_id}', 'fhirStore' => 'projects/{project}/locations/{location}/datasets/{dataset}/fhirStores/{fhir_store}', 'projectLocationCollectionDataStoreBranch' => 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}', 'projectLocationCollectionDataStoreBranchDocument' => 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}', diff --git a/DiscoveryEngine/src/V1/resources/document_service_rest_client_config.php b/DiscoveryEngine/src/V1/resources/document_service_rest_client_config.php index ddeabc3c3ca2..ee26521bf65c 100644 --- a/DiscoveryEngine/src/V1/resources/document_service_rest_client_config.php +++ b/DiscoveryEngine/src/V1/resources/document_service_rest_client_config.php @@ -260,7 +260,7 @@ ], [ 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/identity_mapping_stores/*/operations/*}', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/identityMappingStores/*/operations/*}', ], [ 'method' => 'get', @@ -333,7 +333,7 @@ ], [ 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/identity_mapping_stores/*}/operations', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/identityMappingStores/*}/operations', ], [ 'method' => 'get', diff --git a/DiscoveryEngine/src/V1/resources/engine_service_rest_client_config.php b/DiscoveryEngine/src/V1/resources/engine_service_rest_client_config.php index ebec300e8482..0ef80187bf41 100644 --- a/DiscoveryEngine/src/V1/resources/engine_service_rest_client_config.php +++ b/DiscoveryEngine/src/V1/resources/engine_service_rest_client_config.php @@ -164,7 +164,7 @@ ], [ 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/identity_mapping_stores/*/operations/*}', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/identityMappingStores/*/operations/*}', ], [ 'method' => 'get', @@ -237,7 +237,7 @@ ], [ 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/identity_mapping_stores/*}/operations', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/identityMappingStores/*}/operations', ], [ 'method' => 'get', diff --git a/DiscoveryEngine/src/V1/resources/grounded_generation_service_client_config.json b/DiscoveryEngine/src/V1/resources/grounded_generation_service_client_config.json index 7ee5457d398f..527fcc44020a 100644 --- a/DiscoveryEngine/src/V1/resources/grounded_generation_service_client_config.json +++ b/DiscoveryEngine/src/V1/resources/grounded_generation_service_client_config.json @@ -32,6 +32,14 @@ "timeout_millis": 5000, "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" + }, + "GenerateGroundedContent": { + "timeout_millis": 5000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "StreamGenerateGroundedContent": { + "timeout_millis": 5000 } } } diff --git a/DiscoveryEngine/src/V1/resources/grounded_generation_service_descriptor_config.php b/DiscoveryEngine/src/V1/resources/grounded_generation_service_descriptor_config.php index 4049f6280469..e4fc58d92897 100644 --- a/DiscoveryEngine/src/V1/resources/grounded_generation_service_descriptor_config.php +++ b/DiscoveryEngine/src/V1/resources/grounded_generation_service_descriptor_config.php @@ -35,8 +35,40 @@ ], ], ], + 'GenerateGroundedContent' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse', + 'headerParams' => [ + [ + 'keyName' => 'location', + 'fieldAccessors' => [ + 'getLocation', + ], + ], + ], + ], + 'StreamGenerateGroundedContent' => [ + 'grpcStreaming' => [ + 'grpcStreamingType' => 'BidiStreaming', + ], + 'callType' => \Google\ApiCore\Call::BIDI_STREAMING_CALL, + 'responseType' => 'Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse', + 'headerParams' => [ + [ + 'keyName' => 'location', + 'fieldAccessors' => [ + 'getLocation', + ], + ], + ], + ], 'templateMap' => [ 'groundingConfig' => 'projects/{project}/locations/{location}/groundingConfigs/{grounding_config}', + 'location' => 'projects/{project}/locations/{location}', + 'projectLocationCollectionDataStoreServingConfig' => 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}', + 'projectLocationCollectionEngineServingConfig' => 'projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/servingConfigs/{serving_config}', + 'projectLocationDataStoreServingConfig' => 'projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config}', + 'servingConfig' => 'projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config}', ], ], ], diff --git a/DiscoveryEngine/src/V1/resources/grounded_generation_service_rest_client_config.php b/DiscoveryEngine/src/V1/resources/grounded_generation_service_rest_client_config.php index 321f48799e17..4ff1f90c475f 100644 --- a/DiscoveryEngine/src/V1/resources/grounded_generation_service_rest_client_config.php +++ b/DiscoveryEngine/src/V1/resources/grounded_generation_service_rest_client_config.php @@ -35,6 +35,18 @@ ], ], ], + 'GenerateGroundedContent' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{location=projects/*/locations/*}:generateGroundedContent', + 'body' => '*', + 'placeholders' => [ + 'location' => [ + 'getters' => [ + 'getLocation', + ], + ], + ], + ], ], 'google.longrunning.Operations' => [ 'CancelOperation' => [ @@ -115,7 +127,7 @@ ], [ 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/identity_mapping_stores/*/operations/*}', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/identityMappingStores/*/operations/*}', ], [ 'method' => 'get', @@ -188,7 +200,7 @@ ], [ 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/identity_mapping_stores/*}/operations', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/identityMappingStores/*}/operations', ], [ 'method' => 'get', diff --git a/DiscoveryEngine/src/V1/resources/project_service_rest_client_config.php b/DiscoveryEngine/src/V1/resources/project_service_rest_client_config.php index 5178b3171844..273237494a76 100644 --- a/DiscoveryEngine/src/V1/resources/project_service_rest_client_config.php +++ b/DiscoveryEngine/src/V1/resources/project_service_rest_client_config.php @@ -115,7 +115,7 @@ ], [ 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/identity_mapping_stores/*/operations/*}', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/identityMappingStores/*/operations/*}', ], [ 'method' => 'get', @@ -188,7 +188,7 @@ ], [ 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/identity_mapping_stores/*}/operations', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/identityMappingStores/*}/operations', ], [ 'method' => 'get', diff --git a/DiscoveryEngine/src/V1/resources/rank_service_rest_client_config.php b/DiscoveryEngine/src/V1/resources/rank_service_rest_client_config.php index 5ff62f84aa3c..c9c4ea80db4a 100644 --- a/DiscoveryEngine/src/V1/resources/rank_service_rest_client_config.php +++ b/DiscoveryEngine/src/V1/resources/rank_service_rest_client_config.php @@ -115,7 +115,7 @@ ], [ 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/identity_mapping_stores/*/operations/*}', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/identityMappingStores/*/operations/*}', ], [ 'method' => 'get', @@ -188,7 +188,7 @@ ], [ 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/identity_mapping_stores/*}/operations', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/identityMappingStores/*}/operations', ], [ 'method' => 'get', diff --git a/DiscoveryEngine/src/V1/resources/recommendation_service_rest_client_config.php b/DiscoveryEngine/src/V1/resources/recommendation_service_rest_client_config.php index 2036147e8bb6..1dcb170de077 100644 --- a/DiscoveryEngine/src/V1/resources/recommendation_service_rest_client_config.php +++ b/DiscoveryEngine/src/V1/resources/recommendation_service_rest_client_config.php @@ -127,7 +127,7 @@ ], [ 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/identity_mapping_stores/*/operations/*}', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/identityMappingStores/*/operations/*}', ], [ 'method' => 'get', @@ -200,7 +200,7 @@ ], [ 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/identity_mapping_stores/*}/operations', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/identityMappingStores/*}/operations', ], [ 'method' => 'get', diff --git a/DiscoveryEngine/src/V1/resources/schema_service_rest_client_config.php b/DiscoveryEngine/src/V1/resources/schema_service_rest_client_config.php index 36f625272192..b7810150dda4 100644 --- a/DiscoveryEngine/src/V1/resources/schema_service_rest_client_config.php +++ b/DiscoveryEngine/src/V1/resources/schema_service_rest_client_config.php @@ -199,7 +199,7 @@ ], [ 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/identity_mapping_stores/*/operations/*}', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/identityMappingStores/*/operations/*}', ], [ 'method' => 'get', @@ -272,7 +272,7 @@ ], [ 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/identity_mapping_stores/*}/operations', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/identityMappingStores/*}/operations', ], [ 'method' => 'get', diff --git a/DiscoveryEngine/src/V1/resources/search_service_rest_client_config.php b/DiscoveryEngine/src/V1/resources/search_service_rest_client_config.php index 461ada07c9eb..61ff8f48813e 100644 --- a/DiscoveryEngine/src/V1/resources/search_service_rest_client_config.php +++ b/DiscoveryEngine/src/V1/resources/search_service_rest_client_config.php @@ -127,7 +127,7 @@ ], [ 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/identity_mapping_stores/*/operations/*}', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/identityMappingStores/*/operations/*}', ], [ 'method' => 'get', @@ -200,7 +200,7 @@ ], [ 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/identity_mapping_stores/*}/operations', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/identityMappingStores/*}/operations', ], [ 'method' => 'get', diff --git a/DiscoveryEngine/src/V1/resources/search_tuning_service_rest_client_config.php b/DiscoveryEngine/src/V1/resources/search_tuning_service_rest_client_config.php index 2180fb0a0519..24a6d6eb4c13 100644 --- a/DiscoveryEngine/src/V1/resources/search_tuning_service_rest_client_config.php +++ b/DiscoveryEngine/src/V1/resources/search_tuning_service_rest_client_config.php @@ -126,7 +126,7 @@ ], [ 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/identity_mapping_stores/*/operations/*}', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/identityMappingStores/*/operations/*}', ], [ 'method' => 'get', @@ -199,7 +199,7 @@ ], [ 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/identity_mapping_stores/*}/operations', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/identityMappingStores/*}/operations', ], [ 'method' => 'get', diff --git a/DiscoveryEngine/src/V1/resources/site_search_engine_service_rest_client_config.php b/DiscoveryEngine/src/V1/resources/site_search_engine_service_rest_client_config.php index aef730fd5b60..a8fa128e0290 100644 --- a/DiscoveryEngine/src/V1/resources/site_search_engine_service_rest_client_config.php +++ b/DiscoveryEngine/src/V1/resources/site_search_engine_service_rest_client_config.php @@ -309,7 +309,7 @@ ], [ 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/identity_mapping_stores/*/operations/*}', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/identityMappingStores/*/operations/*}', ], [ 'method' => 'get', @@ -382,7 +382,7 @@ ], [ 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/identity_mapping_stores/*}/operations', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/identityMappingStores/*}/operations', ], [ 'method' => 'get', diff --git a/DiscoveryEngine/src/V1/resources/user_event_service_rest_client_config.php b/DiscoveryEngine/src/V1/resources/user_event_service_rest_client_config.php index 9a2a15cdd96c..806309062225 100644 --- a/DiscoveryEngine/src/V1/resources/user_event_service_rest_client_config.php +++ b/DiscoveryEngine/src/V1/resources/user_event_service_rest_client_config.php @@ -186,7 +186,7 @@ ], [ 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/identity_mapping_stores/*/operations/*}', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/identityMappingStores/*/operations/*}', ], [ 'method' => 'get', @@ -259,7 +259,7 @@ ], [ 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/identity_mapping_stores/*}/operations', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/identityMappingStores/*}/operations', ], [ 'method' => 'get', diff --git a/DiscoveryEngine/tests/Unit/V1/Client/EngineServiceClientTest.php b/DiscoveryEngine/tests/Unit/V1/Client/EngineServiceClientTest.php index 36b41762afc7..2cd3c5299674 100644 --- a/DiscoveryEngine/tests/Unit/V1/Client/EngineServiceClientTest.php +++ b/DiscoveryEngine/tests/Unit/V1/Client/EngineServiceClientTest.php @@ -96,9 +96,11 @@ public function createEngineTest() $transport->addResponse($incompleteOperation); $name = 'name3373707'; $displayName = 'displayName1615086568'; + $disableAnalytics = false; $expectedResponse = new Engine(); $expectedResponse->setName($name); $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDisableAnalytics($disableAnalytics); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); @@ -354,9 +356,11 @@ public function getEngineTest() // Mock response $name2 = 'name2-1052831874'; $displayName = 'displayName1615086568'; + $disableAnalytics = false; $expectedResponse = new Engine(); $expectedResponse->setName($name2); $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDisableAnalytics($disableAnalytics); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->engineName('[PROJECT]', '[LOCATION]', '[COLLECTION]', '[ENGINE]'); @@ -492,9 +496,11 @@ public function updateEngineTest() // Mock response $name = 'name3373707'; $displayName = 'displayName1615086568'; + $disableAnalytics = false; $expectedResponse = new Engine(); $expectedResponse->setName($name); $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDisableAnalytics($disableAnalytics); $transport->addResponse($expectedResponse); // Mock request $engine = new Engine(); @@ -579,9 +585,11 @@ public function createEngineAsyncTest() $transport->addResponse($incompleteOperation); $name = 'name3373707'; $displayName = 'displayName1615086568'; + $disableAnalytics = false; $expectedResponse = new Engine(); $expectedResponse->setName($name); $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDisableAnalytics($disableAnalytics); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); diff --git a/DiscoveryEngine/tests/Unit/V1/Client/GroundedGenerationServiceClientTest.php b/DiscoveryEngine/tests/Unit/V1/Client/GroundedGenerationServiceClientTest.php index fce50c2ed29f..48a125a0c6f5 100644 --- a/DiscoveryEngine/tests/Unit/V1/Client/GroundedGenerationServiceClientTest.php +++ b/DiscoveryEngine/tests/Unit/V1/Client/GroundedGenerationServiceClientTest.php @@ -23,12 +23,15 @@ namespace Google\Cloud\DiscoveryEngine\Tests\Unit\V1\Client; use Google\ApiCore\ApiException; +use Google\ApiCore\BidiStream; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\DiscoveryEngine\V1\CheckGroundingRequest; use Google\Cloud\DiscoveryEngine\V1\CheckGroundingResponse; use Google\Cloud\DiscoveryEngine\V1\Client\GroundedGenerationServiceClient; +use Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentRequest; +use Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentResponse; use Google\Rpc\Code; use stdClass; @@ -127,6 +130,169 @@ public function checkGroundingExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function generateGroundedContentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GenerateGroundedContentResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedLocation = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new GenerateGroundedContentRequest())->setLocation($formattedLocation); + $response = $gapicClient->generateGroundedContent($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.discoveryengine.v1.GroundedGenerationService/GenerateGroundedContent', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getLocation(); + $this->assertProtobufEquals($formattedLocation, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function generateGroundedContentExceptionTest() + { + $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 + $formattedLocation = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new GenerateGroundedContentRequest())->setLocation($formattedLocation); + try { + $gapicClient->generateGroundedContent($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 streamGenerateGroundedContentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GenerateGroundedContentResponse(); + $transport->addResponse($expectedResponse); + $expectedResponse2 = new GenerateGroundedContentResponse(); + $transport->addResponse($expectedResponse2); + $expectedResponse3 = new GenerateGroundedContentResponse(); + $transport->addResponse($expectedResponse3); + // Mock request + $formattedLocation = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = new GenerateGroundedContentRequest(); + $request->setLocation($formattedLocation); + $formattedLocation2 = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request2 = new GenerateGroundedContentRequest(); + $request2->setLocation($formattedLocation2); + $formattedLocation3 = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request3 = new GenerateGroundedContentRequest(); + $request3->setLocation($formattedLocation3); + $bidi = $gapicClient->streamGenerateGroundedContent(); + $this->assertInstanceOf(BidiStream::class, $bidi); + $bidi->write($request); + $responses = []; + $responses[] = $bidi->read(); + $bidi->writeAll([$request2, $request3]); + foreach ($bidi->closeWriteAndReadAll() as $response) { + $responses[] = $response; + } + + $expectedResponses = []; + $expectedResponses[] = $expectedResponse; + $expectedResponses[] = $expectedResponse2; + $expectedResponses[] = $expectedResponse3; + $this->assertEquals($expectedResponses, $responses); + $createStreamRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($createStreamRequests)); + $streamFuncCall = $createStreamRequests[0]->getFuncCall(); + $streamRequestObject = $createStreamRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.discoveryengine.v1.GroundedGenerationService/StreamGenerateGroundedContent', + $streamFuncCall + ); + $this->assertNull($streamRequestObject); + $callObjects = $transport->popCallObjects(); + $this->assertSame(1, count($callObjects)); + $bidiCall = $callObjects[0]; + $writeRequests = $bidiCall->popReceivedCalls(); + $expectedRequests = []; + $expectedRequests[] = $request; + $expectedRequests[] = $request2; + $expectedRequests[] = $request3; + $this->assertEquals($expectedRequests, $writeRequests); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function streamGenerateGroundedContentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $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->setStreamingStatus($status); + $this->assertTrue($transport->isExhausted()); + $bidi = $gapicClient->streamGenerateGroundedContent(); + $results = $bidi->closeWriteAndReadAll(); + try { + iterator_to_array($results); + // If the close stream 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 checkGroundingAsyncTest() { From 764bb32bb2c092828be889c3f951234f605b16ad Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 19:05:08 +0000 Subject: [PATCH 10/34] feat: Add backupplan proto (#7732) feat: Add backupplan proto feat: Add backupplanassociation proto feat: Add backupvault_ba proto feat: Add backupvault_gce proto PiperOrigin-RevId: 683196317 Source-Link: https://github.com/googleapis/googleapis/commit/c532f355b2bae18fdff19ced316897433de5f093 Source-Link: https://github.com/googleapis/googleapis-gen/commit/fd43f5733b002358fa679623f6099aafb6660c8e Copy-Tag: eyJwIjoiQmFja3VwRHIvLk93bEJvdC55YW1sIiwiaCI6ImZkNDNmNTczM2IwMDIzNThmYTY3OTYyM2Y2MDk5YWFmYjY2NjBjOGUifQ== --- BackupDr/metadata/V1/Backupdr.php | Bin 5611 -> 11158 bytes BackupDr/metadata/V1/Backupplan.php | Bin 0 -> 3876 bytes .../metadata/V1/Backupplanassociation.php | Bin 0 -> 3399 bytes BackupDr/metadata/V1/Backupvault.php | Bin 0 -> 11613 bytes BackupDr/metadata/V1/BackupvaultBa.php | Bin 0 -> 1358 bytes BackupDr/metadata/V1/BackupvaultGce.php | Bin 0 -> 11739 bytes .../V1/BackupDRClient/create_backup_plan.php | 174 + .../create_backup_plan_association.php | 114 + .../V1/BackupDRClient/create_backup_vault.php | 93 + .../create_management_server.php | 4 +- .../V1/BackupDRClient/delete_backup.php | 89 + .../V1/BackupDRClient/delete_backup_plan.php | 82 + .../delete_backup_plan_association.php | 85 + .../V1/BackupDRClient/delete_backup_vault.php | 80 + .../fetch_usable_backup_vaults.php | 83 + .../samples/V1/BackupDRClient/get_backup.php | 78 + .../V1/BackupDRClient/get_backup_plan.php | 73 + .../get_backup_plan_association.php | 76 + .../V1/BackupDRClient/get_backup_vault.php | 72 + .../V1/BackupDRClient/get_data_source.php | 77 + .../BackupDRClient/get_management_server.php | 2 +- .../list_backup_plan_associations.php | 81 + .../V1/BackupDRClient/list_backup_plans.php | 80 + .../V1/BackupDRClient/list_backup_vaults.php | 81 + .../V1/BackupDRClient/list_backups.php | 86 + .../V1/BackupDRClient/list_data_sources.php | 81 + .../list_management_servers.php | 9 +- .../V1/BackupDRClient/restore_backup.php | 90 + .../V1/BackupDRClient/trigger_backup.php | 91 + .../V1/BackupDRClient/update_backup.php | 74 + .../V1/BackupDRClient/update_backup_vault.php | 77 + .../V1/BackupDRClient/update_data_source.php | 74 + BackupDr/src/V1/AcceleratorConfig.php | 130 + BackupDr/src/V1/AccessConfig.php | 406 +++ BackupDr/src/V1/AccessConfig/AccessType.php | 62 + BackupDr/src/V1/AccessConfig/NetworkTier.php | 64 + BackupDr/src/V1/AdvancedMachineFeatures.php | 241 ++ BackupDr/src/V1/AliasIpRange.php | 129 + BackupDr/src/V1/AllocationAffinity.php | 159 + BackupDr/src/V1/AllocationAffinity/Type.php | 70 + BackupDr/src/V1/AttachedDisk.php | 804 +++++ .../src/V1/AttachedDisk/DiskInterface.php | 76 + BackupDr/src/V1/AttachedDisk/DiskMode.php | 74 + .../src/V1/AttachedDisk/DiskSavedState.php | 55 + BackupDr/src/V1/AttachedDisk/DiskType.php | 62 + .../src/V1/AttachedDisk/InitializeParams.php | 120 + BackupDr/src/V1/Backup.php | 728 +++++ BackupDr/src/V1/Backup/BackupType.php | 62 + BackupDr/src/V1/Backup/GCPBackupPlanInfo.php | 119 + BackupDr/src/V1/Backup/State.php | 76 + .../src/V1/BackupApplianceBackupConfig.php | 272 ++ .../V1/BackupApplianceBackupProperties.php | 218 ++ BackupDr/src/V1/BackupApplianceLockInfo.php | 252 ++ BackupDr/src/V1/BackupConfigInfo.php | 235 ++ .../V1/BackupConfigInfo/LastBackupState.php | 78 + BackupDr/src/V1/BackupConfigState.php | 63 + BackupDr/src/V1/BackupLock.php | 163 + BackupDr/src/V1/BackupPlan.php | 490 +++ BackupDr/src/V1/BackupPlan/State.php | 76 + BackupDr/src/V1/BackupPlanAssociation.php | 396 +++ .../src/V1/BackupPlanAssociation/State.php | 76 + BackupDr/src/V1/BackupRule.php | 166 + BackupDr/src/V1/BackupVault.php | 715 +++++ .../src/V1/BackupVault/AccessRestriction.php | 70 + BackupDr/src/V1/BackupVault/State.php | 76 + BackupDr/src/V1/BackupVaultView.php | 62 + BackupDr/src/V1/BackupView.php | 62 + BackupDr/src/V1/BackupWindow.php | 125 + BackupDr/src/V1/Client/BackupDRClient.php | 779 +++++ .../V1/ComputeInstanceBackupProperties.php | 716 +++++ .../ComputeInstanceDataSourceProperties.php | 204 ++ .../V1/ComputeInstanceRestoreProperties.php | 1150 +++++++ .../InstancePrivateIpv6GoogleAccess.php | 76 + .../V1/ComputeInstanceTargetEnvironment.php | 102 + .../src/V1/ConfidentialInstanceConfig.php | 81 + .../V1/CreateBackupPlanAssociationRequest.php | 252 ++ BackupDr/src/V1/CreateBackupPlanRequest.php | 262 ++ BackupDr/src/V1/CreateBackupVaultRequest.php | 285 ++ .../src/V1/CreateManagementServerRequest.php | 20 +- BackupDr/src/V1/CustomerEncryptionKey.php | 205 ++ BackupDr/src/V1/DataSource.php | 543 ++++ BackupDr/src/V1/DataSource/State.php | 76 + .../DataSourceBackupApplianceApplication.php | 272 ++ BackupDr/src/V1/DataSourceGcpResource.php | 190 ++ .../V1/DeleteBackupPlanAssociationRequest.php | 160 + BackupDr/src/V1/DeleteBackupPlanRequest.php | 161 + BackupDr/src/V1/DeleteBackupRequest.php | 155 + BackupDr/src/V1/DeleteBackupVaultRequest.php | 311 ++ BackupDr/src/V1/DisplayDevice.php | 77 + BackupDr/src/V1/Entry.php | 133 + .../src/V1/FetchUsableBackupVaultsRequest.php | 246 ++ .../V1/FetchUsableBackupVaultsResponse.php | 159 + BackupDr/src/V1/GcpBackupConfig.php | 171 + BackupDr/src/V1/GcpResource.php | 139 + .../V1/GetBackupPlanAssociationRequest.php | 86 + BackupDr/src/V1/GetBackupPlanRequest.php | 87 + BackupDr/src/V1/GetBackupRequest.php | 124 + BackupDr/src/V1/GetBackupVaultRequest.php | 124 + BackupDr/src/V1/GetDataSourceRequest.php | 86 + .../src/V1/GetManagementServerRequest.php | 10 +- BackupDr/src/V1/GuestOsFeature.php | 77 + .../src/V1/GuestOsFeature/FeatureType.php | 146 + BackupDr/src/V1/InstanceParams.php | 67 + BackupDr/src/V1/KeyRevocationActionType.php | 63 + .../V1/ListBackupPlanAssociationsRequest.php | 212 ++ .../V1/ListBackupPlanAssociationsResponse.php | 159 + BackupDr/src/V1/ListBackupPlansRequest.php | 277 ++ BackupDr/src/V1/ListBackupPlansResponse.php | 179 ++ BackupDr/src/V1/ListBackupVaultsRequest.php | 284 ++ BackupDr/src/V1/ListBackupVaultsResponse.php | 159 + BackupDr/src/V1/ListBackupsRequest.php | 284 ++ BackupDr/src/V1/ListBackupsResponse.php | 159 + BackupDr/src/V1/ListDataSourcesRequest.php | 246 ++ BackupDr/src/V1/ListDataSourcesResponse.php | 159 + .../src/V1/ListManagementServersRequest.php | 45 +- .../src/V1/ListManagementServersResponse.php | 8 +- BackupDr/src/V1/ManagementServer.php | 8 +- BackupDr/src/V1/Metadata.php | 71 + BackupDr/src/V1/NetworkInterface.php | 700 +++++ .../V1/NetworkInterface/Ipv6AccessType.php | 63 + BackupDr/src/V1/NetworkInterface/NicType.php | 62 + .../src/V1/NetworkInterface/StackType.php | 62 + BackupDr/src/V1/NetworkPerformanceConfig.php | 77 + .../src/V1/NetworkPerformanceConfig/Tier.php | 66 + BackupDr/src/V1/OperationMetadata.php | 8 +- BackupDr/src/V1/RestoreBackupRequest.php | 244 ++ BackupDr/src/V1/RestoreBackupResponse.php | 77 + BackupDr/src/V1/RuleConfigInfo.php | 201 ++ .../src/V1/RuleConfigInfo/LastBackupState.php | 77 + BackupDr/src/V1/Scheduling.php | 399 +++ .../Scheduling/InstanceTerminationAction.php | 62 + BackupDr/src/V1/Scheduling/NodeAffinity.php | 157 + .../V1/Scheduling/NodeAffinity/Operator.php | 62 + .../src/V1/Scheduling/OnHostMaintenance.php | 64 + .../src/V1/Scheduling/ProvisioningModel.php | 62 + BackupDr/src/V1/SchedulingDuration.php | 128 + BackupDr/src/V1/ServiceAccount.php | 111 + BackupDr/src/V1/ServiceLockInfo.php | 72 + BackupDr/src/V1/StandardSchedule.php | 447 +++ .../V1/StandardSchedule/RecurrenceType.php | 83 + BackupDr/src/V1/Tags.php | 71 + BackupDr/src/V1/TargetResource.php | 75 + BackupDr/src/V1/TriggerBackupRequest.php | 196 ++ BackupDr/src/V1/UpdateBackupRequest.php | 230 ++ BackupDr/src/V1/UpdateBackupVaultRequest.php | 306 ++ BackupDr/src/V1/UpdateDataSourceRequest.php | 264 ++ BackupDr/src/V1/WeekDayOfMonth.php | 103 + .../src/V1/WeekDayOfMonth/WeekOfMonth.php | 84 + BackupDr/src/V1/gapic_metadata.json | 115 + .../V1/resources/backup_dr_client_config.json | 115 + .../resources/backup_dr_descriptor_config.php | 416 +++ .../backup_dr_rest_client_config.php | 282 ++ .../Unit/V1/Client/BackupDRClientTest.php | 2800 ++++++++++++++++- 153 files changed, 27238 insertions(+), 186 deletions(-) create mode 100644 BackupDr/metadata/V1/Backupplan.php create mode 100644 BackupDr/metadata/V1/Backupplanassociation.php create mode 100644 BackupDr/metadata/V1/Backupvault.php create mode 100644 BackupDr/metadata/V1/BackupvaultBa.php create mode 100644 BackupDr/metadata/V1/BackupvaultGce.php create mode 100644 BackupDr/samples/V1/BackupDRClient/create_backup_plan.php create mode 100644 BackupDr/samples/V1/BackupDRClient/create_backup_plan_association.php create mode 100644 BackupDr/samples/V1/BackupDRClient/create_backup_vault.php create mode 100644 BackupDr/samples/V1/BackupDRClient/delete_backup.php create mode 100644 BackupDr/samples/V1/BackupDRClient/delete_backup_plan.php create mode 100644 BackupDr/samples/V1/BackupDRClient/delete_backup_plan_association.php create mode 100644 BackupDr/samples/V1/BackupDRClient/delete_backup_vault.php create mode 100644 BackupDr/samples/V1/BackupDRClient/fetch_usable_backup_vaults.php create mode 100644 BackupDr/samples/V1/BackupDRClient/get_backup.php create mode 100644 BackupDr/samples/V1/BackupDRClient/get_backup_plan.php create mode 100644 BackupDr/samples/V1/BackupDRClient/get_backup_plan_association.php create mode 100644 BackupDr/samples/V1/BackupDRClient/get_backup_vault.php create mode 100644 BackupDr/samples/V1/BackupDRClient/get_data_source.php create mode 100644 BackupDr/samples/V1/BackupDRClient/list_backup_plan_associations.php create mode 100644 BackupDr/samples/V1/BackupDRClient/list_backup_plans.php create mode 100644 BackupDr/samples/V1/BackupDRClient/list_backup_vaults.php create mode 100644 BackupDr/samples/V1/BackupDRClient/list_backups.php create mode 100644 BackupDr/samples/V1/BackupDRClient/list_data_sources.php create mode 100644 BackupDr/samples/V1/BackupDRClient/restore_backup.php create mode 100644 BackupDr/samples/V1/BackupDRClient/trigger_backup.php create mode 100644 BackupDr/samples/V1/BackupDRClient/update_backup.php create mode 100644 BackupDr/samples/V1/BackupDRClient/update_backup_vault.php create mode 100644 BackupDr/samples/V1/BackupDRClient/update_data_source.php create mode 100644 BackupDr/src/V1/AcceleratorConfig.php create mode 100644 BackupDr/src/V1/AccessConfig.php create mode 100644 BackupDr/src/V1/AccessConfig/AccessType.php create mode 100644 BackupDr/src/V1/AccessConfig/NetworkTier.php create mode 100644 BackupDr/src/V1/AdvancedMachineFeatures.php create mode 100644 BackupDr/src/V1/AliasIpRange.php create mode 100644 BackupDr/src/V1/AllocationAffinity.php create mode 100644 BackupDr/src/V1/AllocationAffinity/Type.php create mode 100644 BackupDr/src/V1/AttachedDisk.php create mode 100644 BackupDr/src/V1/AttachedDisk/DiskInterface.php create mode 100644 BackupDr/src/V1/AttachedDisk/DiskMode.php create mode 100644 BackupDr/src/V1/AttachedDisk/DiskSavedState.php create mode 100644 BackupDr/src/V1/AttachedDisk/DiskType.php create mode 100644 BackupDr/src/V1/AttachedDisk/InitializeParams.php create mode 100644 BackupDr/src/V1/Backup.php create mode 100644 BackupDr/src/V1/Backup/BackupType.php create mode 100644 BackupDr/src/V1/Backup/GCPBackupPlanInfo.php create mode 100644 BackupDr/src/V1/Backup/State.php create mode 100644 BackupDr/src/V1/BackupApplianceBackupConfig.php create mode 100644 BackupDr/src/V1/BackupApplianceBackupProperties.php create mode 100644 BackupDr/src/V1/BackupApplianceLockInfo.php create mode 100644 BackupDr/src/V1/BackupConfigInfo.php create mode 100644 BackupDr/src/V1/BackupConfigInfo/LastBackupState.php create mode 100644 BackupDr/src/V1/BackupConfigState.php create mode 100644 BackupDr/src/V1/BackupLock.php create mode 100644 BackupDr/src/V1/BackupPlan.php create mode 100644 BackupDr/src/V1/BackupPlan/State.php create mode 100644 BackupDr/src/V1/BackupPlanAssociation.php create mode 100644 BackupDr/src/V1/BackupPlanAssociation/State.php create mode 100644 BackupDr/src/V1/BackupRule.php create mode 100644 BackupDr/src/V1/BackupVault.php create mode 100644 BackupDr/src/V1/BackupVault/AccessRestriction.php create mode 100644 BackupDr/src/V1/BackupVault/State.php create mode 100644 BackupDr/src/V1/BackupVaultView.php create mode 100644 BackupDr/src/V1/BackupView.php create mode 100644 BackupDr/src/V1/BackupWindow.php create mode 100644 BackupDr/src/V1/ComputeInstanceBackupProperties.php create mode 100644 BackupDr/src/V1/ComputeInstanceDataSourceProperties.php create mode 100644 BackupDr/src/V1/ComputeInstanceRestoreProperties.php create mode 100644 BackupDr/src/V1/ComputeInstanceRestoreProperties/InstancePrivateIpv6GoogleAccess.php create mode 100644 BackupDr/src/V1/ComputeInstanceTargetEnvironment.php create mode 100644 BackupDr/src/V1/ConfidentialInstanceConfig.php create mode 100644 BackupDr/src/V1/CreateBackupPlanAssociationRequest.php create mode 100644 BackupDr/src/V1/CreateBackupPlanRequest.php create mode 100644 BackupDr/src/V1/CreateBackupVaultRequest.php create mode 100644 BackupDr/src/V1/CustomerEncryptionKey.php create mode 100644 BackupDr/src/V1/DataSource.php create mode 100644 BackupDr/src/V1/DataSource/State.php create mode 100644 BackupDr/src/V1/DataSourceBackupApplianceApplication.php create mode 100644 BackupDr/src/V1/DataSourceGcpResource.php create mode 100644 BackupDr/src/V1/DeleteBackupPlanAssociationRequest.php create mode 100644 BackupDr/src/V1/DeleteBackupPlanRequest.php create mode 100644 BackupDr/src/V1/DeleteBackupRequest.php create mode 100644 BackupDr/src/V1/DeleteBackupVaultRequest.php create mode 100644 BackupDr/src/V1/DisplayDevice.php create mode 100644 BackupDr/src/V1/Entry.php create mode 100644 BackupDr/src/V1/FetchUsableBackupVaultsRequest.php create mode 100644 BackupDr/src/V1/FetchUsableBackupVaultsResponse.php create mode 100644 BackupDr/src/V1/GcpBackupConfig.php create mode 100644 BackupDr/src/V1/GcpResource.php create mode 100644 BackupDr/src/V1/GetBackupPlanAssociationRequest.php create mode 100644 BackupDr/src/V1/GetBackupPlanRequest.php create mode 100644 BackupDr/src/V1/GetBackupRequest.php create mode 100644 BackupDr/src/V1/GetBackupVaultRequest.php create mode 100644 BackupDr/src/V1/GetDataSourceRequest.php create mode 100644 BackupDr/src/V1/GuestOsFeature.php create mode 100644 BackupDr/src/V1/GuestOsFeature/FeatureType.php create mode 100644 BackupDr/src/V1/InstanceParams.php create mode 100644 BackupDr/src/V1/KeyRevocationActionType.php create mode 100644 BackupDr/src/V1/ListBackupPlanAssociationsRequest.php create mode 100644 BackupDr/src/V1/ListBackupPlanAssociationsResponse.php create mode 100644 BackupDr/src/V1/ListBackupPlansRequest.php create mode 100644 BackupDr/src/V1/ListBackupPlansResponse.php create mode 100644 BackupDr/src/V1/ListBackupVaultsRequest.php create mode 100644 BackupDr/src/V1/ListBackupVaultsResponse.php create mode 100644 BackupDr/src/V1/ListBackupsRequest.php create mode 100644 BackupDr/src/V1/ListBackupsResponse.php create mode 100644 BackupDr/src/V1/ListDataSourcesRequest.php create mode 100644 BackupDr/src/V1/ListDataSourcesResponse.php create mode 100644 BackupDr/src/V1/Metadata.php create mode 100644 BackupDr/src/V1/NetworkInterface.php create mode 100644 BackupDr/src/V1/NetworkInterface/Ipv6AccessType.php create mode 100644 BackupDr/src/V1/NetworkInterface/NicType.php create mode 100644 BackupDr/src/V1/NetworkInterface/StackType.php create mode 100644 BackupDr/src/V1/NetworkPerformanceConfig.php create mode 100644 BackupDr/src/V1/NetworkPerformanceConfig/Tier.php create mode 100644 BackupDr/src/V1/RestoreBackupRequest.php create mode 100644 BackupDr/src/V1/RestoreBackupResponse.php create mode 100644 BackupDr/src/V1/RuleConfigInfo.php create mode 100644 BackupDr/src/V1/RuleConfigInfo/LastBackupState.php create mode 100644 BackupDr/src/V1/Scheduling.php create mode 100644 BackupDr/src/V1/Scheduling/InstanceTerminationAction.php create mode 100644 BackupDr/src/V1/Scheduling/NodeAffinity.php create mode 100644 BackupDr/src/V1/Scheduling/NodeAffinity/Operator.php create mode 100644 BackupDr/src/V1/Scheduling/OnHostMaintenance.php create mode 100644 BackupDr/src/V1/Scheduling/ProvisioningModel.php create mode 100644 BackupDr/src/V1/SchedulingDuration.php create mode 100644 BackupDr/src/V1/ServiceAccount.php create mode 100644 BackupDr/src/V1/ServiceLockInfo.php create mode 100644 BackupDr/src/V1/StandardSchedule.php create mode 100644 BackupDr/src/V1/StandardSchedule/RecurrenceType.php create mode 100644 BackupDr/src/V1/Tags.php create mode 100644 BackupDr/src/V1/TargetResource.php create mode 100644 BackupDr/src/V1/TriggerBackupRequest.php create mode 100644 BackupDr/src/V1/UpdateBackupRequest.php create mode 100644 BackupDr/src/V1/UpdateBackupVaultRequest.php create mode 100644 BackupDr/src/V1/UpdateDataSourceRequest.php create mode 100644 BackupDr/src/V1/WeekDayOfMonth.php create mode 100644 BackupDr/src/V1/WeekDayOfMonth/WeekOfMonth.php diff --git a/BackupDr/metadata/V1/Backupdr.php b/BackupDr/metadata/V1/Backupdr.php index ad9d53d4795104ebe54e55f0f4947c64580359cd..fde6b0d8cfbdf7d0c8a52d61ff14ec9a42a21a7e 100644 GIT binary patch literal 11158 zcmb_iO>7&-70!ybEDilbj}x1b?PNncuuRxwr2NyiVoIbH+LlC6KY?B0B*wcSFO)J4NG9NjY-YHeTjwhguA*q&Xtn`*7SxoJ3R-QH=L zO~c8kYGFlPURhI%h0@wf;Og3Kr*7obE!*B|8rgc&Za1YB<^58UJ^Nj){<^ z?-*`NuN&%Od49?8^oH)~)kW%FT_En&dG21_n7M&ay{WsdDz2eNNQHl`cCBgFRoBx! z`0ujmYNlm+rrtC^1QfT_O}*(F;M{Aw*|zGQXEzfq!V4BNq8J@p< zX*-8-Em@oPXl@mQGi+#VJsjeEYBhCh___Oy0(`XVCSCKVA8=Q1H%Hio`?j^^v@OfD zwyG;FlC`7lyiaJLQ*o!|?GKN@cU?0fg*|Xjjt2Pc_fhDuaMNK|HbX6hUtLT{NMU?eM;SWUes-Pk15*J_;m z+~9nVfe8%fH=mboI-JJ*)>VFs#^Ot4AeV%z-1M~}OeI2cuk-*f$~ta)iQ6^hjGERqgYaWGfnvZh8Z`wJOYNac?*Zsd8;WSD0lucU zKd-w+qjR+C6*RSJIXm%k+n#0R zp;W+E(FJ*GTPJrlmM5Coknw@3Ja><&H2bFrB?64AhO=upu<1ugd%%Yr|2z+yK7o@c z-rz+Sv@SU*ASn1A8gJ?~qv>JTU=$%j)A7Ax5Zn-6chM1Vzhxv(QvSXvCh3u;Oi$P)3zQeSmNjr^ zaTn0ZE;__%5Y;Qg3=3RkKwOYgl7Eznu&<1ZT8)sgn{Np^!L8`=!-*Au@n^k{j*|Y! zNFJjr@mBPZfiojZMy$jt@n;z3&;%C^H#tEW(Qgqtw1EsThEJm-(2;H>Pe3$WaxS7o z506iY+cCV0u12m}kKbv!ZgbHf!`H1dAsN)?(eawD0V_Y)rxJhxE=z0-TI51o;6lZ6 zwbqAj@(i7}m&)_du5RefHebD|PCqmGEci{(>87ruxRfwBj$#jueU_*A1UkA)Mq#>^ z8+%Jh<wMubyZKYBKMg15`f*6Bt zF@6C}`Gde%Aj6&dd>lMvK zisgKXh<@TIK84~-`O@-Qahb%L7$?INE0vW>;#lsd%9r_{C}`Sm9az-?MRzmsfRycK zD83Kd^DU$9x!Fhj*Fm;v*ICP!eI$M!WP|)=+y;l>l1sJmAbmQx#I0r%-Ir4TP|$_@ zrt2;F1%lgFjQ88nwBg%m97+fzHy7Dgfc9VI(|CAPXVGK}3Z3S{qZZxrql6*~K8Fy! z?%59wD@lZqXHXK2Z<;goAa_*z&mmmsE&!bnbO882~zE86S|63uqZCTEL*T$J-W^ ziu$%*YZ?F*QZH4lqNzorXW_-V&vleGzUsqsDfKUay+F%TcbsB|r{CF^(6c=YM=HEu zw#V>YB+-zsE#2#pmX?Vv5XNDwB$EW(NPU1V7L2Ch8BtK5axn>2rI~$rO6tckblQKa z5{DC{#><@n=|_jC@iS<`uo@#Z6VNnzx&tQ)LHfi_^yhrpShlb#B6OM`)3(o>P@%d5vX(J8&rfU^`EPCMXK zWz*)R^quI`=~=Q2Jh|~9$RoesWyPjmM`uFr4Js(JPqJu&9RU?8_%8~2E>r?=p9V10 zf#=RtpAIa-k7-Tn&XYXX(~my;;)i2z;@8PT+#@Ejw|xCiOS+#9(R=(m1)T{|5Bys6 zqKB9ZI3uWBs_-OFo9>SINf#aweMqrNAK*{M(AjW#!hO~@+(V$aD6mTprWv1Vsh=y4 z^Dl=yMD!-`ll*nIA=i53t@jFO5nYPAsl#n$u2&%OKNWN~T+#ZiPPoUAtMmTjd>TE+ zpNoNq^b|8gPkeCL3P~JDGvFh0;C~7_&32S!>IOO4!n0x*dmnCkjEBVbG3>mG;_@tE zkS_5}XZ@N+k36o)e~7KVoqA=MtYxkgm79a^o1Ag8QSomTlpsPePcJePJQIz)+g1SY zvsk?@T!QkQ5;TiP27~{upmTQ&ufDzRl8&YWMW08q2p0k7?P&awo*dIsC#E@kbL0)$ z4DjGzDCi`}rGyJ-ql4?T6lh+Kc96zRy(7!1*o%ItRFf!^1tt9ovS^*2C`iNh%c34* z5%B>1{QhuRlw<+&^xp=!rBqyfmSYLaCL`Ji3kN2Imn!j%FeT zjLec3bRz0s!&5orM=%%8MC0f%6euo7+XthjKmdY@B*Gqk$>o?yQhhXr5-d-GIr`~y zx2*_%KuUcADfJ>k(i~xR>0ARARAaBTu5~BWgW0=uizJ&7@~I1VE-np&|D?bnj$fo) zd@Xt>Br^g1`jFO~c@H|7cNf1qGV{8?a9+CjR|=Z+H5&Knb$ug&L5;@1^d|M5%sUbE zVR1KWnICBoem{Zb(ya~BkFT?A}e)8FEJ0$S$G5KU9rgMZ5`K8Xbp1dj*T|N0N zn)0kxhaM0k~IB7 zK~q6j)dkAMH==0~?Im#a;Z#3op2zn(^H{(fI*(L{5 z6a8lTY4(>VEzO{UZ|AGL1tO`##`(#QGE6TFJHH8UdrLCQ;0rFCTh49$Z&e zh(mlmB&O0iP{JLec)lCDhHERGUbjnp#c=mL%O-wKQL1%iz1~vPYOVDVss?V)H%L+0 zcHM28HnfZ=x?Djm<&+jjZXV2E19J31G=zApabb}}>jq)QB>ZTs*?GeA&@9IaE#0=B;ZE)=UEK}{s-Ilj z?KwthxsE~=>W)FOiwd_%*DiQ2?)<(Ih18&6AQ0`E6B6Ii?RJ#}hHrVH>o;&|vA9jb zK7{m3c2T&c=B%!gv3K`Y5(6On<2Fd1v?7I`Bxlsvo%Br-bajr`{vi z33uMC!!mvAfhF=@R44Qg%FN6iNEtrCCZy3_rAN>~sxTMXing5VvxjQMWz@n()7MIzP3s|y z^L%K2&n7`S$pT-9oSn#+2)v1lsoR+R01~vMN%|Z*oGjdYmnH=^w?Q>{*mE!u$8f#REe<@=D#&5S&U3gosfxS^ zSHzZ?2`wQ0zGVP_1SIx#yGJ+yim|&=rUePM zGx;LSY_v)(ReQX?(NHV3<(gWZ{y-jw(MnS-wQB1t(~=C3ELB>yO?5g(B~^7zWs*33 ztE~&!NbyJMRq1;PGNTuI)7DW4cU-zPZj zIOS-4PZqv-J9Up6$u;{HXhY_kx(d@fcm%Kyw60IS?Vu=q|ag+T3Ln(k=m!0W4cdS&8G^VMC(ubE3?zf7F*3xx&&jit7*?L zMMJfo*@MZWpvu=^zNuCoH=F8uMb%nQ8pq2C3uv|exViQOi)joJ)lv-~W3;ZeRP`%- zj$_51dsJUViF6+BT(bbTVT2IIrA$saOC`k_WsNC8D$8L%p+3T__;Lm zT7t==(8>*%VEO6ihLh~h+p#)oAV**8-9Gv;`8LiSo@{EEQR`Ix#4;wNhOEd};W7nA zt1oK|lw;iqAzZFCH(I2|rl3=#N z<`qYjwvHw(fFP8Mko0t{v`{pOo2*eU$Y*J0^DrscMmrO2H2qOa$Bt-J8WmzO(HZ&9 zu|-4UG`t4DiZlqRVLD>R$|$3>{>RSwndPvFvLSt{i7c;;|0^~R3g!46JOJ!6>$Tv#DPxJ9ttJ#v~7 zOgPI}%Y-mnB{oizK{EccQEV^64B*rnWLV;h{uusHPH0E&OOd=`uHN2USZe1T!miy#4)Sd%xy0H5sBL3N+|Ax)n*$n zg|A}sT(MYWn#CfIs@g0TH&a#P$L&^&H>(7V^7~ zhmM~Ru=M)gVHUVFI7}6`0+&>7U~ZG{y&i>t$9Z;h116--lj!&!JCSR3q0Ct_TZdKb z)~BARk3JZT%drk*u8aYsaIT`iFQD81hsCnOwN%D^HRrzibZz;nu;)Zxbx5lLTpWg+ z{LAl631b1A5M2`@)+NBPYMP@XHe3-K;>fL17G((+l>eAVmw0!yq2u&P$H^Db9PKtm z!ct|azOb(^?(0Q)8J*63+v&52C;El7dQf)Y-gWlqH5BO|slW^UR}s37zlu^qygFx4LbkVXm7-^V~b~yJ)e| zG4!6<+Bhf42rcN1p1EV3D^N+(*ff}=NdK8FA)C{FlV0h+O6b;q*Jdhp`4JHCE8?a} z^||=ktNNkKMmVhHpL=4+AEF%W;O-bpY#7}6_}{yEnM)39)Gp0jFMnS|XAZ&$d_F~M zVS58XX-1Jp=scVdsVyAy!c+2|sogzph15;3P-n-^RPAdAEt5D7W5)baP0lStJ2JXt z39oV+S*t9ZBy(MoB*V`eBwjaHL02x!(eIuFfm*W7B^O`}C=R*+AlrS5j4VHi#LTckW&*Ue4%o-4m7 zpmKwCF9+#R5j*7T3`V(ZpoPeZNsx;A++p*fDxZ*p)+$;S)uh8_nntwt<9St(x6zd& zHnQC3yk<-`F`Zv&%n@=Sm$!uX{yh@<{J&N}+}b3xf)&jGbT zp9A8IZg$k2wU@cb5>Ey3R%muCcr3gsT;+kf!(b>UL9WoKjL@p WsVh1?JUn;C^_=bGm*_pThtR)C1XW7_ literal 0 HcmV?d00001 diff --git a/BackupDr/metadata/V1/Backupvault.php b/BackupDr/metadata/V1/Backupvault.php new file mode 100644 index 0000000000000000000000000000000000000000..23fe823241043284d974fec1af5d3221db551edf GIT binary patch literal 11613 zcmd5?O>7(25%!9bEDmM;tYn#%6Pux(SXN@GW}C#JV<#jOt|nHDs$uJ{QAzAQNw|-UMBT2rwQ|i$>^1iH4Leb;9o9|D zuon`ErH#b;##SP~RM>g}Nu655E*t5@L9KRR8H;7B)~GD*>E*|bdc|Hmx+Q-f=?%+W zV735N{m^jgdf7;<6tnjYSFh-=A(tg~=6+&M$e2#I z33)f++6^PTdLm&PZo{tLVY!LHvHxqg!--|;=I*j-Se2~tNIx=bb~+vGDqwOVX`#Ab zI~`fckgD%{u{O<0Ewe_mdjHFx$Y=$vv2T%l#V$3_{?Q(uf|QT`zV1AJ3fe6bJ;Buv z>;2P~>gC-{H28+onTBom<~>tdYNk^04RaY?c+NK^GOX+HaS7)8_gytE<}R?GFL-{w zaCB?-lH{V-&BcAPM)bw~nsE8qi=jbV8jc*g+0W|Qo-U^^^fmpUY{>bS<$Q)7bm7H{ z)U+J;fXg2jvLB*8<%}z>99&Ona>4~U!LFAV$;}&%7)bsDASOU-hu}}0hCzb9xROxj zqS@ikGLg?RBkJ=It4K6K1B?&wAdV=jXFgICbs2^&eb2C*cq9>-i=}SK6KGe#LTIgp zHKxf|UHeIvn5l0-tZW+y@*2q>AH-#1sacPixBUg*B8e)ps*ngsifHbW4)sSmK%@^~ zUKojXh?sQPIMfWZ3XB*P4MEPRlFwG9@-~CHt8c=XfdLUi z$B{h8Q5Lz!IV!8ewERUFm4{KTHL7lW5@{oX@pCZl81|7_HZ;8~MpaMvhu=+k zfG}i8-vJdxG#m#t=(x7YaWo#srN>gQ_sN*)F@kvHtfSeR5DS^D8iUAVQcd9vu=@1fZ`iyz8g$BS02ER16DL+|IY%+{C) z=L*&wpO5FI?TWEfOpNhg*)bT^LKwz>hrova4k1YPCcKP@PB~&fu#g=EK=#tvvu9yQ zBk#^m!noG#jmf``04!lLxye~+7r?#ep#ZtdSZcnz%?7L%LLiX$5qXfk=^K492w65; zdn+LKiK?9dc^LQ62bMD+w_?y)q>Ttjos_6KhM%IV45Xcb=K|9(qAtT|xmMjb4-lFN zSOpC91lAnWgwFIGP^Cdgc9cBCFY?AtP*9eQNN}SRR)Fay#HpgtM1ravlu`t5OaJL_e7s@ zIOm}cN7?{U&cl?}9%z%F4#GsMrKt~L601_z<0Qd*qroPN9!cD=X-I;@>G65xKt&`zZ?S_T9Cq=$!^0x|H z5=0#}gQd-RNg60VsDLnspK2S%ES4-fqK?6^W9b_HO;#FF<1oQY1UPEUhKiV|ItkH7 zHS|ROM3xlAY-z-?V2@%?kllMRBam3Q1v2*%CVB3o zFz7z18{&}F8oWgPvIdq~W)*RPqC zk<$2Vg@(rAEUOWxa8i=I0ppvZCR(eNA5(b8!Y)dOCrnzD(Nv};|DeEymd*JziOyC= z)DcqX04D2Q%+#;N2k;bPsPxBZ6d04LaW*qSt-{EAwLM{3yc0yc8Nbpq5A_3sHx$M1 z6TVUNDWLAoNxmY8CI6!Uh>ei^>TMY3Rk2z$ErItWcTc<@z`}dBRcjiv;>1b-f6rC| z8wlAi2}26NExZGhUZooF6WxRpf-JM5&E9?YOZk{7)!m> z^L#?t(A#h>Y;g|uO{fuetrrinDS_ApnCa*YPFy`5D@C;+*#_>CcL><2H4{s{(Otq8 zU>8OafV%V#TCGj+_SLA4J#jU`-uLEitL6RlgrgaC@^ z)ccjr9ovQa+;%Elndx*;<=bu;QR zJlCly?IADo3&AN#K($a)73P^l4U**#sBilj2an3q?!{itCi-{G;R=8)3#*D9y85H|F``i%iml~zO-`(0{ zqbjQ#9+-mRebd5gTDb-OcpgS-cEzv}F@n@hL1Y*_GL84+6kNwrC!{Z-ZS5cdi;(;& zs=9s8P91H-K-OM8$og|QwZ*EylQ;lYN0JM-l$V}6;nm?DnH_j54sZKGVJoQ z;g%n5JM=Xq?Ek+Gk{>H@rK|8?!(sj$%fb~SY{;G+ztMDkCw;fS{<~*rq{P!3+TYR8 zw)p}sq*_m^Z~2#VbZ5!H(kWTc-O1qs%#bqWs6a6x%?veCQrt+y|$@!Rf@RBv`k94{A28 zz=NoJr3S&rH>=lL%<3gJtAr{Wu} zS}3DxqF0)8O6&WP0uz1=2#h5BdP5#;&ve<_yFmU^?EMo3rox~fh~YiPI1S#v3NnF~ zX4><_`ZLj_1yf;@y|u ztqwXF$%k;h<;0~EW?)=$K{3VMs%TBlb$3RwapcGIlLs)?{6)PBqv1}r%w|qVnpeVi zwAmS$Zjp&Q4_G6|LKCT@9bP5q?^9PAo0_7%%$Wi{`v|r6=ih}%VR*UV0$aTbS7gnd z+gM*NtaQ9<3Z9ZE_(|~U^Co7t*S53{O9cIconVT$&@9Zf(~IS@zgOTn z^p&o<&&nHAE;!K~-C9w3cw5{aiuZH;Xyu?LdjR-&7+j?G2;l iyR~m#_a8~VB3|c)9`n*guUYQ!ke6qQ=eEai4DeqB=RFhv literal 0 HcmV?d00001 diff --git a/BackupDr/metadata/V1/BackupvaultBa.php b/BackupDr/metadata/V1/BackupvaultBa.php new file mode 100644 index 0000000000000000000000000000000000000000..06aa2a0bd4645dba1cef687094ee9f551bca84db GIT binary patch literal 1358 zcmb7E&2G~`5XK4Ru&4;-LI{<*K&7Svg1p zdgo1$cnpp_1!pAQf%UHK^be`{VtaSyn{Q^mnb&W{i9k>B7*dc_L5#ywtWE$6$rX=y zg2Q||1&Jd*7c2qkVmvy)9}bT2&S?MWv3AXPE+Zg##`!FPUX<`W?u9h^l#5vQ7X9*j zLGwffA$1KhLMfd?CTIkBJn`OxqA^v}9~%(=T>;{IC5V6AA0QMZG|R9(GhiM?Ul7)h z$isw1I8#*V*9OZ1mNLa?!anPSw(*oE8EAy7w$nU~6yqr_91hY5x?9*{7PcFL>jG@! ziq)j3iLQsgpDK_kP5cpLkz_(~Inkzs%s|zZEKa&xW!M6aO>x(9B;*RoZLDMt=c8jR zLFFor~*zO+lW&VP*Qm zIIgqZ)#B*Z{0g?4=-Uc<{$HwSwXL~pMC4W?au@y1dI@CIqkGU(6;&&!Cx04f-HKx< zM8c?Urv25)36P3G)>=oaGb?o6^MJ)|2Rq#rulZ}(+`IMFaasekI%T@CS~x)wpxw|0 zcVBeel2;YotqWzHox*vH9!iM#0_15RX*z>Imr^PV)Vv9hv)3qqcF==MK#;~3=Jw5C zni|HtkM0E*(lsX+^7GbEC%6=AN!sh6_T}4(iTA@nYkDbEmATR}uXSNmjl?F-$5+;{ z>NB7BW_-CVs9^QNh@}Vzl>|iiz0n?<<=~p-;9B(2p?lo_SzY<%;wU%A=+M`z<9Fkc nbtJ@i5>mMma@-H^n4Z4ethM{hPU5-2{pZjcOFLR;=nSF1X05`D literal 0 HcmV?d00001 diff --git a/BackupDr/metadata/V1/BackupvaultGce.php b/BackupDr/metadata/V1/BackupvaultGce.php new file mode 100644 index 0000000000000000000000000000000000000000..6a830e43e0cc9174e3ea1d1be57d0949eca741d2 GIT binary patch literal 11739 zcmcIq&2Jl7avxG(R8gX+mTl3p$7XtF$DY|88rIG_vzp8-*kns;So{b{(Q8MWPK#{G zjHqs=yQvv(Ft-3%Ah`s{e-Px7T!I9-<(5N$T#{Q5Acsv(i~JR-s`t9t{Iq?DFP7Br z)vNbj)vtb4^?v7PgVzK2D1T%-wr2%)H-G*nAH25n1J4cIj@!?l4=*lkFW+&m2fe=S z74rFVEnls*@_N~5{T5F3-J#d95Av6;d)c?2bo%bF`{dl}Tnz_Z@5#+m`SXo6><8v$ z$1bpF0LQwv{eji7^G9{9Vh2{&3aqmumU31iDQB9La@KzO6+owN`F>vfjinuRZ1`iy zie9&+7MniCg+Qe_{1~8%0cyy%;*3pyxVynox5(_Tx|U zLMDy`W z$aE~n>&nyN3s%dx2I9mBBq^_lt<<@ww>in6ZJ035S-bL8*ZSSVnu}!Pf zafeQjOYz!|=Sygc2}Lnp`5M3{RfheZbD3M`^*>%PI~seuLK+;x_T|v_16tok6td9Y za=<$LaK02=JRDqdor~V3@*!ledyd%|49!8`3h<7ub7{W4Ra)j1>|NP!OwYb?JBTE% zgX{5se9ap;Fth)3{(8^tH;rg&k!QBhK91K&_I*4=MoPSUVWhcDUO7cyPhquho!fms zm*HLM^H+I`sTWRIj_w5Bo4wB=9s5;D!xHXKSiiCfD>qhuXtU+7A0)p_Xc^crV{W3Y z!HP-Fp>4sY88>-t8@9}GL)X%`{UAVRb+veoKYahZrbN+E_3S`ZR6I1_Q zf&9e&8)z1;XUBZ~4lGk_5!=+3eqBroPyc0yr+lA)AtgpII&|TFhYYc6I~1HEOECGbmy8wZ{Vx{X{b+WGb;7j8Dhx9} zfSoSdJsU2?TAM8qfhJOhz52s(NL(dj6jIpb4q$~)#z(LqfOTL(Bj|3V#^jE)jPx%p?sR=t21CZJ6dCd#ykgQDtP+2ZQksA zL{G7yKY+bZ7%~J30|X198!Eho{rM*-LvnpIHSUC)q^<_51Ix3n{oD>qTM#NkN3QdD zQgHb=Lo$AqfW3j&yFp%#jN;~*DOeB(LEq2aLcy8+SM$|;8&VdcmBk_ku5rZtn1MrQw2Lj>H0teV=25M7bfTNZQb}(%&C_bLu9u8MLoa7P zKxVpYRFCzB(J~JkwTjt1)v9{yMXm8Xn^4Xk!AE+vsNv+=X-lh}R?B9)5(;Y7q~vT; z`4oO22Wm#yXy~PuQL7eDriU&udmy0I?!%rrH}cM+5)a`+;fr$urFI8yVPu(#aZ?0_ zXv%mbVww_$0BsL)qaZwv`ER2qQKzc;{1MPtF4a%aHls!;lUwlmN&C7EpHcRSX zCt-IEM^g%L-*&9?zHK_l7Loqpwu2#62bksah9ytqoDkzt@Y=Jju5V&^KovZ30xQC= zISKq2l$)O4Bcb$N>Pd`Gj$+3581BfGhxSDem*@14av;tNg*;+y8rl3JC7DA{YNg$V z9o)>M8rogh4TVjtt6sq#2P^4XA=ZchrhE?fq!OJtQSAuIFnLhg1GpcqGi$tBhRrcv zryxg`@}*l&i6oaDAEN$g0=B1fIlQD;HYhT2&g;dY@s^a-YQU2e{#F&$n<#%qP+GXarloR1<-DtN1XNqdT3g?B&?N}lhJFeZalu&$N*{iTj z3Ti1>H92Wie+H?rNPzKZr5D&pbrKv{AI_%(ygJKO|7;zyl1Gh78+Tz%y2#imQXs#N zWMFt6evO@=^hUs%i`DHSq3}gPMoVL6_CJ6AZ~u`>rjp0(ji0~<^Qdqf`QUnd+>$8N zpcjN?E6~#krbL>3>q|C=u^Raz_QYna5&1L zGK(_S$tx~2X)>2ZIKBG?WaHc8LJMVEnf;&6H=`+`#9WKKVUjEimvcHya{p*(4?}pS z5{|q%PRpv0a(W%H6{^N$_TSF>BWo>Gd!5m8oP}XfkQQoMTzsR@iY1*WwWf4Q)nPq4 z1&nETkjj;wo2{31eS))X!aDN0FU(r?+#ZDMWNW2DOL|MpwWbxLrdh0}$xQnXTk0?YIl zq(#}5p*JRsAq{I~{jhj?LdOoU%0r&wxl<5cpr87;E3hG)L*NRQXO`K|C|WKoXvSw1 zCjE;8YzTdmc#M8$e4u&<-|2Bkf~L56LT*5uUe$r-h#Bqwb-T6^$#H(TL@!gPUdpvY{RKH^ons> z5iU=eW4YKUqv>#lK!`~{aIQur;MmD)S;)kHzj-D&-~7Abd~WUf9R+O#p`+95dLn8~F#}9qZ;z;f7$mNC!YX+)W3sdy+%ad)RsSJ@@G2|yqB5h{ za6773V8O_`#N2>;M}qeh=Oe(lph81dJt{&7b(TiVXzu`W^9H=Fg0KEn5|rthi*j}b zyU0QO;Wf5!qLR#rGcQJgXhK-SDU8A%qkyE76UU7?-zt+uB4lAvM>P@T(Bc^6rXwC& zf3;>d^rqgxvIdqG&}4UDt5|(G_QxbeC|TVojeS{S0z7B0n&h$Sf2{*FqaKs;3)sP4 z4^;)QF+g$1p>m)E_Gk02btIxtbB=L(Wi)$)>k4HdLo5$da~hjVNT0lba{!rhGJ{3L zM2xeqvFMCBB_n3Mbx?yX$L-?ni82~h%9fdJFKAiB)T`p$@b(0cL${)i3=746m>*}g z48dqK3RVOtyL27QSj}sc(Pv=I?7!QgU^O6`UZL6IP?$7d6UWA*pt>st3e+XuapM+c zX8)UaI{VPOS|c%{`zDrS{KwWFl`s3I?|1PII_{0_y}|f>ZM(w&TZvTPUr@&!9c6il z-A6nTA)6w`-hU%x#SeI1dew#$HKe(DNxqWVKX|A8#bp<2Qi52YO=qT`eF>>>C^<{5 zt~ZLU+9au1g``0~hI|6wbeQ;aGISE=O`*Q(DQr)fI2!iDTGc$RHCtw-NW8MjHOUwU zMaqe+6)9%Lz)+@h09vaUN2rUQ{mq(MgY79J!FIrddZX4hn&|&V^~kK$%KFJfm_+It z#j%8vg5_qt*22h$O}@G2p!^Wd9z~VYP$^sltCxf|6HDNk;JP|%O$)SYbvzv^JPxY|2#@PhRk@8TtNXgf@gm!Jfn5`9ke479Yz6`#KYA+j0YJ1 z6eV6n5PVGiiw)!g@kb1ZN!z2BJ+fNLE2b9_@VE?YdW0{7MhzFN)Sx5d^8kD$!tWfI z8H)12sKJY5_p0Y~87U=WWH#G|TU@FnQjKM4yl;FxV0R@{F6bJL>4k+d&Wp8VE+NVg zN3cwoE3xo>NS0vTl-3KMFI zWup3Sb7NF~=7bun$k@lR9pBDvM7OQ9xgQ*V^&*n(1)c7xqlwaPu`f=yvAH99!>(`2 zPQH9Uv7otgL=Q=7zHH#LG*obhZ*aT?kQ2Sk1qVN~7AO?t#wa#US#DUWrlzJmWo~@F zfV6MjU{w$uJ+QHxNkQQ!^Mk_FsWfSJlO}7cSnm3Dap{=5r4L{|GRYkEGuNZ<+@3_! z;uMgYlbJ=0?Wq+<)Q@_UdoLk7=}?&8h{f57CQGt=u<6+YG!o0C&cYZfYygO&Kh0D% zNQFLu$aTAHG-nn`FfVSFFrJi-F}h%R0s~#sXksj)a8MUA$R8pZ6iz0f9;Y?*V%dCw z?J){c7_<0yF1#cuI-b-@&#{lTq`u;k_Elt#*u~sq)wr&5Sj3*(c>JT#QED0}6@RL> zD>`=3DBQNoMx~Nnq6&(^1D4eyWN62uOQnhq3vU+NdfCK?hpoPG@u(_hcf^-by#$A$ zDTI`Lu?X2X-6JT|cHy=-@d@nW5d=Qml@j2=pv`E(UkM&qa10MP`D4T5Y7RYD6TLd> zN1L?*~(hurCEn{F@E<{KP3x7t9)Tp%e5Cxyl%{3_#>w8vhRxb zj(o!QN|jnKJ#RUZVB18uFQyQGIPyd~2JfVx1bb*)`0J?`cIGTG3nB zfju#*r$3KNOJO{_+dRcI3A?#yBBvES{&^ik_D)l8fvzh4LK6?qf_$Fr713Be0_~f}x8D6_q;;b(uWHSz( zoCqr;!kr{1`{x8bth%0yo7#?e5E{N3M#>qu^~9?$#Y7TyC7setStartHourOfDay($backupPlanBackupRulesStandardScheduleBackupWindowStartHourOfDay) + ->setEndHourOfDay($backupPlanBackupRulesStandardScheduleBackupWindowEndHourOfDay); + $backupPlanBackupRulesStandardSchedule = (new StandardSchedule()) + ->setRecurrenceType($backupPlanBackupRulesStandardScheduleRecurrenceType) + ->setBackupWindow($backupPlanBackupRulesStandardScheduleBackupWindow) + ->setTimeZone($backupPlanBackupRulesStandardScheduleTimeZone); + $backupRule = (new BackupRule()) + ->setRuleId($backupPlanBackupRulesRuleId) + ->setBackupRetentionDays($backupPlanBackupRulesBackupRetentionDays) + ->setStandardSchedule($backupPlanBackupRulesStandardSchedule); + $backupPlanBackupRules = [$backupRule,]; + $backupPlan = (new BackupPlan()) + ->setBackupRules($backupPlanBackupRules) + ->setResourceType($backupPlanResourceType) + ->setBackupVault($formattedBackupPlanBackupVault); + $request = (new CreateBackupPlanRequest()) + ->setParent($formattedParent) + ->setBackupPlanId($backupPlanId) + ->setBackupPlan($backupPlan); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backupDRClient->createBackupPlan($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var BackupPlan $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $formattedParent = BackupDRClient::locationName('[PROJECT]', '[LOCATION]'); + $backupPlanId = '[BACKUP_PLAN_ID]'; + $backupPlanBackupRulesRuleId = '[RULE_ID]'; + $backupPlanBackupRulesBackupRetentionDays = 0; + $backupPlanBackupRulesStandardScheduleRecurrenceType = RecurrenceType::RECURRENCE_TYPE_UNSPECIFIED; + $backupPlanBackupRulesStandardScheduleBackupWindowStartHourOfDay = 0; + $backupPlanBackupRulesStandardScheduleBackupWindowEndHourOfDay = 0; + $backupPlanBackupRulesStandardScheduleTimeZone = '[TIME_ZONE]'; + $backupPlanResourceType = '[RESOURCE_TYPE]'; + $formattedBackupPlanBackupVault = BackupDRClient::backupVaultName( + '[PROJECT]', + '[LOCATION]', + '[BACKUPVAULT]' + ); + + create_backup_plan_sample( + $formattedParent, + $backupPlanId, + $backupPlanBackupRulesRuleId, + $backupPlanBackupRulesBackupRetentionDays, + $backupPlanBackupRulesStandardScheduleRecurrenceType, + $backupPlanBackupRulesStandardScheduleBackupWindowStartHourOfDay, + $backupPlanBackupRulesStandardScheduleBackupWindowEndHourOfDay, + $backupPlanBackupRulesStandardScheduleTimeZone, + $backupPlanResourceType, + $formattedBackupPlanBackupVault + ); +} +// [END backupdr_v1_generated_BackupDR_CreateBackupPlan_sync] diff --git a/BackupDr/samples/V1/BackupDRClient/create_backup_plan_association.php b/BackupDr/samples/V1/BackupDRClient/create_backup_plan_association.php new file mode 100644 index 000000000000..16cba9b49c8c --- /dev/null +++ b/BackupDr/samples/V1/BackupDRClient/create_backup_plan_association.php @@ -0,0 +1,114 @@ +setResource($backupPlanAssociationResource) + ->setBackupPlan($formattedBackupPlanAssociationBackupPlan); + $request = (new CreateBackupPlanAssociationRequest()) + ->setParent($formattedParent) + ->setBackupPlanAssociationId($backupPlanAssociationId) + ->setBackupPlanAssociation($backupPlanAssociation); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backupDRClient->createBackupPlanAssociation($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var BackupPlanAssociation $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $formattedParent = BackupDRClient::locationName('[PROJECT]', '[LOCATION]'); + $backupPlanAssociationId = '[BACKUP_PLAN_ASSOCIATION_ID]'; + $backupPlanAssociationResource = '[RESOURCE]'; + $formattedBackupPlanAssociationBackupPlan = BackupDRClient::backupPlanName( + '[PROJECT]', + '[LOCATION]', + '[BACKUP_PLAN]' + ); + + create_backup_plan_association_sample( + $formattedParent, + $backupPlanAssociationId, + $backupPlanAssociationResource, + $formattedBackupPlanAssociationBackupPlan + ); +} +// [END backupdr_v1_generated_BackupDR_CreateBackupPlanAssociation_sync] diff --git a/BackupDr/samples/V1/BackupDRClient/create_backup_vault.php b/BackupDr/samples/V1/BackupDRClient/create_backup_vault.php new file mode 100644 index 000000000000..0eb8a39cdfc9 --- /dev/null +++ b/BackupDr/samples/V1/BackupDRClient/create_backup_vault.php @@ -0,0 +1,93 @@ +setBackupMinimumEnforcedRetentionDuration($backupVaultBackupMinimumEnforcedRetentionDuration); + $request = (new CreateBackupVaultRequest()) + ->setParent($formattedParent) + ->setBackupVaultId($backupVaultId) + ->setBackupVault($backupVault); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backupDRClient->createBackupVault($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var BackupVault $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $formattedParent = BackupDRClient::locationName('[PROJECT]', '[LOCATION]'); + $backupVaultId = '[BACKUP_VAULT_ID]'; + + create_backup_vault_sample($formattedParent, $backupVaultId); +} +// [END backupdr_v1_generated_BackupDR_CreateBackupVault_sync] diff --git a/BackupDr/samples/V1/BackupDRClient/create_management_server.php b/BackupDr/samples/V1/BackupDRClient/create_management_server.php index 363df2a44dd8..c453145930c7 100644 --- a/BackupDr/samples/V1/BackupDRClient/create_management_server.php +++ b/BackupDr/samples/V1/BackupDRClient/create_management_server.php @@ -35,8 +35,8 @@ * Creates a new ManagementServer in a given project and location. * * @param string $formattedParent The management server project and location in the format - * `projects/{project_id}/locations/{location}`. In Cloud Backup and DR - * locations map to GCP regions, for example **us-central1**. Please see + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR + * locations map to Google Cloud regions, for example **us-central1**. Please see * {@see BackupDRClient::locationName()} for help formatting this field. * @param string $managementServerId The name of the management server to create. The name must be * unique for the specified project and location. diff --git a/BackupDr/samples/V1/BackupDRClient/delete_backup.php b/BackupDr/samples/V1/BackupDRClient/delete_backup.php new file mode 100644 index 000000000000..e57d2bbfa7fe --- /dev/null +++ b/BackupDr/samples/V1/BackupDRClient/delete_backup.php @@ -0,0 +1,89 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backupDRClient->deleteBackup($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Backup $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $formattedName = BackupDRClient::backupName( + '[PROJECT]', + '[LOCATION]', + '[BACKUPVAULT]', + '[DATASOURCE]', + '[BACKUP]' + ); + + delete_backup_sample($formattedName); +} +// [END backupdr_v1_generated_BackupDR_DeleteBackup_sync] diff --git a/BackupDr/samples/V1/BackupDRClient/delete_backup_plan.php b/BackupDr/samples/V1/BackupDRClient/delete_backup_plan.php new file mode 100644 index 000000000000..ceefc320aa66 --- /dev/null +++ b/BackupDr/samples/V1/BackupDRClient/delete_backup_plan.php @@ -0,0 +1,82 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backupDRClient->deleteBackupPlan($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $formattedName = BackupDRClient::backupPlanName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN]'); + + delete_backup_plan_sample($formattedName); +} +// [END backupdr_v1_generated_BackupDR_DeleteBackupPlan_sync] diff --git a/BackupDr/samples/V1/BackupDRClient/delete_backup_plan_association.php b/BackupDr/samples/V1/BackupDRClient/delete_backup_plan_association.php new file mode 100644 index 000000000000..8ebdabee84f5 --- /dev/null +++ b/BackupDr/samples/V1/BackupDRClient/delete_backup_plan_association.php @@ -0,0 +1,85 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backupDRClient->deleteBackupPlanAssociation($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $formattedName = BackupDRClient::backupPlanAssociationName( + '[PROJECT]', + '[LOCATION]', + '[BACKUP_PLAN_ASSOCIATION]' + ); + + delete_backup_plan_association_sample($formattedName); +} +// [END backupdr_v1_generated_BackupDR_DeleteBackupPlanAssociation_sync] diff --git a/BackupDr/samples/V1/BackupDRClient/delete_backup_vault.php b/BackupDr/samples/V1/BackupDRClient/delete_backup_vault.php new file mode 100644 index 000000000000..d1035e0287a1 --- /dev/null +++ b/BackupDr/samples/V1/BackupDRClient/delete_backup_vault.php @@ -0,0 +1,80 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backupDRClient->deleteBackupVault($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $formattedName = BackupDRClient::backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); + + delete_backup_vault_sample($formattedName); +} +// [END backupdr_v1_generated_BackupDR_DeleteBackupVault_sync] diff --git a/BackupDr/samples/V1/BackupDRClient/fetch_usable_backup_vaults.php b/BackupDr/samples/V1/BackupDRClient/fetch_usable_backup_vaults.php new file mode 100644 index 000000000000..ca3baa61001d --- /dev/null +++ b/BackupDr/samples/V1/BackupDRClient/fetch_usable_backup_vaults.php @@ -0,0 +1,83 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $backupDRClient->fetchUsableBackupVaults($request); + + /** @var BackupVault $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = BackupDRClient::locationName('[PROJECT]', '[LOCATION]'); + + fetch_usable_backup_vaults_sample($formattedParent); +} +// [END backupdr_v1_generated_BackupDR_FetchUsableBackupVaults_sync] diff --git a/BackupDr/samples/V1/BackupDRClient/get_backup.php b/BackupDr/samples/V1/BackupDRClient/get_backup.php new file mode 100644 index 000000000000..d022b8e9926a --- /dev/null +++ b/BackupDr/samples/V1/BackupDRClient/get_backup.php @@ -0,0 +1,78 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Backup $response */ + $response = $backupDRClient->getBackup($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 +{ + $formattedName = BackupDRClient::backupName( + '[PROJECT]', + '[LOCATION]', + '[BACKUPVAULT]', + '[DATASOURCE]', + '[BACKUP]' + ); + + get_backup_sample($formattedName); +} +// [END backupdr_v1_generated_BackupDR_GetBackup_sync] diff --git a/BackupDr/samples/V1/BackupDRClient/get_backup_plan.php b/BackupDr/samples/V1/BackupDRClient/get_backup_plan.php new file mode 100644 index 000000000000..bafab40279bf --- /dev/null +++ b/BackupDr/samples/V1/BackupDRClient/get_backup_plan.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var BackupPlan $response */ + $response = $backupDRClient->getBackupPlan($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 +{ + $formattedName = BackupDRClient::backupPlanName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN]'); + + get_backup_plan_sample($formattedName); +} +// [END backupdr_v1_generated_BackupDR_GetBackupPlan_sync] diff --git a/BackupDr/samples/V1/BackupDRClient/get_backup_plan_association.php b/BackupDr/samples/V1/BackupDRClient/get_backup_plan_association.php new file mode 100644 index 000000000000..9eec0a558560 --- /dev/null +++ b/BackupDr/samples/V1/BackupDRClient/get_backup_plan_association.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var BackupPlanAssociation $response */ + $response = $backupDRClient->getBackupPlanAssociation($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 +{ + $formattedName = BackupDRClient::backupPlanAssociationName( + '[PROJECT]', + '[LOCATION]', + '[BACKUP_PLAN_ASSOCIATION]' + ); + + get_backup_plan_association_sample($formattedName); +} +// [END backupdr_v1_generated_BackupDR_GetBackupPlanAssociation_sync] diff --git a/BackupDr/samples/V1/BackupDRClient/get_backup_vault.php b/BackupDr/samples/V1/BackupDRClient/get_backup_vault.php new file mode 100644 index 000000000000..7eda9342994a --- /dev/null +++ b/BackupDr/samples/V1/BackupDRClient/get_backup_vault.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var BackupVault $response */ + $response = $backupDRClient->getBackupVault($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 +{ + $formattedName = BackupDRClient::backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); + + get_backup_vault_sample($formattedName); +} +// [END backupdr_v1_generated_BackupDR_GetBackupVault_sync] diff --git a/BackupDr/samples/V1/BackupDRClient/get_data_source.php b/BackupDr/samples/V1/BackupDRClient/get_data_source.php new file mode 100644 index 000000000000..53f3211d7c1a --- /dev/null +++ b/BackupDr/samples/V1/BackupDRClient/get_data_source.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var DataSource $response */ + $response = $backupDRClient->getDataSource($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 +{ + $formattedName = BackupDRClient::dataSourceName( + '[PROJECT]', + '[LOCATION]', + '[BACKUPVAULT]', + '[DATASOURCE]' + ); + + get_data_source_sample($formattedName); +} +// [END backupdr_v1_generated_BackupDR_GetDataSource_sync] diff --git a/BackupDr/samples/V1/BackupDRClient/get_management_server.php b/BackupDr/samples/V1/BackupDRClient/get_management_server.php index c6ad450d29fa..f7fa6231f8c0 100644 --- a/BackupDr/samples/V1/BackupDRClient/get_management_server.php +++ b/BackupDr/samples/V1/BackupDRClient/get_management_server.php @@ -32,7 +32,7 @@ * Gets details of a single ManagementServer. * * @param string $formattedName Name of the management server resource name, in the format - * `projects/{project_id}/locations/{location}/managementServers/{resource_name}` + * 'projects/{project_id}/locations/{location}/managementServers/{resource_name}' * Please see {@see BackupDRClient::managementServerName()} for help formatting this field. */ function get_management_server_sample(string $formattedName): void diff --git a/BackupDr/samples/V1/BackupDRClient/list_backup_plan_associations.php b/BackupDr/samples/V1/BackupDRClient/list_backup_plan_associations.php new file mode 100644 index 000000000000..8f286295c44b --- /dev/null +++ b/BackupDr/samples/V1/BackupDRClient/list_backup_plan_associations.php @@ -0,0 +1,81 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $backupDRClient->listBackupPlanAssociations($request); + + /** @var BackupPlanAssociation $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = BackupDRClient::locationName('[PROJECT]', '[LOCATION]'); + + list_backup_plan_associations_sample($formattedParent); +} +// [END backupdr_v1_generated_BackupDR_ListBackupPlanAssociations_sync] diff --git a/BackupDr/samples/V1/BackupDRClient/list_backup_plans.php b/BackupDr/samples/V1/BackupDRClient/list_backup_plans.php new file mode 100644 index 000000000000..7e5f8ceee6a8 --- /dev/null +++ b/BackupDr/samples/V1/BackupDRClient/list_backup_plans.php @@ -0,0 +1,80 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $backupDRClient->listBackupPlans($request); + + /** @var BackupPlan $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = BackupDRClient::locationName('[PROJECT]', '[LOCATION]'); + + list_backup_plans_sample($formattedParent); +} +// [END backupdr_v1_generated_BackupDR_ListBackupPlans_sync] diff --git a/BackupDr/samples/V1/BackupDRClient/list_backup_vaults.php b/BackupDr/samples/V1/BackupDRClient/list_backup_vaults.php new file mode 100644 index 000000000000..3ebc85f7ddef --- /dev/null +++ b/BackupDr/samples/V1/BackupDRClient/list_backup_vaults.php @@ -0,0 +1,81 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $backupDRClient->listBackupVaults($request); + + /** @var BackupVault $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = BackupDRClient::locationName('[PROJECT]', '[LOCATION]'); + + list_backup_vaults_sample($formattedParent); +} +// [END backupdr_v1_generated_BackupDR_ListBackupVaults_sync] diff --git a/BackupDr/samples/V1/BackupDRClient/list_backups.php b/BackupDr/samples/V1/BackupDRClient/list_backups.php new file mode 100644 index 000000000000..def0a0a36513 --- /dev/null +++ b/BackupDr/samples/V1/BackupDRClient/list_backups.php @@ -0,0 +1,86 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $backupDRClient->listBackups($request); + + /** @var Backup $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = BackupDRClient::dataSourceName( + '[PROJECT]', + '[LOCATION]', + '[BACKUPVAULT]', + '[DATASOURCE]' + ); + + list_backups_sample($formattedParent); +} +// [END backupdr_v1_generated_BackupDR_ListBackups_sync] diff --git a/BackupDr/samples/V1/BackupDRClient/list_data_sources.php b/BackupDr/samples/V1/BackupDRClient/list_data_sources.php new file mode 100644 index 000000000000..833e650fed27 --- /dev/null +++ b/BackupDr/samples/V1/BackupDRClient/list_data_sources.php @@ -0,0 +1,81 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $backupDRClient->listDataSources($request); + + /** @var DataSource $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = BackupDRClient::backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); + + list_data_sources_sample($formattedParent); +} +// [END backupdr_v1_generated_BackupDR_ListDataSources_sync] diff --git a/BackupDr/samples/V1/BackupDRClient/list_management_servers.php b/BackupDr/samples/V1/BackupDRClient/list_management_servers.php index 5d3871049b33..c1a2219808e9 100644 --- a/BackupDr/samples/V1/BackupDRClient/list_management_servers.php +++ b/BackupDr/samples/V1/BackupDRClient/list_management_servers.php @@ -33,10 +33,11 @@ * Lists ManagementServers in a given project and location. * * @param string $formattedParent The project and location for which to retrieve management servers - * information, in the format `projects/{project_id}/locations/{location}`. In - * Cloud BackupDR, locations map to GCP regions, for example **us-central1**. - * To retrieve management servers for all locations, use "-" for the - * `{location}` value. Please see + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud BackupDR, locations map to Google Cloud regions, for example + * **us-central1**. To retrieve management servers for all locations, use "-" + * for the + * '{location}' value. Please see * {@see BackupDRClient::locationName()} for help formatting this field. */ function list_management_servers_sample(string $formattedParent): void diff --git a/BackupDr/samples/V1/BackupDRClient/restore_backup.php b/BackupDr/samples/V1/BackupDRClient/restore_backup.php new file mode 100644 index 000000000000..6a6199b2a611 --- /dev/null +++ b/BackupDr/samples/V1/BackupDRClient/restore_backup.php @@ -0,0 +1,90 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backupDRClient->restoreBackup($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var RestoreBackupResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $formattedName = BackupDRClient::backupName( + '[PROJECT]', + '[LOCATION]', + '[BACKUPVAULT]', + '[DATASOURCE]', + '[BACKUP]' + ); + + restore_backup_sample($formattedName); +} +// [END backupdr_v1_generated_BackupDR_RestoreBackup_sync] diff --git a/BackupDr/samples/V1/BackupDRClient/trigger_backup.php b/BackupDr/samples/V1/BackupDRClient/trigger_backup.php new file mode 100644 index 000000000000..e5d82046cf0e --- /dev/null +++ b/BackupDr/samples/V1/BackupDRClient/trigger_backup.php @@ -0,0 +1,91 @@ +setName($formattedName) + ->setRuleId($ruleId); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backupDRClient->triggerBackup($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var BackupPlanAssociation $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $formattedName = BackupDRClient::backupPlanAssociationName( + '[PROJECT]', + '[LOCATION]', + '[BACKUP_PLAN_ASSOCIATION]' + ); + $ruleId = '[RULE_ID]'; + + trigger_backup_sample($formattedName, $ruleId); +} +// [END backupdr_v1_generated_BackupDR_TriggerBackup_sync] diff --git a/BackupDr/samples/V1/BackupDRClient/update_backup.php b/BackupDr/samples/V1/BackupDRClient/update_backup.php new file mode 100644 index 000000000000..0986bd437465 --- /dev/null +++ b/BackupDr/samples/V1/BackupDRClient/update_backup.php @@ -0,0 +1,74 @@ +setUpdateMask($updateMask) + ->setBackup($backup); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backupDRClient->updateBackup($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Backup $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END backupdr_v1_generated_BackupDR_UpdateBackup_sync] diff --git a/BackupDr/samples/V1/BackupDRClient/update_backup_vault.php b/BackupDr/samples/V1/BackupDRClient/update_backup_vault.php new file mode 100644 index 000000000000..6cc6d590003a --- /dev/null +++ b/BackupDr/samples/V1/BackupDRClient/update_backup_vault.php @@ -0,0 +1,77 @@ +setBackupMinimumEnforcedRetentionDuration($backupVaultBackupMinimumEnforcedRetentionDuration); + $request = (new UpdateBackupVaultRequest()) + ->setUpdateMask($updateMask) + ->setBackupVault($backupVault); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backupDRClient->updateBackupVault($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var BackupVault $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END backupdr_v1_generated_BackupDR_UpdateBackupVault_sync] diff --git a/BackupDr/samples/V1/BackupDRClient/update_data_source.php b/BackupDr/samples/V1/BackupDRClient/update_data_source.php new file mode 100644 index 000000000000..e62566e4e330 --- /dev/null +++ b/BackupDr/samples/V1/BackupDRClient/update_data_source.php @@ -0,0 +1,74 @@ +setUpdateMask($updateMask) + ->setDataSource($dataSource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backupDRClient->updateDataSource($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var DataSource $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END backupdr_v1_generated_BackupDR_UpdateDataSource_sync] diff --git a/BackupDr/src/V1/AcceleratorConfig.php b/BackupDr/src/V1/AcceleratorConfig.php new file mode 100644 index 000000000000..5a0f3dce0b04 --- /dev/null +++ b/BackupDr/src/V1/AcceleratorConfig.php @@ -0,0 +1,130 @@ +google.cloud.backupdr.v1.AcceleratorConfig + */ +class AcceleratorConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Full or partial URL of the accelerator type resource to attach to + * this instance. + * + * Generated from protobuf field optional string accelerator_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $accelerator_type = null; + /** + * Optional. The number of the guest accelerator cards exposed to this + * instance. + * + * Generated from protobuf field optional int32 accelerator_count = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $accelerator_count = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $accelerator_type + * Optional. Full or partial URL of the accelerator type resource to attach to + * this instance. + * @type int $accelerator_count + * Optional. The number of the guest accelerator cards exposed to this + * instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Full or partial URL of the accelerator type resource to attach to + * this instance. + * + * Generated from protobuf field optional string accelerator_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAcceleratorType() + { + return isset($this->accelerator_type) ? $this->accelerator_type : ''; + } + + public function hasAcceleratorType() + { + return isset($this->accelerator_type); + } + + public function clearAcceleratorType() + { + unset($this->accelerator_type); + } + + /** + * Optional. Full or partial URL of the accelerator type resource to attach to + * this instance. + * + * Generated from protobuf field optional string accelerator_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAcceleratorType($var) + { + GPBUtil::checkString($var, True); + $this->accelerator_type = $var; + + return $this; + } + + /** + * Optional. The number of the guest accelerator cards exposed to this + * instance. + * + * Generated from protobuf field optional int32 accelerator_count = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getAcceleratorCount() + { + return isset($this->accelerator_count) ? $this->accelerator_count : 0; + } + + public function hasAcceleratorCount() + { + return isset($this->accelerator_count); + } + + public function clearAcceleratorCount() + { + unset($this->accelerator_count); + } + + /** + * Optional. The number of the guest accelerator cards exposed to this + * instance. + * + * Generated from protobuf field optional int32 accelerator_count = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setAcceleratorCount($var) + { + GPBUtil::checkInt32($var); + $this->accelerator_count = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/AccessConfig.php b/BackupDr/src/V1/AccessConfig.php new file mode 100644 index 000000000000..325e5e49dd31 --- /dev/null +++ b/BackupDr/src/V1/AccessConfig.php @@ -0,0 +1,406 @@ +google.cloud.backupdr.v1.AccessConfig + */ +class AccessConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. In accessConfigs (IPv4), the + * default and only option is ONE_TO_ONE_NAT. In + * ipv6AccessConfigs, the default and only option is + * DIRECT_IPV6. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AccessConfig.AccessType type = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $type = null; + /** + * Optional. The name of this access configuration. + * + * Generated from protobuf field optional string name = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $name = null; + /** + * Optional. The external IP address of this access configuration. + * + * Generated from protobuf field optional string external_ip = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $external_ip = null; + /** + * Optional. The external IPv6 address of this access configuration. + * + * Generated from protobuf field optional string external_ipv6 = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $external_ipv6 = null; + /** + * Optional. The prefix length of the external IPv6 range. + * + * Generated from protobuf field optional int32 external_ipv6_prefix_length = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $external_ipv6_prefix_length = null; + /** + * Optional. Specifies whether a public DNS 'PTR' record should be created to + * map the external IP address of the instance to a DNS domain name. + * + * Generated from protobuf field optional bool set_public_ptr = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $set_public_ptr = null; + /** + * Optional. The DNS domain name for the public PTR record. + * + * Generated from protobuf field optional string public_ptr_domain_name = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $public_ptr_domain_name = null; + /** + * Optional. This signifies the networking tier used for configuring this + * access + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AccessConfig.NetworkTier network_tier = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $network_tier = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $type + * Optional. In accessConfigs (IPv4), the + * default and only option is ONE_TO_ONE_NAT. In + * ipv6AccessConfigs, the default and only option is + * DIRECT_IPV6. + * @type string $name + * Optional. The name of this access configuration. + * @type string $external_ip + * Optional. The external IP address of this access configuration. + * @type string $external_ipv6 + * Optional. The external IPv6 address of this access configuration. + * @type int $external_ipv6_prefix_length + * Optional. The prefix length of the external IPv6 range. + * @type bool $set_public_ptr + * Optional. Specifies whether a public DNS 'PTR' record should be created to + * map the external IP address of the instance to a DNS domain name. + * @type string $public_ptr_domain_name + * Optional. The DNS domain name for the public PTR record. + * @type int $network_tier + * Optional. This signifies the networking tier used for configuring this + * access + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Optional. In accessConfigs (IPv4), the + * default and only option is ONE_TO_ONE_NAT. In + * ipv6AccessConfigs, the default and only option is + * DIRECT_IPV6. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AccessConfig.AccessType type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getType() + { + return isset($this->type) ? $this->type : 0; + } + + public function hasType() + { + return isset($this->type); + } + + public function clearType() + { + unset($this->type); + } + + /** + * Optional. In accessConfigs (IPv4), the + * default and only option is ONE_TO_ONE_NAT. In + * ipv6AccessConfigs, the default and only option is + * DIRECT_IPV6. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AccessConfig.AccessType type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\AccessConfig\AccessType::class); + $this->type = $var; + + return $this; + } + + /** + * Optional. The name of this access configuration. + * + * Generated from protobuf field optional string name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getName() + { + return isset($this->name) ? $this->name : ''; + } + + public function hasName() + { + return isset($this->name); + } + + public function clearName() + { + unset($this->name); + } + + /** + * Optional. The name of this access configuration. + * + * Generated from protobuf field optional string name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The external IP address of this access configuration. + * + * Generated from protobuf field optional string external_ip = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getExternalIp() + { + return isset($this->external_ip) ? $this->external_ip : ''; + } + + public function hasExternalIp() + { + return isset($this->external_ip); + } + + public function clearExternalIp() + { + unset($this->external_ip); + } + + /** + * Optional. The external IP address of this access configuration. + * + * Generated from protobuf field optional string external_ip = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setExternalIp($var) + { + GPBUtil::checkString($var, True); + $this->external_ip = $var; + + return $this; + } + + /** + * Optional. The external IPv6 address of this access configuration. + * + * Generated from protobuf field optional string external_ipv6 = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getExternalIpv6() + { + return isset($this->external_ipv6) ? $this->external_ipv6 : ''; + } + + public function hasExternalIpv6() + { + return isset($this->external_ipv6); + } + + public function clearExternalIpv6() + { + unset($this->external_ipv6); + } + + /** + * Optional. The external IPv6 address of this access configuration. + * + * Generated from protobuf field optional string external_ipv6 = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setExternalIpv6($var) + { + GPBUtil::checkString($var, True); + $this->external_ipv6 = $var; + + return $this; + } + + /** + * Optional. The prefix length of the external IPv6 range. + * + * Generated from protobuf field optional int32 external_ipv6_prefix_length = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getExternalIpv6PrefixLength() + { + return isset($this->external_ipv6_prefix_length) ? $this->external_ipv6_prefix_length : 0; + } + + public function hasExternalIpv6PrefixLength() + { + return isset($this->external_ipv6_prefix_length); + } + + public function clearExternalIpv6PrefixLength() + { + unset($this->external_ipv6_prefix_length); + } + + /** + * Optional. The prefix length of the external IPv6 range. + * + * Generated from protobuf field optional int32 external_ipv6_prefix_length = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setExternalIpv6PrefixLength($var) + { + GPBUtil::checkInt32($var); + $this->external_ipv6_prefix_length = $var; + + return $this; + } + + /** + * Optional. Specifies whether a public DNS 'PTR' record should be created to + * map the external IP address of the instance to a DNS domain name. + * + * Generated from protobuf field optional bool set_public_ptr = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getSetPublicPtr() + { + return isset($this->set_public_ptr) ? $this->set_public_ptr : false; + } + + public function hasSetPublicPtr() + { + return isset($this->set_public_ptr); + } + + public function clearSetPublicPtr() + { + unset($this->set_public_ptr); + } + + /** + * Optional. Specifies whether a public DNS 'PTR' record should be created to + * map the external IP address of the instance to a DNS domain name. + * + * Generated from protobuf field optional bool set_public_ptr = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setSetPublicPtr($var) + { + GPBUtil::checkBool($var); + $this->set_public_ptr = $var; + + return $this; + } + + /** + * Optional. The DNS domain name for the public PTR record. + * + * Generated from protobuf field optional string public_ptr_domain_name = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPublicPtrDomainName() + { + return isset($this->public_ptr_domain_name) ? $this->public_ptr_domain_name : ''; + } + + public function hasPublicPtrDomainName() + { + return isset($this->public_ptr_domain_name); + } + + public function clearPublicPtrDomainName() + { + unset($this->public_ptr_domain_name); + } + + /** + * Optional. The DNS domain name for the public PTR record. + * + * Generated from protobuf field optional string public_ptr_domain_name = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPublicPtrDomainName($var) + { + GPBUtil::checkString($var, True); + $this->public_ptr_domain_name = $var; + + return $this; + } + + /** + * Optional. This signifies the networking tier used for configuring this + * access + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AccessConfig.NetworkTier network_tier = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getNetworkTier() + { + return isset($this->network_tier) ? $this->network_tier : 0; + } + + public function hasNetworkTier() + { + return isset($this->network_tier); + } + + public function clearNetworkTier() + { + unset($this->network_tier); + } + + /** + * Optional. This signifies the networking tier used for configuring this + * access + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AccessConfig.NetworkTier network_tier = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setNetworkTier($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\AccessConfig\NetworkTier::class); + $this->network_tier = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/AccessConfig/AccessType.php b/BackupDr/src/V1/AccessConfig/AccessType.php new file mode 100644 index 000000000000..b8aba7880571 --- /dev/null +++ b/BackupDr/src/V1/AccessConfig/AccessType.php @@ -0,0 +1,62 @@ +google.cloud.backupdr.v1.AccessConfig.AccessType + */ +class AccessType +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum ACCESS_TYPE_UNSPECIFIED = 0; + */ + const ACCESS_TYPE_UNSPECIFIED = 0; + /** + * ONE_TO_ONE_NAT + * + * Generated from protobuf enum ONE_TO_ONE_NAT = 1; + */ + const ONE_TO_ONE_NAT = 1; + /** + * Direct IPv6 access. + * + * Generated from protobuf enum DIRECT_IPV6 = 2; + */ + const DIRECT_IPV6 = 2; + + private static $valueToName = [ + self::ACCESS_TYPE_UNSPECIFIED => 'ACCESS_TYPE_UNSPECIFIED', + self::ONE_TO_ONE_NAT => 'ONE_TO_ONE_NAT', + self::DIRECT_IPV6 => 'DIRECT_IPV6', + ]; + + 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/BackupDr/src/V1/AccessConfig/NetworkTier.php b/BackupDr/src/V1/AccessConfig/NetworkTier.php new file mode 100644 index 000000000000..f99138563a34 --- /dev/null +++ b/BackupDr/src/V1/AccessConfig/NetworkTier.php @@ -0,0 +1,64 @@ +google.cloud.backupdr.v1.AccessConfig.NetworkTier + */ +class NetworkTier +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum NETWORK_TIER_UNSPECIFIED = 0; + */ + const NETWORK_TIER_UNSPECIFIED = 0; + /** + * High quality, Google-grade network tier, support for all networking + * products. + * + * Generated from protobuf enum PREMIUM = 1; + */ + const PREMIUM = 1; + /** + * Public internet quality, only limited support for other networking + * products. + * + * Generated from protobuf enum STANDARD = 2; + */ + const STANDARD = 2; + + private static $valueToName = [ + self::NETWORK_TIER_UNSPECIFIED => 'NETWORK_TIER_UNSPECIFIED', + self::PREMIUM => 'PREMIUM', + self::STANDARD => 'STANDARD', + ]; + + 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/BackupDr/src/V1/AdvancedMachineFeatures.php b/BackupDr/src/V1/AdvancedMachineFeatures.php new file mode 100644 index 000000000000..29901b19bd41 --- /dev/null +++ b/BackupDr/src/V1/AdvancedMachineFeatures.php @@ -0,0 +1,241 @@ +google.cloud.backupdr.v1.AdvancedMachineFeatures + */ +class AdvancedMachineFeatures extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Whether to enable nested virtualization or not (default is + * false). + * + * Generated from protobuf field optional bool enable_nested_virtualization = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_nested_virtualization = null; + /** + * Optional. The number of threads per physical core. To disable simultaneous + * multithreading (SMT) set this to 1. If unset, the maximum number + * of threads supported per core by the underlying processor is + * assumed. + * + * Generated from protobuf field optional int32 threads_per_core = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $threads_per_core = null; + /** + * Optional. The number of physical cores to expose to an instance. Multiply + * by the number of threads per core to compute the total number of virtual + * CPUs to expose to the instance. If unset, the number of cores is + * inferred from the instance's nominal CPU count and the underlying + * platform's SMT width. + * + * Generated from protobuf field optional int32 visible_core_count = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $visible_core_count = null; + /** + * Optional. Whether to enable UEFI networking for instance creation. + * + * Generated from protobuf field optional bool enable_uefi_networking = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_uefi_networking = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enable_nested_virtualization + * Optional. Whether to enable nested virtualization or not (default is + * false). + * @type int $threads_per_core + * Optional. The number of threads per physical core. To disable simultaneous + * multithreading (SMT) set this to 1. If unset, the maximum number + * of threads supported per core by the underlying processor is + * assumed. + * @type int $visible_core_count + * Optional. The number of physical cores to expose to an instance. Multiply + * by the number of threads per core to compute the total number of virtual + * CPUs to expose to the instance. If unset, the number of cores is + * inferred from the instance's nominal CPU count and the underlying + * platform's SMT width. + * @type bool $enable_uefi_networking + * Optional. Whether to enable UEFI networking for instance creation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Whether to enable nested virtualization or not (default is + * false). + * + * Generated from protobuf field optional bool enable_nested_virtualization = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableNestedVirtualization() + { + return isset($this->enable_nested_virtualization) ? $this->enable_nested_virtualization : false; + } + + public function hasEnableNestedVirtualization() + { + return isset($this->enable_nested_virtualization); + } + + public function clearEnableNestedVirtualization() + { + unset($this->enable_nested_virtualization); + } + + /** + * Optional. Whether to enable nested virtualization or not (default is + * false). + * + * Generated from protobuf field optional bool enable_nested_virtualization = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableNestedVirtualization($var) + { + GPBUtil::checkBool($var); + $this->enable_nested_virtualization = $var; + + return $this; + } + + /** + * Optional. The number of threads per physical core. To disable simultaneous + * multithreading (SMT) set this to 1. If unset, the maximum number + * of threads supported per core by the underlying processor is + * assumed. + * + * Generated from protobuf field optional int32 threads_per_core = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getThreadsPerCore() + { + return isset($this->threads_per_core) ? $this->threads_per_core : 0; + } + + public function hasThreadsPerCore() + { + return isset($this->threads_per_core); + } + + public function clearThreadsPerCore() + { + unset($this->threads_per_core); + } + + /** + * Optional. The number of threads per physical core. To disable simultaneous + * multithreading (SMT) set this to 1. If unset, the maximum number + * of threads supported per core by the underlying processor is + * assumed. + * + * Generated from protobuf field optional int32 threads_per_core = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setThreadsPerCore($var) + { + GPBUtil::checkInt32($var); + $this->threads_per_core = $var; + + return $this; + } + + /** + * Optional. The number of physical cores to expose to an instance. Multiply + * by the number of threads per core to compute the total number of virtual + * CPUs to expose to the instance. If unset, the number of cores is + * inferred from the instance's nominal CPU count and the underlying + * platform's SMT width. + * + * Generated from protobuf field optional int32 visible_core_count = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getVisibleCoreCount() + { + return isset($this->visible_core_count) ? $this->visible_core_count : 0; + } + + public function hasVisibleCoreCount() + { + return isset($this->visible_core_count); + } + + public function clearVisibleCoreCount() + { + unset($this->visible_core_count); + } + + /** + * Optional. The number of physical cores to expose to an instance. Multiply + * by the number of threads per core to compute the total number of virtual + * CPUs to expose to the instance. If unset, the number of cores is + * inferred from the instance's nominal CPU count and the underlying + * platform's SMT width. + * + * Generated from protobuf field optional int32 visible_core_count = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setVisibleCoreCount($var) + { + GPBUtil::checkInt32($var); + $this->visible_core_count = $var; + + return $this; + } + + /** + * Optional. Whether to enable UEFI networking for instance creation. + * + * Generated from protobuf field optional bool enable_uefi_networking = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableUefiNetworking() + { + return isset($this->enable_uefi_networking) ? $this->enable_uefi_networking : false; + } + + public function hasEnableUefiNetworking() + { + return isset($this->enable_uefi_networking); + } + + public function clearEnableUefiNetworking() + { + unset($this->enable_uefi_networking); + } + + /** + * Optional. Whether to enable UEFI networking for instance creation. + * + * Generated from protobuf field optional bool enable_uefi_networking = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableUefiNetworking($var) + { + GPBUtil::checkBool($var); + $this->enable_uefi_networking = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/AliasIpRange.php b/BackupDr/src/V1/AliasIpRange.php new file mode 100644 index 000000000000..c7fa6c80788b --- /dev/null +++ b/BackupDr/src/V1/AliasIpRange.php @@ -0,0 +1,129 @@ +google.cloud.backupdr.v1.AliasIpRange + */ +class AliasIpRange extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The IP alias ranges to allocate for this interface. + * + * Generated from protobuf field optional string ip_cidr_range = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ip_cidr_range = null; + /** + * Optional. The name of a subnetwork secondary IP range from which to + * allocate an IP alias range. If not specified, the primary range of the + * subnetwork is used. + * + * Generated from protobuf field optional string subnetwork_range_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $subnetwork_range_name = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $ip_cidr_range + * Optional. The IP alias ranges to allocate for this interface. + * @type string $subnetwork_range_name + * Optional. The name of a subnetwork secondary IP range from which to + * allocate an IP alias range. If not specified, the primary range of the + * subnetwork is used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The IP alias ranges to allocate for this interface. + * + * Generated from protobuf field optional string ip_cidr_range = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getIpCidrRange() + { + return isset($this->ip_cidr_range) ? $this->ip_cidr_range : ''; + } + + public function hasIpCidrRange() + { + return isset($this->ip_cidr_range); + } + + public function clearIpCidrRange() + { + unset($this->ip_cidr_range); + } + + /** + * Optional. The IP alias ranges to allocate for this interface. + * + * Generated from protobuf field optional string ip_cidr_range = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setIpCidrRange($var) + { + GPBUtil::checkString($var, True); + $this->ip_cidr_range = $var; + + return $this; + } + + /** + * Optional. The name of a subnetwork secondary IP range from which to + * allocate an IP alias range. If not specified, the primary range of the + * subnetwork is used. + * + * Generated from protobuf field optional string subnetwork_range_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSubnetworkRangeName() + { + return isset($this->subnetwork_range_name) ? $this->subnetwork_range_name : ''; + } + + public function hasSubnetworkRangeName() + { + return isset($this->subnetwork_range_name); + } + + public function clearSubnetworkRangeName() + { + unset($this->subnetwork_range_name); + } + + /** + * Optional. The name of a subnetwork secondary IP range from which to + * allocate an IP alias range. If not specified, the primary range of the + * subnetwork is used. + * + * Generated from protobuf field optional string subnetwork_range_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSubnetworkRangeName($var) + { + GPBUtil::checkString($var, True); + $this->subnetwork_range_name = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/AllocationAffinity.php b/BackupDr/src/V1/AllocationAffinity.php new file mode 100644 index 000000000000..6eb73d7b0b92 --- /dev/null +++ b/BackupDr/src/V1/AllocationAffinity.php @@ -0,0 +1,159 @@ +google.cloud.backupdr.v1.AllocationAffinity + */ +class AllocationAffinity extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Specifies the type of reservation from which this instance can + * consume + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AllocationAffinity.Type consume_allocation_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $consume_allocation_type = null; + /** + * Optional. Corresponds to the label key of a reservation resource. + * + * Generated from protobuf field optional string key = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $key = null; + /** + * Optional. Corresponds to the label values of a reservation resource. + * + * Generated from protobuf field repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $values; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $consume_allocation_type + * Optional. Specifies the type of reservation from which this instance can + * consume + * @type string $key + * Optional. Corresponds to the label key of a reservation resource. + * @type array|\Google\Protobuf\Internal\RepeatedField $values + * Optional. Corresponds to the label values of a reservation resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Specifies the type of reservation from which this instance can + * consume + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AllocationAffinity.Type consume_allocation_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getConsumeAllocationType() + { + return isset($this->consume_allocation_type) ? $this->consume_allocation_type : 0; + } + + public function hasConsumeAllocationType() + { + return isset($this->consume_allocation_type); + } + + public function clearConsumeAllocationType() + { + unset($this->consume_allocation_type); + } + + /** + * Optional. Specifies the type of reservation from which this instance can + * consume + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AllocationAffinity.Type consume_allocation_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setConsumeAllocationType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\AllocationAffinity\Type::class); + $this->consume_allocation_type = $var; + + return $this; + } + + /** + * Optional. Corresponds to the label key of a reservation resource. + * + * Generated from protobuf field optional string key = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getKey() + { + return isset($this->key) ? $this->key : ''; + } + + public function hasKey() + { + return isset($this->key); + } + + public function clearKey() + { + unset($this->key); + } + + /** + * Optional. Corresponds to the label key of a reservation resource. + * + * Generated from protobuf field optional string key = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->key = $var; + + return $this; + } + + /** + * Optional. Corresponds to the label values of a reservation resource. + * + * Generated from protobuf field repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getValues() + { + return $this->values; + } + + /** + * Optional. Corresponds to the label values of a reservation resource. + * + * Generated from protobuf field repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->values = $arr; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/AllocationAffinity/Type.php b/BackupDr/src/V1/AllocationAffinity/Type.php new file mode 100644 index 000000000000..949d11e75468 --- /dev/null +++ b/BackupDr/src/V1/AllocationAffinity/Type.php @@ -0,0 +1,70 @@ +google.cloud.backupdr.v1.AllocationAffinity.Type + */ +class Type +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * Do not consume from any allocated capacity. + * + * Generated from protobuf enum NO_RESERVATION = 1; + */ + const NO_RESERVATION = 1; + /** + * Consume any allocation available. + * + * Generated from protobuf enum ANY_RESERVATION = 2; + */ + const ANY_RESERVATION = 2; + /** + * Must consume from a specific reservation. Must specify key value fields + * for specifying the reservations. + * + * Generated from protobuf enum SPECIFIC_RESERVATION = 3; + */ + const SPECIFIC_RESERVATION = 3; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::NO_RESERVATION => 'NO_RESERVATION', + self::ANY_RESERVATION => 'ANY_RESERVATION', + self::SPECIFIC_RESERVATION => 'SPECIFIC_RESERVATION', + ]; + + 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/BackupDr/src/V1/AttachedDisk.php b/BackupDr/src/V1/AttachedDisk.php new file mode 100644 index 000000000000..6d06c12af671 --- /dev/null +++ b/BackupDr/src/V1/AttachedDisk.php @@ -0,0 +1,804 @@ +google.cloud.backupdr.v1.AttachedDisk + */ +class AttachedDisk extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Specifies the parameters to initialize this disk. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AttachedDisk.InitializeParams initialize_params = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $initialize_params = null; + /** + * Optional. This is used as an identifier for the disks. This is the unique + * name has to provided to modify disk parameters like disk_name and + * replica_zones (in case of RePDs) + * + * Generated from protobuf field optional string device_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $device_name = null; + /** + * Optional. Type of the resource. + * + * Generated from protobuf field optional string kind = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $kind = null; + /** + * Specifies the type of the disk. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AttachedDisk.DiskType disk_type_deprecated = 6 [deprecated = true]; + * @deprecated + */ + protected $disk_type_deprecated = null; + /** + * Optional. The mode in which to attach this disk. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AttachedDisk.DiskMode mode = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $mode = null; + /** + * Optional. Specifies a valid partial or full URL to an existing Persistent + * Disk resource. + * + * Generated from protobuf field optional string source = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $source = null; + /** + * Optional. A zero-based index to this disk, where 0 is reserved for the + * boot disk. + * + * Generated from protobuf field optional int64 index = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $index = null; + /** + * Optional. Indicates that this is a boot disk. The virtual machine will use + * the first partition of the disk for its root filesystem. + * + * Generated from protobuf field optional bool boot = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $boot = null; + /** + * Optional. Specifies whether the disk will be auto-deleted when the instance + * is deleted (but not when the disk is detached from the instance). + * + * Generated from protobuf field optional bool auto_delete = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $auto_delete = null; + /** + * Optional. Any valid publicly visible licenses. + * + * Generated from protobuf field repeated string license = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $license; + /** + * Optional. Specifies the disk interface to use for attaching this disk. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AttachedDisk.DiskInterface disk_interface = 13 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $disk_interface = null; + /** + * Optional. A list of features to enable on the guest operating system. + * Applicable only for bootable images. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.GuestOsFeature guest_os_feature = 14 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $guest_os_feature; + /** + * Optional. Encrypts or decrypts a disk using a customer-supplied + * encryption key. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.CustomerEncryptionKey disk_encryption_key = 15 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $disk_encryption_key = null; + /** + * Optional. The size of the disk in GB. + * + * Generated from protobuf field optional int64 disk_size_gb = 16 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $disk_size_gb = null; + /** + * Optional. Output only. The state of the disk. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AttachedDisk.DiskSavedState saved_state = 17 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $saved_state = null; + /** + * Optional. Output only. The URI of the disk type resource. For example: + * projects/project/zones/zone/diskTypes/pd-standard or pd-ssd + * + * Generated from protobuf field optional string disk_type = 18 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $disk_type = null; + /** + * Optional. Specifies the type of the disk. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AttachedDisk.DiskType type = 19 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BackupDR\V1\AttachedDisk\InitializeParams $initialize_params + * Optional. Specifies the parameters to initialize this disk. + * @type string $device_name + * Optional. This is used as an identifier for the disks. This is the unique + * name has to provided to modify disk parameters like disk_name and + * replica_zones (in case of RePDs) + * @type string $kind + * Optional. Type of the resource. + * @type int $disk_type_deprecated + * Specifies the type of the disk. + * @type int $mode + * Optional. The mode in which to attach this disk. + * @type string $source + * Optional. Specifies a valid partial or full URL to an existing Persistent + * Disk resource. + * @type int|string $index + * Optional. A zero-based index to this disk, where 0 is reserved for the + * boot disk. + * @type bool $boot + * Optional. Indicates that this is a boot disk. The virtual machine will use + * the first partition of the disk for its root filesystem. + * @type bool $auto_delete + * Optional. Specifies whether the disk will be auto-deleted when the instance + * is deleted (but not when the disk is detached from the instance). + * @type array|\Google\Protobuf\Internal\RepeatedField $license + * Optional. Any valid publicly visible licenses. + * @type int $disk_interface + * Optional. Specifies the disk interface to use for attaching this disk. + * @type array<\Google\Cloud\BackupDR\V1\GuestOsFeature>|\Google\Protobuf\Internal\RepeatedField $guest_os_feature + * Optional. A list of features to enable on the guest operating system. + * Applicable only for bootable images. + * @type \Google\Cloud\BackupDR\V1\CustomerEncryptionKey $disk_encryption_key + * Optional. Encrypts or decrypts a disk using a customer-supplied + * encryption key. + * @type int|string $disk_size_gb + * Optional. The size of the disk in GB. + * @type int $saved_state + * Optional. Output only. The state of the disk. + * @type string $disk_type + * Optional. Output only. The URI of the disk type resource. For example: + * projects/project/zones/zone/diskTypes/pd-standard or pd-ssd + * @type int $type + * Optional. Specifies the type of the disk. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Specifies the parameters to initialize this disk. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AttachedDisk.InitializeParams initialize_params = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BackupDR\V1\AttachedDisk\InitializeParams|null + */ + public function getInitializeParams() + { + return $this->initialize_params; + } + + public function hasInitializeParams() + { + return isset($this->initialize_params); + } + + public function clearInitializeParams() + { + unset($this->initialize_params); + } + + /** + * Optional. Specifies the parameters to initialize this disk. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AttachedDisk.InitializeParams initialize_params = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BackupDR\V1\AttachedDisk\InitializeParams $var + * @return $this + */ + public function setInitializeParams($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\AttachedDisk\InitializeParams::class); + $this->initialize_params = $var; + + return $this; + } + + /** + * Optional. This is used as an identifier for the disks. This is the unique + * name has to provided to modify disk parameters like disk_name and + * replica_zones (in case of RePDs) + * + * Generated from protobuf field optional string device_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDeviceName() + { + return isset($this->device_name) ? $this->device_name : ''; + } + + public function hasDeviceName() + { + return isset($this->device_name); + } + + public function clearDeviceName() + { + unset($this->device_name); + } + + /** + * Optional. This is used as an identifier for the disks. This is the unique + * name has to provided to modify disk parameters like disk_name and + * replica_zones (in case of RePDs) + * + * Generated from protobuf field optional string device_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDeviceName($var) + { + GPBUtil::checkString($var, True); + $this->device_name = $var; + + return $this; + } + + /** + * Optional. Type of the resource. + * + * Generated from protobuf field optional string kind = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getKind() + { + return isset($this->kind) ? $this->kind : ''; + } + + public function hasKind() + { + return isset($this->kind); + } + + public function clearKind() + { + unset($this->kind); + } + + /** + * Optional. Type of the resource. + * + * Generated from protobuf field optional string kind = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setKind($var) + { + GPBUtil::checkString($var, True); + $this->kind = $var; + + return $this; + } + + /** + * Specifies the type of the disk. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AttachedDisk.DiskType disk_type_deprecated = 6 [deprecated = true]; + * @return int + * @deprecated + */ + public function getDiskTypeDeprecated() + { + @trigger_error('disk_type_deprecated is deprecated.', E_USER_DEPRECATED); + return isset($this->disk_type_deprecated) ? $this->disk_type_deprecated : 0; + } + + public function hasDiskTypeDeprecated() + { + @trigger_error('disk_type_deprecated is deprecated.', E_USER_DEPRECATED); + return isset($this->disk_type_deprecated); + } + + public function clearDiskTypeDeprecated() + { + @trigger_error('disk_type_deprecated is deprecated.', E_USER_DEPRECATED); + unset($this->disk_type_deprecated); + } + + /** + * Specifies the type of the disk. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AttachedDisk.DiskType disk_type_deprecated = 6 [deprecated = true]; + * @param int $var + * @return $this + * @deprecated + */ + public function setDiskTypeDeprecated($var) + { + @trigger_error('disk_type_deprecated is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\AttachedDisk\DiskType::class); + $this->disk_type_deprecated = $var; + + return $this; + } + + /** + * Optional. The mode in which to attach this disk. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AttachedDisk.DiskMode mode = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMode() + { + return isset($this->mode) ? $this->mode : 0; + } + + public function hasMode() + { + return isset($this->mode); + } + + public function clearMode() + { + unset($this->mode); + } + + /** + * Optional. The mode in which to attach this disk. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AttachedDisk.DiskMode mode = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\AttachedDisk\DiskMode::class); + $this->mode = $var; + + return $this; + } + + /** + * Optional. Specifies a valid partial or full URL to an existing Persistent + * Disk resource. + * + * Generated from protobuf field optional string source = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSource() + { + return isset($this->source) ? $this->source : ''; + } + + public function hasSource() + { + return isset($this->source); + } + + public function clearSource() + { + unset($this->source); + } + + /** + * Optional. Specifies a valid partial or full URL to an existing Persistent + * Disk resource. + * + * Generated from protobuf field optional string source = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSource($var) + { + GPBUtil::checkString($var, True); + $this->source = $var; + + return $this; + } + + /** + * Optional. A zero-based index to this disk, where 0 is reserved for the + * boot disk. + * + * Generated from protobuf field optional int64 index = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getIndex() + { + return isset($this->index) ? $this->index : 0; + } + + public function hasIndex() + { + return isset($this->index); + } + + public function clearIndex() + { + unset($this->index); + } + + /** + * Optional. A zero-based index to this disk, where 0 is reserved for the + * boot disk. + * + * Generated from protobuf field optional int64 index = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setIndex($var) + { + GPBUtil::checkInt64($var); + $this->index = $var; + + return $this; + } + + /** + * Optional. Indicates that this is a boot disk. The virtual machine will use + * the first partition of the disk for its root filesystem. + * + * Generated from protobuf field optional bool boot = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getBoot() + { + return isset($this->boot) ? $this->boot : false; + } + + public function hasBoot() + { + return isset($this->boot); + } + + public function clearBoot() + { + unset($this->boot); + } + + /** + * Optional. Indicates that this is a boot disk. The virtual machine will use + * the first partition of the disk for its root filesystem. + * + * Generated from protobuf field optional bool boot = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setBoot($var) + { + GPBUtil::checkBool($var); + $this->boot = $var; + + return $this; + } + + /** + * Optional. Specifies whether the disk will be auto-deleted when the instance + * is deleted (but not when the disk is detached from the instance). + * + * Generated from protobuf field optional bool auto_delete = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAutoDelete() + { + return isset($this->auto_delete) ? $this->auto_delete : false; + } + + public function hasAutoDelete() + { + return isset($this->auto_delete); + } + + public function clearAutoDelete() + { + unset($this->auto_delete); + } + + /** + * Optional. Specifies whether the disk will be auto-deleted when the instance + * is deleted (but not when the disk is detached from the instance). + * + * Generated from protobuf field optional bool auto_delete = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAutoDelete($var) + { + GPBUtil::checkBool($var); + $this->auto_delete = $var; + + return $this; + } + + /** + * Optional. Any valid publicly visible licenses. + * + * Generated from protobuf field repeated string license = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLicense() + { + return $this->license; + } + + /** + * Optional. Any valid publicly visible licenses. + * + * Generated from protobuf field repeated string license = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLicense($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->license = $arr; + + return $this; + } + + /** + * Optional. Specifies the disk interface to use for attaching this disk. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AttachedDisk.DiskInterface disk_interface = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getDiskInterface() + { + return isset($this->disk_interface) ? $this->disk_interface : 0; + } + + public function hasDiskInterface() + { + return isset($this->disk_interface); + } + + public function clearDiskInterface() + { + unset($this->disk_interface); + } + + /** + * Optional. Specifies the disk interface to use for attaching this disk. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AttachedDisk.DiskInterface disk_interface = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setDiskInterface($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\AttachedDisk\DiskInterface::class); + $this->disk_interface = $var; + + return $this; + } + + /** + * Optional. A list of features to enable on the guest operating system. + * Applicable only for bootable images. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.GuestOsFeature guest_os_feature = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGuestOsFeature() + { + return $this->guest_os_feature; + } + + /** + * Optional. A list of features to enable on the guest operating system. + * Applicable only for bootable images. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.GuestOsFeature guest_os_feature = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\BackupDR\V1\GuestOsFeature>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGuestOsFeature($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\GuestOsFeature::class); + $this->guest_os_feature = $arr; + + return $this; + } + + /** + * Optional. Encrypts or decrypts a disk using a customer-supplied + * encryption key. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.CustomerEncryptionKey disk_encryption_key = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BackupDR\V1\CustomerEncryptionKey|null + */ + public function getDiskEncryptionKey() + { + return $this->disk_encryption_key; + } + + public function hasDiskEncryptionKey() + { + return isset($this->disk_encryption_key); + } + + public function clearDiskEncryptionKey() + { + unset($this->disk_encryption_key); + } + + /** + * Optional. Encrypts or decrypts a disk using a customer-supplied + * encryption key. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.CustomerEncryptionKey disk_encryption_key = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BackupDR\V1\CustomerEncryptionKey $var + * @return $this + */ + public function setDiskEncryptionKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\CustomerEncryptionKey::class); + $this->disk_encryption_key = $var; + + return $this; + } + + /** + * Optional. The size of the disk in GB. + * + * Generated from protobuf field optional int64 disk_size_gb = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getDiskSizeGb() + { + return isset($this->disk_size_gb) ? $this->disk_size_gb : 0; + } + + public function hasDiskSizeGb() + { + return isset($this->disk_size_gb); + } + + public function clearDiskSizeGb() + { + unset($this->disk_size_gb); + } + + /** + * Optional. The size of the disk in GB. + * + * Generated from protobuf field optional int64 disk_size_gb = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setDiskSizeGb($var) + { + GPBUtil::checkInt64($var); + $this->disk_size_gb = $var; + + return $this; + } + + /** + * Optional. Output only. The state of the disk. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AttachedDisk.DiskSavedState saved_state = 17 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getSavedState() + { + return isset($this->saved_state) ? $this->saved_state : 0; + } + + public function hasSavedState() + { + return isset($this->saved_state); + } + + public function clearSavedState() + { + unset($this->saved_state); + } + + /** + * Optional. Output only. The state of the disk. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AttachedDisk.DiskSavedState saved_state = 17 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setSavedState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\AttachedDisk\DiskSavedState::class); + $this->saved_state = $var; + + return $this; + } + + /** + * Optional. Output only. The URI of the disk type resource. For example: + * projects/project/zones/zone/diskTypes/pd-standard or pd-ssd + * + * Generated from protobuf field optional string disk_type = 18 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDiskType() + { + return isset($this->disk_type) ? $this->disk_type : ''; + } + + public function hasDiskType() + { + return isset($this->disk_type); + } + + public function clearDiskType() + { + unset($this->disk_type); + } + + /** + * Optional. Output only. The URI of the disk type resource. For example: + * projects/project/zones/zone/diskTypes/pd-standard or pd-ssd + * + * Generated from protobuf field optional string disk_type = 18 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDiskType($var) + { + GPBUtil::checkString($var, True); + $this->disk_type = $var; + + return $this; + } + + /** + * Optional. Specifies the type of the disk. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AttachedDisk.DiskType type = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getType() + { + return isset($this->type) ? $this->type : 0; + } + + public function hasType() + { + return isset($this->type); + } + + public function clearType() + { + unset($this->type); + } + + /** + * Optional. Specifies the type of the disk. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AttachedDisk.DiskType type = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\AttachedDisk\DiskType::class); + $this->type = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/AttachedDisk/DiskInterface.php b/BackupDr/src/V1/AttachedDisk/DiskInterface.php new file mode 100644 index 000000000000..69ac3c141578 --- /dev/null +++ b/BackupDr/src/V1/AttachedDisk/DiskInterface.php @@ -0,0 +1,76 @@ +google.cloud.backupdr.v1.AttachedDisk.DiskInterface + */ +class DiskInterface +{ + /** + * Default value, which is unused. + * + * Generated from protobuf enum DISK_INTERFACE_UNSPECIFIED = 0; + */ + const DISK_INTERFACE_UNSPECIFIED = 0; + /** + * SCSI Disk Interface. + * + * Generated from protobuf enum SCSI = 1; + */ + const SCSI = 1; + /** + * NVME Disk Interface. + * + * Generated from protobuf enum NVME = 2; + */ + const NVME = 2; + /** + * NVDIMM Disk Interface. + * + * Generated from protobuf enum NVDIMM = 3; + */ + const NVDIMM = 3; + /** + * ISCSI Disk Interface. + * + * Generated from protobuf enum ISCSI = 4; + */ + const ISCSI = 4; + + private static $valueToName = [ + self::DISK_INTERFACE_UNSPECIFIED => 'DISK_INTERFACE_UNSPECIFIED', + self::SCSI => 'SCSI', + self::NVME => 'NVME', + self::NVDIMM => 'NVDIMM', + self::ISCSI => 'ISCSI', + ]; + + 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/BackupDr/src/V1/AttachedDisk/DiskMode.php b/BackupDr/src/V1/AttachedDisk/DiskMode.php new file mode 100644 index 000000000000..57c501a544cb --- /dev/null +++ b/BackupDr/src/V1/AttachedDisk/DiskMode.php @@ -0,0 +1,74 @@ +google.cloud.backupdr.v1.AttachedDisk.DiskMode + */ +class DiskMode +{ + /** + * Default value, which is unused. + * + * Generated from protobuf enum DISK_MODE_UNSPECIFIED = 0; + */ + const DISK_MODE_UNSPECIFIED = 0; + /** + * Attaches this disk in read-write mode. Only one + * virtual machine at a time can be attached to a disk in read-write mode. + * + * Generated from protobuf enum READ_WRITE = 1; + */ + const READ_WRITE = 1; + /** + * Attaches this disk in read-only mode. Multiple virtual machines can use + * a disk in read-only mode at a time. + * + * Generated from protobuf enum READ_ONLY = 2; + */ + const READ_ONLY = 2; + /** + * The disk is locked for administrative reasons. Nobody else + * can use the disk. This mode is used (for example) when taking + * a snapshot of a disk to prevent mounting the disk while it is + * being snapshotted. + * + * Generated from protobuf enum LOCKED = 3; + */ + const LOCKED = 3; + + private static $valueToName = [ + self::DISK_MODE_UNSPECIFIED => 'DISK_MODE_UNSPECIFIED', + self::READ_WRITE => 'READ_WRITE', + self::READ_ONLY => 'READ_ONLY', + self::LOCKED => 'LOCKED', + ]; + + 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/BackupDr/src/V1/AttachedDisk/DiskSavedState.php b/BackupDr/src/V1/AttachedDisk/DiskSavedState.php new file mode 100644 index 000000000000..c17852da2280 --- /dev/null +++ b/BackupDr/src/V1/AttachedDisk/DiskSavedState.php @@ -0,0 +1,55 @@ +google.cloud.backupdr.v1.AttachedDisk.DiskSavedState + */ +class DiskSavedState +{ + /** + * Default Disk state has not been preserved. + * + * Generated from protobuf enum DISK_SAVED_STATE_UNSPECIFIED = 0; + */ + const DISK_SAVED_STATE_UNSPECIFIED = 0; + /** + * Disk state has been preserved. + * + * Generated from protobuf enum PRESERVED = 1; + */ + const PRESERVED = 1; + + private static $valueToName = [ + self::DISK_SAVED_STATE_UNSPECIFIED => 'DISK_SAVED_STATE_UNSPECIFIED', + self::PRESERVED => 'PRESERVED', + ]; + + 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/BackupDr/src/V1/AttachedDisk/DiskType.php b/BackupDr/src/V1/AttachedDisk/DiskType.php new file mode 100644 index 000000000000..323c3423bf3d --- /dev/null +++ b/BackupDr/src/V1/AttachedDisk/DiskType.php @@ -0,0 +1,62 @@ +google.cloud.backupdr.v1.AttachedDisk.DiskType + */ +class DiskType +{ + /** + * Default value, which is unused. + * + * Generated from protobuf enum DISK_TYPE_UNSPECIFIED = 0; + */ + const DISK_TYPE_UNSPECIFIED = 0; + /** + * A scratch disk type. + * + * Generated from protobuf enum SCRATCH = 1; + */ + const SCRATCH = 1; + /** + * A persistent disk type. + * + * Generated from protobuf enum PERSISTENT = 2; + */ + const PERSISTENT = 2; + + private static $valueToName = [ + self::DISK_TYPE_UNSPECIFIED => 'DISK_TYPE_UNSPECIFIED', + self::SCRATCH => 'SCRATCH', + self::PERSISTENT => 'PERSISTENT', + ]; + + 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/BackupDr/src/V1/AttachedDisk/InitializeParams.php b/BackupDr/src/V1/AttachedDisk/InitializeParams.php new file mode 100644 index 000000000000..549109c5f495 --- /dev/null +++ b/BackupDr/src/V1/AttachedDisk/InitializeParams.php @@ -0,0 +1,120 @@ +google.cloud.backupdr.v1.AttachedDisk.InitializeParams + */ +class InitializeParams extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Specifies the disk name. If not specified, the default is to + * use the name of the instance. + * + * Generated from protobuf field optional string disk_name = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $disk_name = null; + /** + * Optional. URL of the zone where the disk should be created. + * Required for each regional disk associated with the instance. + * + * Generated from protobuf field repeated string replica_zones = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $replica_zones; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $disk_name + * Optional. Specifies the disk name. If not specified, the default is to + * use the name of the instance. + * @type array|\Google\Protobuf\Internal\RepeatedField $replica_zones + * Optional. URL of the zone where the disk should be created. + * Required for each regional disk associated with the instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Specifies the disk name. If not specified, the default is to + * use the name of the instance. + * + * Generated from protobuf field optional string disk_name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDiskName() + { + return isset($this->disk_name) ? $this->disk_name : ''; + } + + public function hasDiskName() + { + return isset($this->disk_name); + } + + public function clearDiskName() + { + unset($this->disk_name); + } + + /** + * Optional. Specifies the disk name. If not specified, the default is to + * use the name of the instance. + * + * Generated from protobuf field optional string disk_name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDiskName($var) + { + GPBUtil::checkString($var, True); + $this->disk_name = $var; + + return $this; + } + + /** + * Optional. URL of the zone where the disk should be created. + * Required for each regional disk associated with the instance. + * + * Generated from protobuf field repeated string replica_zones = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getReplicaZones() + { + return $this->replica_zones; + } + + /** + * Optional. URL of the zone where the disk should be created. + * Required for each regional disk associated with the instance. + * + * Generated from protobuf field repeated string replica_zones = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setReplicaZones($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->replica_zones = $arr; + + return $this; + } + +} + + diff --git a/BackupDr/src/V1/Backup.php b/BackupDr/src/V1/Backup.php new file mode 100644 index 000000000000..5639d7923c1e --- /dev/null +++ b/BackupDr/src/V1/Backup.php @@ -0,0 +1,728 @@ +google.cloud.backupdr.v1.Backup + */ +class Backup extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Identifier. Name of the backup to create. It must have the + * format`"projects//locations//backupVaults//dataSources/{datasource}/backups/{backup}"`. + * `{backup}` cannot be changed after creation. It must be between 3-63 + * characters long and must be unique within the datasource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. The description of the Backup instance (2048 characters or + * less). + * + * Generated from protobuf field optional string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $description = null; + /** + * Output only. The time when the instance was created. + * + * Generated from protobuf field optional .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time when the instance was updated. + * + * Generated from protobuf field optional .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Optional. Resource labels to represent user provided metadata. + * No labels currently defined. + * + * Generated from protobuf field map labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Optional. The backup can not be deleted before this time. + * + * Generated from protobuf field optional .google.protobuf.Timestamp enforced_retention_end_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enforced_retention_end_time = null; + /** + * Optional. When this backup is automatically expired. + * + * Generated from protobuf field optional .google.protobuf.Timestamp expire_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $expire_time = null; + /** + * Output only. The point in time when this backup was captured from the + * source. + * + * Generated from protobuf field optional .google.protobuf.Timestamp consistency_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $consistency_time = null; + /** + * Optional. Server specified ETag to prevent updates from overwriting each + * other. + * + * Generated from protobuf field optional string etag = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = null; + /** + * Output only. The Backup resource instance state. + * + * Generated from protobuf field .google.cloud.backupdr.v1.Backup.State state = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. The list of BackupLocks taken by the service to prevent the + * deletion of the backup. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupLock service_locks = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $service_locks; + /** + * Optional. The list of BackupLocks taken by the accessor Backup Appliance. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupLock backup_appliance_locks = 18 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $backup_appliance_locks; + /** + * Output only. Type of the backup, unspecified, scheduled or ondemand. + * + * Generated from protobuf field .google.cloud.backupdr.v1.Backup.BackupType backup_type = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $backup_type = 0; + /** + * Output only. source resource size in bytes at the time of the backup. + * + * Generated from protobuf field int64 resource_size_bytes = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $resource_size_bytes = 0; + protected $backup_properties; + protected $plan_info; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Identifier. Name of the backup to create. It must have the + * format`"projects//locations//backupVaults//dataSources/{datasource}/backups/{backup}"`. + * `{backup}` cannot be changed after creation. It must be between 3-63 + * characters long and must be unique within the datasource. + * @type string $description + * Output only. The description of the Backup instance (2048 characters or + * less). + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time when the instance was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The time when the instance was updated. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Resource labels to represent user provided metadata. + * No labels currently defined. + * @type \Google\Protobuf\Timestamp $enforced_retention_end_time + * Optional. The backup can not be deleted before this time. + * @type \Google\Protobuf\Timestamp $expire_time + * Optional. When this backup is automatically expired. + * @type \Google\Protobuf\Timestamp $consistency_time + * Output only. The point in time when this backup was captured from the + * source. + * @type string $etag + * Optional. Server specified ETag to prevent updates from overwriting each + * other. + * @type int $state + * Output only. The Backup resource instance state. + * @type array<\Google\Cloud\BackupDR\V1\BackupLock>|\Google\Protobuf\Internal\RepeatedField $service_locks + * Output only. The list of BackupLocks taken by the service to prevent the + * deletion of the backup. + * @type array<\Google\Cloud\BackupDR\V1\BackupLock>|\Google\Protobuf\Internal\RepeatedField $backup_appliance_locks + * Optional. The list of BackupLocks taken by the accessor Backup Appliance. + * @type \Google\Cloud\BackupDR\V1\ComputeInstanceBackupProperties $compute_instance_backup_properties + * Output only. Compute Engine specific backup properties. + * @type \Google\Cloud\BackupDR\V1\BackupApplianceBackupProperties $backup_appliance_backup_properties + * Output only. Backup Appliance specific backup properties. + * @type int $backup_type + * Output only. Type of the backup, unspecified, scheduled or ondemand. + * @type \Google\Cloud\BackupDR\V1\Backup\GCPBackupPlanInfo $gcp_backup_plan_info + * Output only. Configuration for a Google Cloud resource. + * @type int|string $resource_size_bytes + * Output only. source resource size in bytes at the time of the backup. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Identifier. Name of the backup to create. It must have the + * format`"projects//locations//backupVaults//dataSources/{datasource}/backups/{backup}"`. + * `{backup}` cannot be changed after creation. It must be between 3-63 + * characters long and must be unique within the datasource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Identifier. Name of the backup to create. It must have the + * format`"projects//locations//backupVaults//dataSources/{datasource}/backups/{backup}"`. + * `{backup}` cannot be changed after creation. It must be between 3-63 + * characters long and must be unique within the datasource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The description of the Backup instance (2048 characters or + * less). + * + * Generated from protobuf field optional string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * Output only. The description of the Backup instance (2048 characters or + * less). + * + * Generated from protobuf field optional string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. The time when the instance was created. + * + * Generated from protobuf field optional .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time when the instance was created. + * + * Generated from protobuf field optional .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time when the instance was updated. + * + * Generated from protobuf field optional .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The time when the instance was updated. + * + * Generated from protobuf field optional .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Optional. Resource labels to represent user provided metadata. + * No labels currently defined. + * + * Generated from protobuf field map labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Resource labels to represent user provided metadata. + * No labels currently defined. + * + * Generated from protobuf field map labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Optional. The backup can not be deleted before this time. + * + * Generated from protobuf field optional .google.protobuf.Timestamp enforced_retention_end_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEnforcedRetentionEndTime() + { + return $this->enforced_retention_end_time; + } + + public function hasEnforcedRetentionEndTime() + { + return isset($this->enforced_retention_end_time); + } + + public function clearEnforcedRetentionEndTime() + { + unset($this->enforced_retention_end_time); + } + + /** + * Optional. The backup can not be deleted before this time. + * + * Generated from protobuf field optional .google.protobuf.Timestamp enforced_retention_end_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEnforcedRetentionEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->enforced_retention_end_time = $var; + + return $this; + } + + /** + * Optional. When this backup is automatically expired. + * + * Generated from protobuf field optional .google.protobuf.Timestamp expire_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getExpireTime() + { + return $this->expire_time; + } + + public function hasExpireTime() + { + return isset($this->expire_time); + } + + public function clearExpireTime() + { + unset($this->expire_time); + } + + /** + * Optional. When this backup is automatically expired. + * + * Generated from protobuf field optional .google.protobuf.Timestamp expire_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setExpireTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->expire_time = $var; + + return $this; + } + + /** + * Output only. The point in time when this backup was captured from the + * source. + * + * Generated from protobuf field optional .google.protobuf.Timestamp consistency_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getConsistencyTime() + { + return $this->consistency_time; + } + + public function hasConsistencyTime() + { + return isset($this->consistency_time); + } + + public function clearConsistencyTime() + { + unset($this->consistency_time); + } + + /** + * Output only. The point in time when this backup was captured from the + * source. + * + * Generated from protobuf field optional .google.protobuf.Timestamp consistency_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setConsistencyTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->consistency_time = $var; + + return $this; + } + + /** + * Optional. Server specified ETag to prevent updates from overwriting each + * other. + * + * Generated from protobuf field optional string etag = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return isset($this->etag) ? $this->etag : ''; + } + + public function hasEtag() + { + return isset($this->etag); + } + + public function clearEtag() + { + unset($this->etag); + } + + /** + * Optional. Server specified ETag to prevent updates from overwriting each + * other. + * + * Generated from protobuf field optional string etag = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Output only. The Backup resource instance state. + * + * Generated from protobuf field .google.cloud.backupdr.v1.Backup.State state = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The Backup resource instance state. + * + * Generated from protobuf field .google.cloud.backupdr.v1.Backup.State state = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\Backup\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. The list of BackupLocks taken by the service to prevent the + * deletion of the backup. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupLock service_locks = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getServiceLocks() + { + return $this->service_locks; + } + + /** + * Output only. The list of BackupLocks taken by the service to prevent the + * deletion of the backup. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupLock service_locks = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\BackupDR\V1\BackupLock>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setServiceLocks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\BackupLock::class); + $this->service_locks = $arr; + + return $this; + } + + /** + * Optional. The list of BackupLocks taken by the accessor Backup Appliance. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupLock backup_appliance_locks = 18 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBackupApplianceLocks() + { + return $this->backup_appliance_locks; + } + + /** + * Optional. The list of BackupLocks taken by the accessor Backup Appliance. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupLock backup_appliance_locks = 18 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\BackupDR\V1\BackupLock>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBackupApplianceLocks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\BackupLock::class); + $this->backup_appliance_locks = $arr; + + return $this; + } + + /** + * Output only. Compute Engine specific backup properties. + * + * Generated from protobuf field .google.cloud.backupdr.v1.ComputeInstanceBackupProperties compute_instance_backup_properties = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\BackupDR\V1\ComputeInstanceBackupProperties|null + */ + public function getComputeInstanceBackupProperties() + { + return $this->readOneof(19); + } + + public function hasComputeInstanceBackupProperties() + { + return $this->hasOneof(19); + } + + /** + * Output only. Compute Engine specific backup properties. + * + * Generated from protobuf field .google.cloud.backupdr.v1.ComputeInstanceBackupProperties compute_instance_backup_properties = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\BackupDR\V1\ComputeInstanceBackupProperties $var + * @return $this + */ + public function setComputeInstanceBackupProperties($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\ComputeInstanceBackupProperties::class); + $this->writeOneof(19, $var); + + return $this; + } + + /** + * Output only. Backup Appliance specific backup properties. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupApplianceBackupProperties backup_appliance_backup_properties = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\BackupDR\V1\BackupApplianceBackupProperties|null + */ + public function getBackupApplianceBackupProperties() + { + return $this->readOneof(21); + } + + public function hasBackupApplianceBackupProperties() + { + return $this->hasOneof(21); + } + + /** + * Output only. Backup Appliance specific backup properties. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupApplianceBackupProperties backup_appliance_backup_properties = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\BackupDR\V1\BackupApplianceBackupProperties $var + * @return $this + */ + public function setBackupApplianceBackupProperties($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\BackupApplianceBackupProperties::class); + $this->writeOneof(21, $var); + + return $this; + } + + /** + * Output only. Type of the backup, unspecified, scheduled or ondemand. + * + * Generated from protobuf field .google.cloud.backupdr.v1.Backup.BackupType backup_type = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getBackupType() + { + return $this->backup_type; + } + + /** + * Output only. Type of the backup, unspecified, scheduled or ondemand. + * + * Generated from protobuf field .google.cloud.backupdr.v1.Backup.BackupType backup_type = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setBackupType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\Backup\BackupType::class); + $this->backup_type = $var; + + return $this; + } + + /** + * Output only. Configuration for a Google Cloud resource. + * + * Generated from protobuf field .google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo gcp_backup_plan_info = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\BackupDR\V1\Backup\GCPBackupPlanInfo|null + */ + public function getGcpBackupPlanInfo() + { + return $this->readOneof(22); + } + + public function hasGcpBackupPlanInfo() + { + return $this->hasOneof(22); + } + + /** + * Output only. Configuration for a Google Cloud resource. + * + * Generated from protobuf field .google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo gcp_backup_plan_info = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\BackupDR\V1\Backup\GCPBackupPlanInfo $var + * @return $this + */ + public function setGcpBackupPlanInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\Backup\GCPBackupPlanInfo::class); + $this->writeOneof(22, $var); + + return $this; + } + + /** + * Output only. source resource size in bytes at the time of the backup. + * + * Generated from protobuf field int64 resource_size_bytes = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getResourceSizeBytes() + { + return $this->resource_size_bytes; + } + + /** + * Output only. source resource size in bytes at the time of the backup. + * + * Generated from protobuf field int64 resource_size_bytes = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setResourceSizeBytes($var) + { + GPBUtil::checkInt64($var); + $this->resource_size_bytes = $var; + + return $this; + } + + /** + * @return string + */ + public function getBackupProperties() + { + return $this->whichOneof("backup_properties"); + } + + /** + * @return string + */ + public function getPlanInfo() + { + return $this->whichOneof("plan_info"); + } + +} + diff --git a/BackupDr/src/V1/Backup/BackupType.php b/BackupDr/src/V1/Backup/BackupType.php new file mode 100644 index 000000000000..5858858dc7d8 --- /dev/null +++ b/BackupDr/src/V1/Backup/BackupType.php @@ -0,0 +1,62 @@ +google.cloud.backupdr.v1.Backup.BackupType + */ +class BackupType +{ + /** + * Backup type is unspecified. + * + * Generated from protobuf enum BACKUP_TYPE_UNSPECIFIED = 0; + */ + const BACKUP_TYPE_UNSPECIFIED = 0; + /** + * Scheduled backup. + * + * Generated from protobuf enum SCHEDULED = 1; + */ + const SCHEDULED = 1; + /** + * On demand backup. + * + * Generated from protobuf enum ON_DEMAND = 2; + */ + const ON_DEMAND = 2; + + private static $valueToName = [ + self::BACKUP_TYPE_UNSPECIFIED => 'BACKUP_TYPE_UNSPECIFIED', + self::SCHEDULED => 'SCHEDULED', + self::ON_DEMAND => 'ON_DEMAND', + ]; + + 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/BackupDr/src/V1/Backup/GCPBackupPlanInfo.php b/BackupDr/src/V1/Backup/GCPBackupPlanInfo.php new file mode 100644 index 000000000000..b8c387cdfd06 --- /dev/null +++ b/BackupDr/src/V1/Backup/GCPBackupPlanInfo.php @@ -0,0 +1,119 @@ +google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo + */ +class GCPBackupPlanInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Resource name of backup plan by which workload is protected at the time + * of the backup. + * Format: + * projects/{project}/locations/{location}/backupPlans/{backupPlanId} + * + * Generated from protobuf field string backup_plan = 1 [(.google.api.resource_reference) = { + */ + protected $backup_plan = ''; + /** + * The rule id of the backup plan which triggered this backup in case of + * scheduled backup or used for + * + * Generated from protobuf field string backup_plan_rule_id = 2; + */ + protected $backup_plan_rule_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $backup_plan + * Resource name of backup plan by which workload is protected at the time + * of the backup. + * Format: + * projects/{project}/locations/{location}/backupPlans/{backupPlanId} + * @type string $backup_plan_rule_id + * The rule id of the backup plan which triggered this backup in case of + * scheduled backup or used for + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Resource name of backup plan by which workload is protected at the time + * of the backup. + * Format: + * projects/{project}/locations/{location}/backupPlans/{backupPlanId} + * + * Generated from protobuf field string backup_plan = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getBackupPlan() + { + return $this->backup_plan; + } + + /** + * Resource name of backup plan by which workload is protected at the time + * of the backup. + * Format: + * projects/{project}/locations/{location}/backupPlans/{backupPlanId} + * + * Generated from protobuf field string backup_plan = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setBackupPlan($var) + { + GPBUtil::checkString($var, True); + $this->backup_plan = $var; + + return $this; + } + + /** + * The rule id of the backup plan which triggered this backup in case of + * scheduled backup or used for + * + * Generated from protobuf field string backup_plan_rule_id = 2; + * @return string + */ + public function getBackupPlanRuleId() + { + return $this->backup_plan_rule_id; + } + + /** + * The rule id of the backup plan which triggered this backup in case of + * scheduled backup or used for + * + * Generated from protobuf field string backup_plan_rule_id = 2; + * @param string $var + * @return $this + */ + public function setBackupPlanRuleId($var) + { + GPBUtil::checkString($var, True); + $this->backup_plan_rule_id = $var; + + return $this; + } + +} + + diff --git a/BackupDr/src/V1/Backup/State.php b/BackupDr/src/V1/Backup/State.php new file mode 100644 index 000000000000..a82ffb90bab8 --- /dev/null +++ b/BackupDr/src/V1/Backup/State.php @@ -0,0 +1,76 @@ +google.cloud.backupdr.v1.Backup.State + */ +class State +{ + /** + * State not set. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The backup is being created. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * The backup has been created and is fully usable. + * + * Generated from protobuf enum ACTIVE = 2; + */ + const ACTIVE = 2; + /** + * The backup is being deleted. + * + * Generated from protobuf enum DELETING = 3; + */ + const DELETING = 3; + /** + * The backup is experiencing an issue and might be unusable. + * + * Generated from protobuf enum ERROR = 4; + */ + const ERROR = 4; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::ACTIVE => 'ACTIVE', + self::DELETING => 'DELETING', + self::ERROR => 'ERROR', + ]; + + 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/BackupDr/src/V1/BackupApplianceBackupConfig.php b/BackupDr/src/V1/BackupApplianceBackupConfig.php new file mode 100644 index 000000000000..b5d4c27f9480 --- /dev/null +++ b/BackupDr/src/V1/BackupApplianceBackupConfig.php @@ -0,0 +1,272 @@ +google.cloud.backupdr.v1.BackupApplianceBackupConfig + */ +class BackupApplianceBackupConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the backup appliance. + * + * Generated from protobuf field string backup_appliance_name = 1; + */ + protected $backup_appliance_name = ''; + /** + * The ID of the backup appliance. + * + * Generated from protobuf field int64 backup_appliance_id = 2; + */ + protected $backup_appliance_id = 0; + /** + * The ID of the SLA of this application. + * + * Generated from protobuf field int64 sla_id = 3; + */ + protected $sla_id = 0; + /** + * The name of the application. + * + * Generated from protobuf field string application_name = 4; + */ + protected $application_name = ''; + /** + * The name of the host where the application is running. + * + * Generated from protobuf field string host_name = 5; + */ + protected $host_name = ''; + /** + * The name of the SLT associated with the application. + * + * Generated from protobuf field string slt_name = 6; + */ + protected $slt_name = ''; + /** + * The name of the SLP associated with the application. + * + * Generated from protobuf field string slp_name = 7; + */ + protected $slp_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $backup_appliance_name + * The name of the backup appliance. + * @type int|string $backup_appliance_id + * The ID of the backup appliance. + * @type int|string $sla_id + * The ID of the SLA of this application. + * @type string $application_name + * The name of the application. + * @type string $host_name + * The name of the host where the application is running. + * @type string $slt_name + * The name of the SLT associated with the application. + * @type string $slp_name + * The name of the SLP associated with the application. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * The name of the backup appliance. + * + * Generated from protobuf field string backup_appliance_name = 1; + * @return string + */ + public function getBackupApplianceName() + { + return $this->backup_appliance_name; + } + + /** + * The name of the backup appliance. + * + * Generated from protobuf field string backup_appliance_name = 1; + * @param string $var + * @return $this + */ + public function setBackupApplianceName($var) + { + GPBUtil::checkString($var, True); + $this->backup_appliance_name = $var; + + return $this; + } + + /** + * The ID of the backup appliance. + * + * Generated from protobuf field int64 backup_appliance_id = 2; + * @return int|string + */ + public function getBackupApplianceId() + { + return $this->backup_appliance_id; + } + + /** + * The ID of the backup appliance. + * + * Generated from protobuf field int64 backup_appliance_id = 2; + * @param int|string $var + * @return $this + */ + public function setBackupApplianceId($var) + { + GPBUtil::checkInt64($var); + $this->backup_appliance_id = $var; + + return $this; + } + + /** + * The ID of the SLA of this application. + * + * Generated from protobuf field int64 sla_id = 3; + * @return int|string + */ + public function getSlaId() + { + return $this->sla_id; + } + + /** + * The ID of the SLA of this application. + * + * Generated from protobuf field int64 sla_id = 3; + * @param int|string $var + * @return $this + */ + public function setSlaId($var) + { + GPBUtil::checkInt64($var); + $this->sla_id = $var; + + return $this; + } + + /** + * The name of the application. + * + * Generated from protobuf field string application_name = 4; + * @return string + */ + public function getApplicationName() + { + return $this->application_name; + } + + /** + * The name of the application. + * + * Generated from protobuf field string application_name = 4; + * @param string $var + * @return $this + */ + public function setApplicationName($var) + { + GPBUtil::checkString($var, True); + $this->application_name = $var; + + return $this; + } + + /** + * The name of the host where the application is running. + * + * Generated from protobuf field string host_name = 5; + * @return string + */ + public function getHostName() + { + return $this->host_name; + } + + /** + * The name of the host where the application is running. + * + * Generated from protobuf field string host_name = 5; + * @param string $var + * @return $this + */ + public function setHostName($var) + { + GPBUtil::checkString($var, True); + $this->host_name = $var; + + return $this; + } + + /** + * The name of the SLT associated with the application. + * + * Generated from protobuf field string slt_name = 6; + * @return string + */ + public function getSltName() + { + return $this->slt_name; + } + + /** + * The name of the SLT associated with the application. + * + * Generated from protobuf field string slt_name = 6; + * @param string $var + * @return $this + */ + public function setSltName($var) + { + GPBUtil::checkString($var, True); + $this->slt_name = $var; + + return $this; + } + + /** + * The name of the SLP associated with the application. + * + * Generated from protobuf field string slp_name = 7; + * @return string + */ + public function getSlpName() + { + return $this->slp_name; + } + + /** + * The name of the SLP associated with the application. + * + * Generated from protobuf field string slp_name = 7; + * @param string $var + * @return $this + */ + public function setSlpName($var) + { + GPBUtil::checkString($var, True); + $this->slp_name = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/BackupApplianceBackupProperties.php b/BackupDr/src/V1/BackupApplianceBackupProperties.php new file mode 100644 index 000000000000..62bf277eea5e --- /dev/null +++ b/BackupDr/src/V1/BackupApplianceBackupProperties.php @@ -0,0 +1,218 @@ +google.cloud.backupdr.v1.BackupApplianceBackupProperties + */ +class BackupApplianceBackupProperties extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The numeric generation ID of the backup (monotonically + * increasing). + * + * Generated from protobuf field optional int32 generation_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $generation_id = null; + /** + * Output only. The time when this backup object was finalized (if none, + * backup is not finalized). + * + * Generated from protobuf field optional .google.protobuf.Timestamp finalize_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $finalize_time = null; + /** + * Optional. The earliest timestamp of data available in this Backup. + * + * Generated from protobuf field optional .google.protobuf.Timestamp recovery_range_start_time = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $recovery_range_start_time = null; + /** + * Optional. The latest timestamp of data available in this Backup. + * + * Generated from protobuf field optional .google.protobuf.Timestamp recovery_range_end_time = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $recovery_range_end_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $generation_id + * Output only. The numeric generation ID of the backup (monotonically + * increasing). + * @type \Google\Protobuf\Timestamp $finalize_time + * Output only. The time when this backup object was finalized (if none, + * backup is not finalized). + * @type \Google\Protobuf\Timestamp $recovery_range_start_time + * Optional. The earliest timestamp of data available in this Backup. + * @type \Google\Protobuf\Timestamp $recovery_range_end_time + * Optional. The latest timestamp of data available in this Backup. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultBa::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The numeric generation ID of the backup (monotonically + * increasing). + * + * Generated from protobuf field optional int32 generation_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getGenerationId() + { + return isset($this->generation_id) ? $this->generation_id : 0; + } + + public function hasGenerationId() + { + return isset($this->generation_id); + } + + public function clearGenerationId() + { + unset($this->generation_id); + } + + /** + * Output only. The numeric generation ID of the backup (monotonically + * increasing). + * + * Generated from protobuf field optional int32 generation_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setGenerationId($var) + { + GPBUtil::checkInt32($var); + $this->generation_id = $var; + + return $this; + } + + /** + * Output only. The time when this backup object was finalized (if none, + * backup is not finalized). + * + * Generated from protobuf field optional .google.protobuf.Timestamp finalize_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getFinalizeTime() + { + return $this->finalize_time; + } + + public function hasFinalizeTime() + { + return isset($this->finalize_time); + } + + public function clearFinalizeTime() + { + unset($this->finalize_time); + } + + /** + * Output only. The time when this backup object was finalized (if none, + * backup is not finalized). + * + * Generated from protobuf field optional .google.protobuf.Timestamp finalize_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setFinalizeTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->finalize_time = $var; + + return $this; + } + + /** + * Optional. The earliest timestamp of data available in this Backup. + * + * Generated from protobuf field optional .google.protobuf.Timestamp recovery_range_start_time = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getRecoveryRangeStartTime() + { + return $this->recovery_range_start_time; + } + + public function hasRecoveryRangeStartTime() + { + return isset($this->recovery_range_start_time); + } + + public function clearRecoveryRangeStartTime() + { + unset($this->recovery_range_start_time); + } + + /** + * Optional. The earliest timestamp of data available in this Backup. + * + * Generated from protobuf field optional .google.protobuf.Timestamp recovery_range_start_time = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setRecoveryRangeStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->recovery_range_start_time = $var; + + return $this; + } + + /** + * Optional. The latest timestamp of data available in this Backup. + * + * Generated from protobuf field optional .google.protobuf.Timestamp recovery_range_end_time = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getRecoveryRangeEndTime() + { + return $this->recovery_range_end_time; + } + + public function hasRecoveryRangeEndTime() + { + return isset($this->recovery_range_end_time); + } + + public function clearRecoveryRangeEndTime() + { + unset($this->recovery_range_end_time); + } + + /** + * Optional. The latest timestamp of data available in this Backup. + * + * Generated from protobuf field optional .google.protobuf.Timestamp recovery_range_end_time = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setRecoveryRangeEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->recovery_range_end_time = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/BackupApplianceLockInfo.php b/BackupDr/src/V1/BackupApplianceLockInfo.php new file mode 100644 index 000000000000..f024d90f7bd8 --- /dev/null +++ b/BackupDr/src/V1/BackupApplianceLockInfo.php @@ -0,0 +1,252 @@ +google.cloud.backupdr.v1.BackupApplianceLockInfo + */ +class BackupApplianceLockInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The ID of the backup/recovery appliance that created this lock. + * + * Generated from protobuf field int64 backup_appliance_id = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backup_appliance_id = 0; + /** + * Required. The name of the backup/recovery appliance that created this lock. + * + * Generated from protobuf field string backup_appliance_name = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backup_appliance_name = ''; + /** + * Required. The reason for the lock: e.g. MOUNT/RESTORE/BACKUP/etc. The + * value of this string is only meaningful to the client and it is not + * interpreted by the BackupVault service. + * + * Generated from protobuf field string lock_reason = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $lock_reason = ''; + protected $lock_source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $backup_appliance_id + * Required. The ID of the backup/recovery appliance that created this lock. + * @type string $backup_appliance_name + * Required. The name of the backup/recovery appliance that created this lock. + * @type string $lock_reason + * Required. The reason for the lock: e.g. MOUNT/RESTORE/BACKUP/etc. The + * value of this string is only meaningful to the client and it is not + * interpreted by the BackupVault service. + * @type string $job_name + * The job name on the backup/recovery appliance that created this lock. + * @type string $backup_image + * The image name that depends on this Backup. + * @type int|string $sla_id + * The SLA on the backup/recovery appliance that owns the lock. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Required. The ID of the backup/recovery appliance that created this lock. + * + * Generated from protobuf field int64 backup_appliance_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int|string + */ + public function getBackupApplianceId() + { + return $this->backup_appliance_id; + } + + /** + * Required. The ID of the backup/recovery appliance that created this lock. + * + * Generated from protobuf field int64 backup_appliance_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int|string $var + * @return $this + */ + public function setBackupApplianceId($var) + { + GPBUtil::checkInt64($var); + $this->backup_appliance_id = $var; + + return $this; + } + + /** + * Required. The name of the backup/recovery appliance that created this lock. + * + * Generated from protobuf field string backup_appliance_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBackupApplianceName() + { + return $this->backup_appliance_name; + } + + /** + * Required. The name of the backup/recovery appliance that created this lock. + * + * Generated from protobuf field string backup_appliance_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBackupApplianceName($var) + { + GPBUtil::checkString($var, True); + $this->backup_appliance_name = $var; + + return $this; + } + + /** + * Required. The reason for the lock: e.g. MOUNT/RESTORE/BACKUP/etc. The + * value of this string is only meaningful to the client and it is not + * interpreted by the BackupVault service. + * + * Generated from protobuf field string lock_reason = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getLockReason() + { + return $this->lock_reason; + } + + /** + * Required. The reason for the lock: e.g. MOUNT/RESTORE/BACKUP/etc. The + * value of this string is only meaningful to the client and it is not + * interpreted by the BackupVault service. + * + * Generated from protobuf field string lock_reason = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setLockReason($var) + { + GPBUtil::checkString($var, True); + $this->lock_reason = $var; + + return $this; + } + + /** + * The job name on the backup/recovery appliance that created this lock. + * + * Generated from protobuf field string job_name = 6; + * @return string + */ + public function getJobName() + { + return $this->readOneof(6); + } + + public function hasJobName() + { + return $this->hasOneof(6); + } + + /** + * The job name on the backup/recovery appliance that created this lock. + * + * Generated from protobuf field string job_name = 6; + * @param string $var + * @return $this + */ + public function setJobName($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * The image name that depends on this Backup. + * + * Generated from protobuf field string backup_image = 7; + * @return string + */ + public function getBackupImage() + { + return $this->readOneof(7); + } + + public function hasBackupImage() + { + return $this->hasOneof(7); + } + + /** + * The image name that depends on this Backup. + * + * Generated from protobuf field string backup_image = 7; + * @param string $var + * @return $this + */ + public function setBackupImage($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * The SLA on the backup/recovery appliance that owns the lock. + * + * Generated from protobuf field int64 sla_id = 8; + * @return int|string + */ + public function getSlaId() + { + return $this->readOneof(8); + } + + public function hasSlaId() + { + return $this->hasOneof(8); + } + + /** + * The SLA on the backup/recovery appliance that owns the lock. + * + * Generated from protobuf field int64 sla_id = 8; + * @param int|string $var + * @return $this + */ + public function setSlaId($var) + { + GPBUtil::checkInt64($var); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * @return string + */ + public function getLockSource() + { + return $this->whichOneof("lock_source"); + } + +} + diff --git a/BackupDr/src/V1/BackupConfigInfo.php b/BackupDr/src/V1/BackupConfigInfo.php new file mode 100644 index 000000000000..910ef56ebd1e --- /dev/null +++ b/BackupDr/src/V1/BackupConfigInfo.php @@ -0,0 +1,235 @@ +google.cloud.backupdr.v1.BackupConfigInfo + */ +class BackupConfigInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The status of the last backup to this BackupVault + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState last_backup_state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $last_backup_state = 0; + /** + * Output only. If the last backup were successful, this field has the + * consistency date. + * + * Generated from protobuf field .google.protobuf.Timestamp last_successful_backup_consistency_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $last_successful_backup_consistency_time = null; + /** + * Output only. If the last backup failed, this field has the error message. + * + * Generated from protobuf field .google.rpc.Status last_backup_error = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $last_backup_error = null; + protected $backup_config; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $last_backup_state + * Output only. The status of the last backup to this BackupVault + * @type \Google\Protobuf\Timestamp $last_successful_backup_consistency_time + * Output only. If the last backup were successful, this field has the + * consistency date. + * @type \Google\Rpc\Status $last_backup_error + * Output only. If the last backup failed, this field has the error message. + * @type \Google\Cloud\BackupDR\V1\GcpBackupConfig $gcp_backup_config + * Configuration for a Google Cloud resource. + * @type \Google\Cloud\BackupDR\V1\BackupApplianceBackupConfig $backup_appliance_backup_config + * Configuration for an application backed up by a Backup Appliance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The status of the last backup to this BackupVault + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState last_backup_state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getLastBackupState() + { + return $this->last_backup_state; + } + + /** + * Output only. The status of the last backup to this BackupVault + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState last_backup_state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setLastBackupState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\BackupConfigInfo\LastBackupState::class); + $this->last_backup_state = $var; + + return $this; + } + + /** + * Output only. If the last backup were successful, this field has the + * consistency date. + * + * Generated from protobuf field .google.protobuf.Timestamp last_successful_backup_consistency_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getLastSuccessfulBackupConsistencyTime() + { + return $this->last_successful_backup_consistency_time; + } + + public function hasLastSuccessfulBackupConsistencyTime() + { + return isset($this->last_successful_backup_consistency_time); + } + + public function clearLastSuccessfulBackupConsistencyTime() + { + unset($this->last_successful_backup_consistency_time); + } + + /** + * Output only. If the last backup were successful, this field has the + * consistency date. + * + * Generated from protobuf field .google.protobuf.Timestamp last_successful_backup_consistency_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setLastSuccessfulBackupConsistencyTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->last_successful_backup_consistency_time = $var; + + return $this; + } + + /** + * Output only. If the last backup failed, this field has the error message. + * + * Generated from protobuf field .google.rpc.Status last_backup_error = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Rpc\Status|null + */ + public function getLastBackupError() + { + return $this->last_backup_error; + } + + public function hasLastBackupError() + { + return isset($this->last_backup_error); + } + + public function clearLastBackupError() + { + unset($this->last_backup_error); + } + + /** + * Output only. If the last backup failed, this field has the error message. + * + * Generated from protobuf field .google.rpc.Status last_backup_error = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setLastBackupError($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->last_backup_error = $var; + + return $this; + } + + /** + * Configuration for a Google Cloud resource. + * + * Generated from protobuf field .google.cloud.backupdr.v1.GcpBackupConfig gcp_backup_config = 4; + * @return \Google\Cloud\BackupDR\V1\GcpBackupConfig|null + */ + public function getGcpBackupConfig() + { + return $this->readOneof(4); + } + + public function hasGcpBackupConfig() + { + return $this->hasOneof(4); + } + + /** + * Configuration for a Google Cloud resource. + * + * Generated from protobuf field .google.cloud.backupdr.v1.GcpBackupConfig gcp_backup_config = 4; + * @param \Google\Cloud\BackupDR\V1\GcpBackupConfig $var + * @return $this + */ + public function setGcpBackupConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\GcpBackupConfig::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Configuration for an application backed up by a Backup Appliance. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupApplianceBackupConfig backup_appliance_backup_config = 5; + * @return \Google\Cloud\BackupDR\V1\BackupApplianceBackupConfig|null + */ + public function getBackupApplianceBackupConfig() + { + return $this->readOneof(5); + } + + public function hasBackupApplianceBackupConfig() + { + return $this->hasOneof(5); + } + + /** + * Configuration for an application backed up by a Backup Appliance. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupApplianceBackupConfig backup_appliance_backup_config = 5; + * @param \Google\Cloud\BackupDR\V1\BackupApplianceBackupConfig $var + * @return $this + */ + public function setBackupApplianceBackupConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\BackupApplianceBackupConfig::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * @return string + */ + public function getBackupConfig() + { + return $this->whichOneof("backup_config"); + } + +} + diff --git a/BackupDr/src/V1/BackupConfigInfo/LastBackupState.php b/BackupDr/src/V1/BackupConfigInfo/LastBackupState.php new file mode 100644 index 000000000000..a451de244b95 --- /dev/null +++ b/BackupDr/src/V1/BackupConfigInfo/LastBackupState.php @@ -0,0 +1,78 @@ +google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState + */ +class LastBackupState +{ + /** + * Status not set. + * + * Generated from protobuf enum LAST_BACKUP_STATE_UNSPECIFIED = 0; + */ + const LAST_BACKUP_STATE_UNSPECIFIED = 0; + /** + * The first backup has not yet completed + * + * Generated from protobuf enum FIRST_BACKUP_PENDING = 1; + */ + const FIRST_BACKUP_PENDING = 1; + /** + * The most recent backup was successful + * + * Generated from protobuf enum SUCCEEDED = 2; + */ + const SUCCEEDED = 2; + /** + * The most recent backup failed + * + * Generated from protobuf enum FAILED = 3; + */ + const FAILED = 3; + /** + * The most recent backup could not be run/failed because of the lack of + * permissions + * + * Generated from protobuf enum PERMISSION_DENIED = 4; + */ + const PERMISSION_DENIED = 4; + + private static $valueToName = [ + self::LAST_BACKUP_STATE_UNSPECIFIED => 'LAST_BACKUP_STATE_UNSPECIFIED', + self::FIRST_BACKUP_PENDING => 'FIRST_BACKUP_PENDING', + self::SUCCEEDED => 'SUCCEEDED', + self::FAILED => 'FAILED', + self::PERMISSION_DENIED => 'PERMISSION_DENIED', + ]; + + 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/BackupDr/src/V1/BackupConfigState.php b/BackupDr/src/V1/BackupConfigState.php new file mode 100644 index 000000000000..8c760774704c --- /dev/null +++ b/BackupDr/src/V1/BackupConfigState.php @@ -0,0 +1,63 @@ +google.cloud.backupdr.v1.BackupConfigState + */ +class BackupConfigState +{ + /** + * The possible states of backup configuration. + * Status not set. + * + * Generated from protobuf enum BACKUP_CONFIG_STATE_UNSPECIFIED = 0; + */ + const BACKUP_CONFIG_STATE_UNSPECIFIED = 0; + /** + * The data source is actively protected (i.e. there is a + * BackupPlanAssociation or Appliance SLA pointing to it) + * + * Generated from protobuf enum ACTIVE = 1; + */ + const ACTIVE = 1; + /** + * The data source is no longer protected (but may have backups under it) + * + * Generated from protobuf enum PASSIVE = 2; + */ + const PASSIVE = 2; + + private static $valueToName = [ + self::BACKUP_CONFIG_STATE_UNSPECIFIED => 'BACKUP_CONFIG_STATE_UNSPECIFIED', + self::ACTIVE => 'ACTIVE', + self::PASSIVE => 'PASSIVE', + ]; + + 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/BackupDr/src/V1/BackupLock.php b/BackupDr/src/V1/BackupLock.php new file mode 100644 index 000000000000..16c344cda822 --- /dev/null +++ b/BackupDr/src/V1/BackupLock.php @@ -0,0 +1,163 @@ +google.cloud.backupdr.v1.BackupLock + */ +class BackupLock extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The time after which this lock is not considered valid and will + * no longer protect the Backup from deletion. + * + * Generated from protobuf field .google.protobuf.Timestamp lock_until_time = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $lock_until_time = null; + protected $ClientLockInfo; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $lock_until_time + * Required. The time after which this lock is not considered valid and will + * no longer protect the Backup from deletion. + * @type \Google\Cloud\BackupDR\V1\BackupApplianceLockInfo $backup_appliance_lock_info + * If the client is a backup and recovery appliance, this + * contains metadata about why the lock exists. + * @type \Google\Cloud\BackupDR\V1\ServiceLockInfo $service_lock_info + * Output only. Contains metadata about the lock exist for Google Cloud + * native backups. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Required. The time after which this lock is not considered valid and will + * no longer protect the Backup from deletion. + * + * Generated from protobuf field .google.protobuf.Timestamp lock_until_time = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getLockUntilTime() + { + return $this->lock_until_time; + } + + public function hasLockUntilTime() + { + return isset($this->lock_until_time); + } + + public function clearLockUntilTime() + { + unset($this->lock_until_time); + } + + /** + * Required. The time after which this lock is not considered valid and will + * no longer protect the Backup from deletion. + * + * Generated from protobuf field .google.protobuf.Timestamp lock_until_time = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setLockUntilTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->lock_until_time = $var; + + return $this; + } + + /** + * If the client is a backup and recovery appliance, this + * contains metadata about why the lock exists. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupApplianceLockInfo backup_appliance_lock_info = 3; + * @return \Google\Cloud\BackupDR\V1\BackupApplianceLockInfo|null + */ + public function getBackupApplianceLockInfo() + { + return $this->readOneof(3); + } + + public function hasBackupApplianceLockInfo() + { + return $this->hasOneof(3); + } + + /** + * If the client is a backup and recovery appliance, this + * contains metadata about why the lock exists. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupApplianceLockInfo backup_appliance_lock_info = 3; + * @param \Google\Cloud\BackupDR\V1\BackupApplianceLockInfo $var + * @return $this + */ + public function setBackupApplianceLockInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\BackupApplianceLockInfo::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Output only. Contains metadata about the lock exist for Google Cloud + * native backups. + * + * Generated from protobuf field .google.cloud.backupdr.v1.ServiceLockInfo service_lock_info = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\BackupDR\V1\ServiceLockInfo|null + */ + public function getServiceLockInfo() + { + return $this->readOneof(4); + } + + public function hasServiceLockInfo() + { + return $this->hasOneof(4); + } + + /** + * Output only. Contains metadata about the lock exist for Google Cloud + * native backups. + * + * Generated from protobuf field .google.cloud.backupdr.v1.ServiceLockInfo service_lock_info = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\BackupDR\V1\ServiceLockInfo $var + * @return $this + */ + public function setServiceLockInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\ServiceLockInfo::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getClientLockInfo() + { + return $this->whichOneof("ClientLockInfo"); + } + +} + diff --git a/BackupDr/src/V1/BackupPlan.php b/BackupDr/src/V1/BackupPlan.php new file mode 100644 index 000000000000..5f4feca856b7 --- /dev/null +++ b/BackupDr/src/V1/BackupPlan.php @@ -0,0 +1,490 @@ +google.cloud.backupdr.v1.BackupPlan + */ +class BackupPlan extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Identifier. The resource name of the `BackupPlan`. + * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Optional. The description of the `BackupPlan` resource. + * The description allows for additional details about `BackupPlan` and its + * use cases to be provided. An example description is the following: "This + * is a backup plan that performs a daily backup at 6pm and retains data for 3 + * months". The description must be at most 2048 characters. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Optional. This collection of key/value pairs allows for custom labels to be + * supplied by the user. Example, {"tag": "Weekly"}. + * + * Generated from protobuf field map labels = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Output only. When the `BackupPlan` was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. When the `BackupPlan` was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Required. The backup rules for this `BackupPlan`. There must be at least + * one `BackupRule` message. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupRule backup_rules = 6 [(.google.api.field_behavior) = REQUIRED]; + */ + private $backup_rules; + /** + * Output only. The `State` for the `BackupPlan`. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupPlan.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Required. The resource type to which the `BackupPlan` will be applied. + * Examples include, "compute.googleapis.com/Instance" and + * "storage.googleapis.com/Bucket". + * + * Generated from protobuf field string resource_type = 8 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource_type = ''; + /** + * Optional. `etag` is returned from the service in the response. As a user of + * the service, you may provide an etag value in this field to prevent stale + * resources. + * + * Generated from protobuf field string etag = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + /** + * Required. Resource name of backup vault which will be used as storage + * location for backups. Format: + * projects/{project}/locations/{location}/backupVaults/{backupvault} + * + * Generated from protobuf field string backup_vault = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $backup_vault = ''; + /** + * Output only. The Google Cloud Platform Service Account to be used by the + * BackupVault for taking backups. Specify the email address of the Backup + * Vault Service Account. + * + * Generated from protobuf field string backup_vault_service_account = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $backup_vault_service_account = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Identifier. The resource name of the `BackupPlan`. + * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + * @type string $description + * Optional. The description of the `BackupPlan` resource. + * The description allows for additional details about `BackupPlan` and its + * use cases to be provided. An example description is the following: "This + * is a backup plan that performs a daily backup at 6pm and retains data for 3 + * months". The description must be at most 2048 characters. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. This collection of key/value pairs allows for custom labels to be + * supplied by the user. Example, {"tag": "Weekly"}. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. When the `BackupPlan` was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. When the `BackupPlan` was last updated. + * @type array<\Google\Cloud\BackupDR\V1\BackupRule>|\Google\Protobuf\Internal\RepeatedField $backup_rules + * Required. The backup rules for this `BackupPlan`. There must be at least + * one `BackupRule` message. + * @type int $state + * Output only. The `State` for the `BackupPlan`. + * @type string $resource_type + * Required. The resource type to which the `BackupPlan` will be applied. + * Examples include, "compute.googleapis.com/Instance" and + * "storage.googleapis.com/Bucket". + * @type string $etag + * Optional. `etag` is returned from the service in the response. As a user of + * the service, you may provide an etag value in this field to prevent stale + * resources. + * @type string $backup_vault + * Required. Resource name of backup vault which will be used as storage + * location for backups. Format: + * projects/{project}/locations/{location}/backupVaults/{backupvault} + * @type string $backup_vault_service_account + * Output only. The Google Cloud Platform Service Account to be used by the + * BackupVault for taking backups. Specify the email address of the Backup + * Vault Service Account. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupplan::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Identifier. The resource name of the `BackupPlan`. + * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Identifier. The resource name of the `BackupPlan`. + * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The description of the `BackupPlan` resource. + * The description allows for additional details about `BackupPlan` and its + * use cases to be provided. An example description is the following: "This + * is a backup plan that performs a daily backup at 6pm and retains data for 3 + * months". The description must be at most 2048 characters. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. The description of the `BackupPlan` resource. + * The description allows for additional details about `BackupPlan` and its + * use cases to be provided. An example description is the following: "This + * is a backup plan that performs a daily backup at 6pm and retains data for 3 + * months". The description must be at most 2048 characters. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. This collection of key/value pairs allows for custom labels to be + * supplied by the user. Example, {"tag": "Weekly"}. + * + * Generated from protobuf field map labels = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. This collection of key/value pairs allows for custom labels to be + * supplied by the user. Example, {"tag": "Weekly"}. + * + * Generated from protobuf field map labels = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Output only. When the `BackupPlan` was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. When the `BackupPlan` was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. When the `BackupPlan` was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. When the `BackupPlan` was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Required. The backup rules for this `BackupPlan`. There must be at least + * one `BackupRule` message. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupRule backup_rules = 6 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBackupRules() + { + return $this->backup_rules; + } + + /** + * Required. The backup rules for this `BackupPlan`. There must be at least + * one `BackupRule` message. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupRule backup_rules = 6 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\BackupDR\V1\BackupRule>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBackupRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\BackupRule::class); + $this->backup_rules = $arr; + + return $this; + } + + /** + * Output only. The `State` for the `BackupPlan`. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupPlan.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The `State` for the `BackupPlan`. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupPlan.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\BackupPlan\State::class); + $this->state = $var; + + return $this; + } + + /** + * Required. The resource type to which the `BackupPlan` will be applied. + * Examples include, "compute.googleapis.com/Instance" and + * "storage.googleapis.com/Bucket". + * + * Generated from protobuf field string resource_type = 8 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResourceType() + { + return $this->resource_type; + } + + /** + * Required. The resource type to which the `BackupPlan` will be applied. + * Examples include, "compute.googleapis.com/Instance" and + * "storage.googleapis.com/Bucket". + * + * Generated from protobuf field string resource_type = 8 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResourceType($var) + { + GPBUtil::checkString($var, True); + $this->resource_type = $var; + + return $this; + } + + /** + * Optional. `etag` is returned from the service in the response. As a user of + * the service, you may provide an etag value in this field to prevent stale + * resources. + * + * Generated from protobuf field string etag = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. `etag` is returned from the service in the response. As a user of + * the service, you may provide an etag value in this field to prevent stale + * resources. + * + * Generated from protobuf field string etag = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Required. Resource name of backup vault which will be used as storage + * location for backups. Format: + * projects/{project}/locations/{location}/backupVaults/{backupvault} + * + * Generated from protobuf field string backup_vault = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getBackupVault() + { + return $this->backup_vault; + } + + /** + * Required. Resource name of backup vault which will be used as storage + * location for backups. Format: + * projects/{project}/locations/{location}/backupVaults/{backupvault} + * + * Generated from protobuf field string backup_vault = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setBackupVault($var) + { + GPBUtil::checkString($var, True); + $this->backup_vault = $var; + + return $this; + } + + /** + * Output only. The Google Cloud Platform Service Account to be used by the + * BackupVault for taking backups. Specify the email address of the Backup + * Vault Service Account. + * + * Generated from protobuf field string backup_vault_service_account = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getBackupVaultServiceAccount() + { + return $this->backup_vault_service_account; + } + + /** + * Output only. The Google Cloud Platform Service Account to be used by the + * BackupVault for taking backups. Specify the email address of the Backup + * Vault Service Account. + * + * Generated from protobuf field string backup_vault_service_account = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setBackupVaultServiceAccount($var) + { + GPBUtil::checkString($var, True); + $this->backup_vault_service_account = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/BackupPlan/State.php b/BackupDr/src/V1/BackupPlan/State.php new file mode 100644 index 000000000000..81636c4e541e --- /dev/null +++ b/BackupDr/src/V1/BackupPlan/State.php @@ -0,0 +1,76 @@ +google.cloud.backupdr.v1.BackupPlan.State + */ +class State +{ + /** + * State not set. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The resource is being created. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * The resource has been created and is fully usable. + * + * Generated from protobuf enum ACTIVE = 2; + */ + const ACTIVE = 2; + /** + * The resource is being deleted. + * + * Generated from protobuf enum DELETING = 3; + */ + const DELETING = 3; + /** + * The resource has been created but is not usable. + * + * Generated from protobuf enum INACTIVE = 4; + */ + const INACTIVE = 4; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::ACTIVE => 'ACTIVE', + self::DELETING => 'DELETING', + self::INACTIVE => 'INACTIVE', + ]; + + 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/BackupDr/src/V1/BackupPlanAssociation.php b/BackupDr/src/V1/BackupPlanAssociation.php new file mode 100644 index 000000000000..2a5804c13ae5 --- /dev/null +++ b/BackupDr/src/V1/BackupPlanAssociation.php @@ -0,0 +1,396 @@ +google.cloud.backupdr.v1.BackupPlanAssociation + */ +class BackupPlanAssociation extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Identifier. The resource name of BackupPlanAssociation in + * below format Format : + * projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Optional. Resource type of workload on which backupplan is applied + * + * Generated from protobuf field string resource_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $resource_type = ''; + /** + * Required. Immutable. Resource name of workload on which backupplan is + * applied + * + * Generated from protobuf field string resource = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * Required. Resource name of backup plan which needs to be applied on + * workload. Format: + * projects/{project}/locations/{location}/backupPlans/{backupPlanId} + * + * Generated from protobuf field string backup_plan = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $backup_plan = ''; + /** + * Output only. The time when the instance was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time when the instance was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. The BackupPlanAssociation resource state. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupPlanAssociation.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. The config info related to backup rules. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.RuleConfigInfo rules_config_info = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $rules_config_info; + /** + * Output only. Output Only. + * Resource name of data source which will be used as storage location for + * backups taken. + * Format : + * projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource} + * + * Generated from protobuf field string data_source = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $data_source = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Identifier. The resource name of BackupPlanAssociation in + * below format Format : + * projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId} + * @type string $resource_type + * Optional. Resource type of workload on which backupplan is applied + * @type string $resource + * Required. Immutable. Resource name of workload on which backupplan is + * applied + * @type string $backup_plan + * Required. Resource name of backup plan which needs to be applied on + * workload. Format: + * projects/{project}/locations/{location}/backupPlans/{backupPlanId} + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time when the instance was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The time when the instance was updated. + * @type int $state + * Output only. The BackupPlanAssociation resource state. + * @type array<\Google\Cloud\BackupDR\V1\RuleConfigInfo>|\Google\Protobuf\Internal\RepeatedField $rules_config_info + * Output only. The config info related to backup rules. + * @type string $data_source + * Output only. Output Only. + * Resource name of data source which will be used as storage location for + * backups taken. + * Format : + * projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource} + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupplanassociation::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Identifier. The resource name of BackupPlanAssociation in + * below format Format : + * projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Identifier. The resource name of BackupPlanAssociation in + * below format Format : + * projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Resource type of workload on which backupplan is applied + * + * Generated from protobuf field string resource_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getResourceType() + { + return $this->resource_type; + } + + /** + * Optional. Resource type of workload on which backupplan is applied + * + * Generated from protobuf field string resource_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setResourceType($var) + { + GPBUtil::checkString($var, True); + $this->resource_type = $var; + + return $this; + } + + /** + * Required. Immutable. Resource name of workload on which backupplan is + * applied + * + * Generated from protobuf field string resource = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Required. Immutable. Resource name of workload on which backupplan is + * applied + * + * Generated from protobuf field string resource = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * Required. Resource name of backup plan which needs to be applied on + * workload. Format: + * projects/{project}/locations/{location}/backupPlans/{backupPlanId} + * + * Generated from protobuf field string backup_plan = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getBackupPlan() + { + return $this->backup_plan; + } + + /** + * Required. Resource name of backup plan which needs to be applied on + * workload. Format: + * projects/{project}/locations/{location}/backupPlans/{backupPlanId} + * + * Generated from protobuf field string backup_plan = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setBackupPlan($var) + { + GPBUtil::checkString($var, True); + $this->backup_plan = $var; + + return $this; + } + + /** + * Output only. The time when the instance was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time when the instance was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time when the instance was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The time when the instance was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. The BackupPlanAssociation resource state. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupPlanAssociation.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The BackupPlanAssociation resource state. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupPlanAssociation.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\BackupPlanAssociation\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. The config info related to backup rules. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.RuleConfigInfo rules_config_info = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRulesConfigInfo() + { + return $this->rules_config_info; + } + + /** + * Output only. The config info related to backup rules. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.RuleConfigInfo rules_config_info = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\BackupDR\V1\RuleConfigInfo>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRulesConfigInfo($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\RuleConfigInfo::class); + $this->rules_config_info = $arr; + + return $this; + } + + /** + * Output only. Output Only. + * Resource name of data source which will be used as storage location for + * backups taken. + * Format : + * projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource} + * + * Generated from protobuf field string data_source = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDataSource() + { + return $this->data_source; + } + + /** + * Output only. Output Only. + * Resource name of data source which will be used as storage location for + * backups taken. + * Format : + * projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource} + * + * Generated from protobuf field string data_source = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDataSource($var) + { + GPBUtil::checkString($var, True); + $this->data_source = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/BackupPlanAssociation/State.php b/BackupDr/src/V1/BackupPlanAssociation/State.php new file mode 100644 index 000000000000..5b9acba42bd6 --- /dev/null +++ b/BackupDr/src/V1/BackupPlanAssociation/State.php @@ -0,0 +1,76 @@ +google.cloud.backupdr.v1.BackupPlanAssociation.State + */ +class State +{ + /** + * State not set. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The resource is being created. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * The resource has been created and is fully usable. + * + * Generated from protobuf enum ACTIVE = 2; + */ + const ACTIVE = 2; + /** + * The resource is being deleted. + * + * Generated from protobuf enum DELETING = 3; + */ + const DELETING = 3; + /** + * The resource has been created but is not usable. + * + * Generated from protobuf enum INACTIVE = 4; + */ + const INACTIVE = 4; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::ACTIVE => 'ACTIVE', + self::DELETING => 'DELETING', + self::INACTIVE => 'INACTIVE', + ]; + + 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/BackupDr/src/V1/BackupRule.php b/BackupDr/src/V1/BackupRule.php new file mode 100644 index 000000000000..a66eb5362db0 --- /dev/null +++ b/BackupDr/src/V1/BackupRule.php @@ -0,0 +1,166 @@ +google.cloud.backupdr.v1.BackupRule + */ +class BackupRule extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Immutable. The unique id of this `BackupRule`. The `rule_id` is + * unique per `BackupPlan`.The `rule_id` must start with a lowercase letter + * followed by up to 62 lowercase letters, numbers, or hyphens. Pattern, + * /[a-z][a-z0-9-]{,62}/. + * + * Generated from protobuf field string rule_id = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $rule_id = ''; + /** + * Required. Configures the duration for which backup data will be kept. It is + * defined in “days”. The value should be greater than or equal to minimum + * enforced retention of the backup vault. + * + * Generated from protobuf field int32 backup_retention_days = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backup_retention_days = 0; + protected $backup_schedule_oneof; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $rule_id + * Required. Immutable. The unique id of this `BackupRule`. The `rule_id` is + * unique per `BackupPlan`.The `rule_id` must start with a lowercase letter + * followed by up to 62 lowercase letters, numbers, or hyphens. Pattern, + * /[a-z][a-z0-9-]{,62}/. + * @type int $backup_retention_days + * Required. Configures the duration for which backup data will be kept. It is + * defined in “days”. The value should be greater than or equal to minimum + * enforced retention of the backup vault. + * @type \Google\Cloud\BackupDR\V1\StandardSchedule $standard_schedule + * Required. Defines a schedule that runs within the confines of a defined + * window of time. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupplan::initOnce(); + parent::__construct($data); + } + + /** + * Required. Immutable. The unique id of this `BackupRule`. The `rule_id` is + * unique per `BackupPlan`.The `rule_id` must start with a lowercase letter + * followed by up to 62 lowercase letters, numbers, or hyphens. Pattern, + * /[a-z][a-z0-9-]{,62}/. + * + * Generated from protobuf field string rule_id = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getRuleId() + { + return $this->rule_id; + } + + /** + * Required. Immutable. The unique id of this `BackupRule`. The `rule_id` is + * unique per `BackupPlan`.The `rule_id` must start with a lowercase letter + * followed by up to 62 lowercase letters, numbers, or hyphens. Pattern, + * /[a-z][a-z0-9-]{,62}/. + * + * Generated from protobuf field string rule_id = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setRuleId($var) + { + GPBUtil::checkString($var, True); + $this->rule_id = $var; + + return $this; + } + + /** + * Required. Configures the duration for which backup data will be kept. It is + * defined in “days”. The value should be greater than or equal to minimum + * enforced retention of the backup vault. + * + * Generated from protobuf field int32 backup_retention_days = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getBackupRetentionDays() + { + return $this->backup_retention_days; + } + + /** + * Required. Configures the duration for which backup data will be kept. It is + * defined in “days”. The value should be greater than or equal to minimum + * enforced retention of the backup vault. + * + * Generated from protobuf field int32 backup_retention_days = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setBackupRetentionDays($var) + { + GPBUtil::checkInt32($var); + $this->backup_retention_days = $var; + + return $this; + } + + /** + * Required. Defines a schedule that runs within the confines of a defined + * window of time. + * + * Generated from protobuf field .google.cloud.backupdr.v1.StandardSchedule standard_schedule = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BackupDR\V1\StandardSchedule|null + */ + public function getStandardSchedule() + { + return $this->readOneof(5); + } + + public function hasStandardSchedule() + { + return $this->hasOneof(5); + } + + /** + * Required. Defines a schedule that runs within the confines of a defined + * window of time. + * + * Generated from protobuf field .google.cloud.backupdr.v1.StandardSchedule standard_schedule = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BackupDR\V1\StandardSchedule $var + * @return $this + */ + public function setStandardSchedule($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\StandardSchedule::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * @return string + */ + public function getBackupScheduleOneof() + { + return $this->whichOneof("backup_schedule_oneof"); + } + +} + diff --git a/BackupDr/src/V1/BackupVault.php b/BackupDr/src/V1/BackupVault.php new file mode 100644 index 000000000000..03d965e14bae --- /dev/null +++ b/BackupDr/src/V1/BackupVault.php @@ -0,0 +1,715 @@ +google.cloud.backupdr.v1.BackupVault + */ +class BackupVault extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Identifier. Name of the backup vault to create. It must have + * the + * format`"projects/{project}/locations/{location}/backupVaults/{backupvault}"`. + * `{backupvault}` cannot be changed after creation. It must be between 3-63 + * characters long and must be unique within the project and location. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Optional. The description of the BackupVault instance (2048 characters or + * less). + * + * Generated from protobuf field optional string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = null; + /** + * Optional. Resource labels to represent user provided metadata. + * No labels currently defined: + * + * Generated from protobuf field map labels = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Output only. The time when the instance was created. + * + * Generated from protobuf field optional .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time when the instance was updated. + * + * Generated from protobuf field optional .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Required. The default and minimum enforced retention for each backup within + * the backup vault. The enforced retention for each backup can be extended. + * + * Generated from protobuf field optional .google.protobuf.Duration backup_minimum_enforced_retention_duration = 20 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backup_minimum_enforced_retention_duration = null; + /** + * Output only. Set to true when there are no backups nested under this + * resource. + * + * Generated from protobuf field optional bool deletable = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $deletable = null; + /** + * Optional. Server specified ETag for the backup vault resource to + * prevent simultaneous updates from overwiting each other. + * + * Generated from protobuf field optional string etag = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = null; + /** + * Output only. The BackupVault resource instance state. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupVault.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Optional. Time after which the BackupVault resource is locked. + * + * Generated from protobuf field optional .google.protobuf.Timestamp effective_time = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $effective_time = null; + /** + * Output only. The number of backups in this backup vault. + * + * Generated from protobuf field int64 backup_count = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $backup_count = 0; + /** + * Output only. Service account used by the BackupVault Service for this + * BackupVault. The user should grant this account permissions in their + * workload project to enable the service to run backups and restores there. + * + * Generated from protobuf field string service_account = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $service_account = ''; + /** + * Output only. Total size of the storage used by all backup resources. + * + * Generated from protobuf field int64 total_stored_bytes = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $total_stored_bytes = 0; + /** + * Output only. Output only + * Immutable after resource creation until resource deletion. + * + * Generated from protobuf field string uid = 21 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { + */ + protected $uid = ''; + /** + * Optional. User annotations. See https://google.aip.dev/128#annotations + * Stores small amounts of arbitrary data. + * + * Generated from protobuf field map annotations = 22 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $annotations; + /** + * Optional. Note: This field is added for future use case and will not be + * supported in the current release. + * Optional. + * Access restriction for the backup vault. + * Default value is WITHIN_ORGANIZATION if not provided during creation. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupVault.AccessRestriction access_restriction = 24 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $access_restriction = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Identifier. Name of the backup vault to create. It must have + * the + * format`"projects/{project}/locations/{location}/backupVaults/{backupvault}"`. + * `{backupvault}` cannot be changed after creation. It must be between 3-63 + * characters long and must be unique within the project and location. + * @type string $description + * Optional. The description of the BackupVault instance (2048 characters or + * less). + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Resource labels to represent user provided metadata. + * No labels currently defined: + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time when the instance was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The time when the instance was updated. + * @type \Google\Protobuf\Duration $backup_minimum_enforced_retention_duration + * Required. The default and minimum enforced retention for each backup within + * the backup vault. The enforced retention for each backup can be extended. + * @type bool $deletable + * Output only. Set to true when there are no backups nested under this + * resource. + * @type string $etag + * Optional. Server specified ETag for the backup vault resource to + * prevent simultaneous updates from overwiting each other. + * @type int $state + * Output only. The BackupVault resource instance state. + * @type \Google\Protobuf\Timestamp $effective_time + * Optional. Time after which the BackupVault resource is locked. + * @type int|string $backup_count + * Output only. The number of backups in this backup vault. + * @type string $service_account + * Output only. Service account used by the BackupVault Service for this + * BackupVault. The user should grant this account permissions in their + * workload project to enable the service to run backups and restores there. + * @type int|string $total_stored_bytes + * Output only. Total size of the storage used by all backup resources. + * @type string $uid + * Output only. Output only + * Immutable after resource creation until resource deletion. + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Optional. User annotations. See https://google.aip.dev/128#annotations + * Stores small amounts of arbitrary data. + * @type int $access_restriction + * Optional. Note: This field is added for future use case and will not be + * supported in the current release. + * Optional. + * Access restriction for the backup vault. + * Default value is WITHIN_ORGANIZATION if not provided during creation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Identifier. Name of the backup vault to create. It must have + * the + * format`"projects/{project}/locations/{location}/backupVaults/{backupvault}"`. + * `{backupvault}` cannot be changed after creation. It must be between 3-63 + * characters long and must be unique within the project and location. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Identifier. Name of the backup vault to create. It must have + * the + * format`"projects/{project}/locations/{location}/backupVaults/{backupvault}"`. + * `{backupvault}` cannot be changed after creation. It must be between 3-63 + * characters long and must be unique within the project and location. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The description of the BackupVault instance (2048 characters or + * less). + * + * Generated from protobuf field optional string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * Optional. The description of the BackupVault instance (2048 characters or + * less). + * + * Generated from protobuf field optional string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. Resource labels to represent user provided metadata. + * No labels currently defined: + * + * Generated from protobuf field map labels = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Resource labels to represent user provided metadata. + * No labels currently defined: + * + * Generated from protobuf field map labels = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Output only. The time when the instance was created. + * + * Generated from protobuf field optional .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time when the instance was created. + * + * Generated from protobuf field optional .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time when the instance was updated. + * + * Generated from protobuf field optional .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The time when the instance was updated. + * + * Generated from protobuf field optional .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Required. The default and minimum enforced retention for each backup within + * the backup vault. The enforced retention for each backup can be extended. + * + * Generated from protobuf field optional .google.protobuf.Duration backup_minimum_enforced_retention_duration = 20 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Duration|null + */ + public function getBackupMinimumEnforcedRetentionDuration() + { + return $this->backup_minimum_enforced_retention_duration; + } + + public function hasBackupMinimumEnforcedRetentionDuration() + { + return isset($this->backup_minimum_enforced_retention_duration); + } + + public function clearBackupMinimumEnforcedRetentionDuration() + { + unset($this->backup_minimum_enforced_retention_duration); + } + + /** + * Required. The default and minimum enforced retention for each backup within + * the backup vault. The enforced retention for each backup can be extended. + * + * Generated from protobuf field optional .google.protobuf.Duration backup_minimum_enforced_retention_duration = 20 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setBackupMinimumEnforcedRetentionDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->backup_minimum_enforced_retention_duration = $var; + + return $this; + } + + /** + * Output only. Set to true when there are no backups nested under this + * resource. + * + * Generated from protobuf field optional bool deletable = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getDeletable() + { + return isset($this->deletable) ? $this->deletable : false; + } + + public function hasDeletable() + { + return isset($this->deletable); + } + + public function clearDeletable() + { + unset($this->deletable); + } + + /** + * Output only. Set to true when there are no backups nested under this + * resource. + * + * Generated from protobuf field optional bool deletable = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setDeletable($var) + { + GPBUtil::checkBool($var); + $this->deletable = $var; + + return $this; + } + + /** + * Optional. Server specified ETag for the backup vault resource to + * prevent simultaneous updates from overwiting each other. + * + * Generated from protobuf field optional string etag = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return isset($this->etag) ? $this->etag : ''; + } + + public function hasEtag() + { + return isset($this->etag); + } + + public function clearEtag() + { + unset($this->etag); + } + + /** + * Optional. Server specified ETag for the backup vault resource to + * prevent simultaneous updates from overwiting each other. + * + * Generated from protobuf field optional string etag = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Output only. The BackupVault resource instance state. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupVault.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The BackupVault resource instance state. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupVault.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\BackupVault\State::class); + $this->state = $var; + + return $this; + } + + /** + * Optional. Time after which the BackupVault resource is locked. + * + * Generated from protobuf field optional .google.protobuf.Timestamp effective_time = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEffectiveTime() + { + return $this->effective_time; + } + + public function hasEffectiveTime() + { + return isset($this->effective_time); + } + + public function clearEffectiveTime() + { + unset($this->effective_time); + } + + /** + * Optional. Time after which the BackupVault resource is locked. + * + * Generated from protobuf field optional .google.protobuf.Timestamp effective_time = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEffectiveTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->effective_time = $var; + + return $this; + } + + /** + * Output only. The number of backups in this backup vault. + * + * Generated from protobuf field int64 backup_count = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getBackupCount() + { + return $this->backup_count; + } + + /** + * Output only. The number of backups in this backup vault. + * + * Generated from protobuf field int64 backup_count = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setBackupCount($var) + { + GPBUtil::checkInt64($var); + $this->backup_count = $var; + + return $this; + } + + /** + * Output only. Service account used by the BackupVault Service for this + * BackupVault. The user should grant this account permissions in their + * workload project to enable the service to run backups and restores there. + * + * Generated from protobuf field string service_account = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getServiceAccount() + { + return $this->service_account; + } + + /** + * Output only. Service account used by the BackupVault Service for this + * BackupVault. The user should grant this account permissions in their + * workload project to enable the service to run backups and restores there. + * + * Generated from protobuf field string service_account = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setServiceAccount($var) + { + GPBUtil::checkString($var, True); + $this->service_account = $var; + + return $this; + } + + /** + * Output only. Total size of the storage used by all backup resources. + * + * Generated from protobuf field int64 total_stored_bytes = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getTotalStoredBytes() + { + return $this->total_stored_bytes; + } + + /** + * Output only. Total size of the storage used by all backup resources. + * + * Generated from protobuf field int64 total_stored_bytes = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setTotalStoredBytes($var) + { + GPBUtil::checkInt64($var); + $this->total_stored_bytes = $var; + + return $this; + } + + /** + * Output only. Output only + * Immutable after resource creation until resource deletion. + * + * Generated from protobuf field string uid = 21 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. Output only + * Immutable after resource creation until resource deletion. + * + * Generated from protobuf field string uid = 21 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Optional. User annotations. See https://google.aip.dev/128#annotations + * Stores small amounts of arbitrary data. + * + * Generated from protobuf field map annotations = 22 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Optional. User annotations. See https://google.aip.dev/128#annotations + * Stores small amounts of arbitrary data. + * + * Generated from protobuf field map annotations = 22 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Optional. Note: This field is added for future use case and will not be + * supported in the current release. + * Optional. + * Access restriction for the backup vault. + * Default value is WITHIN_ORGANIZATION if not provided during creation. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupVault.AccessRestriction access_restriction = 24 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getAccessRestriction() + { + return $this->access_restriction; + } + + /** + * Optional. Note: This field is added for future use case and will not be + * supported in the current release. + * Optional. + * Access restriction for the backup vault. + * Default value is WITHIN_ORGANIZATION if not provided during creation. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupVault.AccessRestriction access_restriction = 24 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setAccessRestriction($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\BackupVault\AccessRestriction::class); + $this->access_restriction = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/BackupVault/AccessRestriction.php b/BackupDr/src/V1/BackupVault/AccessRestriction.php new file mode 100644 index 000000000000..a48fa59cab20 --- /dev/null +++ b/BackupDr/src/V1/BackupVault/AccessRestriction.php @@ -0,0 +1,70 @@ +google.cloud.backupdr.v1.BackupVault.AccessRestriction + */ +class AccessRestriction +{ + /** + * Access restriction not set. + * + * Generated from protobuf enum ACCESS_RESTRICTION_UNSPECIFIED = 0; + */ + const ACCESS_RESTRICTION_UNSPECIFIED = 0; + /** + * Access to or from resources outside your current project will be denied. + * + * Generated from protobuf enum WITHIN_PROJECT = 1; + */ + const WITHIN_PROJECT = 1; + /** + * Access to or from resources outside your current organization will be + * denied. + * + * Generated from protobuf enum WITHIN_ORGANIZATION = 2; + */ + const WITHIN_ORGANIZATION = 2; + /** + * No access restriction. + * + * Generated from protobuf enum UNRESTRICTED = 3; + */ + const UNRESTRICTED = 3; + + private static $valueToName = [ + self::ACCESS_RESTRICTION_UNSPECIFIED => 'ACCESS_RESTRICTION_UNSPECIFIED', + self::WITHIN_PROJECT => 'WITHIN_PROJECT', + self::WITHIN_ORGANIZATION => 'WITHIN_ORGANIZATION', + self::UNRESTRICTED => 'UNRESTRICTED', + ]; + + 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/BackupDr/src/V1/BackupVault/State.php b/BackupDr/src/V1/BackupVault/State.php new file mode 100644 index 000000000000..04633e6f97d1 --- /dev/null +++ b/BackupDr/src/V1/BackupVault/State.php @@ -0,0 +1,76 @@ +google.cloud.backupdr.v1.BackupVault.State + */ +class State +{ + /** + * State not set. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The backup vault is being created. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * The backup vault has been created and is fully usable. + * + * Generated from protobuf enum ACTIVE = 2; + */ + const ACTIVE = 2; + /** + * The backup vault is being deleted. + * + * Generated from protobuf enum DELETING = 3; + */ + const DELETING = 3; + /** + * The backup vault is experiencing an issue and might be unusable. + * + * Generated from protobuf enum ERROR = 4; + */ + const ERROR = 4; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::ACTIVE => 'ACTIVE', + self::DELETING => 'DELETING', + self::ERROR => 'ERROR', + ]; + + 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/BackupDr/src/V1/BackupVaultView.php b/BackupDr/src/V1/BackupVaultView.php new file mode 100644 index 000000000000..2fb4c1492dc7 --- /dev/null +++ b/BackupDr/src/V1/BackupVaultView.php @@ -0,0 +1,62 @@ +google.cloud.backupdr.v1.BackupVaultView + */ +class BackupVaultView +{ + /** + * If the value is not set, the default 'FULL' view is used. + * + * Generated from protobuf enum BACKUP_VAULT_VIEW_UNSPECIFIED = 0; + */ + const BACKUP_VAULT_VIEW_UNSPECIFIED = 0; + /** + * Includes basic data about the Backup Vault, but not the full contents. + * + * Generated from protobuf enum BACKUP_VAULT_VIEW_BASIC = 1; + */ + const BACKUP_VAULT_VIEW_BASIC = 1; + /** + * Includes all data about the Backup Vault. + * This is the default value (for both ListBackupVaults and GetBackupVault). + * + * Generated from protobuf enum BACKUP_VAULT_VIEW_FULL = 2; + */ + const BACKUP_VAULT_VIEW_FULL = 2; + + private static $valueToName = [ + self::BACKUP_VAULT_VIEW_UNSPECIFIED => 'BACKUP_VAULT_VIEW_UNSPECIFIED', + self::BACKUP_VAULT_VIEW_BASIC => 'BACKUP_VAULT_VIEW_BASIC', + self::BACKUP_VAULT_VIEW_FULL => 'BACKUP_VAULT_VIEW_FULL', + ]; + + 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/BackupDr/src/V1/BackupView.php b/BackupDr/src/V1/BackupView.php new file mode 100644 index 000000000000..27ea4394600a --- /dev/null +++ b/BackupDr/src/V1/BackupView.php @@ -0,0 +1,62 @@ +google.cloud.backupdr.v1.BackupView + */ +class BackupView +{ + /** + * If the value is not set, the default 'FULL' view is used. + * + * Generated from protobuf enum BACKUP_VIEW_UNSPECIFIED = 0; + */ + const BACKUP_VIEW_UNSPECIFIED = 0; + /** + * Includes basic data about the Backup, but not the full contents. + * + * Generated from protobuf enum BACKUP_VIEW_BASIC = 1; + */ + const BACKUP_VIEW_BASIC = 1; + /** + * Includes all data about the Backup. + * This is the default value (for both ListBackups and GetBackup). + * + * Generated from protobuf enum BACKUP_VIEW_FULL = 2; + */ + const BACKUP_VIEW_FULL = 2; + + private static $valueToName = [ + self::BACKUP_VIEW_UNSPECIFIED => 'BACKUP_VIEW_UNSPECIFIED', + self::BACKUP_VIEW_BASIC => 'BACKUP_VIEW_BASIC', + self::BACKUP_VIEW_FULL => 'BACKUP_VIEW_FULL', + ]; + + 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/BackupDr/src/V1/BackupWindow.php b/BackupDr/src/V1/BackupWindow.php new file mode 100644 index 000000000000..8e4da2ca5064 --- /dev/null +++ b/BackupDr/src/V1/BackupWindow.php @@ -0,0 +1,125 @@ +google.cloud.backupdr.v1.BackupWindow + */ +class BackupWindow extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The hour of day (0-23) when the window starts for e.g. if value + * of start hour of day is 6 that mean backup window start at 6:00. + * + * Generated from protobuf field int32 start_hour_of_day = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $start_hour_of_day = 0; + /** + * Required. The hour of day (1-24) when the window end for e.g. if value of + * end hour of day is 10 that mean backup window end time is 10:00. + * End hour of day should be greater than start hour of day. + * 0 <= start_hour_of_day < end_hour_of_day <= 24 + * End hour of day is not include in backup window that mean if + * end_hour_of_day= 10 jobs should start before 10:00. + * + * Generated from protobuf field int32 end_hour_of_day = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $end_hour_of_day = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $start_hour_of_day + * Required. The hour of day (0-23) when the window starts for e.g. if value + * of start hour of day is 6 that mean backup window start at 6:00. + * @type int $end_hour_of_day + * Required. The hour of day (1-24) when the window end for e.g. if value of + * end hour of day is 10 that mean backup window end time is 10:00. + * End hour of day should be greater than start hour of day. + * 0 <= start_hour_of_day < end_hour_of_day <= 24 + * End hour of day is not include in backup window that mean if + * end_hour_of_day= 10 jobs should start before 10:00. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupplan::initOnce(); + parent::__construct($data); + } + + /** + * Required. The hour of day (0-23) when the window starts for e.g. if value + * of start hour of day is 6 that mean backup window start at 6:00. + * + * Generated from protobuf field int32 start_hour_of_day = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getStartHourOfDay() + { + return $this->start_hour_of_day; + } + + /** + * Required. The hour of day (0-23) when the window starts for e.g. if value + * of start hour of day is 6 that mean backup window start at 6:00. + * + * Generated from protobuf field int32 start_hour_of_day = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setStartHourOfDay($var) + { + GPBUtil::checkInt32($var); + $this->start_hour_of_day = $var; + + return $this; + } + + /** + * Required. The hour of day (1-24) when the window end for e.g. if value of + * end hour of day is 10 that mean backup window end time is 10:00. + * End hour of day should be greater than start hour of day. + * 0 <= start_hour_of_day < end_hour_of_day <= 24 + * End hour of day is not include in backup window that mean if + * end_hour_of_day= 10 jobs should start before 10:00. + * + * Generated from protobuf field int32 end_hour_of_day = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getEndHourOfDay() + { + return $this->end_hour_of_day; + } + + /** + * Required. The hour of day (1-24) when the window end for e.g. if value of + * end hour of day is 10 that mean backup window end time is 10:00. + * End hour of day should be greater than start hour of day. + * 0 <= start_hour_of_day < end_hour_of_day <= 24 + * End hour of day is not include in backup window that mean if + * end_hour_of_day= 10 jobs should start before 10:00. + * + * Generated from protobuf field int32 end_hour_of_day = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setEndHourOfDay($var) + { + GPBUtil::checkInt32($var); + $this->end_hour_of_day = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/Client/BackupDRClient.php b/BackupDr/src/V1/Client/BackupDRClient.php index b3150d620337..05d8d344e49c 100644 --- a/BackupDr/src/V1/Client/BackupDRClient.php +++ b/BackupDr/src/V1/Client/BackupDRClient.php @@ -34,11 +34,39 @@ use Google\ApiCore\Transport\TransportInterface; use Google\ApiCore\ValidationException; use Google\Auth\FetchAuthTokenInterface; +use Google\Cloud\BackupDR\V1\Backup; +use Google\Cloud\BackupDR\V1\BackupPlan; +use Google\Cloud\BackupDR\V1\BackupPlanAssociation; +use Google\Cloud\BackupDR\V1\BackupVault; +use Google\Cloud\BackupDR\V1\CreateBackupPlanAssociationRequest; +use Google\Cloud\BackupDR\V1\CreateBackupPlanRequest; +use Google\Cloud\BackupDR\V1\CreateBackupVaultRequest; use Google\Cloud\BackupDR\V1\CreateManagementServerRequest; +use Google\Cloud\BackupDR\V1\DataSource; +use Google\Cloud\BackupDR\V1\DeleteBackupPlanAssociationRequest; +use Google\Cloud\BackupDR\V1\DeleteBackupPlanRequest; +use Google\Cloud\BackupDR\V1\DeleteBackupRequest; +use Google\Cloud\BackupDR\V1\DeleteBackupVaultRequest; use Google\Cloud\BackupDR\V1\DeleteManagementServerRequest; +use Google\Cloud\BackupDR\V1\FetchUsableBackupVaultsRequest; +use Google\Cloud\BackupDR\V1\GetBackupPlanAssociationRequest; +use Google\Cloud\BackupDR\V1\GetBackupPlanRequest; +use Google\Cloud\BackupDR\V1\GetBackupRequest; +use Google\Cloud\BackupDR\V1\GetBackupVaultRequest; +use Google\Cloud\BackupDR\V1\GetDataSourceRequest; use Google\Cloud\BackupDR\V1\GetManagementServerRequest; +use Google\Cloud\BackupDR\V1\ListBackupPlanAssociationsRequest; +use Google\Cloud\BackupDR\V1\ListBackupPlansRequest; +use Google\Cloud\BackupDR\V1\ListBackupVaultsRequest; +use Google\Cloud\BackupDR\V1\ListBackupsRequest; +use Google\Cloud\BackupDR\V1\ListDataSourcesRequest; use Google\Cloud\BackupDR\V1\ListManagementServersRequest; use Google\Cloud\BackupDR\V1\ManagementServer; +use Google\Cloud\BackupDR\V1\RestoreBackupRequest; +use Google\Cloud\BackupDR\V1\TriggerBackupRequest; +use Google\Cloud\BackupDR\V1\UpdateBackupRequest; +use Google\Cloud\BackupDR\V1\UpdateBackupVaultRequest; +use Google\Cloud\BackupDR\V1\UpdateDataSourceRequest; use Google\Cloud\Iam\V1\GetIamPolicyRequest; use Google\Cloud\Iam\V1\Policy; use Google\Cloud\Iam\V1\SetIamPolicyRequest; @@ -62,10 +90,33 @@ * name, and additionally a parseName method to extract the individual identifiers * contained within formatted names that are returned by the API. * + * @method PromiseInterface createBackupPlanAsync(CreateBackupPlanRequest $request, array $optionalArgs = []) + * @method PromiseInterface createBackupPlanAssociationAsync(CreateBackupPlanAssociationRequest $request, array $optionalArgs = []) + * @method PromiseInterface createBackupVaultAsync(CreateBackupVaultRequest $request, array $optionalArgs = []) * @method PromiseInterface createManagementServerAsync(CreateManagementServerRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteBackupAsync(DeleteBackupRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteBackupPlanAsync(DeleteBackupPlanRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteBackupPlanAssociationAsync(DeleteBackupPlanAssociationRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteBackupVaultAsync(DeleteBackupVaultRequest $request, array $optionalArgs = []) * @method PromiseInterface deleteManagementServerAsync(DeleteManagementServerRequest $request, array $optionalArgs = []) + * @method PromiseInterface fetchUsableBackupVaultsAsync(FetchUsableBackupVaultsRequest $request, array $optionalArgs = []) + * @method PromiseInterface getBackupAsync(GetBackupRequest $request, array $optionalArgs = []) + * @method PromiseInterface getBackupPlanAsync(GetBackupPlanRequest $request, array $optionalArgs = []) + * @method PromiseInterface getBackupPlanAssociationAsync(GetBackupPlanAssociationRequest $request, array $optionalArgs = []) + * @method PromiseInterface getBackupVaultAsync(GetBackupVaultRequest $request, array $optionalArgs = []) + * @method PromiseInterface getDataSourceAsync(GetDataSourceRequest $request, array $optionalArgs = []) * @method PromiseInterface getManagementServerAsync(GetManagementServerRequest $request, array $optionalArgs = []) + * @method PromiseInterface listBackupPlanAssociationsAsync(ListBackupPlanAssociationsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listBackupPlansAsync(ListBackupPlansRequest $request, array $optionalArgs = []) + * @method PromiseInterface listBackupVaultsAsync(ListBackupVaultsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listBackupsAsync(ListBackupsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listDataSourcesAsync(ListDataSourcesRequest $request, array $optionalArgs = []) * @method PromiseInterface listManagementServersAsync(ListManagementServersRequest $request, array $optionalArgs = []) + * @method PromiseInterface restoreBackupAsync(RestoreBackupRequest $request, array $optionalArgs = []) + * @method PromiseInterface triggerBackupAsync(TriggerBackupRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateBackupAsync(UpdateBackupRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateBackupVaultAsync(UpdateBackupVaultRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateDataSourceAsync(UpdateDataSourceRequest $request, array $optionalArgs = []) * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = []) @@ -170,6 +221,119 @@ private function createOperationsClient(array $options) return new OperationsClient($options); } + /** + * Formats a string containing the fully-qualified path to represent a backup + * resource. + * + * @param string $project + * @param string $location + * @param string $backupvault + * @param string $datasource + * @param string $backup + * + * @return string The formatted backup resource. + */ + public static function backupName( + string $project, + string $location, + string $backupvault, + string $datasource, + string $backup + ): string { + return self::getPathTemplate('backup')->render([ + 'project' => $project, + 'location' => $location, + 'backupvault' => $backupvault, + 'datasource' => $datasource, + 'backup' => $backup, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a backup_plan + * resource. + * + * @param string $project + * @param string $location + * @param string $backupPlan + * + * @return string The formatted backup_plan resource. + */ + public static function backupPlanName(string $project, string $location, string $backupPlan): string + { + return self::getPathTemplate('backupPlan')->render([ + 'project' => $project, + 'location' => $location, + 'backup_plan' => $backupPlan, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * backup_plan_association resource. + * + * @param string $project + * @param string $location + * @param string $backupPlanAssociation + * + * @return string The formatted backup_plan_association resource. + */ + public static function backupPlanAssociationName( + string $project, + string $location, + string $backupPlanAssociation + ): string { + return self::getPathTemplate('backupPlanAssociation')->render([ + 'project' => $project, + 'location' => $location, + 'backup_plan_association' => $backupPlanAssociation, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a backup_vault + * resource. + * + * @param string $project + * @param string $location + * @param string $backupvault + * + * @return string The formatted backup_vault resource. + */ + public static function backupVaultName(string $project, string $location, string $backupvault): string + { + return self::getPathTemplate('backupVault')->render([ + 'project' => $project, + 'location' => $location, + 'backupvault' => $backupvault, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a data_source + * resource. + * + * @param string $project + * @param string $location + * @param string $backupvault + * @param string $datasource + * + * @return string The formatted data_source resource. + */ + public static function dataSourceName( + string $project, + string $location, + string $backupvault, + string $datasource + ): string { + return self::getPathTemplate('dataSource')->render([ + 'project' => $project, + 'location' => $location, + 'backupvault' => $backupvault, + 'datasource' => $datasource, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a location * resource. @@ -210,6 +374,11 @@ public static function managementServerName(string $project, string $location, s * Parses a formatted name string and returns an associative array of the components in the name. * The following name formats are supported: * Template: Pattern + * - backup: projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup} + * - backupPlan: projects/{project}/locations/{location}/backupPlans/{backup_plan} + * - backupPlanAssociation: projects/{project}/locations/{location}/backupPlanAssociations/{backup_plan_association} + * - backupVault: projects/{project}/locations/{location}/backupVaults/{backupvault} + * - dataSource: projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource} * - location: projects/{project}/locations/{location} * - managementServer: projects/{project}/locations/{location}/managementServers/{managementserver} * @@ -303,6 +472,86 @@ public function __call($method, $args) return call_user_func_array([$this, 'startAsyncCall'], $args); } + /** + * Create a BackupPlan + * + * The async variant is {@see BackupDRClient::createBackupPlanAsync()} . + * + * @example samples/V1/BackupDRClient/create_backup_plan.php + * + * @param CreateBackupPlanRequest $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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createBackupPlan(CreateBackupPlanRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateBackupPlan', $request, $callOptions)->wait(); + } + + /** + * Create a BackupPlanAssociation + * + * The async variant is {@see BackupDRClient::createBackupPlanAssociationAsync()} . + * + * @example samples/V1/BackupDRClient/create_backup_plan_association.php + * + * @param CreateBackupPlanAssociationRequest $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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createBackupPlanAssociation( + CreateBackupPlanAssociationRequest $request, + array $callOptions = [] + ): OperationResponse { + return $this->startApiCall('CreateBackupPlanAssociation', $request, $callOptions)->wait(); + } + + /** + * Creates a new BackupVault in a given project and location. + * + * The async variant is {@see BackupDRClient::createBackupVaultAsync()} . + * + * @example samples/V1/BackupDRClient/create_backup_vault.php + * + * @param CreateBackupVaultRequest $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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createBackupVault(CreateBackupVaultRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateBackupVault', $request, $callOptions)->wait(); + } + /** * Creates a new ManagementServer in a given project and location. * @@ -331,6 +580,112 @@ public function createManagementServer( return $this->startApiCall('CreateManagementServer', $request, $callOptions)->wait(); } + /** + * Deletes a Backup. + * + * The async variant is {@see BackupDRClient::deleteBackupAsync()} . + * + * @example samples/V1/BackupDRClient/delete_backup.php + * + * @param DeleteBackupRequest $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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteBackup(DeleteBackupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteBackup', $request, $callOptions)->wait(); + } + + /** + * Deletes a single BackupPlan. + * + * The async variant is {@see BackupDRClient::deleteBackupPlanAsync()} . + * + * @example samples/V1/BackupDRClient/delete_backup_plan.php + * + * @param DeleteBackupPlanRequest $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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteBackupPlan(DeleteBackupPlanRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteBackupPlan', $request, $callOptions)->wait(); + } + + /** + * Deletes a single BackupPlanAssociation. + * + * The async variant is {@see BackupDRClient::deleteBackupPlanAssociationAsync()} . + * + * @example samples/V1/BackupDRClient/delete_backup_plan_association.php + * + * @param DeleteBackupPlanAssociationRequest $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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteBackupPlanAssociation( + DeleteBackupPlanAssociationRequest $request, + array $callOptions = [] + ): OperationResponse { + return $this->startApiCall('DeleteBackupPlanAssociation', $request, $callOptions)->wait(); + } + + /** + * Deletes a BackupVault. + * + * The async variant is {@see BackupDRClient::deleteBackupVaultAsync()} . + * + * @example samples/V1/BackupDRClient/delete_backup_vault.php + * + * @param DeleteBackupVaultRequest $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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteBackupVault(DeleteBackupVaultRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteBackupVault', $request, $callOptions)->wait(); + } + /** * Deletes a single ManagementServer. * @@ -359,6 +714,168 @@ public function deleteManagementServer( return $this->startApiCall('DeleteManagementServer', $request, $callOptions)->wait(); } + /** + * FetchUsableBackupVaults lists usable BackupVaults in a given project and + * location. Usable BackupVault are the ones that user has + * backupdr.backupVaults.get permission. + * + * The async variant is {@see BackupDRClient::fetchUsableBackupVaultsAsync()} . + * + * @example samples/V1/BackupDRClient/fetch_usable_backup_vaults.php + * + * @param FetchUsableBackupVaultsRequest $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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function fetchUsableBackupVaults( + FetchUsableBackupVaultsRequest $request, + array $callOptions = [] + ): PagedListResponse { + return $this->startApiCall('FetchUsableBackupVaults', $request, $callOptions); + } + + /** + * Gets details of a Backup. + * + * The async variant is {@see BackupDRClient::getBackupAsync()} . + * + * @example samples/V1/BackupDRClient/get_backup.php + * + * @param GetBackupRequest $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 Backup + * + * @throws ApiException Thrown if the API call fails. + */ + public function getBackup(GetBackupRequest $request, array $callOptions = []): Backup + { + return $this->startApiCall('GetBackup', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single BackupPlan. + * + * The async variant is {@see BackupDRClient::getBackupPlanAsync()} . + * + * @example samples/V1/BackupDRClient/get_backup_plan.php + * + * @param GetBackupPlanRequest $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 BackupPlan + * + * @throws ApiException Thrown if the API call fails. + */ + public function getBackupPlan(GetBackupPlanRequest $request, array $callOptions = []): BackupPlan + { + return $this->startApiCall('GetBackupPlan', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single BackupPlanAssociation. + * + * The async variant is {@see BackupDRClient::getBackupPlanAssociationAsync()} . + * + * @example samples/V1/BackupDRClient/get_backup_plan_association.php + * + * @param GetBackupPlanAssociationRequest $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 BackupPlanAssociation + * + * @throws ApiException Thrown if the API call fails. + */ + public function getBackupPlanAssociation( + GetBackupPlanAssociationRequest $request, + array $callOptions = [] + ): BackupPlanAssociation { + return $this->startApiCall('GetBackupPlanAssociation', $request, $callOptions)->wait(); + } + + /** + * Gets details of a BackupVault. + * + * The async variant is {@see BackupDRClient::getBackupVaultAsync()} . + * + * @example samples/V1/BackupDRClient/get_backup_vault.php + * + * @param GetBackupVaultRequest $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 BackupVault + * + * @throws ApiException Thrown if the API call fails. + */ + public function getBackupVault(GetBackupVaultRequest $request, array $callOptions = []): BackupVault + { + return $this->startApiCall('GetBackupVault', $request, $callOptions)->wait(); + } + + /** + * Gets details of a DataSource. + * + * The async variant is {@see BackupDRClient::getDataSourceAsync()} . + * + * @example samples/V1/BackupDRClient/get_data_source.php + * + * @param GetDataSourceRequest $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 DataSource + * + * @throws ApiException Thrown if the API call fails. + */ + public function getDataSource(GetDataSourceRequest $request, array $callOptions = []): DataSource + { + return $this->startApiCall('GetDataSource', $request, $callOptions)->wait(); + } + /** * Gets details of a single ManagementServer. * @@ -385,6 +902,138 @@ public function getManagementServer(GetManagementServerRequest $request, array $ return $this->startApiCall('GetManagementServer', $request, $callOptions)->wait(); } + /** + * Lists BackupPlanAssociations in a given project and location. + * + * The async variant is {@see BackupDRClient::listBackupPlanAssociationsAsync()} . + * + * @example samples/V1/BackupDRClient/list_backup_plan_associations.php + * + * @param ListBackupPlanAssociationsRequest $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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listBackupPlanAssociations( + ListBackupPlanAssociationsRequest $request, + array $callOptions = [] + ): PagedListResponse { + return $this->startApiCall('ListBackupPlanAssociations', $request, $callOptions); + } + + /** + * Lists BackupPlans in a given project and location. + * + * The async variant is {@see BackupDRClient::listBackupPlansAsync()} . + * + * @example samples/V1/BackupDRClient/list_backup_plans.php + * + * @param ListBackupPlansRequest $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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listBackupPlans(ListBackupPlansRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListBackupPlans', $request, $callOptions); + } + + /** + * Lists BackupVaults in a given project and location. + * + * The async variant is {@see BackupDRClient::listBackupVaultsAsync()} . + * + * @example samples/V1/BackupDRClient/list_backup_vaults.php + * + * @param ListBackupVaultsRequest $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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listBackupVaults(ListBackupVaultsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListBackupVaults', $request, $callOptions); + } + + /** + * Lists Backups in a given project and location. + * + * The async variant is {@see BackupDRClient::listBackupsAsync()} . + * + * @example samples/V1/BackupDRClient/list_backups.php + * + * @param ListBackupsRequest $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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listBackups(ListBackupsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListBackups', $request, $callOptions); + } + + /** + * Lists DataSources in a given project and location. + * + * The async variant is {@see BackupDRClient::listDataSourcesAsync()} . + * + * @example samples/V1/BackupDRClient/list_data_sources.php + * + * @param ListDataSourcesRequest $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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listDataSources(ListDataSourcesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListDataSources', $request, $callOptions); + } + /** * Lists ManagementServers in a given project and location. * @@ -413,6 +1062,136 @@ public function listManagementServers( return $this->startApiCall('ListManagementServers', $request, $callOptions); } + /** + * Restore from a Backup + * + * The async variant is {@see BackupDRClient::restoreBackupAsync()} . + * + * @example samples/V1/BackupDRClient/restore_backup.php + * + * @param RestoreBackupRequest $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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function restoreBackup(RestoreBackupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('RestoreBackup', $request, $callOptions)->wait(); + } + + /** + * Triggers a new Backup. + * + * The async variant is {@see BackupDRClient::triggerBackupAsync()} . + * + * @example samples/V1/BackupDRClient/trigger_backup.php + * + * @param TriggerBackupRequest $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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function triggerBackup(TriggerBackupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('TriggerBackup', $request, $callOptions)->wait(); + } + + /** + * Updates the settings of a Backup. + * + * The async variant is {@see BackupDRClient::updateBackupAsync()} . + * + * @example samples/V1/BackupDRClient/update_backup.php + * + * @param UpdateBackupRequest $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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateBackup(UpdateBackupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateBackup', $request, $callOptions)->wait(); + } + + /** + * Updates the settings of a BackupVault. + * + * The async variant is {@see BackupDRClient::updateBackupVaultAsync()} . + * + * @example samples/V1/BackupDRClient/update_backup_vault.php + * + * @param UpdateBackupVaultRequest $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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateBackupVault(UpdateBackupVaultRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateBackupVault', $request, $callOptions)->wait(); + } + + /** + * Updates the settings of a DataSource. + * + * The async variant is {@see BackupDRClient::updateDataSourceAsync()} . + * + * @example samples/V1/BackupDRClient/update_data_source.php + * + * @param UpdateDataSourceRequest $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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateDataSource(UpdateDataSourceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateDataSource', $request, $callOptions)->wait(); + } + /** * Gets information about a location. * diff --git a/BackupDr/src/V1/ComputeInstanceBackupProperties.php b/BackupDr/src/V1/ComputeInstanceBackupProperties.php new file mode 100644 index 000000000000..8f9a6f915880 --- /dev/null +++ b/BackupDr/src/V1/ComputeInstanceBackupProperties.php @@ -0,0 +1,716 @@ +google.cloud.backupdr.v1.ComputeInstanceBackupProperties + */ +class ComputeInstanceBackupProperties extends \Google\Protobuf\Internal\Message +{ + /** + * An optional text description for the instances that are created from these + * properties. + * + * Generated from protobuf field optional string description = 1; + */ + protected $description = null; + /** + * A list of tags to apply to the instances that are created from these + * properties. The tags identify valid sources or targets for network + * firewalls. The setTags method can modify this list of tags. Each tag within + * the list must comply with RFC1035 (https://www.ietf.org/rfc/rfc1035.txt). + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Tags tags = 2; + */ + protected $tags = null; + /** + * The machine type to use for instances that are created from these + * properties. + * + * Generated from protobuf field optional string machine_type = 3; + */ + protected $machine_type = null; + /** + * Enables instances created based on these properties to send packets with + * source IP addresses other than their own and receive packets with + * destination IP addresses other than their own. If these instances will be + * used as an IP gateway or it will be set as the next-hop in a Route + * resource, specify `true`. If unsure, leave this set to `false`. See the + * https://cloud.google.com/vpc/docs/using-routes#canipforward + * documentation for more information. + * + * Generated from protobuf field optional bool can_ip_forward = 4; + */ + protected $can_ip_forward = null; + /** + * An array of network access configurations for this interface. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.NetworkInterface network_interface = 5; + */ + private $network_interface; + /** + * An array of disks that are associated with the instances that are created + * from these properties. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AttachedDisk disk = 6; + */ + private $disk; + /** + * The metadata key/value pairs to assign to instances that are created from + * these properties. These pairs can consist of custom metadata or predefined + * keys. See https://cloud.google.com/compute/docs/metadata/overview for more + * information. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Metadata metadata = 7; + */ + protected $metadata = null; + /** + * A list of service accounts with specified scopes. Access tokens for these + * service accounts are available to the instances that are created from + * these properties. Use metadata queries to obtain the access tokens for + * these instances. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.ServiceAccount service_account = 8; + */ + private $service_account; + /** + * Specifies the scheduling options for the instances that are created from + * these properties. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Scheduling scheduling = 9; + */ + protected $scheduling = null; + /** + * A list of guest accelerator cards' type and count to use for instances + * created from these properties. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AcceleratorConfig guest_accelerator = 10; + */ + private $guest_accelerator; + /** + * Minimum cpu/platform to be used by instances. The instance may be + * scheduled on the specified or newer cpu/platform. Applicable values are the + * friendly names of CPU platforms, such as + * `minCpuPlatform: Intel Haswell` or `minCpuPlatform: Intel Sandy Bridge`. + * For more information, read + * https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform. + * + * Generated from protobuf field optional string min_cpu_platform = 11; + */ + protected $min_cpu_platform = null; + /** + * KeyRevocationActionType of the instance. Supported options are "STOP" and + * "NONE". The default value is "NONE" if it is not specified. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.KeyRevocationActionType key_revocation_action_type = 12; + */ + protected $key_revocation_action_type = null; + /** + * The source instance used to create this backup. This can be a partial or + * full URL to the resource. For example, the following are valid values: + * -https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance + * -projects/project/zones/zone/instances/instance + * + * Generated from protobuf field optional string source_instance = 13; + */ + protected $source_instance = null; + /** + * Labels to apply to instances that are created from these properties. + * + * Generated from protobuf field map labels = 14; + */ + private $labels; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $description + * An optional text description for the instances that are created from these + * properties. + * @type \Google\Cloud\BackupDR\V1\Tags $tags + * A list of tags to apply to the instances that are created from these + * properties. The tags identify valid sources or targets for network + * firewalls. The setTags method can modify this list of tags. Each tag within + * the list must comply with RFC1035 (https://www.ietf.org/rfc/rfc1035.txt). + * @type string $machine_type + * The machine type to use for instances that are created from these + * properties. + * @type bool $can_ip_forward + * Enables instances created based on these properties to send packets with + * source IP addresses other than their own and receive packets with + * destination IP addresses other than their own. If these instances will be + * used as an IP gateway or it will be set as the next-hop in a Route + * resource, specify `true`. If unsure, leave this set to `false`. See the + * https://cloud.google.com/vpc/docs/using-routes#canipforward + * documentation for more information. + * @type array<\Google\Cloud\BackupDR\V1\NetworkInterface>|\Google\Protobuf\Internal\RepeatedField $network_interface + * An array of network access configurations for this interface. + * @type array<\Google\Cloud\BackupDR\V1\AttachedDisk>|\Google\Protobuf\Internal\RepeatedField $disk + * An array of disks that are associated with the instances that are created + * from these properties. + * @type \Google\Cloud\BackupDR\V1\Metadata $metadata + * The metadata key/value pairs to assign to instances that are created from + * these properties. These pairs can consist of custom metadata or predefined + * keys. See https://cloud.google.com/compute/docs/metadata/overview for more + * information. + * @type array<\Google\Cloud\BackupDR\V1\ServiceAccount>|\Google\Protobuf\Internal\RepeatedField $service_account + * A list of service accounts with specified scopes. Access tokens for these + * service accounts are available to the instances that are created from + * these properties. Use metadata queries to obtain the access tokens for + * these instances. + * @type \Google\Cloud\BackupDR\V1\Scheduling $scheduling + * Specifies the scheduling options for the instances that are created from + * these properties. + * @type array<\Google\Cloud\BackupDR\V1\AcceleratorConfig>|\Google\Protobuf\Internal\RepeatedField $guest_accelerator + * A list of guest accelerator cards' type and count to use for instances + * created from these properties. + * @type string $min_cpu_platform + * Minimum cpu/platform to be used by instances. The instance may be + * scheduled on the specified or newer cpu/platform. Applicable values are the + * friendly names of CPU platforms, such as + * `minCpuPlatform: Intel Haswell` or `minCpuPlatform: Intel Sandy Bridge`. + * For more information, read + * https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform. + * @type int $key_revocation_action_type + * KeyRevocationActionType of the instance. Supported options are "STOP" and + * "NONE". The default value is "NONE" if it is not specified. + * @type string $source_instance + * The source instance used to create this backup. This can be a partial or + * full URL to the resource. For example, the following are valid values: + * -https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance + * -projects/project/zones/zone/instances/instance + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels to apply to instances that are created from these properties. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * An optional text description for the instances that are created from these + * properties. + * + * Generated from protobuf field optional string description = 1; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional text description for the instances that are created from these + * properties. + * + * Generated from protobuf field optional string description = 1; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * A list of tags to apply to the instances that are created from these + * properties. The tags identify valid sources or targets for network + * firewalls. The setTags method can modify this list of tags. Each tag within + * the list must comply with RFC1035 (https://www.ietf.org/rfc/rfc1035.txt). + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Tags tags = 2; + * @return \Google\Cloud\BackupDR\V1\Tags|null + */ + public function getTags() + { + return $this->tags; + } + + public function hasTags() + { + return isset($this->tags); + } + + public function clearTags() + { + unset($this->tags); + } + + /** + * A list of tags to apply to the instances that are created from these + * properties. The tags identify valid sources or targets for network + * firewalls. The setTags method can modify this list of tags. Each tag within + * the list must comply with RFC1035 (https://www.ietf.org/rfc/rfc1035.txt). + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Tags tags = 2; + * @param \Google\Cloud\BackupDR\V1\Tags $var + * @return $this + */ + public function setTags($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\Tags::class); + $this->tags = $var; + + return $this; + } + + /** + * The machine type to use for instances that are created from these + * properties. + * + * Generated from protobuf field optional string machine_type = 3; + * @return string + */ + public function getMachineType() + { + return isset($this->machine_type) ? $this->machine_type : ''; + } + + public function hasMachineType() + { + return isset($this->machine_type); + } + + public function clearMachineType() + { + unset($this->machine_type); + } + + /** + * The machine type to use for instances that are created from these + * properties. + * + * Generated from protobuf field optional string machine_type = 3; + * @param string $var + * @return $this + */ + public function setMachineType($var) + { + GPBUtil::checkString($var, True); + $this->machine_type = $var; + + return $this; + } + + /** + * Enables instances created based on these properties to send packets with + * source IP addresses other than their own and receive packets with + * destination IP addresses other than their own. If these instances will be + * used as an IP gateway or it will be set as the next-hop in a Route + * resource, specify `true`. If unsure, leave this set to `false`. See the + * https://cloud.google.com/vpc/docs/using-routes#canipforward + * documentation for more information. + * + * Generated from protobuf field optional bool can_ip_forward = 4; + * @return bool + */ + public function getCanIpForward() + { + return isset($this->can_ip_forward) ? $this->can_ip_forward : false; + } + + public function hasCanIpForward() + { + return isset($this->can_ip_forward); + } + + public function clearCanIpForward() + { + unset($this->can_ip_forward); + } + + /** + * Enables instances created based on these properties to send packets with + * source IP addresses other than their own and receive packets with + * destination IP addresses other than their own. If these instances will be + * used as an IP gateway or it will be set as the next-hop in a Route + * resource, specify `true`. If unsure, leave this set to `false`. See the + * https://cloud.google.com/vpc/docs/using-routes#canipforward + * documentation for more information. + * + * Generated from protobuf field optional bool can_ip_forward = 4; + * @param bool $var + * @return $this + */ + public function setCanIpForward($var) + { + GPBUtil::checkBool($var); + $this->can_ip_forward = $var; + + return $this; + } + + /** + * An array of network access configurations for this interface. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.NetworkInterface network_interface = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNetworkInterface() + { + return $this->network_interface; + } + + /** + * An array of network access configurations for this interface. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.NetworkInterface network_interface = 5; + * @param array<\Google\Cloud\BackupDR\V1\NetworkInterface>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNetworkInterface($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\NetworkInterface::class); + $this->network_interface = $arr; + + return $this; + } + + /** + * An array of disks that are associated with the instances that are created + * from these properties. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AttachedDisk disk = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDisk() + { + return $this->disk; + } + + /** + * An array of disks that are associated with the instances that are created + * from these properties. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AttachedDisk disk = 6; + * @param array<\Google\Cloud\BackupDR\V1\AttachedDisk>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDisk($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\AttachedDisk::class); + $this->disk = $arr; + + return $this; + } + + /** + * The metadata key/value pairs to assign to instances that are created from + * these properties. These pairs can consist of custom metadata or predefined + * keys. See https://cloud.google.com/compute/docs/metadata/overview for more + * information. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Metadata metadata = 7; + * @return \Google\Cloud\BackupDR\V1\Metadata|null + */ + public function getMetadata() + { + return $this->metadata; + } + + public function hasMetadata() + { + return isset($this->metadata); + } + + public function clearMetadata() + { + unset($this->metadata); + } + + /** + * The metadata key/value pairs to assign to instances that are created from + * these properties. These pairs can consist of custom metadata or predefined + * keys. See https://cloud.google.com/compute/docs/metadata/overview for more + * information. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Metadata metadata = 7; + * @param \Google\Cloud\BackupDR\V1\Metadata $var + * @return $this + */ + public function setMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\Metadata::class); + $this->metadata = $var; + + return $this; + } + + /** + * A list of service accounts with specified scopes. Access tokens for these + * service accounts are available to the instances that are created from + * these properties. Use metadata queries to obtain the access tokens for + * these instances. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.ServiceAccount service_account = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getServiceAccount() + { + return $this->service_account; + } + + /** + * A list of service accounts with specified scopes. Access tokens for these + * service accounts are available to the instances that are created from + * these properties. Use metadata queries to obtain the access tokens for + * these instances. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.ServiceAccount service_account = 8; + * @param array<\Google\Cloud\BackupDR\V1\ServiceAccount>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setServiceAccount($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\ServiceAccount::class); + $this->service_account = $arr; + + return $this; + } + + /** + * Specifies the scheduling options for the instances that are created from + * these properties. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Scheduling scheduling = 9; + * @return \Google\Cloud\BackupDR\V1\Scheduling|null + */ + public function getScheduling() + { + return $this->scheduling; + } + + public function hasScheduling() + { + return isset($this->scheduling); + } + + public function clearScheduling() + { + unset($this->scheduling); + } + + /** + * Specifies the scheduling options for the instances that are created from + * these properties. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Scheduling scheduling = 9; + * @param \Google\Cloud\BackupDR\V1\Scheduling $var + * @return $this + */ + public function setScheduling($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\Scheduling::class); + $this->scheduling = $var; + + return $this; + } + + /** + * A list of guest accelerator cards' type and count to use for instances + * created from these properties. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AcceleratorConfig guest_accelerator = 10; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGuestAccelerator() + { + return $this->guest_accelerator; + } + + /** + * A list of guest accelerator cards' type and count to use for instances + * created from these properties. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AcceleratorConfig guest_accelerator = 10; + * @param array<\Google\Cloud\BackupDR\V1\AcceleratorConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGuestAccelerator($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\AcceleratorConfig::class); + $this->guest_accelerator = $arr; + + return $this; + } + + /** + * Minimum cpu/platform to be used by instances. The instance may be + * scheduled on the specified or newer cpu/platform. Applicable values are the + * friendly names of CPU platforms, such as + * `minCpuPlatform: Intel Haswell` or `minCpuPlatform: Intel Sandy Bridge`. + * For more information, read + * https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform. + * + * Generated from protobuf field optional string min_cpu_platform = 11; + * @return string + */ + public function getMinCpuPlatform() + { + return isset($this->min_cpu_platform) ? $this->min_cpu_platform : ''; + } + + public function hasMinCpuPlatform() + { + return isset($this->min_cpu_platform); + } + + public function clearMinCpuPlatform() + { + unset($this->min_cpu_platform); + } + + /** + * Minimum cpu/platform to be used by instances. The instance may be + * scheduled on the specified or newer cpu/platform. Applicable values are the + * friendly names of CPU platforms, such as + * `minCpuPlatform: Intel Haswell` or `minCpuPlatform: Intel Sandy Bridge`. + * For more information, read + * https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform. + * + * Generated from protobuf field optional string min_cpu_platform = 11; + * @param string $var + * @return $this + */ + public function setMinCpuPlatform($var) + { + GPBUtil::checkString($var, True); + $this->min_cpu_platform = $var; + + return $this; + } + + /** + * KeyRevocationActionType of the instance. Supported options are "STOP" and + * "NONE". The default value is "NONE" if it is not specified. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.KeyRevocationActionType key_revocation_action_type = 12; + * @return int + */ + public function getKeyRevocationActionType() + { + return isset($this->key_revocation_action_type) ? $this->key_revocation_action_type : 0; + } + + public function hasKeyRevocationActionType() + { + return isset($this->key_revocation_action_type); + } + + public function clearKeyRevocationActionType() + { + unset($this->key_revocation_action_type); + } + + /** + * KeyRevocationActionType of the instance. Supported options are "STOP" and + * "NONE". The default value is "NONE" if it is not specified. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.KeyRevocationActionType key_revocation_action_type = 12; + * @param int $var + * @return $this + */ + public function setKeyRevocationActionType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\KeyRevocationActionType::class); + $this->key_revocation_action_type = $var; + + return $this; + } + + /** + * The source instance used to create this backup. This can be a partial or + * full URL to the resource. For example, the following are valid values: + * -https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance + * -projects/project/zones/zone/instances/instance + * + * Generated from protobuf field optional string source_instance = 13; + * @return string + */ + public function getSourceInstance() + { + return isset($this->source_instance) ? $this->source_instance : ''; + } + + public function hasSourceInstance() + { + return isset($this->source_instance); + } + + public function clearSourceInstance() + { + unset($this->source_instance); + } + + /** + * The source instance used to create this backup. This can be a partial or + * full URL to the resource. For example, the following are valid values: + * -https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance + * -projects/project/zones/zone/instances/instance + * + * Generated from protobuf field optional string source_instance = 13; + * @param string $var + * @return $this + */ + public function setSourceInstance($var) + { + GPBUtil::checkString($var, True); + $this->source_instance = $var; + + return $this; + } + + /** + * Labels to apply to instances that are created from these properties. + * + * Generated from protobuf field map labels = 14; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels to apply to instances that are created from these properties. + * + * Generated from protobuf field map labels = 14; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/ComputeInstanceDataSourceProperties.php b/BackupDr/src/V1/ComputeInstanceDataSourceProperties.php new file mode 100644 index 000000000000..28fa438fe071 --- /dev/null +++ b/BackupDr/src/V1/ComputeInstanceDataSourceProperties.php @@ -0,0 +1,204 @@ +google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + */ +class ComputeInstanceDataSourceProperties extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the compute instance backed up by the datasource. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The description of the Compute Engine instance. + * + * Generated from protobuf field string description = 2; + */ + protected $description = ''; + /** + * The machine type of the instance. + * + * Generated from protobuf field string machine_type = 3; + */ + protected $machine_type = ''; + /** + * The total number of disks attached to the Instance. + * + * Generated from protobuf field int64 total_disk_count = 4; + */ + protected $total_disk_count = 0; + /** + * The sum of all the disk sizes. + * + * Generated from protobuf field int64 total_disk_size_gb = 5; + */ + protected $total_disk_size_gb = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Name of the compute instance backed up by the datasource. + * @type string $description + * The description of the Compute Engine instance. + * @type string $machine_type + * The machine type of the instance. + * @type int|string $total_disk_count + * The total number of disks attached to the Instance. + * @type int|string $total_disk_size_gb + * The sum of all the disk sizes. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Name of the compute instance backed up by the datasource. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Name of the compute instance backed up by the datasource. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The description of the Compute Engine instance. + * + * Generated from protobuf field string description = 2; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * The description of the Compute Engine instance. + * + * Generated from protobuf field string description = 2; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * The machine type of the instance. + * + * Generated from protobuf field string machine_type = 3; + * @return string + */ + public function getMachineType() + { + return $this->machine_type; + } + + /** + * The machine type of the instance. + * + * Generated from protobuf field string machine_type = 3; + * @param string $var + * @return $this + */ + public function setMachineType($var) + { + GPBUtil::checkString($var, True); + $this->machine_type = $var; + + return $this; + } + + /** + * The total number of disks attached to the Instance. + * + * Generated from protobuf field int64 total_disk_count = 4; + * @return int|string + */ + public function getTotalDiskCount() + { + return $this->total_disk_count; + } + + /** + * The total number of disks attached to the Instance. + * + * Generated from protobuf field int64 total_disk_count = 4; + * @param int|string $var + * @return $this + */ + public function setTotalDiskCount($var) + { + GPBUtil::checkInt64($var); + $this->total_disk_count = $var; + + return $this; + } + + /** + * The sum of all the disk sizes. + * + * Generated from protobuf field int64 total_disk_size_gb = 5; + * @return int|string + */ + public function getTotalDiskSizeGb() + { + return $this->total_disk_size_gb; + } + + /** + * The sum of all the disk sizes. + * + * Generated from protobuf field int64 total_disk_size_gb = 5; + * @param int|string $var + * @return $this + */ + public function setTotalDiskSizeGb($var) + { + GPBUtil::checkInt64($var); + $this->total_disk_size_gb = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/ComputeInstanceRestoreProperties.php b/BackupDr/src/V1/ComputeInstanceRestoreProperties.php new file mode 100644 index 000000000000..b5ed7b1b9feb --- /dev/null +++ b/BackupDr/src/V1/ComputeInstanceRestoreProperties.php @@ -0,0 +1,1150 @@ +google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + */ +class ComputeInstanceRestoreProperties extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the compute instance. + * + * Generated from protobuf field optional string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = null; + /** + * Optional. Controls for advanced machine-related behavior features. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AdvancedMachineFeatures advanced_machine_features = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $advanced_machine_features = null; + /** + * Optional. Allows this instance to send and receive packets with + * non-matching destination or source IPs. + * + * Generated from protobuf field optional bool can_ip_forward = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $can_ip_forward = null; + /** + * Optional. Controls Confidential compute options on the instance + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.ConfidentialInstanceConfig confidential_instance_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $confidential_instance_config = null; + /** + * Optional. Whether the resource should be protected against deletion. + * + * Generated from protobuf field optional bool deletion_protection = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $deletion_protection = null; + /** + * Optional. An optional description of this resource. Provide this property + * when you create the resource. + * + * Generated from protobuf field optional string description = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = null; + /** + * Optional. Array of disks associated with this instance. Persistent disks + * must be created before you can assign them. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AttachedDisk disks = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $disks; + /** + * Optional. Enables display device for the instance. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.DisplayDevice display_device = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_device = null; + /** + * Optional. A list of the type and count of accelerator cards attached to the + * instance. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AcceleratorConfig guest_accelerators = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $guest_accelerators; + /** + * Optional. Specifies the hostname of the instance. The specified hostname + * must be RFC1035 compliant. If hostname is not specified, the default + * hostname is [INSTANCE_NAME].c.[PROJECT_ID].internal when using the global + * DNS, and [INSTANCE_NAME].[ZONE].c.[PROJECT_ID].internal when using zonal + * DNS. + * + * Generated from protobuf field optional string hostname = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $hostname = null; + /** + * Optional. Encrypts suspended data for an instance with a + * customer-managed encryption key. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.CustomerEncryptionKey instance_encryption_key = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $instance_encryption_key = null; + /** + * Optional. KeyRevocationActionType of the instance. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.KeyRevocationActionType key_revocation_action_type = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $key_revocation_action_type = null; + /** + * Optional. Labels to apply to this instance. + * + * Generated from protobuf field map labels = 13 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Optional. Full or partial URL of the machine type resource to use for this + * instance. + * + * Generated from protobuf field optional string machine_type = 14 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $machine_type = null; + /** + * Optional. This includes custom metadata and predefined keys. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Metadata metadata = 15 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $metadata = null; + /** + * Optional. Minimum CPU platform to use for this instance. + * + * Generated from protobuf field optional string min_cpu_platform = 16 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $min_cpu_platform = null; + /** + * Optional. An array of network configurations for this instance. These + * specify how interfaces are configured to interact with other network + * services, such as connecting to the internet. Multiple interfaces are + * supported per instance. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.NetworkInterface network_interfaces = 17 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $network_interfaces; + /** + * Optional. Configure network performance such as egress bandwidth tier. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.NetworkPerformanceConfig network_performance_config = 18 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $network_performance_config = null; + /** + * Input only. Additional params passed with the request, but not persisted + * as part of resource payload. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.InstanceParams params = 19 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $params = null; + /** + * Optional. The private IPv6 google access type for the VM. + * If not specified, use INHERIT_FROM_SUBNETWORK as default. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess private_ipv6_google_access = 20 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $private_ipv6_google_access = null; + /** + * Optional. Specifies the reservations that this instance can consume from. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AllocationAffinity allocation_affinity = 21 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $allocation_affinity = null; + /** + * Optional. Resource policies applied to this instance. + * + * Generated from protobuf field repeated string resource_policies = 22 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $resource_policies; + /** + * Optional. Sets the scheduling options for this instance. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Scheduling scheduling = 23 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $scheduling = null; + /** + * Optional. A list of service accounts, with their specified scopes, + * authorized for this instance. Only one service account per VM instance is + * supported. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.ServiceAccount service_accounts = 24 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $service_accounts; + /** + * Optional. Tags to apply to this instance. Tags are used to identify valid + * sources or targets for network firewalls and are specified by the client + * during instance creation. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Tags tags = 26 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $tags = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the compute instance. + * @type \Google\Cloud\BackupDR\V1\AdvancedMachineFeatures $advanced_machine_features + * Optional. Controls for advanced machine-related behavior features. + * @type bool $can_ip_forward + * Optional. Allows this instance to send and receive packets with + * non-matching destination or source IPs. + * @type \Google\Cloud\BackupDR\V1\ConfidentialInstanceConfig $confidential_instance_config + * Optional. Controls Confidential compute options on the instance + * @type bool $deletion_protection + * Optional. Whether the resource should be protected against deletion. + * @type string $description + * Optional. An optional description of this resource. Provide this property + * when you create the resource. + * @type array<\Google\Cloud\BackupDR\V1\AttachedDisk>|\Google\Protobuf\Internal\RepeatedField $disks + * Optional. Array of disks associated with this instance. Persistent disks + * must be created before you can assign them. + * @type \Google\Cloud\BackupDR\V1\DisplayDevice $display_device + * Optional. Enables display device for the instance. + * @type array<\Google\Cloud\BackupDR\V1\AcceleratorConfig>|\Google\Protobuf\Internal\RepeatedField $guest_accelerators + * Optional. A list of the type and count of accelerator cards attached to the + * instance. + * @type string $hostname + * Optional. Specifies the hostname of the instance. The specified hostname + * must be RFC1035 compliant. If hostname is not specified, the default + * hostname is [INSTANCE_NAME].c.[PROJECT_ID].internal when using the global + * DNS, and [INSTANCE_NAME].[ZONE].c.[PROJECT_ID].internal when using zonal + * DNS. + * @type \Google\Cloud\BackupDR\V1\CustomerEncryptionKey $instance_encryption_key + * Optional. Encrypts suspended data for an instance with a + * customer-managed encryption key. + * @type int $key_revocation_action_type + * Optional. KeyRevocationActionType of the instance. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Labels to apply to this instance. + * @type string $machine_type + * Optional. Full or partial URL of the machine type resource to use for this + * instance. + * @type \Google\Cloud\BackupDR\V1\Metadata $metadata + * Optional. This includes custom metadata and predefined keys. + * @type string $min_cpu_platform + * Optional. Minimum CPU platform to use for this instance. + * @type array<\Google\Cloud\BackupDR\V1\NetworkInterface>|\Google\Protobuf\Internal\RepeatedField $network_interfaces + * Optional. An array of network configurations for this instance. These + * specify how interfaces are configured to interact with other network + * services, such as connecting to the internet. Multiple interfaces are + * supported per instance. + * @type \Google\Cloud\BackupDR\V1\NetworkPerformanceConfig $network_performance_config + * Optional. Configure network performance such as egress bandwidth tier. + * @type \Google\Cloud\BackupDR\V1\InstanceParams $params + * Input only. Additional params passed with the request, but not persisted + * as part of resource payload. + * @type int $private_ipv6_google_access + * Optional. The private IPv6 google access type for the VM. + * If not specified, use INHERIT_FROM_SUBNETWORK as default. + * @type \Google\Cloud\BackupDR\V1\AllocationAffinity $allocation_affinity + * Optional. Specifies the reservations that this instance can consume from. + * @type array|\Google\Protobuf\Internal\RepeatedField $resource_policies + * Optional. Resource policies applied to this instance. + * @type \Google\Cloud\BackupDR\V1\Scheduling $scheduling + * Optional. Sets the scheduling options for this instance. + * @type array<\Google\Cloud\BackupDR\V1\ServiceAccount>|\Google\Protobuf\Internal\RepeatedField $service_accounts + * Optional. A list of service accounts, with their specified scopes, + * authorized for this instance. Only one service account per VM instance is + * supported. + * @type \Google\Cloud\BackupDR\V1\Tags $tags + * Optional. Tags to apply to this instance. Tags are used to identify valid + * sources or targets for network firewalls and are specified by the client + * during instance creation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the compute instance. + * + * Generated from protobuf field optional string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return isset($this->name) ? $this->name : ''; + } + + public function hasName() + { + return isset($this->name); + } + + public function clearName() + { + unset($this->name); + } + + /** + * Required. Name of the compute instance. + * + * Generated from protobuf field optional string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Controls for advanced machine-related behavior features. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AdvancedMachineFeatures advanced_machine_features = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BackupDR\V1\AdvancedMachineFeatures|null + */ + public function getAdvancedMachineFeatures() + { + return $this->advanced_machine_features; + } + + public function hasAdvancedMachineFeatures() + { + return isset($this->advanced_machine_features); + } + + public function clearAdvancedMachineFeatures() + { + unset($this->advanced_machine_features); + } + + /** + * Optional. Controls for advanced machine-related behavior features. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AdvancedMachineFeatures advanced_machine_features = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BackupDR\V1\AdvancedMachineFeatures $var + * @return $this + */ + public function setAdvancedMachineFeatures($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\AdvancedMachineFeatures::class); + $this->advanced_machine_features = $var; + + return $this; + } + + /** + * Optional. Allows this instance to send and receive packets with + * non-matching destination or source IPs. + * + * Generated from protobuf field optional bool can_ip_forward = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getCanIpForward() + { + return isset($this->can_ip_forward) ? $this->can_ip_forward : false; + } + + public function hasCanIpForward() + { + return isset($this->can_ip_forward); + } + + public function clearCanIpForward() + { + unset($this->can_ip_forward); + } + + /** + * Optional. Allows this instance to send and receive packets with + * non-matching destination or source IPs. + * + * Generated from protobuf field optional bool can_ip_forward = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setCanIpForward($var) + { + GPBUtil::checkBool($var); + $this->can_ip_forward = $var; + + return $this; + } + + /** + * Optional. Controls Confidential compute options on the instance + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.ConfidentialInstanceConfig confidential_instance_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BackupDR\V1\ConfidentialInstanceConfig|null + */ + public function getConfidentialInstanceConfig() + { + return $this->confidential_instance_config; + } + + public function hasConfidentialInstanceConfig() + { + return isset($this->confidential_instance_config); + } + + public function clearConfidentialInstanceConfig() + { + unset($this->confidential_instance_config); + } + + /** + * Optional. Controls Confidential compute options on the instance + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.ConfidentialInstanceConfig confidential_instance_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BackupDR\V1\ConfidentialInstanceConfig $var + * @return $this + */ + public function setConfidentialInstanceConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\ConfidentialInstanceConfig::class); + $this->confidential_instance_config = $var; + + return $this; + } + + /** + * Optional. Whether the resource should be protected against deletion. + * + * Generated from protobuf field optional bool deletion_protection = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getDeletionProtection() + { + return isset($this->deletion_protection) ? $this->deletion_protection : false; + } + + public function hasDeletionProtection() + { + return isset($this->deletion_protection); + } + + public function clearDeletionProtection() + { + unset($this->deletion_protection); + } + + /** + * Optional. Whether the resource should be protected against deletion. + * + * Generated from protobuf field optional bool deletion_protection = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setDeletionProtection($var) + { + GPBUtil::checkBool($var); + $this->deletion_protection = $var; + + return $this; + } + + /** + * Optional. An optional description of this resource. Provide this property + * when you create the resource. + * + * Generated from protobuf field optional string description = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * Optional. An optional description of this resource. Provide this property + * when you create the resource. + * + * Generated from protobuf field optional string description = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. Array of disks associated with this instance. Persistent disks + * must be created before you can assign them. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AttachedDisk disks = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDisks() + { + return $this->disks; + } + + /** + * Optional. Array of disks associated with this instance. Persistent disks + * must be created before you can assign them. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AttachedDisk disks = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\BackupDR\V1\AttachedDisk>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDisks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\AttachedDisk::class); + $this->disks = $arr; + + return $this; + } + + /** + * Optional. Enables display device for the instance. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.DisplayDevice display_device = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BackupDR\V1\DisplayDevice|null + */ + public function getDisplayDevice() + { + return $this->display_device; + } + + public function hasDisplayDevice() + { + return isset($this->display_device); + } + + public function clearDisplayDevice() + { + unset($this->display_device); + } + + /** + * Optional. Enables display device for the instance. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.DisplayDevice display_device = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BackupDR\V1\DisplayDevice $var + * @return $this + */ + public function setDisplayDevice($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\DisplayDevice::class); + $this->display_device = $var; + + return $this; + } + + /** + * Optional. A list of the type and count of accelerator cards attached to the + * instance. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AcceleratorConfig guest_accelerators = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGuestAccelerators() + { + return $this->guest_accelerators; + } + + /** + * Optional. A list of the type and count of accelerator cards attached to the + * instance. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AcceleratorConfig guest_accelerators = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\BackupDR\V1\AcceleratorConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGuestAccelerators($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\AcceleratorConfig::class); + $this->guest_accelerators = $arr; + + return $this; + } + + /** + * Optional. Specifies the hostname of the instance. The specified hostname + * must be RFC1035 compliant. If hostname is not specified, the default + * hostname is [INSTANCE_NAME].c.[PROJECT_ID].internal when using the global + * DNS, and [INSTANCE_NAME].[ZONE].c.[PROJECT_ID].internal when using zonal + * DNS. + * + * Generated from protobuf field optional string hostname = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getHostname() + { + return isset($this->hostname) ? $this->hostname : ''; + } + + public function hasHostname() + { + return isset($this->hostname); + } + + public function clearHostname() + { + unset($this->hostname); + } + + /** + * Optional. Specifies the hostname of the instance. The specified hostname + * must be RFC1035 compliant. If hostname is not specified, the default + * hostname is [INSTANCE_NAME].c.[PROJECT_ID].internal when using the global + * DNS, and [INSTANCE_NAME].[ZONE].c.[PROJECT_ID].internal when using zonal + * DNS. + * + * Generated from protobuf field optional string hostname = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setHostname($var) + { + GPBUtil::checkString($var, True); + $this->hostname = $var; + + return $this; + } + + /** + * Optional. Encrypts suspended data for an instance with a + * customer-managed encryption key. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.CustomerEncryptionKey instance_encryption_key = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BackupDR\V1\CustomerEncryptionKey|null + */ + public function getInstanceEncryptionKey() + { + return $this->instance_encryption_key; + } + + public function hasInstanceEncryptionKey() + { + return isset($this->instance_encryption_key); + } + + public function clearInstanceEncryptionKey() + { + unset($this->instance_encryption_key); + } + + /** + * Optional. Encrypts suspended data for an instance with a + * customer-managed encryption key. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.CustomerEncryptionKey instance_encryption_key = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BackupDR\V1\CustomerEncryptionKey $var + * @return $this + */ + public function setInstanceEncryptionKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\CustomerEncryptionKey::class); + $this->instance_encryption_key = $var; + + return $this; + } + + /** + * Optional. KeyRevocationActionType of the instance. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.KeyRevocationActionType key_revocation_action_type = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getKeyRevocationActionType() + { + return isset($this->key_revocation_action_type) ? $this->key_revocation_action_type : 0; + } + + public function hasKeyRevocationActionType() + { + return isset($this->key_revocation_action_type); + } + + public function clearKeyRevocationActionType() + { + unset($this->key_revocation_action_type); + } + + /** + * Optional. KeyRevocationActionType of the instance. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.KeyRevocationActionType key_revocation_action_type = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setKeyRevocationActionType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\KeyRevocationActionType::class); + $this->key_revocation_action_type = $var; + + return $this; + } + + /** + * Optional. Labels to apply to this instance. + * + * Generated from protobuf field map labels = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Labels to apply to this instance. + * + * Generated from protobuf field map labels = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Optional. Full or partial URL of the machine type resource to use for this + * instance. + * + * Generated from protobuf field optional string machine_type = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getMachineType() + { + return isset($this->machine_type) ? $this->machine_type : ''; + } + + public function hasMachineType() + { + return isset($this->machine_type); + } + + public function clearMachineType() + { + unset($this->machine_type); + } + + /** + * Optional. Full or partial URL of the machine type resource to use for this + * instance. + * + * Generated from protobuf field optional string machine_type = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setMachineType($var) + { + GPBUtil::checkString($var, True); + $this->machine_type = $var; + + return $this; + } + + /** + * Optional. This includes custom metadata and predefined keys. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Metadata metadata = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BackupDR\V1\Metadata|null + */ + public function getMetadata() + { + return $this->metadata; + } + + public function hasMetadata() + { + return isset($this->metadata); + } + + public function clearMetadata() + { + unset($this->metadata); + } + + /** + * Optional. This includes custom metadata and predefined keys. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Metadata metadata = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BackupDR\V1\Metadata $var + * @return $this + */ + public function setMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\Metadata::class); + $this->metadata = $var; + + return $this; + } + + /** + * Optional. Minimum CPU platform to use for this instance. + * + * Generated from protobuf field optional string min_cpu_platform = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getMinCpuPlatform() + { + return isset($this->min_cpu_platform) ? $this->min_cpu_platform : ''; + } + + public function hasMinCpuPlatform() + { + return isset($this->min_cpu_platform); + } + + public function clearMinCpuPlatform() + { + unset($this->min_cpu_platform); + } + + /** + * Optional. Minimum CPU platform to use for this instance. + * + * Generated from protobuf field optional string min_cpu_platform = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setMinCpuPlatform($var) + { + GPBUtil::checkString($var, True); + $this->min_cpu_platform = $var; + + return $this; + } + + /** + * Optional. An array of network configurations for this instance. These + * specify how interfaces are configured to interact with other network + * services, such as connecting to the internet. Multiple interfaces are + * supported per instance. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.NetworkInterface network_interfaces = 17 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNetworkInterfaces() + { + return $this->network_interfaces; + } + + /** + * Optional. An array of network configurations for this instance. These + * specify how interfaces are configured to interact with other network + * services, such as connecting to the internet. Multiple interfaces are + * supported per instance. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.NetworkInterface network_interfaces = 17 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\BackupDR\V1\NetworkInterface>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNetworkInterfaces($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\NetworkInterface::class); + $this->network_interfaces = $arr; + + return $this; + } + + /** + * Optional. Configure network performance such as egress bandwidth tier. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.NetworkPerformanceConfig network_performance_config = 18 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BackupDR\V1\NetworkPerformanceConfig|null + */ + public function getNetworkPerformanceConfig() + { + return $this->network_performance_config; + } + + public function hasNetworkPerformanceConfig() + { + return isset($this->network_performance_config); + } + + public function clearNetworkPerformanceConfig() + { + unset($this->network_performance_config); + } + + /** + * Optional. Configure network performance such as egress bandwidth tier. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.NetworkPerformanceConfig network_performance_config = 18 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BackupDR\V1\NetworkPerformanceConfig $var + * @return $this + */ + public function setNetworkPerformanceConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\NetworkPerformanceConfig::class); + $this->network_performance_config = $var; + + return $this; + } + + /** + * Input only. Additional params passed with the request, but not persisted + * as part of resource payload. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.InstanceParams params = 19 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return \Google\Cloud\BackupDR\V1\InstanceParams|null + */ + public function getParams() + { + return $this->params; + } + + public function hasParams() + { + return isset($this->params); + } + + public function clearParams() + { + unset($this->params); + } + + /** + * Input only. Additional params passed with the request, but not persisted + * as part of resource payload. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.InstanceParams params = 19 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param \Google\Cloud\BackupDR\V1\InstanceParams $var + * @return $this + */ + public function setParams($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\InstanceParams::class); + $this->params = $var; + + return $this; + } + + /** + * Optional. The private IPv6 google access type for the VM. + * If not specified, use INHERIT_FROM_SUBNETWORK as default. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess private_ipv6_google_access = 20 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPrivateIpv6GoogleAccess() + { + return isset($this->private_ipv6_google_access) ? $this->private_ipv6_google_access : 0; + } + + public function hasPrivateIpv6GoogleAccess() + { + return isset($this->private_ipv6_google_access); + } + + public function clearPrivateIpv6GoogleAccess() + { + unset($this->private_ipv6_google_access); + } + + /** + * Optional. The private IPv6 google access type for the VM. + * If not specified, use INHERIT_FROM_SUBNETWORK as default. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess private_ipv6_google_access = 20 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPrivateIpv6GoogleAccess($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\ComputeInstanceRestoreProperties\InstancePrivateIpv6GoogleAccess::class); + $this->private_ipv6_google_access = $var; + + return $this; + } + + /** + * Optional. Specifies the reservations that this instance can consume from. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AllocationAffinity allocation_affinity = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BackupDR\V1\AllocationAffinity|null + */ + public function getAllocationAffinity() + { + return $this->allocation_affinity; + } + + public function hasAllocationAffinity() + { + return isset($this->allocation_affinity); + } + + public function clearAllocationAffinity() + { + unset($this->allocation_affinity); + } + + /** + * Optional. Specifies the reservations that this instance can consume from. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.AllocationAffinity allocation_affinity = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BackupDR\V1\AllocationAffinity $var + * @return $this + */ + public function setAllocationAffinity($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\AllocationAffinity::class); + $this->allocation_affinity = $var; + + return $this; + } + + /** + * Optional. Resource policies applied to this instance. + * + * Generated from protobuf field repeated string resource_policies = 22 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResourcePolicies() + { + return $this->resource_policies; + } + + /** + * Optional. Resource policies applied to this instance. + * + * Generated from protobuf field repeated string resource_policies = 22 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResourcePolicies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->resource_policies = $arr; + + return $this; + } + + /** + * Optional. Sets the scheduling options for this instance. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Scheduling scheduling = 23 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BackupDR\V1\Scheduling|null + */ + public function getScheduling() + { + return $this->scheduling; + } + + public function hasScheduling() + { + return isset($this->scheduling); + } + + public function clearScheduling() + { + unset($this->scheduling); + } + + /** + * Optional. Sets the scheduling options for this instance. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Scheduling scheduling = 23 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BackupDR\V1\Scheduling $var + * @return $this + */ + public function setScheduling($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\Scheduling::class); + $this->scheduling = $var; + + return $this; + } + + /** + * Optional. A list of service accounts, with their specified scopes, + * authorized for this instance. Only one service account per VM instance is + * supported. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.ServiceAccount service_accounts = 24 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getServiceAccounts() + { + return $this->service_accounts; + } + + /** + * Optional. A list of service accounts, with their specified scopes, + * authorized for this instance. Only one service account per VM instance is + * supported. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.ServiceAccount service_accounts = 24 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\BackupDR\V1\ServiceAccount>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setServiceAccounts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\ServiceAccount::class); + $this->service_accounts = $arr; + + return $this; + } + + /** + * Optional. Tags to apply to this instance. Tags are used to identify valid + * sources or targets for network firewalls and are specified by the client + * during instance creation. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Tags tags = 26 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BackupDR\V1\Tags|null + */ + public function getTags() + { + return $this->tags; + } + + public function hasTags() + { + return isset($this->tags); + } + + public function clearTags() + { + unset($this->tags); + } + + /** + * Optional. Tags to apply to this instance. Tags are used to identify valid + * sources or targets for network firewalls and are specified by the client + * during instance creation. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Tags tags = 26 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BackupDR\V1\Tags $var + * @return $this + */ + public function setTags($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\Tags::class); + $this->tags = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/ComputeInstanceRestoreProperties/InstancePrivateIpv6GoogleAccess.php b/BackupDr/src/V1/ComputeInstanceRestoreProperties/InstancePrivateIpv6GoogleAccess.php new file mode 100644 index 000000000000..333ed1ee11a8 --- /dev/null +++ b/BackupDr/src/V1/ComputeInstanceRestoreProperties/InstancePrivateIpv6GoogleAccess.php @@ -0,0 +1,76 @@ +google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess + */ +class InstancePrivateIpv6GoogleAccess +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum INSTANCE_PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED = 0; + */ + const INSTANCE_PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED = 0; + /** + * Each network interface inherits PrivateIpv6GoogleAccess from its + * subnetwork. + * + * Generated from protobuf enum INHERIT_FROM_SUBNETWORK = 1; + */ + const INHERIT_FROM_SUBNETWORK = 1; + /** + * Outbound private IPv6 access from VMs in this subnet to Google services. + * If specified, the subnetwork who is attached to the instance's default + * network interface will be assigned an internal IPv6 prefix if it doesn't + * have before. + * + * Generated from protobuf enum ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE = 2; + */ + const ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE = 2; + /** + * Bidirectional private IPv6 access to/from Google services. If + * specified, the subnetwork who is attached to the instance's default + * network interface will be assigned an internal IPv6 prefix if it doesn't + * have before. + * + * Generated from protobuf enum ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE = 3; + */ + const ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE = 3; + + private static $valueToName = [ + self::INSTANCE_PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED => 'INSTANCE_PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED', + self::INHERIT_FROM_SUBNETWORK => 'INHERIT_FROM_SUBNETWORK', + self::ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE => 'ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE', + self::ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE => 'ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE', + ]; + + 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/BackupDr/src/V1/ComputeInstanceTargetEnvironment.php b/BackupDr/src/V1/ComputeInstanceTargetEnvironment.php new file mode 100644 index 000000000000..6251eea36937 --- /dev/null +++ b/BackupDr/src/V1/ComputeInstanceTargetEnvironment.php @@ -0,0 +1,102 @@ +google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment + */ +class ComputeInstanceTargetEnvironment extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Target project for the Compute Engine instance. + * + * Generated from protobuf field string project = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Required. The zone of the Compute Engine instance. + * + * Generated from protobuf field string zone = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Required. Target project for the Compute Engine instance. + * @type string $zone + * Required. The zone of the Compute Engine instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Required. Target project for the Compute Engine instance. + * + * Generated from protobuf field string project = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getProject() + { + return $this->project; + } + + /** + * Required. Target project for the Compute Engine instance. + * + * Generated from protobuf field string project = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setProject($var) + { + GPBUtil::checkString($var, True); + $this->project = $var; + + return $this; + } + + /** + * Required. The zone of the Compute Engine instance. + * + * Generated from protobuf field string zone = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getZone() + { + return $this->zone; + } + + /** + * Required. The zone of the Compute Engine instance. + * + * Generated from protobuf field string zone = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/ConfidentialInstanceConfig.php b/BackupDr/src/V1/ConfidentialInstanceConfig.php new file mode 100644 index 000000000000..276f5b0eaf46 --- /dev/null +++ b/BackupDr/src/V1/ConfidentialInstanceConfig.php @@ -0,0 +1,81 @@ +google.cloud.backupdr.v1.ConfidentialInstanceConfig + */ +class ConfidentialInstanceConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Defines whether the instance should have confidential compute + * enabled. + * + * Generated from protobuf field optional bool enable_confidential_compute = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_confidential_compute = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enable_confidential_compute + * Optional. Defines whether the instance should have confidential compute + * enabled. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Defines whether the instance should have confidential compute + * enabled. + * + * Generated from protobuf field optional bool enable_confidential_compute = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableConfidentialCompute() + { + return isset($this->enable_confidential_compute) ? $this->enable_confidential_compute : false; + } + + public function hasEnableConfidentialCompute() + { + return isset($this->enable_confidential_compute); + } + + public function clearEnableConfidentialCompute() + { + unset($this->enable_confidential_compute); + } + + /** + * Optional. Defines whether the instance should have confidential compute + * enabled. + * + * Generated from protobuf field optional bool enable_confidential_compute = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableConfidentialCompute($var) + { + GPBUtil::checkBool($var); + $this->enable_confidential_compute = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/CreateBackupPlanAssociationRequest.php b/BackupDr/src/V1/CreateBackupPlanAssociationRequest.php new file mode 100644 index 000000000000..9462d6101471 --- /dev/null +++ b/BackupDr/src/V1/CreateBackupPlanAssociationRequest.php @@ -0,0 +1,252 @@ +google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + */ +class CreateBackupPlanAssociationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The backup plan association project and location in the format + * `projects/{project_id}/locations/{location}`. In Cloud BackupDR locations + * map to GCP regions, for example **us-central1**. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The name of the backup plan association to create. The name must + * be unique for the specified project and location. + * + * Generated from protobuf field string backup_plan_association_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backup_plan_association_id = ''; + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupPlanAssociation backup_plan_association = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backup_plan_association = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + + /** + * @param string $parent Required. The backup plan association project and location in the format + * `projects/{project_id}/locations/{location}`. In Cloud BackupDR locations + * map to GCP regions, for example **us-central1**. Please see + * {@see BackupDRClient::locationName()} for help formatting this field. + * @param \Google\Cloud\BackupDR\V1\BackupPlanAssociation $backupPlanAssociation Required. The resource being created + * @param string $backupPlanAssociationId Required. The name of the backup plan association to create. The name must + * be unique for the specified project and location. + * + * @return \Google\Cloud\BackupDR\V1\CreateBackupPlanAssociationRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\BackupDR\V1\BackupPlanAssociation $backupPlanAssociation, string $backupPlanAssociationId): self + { + return (new self()) + ->setParent($parent) + ->setBackupPlanAssociation($backupPlanAssociation) + ->setBackupPlanAssociationId($backupPlanAssociationId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The backup plan association project and location in the format + * `projects/{project_id}/locations/{location}`. In Cloud BackupDR locations + * map to GCP regions, for example **us-central1**. + * @type string $backup_plan_association_id + * Required. The name of the backup plan association to create. The name must + * be unique for the specified project and location. + * @type \Google\Cloud\BackupDR\V1\BackupPlanAssociation $backup_plan_association + * Required. The resource being created + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupplanassociation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The backup plan association project and location in the format + * `projects/{project_id}/locations/{location}`. In Cloud BackupDR locations + * map to GCP regions, for example **us-central1**. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The backup plan association project and location in the format + * `projects/{project_id}/locations/{location}`. In Cloud BackupDR locations + * map to GCP regions, for example **us-central1**. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The name of the backup plan association to create. The name must + * be unique for the specified project and location. + * + * Generated from protobuf field string backup_plan_association_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBackupPlanAssociationId() + { + return $this->backup_plan_association_id; + } + + /** + * Required. The name of the backup plan association to create. The name must + * be unique for the specified project and location. + * + * Generated from protobuf field string backup_plan_association_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBackupPlanAssociationId($var) + { + GPBUtil::checkString($var, True); + $this->backup_plan_association_id = $var; + + return $this; + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupPlanAssociation backup_plan_association = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BackupDR\V1\BackupPlanAssociation|null + */ + public function getBackupPlanAssociation() + { + return $this->backup_plan_association; + } + + public function hasBackupPlanAssociation() + { + return isset($this->backup_plan_association); + } + + public function clearBackupPlanAssociation() + { + unset($this->backup_plan_association); + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupPlanAssociation backup_plan_association = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BackupDR\V1\BackupPlanAssociation $var + * @return $this + */ + public function setBackupPlanAssociation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\BackupPlanAssociation::class); + $this->backup_plan_association = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/CreateBackupPlanRequest.php b/BackupDr/src/V1/CreateBackupPlanRequest.php new file mode 100644 index 000000000000..f4eeb674fb1f --- /dev/null +++ b/BackupDr/src/V1/CreateBackupPlanRequest.php @@ -0,0 +1,262 @@ +google.cloud.backupdr.v1.CreateBackupPlanRequest + */ +class CreateBackupPlanRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The `BackupPlan` project and location in the format + * `projects/{project}/locations/{location}`. In Cloud BackupDR locations + * map to GCP regions, for example **us-central1**. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The name of the `BackupPlan` to create. The name must be unique + * for the specified project and location.The name must start with a lowercase + * letter followed by up to 62 lowercase letters, numbers, or hyphens. + * Pattern, /[a-z][a-z0-9-]{,62}/. + * + * Generated from protobuf field string backup_plan_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backup_plan_id = ''; + /** + * Required. The `BackupPlan` resource object to create. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupPlan backup_plan = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backup_plan = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + + /** + * @param string $parent Required. The `BackupPlan` project and location in the format + * `projects/{project}/locations/{location}`. In Cloud BackupDR locations + * map to GCP regions, for example **us-central1**. Please see + * {@see BackupDRClient::locationName()} for help formatting this field. + * @param \Google\Cloud\BackupDR\V1\BackupPlan $backupPlan Required. The `BackupPlan` resource object to create. + * @param string $backupPlanId Required. The name of the `BackupPlan` to create. The name must be unique + * for the specified project and location.The name must start with a lowercase + * letter followed by up to 62 lowercase letters, numbers, or hyphens. + * Pattern, /[a-z][a-z0-9-]{,62}/. + * + * @return \Google\Cloud\BackupDR\V1\CreateBackupPlanRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\BackupDR\V1\BackupPlan $backupPlan, string $backupPlanId): self + { + return (new self()) + ->setParent($parent) + ->setBackupPlan($backupPlan) + ->setBackupPlanId($backupPlanId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The `BackupPlan` project and location in the format + * `projects/{project}/locations/{location}`. In Cloud BackupDR locations + * map to GCP regions, for example **us-central1**. + * @type string $backup_plan_id + * Required. The name of the `BackupPlan` to create. The name must be unique + * for the specified project and location.The name must start with a lowercase + * letter followed by up to 62 lowercase letters, numbers, or hyphens. + * Pattern, /[a-z][a-z0-9-]{,62}/. + * @type \Google\Cloud\BackupDR\V1\BackupPlan $backup_plan + * Required. The `BackupPlan` resource object to create. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupplan::initOnce(); + parent::__construct($data); + } + + /** + * Required. The `BackupPlan` project and location in the format + * `projects/{project}/locations/{location}`. In Cloud BackupDR locations + * map to GCP regions, for example **us-central1**. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The `BackupPlan` project and location in the format + * `projects/{project}/locations/{location}`. In Cloud BackupDR locations + * map to GCP regions, for example **us-central1**. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The name of the `BackupPlan` to create. The name must be unique + * for the specified project and location.The name must start with a lowercase + * letter followed by up to 62 lowercase letters, numbers, or hyphens. + * Pattern, /[a-z][a-z0-9-]{,62}/. + * + * Generated from protobuf field string backup_plan_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBackupPlanId() + { + return $this->backup_plan_id; + } + + /** + * Required. The name of the `BackupPlan` to create. The name must be unique + * for the specified project and location.The name must start with a lowercase + * letter followed by up to 62 lowercase letters, numbers, or hyphens. + * Pattern, /[a-z][a-z0-9-]{,62}/. + * + * Generated from protobuf field string backup_plan_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBackupPlanId($var) + { + GPBUtil::checkString($var, True); + $this->backup_plan_id = $var; + + return $this; + } + + /** + * Required. The `BackupPlan` resource object to create. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupPlan backup_plan = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BackupDR\V1\BackupPlan|null + */ + public function getBackupPlan() + { + return $this->backup_plan; + } + + public function hasBackupPlan() + { + return isset($this->backup_plan); + } + + public function clearBackupPlan() + { + unset($this->backup_plan); + } + + /** + * Required. The `BackupPlan` resource object to create. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupPlan backup_plan = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BackupDR\V1\BackupPlan $var + * @return $this + */ + public function setBackupPlan($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\BackupPlan::class); + $this->backup_plan = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/CreateBackupVaultRequest.php b/BackupDr/src/V1/CreateBackupVaultRequest.php new file mode 100644 index 000000000000..39269b8ee810 --- /dev/null +++ b/BackupDr/src/V1/CreateBackupVaultRequest.php @@ -0,0 +1,285 @@ +google.cloud.backupdr.v1.CreateBackupVaultRequest + */ +class CreateBackupVaultRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Value for parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. ID of the requesting object + * If auto-generating ID server-side, remove this field and + * backup_vault_id from the method_signature of Create RPC + * + * Generated from protobuf field string backup_vault_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backup_vault_id = ''; + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupVault backup_vault = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backup_vault = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * @param string $parent Required. Value for parent. Please see + * {@see BackupDRClient::locationName()} for help formatting this field. + * @param \Google\Cloud\BackupDR\V1\BackupVault $backupVault Required. The resource being created + * @param string $backupVaultId Required. ID of the requesting object + * If auto-generating ID server-side, remove this field and + * backup_vault_id from the method_signature of Create RPC + * + * @return \Google\Cloud\BackupDR\V1\CreateBackupVaultRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\BackupDR\V1\BackupVault $backupVault, string $backupVaultId): self + { + return (new self()) + ->setParent($parent) + ->setBackupVault($backupVault) + ->setBackupVaultId($backupVaultId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Value for parent. + * @type string $backup_vault_id + * Required. ID of the requesting object + * If auto-generating ID server-side, remove this field and + * backup_vault_id from the method_signature of Create RPC + * @type \Google\Cloud\BackupDR\V1\BackupVault $backup_vault + * Required. The resource being created + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $validate_only + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Required. Value for parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Value for parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. ID of the requesting object + * If auto-generating ID server-side, remove this field and + * backup_vault_id from the method_signature of Create RPC + * + * Generated from protobuf field string backup_vault_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBackupVaultId() + { + return $this->backup_vault_id; + } + + /** + * Required. ID of the requesting object + * If auto-generating ID server-side, remove this field and + * backup_vault_id from the method_signature of Create RPC + * + * Generated from protobuf field string backup_vault_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBackupVaultId($var) + { + GPBUtil::checkString($var, True); + $this->backup_vault_id = $var; + + return $this; + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupVault backup_vault = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BackupDR\V1\BackupVault|null + */ + public function getBackupVault() + { + return $this->backup_vault; + } + + public function hasBackupVault() + { + return isset($this->backup_vault); + } + + public function clearBackupVault() + { + unset($this->backup_vault); + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupVault backup_vault = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BackupDR\V1\BackupVault $var + * @return $this + */ + public function setBackupVault($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\BackupVault::class); + $this->backup_vault = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/CreateManagementServerRequest.php b/BackupDr/src/V1/CreateManagementServerRequest.php index 4f329ab68f27..a1eb23931ba0 100644 --- a/BackupDr/src/V1/CreateManagementServerRequest.php +++ b/BackupDr/src/V1/CreateManagementServerRequest.php @@ -17,8 +17,8 @@ class CreateManagementServerRequest extends \Google\Protobuf\Internal\Message { /** * Required. The management server project and location in the format - * `projects/{project_id}/locations/{location}`. In Cloud Backup and DR - * locations map to GCP regions, for example **us-central1**. + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR + * locations map to Google Cloud regions, for example **us-central1**. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -56,8 +56,8 @@ class CreateManagementServerRequest extends \Google\Protobuf\Internal\Message /** * @param string $parent Required. The management server project and location in the format - * `projects/{project_id}/locations/{location}`. In Cloud Backup and DR - * locations map to GCP regions, for example **us-central1**. Please see + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR + * locations map to Google Cloud regions, for example **us-central1**. Please see * {@see BackupDRClient::locationName()} for help formatting this field. * @param \Google\Cloud\BackupDR\V1\ManagementServer $managementServer Required. A [management server * resource][google.cloud.backupdr.v1.ManagementServer] @@ -84,8 +84,8 @@ public static function build(string $parent, \Google\Cloud\BackupDR\V1\Managemen * * @type string $parent * Required. The management server project and location in the format - * `projects/{project_id}/locations/{location}`. In Cloud Backup and DR - * locations map to GCP regions, for example **us-central1**. + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR + * locations map to Google Cloud regions, for example **us-central1**. * @type string $management_server_id * Required. The name of the management server to create. The name must be * unique for the specified project and location. @@ -113,8 +113,8 @@ public function __construct($data = NULL) { /** * Required. The management server project and location in the format - * `projects/{project_id}/locations/{location}`. In Cloud Backup and DR - * locations map to GCP regions, for example **us-central1**. + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR + * locations map to Google Cloud regions, for example **us-central1**. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -126,8 +126,8 @@ public function getParent() /** * Required. The management server project and location in the format - * `projects/{project_id}/locations/{location}`. In Cloud Backup and DR - * locations map to GCP regions, for example **us-central1**. + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR + * locations map to Google Cloud regions, for example **us-central1**. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/BackupDr/src/V1/CustomerEncryptionKey.php b/BackupDr/src/V1/CustomerEncryptionKey.php new file mode 100644 index 000000000000..da28ac0861a8 --- /dev/null +++ b/BackupDr/src/V1/CustomerEncryptionKey.php @@ -0,0 +1,205 @@ +google.cloud.backupdr.v1.CustomerEncryptionKey + */ +class CustomerEncryptionKey extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The service account being used for the encryption request for the + * given KMS key. If absent, the Compute Engine default service account is + * used. + * + * Generated from protobuf field optional string kms_key_service_account = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $kms_key_service_account = null; + protected $key; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $raw_key + * Optional. Specifies a 256-bit customer-supplied + * encryption key. + * @type string $rsa_encrypted_key + * Optional. RSA-wrapped 2048-bit + * customer-supplied encryption key to either encrypt or decrypt this + * resource. + * @type string $kms_key_name + * Optional. The name of the encryption key that is stored in Google Cloud + * KMS. + * @type string $kms_key_service_account + * Optional. The service account being used for the encryption request for the + * given KMS key. If absent, the Compute Engine default service account is + * used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Specifies a 256-bit customer-supplied + * encryption key. + * + * Generated from protobuf field string raw_key = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRawKey() + { + return $this->readOneof(1); + } + + public function hasRawKey() + { + return $this->hasOneof(1); + } + + /** + * Optional. Specifies a 256-bit customer-supplied + * encryption key. + * + * Generated from protobuf field string raw_key = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRawKey($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Optional. RSA-wrapped 2048-bit + * customer-supplied encryption key to either encrypt or decrypt this + * resource. + * + * Generated from protobuf field string rsa_encrypted_key = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRsaEncryptedKey() + { + return $this->readOneof(2); + } + + public function hasRsaEncryptedKey() + { + return $this->hasOneof(2); + } + + /** + * Optional. RSA-wrapped 2048-bit + * customer-supplied encryption key to either encrypt or decrypt this + * resource. + * + * Generated from protobuf field string rsa_encrypted_key = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRsaEncryptedKey($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Optional. The name of the encryption key that is stored in Google Cloud + * KMS. + * + * Generated from protobuf field string kms_key_name = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getKmsKeyName() + { + return $this->readOneof(3); + } + + public function hasKmsKeyName() + { + return $this->hasOneof(3); + } + + /** + * Optional. The name of the encryption key that is stored in Google Cloud + * KMS. + * + * Generated from protobuf field string kms_key_name = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setKmsKeyName($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Optional. The service account being used for the encryption request for the + * given KMS key. If absent, the Compute Engine default service account is + * used. + * + * Generated from protobuf field optional string kms_key_service_account = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getKmsKeyServiceAccount() + { + return isset($this->kms_key_service_account) ? $this->kms_key_service_account : ''; + } + + public function hasKmsKeyServiceAccount() + { + return isset($this->kms_key_service_account); + } + + public function clearKmsKeyServiceAccount() + { + unset($this->kms_key_service_account); + } + + /** + * Optional. The service account being used for the encryption request for the + * given KMS key. If absent, the Compute Engine default service account is + * used. + * + * Generated from protobuf field optional string kms_key_service_account = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setKmsKeyServiceAccount($var) + { + GPBUtil::checkString($var, True); + $this->kms_key_service_account = $var; + + return $this; + } + + /** + * @return string + */ + public function getKey() + { + return $this->whichOneof("key"); + } + +} + diff --git a/BackupDr/src/V1/DataSource.php b/BackupDr/src/V1/DataSource.php new file mode 100644 index 000000000000..5522ae4f3952 --- /dev/null +++ b/BackupDr/src/V1/DataSource.php @@ -0,0 +1,543 @@ +google.cloud.backupdr.v1.DataSource + */ +class DataSource extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Identifier. Name of the datasource to create. + * It must have the + * format`"projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}"`. + * `{datasource}` cannot be changed after creation. It must be between 3-63 + * characters long and must be unique within the backup vault. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. The DataSource resource instance state. + * + * Generated from protobuf field .google.cloud.backupdr.v1.DataSource.State state = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Optional. Resource labels to represent user provided metadata. + * No labels currently defined: + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Output only. The time when the instance was created. + * + * Generated from protobuf field optional .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time when the instance was updated. + * + * Generated from protobuf field optional .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Number of backups in the data source. + * + * Generated from protobuf field optional int64 backup_count = 7; + */ + protected $backup_count = null; + /** + * Server specified ETag for the ManagementServer resource to prevent + * simultaneous updates from overwiting each other. + * + * Generated from protobuf field optional string etag = 14; + */ + protected $etag = null; + /** + * The number of bytes (metadata and data) stored in this datasource. + * + * Generated from protobuf field optional int64 total_stored_bytes = 23; + */ + protected $total_stored_bytes = null; + /** + * Output only. The backup configuration state. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupConfigState config_state = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $config_state = 0; + /** + * Output only. Details of how the resource is configured for backup. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupConfigInfo backup_config_info = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $backup_config_info = null; + protected $source_resource; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Identifier. Name of the datasource to create. + * It must have the + * format`"projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}"`. + * `{datasource}` cannot be changed after creation. It must be between 3-63 + * characters long and must be unique within the backup vault. + * @type int $state + * Output only. The DataSource resource instance state. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Resource labels to represent user provided metadata. + * No labels currently defined: + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time when the instance was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The time when the instance was updated. + * @type int|string $backup_count + * Number of backups in the data source. + * @type string $etag + * Server specified ETag for the ManagementServer resource to prevent + * simultaneous updates from overwiting each other. + * @type int|string $total_stored_bytes + * The number of bytes (metadata and data) stored in this datasource. + * @type int $config_state + * Output only. The backup configuration state. + * @type \Google\Cloud\BackupDR\V1\BackupConfigInfo $backup_config_info + * Output only. Details of how the resource is configured for backup. + * @type \Google\Cloud\BackupDR\V1\DataSourceGcpResource $data_source_gcp_resource + * The backed up resource is a Google Cloud resource. + * The word 'DataSource' was included in the names to indicate that this is + * the representation of the Google Cloud resource used within the + * DataSource object. + * @type \Google\Cloud\BackupDR\V1\DataSourceBackupApplianceApplication $data_source_backup_appliance_application + * The backed up resource is a backup appliance application. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Identifier. Name of the datasource to create. + * It must have the + * format`"projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}"`. + * `{datasource}` cannot be changed after creation. It must be between 3-63 + * characters long and must be unique within the backup vault. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Identifier. Name of the datasource to create. + * It must have the + * format`"projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}"`. + * `{datasource}` cannot be changed after creation. It must be between 3-63 + * characters long and must be unique within the backup vault. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The DataSource resource instance state. + * + * Generated from protobuf field .google.cloud.backupdr.v1.DataSource.State state = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The DataSource resource instance state. + * + * Generated from protobuf field .google.cloud.backupdr.v1.DataSource.State state = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\DataSource\State::class); + $this->state = $var; + + return $this; + } + + /** + * Optional. Resource labels to represent user provided metadata. + * No labels currently defined: + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Resource labels to represent user provided metadata. + * No labels currently defined: + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Output only. The time when the instance was created. + * + * Generated from protobuf field optional .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time when the instance was created. + * + * Generated from protobuf field optional .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time when the instance was updated. + * + * Generated from protobuf field optional .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The time when the instance was updated. + * + * Generated from protobuf field optional .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Number of backups in the data source. + * + * Generated from protobuf field optional int64 backup_count = 7; + * @return int|string + */ + public function getBackupCount() + { + return isset($this->backup_count) ? $this->backup_count : 0; + } + + public function hasBackupCount() + { + return isset($this->backup_count); + } + + public function clearBackupCount() + { + unset($this->backup_count); + } + + /** + * Number of backups in the data source. + * + * Generated from protobuf field optional int64 backup_count = 7; + * @param int|string $var + * @return $this + */ + public function setBackupCount($var) + { + GPBUtil::checkInt64($var); + $this->backup_count = $var; + + return $this; + } + + /** + * Server specified ETag for the ManagementServer resource to prevent + * simultaneous updates from overwiting each other. + * + * Generated from protobuf field optional string etag = 14; + * @return string + */ + public function getEtag() + { + return isset($this->etag) ? $this->etag : ''; + } + + public function hasEtag() + { + return isset($this->etag); + } + + public function clearEtag() + { + unset($this->etag); + } + + /** + * Server specified ETag for the ManagementServer resource to prevent + * simultaneous updates from overwiting each other. + * + * Generated from protobuf field optional string etag = 14; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * The number of bytes (metadata and data) stored in this datasource. + * + * Generated from protobuf field optional int64 total_stored_bytes = 23; + * @return int|string + */ + public function getTotalStoredBytes() + { + return isset($this->total_stored_bytes) ? $this->total_stored_bytes : 0; + } + + public function hasTotalStoredBytes() + { + return isset($this->total_stored_bytes); + } + + public function clearTotalStoredBytes() + { + unset($this->total_stored_bytes); + } + + /** + * The number of bytes (metadata and data) stored in this datasource. + * + * Generated from protobuf field optional int64 total_stored_bytes = 23; + * @param int|string $var + * @return $this + */ + public function setTotalStoredBytes($var) + { + GPBUtil::checkInt64($var); + $this->total_stored_bytes = $var; + + return $this; + } + + /** + * Output only. The backup configuration state. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupConfigState config_state = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getConfigState() + { + return $this->config_state; + } + + /** + * Output only. The backup configuration state. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupConfigState config_state = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setConfigState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\BackupConfigState::class); + $this->config_state = $var; + + return $this; + } + + /** + * Output only. Details of how the resource is configured for backup. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupConfigInfo backup_config_info = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\BackupDR\V1\BackupConfigInfo|null + */ + public function getBackupConfigInfo() + { + return $this->backup_config_info; + } + + public function hasBackupConfigInfo() + { + return isset($this->backup_config_info); + } + + public function clearBackupConfigInfo() + { + unset($this->backup_config_info); + } + + /** + * Output only. Details of how the resource is configured for backup. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupConfigInfo backup_config_info = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\BackupDR\V1\BackupConfigInfo $var + * @return $this + */ + public function setBackupConfigInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\BackupConfigInfo::class); + $this->backup_config_info = $var; + + return $this; + } + + /** + * The backed up resource is a Google Cloud resource. + * The word 'DataSource' was included in the names to indicate that this is + * the representation of the Google Cloud resource used within the + * DataSource object. + * + * Generated from protobuf field .google.cloud.backupdr.v1.DataSourceGcpResource data_source_gcp_resource = 26; + * @return \Google\Cloud\BackupDR\V1\DataSourceGcpResource|null + */ + public function getDataSourceGcpResource() + { + return $this->readOneof(26); + } + + public function hasDataSourceGcpResource() + { + return $this->hasOneof(26); + } + + /** + * The backed up resource is a Google Cloud resource. + * The word 'DataSource' was included in the names to indicate that this is + * the representation of the Google Cloud resource used within the + * DataSource object. + * + * Generated from protobuf field .google.cloud.backupdr.v1.DataSourceGcpResource data_source_gcp_resource = 26; + * @param \Google\Cloud\BackupDR\V1\DataSourceGcpResource $var + * @return $this + */ + public function setDataSourceGcpResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\DataSourceGcpResource::class); + $this->writeOneof(26, $var); + + return $this; + } + + /** + * The backed up resource is a backup appliance application. + * + * Generated from protobuf field .google.cloud.backupdr.v1.DataSourceBackupApplianceApplication data_source_backup_appliance_application = 27; + * @return \Google\Cloud\BackupDR\V1\DataSourceBackupApplianceApplication|null + */ + public function getDataSourceBackupApplianceApplication() + { + return $this->readOneof(27); + } + + public function hasDataSourceBackupApplianceApplication() + { + return $this->hasOneof(27); + } + + /** + * The backed up resource is a backup appliance application. + * + * Generated from protobuf field .google.cloud.backupdr.v1.DataSourceBackupApplianceApplication data_source_backup_appliance_application = 27; + * @param \Google\Cloud\BackupDR\V1\DataSourceBackupApplianceApplication $var + * @return $this + */ + public function setDataSourceBackupApplianceApplication($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\DataSourceBackupApplianceApplication::class); + $this->writeOneof(27, $var); + + return $this; + } + + /** + * @return string + */ + public function getSourceResource() + { + return $this->whichOneof("source_resource"); + } + +} + diff --git a/BackupDr/src/V1/DataSource/State.php b/BackupDr/src/V1/DataSource/State.php new file mode 100644 index 000000000000..900f3b1ef95a --- /dev/null +++ b/BackupDr/src/V1/DataSource/State.php @@ -0,0 +1,76 @@ +google.cloud.backupdr.v1.DataSource.State + */ +class State +{ + /** + * State not set. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The data source is being created. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * The data source has been created and is fully usable. + * + * Generated from protobuf enum ACTIVE = 2; + */ + const ACTIVE = 2; + /** + * The data source is being deleted. + * + * Generated from protobuf enum DELETING = 3; + */ + const DELETING = 3; + /** + * The data source is experiencing an issue and might be unusable. + * + * Generated from protobuf enum ERROR = 4; + */ + const ERROR = 4; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::ACTIVE => 'ACTIVE', + self::DELETING => 'DELETING', + self::ERROR => 'ERROR', + ]; + + 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/BackupDr/src/V1/DataSourceBackupApplianceApplication.php b/BackupDr/src/V1/DataSourceBackupApplianceApplication.php new file mode 100644 index 000000000000..07e5a34b90f2 --- /dev/null +++ b/BackupDr/src/V1/DataSourceBackupApplianceApplication.php @@ -0,0 +1,272 @@ +google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + */ +class DataSourceBackupApplianceApplication extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the Application as known to the Backup Appliance. + * + * Generated from protobuf field string application_name = 1; + */ + protected $application_name = ''; + /** + * Appliance name. + * + * Generated from protobuf field string backup_appliance = 2; + */ + protected $backup_appliance = ''; + /** + * Appliance Id of the Backup Appliance. + * + * Generated from protobuf field int64 appliance_id = 3; + */ + protected $appliance_id = 0; + /** + * The type of the application. e.g. VMBackup + * + * Generated from protobuf field string type = 4; + */ + protected $type = ''; + /** + * The appid field of the application within the Backup Appliance. + * + * Generated from protobuf field int64 application_id = 8; + */ + protected $application_id = 0; + /** + * Hostname of the host where the application is running. + * + * Generated from protobuf field string hostname = 6; + */ + protected $hostname = ''; + /** + * Hostid of the application host. + * + * Generated from protobuf field int64 host_id = 7; + */ + protected $host_id = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $application_name + * The name of the Application as known to the Backup Appliance. + * @type string $backup_appliance + * Appliance name. + * @type int|string $appliance_id + * Appliance Id of the Backup Appliance. + * @type string $type + * The type of the application. e.g. VMBackup + * @type int|string $application_id + * The appid field of the application within the Backup Appliance. + * @type string $hostname + * Hostname of the host where the application is running. + * @type int|string $host_id + * Hostid of the application host. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * The name of the Application as known to the Backup Appliance. + * + * Generated from protobuf field string application_name = 1; + * @return string + */ + public function getApplicationName() + { + return $this->application_name; + } + + /** + * The name of the Application as known to the Backup Appliance. + * + * Generated from protobuf field string application_name = 1; + * @param string $var + * @return $this + */ + public function setApplicationName($var) + { + GPBUtil::checkString($var, True); + $this->application_name = $var; + + return $this; + } + + /** + * Appliance name. + * + * Generated from protobuf field string backup_appliance = 2; + * @return string + */ + public function getBackupAppliance() + { + return $this->backup_appliance; + } + + /** + * Appliance name. + * + * Generated from protobuf field string backup_appliance = 2; + * @param string $var + * @return $this + */ + public function setBackupAppliance($var) + { + GPBUtil::checkString($var, True); + $this->backup_appliance = $var; + + return $this; + } + + /** + * Appliance Id of the Backup Appliance. + * + * Generated from protobuf field int64 appliance_id = 3; + * @return int|string + */ + public function getApplianceId() + { + return $this->appliance_id; + } + + /** + * Appliance Id of the Backup Appliance. + * + * Generated from protobuf field int64 appliance_id = 3; + * @param int|string $var + * @return $this + */ + public function setApplianceId($var) + { + GPBUtil::checkInt64($var); + $this->appliance_id = $var; + + return $this; + } + + /** + * The type of the application. e.g. VMBackup + * + * Generated from protobuf field string type = 4; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * The type of the application. e.g. VMBackup + * + * Generated from protobuf field string type = 4; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * The appid field of the application within the Backup Appliance. + * + * Generated from protobuf field int64 application_id = 8; + * @return int|string + */ + public function getApplicationId() + { + return $this->application_id; + } + + /** + * The appid field of the application within the Backup Appliance. + * + * Generated from protobuf field int64 application_id = 8; + * @param int|string $var + * @return $this + */ + public function setApplicationId($var) + { + GPBUtil::checkInt64($var); + $this->application_id = $var; + + return $this; + } + + /** + * Hostname of the host where the application is running. + * + * Generated from protobuf field string hostname = 6; + * @return string + */ + public function getHostname() + { + return $this->hostname; + } + + /** + * Hostname of the host where the application is running. + * + * Generated from protobuf field string hostname = 6; + * @param string $var + * @return $this + */ + public function setHostname($var) + { + GPBUtil::checkString($var, True); + $this->hostname = $var; + + return $this; + } + + /** + * Hostid of the application host. + * + * Generated from protobuf field int64 host_id = 7; + * @return int|string + */ + public function getHostId() + { + return $this->host_id; + } + + /** + * Hostid of the application host. + * + * Generated from protobuf field int64 host_id = 7; + * @param int|string $var + * @return $this + */ + public function setHostId($var) + { + GPBUtil::checkInt64($var); + $this->host_id = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/DataSourceGcpResource.php b/BackupDr/src/V1/DataSourceGcpResource.php new file mode 100644 index 000000000000..dfd4a646d3ee --- /dev/null +++ b/BackupDr/src/V1/DataSourceGcpResource.php @@ -0,0 +1,190 @@ +google.cloud.backupdr.v1.DataSourceGcpResource + */ +class DataSourceGcpResource extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Full resource pathname URL of the source Google Cloud + * resource. + * + * Generated from protobuf field string gcp_resourcename = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $gcp_resourcename = ''; + /** + * Location of the resource: //"global"/"unspecified". + * + * Generated from protobuf field string location = 2; + */ + protected $location = ''; + /** + * The type of the Google Cloud resource. Use the Unified Resource Type, + * eg. compute.googleapis.com/Instance. + * + * Generated from protobuf field string type = 3; + */ + protected $type = ''; + protected $gcp_resource_properties; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $gcp_resourcename + * Output only. Full resource pathname URL of the source Google Cloud + * resource. + * @type string $location + * Location of the resource: //"global"/"unspecified". + * @type string $type + * The type of the Google Cloud resource. Use the Unified Resource Type, + * eg. compute.googleapis.com/Instance. + * @type \Google\Cloud\BackupDR\V1\ComputeInstanceDataSourceProperties $compute_instance_datasource_properties + * ComputeInstanceDataSourceProperties has a subset of Compute Instance + * properties that are useful at the Datasource level. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Full resource pathname URL of the source Google Cloud + * resource. + * + * Generated from protobuf field string gcp_resourcename = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getGcpResourcename() + { + return $this->gcp_resourcename; + } + + /** + * Output only. Full resource pathname URL of the source Google Cloud + * resource. + * + * Generated from protobuf field string gcp_resourcename = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setGcpResourcename($var) + { + GPBUtil::checkString($var, True); + $this->gcp_resourcename = $var; + + return $this; + } + + /** + * Location of the resource: //"global"/"unspecified". + * + * Generated from protobuf field string location = 2; + * @return string + */ + public function getLocation() + { + return $this->location; + } + + /** + * Location of the resource: //"global"/"unspecified". + * + * Generated from protobuf field string location = 2; + * @param string $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkString($var, True); + $this->location = $var; + + return $this; + } + + /** + * The type of the Google Cloud resource. Use the Unified Resource Type, + * eg. compute.googleapis.com/Instance. + * + * Generated from protobuf field string type = 3; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * The type of the Google Cloud resource. Use the Unified Resource Type, + * eg. compute.googleapis.com/Instance. + * + * Generated from protobuf field string type = 3; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * ComputeInstanceDataSourceProperties has a subset of Compute Instance + * properties that are useful at the Datasource level. + * + * Generated from protobuf field .google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties compute_instance_datasource_properties = 4; + * @return \Google\Cloud\BackupDR\V1\ComputeInstanceDataSourceProperties|null + */ + public function getComputeInstanceDatasourceProperties() + { + return $this->readOneof(4); + } + + public function hasComputeInstanceDatasourceProperties() + { + return $this->hasOneof(4); + } + + /** + * ComputeInstanceDataSourceProperties has a subset of Compute Instance + * properties that are useful at the Datasource level. + * + * Generated from protobuf field .google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties compute_instance_datasource_properties = 4; + * @param \Google\Cloud\BackupDR\V1\ComputeInstanceDataSourceProperties $var + * @return $this + */ + public function setComputeInstanceDatasourceProperties($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\ComputeInstanceDataSourceProperties::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getGcpResourceProperties() + { + return $this->whichOneof("gcp_resource_properties"); + } + +} + diff --git a/BackupDr/src/V1/DeleteBackupPlanAssociationRequest.php b/BackupDr/src/V1/DeleteBackupPlanAssociationRequest.php new file mode 100644 index 000000000000..d89d4149bfa5 --- /dev/null +++ b/BackupDr/src/V1/DeleteBackupPlanAssociationRequest.php @@ -0,0 +1,160 @@ +google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest + */ +class DeleteBackupPlanAssociationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + + /** + * @param string $name Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + * Please see {@see BackupDRClient::backupPlanAssociationName()} for help formatting this field. + * + * @return \Google\Cloud\BackupDR\V1\DeleteBackupPlanAssociationRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupplanassociation::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/DeleteBackupPlanRequest.php b/BackupDr/src/V1/DeleteBackupPlanRequest.php new file mode 100644 index 000000000000..33d0f577a1de --- /dev/null +++ b/BackupDr/src/V1/DeleteBackupPlanRequest.php @@ -0,0 +1,161 @@ +google.cloud.backupdr.v1.DeleteBackupPlanRequest + */ +class DeleteBackupPlanRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the `BackupPlan` to delete. + * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + + /** + * @param string $name Required. The resource name of the `BackupPlan` to delete. + * + * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + * Please see {@see BackupDRClient::backupPlanName()} for help formatting this field. + * + * @return \Google\Cloud\BackupDR\V1\DeleteBackupPlanRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the `BackupPlan` to delete. + * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupplan::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the `BackupPlan` to delete. + * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the `BackupPlan` to delete. + * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/DeleteBackupRequest.php b/BackupDr/src/V1/DeleteBackupRequest.php new file mode 100644 index 000000000000..d3b5a8223f9c --- /dev/null +++ b/BackupDr/src/V1/DeleteBackupRequest.php @@ -0,0 +1,155 @@ +google.cloud.backupdr.v1.DeleteBackupRequest + */ +class DeleteBackupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + + /** + * @param string $name Required. Name of the resource. Please see + * {@see BackupDRClient::backupName()} for help formatting this field. + * + * @return \Google\Cloud\BackupDR\V1\DeleteBackupRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/DeleteBackupVaultRequest.php b/BackupDr/src/V1/DeleteBackupVaultRequest.php new file mode 100644 index 000000000000..2408f02e4d27 --- /dev/null +++ b/BackupDr/src/V1/DeleteBackupVaultRequest.php @@ -0,0 +1,311 @@ +google.cloud.backupdr.v1.DeleteBackupVaultRequest + */ +class DeleteBackupVaultRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + /** + * Optional. If set to true, any data source from this backup vault will also + * be deleted. + * + * Generated from protobuf field bool force = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $force = false; + /** + * The current etag of the backup vault. + * If an etag is provided and does not match the current etag of the + * connection, deletion will be blocked. + * + * Generated from protobuf field string etag = 4; + */ + protected $etag = ''; + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + /** + * Optional. If true and the BackupVault is not found, the request will + * succeed but no action will be taken. + * + * Generated from protobuf field bool allow_missing = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $allow_missing = false; + + /** + * @param string $name Required. Name of the resource. Please see + * {@see BackupDRClient::backupVaultName()} for help formatting this field. + * + * @return \Google\Cloud\BackupDR\V1\DeleteBackupVaultRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $force + * Optional. If set to true, any data source from this backup vault will also + * be deleted. + * @type string $etag + * The current etag of the backup vault. + * If an etag is provided and does not match the current etag of the + * connection, deletion will be blocked. + * @type bool $validate_only + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + * @type bool $allow_missing + * Optional. If true and the BackupVault is not found, the request will + * succeed but no action will be taken. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set to true, any data source from this backup vault will also + * be deleted. + * + * Generated from protobuf field bool force = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getForce() + { + return $this->force; + } + + /** + * Optional. If set to true, any data source from this backup vault will also + * be deleted. + * + * Generated from protobuf field bool force = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setForce($var) + { + GPBUtil::checkBool($var); + $this->force = $var; + + return $this; + } + + /** + * The current etag of the backup vault. + * If an etag is provided and does not match the current etag of the + * connection, deletion will be blocked. + * + * Generated from protobuf field string etag = 4; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * The current etag of the backup vault. + * If an etag is provided and does not match the current etag of the + * connection, deletion will be blocked. + * + * Generated from protobuf field string etag = 4; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * Optional. If true and the BackupVault is not found, the request will + * succeed but no action will be taken. + * + * Generated from protobuf field bool allow_missing = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * Optional. If true and the BackupVault is not found, the request will + * succeed but no action will be taken. + * + * Generated from protobuf field bool allow_missing = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/DisplayDevice.php b/BackupDr/src/V1/DisplayDevice.php new file mode 100644 index 000000000000..fd3d2d33844d --- /dev/null +++ b/BackupDr/src/V1/DisplayDevice.php @@ -0,0 +1,77 @@ +google.cloud.backupdr.v1.DisplayDevice + */ +class DisplayDevice extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Enables display for the Compute Engine VM + * + * Generated from protobuf field optional bool enable_display = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_display = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enable_display + * Optional. Enables display for the Compute Engine VM + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Enables display for the Compute Engine VM + * + * Generated from protobuf field optional bool enable_display = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableDisplay() + { + return isset($this->enable_display) ? $this->enable_display : false; + } + + public function hasEnableDisplay() + { + return isset($this->enable_display); + } + + public function clearEnableDisplay() + { + unset($this->enable_display); + } + + /** + * Optional. Enables display for the Compute Engine VM + * + * Generated from protobuf field optional bool enable_display = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableDisplay($var) + { + GPBUtil::checkBool($var); + $this->enable_display = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/Entry.php b/BackupDr/src/V1/Entry.php new file mode 100644 index 000000000000..43f3558be810 --- /dev/null +++ b/BackupDr/src/V1/Entry.php @@ -0,0 +1,133 @@ +google.cloud.backupdr.v1.Entry + */ +class Entry extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Key for the metadata entry. + * + * Generated from protobuf field optional string key = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $key = null; + /** + * Optional. Value for the metadata entry. These are free-form strings, and + * only have meaning as interpreted by the image running in the instance. The + * only restriction placed on values is that their size must be less than + * or equal to 262144 bytes (256 KiB). + * + * Generated from protobuf field optional string value = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key + * Optional. Key for the metadata entry. + * @type string $value + * Optional. Value for the metadata entry. These are free-form strings, and + * only have meaning as interpreted by the image running in the instance. The + * only restriction placed on values is that their size must be less than + * or equal to 262144 bytes (256 KiB). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Key for the metadata entry. + * + * Generated from protobuf field optional string key = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getKey() + { + return isset($this->key) ? $this->key : ''; + } + + public function hasKey() + { + return isset($this->key); + } + + public function clearKey() + { + unset($this->key); + } + + /** + * Optional. Key for the metadata entry. + * + * Generated from protobuf field optional string key = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->key = $var; + + return $this; + } + + /** + * Optional. Value for the metadata entry. These are free-form strings, and + * only have meaning as interpreted by the image running in the instance. The + * only restriction placed on values is that their size must be less than + * or equal to 262144 bytes (256 KiB). + * + * Generated from protobuf field optional string value = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getValue() + { + return isset($this->value) ? $this->value : ''; + } + + public function hasValue() + { + return isset($this->value); + } + + public function clearValue() + { + unset($this->value); + } + + /** + * Optional. Value for the metadata entry. These are free-form strings, and + * only have meaning as interpreted by the image running in the instance. The + * only restriction placed on values is that their size must be less than + * or equal to 262144 bytes (256 KiB). + * + * Generated from protobuf field optional string value = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/FetchUsableBackupVaultsRequest.php b/BackupDr/src/V1/FetchUsableBackupVaultsRequest.php new file mode 100644 index 000000000000..142606583a7a --- /dev/null +++ b/BackupDr/src/V1/FetchUsableBackupVaultsRequest.php @@ -0,0 +1,246 @@ +google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + */ +class FetchUsableBackupVaultsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. Please see + * {@see BackupDRClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\BackupDR\V1\FetchUsableBackupVaultsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. + * @type int $page_size + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @type string $page_token + * Optional. A token identifying a page of results the server should return. + * @type string $filter + * Optional. Filtering results. + * @type string $order_by + * Optional. Hint for how to order the results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/FetchUsableBackupVaultsResponse.php b/BackupDr/src/V1/FetchUsableBackupVaultsResponse.php new file mode 100644 index 000000000000..058334542e91 --- /dev/null +++ b/BackupDr/src/V1/FetchUsableBackupVaultsResponse.php @@ -0,0 +1,159 @@ +google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse + */ +class FetchUsableBackupVaultsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of BackupVault instances in the project for the specified + * location. + * If the '{location}' value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return backup vaults in reachable locations and + * the 'unreachable' field will be populated with a list of unreachable + * locations. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupVault backup_vaults = 1; + */ + private $backup_vaults; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BackupDR\V1\BackupVault>|\Google\Protobuf\Internal\RepeatedField $backup_vaults + * The list of BackupVault instances in the project for the specified + * location. + * If the '{location}' value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return backup vaults in reachable locations and + * the 'unreachable' field will be populated with a list of unreachable + * locations. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * The list of BackupVault instances in the project for the specified + * location. + * If the '{location}' value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return backup vaults in reachable locations and + * the 'unreachable' field will be populated with a list of unreachable + * locations. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupVault backup_vaults = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBackupVaults() + { + return $this->backup_vaults; + } + + /** + * The list of BackupVault instances in the project for the specified + * location. + * If the '{location}' value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return backup vaults in reachable locations and + * the 'unreachable' field will be populated with a list of unreachable + * locations. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupVault backup_vaults = 1; + * @param array<\Google\Cloud\BackupDR\V1\BackupVault>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBackupVaults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\BackupVault::class); + $this->backup_vaults = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/GcpBackupConfig.php b/BackupDr/src/V1/GcpBackupConfig.php new file mode 100644 index 000000000000..5e8d78bb7496 --- /dev/null +++ b/BackupDr/src/V1/GcpBackupConfig.php @@ -0,0 +1,171 @@ +google.cloud.backupdr.v1.GcpBackupConfig + */ +class GcpBackupConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the backup plan. + * + * Generated from protobuf field string backup_plan = 1 [(.google.api.resource_reference) = { + */ + protected $backup_plan = ''; + /** + * The description of the backup plan. + * + * Generated from protobuf field string backup_plan_description = 2; + */ + protected $backup_plan_description = ''; + /** + * The name of the backup plan association. + * + * Generated from protobuf field string backup_plan_association = 3 [(.google.api.resource_reference) = { + */ + protected $backup_plan_association = ''; + /** + * The names of the backup plan rules which point to this backupvault + * + * Generated from protobuf field repeated string backup_plan_rules = 4; + */ + private $backup_plan_rules; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $backup_plan + * The name of the backup plan. + * @type string $backup_plan_description + * The description of the backup plan. + * @type string $backup_plan_association + * The name of the backup plan association. + * @type array|\Google\Protobuf\Internal\RepeatedField $backup_plan_rules + * The names of the backup plan rules which point to this backupvault + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * The name of the backup plan. + * + * Generated from protobuf field string backup_plan = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getBackupPlan() + { + return $this->backup_plan; + } + + /** + * The name of the backup plan. + * + * Generated from protobuf field string backup_plan = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setBackupPlan($var) + { + GPBUtil::checkString($var, True); + $this->backup_plan = $var; + + return $this; + } + + /** + * The description of the backup plan. + * + * Generated from protobuf field string backup_plan_description = 2; + * @return string + */ + public function getBackupPlanDescription() + { + return $this->backup_plan_description; + } + + /** + * The description of the backup plan. + * + * Generated from protobuf field string backup_plan_description = 2; + * @param string $var + * @return $this + */ + public function setBackupPlanDescription($var) + { + GPBUtil::checkString($var, True); + $this->backup_plan_description = $var; + + return $this; + } + + /** + * The name of the backup plan association. + * + * Generated from protobuf field string backup_plan_association = 3 [(.google.api.resource_reference) = { + * @return string + */ + public function getBackupPlanAssociation() + { + return $this->backup_plan_association; + } + + /** + * The name of the backup plan association. + * + * Generated from protobuf field string backup_plan_association = 3 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setBackupPlanAssociation($var) + { + GPBUtil::checkString($var, True); + $this->backup_plan_association = $var; + + return $this; + } + + /** + * The names of the backup plan rules which point to this backupvault + * + * Generated from protobuf field repeated string backup_plan_rules = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBackupPlanRules() + { + return $this->backup_plan_rules; + } + + /** + * The names of the backup plan rules which point to this backupvault + * + * Generated from protobuf field repeated string backup_plan_rules = 4; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBackupPlanRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->backup_plan_rules = $arr; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/GcpResource.php b/BackupDr/src/V1/GcpResource.php new file mode 100644 index 000000000000..dd1322beaae1 --- /dev/null +++ b/BackupDr/src/V1/GcpResource.php @@ -0,0 +1,139 @@ +google.cloud.backupdr.v1.GcpResource + */ +class GcpResource extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the Google Cloud resource. + * + * Generated from protobuf field string gcp_resourcename = 1; + */ + protected $gcp_resourcename = ''; + /** + * Location of the resource: //"global"/"unspecified". + * + * Generated from protobuf field string location = 2; + */ + protected $location = ''; + /** + * Type of the resource. Use the Unified Resource Type, + * eg. compute.googleapis.com/Instance. + * + * Generated from protobuf field string type = 3; + */ + protected $type = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $gcp_resourcename + * Name of the Google Cloud resource. + * @type string $location + * Location of the resource: //"global"/"unspecified". + * @type string $type + * Type of the resource. Use the Unified Resource Type, + * eg. compute.googleapis.com/Instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Name of the Google Cloud resource. + * + * Generated from protobuf field string gcp_resourcename = 1; + * @return string + */ + public function getGcpResourcename() + { + return $this->gcp_resourcename; + } + + /** + * Name of the Google Cloud resource. + * + * Generated from protobuf field string gcp_resourcename = 1; + * @param string $var + * @return $this + */ + public function setGcpResourcename($var) + { + GPBUtil::checkString($var, True); + $this->gcp_resourcename = $var; + + return $this; + } + + /** + * Location of the resource: //"global"/"unspecified". + * + * Generated from protobuf field string location = 2; + * @return string + */ + public function getLocation() + { + return $this->location; + } + + /** + * Location of the resource: //"global"/"unspecified". + * + * Generated from protobuf field string location = 2; + * @param string $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkString($var, True); + $this->location = $var; + + return $this; + } + + /** + * Type of the resource. Use the Unified Resource Type, + * eg. compute.googleapis.com/Instance. + * + * Generated from protobuf field string type = 3; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * Type of the resource. Use the Unified Resource Type, + * eg. compute.googleapis.com/Instance. + * + * Generated from protobuf field string type = 3; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/GetBackupPlanAssociationRequest.php b/BackupDr/src/V1/GetBackupPlanAssociationRequest.php new file mode 100644 index 000000000000..e17c8ba0816d --- /dev/null +++ b/BackupDr/src/V1/GetBackupPlanAssociationRequest.php @@ -0,0 +1,86 @@ +google.cloud.backupdr.v1.GetBackupPlanAssociationRequest + */ +class GetBackupPlanAssociationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + * Please see {@see BackupDRClient::backupPlanAssociationName()} for help formatting this field. + * + * @return \Google\Cloud\BackupDR\V1\GetBackupPlanAssociationRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupplanassociation::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/GetBackupPlanRequest.php b/BackupDr/src/V1/GetBackupPlanRequest.php new file mode 100644 index 000000000000..5af2986cc0d1 --- /dev/null +++ b/BackupDr/src/V1/GetBackupPlanRequest.php @@ -0,0 +1,87 @@ +google.cloud.backupdr.v1.GetBackupPlanRequest + */ +class GetBackupPlanRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the `BackupPlan` to retrieve. + * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the `BackupPlan` to retrieve. + * + * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + * Please see {@see BackupDRClient::backupPlanName()} for help formatting this field. + * + * @return \Google\Cloud\BackupDR\V1\GetBackupPlanRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the `BackupPlan` to retrieve. + * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupplan::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the `BackupPlan` to retrieve. + * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the `BackupPlan` to retrieve. + * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/GetBackupRequest.php b/BackupDr/src/V1/GetBackupRequest.php new file mode 100644 index 000000000000..cef977871e55 --- /dev/null +++ b/BackupDr/src/V1/GetBackupRequest.php @@ -0,0 +1,124 @@ +google.cloud.backupdr.v1.GetBackupRequest + */ +class GetBackupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the data source resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{backupVault}/dataSources/{datasource}/backups/{backup}' + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * resource. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $view = 0; + + /** + * @param string $name Required. Name of the data source resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{backupVault}/dataSources/{datasource}/backups/{backup}' + * Please see {@see BackupDRClient::backupName()} for help formatting this field. + * + * @return \Google\Cloud\BackupDR\V1\GetBackupRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the data source resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{backupVault}/dataSources/{datasource}/backups/{backup}' + * @type int $view + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the data source resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{backupVault}/dataSources/{datasource}/backups/{backup}' + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the data source resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{backupVault}/dataSources/{datasource}/backups/{backup}' + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * resource. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * resource. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\BackupView::class); + $this->view = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/GetBackupVaultRequest.php b/BackupDr/src/V1/GetBackupVaultRequest.php new file mode 100644 index 000000000000..de3959298ba2 --- /dev/null +++ b/BackupDr/src/V1/GetBackupVaultRequest.php @@ -0,0 +1,124 @@ +google.cloud.backupdr.v1.GetBackupVaultRequest + */ +class GetBackupVaultRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the backupvault store resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}' + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * Vault + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupVaultView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $view = 0; + + /** + * @param string $name Required. Name of the backupvault store resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}' + * Please see {@see BackupDRClient::backupVaultName()} for help formatting this field. + * + * @return \Google\Cloud\BackupDR\V1\GetBackupVaultRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the backupvault store resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}' + * @type int $view + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * Vault + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the backupvault store resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}' + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the backupvault store resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}' + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * Vault + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupVaultView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * Vault + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupVaultView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\BackupVaultView::class); + $this->view = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/GetDataSourceRequest.php b/BackupDr/src/V1/GetDataSourceRequest.php new file mode 100644 index 000000000000..27f9c86ff9b1 --- /dev/null +++ b/BackupDr/src/V1/GetDataSourceRequest.php @@ -0,0 +1,86 @@ +google.cloud.backupdr.v1.GetDataSourceRequest + */ +class GetDataSourceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the data source resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}/dataSource/{resource_name}' + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the data source resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}/dataSource/{resource_name}' + * Please see {@see BackupDRClient::dataSourceName()} for help formatting this field. + * + * @return \Google\Cloud\BackupDR\V1\GetDataSourceRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the data source resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}/dataSource/{resource_name}' + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the data source resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}/dataSource/{resource_name}' + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the data source resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}/dataSource/{resource_name}' + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/GetManagementServerRequest.php b/BackupDr/src/V1/GetManagementServerRequest.php index 4787333aa02d..7c83be3986fc 100644 --- a/BackupDr/src/V1/GetManagementServerRequest.php +++ b/BackupDr/src/V1/GetManagementServerRequest.php @@ -17,7 +17,7 @@ class GetManagementServerRequest extends \Google\Protobuf\Internal\Message { /** * Required. Name of the management server resource name, in the format - * `projects/{project_id}/locations/{location}/managementServers/{resource_name}` + * 'projects/{project_id}/locations/{location}/managementServers/{resource_name}' * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -25,7 +25,7 @@ class GetManagementServerRequest extends \Google\Protobuf\Internal\Message /** * @param string $name Required. Name of the management server resource name, in the format - * `projects/{project_id}/locations/{location}/managementServers/{resource_name}` + * 'projects/{project_id}/locations/{location}/managementServers/{resource_name}' * Please see {@see BackupDRClient::managementServerName()} for help formatting this field. * * @return \Google\Cloud\BackupDR\V1\GetManagementServerRequest @@ -46,7 +46,7 @@ public static function build(string $name): self * * @type string $name * Required. Name of the management server resource name, in the format - * `projects/{project_id}/locations/{location}/managementServers/{resource_name}` + * 'projects/{project_id}/locations/{location}/managementServers/{resource_name}' * } */ public function __construct($data = NULL) { @@ -56,7 +56,7 @@ public function __construct($data = NULL) { /** * Required. Name of the management server resource name, in the format - * `projects/{project_id}/locations/{location}/managementServers/{resource_name}` + * 'projects/{project_id}/locations/{location}/managementServers/{resource_name}' * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -68,7 +68,7 @@ public function getName() /** * Required. Name of the management server resource name, in the format - * `projects/{project_id}/locations/{location}/managementServers/{resource_name}` + * 'projects/{project_id}/locations/{location}/managementServers/{resource_name}' * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/BackupDr/src/V1/GuestOsFeature.php b/BackupDr/src/V1/GuestOsFeature.php new file mode 100644 index 000000000000..93d51da05752 --- /dev/null +++ b/BackupDr/src/V1/GuestOsFeature.php @@ -0,0 +1,77 @@ +google.cloud.backupdr.v1.GuestOsFeature + */ +class GuestOsFeature extends \Google\Protobuf\Internal\Message +{ + /** + * The ID of a supported feature. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.GuestOsFeature.FeatureType type = 1; + */ + protected $type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $type + * The ID of a supported feature. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * The ID of a supported feature. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.GuestOsFeature.FeatureType type = 1; + * @return int + */ + public function getType() + { + return isset($this->type) ? $this->type : 0; + } + + public function hasType() + { + return isset($this->type); + } + + public function clearType() + { + unset($this->type); + } + + /** + * The ID of a supported feature. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.GuestOsFeature.FeatureType type = 1; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\GuestOsFeature\FeatureType::class); + $this->type = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/GuestOsFeature/FeatureType.php b/BackupDr/src/V1/GuestOsFeature/FeatureType.php new file mode 100644 index 000000000000..dae448e1271f --- /dev/null +++ b/BackupDr/src/V1/GuestOsFeature/FeatureType.php @@ -0,0 +1,146 @@ +google.cloud.backupdr.v1.GuestOsFeature.FeatureType + */ +class FeatureType +{ + /** + * Default value, which is unused. + * + * Generated from protobuf enum FEATURE_TYPE_UNSPECIFIED = 0; + */ + const FEATURE_TYPE_UNSPECIFIED = 0; + /** + * VIRTIO_SCSI_MULTIQUEUE feature type. + * + * Generated from protobuf enum VIRTIO_SCSI_MULTIQUEUE = 1; + */ + const VIRTIO_SCSI_MULTIQUEUE = 1; + /** + * WINDOWS feature type. + * + * Generated from protobuf enum WINDOWS = 2; + */ + const WINDOWS = 2; + /** + * MULTI_IP_SUBNET feature type. + * + * Generated from protobuf enum MULTI_IP_SUBNET = 3; + */ + const MULTI_IP_SUBNET = 3; + /** + * UEFI_COMPATIBLE feature type. + * + * Generated from protobuf enum UEFI_COMPATIBLE = 4; + */ + const UEFI_COMPATIBLE = 4; + /** + * SECURE_BOOT feature type. + * + * Generated from protobuf enum SECURE_BOOT = 5; + */ + const SECURE_BOOT = 5; + /** + * GVNIC feature type. + * + * Generated from protobuf enum GVNIC = 6; + */ + const GVNIC = 6; + /** + * SEV_CAPABLE feature type. + * + * Generated from protobuf enum SEV_CAPABLE = 7; + */ + const SEV_CAPABLE = 7; + /** + * BARE_METAL_LINUX_COMPATIBLE feature type. + * + * Generated from protobuf enum BARE_METAL_LINUX_COMPATIBLE = 8; + */ + const BARE_METAL_LINUX_COMPATIBLE = 8; + /** + * SUSPEND_RESUME_COMPATIBLE feature type. + * + * Generated from protobuf enum SUSPEND_RESUME_COMPATIBLE = 9; + */ + const SUSPEND_RESUME_COMPATIBLE = 9; + /** + * SEV_LIVE_MIGRATABLE feature type. + * + * Generated from protobuf enum SEV_LIVE_MIGRATABLE = 10; + */ + const SEV_LIVE_MIGRATABLE = 10; + /** + * SEV_SNP_CAPABLE feature type. + * + * Generated from protobuf enum SEV_SNP_CAPABLE = 11; + */ + const SEV_SNP_CAPABLE = 11; + /** + * TDX_CAPABLE feature type. + * + * Generated from protobuf enum TDX_CAPABLE = 12; + */ + const TDX_CAPABLE = 12; + /** + * IDPF feature type. + * + * Generated from protobuf enum IDPF = 13; + */ + const IDPF = 13; + /** + * SEV_LIVE_MIGRATABLE_V2 feature type. + * + * Generated from protobuf enum SEV_LIVE_MIGRATABLE_V2 = 14; + */ + const SEV_LIVE_MIGRATABLE_V2 = 14; + + private static $valueToName = [ + self::FEATURE_TYPE_UNSPECIFIED => 'FEATURE_TYPE_UNSPECIFIED', + self::VIRTIO_SCSI_MULTIQUEUE => 'VIRTIO_SCSI_MULTIQUEUE', + self::WINDOWS => 'WINDOWS', + self::MULTI_IP_SUBNET => 'MULTI_IP_SUBNET', + self::UEFI_COMPATIBLE => 'UEFI_COMPATIBLE', + self::SECURE_BOOT => 'SECURE_BOOT', + self::GVNIC => 'GVNIC', + self::SEV_CAPABLE => 'SEV_CAPABLE', + self::BARE_METAL_LINUX_COMPATIBLE => 'BARE_METAL_LINUX_COMPATIBLE', + self::SUSPEND_RESUME_COMPATIBLE => 'SUSPEND_RESUME_COMPATIBLE', + self::SEV_LIVE_MIGRATABLE => 'SEV_LIVE_MIGRATABLE', + self::SEV_SNP_CAPABLE => 'SEV_SNP_CAPABLE', + self::TDX_CAPABLE => 'TDX_CAPABLE', + self::IDPF => 'IDPF', + self::SEV_LIVE_MIGRATABLE_V2 => 'SEV_LIVE_MIGRATABLE_V2', + ]; + + 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/BackupDr/src/V1/InstanceParams.php b/BackupDr/src/V1/InstanceParams.php new file mode 100644 index 000000000000..525d36ec6f3d --- /dev/null +++ b/BackupDr/src/V1/InstanceParams.php @@ -0,0 +1,67 @@ +google.cloud.backupdr.v1.InstanceParams + */ +class InstanceParams extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Resource manager tags to be bound to the instance. + * + * Generated from protobuf field map resource_manager_tags = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $resource_manager_tags; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $resource_manager_tags + * Optional. Resource manager tags to be bound to the instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Resource manager tags to be bound to the instance. + * + * Generated from protobuf field map resource_manager_tags = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getResourceManagerTags() + { + return $this->resource_manager_tags; + } + + /** + * Optional. Resource manager tags to be bound to the instance. + * + * Generated from protobuf field map resource_manager_tags = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setResourceManagerTags($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->resource_manager_tags = $arr; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/KeyRevocationActionType.php b/BackupDr/src/V1/KeyRevocationActionType.php new file mode 100644 index 000000000000..9922c9b37b07 --- /dev/null +++ b/BackupDr/src/V1/KeyRevocationActionType.php @@ -0,0 +1,63 @@ +google.cloud.backupdr.v1.KeyRevocationActionType + */ +class KeyRevocationActionType +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED = 0; + */ + const KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED = 0; + /** + * Indicates user chose no operation. + * + * Generated from protobuf enum NONE = 1; + */ + const NONE = 1; + /** + * Indicates user chose to opt for VM shutdown on key revocation. + * + * Generated from protobuf enum STOP = 2; + */ + const STOP = 2; + + private static $valueToName = [ + self::KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED => 'KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED', + self::NONE => 'NONE', + self::STOP => 'STOP', + ]; + + 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/BackupDr/src/V1/ListBackupPlanAssociationsRequest.php b/BackupDr/src/V1/ListBackupPlanAssociationsRequest.php new file mode 100644 index 000000000000..1cd640705bf5 --- /dev/null +++ b/BackupDr/src/V1/ListBackupPlanAssociationsRequest.php @@ -0,0 +1,212 @@ +google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + */ +class ListBackupPlanAssociationsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location for which to retrieve backup Plan + * Associations information, in the format + * `projects/{project_id}/locations/{location}`. In Cloud BackupDR, locations + * map to GCP regions, for example **us-central1**. To retrieve backup plan + * associations for all locations, use "-" for the + * `{location}` value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filtering results + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + + /** + * @param string $parent Required. The project and location for which to retrieve backup Plan + * Associations information, in the format + * `projects/{project_id}/locations/{location}`. In Cloud BackupDR, locations + * map to GCP regions, for example **us-central1**. To retrieve backup plan + * associations for all locations, use "-" for the + * `{location}` value. Please see + * {@see BackupDRClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\BackupDR\V1\ListBackupPlanAssociationsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location for which to retrieve backup Plan + * Associations information, in the format + * `projects/{project_id}/locations/{location}`. In Cloud BackupDR, locations + * map to GCP regions, for example **us-central1**. To retrieve backup plan + * associations for all locations, use "-" for the + * `{location}` value. + * @type int $page_size + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @type string $page_token + * Optional. A token identifying a page of results the server should return. + * @type string $filter + * Optional. Filtering results + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupplanassociation::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location for which to retrieve backup Plan + * Associations information, in the format + * `projects/{project_id}/locations/{location}`. In Cloud BackupDR, locations + * map to GCP regions, for example **us-central1**. To retrieve backup plan + * associations for all locations, use "-" for the + * `{location}` value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location for which to retrieve backup Plan + * Associations information, in the format + * `projects/{project_id}/locations/{location}`. In Cloud BackupDR, locations + * map to GCP regions, for example **us-central1**. To retrieve backup plan + * associations for all locations, use "-" for the + * `{location}` value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Filtering results + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering results + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/ListBackupPlanAssociationsResponse.php b/BackupDr/src/V1/ListBackupPlanAssociationsResponse.php new file mode 100644 index 000000000000..a92169b9c6c0 --- /dev/null +++ b/BackupDr/src/V1/ListBackupPlanAssociationsResponse.php @@ -0,0 +1,159 @@ +google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse + */ +class ListBackupPlanAssociationsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of Backup Plan Associations in the project for the specified + * location. + * If the `{location}` value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return backup plan associations in reachable + * locations and the 'unreachable' field will be populated with a list of + * unreachable locations. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupPlanAssociation backup_plan_associations = 1; + */ + private $backup_plan_associations; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BackupDR\V1\BackupPlanAssociation>|\Google\Protobuf\Internal\RepeatedField $backup_plan_associations + * The list of Backup Plan Associations in the project for the specified + * location. + * If the `{location}` value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return backup plan associations in reachable + * locations and the 'unreachable' field will be populated with a list of + * unreachable locations. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupplanassociation::initOnce(); + parent::__construct($data); + } + + /** + * The list of Backup Plan Associations in the project for the specified + * location. + * If the `{location}` value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return backup plan associations in reachable + * locations and the 'unreachable' field will be populated with a list of + * unreachable locations. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupPlanAssociation backup_plan_associations = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBackupPlanAssociations() + { + return $this->backup_plan_associations; + } + + /** + * The list of Backup Plan Associations in the project for the specified + * location. + * If the `{location}` value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return backup plan associations in reachable + * locations and the 'unreachable' field will be populated with a list of + * unreachable locations. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupPlanAssociation backup_plan_associations = 1; + * @param array<\Google\Cloud\BackupDR\V1\BackupPlanAssociation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBackupPlanAssociations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\BackupPlanAssociation::class); + $this->backup_plan_associations = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/ListBackupPlansRequest.php b/BackupDr/src/V1/ListBackupPlansRequest.php new file mode 100644 index 000000000000..59cf4b63f0d6 --- /dev/null +++ b/BackupDr/src/V1/ListBackupPlansRequest.php @@ -0,0 +1,277 @@ +google.cloud.backupdr.v1.ListBackupPlansRequest + */ +class ListBackupPlansRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location for which to retrieve `BackupPlans` + * information. Format: `projects/{project}/locations/{location}`. In Cloud + * BackupDR, locations map to GCP regions, for e.g. **us-central1**. To + * retrieve backup plans for all locations, use "-" for the + * `{location}` value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of `BackupPlans` to return in a single + * response. If not specified, a default value will be chosen by the service. + * Note that the response may include a partial list and a caller should + * only rely on the response's + * [next_page_token][google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token] + * to determine if there are more instances left to be queried. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The value of + * [next_page_token][google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token] + * received from a previous `ListBackupPlans` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to + * `ListBackupPlans` must match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Field match expression used to filter the results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Field by which to sort the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. The project and location for which to retrieve `BackupPlans` + * information. Format: `projects/{project}/locations/{location}`. In Cloud + * BackupDR, locations map to GCP regions, for e.g. **us-central1**. To + * retrieve backup plans for all locations, use "-" for the + * `{location}` value. Please see + * {@see BackupDRClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\BackupDR\V1\ListBackupPlansRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location for which to retrieve `BackupPlans` + * information. Format: `projects/{project}/locations/{location}`. In Cloud + * BackupDR, locations map to GCP regions, for e.g. **us-central1**. To + * retrieve backup plans for all locations, use "-" for the + * `{location}` value. + * @type int $page_size + * Optional. The maximum number of `BackupPlans` to return in a single + * response. If not specified, a default value will be chosen by the service. + * Note that the response may include a partial list and a caller should + * only rely on the response's + * [next_page_token][google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token] + * to determine if there are more instances left to be queried. + * @type string $page_token + * Optional. The value of + * [next_page_token][google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token] + * received from a previous `ListBackupPlans` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to + * `ListBackupPlans` must match the call that provided the page token. + * @type string $filter + * Optional. Field match expression used to filter the results. + * @type string $order_by + * Optional. Field by which to sort the results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupplan::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location for which to retrieve `BackupPlans` + * information. Format: `projects/{project}/locations/{location}`. In Cloud + * BackupDR, locations map to GCP regions, for e.g. **us-central1**. To + * retrieve backup plans for all locations, use "-" for the + * `{location}` value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location for which to retrieve `BackupPlans` + * information. Format: `projects/{project}/locations/{location}`. In Cloud + * BackupDR, locations map to GCP regions, for e.g. **us-central1**. To + * retrieve backup plans for all locations, use "-" for the + * `{location}` value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of `BackupPlans` to return in a single + * response. If not specified, a default value will be chosen by the service. + * Note that the response may include a partial list and a caller should + * only rely on the response's + * [next_page_token][google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token] + * to determine if there are more instances left to be queried. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of `BackupPlans` to return in a single + * response. If not specified, a default value will be chosen by the service. + * Note that the response may include a partial list and a caller should + * only rely on the response's + * [next_page_token][google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token] + * to determine if there are more instances left to be queried. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The value of + * [next_page_token][google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token] + * received from a previous `ListBackupPlans` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to + * `ListBackupPlans` must match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The value of + * [next_page_token][google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token] + * received from a previous `ListBackupPlans` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to + * `ListBackupPlans` must match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Field match expression used to filter the results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Field match expression used to filter the results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Field by which to sort the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Field by which to sort the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/ListBackupPlansResponse.php b/BackupDr/src/V1/ListBackupPlansResponse.php new file mode 100644 index 000000000000..ff5e2d64a27c --- /dev/null +++ b/BackupDr/src/V1/ListBackupPlansResponse.php @@ -0,0 +1,179 @@ +google.cloud.backupdr.v1.ListBackupPlansResponse + */ +class ListBackupPlansResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of `BackupPlans` in the project for the specified + * location. + * If the `{location}` value in the request is "-", the response contains a + * list of resources from all locations. In case any location is unreachable, + * the response will only return backup plans in reachable locations and + * the 'unreachable' field will be populated with a list of unreachable + * locations. + * BackupPlan + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupPlan backup_plans = 1; + */ + private $backup_plans; + /** + * A token which may be sent as + * [page_token][google.cloud.backupdr.v1.ListBackupPlansRequest.page_token] in + * a subsequent `ListBackupPlans` call to retrieve the next page of results. + * If this field is omitted or empty, then there are no more results to + * return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BackupDR\V1\BackupPlan>|\Google\Protobuf\Internal\RepeatedField $backup_plans + * The list of `BackupPlans` in the project for the specified + * location. + * If the `{location}` value in the request is "-", the response contains a + * list of resources from all locations. In case any location is unreachable, + * the response will only return backup plans in reachable locations and + * the 'unreachable' field will be populated with a list of unreachable + * locations. + * BackupPlan + * @type string $next_page_token + * A token which may be sent as + * [page_token][google.cloud.backupdr.v1.ListBackupPlansRequest.page_token] in + * a subsequent `ListBackupPlans` call to retrieve the next page of results. + * If this field is omitted or empty, then there are no more results to + * return. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupplan::initOnce(); + parent::__construct($data); + } + + /** + * The list of `BackupPlans` in the project for the specified + * location. + * If the `{location}` value in the request is "-", the response contains a + * list of resources from all locations. In case any location is unreachable, + * the response will only return backup plans in reachable locations and + * the 'unreachable' field will be populated with a list of unreachable + * locations. + * BackupPlan + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupPlan backup_plans = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBackupPlans() + { + return $this->backup_plans; + } + + /** + * The list of `BackupPlans` in the project for the specified + * location. + * If the `{location}` value in the request is "-", the response contains a + * list of resources from all locations. In case any location is unreachable, + * the response will only return backup plans in reachable locations and + * the 'unreachable' field will be populated with a list of unreachable + * locations. + * BackupPlan + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupPlan backup_plans = 1; + * @param array<\Google\Cloud\BackupDR\V1\BackupPlan>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBackupPlans($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\BackupPlan::class); + $this->backup_plans = $arr; + + return $this; + } + + /** + * A token which may be sent as + * [page_token][google.cloud.backupdr.v1.ListBackupPlansRequest.page_token] in + * a subsequent `ListBackupPlans` call to retrieve the next page of results. + * If this field is omitted or empty, then there are no more results to + * return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token which may be sent as + * [page_token][google.cloud.backupdr.v1.ListBackupPlansRequest.page_token] in + * a subsequent `ListBackupPlans` call to retrieve the next page of results. + * If this field is omitted or empty, then there are no more results to + * return. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/ListBackupVaultsRequest.php b/BackupDr/src/V1/ListBackupVaultsRequest.php new file mode 100644 index 000000000000..3f8755430f7e --- /dev/null +++ b/BackupDr/src/V1/ListBackupVaultsRequest.php @@ -0,0 +1,284 @@ +google.cloud.backupdr.v1.ListBackupVaultsRequest + */ +class ListBackupVaultsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + /** + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * Vault. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupVaultView view = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $view = 0; + + /** + * @param string $parent Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. Please see + * {@see BackupDRClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\BackupDR\V1\ListBackupVaultsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. + * @type int $page_size + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @type string $page_token + * Optional. A token identifying a page of results the server should return. + * @type string $filter + * Optional. Filtering results. + * @type string $order_by + * Optional. Hint for how to order the results. + * @type int $view + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * Vault. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + + /** + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * Vault. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupVaultView view = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * Vault. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupVaultView view = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\BackupVaultView::class); + $this->view = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/ListBackupVaultsResponse.php b/BackupDr/src/V1/ListBackupVaultsResponse.php new file mode 100644 index 000000000000..34988c886256 --- /dev/null +++ b/BackupDr/src/V1/ListBackupVaultsResponse.php @@ -0,0 +1,159 @@ +google.cloud.backupdr.v1.ListBackupVaultsResponse + */ +class ListBackupVaultsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of BackupVault instances in the project for the specified + * location. + * If the '{location}' value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return backup vaults in reachable locations and + * the 'unreachable' field will be populated with a list of unreachable + * locations. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupVault backup_vaults = 1; + */ + private $backup_vaults; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BackupDR\V1\BackupVault>|\Google\Protobuf\Internal\RepeatedField $backup_vaults + * The list of BackupVault instances in the project for the specified + * location. + * If the '{location}' value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return backup vaults in reachable locations and + * the 'unreachable' field will be populated with a list of unreachable + * locations. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * The list of BackupVault instances in the project for the specified + * location. + * If the '{location}' value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return backup vaults in reachable locations and + * the 'unreachable' field will be populated with a list of unreachable + * locations. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupVault backup_vaults = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBackupVaults() + { + return $this->backup_vaults; + } + + /** + * The list of BackupVault instances in the project for the specified + * location. + * If the '{location}' value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return backup vaults in reachable locations and + * the 'unreachable' field will be populated with a list of unreachable + * locations. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.BackupVault backup_vaults = 1; + * @param array<\Google\Cloud\BackupDR\V1\BackupVault>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBackupVaults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\BackupVault::class); + $this->backup_vaults = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/ListBackupsRequest.php b/BackupDr/src/V1/ListBackupsRequest.php new file mode 100644 index 000000000000..92b535e1b4f0 --- /dev/null +++ b/BackupDr/src/V1/ListBackupsRequest.php @@ -0,0 +1,284 @@ +google.cloud.backupdr.v1.ListBackupsRequest + */ +class ListBackupsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location for which to retrieve backup + * information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + /** + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * resource. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupView view = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $view = 0; + + /** + * @param string $parent Required. The project and location for which to retrieve backup + * information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. Please see + * {@see BackupDRClient::dataSourceName()} for help formatting this field. + * + * @return \Google\Cloud\BackupDR\V1\ListBackupsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location for which to retrieve backup + * information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. + * @type int $page_size + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @type string $page_token + * Optional. A token identifying a page of results the server should return. + * @type string $filter + * Optional. Filtering results. + * @type string $order_by + * Optional. Hint for how to order the results. + * @type int $view + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location for which to retrieve backup + * information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location for which to retrieve backup + * information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + + /** + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * resource. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupView view = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * resource. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupView view = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\BackupView::class); + $this->view = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/ListBackupsResponse.php b/BackupDr/src/V1/ListBackupsResponse.php new file mode 100644 index 000000000000..04479201f61b --- /dev/null +++ b/BackupDr/src/V1/ListBackupsResponse.php @@ -0,0 +1,159 @@ +google.cloud.backupdr.v1.ListBackupsResponse + */ +class ListBackupsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of Backup instances in the project for the specified + * location. + * If the '{location}' value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return data sources in reachable locations + * and the 'unreachable' field will be populated with a list of unreachable + * locations. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.Backup backups = 1; + */ + private $backups; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BackupDR\V1\Backup>|\Google\Protobuf\Internal\RepeatedField $backups + * The list of Backup instances in the project for the specified + * location. + * If the '{location}' value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return data sources in reachable locations + * and the 'unreachable' field will be populated with a list of unreachable + * locations. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * The list of Backup instances in the project for the specified + * location. + * If the '{location}' value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return data sources in reachable locations + * and the 'unreachable' field will be populated with a list of unreachable + * locations. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.Backup backups = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBackups() + { + return $this->backups; + } + + /** + * The list of Backup instances in the project for the specified + * location. + * If the '{location}' value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return data sources in reachable locations + * and the 'unreachable' field will be populated with a list of unreachable + * locations. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.Backup backups = 1; + * @param array<\Google\Cloud\BackupDR\V1\Backup>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBackups($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\Backup::class); + $this->backups = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/ListDataSourcesRequest.php b/BackupDr/src/V1/ListDataSourcesRequest.php new file mode 100644 index 000000000000..ef8584fa5ce2 --- /dev/null +++ b/BackupDr/src/V1/ListDataSourcesRequest.php @@ -0,0 +1,246 @@ +google.cloud.backupdr.v1.ListDataSourcesRequest + */ +class ListDataSourcesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location for which to retrieve data + * sources information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. The project and location for which to retrieve data + * sources information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. Please see + * {@see BackupDRClient::backupVaultName()} for help formatting this field. + * + * @return \Google\Cloud\BackupDR\V1\ListDataSourcesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location for which to retrieve data + * sources information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. + * @type int $page_size + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @type string $page_token + * Optional. A token identifying a page of results the server should return. + * @type string $filter + * Optional. Filtering results. + * @type string $order_by + * Optional. Hint for how to order the results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location for which to retrieve data + * sources information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location for which to retrieve data + * sources information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/ListDataSourcesResponse.php b/BackupDr/src/V1/ListDataSourcesResponse.php new file mode 100644 index 000000000000..ef509a105897 --- /dev/null +++ b/BackupDr/src/V1/ListDataSourcesResponse.php @@ -0,0 +1,159 @@ +google.cloud.backupdr.v1.ListDataSourcesResponse + */ +class ListDataSourcesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of DataSource instances in the project for the specified + * location. + * If the '{location}' value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return data sources in reachable locations + * and the 'unreachable' field will be populated with a list of unreachable + * locations. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.DataSource data_sources = 1; + */ + private $data_sources; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BackupDR\V1\DataSource>|\Google\Protobuf\Internal\RepeatedField $data_sources + * The list of DataSource instances in the project for the specified + * location. + * If the '{location}' value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return data sources in reachable locations + * and the 'unreachable' field will be populated with a list of unreachable + * locations. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * The list of DataSource instances in the project for the specified + * location. + * If the '{location}' value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return data sources in reachable locations + * and the 'unreachable' field will be populated with a list of unreachable + * locations. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.DataSource data_sources = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDataSources() + { + return $this->data_sources; + } + + /** + * The list of DataSource instances in the project for the specified + * location. + * If the '{location}' value in the request is "-", the response contains a + * list of instances from all locations. In case any location is unreachable, + * the response will only return data sources in reachable locations + * and the 'unreachable' field will be populated with a list of unreachable + * locations. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.DataSource data_sources = 1; + * @param array<\Google\Cloud\BackupDR\V1\DataSource>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDataSources($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\DataSource::class); + $this->data_sources = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/ListManagementServersRequest.php b/BackupDr/src/V1/ListManagementServersRequest.php index 37886b801be4..963e2af63f5e 100644 --- a/BackupDr/src/V1/ListManagementServersRequest.php +++ b/BackupDr/src/V1/ListManagementServersRequest.php @@ -17,10 +17,11 @@ class ListManagementServersRequest extends \Google\Protobuf\Internal\Message { /** * Required. The project and location for which to retrieve management servers - * information, in the format `projects/{project_id}/locations/{location}`. In - * Cloud BackupDR, locations map to GCP regions, for example **us-central1**. - * To retrieve management servers for all locations, use "-" for the - * `{location}` value. + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud BackupDR, locations map to Google Cloud regions, for example + * **us-central1**. To retrieve management servers for all locations, use "-" + * for the + * '{location}' value. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -53,10 +54,11 @@ class ListManagementServersRequest extends \Google\Protobuf\Internal\Message /** * @param string $parent Required. The project and location for which to retrieve management servers - * information, in the format `projects/{project_id}/locations/{location}`. In - * Cloud BackupDR, locations map to GCP regions, for example **us-central1**. - * To retrieve management servers for all locations, use "-" for the - * `{location}` value. Please see + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud BackupDR, locations map to Google Cloud regions, for example + * **us-central1**. To retrieve management servers for all locations, use "-" + * for the + * '{location}' value. Please see * {@see BackupDRClient::locationName()} for help formatting this field. * * @return \Google\Cloud\BackupDR\V1\ListManagementServersRequest @@ -77,10 +79,11 @@ public static function build(string $parent): self * * @type string $parent * Required. The project and location for which to retrieve management servers - * information, in the format `projects/{project_id}/locations/{location}`. In - * Cloud BackupDR, locations map to GCP regions, for example **us-central1**. - * To retrieve management servers for all locations, use "-" for the - * `{location}` value. + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud BackupDR, locations map to Google Cloud regions, for example + * **us-central1**. To retrieve management servers for all locations, use "-" + * for the + * '{location}' value. * @type int $page_size * Optional. Requested page size. Server may return fewer items than * requested. If unspecified, server will pick an appropriate default. @@ -99,10 +102,11 @@ public function __construct($data = NULL) { /** * Required. The project and location for which to retrieve management servers - * information, in the format `projects/{project_id}/locations/{location}`. In - * Cloud BackupDR, locations map to GCP regions, for example **us-central1**. - * To retrieve management servers for all locations, use "-" for the - * `{location}` value. + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud BackupDR, locations map to Google Cloud regions, for example + * **us-central1**. To retrieve management servers for all locations, use "-" + * for the + * '{location}' value. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -114,10 +118,11 @@ public function getParent() /** * Required. The project and location for which to retrieve management servers - * information, in the format `projects/{project_id}/locations/{location}`. In - * Cloud BackupDR, locations map to GCP regions, for example **us-central1**. - * To retrieve management servers for all locations, use "-" for the - * `{location}` value. + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud BackupDR, locations map to Google Cloud regions, for example + * **us-central1**. To retrieve management servers for all locations, use "-" + * for the + * '{location}' value. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/BackupDr/src/V1/ListManagementServersResponse.php b/BackupDr/src/V1/ListManagementServersResponse.php index fa2d796a5d0e..84bd573686db 100644 --- a/BackupDr/src/V1/ListManagementServersResponse.php +++ b/BackupDr/src/V1/ListManagementServersResponse.php @@ -18,7 +18,7 @@ class ListManagementServersResponse extends \Google\Protobuf\Internal\Message /** * The list of ManagementServer instances in the project for the specified * location. - * If the `{location}` value in the request is "-", the response contains a + * If the '{location}' value in the request is "-", the response contains a * list of instances from all locations. In case any location is unreachable, * the response will only return management servers in reachable locations and * the 'unreachable' field will be populated with a list of unreachable @@ -49,7 +49,7 @@ class ListManagementServersResponse extends \Google\Protobuf\Internal\Message * @type array<\Google\Cloud\BackupDR\V1\ManagementServer>|\Google\Protobuf\Internal\RepeatedField $management_servers * The list of ManagementServer instances in the project for the specified * location. - * If the `{location}` value in the request is "-", the response contains a + * If the '{location}' value in the request is "-", the response contains a * list of instances from all locations. In case any location is unreachable, * the response will only return management servers in reachable locations and * the 'unreachable' field will be populated with a list of unreachable @@ -68,7 +68,7 @@ public function __construct($data = NULL) { /** * The list of ManagementServer instances in the project for the specified * location. - * If the `{location}` value in the request is "-", the response contains a + * If the '{location}' value in the request is "-", the response contains a * list of instances from all locations. In case any location is unreachable, * the response will only return management servers in reachable locations and * the 'unreachable' field will be populated with a list of unreachable @@ -85,7 +85,7 @@ public function getManagementServers() /** * The list of ManagementServer instances in the project for the specified * location. - * If the `{location}` value in the request is "-", the response contains a + * If the '{location}' value in the request is "-", the response contains a * list of instances from all locations. In case any location is unreachable, * the response will only return management servers in reachable locations and * the 'unreachable' field will be populated with a list of unreachable diff --git a/BackupDr/src/V1/ManagementServer.php b/BackupDr/src/V1/ManagementServer.php index 47545858a697..70295addc1c0 100644 --- a/BackupDr/src/V1/ManagementServer.php +++ b/BackupDr/src/V1/ManagementServer.php @@ -92,7 +92,7 @@ class ManagementServer extends \Google\Protobuf\Internal\Message /** * Output only. The OAuth 2.0 client id is required to make API calls to the * BackupDR instance API of this ManagementServer. This is the value that - * should be provided in the ‘aud’ field of the OIDC ID Token (see openid + * should be provided in the 'aud' field of the OIDC ID Token (see openid * specification * https://openid.net/specs/openid-connect-core-1_0.html#IDToken). * @@ -164,7 +164,7 @@ class ManagementServer extends \Google\Protobuf\Internal\Message * @type string $oauth2_client_id * Output only. The OAuth 2.0 client id is required to make API calls to the * BackupDR instance API of this ManagementServer. This is the value that - * should be provided in the ‘aud’ field of the OIDC ID Token (see openid + * should be provided in the 'aud' field of the OIDC ID Token (see openid * specification * https://openid.net/specs/openid-connect-core-1_0.html#IDToken). * @type \Google\Cloud\BackupDR\V1\WorkforceIdentityBasedOAuth2ClientID $workforce_identity_based_oauth2_client_id @@ -528,7 +528,7 @@ public function setEtag($var) /** * Output only. The OAuth 2.0 client id is required to make API calls to the * BackupDR instance API of this ManagementServer. This is the value that - * should be provided in the ‘aud’ field of the OIDC ID Token (see openid + * should be provided in the 'aud' field of the OIDC ID Token (see openid * specification * https://openid.net/specs/openid-connect-core-1_0.html#IDToken). * @@ -543,7 +543,7 @@ public function getOauth2ClientId() /** * Output only. The OAuth 2.0 client id is required to make API calls to the * BackupDR instance API of this ManagementServer. This is the value that - * should be provided in the ‘aud’ field of the OIDC ID Token (see openid + * should be provided in the 'aud' field of the OIDC ID Token (see openid * specification * https://openid.net/specs/openid-connect-core-1_0.html#IDToken). * diff --git a/BackupDr/src/V1/Metadata.php b/BackupDr/src/V1/Metadata.php new file mode 100644 index 000000000000..a47c48d30479 --- /dev/null +++ b/BackupDr/src/V1/Metadata.php @@ -0,0 +1,71 @@ +google.cloud.backupdr.v1.Metadata + */ +class Metadata extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Array of key/value pairs. The total size of all keys and values + * must be less than 512 KB. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.Entry items = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $items; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\BackupDR\V1\Entry>|\Google\Protobuf\Internal\RepeatedField $items + * Optional. Array of key/value pairs. The total size of all keys and values + * must be less than 512 KB. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Array of key/value pairs. The total size of all keys and values + * must be less than 512 KB. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.Entry items = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * Optional. Array of key/value pairs. The total size of all keys and values + * must be less than 512 KB. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.Entry items = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\BackupDR\V1\Entry>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\Entry::class); + $this->items = $arr; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/NetworkInterface.php b/BackupDr/src/V1/NetworkInterface.php new file mode 100644 index 000000000000..f814b5bc7885 --- /dev/null +++ b/BackupDr/src/V1/NetworkInterface.php @@ -0,0 +1,700 @@ +google.cloud.backupdr.v1.NetworkInterface + */ +class NetworkInterface extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. URL of the VPC network resource for this instance. + * + * Generated from protobuf field optional string network = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $network = null; + /** + * Optional. The URL of the Subnetwork resource for this instance. + * + * Generated from protobuf field optional string subnetwork = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $subnetwork = null; + /** + * Optional. An IPv4 internal IP address to assign to the instance for this + * network interface. If not specified by the user, an unused internal IP is + * assigned by the system. + * + * Generated from protobuf field optional string ip_address = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $ip_address = null; + /** + * Optional. An IPv6 internal network address for this network interface. To + * use a static internal IP address, it must be unused and in the same region + * as the instance's zone. If not specified, Google Cloud will automatically + * assign an internal IPv6 address from the instance's subnetwork. + * + * Generated from protobuf field optional string ipv6_address = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $ipv6_address = null; + /** + * Optional. The prefix length of the primary internal IPv6 range. + * + * Generated from protobuf field optional int32 internal_ipv6_prefix_length = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $internal_ipv6_prefix_length = null; + /** + * Output only. [Output Only] The name of the network interface, which is + * generated by the server. + * + * Generated from protobuf field optional string name = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = null; + /** + * Optional. An array of configurations for this interface. Currently, only + * one access config,ONE_TO_ONE_NAT is supported. If there are no + * accessConfigs specified, then this instance will have + * no external internet access. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AccessConfig access_configs = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $access_configs; + /** + * Optional. An array of IPv6 access configurations for this interface. + * Currently, only one IPv6 access config, DIRECT_IPV6, is supported. If there + * is no ipv6AccessConfig specified, then this instance will + * have no external IPv6 Internet access. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AccessConfig ipv6_access_configs = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $ipv6_access_configs; + /** + * Optional. An array of alias IP ranges for this network interface. + * You can only specify this field for network interfaces in VPC networks. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AliasIpRange alias_ip_ranges = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $alias_ip_ranges; + /** + * The stack type for this network interface. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.NetworkInterface.StackType stack_type = 10; + */ + protected $stack_type = null; + /** + * Optional. [Output Only] One of EXTERNAL, INTERNAL to indicate whether the + * IP can be accessed from the Internet. This field is always inherited from + * its subnetwork. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType ipv6_access_type = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ipv6_access_type = null; + /** + * Optional. The networking queue count that's specified by users for the + * network interface. Both Rx and Tx queues will be set to this number. It'll + * be empty if not specified by the users. + * + * Generated from protobuf field optional int32 queue_count = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $queue_count = null; + /** + * Optional. The type of vNIC to be used on this interface. This may be gVNIC + * or VirtioNet. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.NetworkInterface.NicType nic_type = 13 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $nic_type = null; + /** + * Optional. The URL of the network attachment that this interface should + * connect to in the following format: + * projects/{project_number}/regions/{region_name}/networkAttachments/{network_attachment_name}. + * + * Generated from protobuf field optional string network_attachment = 14 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $network_attachment = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network + * Optional. URL of the VPC network resource for this instance. + * @type string $subnetwork + * Optional. The URL of the Subnetwork resource for this instance. + * @type string $ip_address + * Optional. An IPv4 internal IP address to assign to the instance for this + * network interface. If not specified by the user, an unused internal IP is + * assigned by the system. + * @type string $ipv6_address + * Optional. An IPv6 internal network address for this network interface. To + * use a static internal IP address, it must be unused and in the same region + * as the instance's zone. If not specified, Google Cloud will automatically + * assign an internal IPv6 address from the instance's subnetwork. + * @type int $internal_ipv6_prefix_length + * Optional. The prefix length of the primary internal IPv6 range. + * @type string $name + * Output only. [Output Only] The name of the network interface, which is + * generated by the server. + * @type array<\Google\Cloud\BackupDR\V1\AccessConfig>|\Google\Protobuf\Internal\RepeatedField $access_configs + * Optional. An array of configurations for this interface. Currently, only + * one access config,ONE_TO_ONE_NAT is supported. If there are no + * accessConfigs specified, then this instance will have + * no external internet access. + * @type array<\Google\Cloud\BackupDR\V1\AccessConfig>|\Google\Protobuf\Internal\RepeatedField $ipv6_access_configs + * Optional. An array of IPv6 access configurations for this interface. + * Currently, only one IPv6 access config, DIRECT_IPV6, is supported. If there + * is no ipv6AccessConfig specified, then this instance will + * have no external IPv6 Internet access. + * @type array<\Google\Cloud\BackupDR\V1\AliasIpRange>|\Google\Protobuf\Internal\RepeatedField $alias_ip_ranges + * Optional. An array of alias IP ranges for this network interface. + * You can only specify this field for network interfaces in VPC networks. + * @type int $stack_type + * The stack type for this network interface. + * @type int $ipv6_access_type + * Optional. [Output Only] One of EXTERNAL, INTERNAL to indicate whether the + * IP can be accessed from the Internet. This field is always inherited from + * its subnetwork. + * @type int $queue_count + * Optional. The networking queue count that's specified by users for the + * network interface. Both Rx and Tx queues will be set to this number. It'll + * be empty if not specified by the users. + * @type int $nic_type + * Optional. The type of vNIC to be used on this interface. This may be gVNIC + * or VirtioNet. + * @type string $network_attachment + * Optional. The URL of the network attachment that this interface should + * connect to in the following format: + * projects/{project_number}/regions/{region_name}/networkAttachments/{network_attachment_name}. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Optional. URL of the VPC network resource for this instance. + * + * Generated from protobuf field optional string network = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getNetwork() + { + return isset($this->network) ? $this->network : ''; + } + + public function hasNetwork() + { + return isset($this->network); + } + + public function clearNetwork() + { + unset($this->network); + } + + /** + * Optional. URL of the VPC network resource for this instance. + * + * Generated from protobuf field optional string network = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * Optional. The URL of the Subnetwork resource for this instance. + * + * Generated from protobuf field optional string subnetwork = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSubnetwork() + { + return isset($this->subnetwork) ? $this->subnetwork : ''; + } + + public function hasSubnetwork() + { + return isset($this->subnetwork); + } + + public function clearSubnetwork() + { + unset($this->subnetwork); + } + + /** + * Optional. The URL of the Subnetwork resource for this instance. + * + * Generated from protobuf field optional string subnetwork = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSubnetwork($var) + { + GPBUtil::checkString($var, True); + $this->subnetwork = $var; + + return $this; + } + + /** + * Optional. An IPv4 internal IP address to assign to the instance for this + * network interface. If not specified by the user, an unused internal IP is + * assigned by the system. + * + * Generated from protobuf field optional string ip_address = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getIpAddress() + { + return isset($this->ip_address) ? $this->ip_address : ''; + } + + public function hasIpAddress() + { + return isset($this->ip_address); + } + + public function clearIpAddress() + { + unset($this->ip_address); + } + + /** + * Optional. An IPv4 internal IP address to assign to the instance for this + * network interface. If not specified by the user, an unused internal IP is + * assigned by the system. + * + * Generated from protobuf field optional string ip_address = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setIpAddress($var) + { + GPBUtil::checkString($var, True); + $this->ip_address = $var; + + return $this; + } + + /** + * Optional. An IPv6 internal network address for this network interface. To + * use a static internal IP address, it must be unused and in the same region + * as the instance's zone. If not specified, Google Cloud will automatically + * assign an internal IPv6 address from the instance's subnetwork. + * + * Generated from protobuf field optional string ipv6_address = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getIpv6Address() + { + return isset($this->ipv6_address) ? $this->ipv6_address : ''; + } + + public function hasIpv6Address() + { + return isset($this->ipv6_address); + } + + public function clearIpv6Address() + { + unset($this->ipv6_address); + } + + /** + * Optional. An IPv6 internal network address for this network interface. To + * use a static internal IP address, it must be unused and in the same region + * as the instance's zone. If not specified, Google Cloud will automatically + * assign an internal IPv6 address from the instance's subnetwork. + * + * Generated from protobuf field optional string ipv6_address = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setIpv6Address($var) + { + GPBUtil::checkString($var, True); + $this->ipv6_address = $var; + + return $this; + } + + /** + * Optional. The prefix length of the primary internal IPv6 range. + * + * Generated from protobuf field optional int32 internal_ipv6_prefix_length = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getInternalIpv6PrefixLength() + { + return isset($this->internal_ipv6_prefix_length) ? $this->internal_ipv6_prefix_length : 0; + } + + public function hasInternalIpv6PrefixLength() + { + return isset($this->internal_ipv6_prefix_length); + } + + public function clearInternalIpv6PrefixLength() + { + unset($this->internal_ipv6_prefix_length); + } + + /** + * Optional. The prefix length of the primary internal IPv6 range. + * + * Generated from protobuf field optional int32 internal_ipv6_prefix_length = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setInternalIpv6PrefixLength($var) + { + GPBUtil::checkInt32($var); + $this->internal_ipv6_prefix_length = $var; + + return $this; + } + + /** + * Output only. [Output Only] The name of the network interface, which is + * generated by the server. + * + * Generated from protobuf field optional string name = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return isset($this->name) ? $this->name : ''; + } + + public function hasName() + { + return isset($this->name); + } + + public function clearName() + { + unset($this->name); + } + + /** + * Output only. [Output Only] The name of the network interface, which is + * generated by the server. + * + * Generated from protobuf field optional string name = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. An array of configurations for this interface. Currently, only + * one access config,ONE_TO_ONE_NAT is supported. If there are no + * accessConfigs specified, then this instance will have + * no external internet access. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AccessConfig access_configs = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAccessConfigs() + { + return $this->access_configs; + } + + /** + * Optional. An array of configurations for this interface. Currently, only + * one access config,ONE_TO_ONE_NAT is supported. If there are no + * accessConfigs specified, then this instance will have + * no external internet access. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AccessConfig access_configs = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\BackupDR\V1\AccessConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAccessConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\AccessConfig::class); + $this->access_configs = $arr; + + return $this; + } + + /** + * Optional. An array of IPv6 access configurations for this interface. + * Currently, only one IPv6 access config, DIRECT_IPV6, is supported. If there + * is no ipv6AccessConfig specified, then this instance will + * have no external IPv6 Internet access. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AccessConfig ipv6_access_configs = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getIpv6AccessConfigs() + { + return $this->ipv6_access_configs; + } + + /** + * Optional. An array of IPv6 access configurations for this interface. + * Currently, only one IPv6 access config, DIRECT_IPV6, is supported. If there + * is no ipv6AccessConfig specified, then this instance will + * have no external IPv6 Internet access. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AccessConfig ipv6_access_configs = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\BackupDR\V1\AccessConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setIpv6AccessConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\AccessConfig::class); + $this->ipv6_access_configs = $arr; + + return $this; + } + + /** + * Optional. An array of alias IP ranges for this network interface. + * You can only specify this field for network interfaces in VPC networks. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AliasIpRange alias_ip_ranges = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAliasIpRanges() + { + return $this->alias_ip_ranges; + } + + /** + * Optional. An array of alias IP ranges for this network interface. + * You can only specify this field for network interfaces in VPC networks. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.AliasIpRange alias_ip_ranges = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\BackupDR\V1\AliasIpRange>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAliasIpRanges($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\AliasIpRange::class); + $this->alias_ip_ranges = $arr; + + return $this; + } + + /** + * The stack type for this network interface. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.NetworkInterface.StackType stack_type = 10; + * @return int + */ + public function getStackType() + { + return isset($this->stack_type) ? $this->stack_type : 0; + } + + public function hasStackType() + { + return isset($this->stack_type); + } + + public function clearStackType() + { + unset($this->stack_type); + } + + /** + * The stack type for this network interface. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.NetworkInterface.StackType stack_type = 10; + * @param int $var + * @return $this + */ + public function setStackType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\NetworkInterface\StackType::class); + $this->stack_type = $var; + + return $this; + } + + /** + * Optional. [Output Only] One of EXTERNAL, INTERNAL to indicate whether the + * IP can be accessed from the Internet. This field is always inherited from + * its subnetwork. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType ipv6_access_type = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getIpv6AccessType() + { + return isset($this->ipv6_access_type) ? $this->ipv6_access_type : 0; + } + + public function hasIpv6AccessType() + { + return isset($this->ipv6_access_type); + } + + public function clearIpv6AccessType() + { + unset($this->ipv6_access_type); + } + + /** + * Optional. [Output Only] One of EXTERNAL, INTERNAL to indicate whether the + * IP can be accessed from the Internet. This field is always inherited from + * its subnetwork. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType ipv6_access_type = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setIpv6AccessType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\NetworkInterface\Ipv6AccessType::class); + $this->ipv6_access_type = $var; + + return $this; + } + + /** + * Optional. The networking queue count that's specified by users for the + * network interface. Both Rx and Tx queues will be set to this number. It'll + * be empty if not specified by the users. + * + * Generated from protobuf field optional int32 queue_count = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getQueueCount() + { + return isset($this->queue_count) ? $this->queue_count : 0; + } + + public function hasQueueCount() + { + return isset($this->queue_count); + } + + public function clearQueueCount() + { + unset($this->queue_count); + } + + /** + * Optional. The networking queue count that's specified by users for the + * network interface. Both Rx and Tx queues will be set to this number. It'll + * be empty if not specified by the users. + * + * Generated from protobuf field optional int32 queue_count = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setQueueCount($var) + { + GPBUtil::checkInt32($var); + $this->queue_count = $var; + + return $this; + } + + /** + * Optional. The type of vNIC to be used on this interface. This may be gVNIC + * or VirtioNet. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.NetworkInterface.NicType nic_type = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getNicType() + { + return isset($this->nic_type) ? $this->nic_type : 0; + } + + public function hasNicType() + { + return isset($this->nic_type); + } + + public function clearNicType() + { + unset($this->nic_type); + } + + /** + * Optional. The type of vNIC to be used on this interface. This may be gVNIC + * or VirtioNet. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.NetworkInterface.NicType nic_type = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setNicType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\NetworkInterface\NicType::class); + $this->nic_type = $var; + + return $this; + } + + /** + * Optional. The URL of the network attachment that this interface should + * connect to in the following format: + * projects/{project_number}/regions/{region_name}/networkAttachments/{network_attachment_name}. + * + * Generated from protobuf field optional string network_attachment = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getNetworkAttachment() + { + return isset($this->network_attachment) ? $this->network_attachment : ''; + } + + public function hasNetworkAttachment() + { + return isset($this->network_attachment); + } + + public function clearNetworkAttachment() + { + unset($this->network_attachment); + } + + /** + * Optional. The URL of the network attachment that this interface should + * connect to in the following format: + * projects/{project_number}/regions/{region_name}/networkAttachments/{network_attachment_name}. + * + * Generated from protobuf field optional string network_attachment = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setNetworkAttachment($var) + { + GPBUtil::checkString($var, True); + $this->network_attachment = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/NetworkInterface/Ipv6AccessType.php b/BackupDr/src/V1/NetworkInterface/Ipv6AccessType.php new file mode 100644 index 000000000000..0e693955e272 --- /dev/null +++ b/BackupDr/src/V1/NetworkInterface/Ipv6AccessType.php @@ -0,0 +1,63 @@ +google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType + */ +class Ipv6AccessType +{ + /** + * IPv6 access type not set. Means this network interface hasn't been + * turned on IPv6 yet. + * + * Generated from protobuf enum UNSPECIFIED_IPV6_ACCESS_TYPE = 0; + */ + const UNSPECIFIED_IPV6_ACCESS_TYPE = 0; + /** + * This network interface can have internal IPv6. + * + * Generated from protobuf enum INTERNAL = 1; + */ + const INTERNAL = 1; + /** + * This network interface can have external IPv6. + * + * Generated from protobuf enum EXTERNAL = 2; + */ + const EXTERNAL = 2; + + private static $valueToName = [ + self::UNSPECIFIED_IPV6_ACCESS_TYPE => 'UNSPECIFIED_IPV6_ACCESS_TYPE', + self::INTERNAL => 'INTERNAL', + self::EXTERNAL => 'EXTERNAL', + ]; + + 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/BackupDr/src/V1/NetworkInterface/NicType.php b/BackupDr/src/V1/NetworkInterface/NicType.php new file mode 100644 index 000000000000..68e6feafb6d2 --- /dev/null +++ b/BackupDr/src/V1/NetworkInterface/NicType.php @@ -0,0 +1,62 @@ +google.cloud.backupdr.v1.NetworkInterface.NicType + */ +class NicType +{ + /** + * Default should be NIC_TYPE_UNSPECIFIED. + * + * Generated from protobuf enum NIC_TYPE_UNSPECIFIED = 0; + */ + const NIC_TYPE_UNSPECIFIED = 0; + /** + * VIRTIO + * + * Generated from protobuf enum VIRTIO_NET = 1; + */ + const VIRTIO_NET = 1; + /** + * GVNIC + * + * Generated from protobuf enum GVNIC = 2; + */ + const GVNIC = 2; + + private static $valueToName = [ + self::NIC_TYPE_UNSPECIFIED => 'NIC_TYPE_UNSPECIFIED', + self::VIRTIO_NET => 'VIRTIO_NET', + self::GVNIC => 'GVNIC', + ]; + + 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/BackupDr/src/V1/NetworkInterface/StackType.php b/BackupDr/src/V1/NetworkInterface/StackType.php new file mode 100644 index 000000000000..3fa4b59c862e --- /dev/null +++ b/BackupDr/src/V1/NetworkInterface/StackType.php @@ -0,0 +1,62 @@ +google.cloud.backupdr.v1.NetworkInterface.StackType + */ +class StackType +{ + /** + * Default should be STACK_TYPE_UNSPECIFIED. + * + * Generated from protobuf enum STACK_TYPE_UNSPECIFIED = 0; + */ + const STACK_TYPE_UNSPECIFIED = 0; + /** + * The network interface will be assigned IPv4 address. + * + * Generated from protobuf enum IPV4_ONLY = 1; + */ + const IPV4_ONLY = 1; + /** + * The network interface can have both IPv4 and IPv6 addresses. + * + * Generated from protobuf enum IPV4_IPV6 = 2; + */ + const IPV4_IPV6 = 2; + + private static $valueToName = [ + self::STACK_TYPE_UNSPECIFIED => 'STACK_TYPE_UNSPECIFIED', + self::IPV4_ONLY => 'IPV4_ONLY', + self::IPV4_IPV6 => 'IPV4_IPV6', + ]; + + 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/BackupDr/src/V1/NetworkPerformanceConfig.php b/BackupDr/src/V1/NetworkPerformanceConfig.php new file mode 100644 index 000000000000..9104b7f0e842 --- /dev/null +++ b/BackupDr/src/V1/NetworkPerformanceConfig.php @@ -0,0 +1,77 @@ +google.cloud.backupdr.v1.NetworkPerformanceConfig + */ +class NetworkPerformanceConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The tier of the total egress bandwidth. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier total_egress_bandwidth_tier = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $total_egress_bandwidth_tier = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $total_egress_bandwidth_tier + * Optional. The tier of the total egress bandwidth. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The tier of the total egress bandwidth. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier total_egress_bandwidth_tier = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getTotalEgressBandwidthTier() + { + return isset($this->total_egress_bandwidth_tier) ? $this->total_egress_bandwidth_tier : 0; + } + + public function hasTotalEgressBandwidthTier() + { + return isset($this->total_egress_bandwidth_tier); + } + + public function clearTotalEgressBandwidthTier() + { + unset($this->total_egress_bandwidth_tier); + } + + /** + * Optional. The tier of the total egress bandwidth. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier total_egress_bandwidth_tier = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setTotalEgressBandwidthTier($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\NetworkPerformanceConfig\Tier::class); + $this->total_egress_bandwidth_tier = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/NetworkPerformanceConfig/Tier.php b/BackupDr/src/V1/NetworkPerformanceConfig/Tier.php new file mode 100644 index 000000000000..e53e32fa05fb --- /dev/null +++ b/BackupDr/src/V1/NetworkPerformanceConfig/Tier.php @@ -0,0 +1,66 @@ +google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier + */ +class Tier +{ + /** + * This value is unused. + * + * Generated from protobuf enum TIER_UNSPECIFIED = 0; + */ + const TIER_UNSPECIFIED = 0; + /** + * Default network performance config. + * + * Generated from protobuf enum DEFAULT = 1; + */ + const PBDEFAULT = 1; + /** + * Tier 1 network performance config. + * + * Generated from protobuf enum TIER_1 = 2; + */ + const TIER_1 = 2; + + private static $valueToName = [ + self::TIER_UNSPECIFIED => 'TIER_UNSPECIFIED', + self::PBDEFAULT => 'DEFAULT', + self::TIER_1 => 'TIER_1', + ]; + + 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)) { + $pbconst = __CLASS__. '::PB' . strtoupper($name); + if (!defined($pbconst)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($pbconst); + } + return constant($const); + } +} + + diff --git a/BackupDr/src/V1/OperationMetadata.php b/BackupDr/src/V1/OperationMetadata.php index 822d7b9a09a9..e880bbc7986d 100644 --- a/BackupDr/src/V1/OperationMetadata.php +++ b/BackupDr/src/V1/OperationMetadata.php @@ -50,7 +50,7 @@ class OperationMetadata extends \Google\Protobuf\Internal\Message * of the operation. Operations that have successfully been cancelled * have [Operation.error][] value with a * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. + * 'Code.CANCELLED'. * * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ @@ -90,7 +90,7 @@ class OperationMetadata extends \Google\Protobuf\Internal\Message * of the operation. Operations that have successfully been cancelled * have [Operation.error][] value with a * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. + * 'Code.CANCELLED'. * @type string $api_version * Output only. API version used to start the operation. * @type array|\Google\Protobuf\Internal\MapField $additional_info @@ -258,7 +258,7 @@ public function setStatusMessage($var) * of the operation. Operations that have successfully been cancelled * have [Operation.error][] value with a * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. + * 'Code.CANCELLED'. * * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return bool @@ -273,7 +273,7 @@ public function getRequestedCancellation() * of the operation. Operations that have successfully been cancelled * have [Operation.error][] value with a * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. + * 'Code.CANCELLED'. * * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param bool $var diff --git a/BackupDr/src/V1/RestoreBackupRequest.php b/BackupDr/src/V1/RestoreBackupRequest.php new file mode 100644 index 000000000000..57cda39c282c --- /dev/null +++ b/BackupDr/src/V1/RestoreBackupRequest.php @@ -0,0 +1,244 @@ +google.cloud.backupdr.v1.RestoreBackupRequest + */ +class RestoreBackupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the Backup instance, in the format + * 'projects/*/locations/*/backupVaults/*/dataSources/*/backups/'. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + protected $target_environment; + protected $instance_properties; + + /** + * @param string $name Required. The resource name of the Backup instance, in the format + * 'projects/*/locations/*/backupVaults/*/dataSources/*/backups/'. Please see + * {@see BackupDRClient::backupName()} for help formatting this field. + * + * @return \Google\Cloud\BackupDR\V1\RestoreBackupRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the Backup instance, in the format + * 'projects/*/locations/*/backupVaults/*/dataSources/*/backups/'. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type \Google\Cloud\BackupDR\V1\ComputeInstanceTargetEnvironment $compute_instance_target_environment + * Compute Engine target environment to be used during restore. + * @type \Google\Cloud\BackupDR\V1\ComputeInstanceRestoreProperties $compute_instance_restore_properties + * Compute Engine instance properties to be overridden during restore. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the Backup instance, in the format + * 'projects/*/locations/*/backupVaults/*/dataSources/*/backups/'. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the Backup instance, in the format + * 'projects/*/locations/*/backupVaults/*/dataSources/*/backups/'. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Compute Engine target environment to be used during restore. + * + * Generated from protobuf field .google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment compute_instance_target_environment = 3; + * @return \Google\Cloud\BackupDR\V1\ComputeInstanceTargetEnvironment|null + */ + public function getComputeInstanceTargetEnvironment() + { + return $this->readOneof(3); + } + + public function hasComputeInstanceTargetEnvironment() + { + return $this->hasOneof(3); + } + + /** + * Compute Engine target environment to be used during restore. + * + * Generated from protobuf field .google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment compute_instance_target_environment = 3; + * @param \Google\Cloud\BackupDR\V1\ComputeInstanceTargetEnvironment $var + * @return $this + */ + public function setComputeInstanceTargetEnvironment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\ComputeInstanceTargetEnvironment::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Compute Engine instance properties to be overridden during restore. + * + * Generated from protobuf field .google.cloud.backupdr.v1.ComputeInstanceRestoreProperties compute_instance_restore_properties = 4; + * @return \Google\Cloud\BackupDR\V1\ComputeInstanceRestoreProperties|null + */ + public function getComputeInstanceRestoreProperties() + { + return $this->readOneof(4); + } + + public function hasComputeInstanceRestoreProperties() + { + return $this->hasOneof(4); + } + + /** + * Compute Engine instance properties to be overridden during restore. + * + * Generated from protobuf field .google.cloud.backupdr.v1.ComputeInstanceRestoreProperties compute_instance_restore_properties = 4; + * @param \Google\Cloud\BackupDR\V1\ComputeInstanceRestoreProperties $var + * @return $this + */ + public function setComputeInstanceRestoreProperties($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\ComputeInstanceRestoreProperties::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getTargetEnvironment() + { + return $this->whichOneof("target_environment"); + } + + /** + * @return string + */ + public function getInstanceProperties() + { + return $this->whichOneof("instance_properties"); + } + +} + diff --git a/BackupDr/src/V1/RestoreBackupResponse.php b/BackupDr/src/V1/RestoreBackupResponse.php new file mode 100644 index 000000000000..27614255363f --- /dev/null +++ b/BackupDr/src/V1/RestoreBackupResponse.php @@ -0,0 +1,77 @@ +google.cloud.backupdr.v1.RestoreBackupResponse + */ +class RestoreBackupResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Details of the target resource created/modified as part of restore. + * + * Generated from protobuf field .google.cloud.backupdr.v1.TargetResource target_resource = 1; + */ + protected $target_resource = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BackupDR\V1\TargetResource $target_resource + * Details of the target resource created/modified as part of restore. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Details of the target resource created/modified as part of restore. + * + * Generated from protobuf field .google.cloud.backupdr.v1.TargetResource target_resource = 1; + * @return \Google\Cloud\BackupDR\V1\TargetResource|null + */ + public function getTargetResource() + { + return $this->target_resource; + } + + public function hasTargetResource() + { + return isset($this->target_resource); + } + + public function clearTargetResource() + { + unset($this->target_resource); + } + + /** + * Details of the target resource created/modified as part of restore. + * + * Generated from protobuf field .google.cloud.backupdr.v1.TargetResource target_resource = 1; + * @param \Google\Cloud\BackupDR\V1\TargetResource $var + * @return $this + */ + public function setTargetResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\TargetResource::class); + $this->target_resource = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/RuleConfigInfo.php b/BackupDr/src/V1/RuleConfigInfo.php new file mode 100644 index 000000000000..710f042a26d9 --- /dev/null +++ b/BackupDr/src/V1/RuleConfigInfo.php @@ -0,0 +1,201 @@ +google.cloud.backupdr.v1.RuleConfigInfo + */ +class RuleConfigInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Output Only. + * Backup Rule id fetched from backup plan. + * + * Generated from protobuf field string rule_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $rule_id = ''; + /** + * Output only. The last backup state for rule. + * + * Generated from protobuf field .google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState last_backup_state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $last_backup_state = 0; + /** + * Output only. Output Only. + * google.rpc.Status object to store the last backup error. + * + * Generated from protobuf field .google.rpc.Status last_backup_error = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $last_backup_error = null; + /** + * Output only. The point in time when the last successful backup was captured + * from the source. + * + * Generated from protobuf field .google.protobuf.Timestamp last_successful_backup_consistency_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $last_successful_backup_consistency_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $rule_id + * Output only. Output Only. + * Backup Rule id fetched from backup plan. + * @type int $last_backup_state + * Output only. The last backup state for rule. + * @type \Google\Rpc\Status $last_backup_error + * Output only. Output Only. + * google.rpc.Status object to store the last backup error. + * @type \Google\Protobuf\Timestamp $last_successful_backup_consistency_time + * Output only. The point in time when the last successful backup was captured + * from the source. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupplanassociation::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Output Only. + * Backup Rule id fetched from backup plan. + * + * Generated from protobuf field string rule_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getRuleId() + { + return $this->rule_id; + } + + /** + * Output only. Output Only. + * Backup Rule id fetched from backup plan. + * + * Generated from protobuf field string rule_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setRuleId($var) + { + GPBUtil::checkString($var, True); + $this->rule_id = $var; + + return $this; + } + + /** + * Output only. The last backup state for rule. + * + * Generated from protobuf field .google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState last_backup_state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getLastBackupState() + { + return $this->last_backup_state; + } + + /** + * Output only. The last backup state for rule. + * + * Generated from protobuf field .google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState last_backup_state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setLastBackupState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\RuleConfigInfo\LastBackupState::class); + $this->last_backup_state = $var; + + return $this; + } + + /** + * Output only. Output Only. + * google.rpc.Status object to store the last backup error. + * + * Generated from protobuf field .google.rpc.Status last_backup_error = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Rpc\Status|null + */ + public function getLastBackupError() + { + return $this->last_backup_error; + } + + public function hasLastBackupError() + { + return isset($this->last_backup_error); + } + + public function clearLastBackupError() + { + unset($this->last_backup_error); + } + + /** + * Output only. Output Only. + * google.rpc.Status object to store the last backup error. + * + * Generated from protobuf field .google.rpc.Status last_backup_error = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setLastBackupError($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->last_backup_error = $var; + + return $this; + } + + /** + * Output only. The point in time when the last successful backup was captured + * from the source. + * + * Generated from protobuf field .google.protobuf.Timestamp last_successful_backup_consistency_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getLastSuccessfulBackupConsistencyTime() + { + return $this->last_successful_backup_consistency_time; + } + + public function hasLastSuccessfulBackupConsistencyTime() + { + return isset($this->last_successful_backup_consistency_time); + } + + public function clearLastSuccessfulBackupConsistencyTime() + { + unset($this->last_successful_backup_consistency_time); + } + + /** + * Output only. The point in time when the last successful backup was captured + * from the source. + * + * Generated from protobuf field .google.protobuf.Timestamp last_successful_backup_consistency_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setLastSuccessfulBackupConsistencyTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->last_successful_backup_consistency_time = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/RuleConfigInfo/LastBackupState.php b/BackupDr/src/V1/RuleConfigInfo/LastBackupState.php new file mode 100644 index 000000000000..b8df1c268358 --- /dev/null +++ b/BackupDr/src/V1/RuleConfigInfo/LastBackupState.php @@ -0,0 +1,77 @@ +google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState + */ +class LastBackupState +{ + /** + * State not set. + * + * Generated from protobuf enum LAST_BACKUP_STATE_UNSPECIFIED = 0; + */ + const LAST_BACKUP_STATE_UNSPECIFIED = 0; + /** + * The first backup is pending. + * + * Generated from protobuf enum FIRST_BACKUP_PENDING = 1; + */ + const FIRST_BACKUP_PENDING = 1; + /** + * The most recent backup could not be run/failed because of the lack of + * permissions. + * + * Generated from protobuf enum PERMISSION_DENIED = 2; + */ + const PERMISSION_DENIED = 2; + /** + * The last backup operation succeeded. + * + * Generated from protobuf enum SUCCEEDED = 3; + */ + const SUCCEEDED = 3; + /** + * The last backup operation failed. + * + * Generated from protobuf enum FAILED = 4; + */ + const FAILED = 4; + + private static $valueToName = [ + self::LAST_BACKUP_STATE_UNSPECIFIED => 'LAST_BACKUP_STATE_UNSPECIFIED', + self::FIRST_BACKUP_PENDING => 'FIRST_BACKUP_PENDING', + self::PERMISSION_DENIED => 'PERMISSION_DENIED', + self::SUCCEEDED => 'SUCCEEDED', + self::FAILED => 'FAILED', + ]; + + 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/BackupDr/src/V1/Scheduling.php b/BackupDr/src/V1/Scheduling.php new file mode 100644 index 000000000000..fceb736acfde --- /dev/null +++ b/BackupDr/src/V1/Scheduling.php @@ -0,0 +1,399 @@ +google.cloud.backupdr.v1.Scheduling + */ +class Scheduling extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Defines the maintenance behavior for this instance. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Scheduling.OnHostMaintenance on_host_maintenance = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $on_host_maintenance = null; + /** + * Optional. Specifies whether the instance should be automatically restarted + * if it is terminated by Compute Engine (not terminated by a user). + * + * Generated from protobuf field optional bool automatic_restart = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $automatic_restart = null; + /** + * Optional. Defines whether the instance is preemptible. + * + * Generated from protobuf field optional bool preemptible = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $preemptible = null; + /** + * Optional. A set of node affinity and anti-affinity configurations. + * Overrides reservationAffinity. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.Scheduling.NodeAffinity node_affinities = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $node_affinities; + /** + * Optional. The minimum number of virtual CPUs this instance will consume + * when running on a sole-tenant node. + * + * Generated from protobuf field optional int32 min_node_cpus = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $min_node_cpus = null; + /** + * Optional. Specifies the provisioning model of the instance. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Scheduling.ProvisioningModel provisioning_model = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $provisioning_model = null; + /** + * Optional. Specifies the termination action for the instance. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction instance_termination_action = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $instance_termination_action = null; + /** + * Optional. Specifies the maximum amount of time a Local Ssd Vm should wait + * while recovery of the Local Ssd state is attempted. Its value should be in + * between 0 and 168 hours with hour granularity and the default value being 1 + * hour. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.SchedulingDuration local_ssd_recovery_timeout = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $local_ssd_recovery_timeout = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $on_host_maintenance + * Optional. Defines the maintenance behavior for this instance. + * @type bool $automatic_restart + * Optional. Specifies whether the instance should be automatically restarted + * if it is terminated by Compute Engine (not terminated by a user). + * @type bool $preemptible + * Optional. Defines whether the instance is preemptible. + * @type array<\Google\Cloud\BackupDR\V1\Scheduling\NodeAffinity>|\Google\Protobuf\Internal\RepeatedField $node_affinities + * Optional. A set of node affinity and anti-affinity configurations. + * Overrides reservationAffinity. + * @type int $min_node_cpus + * Optional. The minimum number of virtual CPUs this instance will consume + * when running on a sole-tenant node. + * @type int $provisioning_model + * Optional. Specifies the provisioning model of the instance. + * @type int $instance_termination_action + * Optional. Specifies the termination action for the instance. + * @type \Google\Cloud\BackupDR\V1\SchedulingDuration $local_ssd_recovery_timeout + * Optional. Specifies the maximum amount of time a Local Ssd Vm should wait + * while recovery of the Local Ssd state is attempted. Its value should be in + * between 0 and 168 hours with hour granularity and the default value being 1 + * hour. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Defines the maintenance behavior for this instance. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Scheduling.OnHostMaintenance on_host_maintenance = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getOnHostMaintenance() + { + return isset($this->on_host_maintenance) ? $this->on_host_maintenance : 0; + } + + public function hasOnHostMaintenance() + { + return isset($this->on_host_maintenance); + } + + public function clearOnHostMaintenance() + { + unset($this->on_host_maintenance); + } + + /** + * Optional. Defines the maintenance behavior for this instance. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Scheduling.OnHostMaintenance on_host_maintenance = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setOnHostMaintenance($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\Scheduling\OnHostMaintenance::class); + $this->on_host_maintenance = $var; + + return $this; + } + + /** + * Optional. Specifies whether the instance should be automatically restarted + * if it is terminated by Compute Engine (not terminated by a user). + * + * Generated from protobuf field optional bool automatic_restart = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAutomaticRestart() + { + return isset($this->automatic_restart) ? $this->automatic_restart : false; + } + + public function hasAutomaticRestart() + { + return isset($this->automatic_restart); + } + + public function clearAutomaticRestart() + { + unset($this->automatic_restart); + } + + /** + * Optional. Specifies whether the instance should be automatically restarted + * if it is terminated by Compute Engine (not terminated by a user). + * + * Generated from protobuf field optional bool automatic_restart = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAutomaticRestart($var) + { + GPBUtil::checkBool($var); + $this->automatic_restart = $var; + + return $this; + } + + /** + * Optional. Defines whether the instance is preemptible. + * + * Generated from protobuf field optional bool preemptible = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getPreemptible() + { + return isset($this->preemptible) ? $this->preemptible : false; + } + + public function hasPreemptible() + { + return isset($this->preemptible); + } + + public function clearPreemptible() + { + unset($this->preemptible); + } + + /** + * Optional. Defines whether the instance is preemptible. + * + * Generated from protobuf field optional bool preemptible = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setPreemptible($var) + { + GPBUtil::checkBool($var); + $this->preemptible = $var; + + return $this; + } + + /** + * Optional. A set of node affinity and anti-affinity configurations. + * Overrides reservationAffinity. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.Scheduling.NodeAffinity node_affinities = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNodeAffinities() + { + return $this->node_affinities; + } + + /** + * Optional. A set of node affinity and anti-affinity configurations. + * Overrides reservationAffinity. + * + * Generated from protobuf field repeated .google.cloud.backupdr.v1.Scheduling.NodeAffinity node_affinities = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\BackupDR\V1\Scheduling\NodeAffinity>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNodeAffinities($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\Scheduling\NodeAffinity::class); + $this->node_affinities = $arr; + + return $this; + } + + /** + * Optional. The minimum number of virtual CPUs this instance will consume + * when running on a sole-tenant node. + * + * Generated from protobuf field optional int32 min_node_cpus = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMinNodeCpus() + { + return isset($this->min_node_cpus) ? $this->min_node_cpus : 0; + } + + public function hasMinNodeCpus() + { + return isset($this->min_node_cpus); + } + + public function clearMinNodeCpus() + { + unset($this->min_node_cpus); + } + + /** + * Optional. The minimum number of virtual CPUs this instance will consume + * when running on a sole-tenant node. + * + * Generated from protobuf field optional int32 min_node_cpus = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMinNodeCpus($var) + { + GPBUtil::checkInt32($var); + $this->min_node_cpus = $var; + + return $this; + } + + /** + * Optional. Specifies the provisioning model of the instance. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Scheduling.ProvisioningModel provisioning_model = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getProvisioningModel() + { + return isset($this->provisioning_model) ? $this->provisioning_model : 0; + } + + public function hasProvisioningModel() + { + return isset($this->provisioning_model); + } + + public function clearProvisioningModel() + { + unset($this->provisioning_model); + } + + /** + * Optional. Specifies the provisioning model of the instance. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Scheduling.ProvisioningModel provisioning_model = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setProvisioningModel($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\Scheduling\ProvisioningModel::class); + $this->provisioning_model = $var; + + return $this; + } + + /** + * Optional. Specifies the termination action for the instance. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction instance_termination_action = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getInstanceTerminationAction() + { + return isset($this->instance_termination_action) ? $this->instance_termination_action : 0; + } + + public function hasInstanceTerminationAction() + { + return isset($this->instance_termination_action); + } + + public function clearInstanceTerminationAction() + { + unset($this->instance_termination_action); + } + + /** + * Optional. Specifies the termination action for the instance. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction instance_termination_action = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setInstanceTerminationAction($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\Scheduling\InstanceTerminationAction::class); + $this->instance_termination_action = $var; + + return $this; + } + + /** + * Optional. Specifies the maximum amount of time a Local Ssd Vm should wait + * while recovery of the Local Ssd state is attempted. Its value should be in + * between 0 and 168 hours with hour granularity and the default value being 1 + * hour. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.SchedulingDuration local_ssd_recovery_timeout = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BackupDR\V1\SchedulingDuration|null + */ + public function getLocalSsdRecoveryTimeout() + { + return $this->local_ssd_recovery_timeout; + } + + public function hasLocalSsdRecoveryTimeout() + { + return isset($this->local_ssd_recovery_timeout); + } + + public function clearLocalSsdRecoveryTimeout() + { + unset($this->local_ssd_recovery_timeout); + } + + /** + * Optional. Specifies the maximum amount of time a Local Ssd Vm should wait + * while recovery of the Local Ssd state is attempted. Its value should be in + * between 0 and 168 hours with hour granularity and the default value being 1 + * hour. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.SchedulingDuration local_ssd_recovery_timeout = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BackupDR\V1\SchedulingDuration $var + * @return $this + */ + public function setLocalSsdRecoveryTimeout($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\SchedulingDuration::class); + $this->local_ssd_recovery_timeout = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/Scheduling/InstanceTerminationAction.php b/BackupDr/src/V1/Scheduling/InstanceTerminationAction.php new file mode 100644 index 000000000000..cd01151b99d2 --- /dev/null +++ b/BackupDr/src/V1/Scheduling/InstanceTerminationAction.php @@ -0,0 +1,62 @@ +google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction + */ +class InstanceTerminationAction +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum INSTANCE_TERMINATION_ACTION_UNSPECIFIED = 0; + */ + const INSTANCE_TERMINATION_ACTION_UNSPECIFIED = 0; + /** + * Delete the VM. + * + * Generated from protobuf enum DELETE = 1; + */ + const DELETE = 1; + /** + * Stop the VM without storing in-memory content. default action. + * + * Generated from protobuf enum STOP = 2; + */ + const STOP = 2; + + private static $valueToName = [ + self::INSTANCE_TERMINATION_ACTION_UNSPECIFIED => 'INSTANCE_TERMINATION_ACTION_UNSPECIFIED', + self::DELETE => 'DELETE', + self::STOP => 'STOP', + ]; + + 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/BackupDr/src/V1/Scheduling/NodeAffinity.php b/BackupDr/src/V1/Scheduling/NodeAffinity.php new file mode 100644 index 000000000000..9068885d9fa7 --- /dev/null +++ b/BackupDr/src/V1/Scheduling/NodeAffinity.php @@ -0,0 +1,157 @@ +google.cloud.backupdr.v1.Scheduling.NodeAffinity + */ +class NodeAffinity extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Corresponds to the label key of Node resource. + * + * Generated from protobuf field optional string key = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $key = null; + /** + * Optional. Defines the operation of node selection. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator operator = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $operator = null; + /** + * Optional. Corresponds to the label values of Node resource. + * + * Generated from protobuf field repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $values; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key + * Optional. Corresponds to the label key of Node resource. + * @type int $operator + * Optional. Defines the operation of node selection. + * @type array|\Google\Protobuf\Internal\RepeatedField $values + * Optional. Corresponds to the label values of Node resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Corresponds to the label key of Node resource. + * + * Generated from protobuf field optional string key = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getKey() + { + return isset($this->key) ? $this->key : ''; + } + + public function hasKey() + { + return isset($this->key); + } + + public function clearKey() + { + unset($this->key); + } + + /** + * Optional. Corresponds to the label key of Node resource. + * + * Generated from protobuf field optional string key = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->key = $var; + + return $this; + } + + /** + * Optional. Defines the operation of node selection. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator operator = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getOperator() + { + return isset($this->operator) ? $this->operator : 0; + } + + public function hasOperator() + { + return isset($this->operator); + } + + public function clearOperator() + { + unset($this->operator); + } + + /** + * Optional. Defines the operation of node selection. + * + * Generated from protobuf field optional .google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator operator = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setOperator($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\Scheduling\NodeAffinity\Operator::class); + $this->operator = $var; + + return $this; + } + + /** + * Optional. Corresponds to the label values of Node resource. + * + * Generated from protobuf field repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getValues() + { + return $this->values; + } + + /** + * Optional. Corresponds to the label values of Node resource. + * + * Generated from protobuf field repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->values = $arr; + + return $this; + } + +} + + diff --git a/BackupDr/src/V1/Scheduling/NodeAffinity/Operator.php b/BackupDr/src/V1/Scheduling/NodeAffinity/Operator.php new file mode 100644 index 000000000000..3117fed94931 --- /dev/null +++ b/BackupDr/src/V1/Scheduling/NodeAffinity/Operator.php @@ -0,0 +1,62 @@ +google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator + */ +class Operator +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum OPERATOR_UNSPECIFIED = 0; + */ + const OPERATOR_UNSPECIFIED = 0; + /** + * Requires Compute Engine to seek for matched nodes. + * + * Generated from protobuf enum IN = 1; + */ + const IN = 1; + /** + * Requires Compute Engine to avoid certain nodes. + * + * Generated from protobuf enum NOT_IN = 2; + */ + const NOT_IN = 2; + + private static $valueToName = [ + self::OPERATOR_UNSPECIFIED => 'OPERATOR_UNSPECIFIED', + self::IN => 'IN', + self::NOT_IN => 'NOT_IN', + ]; + + 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/BackupDr/src/V1/Scheduling/OnHostMaintenance.php b/BackupDr/src/V1/Scheduling/OnHostMaintenance.php new file mode 100644 index 000000000000..9a388fd66a95 --- /dev/null +++ b/BackupDr/src/V1/Scheduling/OnHostMaintenance.php @@ -0,0 +1,64 @@ +google.cloud.backupdr.v1.Scheduling.OnHostMaintenance + */ +class OnHostMaintenance +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum ON_HOST_MAINTENANCE_UNSPECIFIED = 0; + */ + const ON_HOST_MAINTENANCE_UNSPECIFIED = 0; + /** + * Tells Compute Engine to terminate and (optionally) restart the instance + * away from the maintenance activity. + * + * Generated from protobuf enum TERMINATE = 1; + */ + const TERMINATE = 1; + /** + * Default, Allows Compute Engine to automatically migrate instances + * out of the way of maintenance events. + * + * Generated from protobuf enum MIGRATE = 1000; + */ + const MIGRATE = 1000; + + private static $valueToName = [ + self::ON_HOST_MAINTENANCE_UNSPECIFIED => 'ON_HOST_MAINTENANCE_UNSPECIFIED', + self::TERMINATE => 'TERMINATE', + self::MIGRATE => 'MIGRATE', + ]; + + 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/BackupDr/src/V1/Scheduling/ProvisioningModel.php b/BackupDr/src/V1/Scheduling/ProvisioningModel.php new file mode 100644 index 000000000000..50d92477518f --- /dev/null +++ b/BackupDr/src/V1/Scheduling/ProvisioningModel.php @@ -0,0 +1,62 @@ +google.cloud.backupdr.v1.Scheduling.ProvisioningModel + */ +class ProvisioningModel +{ + /** + * Default value. This value is not used. + * + * Generated from protobuf enum PROVISIONING_MODEL_UNSPECIFIED = 0; + */ + const PROVISIONING_MODEL_UNSPECIFIED = 0; + /** + * Standard provisioning with user controlled runtime, no discounts. + * + * Generated from protobuf enum STANDARD = 1; + */ + const STANDARD = 1; + /** + * Heavily discounted, no guaranteed runtime. + * + * Generated from protobuf enum SPOT = 2; + */ + const SPOT = 2; + + private static $valueToName = [ + self::PROVISIONING_MODEL_UNSPECIFIED => 'PROVISIONING_MODEL_UNSPECIFIED', + self::STANDARD => 'STANDARD', + self::SPOT => 'SPOT', + ]; + + 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/BackupDr/src/V1/SchedulingDuration.php b/BackupDr/src/V1/SchedulingDuration.php new file mode 100644 index 000000000000..cc3c3abf8a1a --- /dev/null +++ b/BackupDr/src/V1/SchedulingDuration.php @@ -0,0 +1,128 @@ +google.cloud.backupdr.v1.SchedulingDuration + */ +class SchedulingDuration extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Span of time at a resolution of a second. + * + * Generated from protobuf field optional int64 seconds = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $seconds = null; + /** + * Optional. Span of time that's a fraction of a second at nanosecond + * resolution. + * + * Generated from protobuf field optional int32 nanos = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $nanos = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $seconds + * Optional. Span of time at a resolution of a second. + * @type int $nanos + * Optional. Span of time that's a fraction of a second at nanosecond + * resolution. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Span of time at a resolution of a second. + * + * Generated from protobuf field optional int64 seconds = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getSeconds() + { + return isset($this->seconds) ? $this->seconds : 0; + } + + public function hasSeconds() + { + return isset($this->seconds); + } + + public function clearSeconds() + { + unset($this->seconds); + } + + /** + * Optional. Span of time at a resolution of a second. + * + * Generated from protobuf field optional int64 seconds = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setSeconds($var) + { + GPBUtil::checkInt64($var); + $this->seconds = $var; + + return $this; + } + + /** + * Optional. Span of time that's a fraction of a second at nanosecond + * resolution. + * + * Generated from protobuf field optional int32 nanos = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getNanos() + { + return isset($this->nanos) ? $this->nanos : 0; + } + + public function hasNanos() + { + return isset($this->nanos); + } + + public function clearNanos() + { + unset($this->nanos); + } + + /** + * Optional. Span of time that's a fraction of a second at nanosecond + * resolution. + * + * Generated from protobuf field optional int32 nanos = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setNanos($var) + { + GPBUtil::checkInt32($var); + $this->nanos = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/ServiceAccount.php b/BackupDr/src/V1/ServiceAccount.php new file mode 100644 index 000000000000..2555e69a2e1d --- /dev/null +++ b/BackupDr/src/V1/ServiceAccount.php @@ -0,0 +1,111 @@ +google.cloud.backupdr.v1.ServiceAccount + */ +class ServiceAccount extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Email address of the service account. + * + * Generated from protobuf field optional string email = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $email = null; + /** + * Optional. The list of scopes to be made available for this service account. + * + * Generated from protobuf field repeated string scopes = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $scopes; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $email + * Optional. Email address of the service account. + * @type array|\Google\Protobuf\Internal\RepeatedField $scopes + * Optional. The list of scopes to be made available for this service account. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Email address of the service account. + * + * Generated from protobuf field optional string email = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEmail() + { + return isset($this->email) ? $this->email : ''; + } + + public function hasEmail() + { + return isset($this->email); + } + + public function clearEmail() + { + unset($this->email); + } + + /** + * Optional. Email address of the service account. + * + * Generated from protobuf field optional string email = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEmail($var) + { + GPBUtil::checkString($var, True); + $this->email = $var; + + return $this; + } + + /** + * Optional. The list of scopes to be made available for this service account. + * + * Generated from protobuf field repeated string scopes = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getScopes() + { + return $this->scopes; + } + + /** + * Optional. The list of scopes to be made available for this service account. + * + * Generated from protobuf field repeated string scopes = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setScopes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->scopes = $arr; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/ServiceLockInfo.php b/BackupDr/src/V1/ServiceLockInfo.php new file mode 100644 index 000000000000..1191b4e15201 --- /dev/null +++ b/BackupDr/src/V1/ServiceLockInfo.php @@ -0,0 +1,72 @@ +google.cloud.backupdr.v1.ServiceLockInfo + */ +class ServiceLockInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The name of the operation that created this lock. + * The lock will automatically be released when the operation completes. + * + * Generated from protobuf field string operation = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $operation = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $operation + * Output only. The name of the operation that created this lock. + * The lock will automatically be released when the operation completes. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The name of the operation that created this lock. + * The lock will automatically be released when the operation completes. + * + * Generated from protobuf field string operation = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getOperation() + { + return $this->operation; + } + + /** + * Output only. The name of the operation that created this lock. + * The lock will automatically be released when the operation completes. + * + * Generated from protobuf field string operation = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setOperation($var) + { + GPBUtil::checkString($var, True); + $this->operation = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/StandardSchedule.php b/BackupDr/src/V1/StandardSchedule.php new file mode 100644 index 000000000000..a6936ec9b05d --- /dev/null +++ b/BackupDr/src/V1/StandardSchedule.php @@ -0,0 +1,447 @@ +google.cloud.backupdr.v1.StandardSchedule + */ +class StandardSchedule extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Specifies the `RecurrenceType` for the schedule. + * + * Generated from protobuf field .google.cloud.backupdr.v1.StandardSchedule.RecurrenceType recurrence_type = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $recurrence_type = 0; + /** + * Optional. Specifies frequency for hourly backups. A hourly frequency of 2 + * means jobs will run every 2 hours from start time till end time defined. + * This is required for `recurrence_type`, `HOURLY` and is not applicable + * otherwise. A validation error will occur if a value is supplied and + * `recurrence_type` is not `HOURLY`. + * Value of hourly frequency should be between 6 and 23. + * Reason for limit : We found that there is bandwidth limitation of 3GB/S for + * GMI while taking a backup and 5GB/S while doing a restore. Given the amount + * of parallel backups and restore we are targeting, this will potentially + * take the backup time to mins and hours (in worst case scenario). + * + * Generated from protobuf field int32 hourly_frequency = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $hourly_frequency = 0; + /** + * Optional. Specifies days of week like, MONDAY or TUESDAY, on which jobs + * will run. + * This is required for `recurrence_type`, `WEEKLY` and is not applicable + * otherwise. A validation error will occur if a value is supplied and + * `recurrence_type` is not `WEEKLY`. + * + * Generated from protobuf field repeated .google.type.DayOfWeek days_of_week = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $days_of_week; + /** + * Optional. Specifies days of months like 1, 5, or 14 on which jobs will run. + * Values for `days_of_month` are only applicable for `recurrence_type`, + * `MONTHLY` and `YEARLY`. A validation error will occur if other values are + * supplied. + * + * Generated from protobuf field repeated int32 days_of_month = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $days_of_month; + /** + * Optional. Specifies a week day of the month like, FIRST SUNDAY or LAST + * MONDAY, on which jobs will run. This will be specified by two fields in + * `WeekDayOfMonth`, one for the day, e.g. `MONDAY`, and one for the week, + * e.g. `LAST`. + * This field is only applicable for `recurrence_type`, `MONTHLY` and + * `YEARLY`. A validation error will occur if other values are supplied. + * + * Generated from protobuf field .google.cloud.backupdr.v1.WeekDayOfMonth week_day_of_month = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $week_day_of_month = null; + /** + * Optional. Specifies the months of year, like `FEBRUARY` and/or `MAY`, on + * which jobs will run. + * This field is only applicable when `recurrence_type` is `YEARLY`. A + * validation error will occur if other values are supplied. + * + * Generated from protobuf field repeated .google.type.Month months = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $months; + /** + * Required. A BackupWindow defines the window of day during which backup jobs + * will run. Jobs are queued at the beginning of the window and will be marked + * as `NOT_RUN` if they do not start by the end of the window. + * Note: running jobs will not be cancelled at the end of the window. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupWindow backup_window = 7 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backup_window = null; + /** + * Required. The time zone to be used when interpreting the schedule. + * The value of this field must be a time zone name from the IANA tz database. + * See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for the + * list of valid timezone names. For e.g., Europe/Paris. + * + * Generated from protobuf field string time_zone = 8 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $time_zone = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $recurrence_type + * Required. Specifies the `RecurrenceType` for the schedule. + * @type int $hourly_frequency + * Optional. Specifies frequency for hourly backups. A hourly frequency of 2 + * means jobs will run every 2 hours from start time till end time defined. + * This is required for `recurrence_type`, `HOURLY` and is not applicable + * otherwise. A validation error will occur if a value is supplied and + * `recurrence_type` is not `HOURLY`. + * Value of hourly frequency should be between 6 and 23. + * Reason for limit : We found that there is bandwidth limitation of 3GB/S for + * GMI while taking a backup and 5GB/S while doing a restore. Given the amount + * of parallel backups and restore we are targeting, this will potentially + * take the backup time to mins and hours (in worst case scenario). + * @type array|\Google\Protobuf\Internal\RepeatedField $days_of_week + * Optional. Specifies days of week like, MONDAY or TUESDAY, on which jobs + * will run. + * This is required for `recurrence_type`, `WEEKLY` and is not applicable + * otherwise. A validation error will occur if a value is supplied and + * `recurrence_type` is not `WEEKLY`. + * @type array|\Google\Protobuf\Internal\RepeatedField $days_of_month + * Optional. Specifies days of months like 1, 5, or 14 on which jobs will run. + * Values for `days_of_month` are only applicable for `recurrence_type`, + * `MONTHLY` and `YEARLY`. A validation error will occur if other values are + * supplied. + * @type \Google\Cloud\BackupDR\V1\WeekDayOfMonth $week_day_of_month + * Optional. Specifies a week day of the month like, FIRST SUNDAY or LAST + * MONDAY, on which jobs will run. This will be specified by two fields in + * `WeekDayOfMonth`, one for the day, e.g. `MONDAY`, and one for the week, + * e.g. `LAST`. + * This field is only applicable for `recurrence_type`, `MONTHLY` and + * `YEARLY`. A validation error will occur if other values are supplied. + * @type array|\Google\Protobuf\Internal\RepeatedField $months + * Optional. Specifies the months of year, like `FEBRUARY` and/or `MAY`, on + * which jobs will run. + * This field is only applicable when `recurrence_type` is `YEARLY`. A + * validation error will occur if other values are supplied. + * @type \Google\Cloud\BackupDR\V1\BackupWindow $backup_window + * Required. A BackupWindow defines the window of day during which backup jobs + * will run. Jobs are queued at the beginning of the window and will be marked + * as `NOT_RUN` if they do not start by the end of the window. + * Note: running jobs will not be cancelled at the end of the window. + * @type string $time_zone + * Required. The time zone to be used when interpreting the schedule. + * The value of this field must be a time zone name from the IANA tz database. + * See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for the + * list of valid timezone names. For e.g., Europe/Paris. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupplan::initOnce(); + parent::__construct($data); + } + + /** + * Required. Specifies the `RecurrenceType` for the schedule. + * + * Generated from protobuf field .google.cloud.backupdr.v1.StandardSchedule.RecurrenceType recurrence_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getRecurrenceType() + { + return $this->recurrence_type; + } + + /** + * Required. Specifies the `RecurrenceType` for the schedule. + * + * Generated from protobuf field .google.cloud.backupdr.v1.StandardSchedule.RecurrenceType recurrence_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setRecurrenceType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\StandardSchedule\RecurrenceType::class); + $this->recurrence_type = $var; + + return $this; + } + + /** + * Optional. Specifies frequency for hourly backups. A hourly frequency of 2 + * means jobs will run every 2 hours from start time till end time defined. + * This is required for `recurrence_type`, `HOURLY` and is not applicable + * otherwise. A validation error will occur if a value is supplied and + * `recurrence_type` is not `HOURLY`. + * Value of hourly frequency should be between 6 and 23. + * Reason for limit : We found that there is bandwidth limitation of 3GB/S for + * GMI while taking a backup and 5GB/S while doing a restore. Given the amount + * of parallel backups and restore we are targeting, this will potentially + * take the backup time to mins and hours (in worst case scenario). + * + * Generated from protobuf field int32 hourly_frequency = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getHourlyFrequency() + { + return $this->hourly_frequency; + } + + /** + * Optional. Specifies frequency for hourly backups. A hourly frequency of 2 + * means jobs will run every 2 hours from start time till end time defined. + * This is required for `recurrence_type`, `HOURLY` and is not applicable + * otherwise. A validation error will occur if a value is supplied and + * `recurrence_type` is not `HOURLY`. + * Value of hourly frequency should be between 6 and 23. + * Reason for limit : We found that there is bandwidth limitation of 3GB/S for + * GMI while taking a backup and 5GB/S while doing a restore. Given the amount + * of parallel backups and restore we are targeting, this will potentially + * take the backup time to mins and hours (in worst case scenario). + * + * Generated from protobuf field int32 hourly_frequency = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setHourlyFrequency($var) + { + GPBUtil::checkInt32($var); + $this->hourly_frequency = $var; + + return $this; + } + + /** + * Optional. Specifies days of week like, MONDAY or TUESDAY, on which jobs + * will run. + * This is required for `recurrence_type`, `WEEKLY` and is not applicable + * otherwise. A validation error will occur if a value is supplied and + * `recurrence_type` is not `WEEKLY`. + * + * Generated from protobuf field repeated .google.type.DayOfWeek days_of_week = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDaysOfWeek() + { + return $this->days_of_week; + } + + /** + * Optional. Specifies days of week like, MONDAY or TUESDAY, on which jobs + * will run. + * This is required for `recurrence_type`, `WEEKLY` and is not applicable + * otherwise. A validation error will occur if a value is supplied and + * `recurrence_type` is not `WEEKLY`. + * + * Generated from protobuf field repeated .google.type.DayOfWeek days_of_week = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDaysOfWeek($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Type\DayOfWeek::class); + $this->days_of_week = $arr; + + return $this; + } + + /** + * Optional. Specifies days of months like 1, 5, or 14 on which jobs will run. + * Values for `days_of_month` are only applicable for `recurrence_type`, + * `MONTHLY` and `YEARLY`. A validation error will occur if other values are + * supplied. + * + * Generated from protobuf field repeated int32 days_of_month = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDaysOfMonth() + { + return $this->days_of_month; + } + + /** + * Optional. Specifies days of months like 1, 5, or 14 on which jobs will run. + * Values for `days_of_month` are only applicable for `recurrence_type`, + * `MONTHLY` and `YEARLY`. A validation error will occur if other values are + * supplied. + * + * Generated from protobuf field repeated int32 days_of_month = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDaysOfMonth($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); + $this->days_of_month = $arr; + + return $this; + } + + /** + * Optional. Specifies a week day of the month like, FIRST SUNDAY or LAST + * MONDAY, on which jobs will run. This will be specified by two fields in + * `WeekDayOfMonth`, one for the day, e.g. `MONDAY`, and one for the week, + * e.g. `LAST`. + * This field is only applicable for `recurrence_type`, `MONTHLY` and + * `YEARLY`. A validation error will occur if other values are supplied. + * + * Generated from protobuf field .google.cloud.backupdr.v1.WeekDayOfMonth week_day_of_month = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\BackupDR\V1\WeekDayOfMonth|null + */ + public function getWeekDayOfMonth() + { + return $this->week_day_of_month; + } + + public function hasWeekDayOfMonth() + { + return isset($this->week_day_of_month); + } + + public function clearWeekDayOfMonth() + { + unset($this->week_day_of_month); + } + + /** + * Optional. Specifies a week day of the month like, FIRST SUNDAY or LAST + * MONDAY, on which jobs will run. This will be specified by two fields in + * `WeekDayOfMonth`, one for the day, e.g. `MONDAY`, and one for the week, + * e.g. `LAST`. + * This field is only applicable for `recurrence_type`, `MONTHLY` and + * `YEARLY`. A validation error will occur if other values are supplied. + * + * Generated from protobuf field .google.cloud.backupdr.v1.WeekDayOfMonth week_day_of_month = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\BackupDR\V1\WeekDayOfMonth $var + * @return $this + */ + public function setWeekDayOfMonth($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\WeekDayOfMonth::class); + $this->week_day_of_month = $var; + + return $this; + } + + /** + * Optional. Specifies the months of year, like `FEBRUARY` and/or `MAY`, on + * which jobs will run. + * This field is only applicable when `recurrence_type` is `YEARLY`. A + * validation error will occur if other values are supplied. + * + * Generated from protobuf field repeated .google.type.Month months = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMonths() + { + return $this->months; + } + + /** + * Optional. Specifies the months of year, like `FEBRUARY` and/or `MAY`, on + * which jobs will run. + * This field is only applicable when `recurrence_type` is `YEARLY`. A + * validation error will occur if other values are supplied. + * + * Generated from protobuf field repeated .google.type.Month months = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMonths($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Type\Month::class); + $this->months = $arr; + + return $this; + } + + /** + * Required. A BackupWindow defines the window of day during which backup jobs + * will run. Jobs are queued at the beginning of the window and will be marked + * as `NOT_RUN` if they do not start by the end of the window. + * Note: running jobs will not be cancelled at the end of the window. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupWindow backup_window = 7 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BackupDR\V1\BackupWindow|null + */ + public function getBackupWindow() + { + return $this->backup_window; + } + + public function hasBackupWindow() + { + return isset($this->backup_window); + } + + public function clearBackupWindow() + { + unset($this->backup_window); + } + + /** + * Required. A BackupWindow defines the window of day during which backup jobs + * will run. Jobs are queued at the beginning of the window and will be marked + * as `NOT_RUN` if they do not start by the end of the window. + * Note: running jobs will not be cancelled at the end of the window. + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupWindow backup_window = 7 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BackupDR\V1\BackupWindow $var + * @return $this + */ + public function setBackupWindow($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\BackupWindow::class); + $this->backup_window = $var; + + return $this; + } + + /** + * Required. The time zone to be used when interpreting the schedule. + * The value of this field must be a time zone name from the IANA tz database. + * See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for the + * list of valid timezone names. For e.g., Europe/Paris. + * + * Generated from protobuf field string time_zone = 8 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTimeZone() + { + return $this->time_zone; + } + + /** + * Required. The time zone to be used when interpreting the schedule. + * The value of this field must be a time zone name from the IANA tz database. + * See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for the + * list of valid timezone names. For e.g., Europe/Paris. + * + * Generated from protobuf field string time_zone = 8 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTimeZone($var) + { + GPBUtil::checkString($var, True); + $this->time_zone = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/StandardSchedule/RecurrenceType.php b/BackupDr/src/V1/StandardSchedule/RecurrenceType.php new file mode 100644 index 000000000000..4ee2035fcff1 --- /dev/null +++ b/BackupDr/src/V1/StandardSchedule/RecurrenceType.php @@ -0,0 +1,83 @@ +google.cloud.backupdr.v1.StandardSchedule.RecurrenceType + */ +class RecurrenceType +{ + /** + * recurrence type not set + * + * Generated from protobuf enum RECURRENCE_TYPE_UNSPECIFIED = 0; + */ + const RECURRENCE_TYPE_UNSPECIFIED = 0; + /** + * The `BackupRule` is to be applied hourly. + * + * Generated from protobuf enum HOURLY = 1; + */ + const HOURLY = 1; + /** + * The `BackupRule` is to be applied daily. + * + * Generated from protobuf enum DAILY = 2; + */ + const DAILY = 2; + /** + * The `BackupRule` is to be applied weekly. + * + * Generated from protobuf enum WEEKLY = 3; + */ + const WEEKLY = 3; + /** + * The `BackupRule` is to be applied monthly. + * + * Generated from protobuf enum MONTHLY = 4; + */ + const MONTHLY = 4; + /** + * The `BackupRule` is to be applied yearly. + * + * Generated from protobuf enum YEARLY = 5; + */ + const YEARLY = 5; + + private static $valueToName = [ + self::RECURRENCE_TYPE_UNSPECIFIED => 'RECURRENCE_TYPE_UNSPECIFIED', + self::HOURLY => 'HOURLY', + self::DAILY => 'DAILY', + self::WEEKLY => 'WEEKLY', + self::MONTHLY => 'MONTHLY', + self::YEARLY => 'YEARLY', + ]; + + 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/BackupDr/src/V1/Tags.php b/BackupDr/src/V1/Tags.php new file mode 100644 index 000000000000..5c7e2cc19aff --- /dev/null +++ b/BackupDr/src/V1/Tags.php @@ -0,0 +1,71 @@ +google.cloud.backupdr.v1.Tags + */ +class Tags extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. An array of tags. Each tag must be 1-63 characters long, and + * comply with RFC1035. + * + * Generated from protobuf field repeated string items = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $items; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $items + * Optional. An array of tags. Each tag must be 1-63 characters long, and + * comply with RFC1035. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\BackupvaultGce::initOnce(); + parent::__construct($data); + } + + /** + * Optional. An array of tags. Each tag must be 1-63 characters long, and + * comply with RFC1035. + * + * Generated from protobuf field repeated string items = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * Optional. An array of tags. Each tag must be 1-63 characters long, and + * comply with RFC1035. + * + * Generated from protobuf field repeated string items = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->items = $arr; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/TargetResource.php b/BackupDr/src/V1/TargetResource.php new file mode 100644 index 000000000000..2b664c8ac0b2 --- /dev/null +++ b/BackupDr/src/V1/TargetResource.php @@ -0,0 +1,75 @@ +google.cloud.backupdr.v1.TargetResource + */ +class TargetResource extends \Google\Protobuf\Internal\Message +{ + protected $target_resource_info; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BackupDR\V1\GcpResource $gcp_resource + * Details of the native Google Cloud resource created as part of restore. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Details of the native Google Cloud resource created as part of restore. + * + * Generated from protobuf field .google.cloud.backupdr.v1.GcpResource gcp_resource = 1; + * @return \Google\Cloud\BackupDR\V1\GcpResource|null + */ + public function getGcpResource() + { + return $this->readOneof(1); + } + + public function hasGcpResource() + { + return $this->hasOneof(1); + } + + /** + * Details of the native Google Cloud resource created as part of restore. + * + * Generated from protobuf field .google.cloud.backupdr.v1.GcpResource gcp_resource = 1; + * @param \Google\Cloud\BackupDR\V1\GcpResource $var + * @return $this + */ + public function setGcpResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\GcpResource::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getTargetResourceInfo() + { + return $this->whichOneof("target_resource_info"); + } + +} + diff --git a/BackupDr/src/V1/TriggerBackupRequest.php b/BackupDr/src/V1/TriggerBackupRequest.php new file mode 100644 index 000000000000..c83aa7eafd80 --- /dev/null +++ b/BackupDr/src/V1/TriggerBackupRequest.php @@ -0,0 +1,196 @@ +google.cloud.backupdr.v1.TriggerBackupRequest + */ +class TriggerBackupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. backup rule_id for which a backup needs to be triggered. + * + * Generated from protobuf field string rule_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $rule_id = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + + /** + * @param string $name Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + * Please see {@see BackupDRClient::backupPlanAssociationName()} for help formatting this field. + * @param string $ruleId Required. backup rule_id for which a backup needs to be triggered. + * + * @return \Google\Cloud\BackupDR\V1\TriggerBackupRequest + * + * @experimental + */ + public static function build(string $name, string $ruleId): self + { + return (new self()) + ->setName($name) + ->setRuleId($ruleId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + * @type string $rule_id + * Required. backup rule_id for which a backup needs to be triggered. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupplanassociation::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. backup rule_id for which a backup needs to be triggered. + * + * Generated from protobuf field string rule_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRuleId() + { + return $this->rule_id; + } + + /** + * Required. backup rule_id for which a backup needs to be triggered. + * + * Generated from protobuf field string rule_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRuleId($var) + { + GPBUtil::checkString($var, True); + $this->rule_id = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/UpdateBackupRequest.php b/BackupDr/src/V1/UpdateBackupRequest.php new file mode 100644 index 000000000000..45590b90791f --- /dev/null +++ b/BackupDr/src/V1/UpdateBackupRequest.php @@ -0,0 +1,230 @@ +google.cloud.backupdr.v1.UpdateBackupRequest + */ +class UpdateBackupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * Backup resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.backupdr.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backup = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + + /** + * @param \Google\Cloud\BackupDR\V1\Backup $backup Required. The resource being updated + * @param \Google\Protobuf\FieldMask $updateMask Required. Field mask is used to specify the fields to be overwritten in the + * Backup resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * + * @return \Google\Cloud\BackupDR\V1\UpdateBackupRequest + * + * @experimental + */ + public static function build(\Google\Cloud\BackupDR\V1\Backup $backup, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setBackup($backup) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Required. Field mask is used to specify the fields to be overwritten in the + * Backup resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * @type \Google\Cloud\BackupDR\V1\Backup $backup + * Required. The resource being updated + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * Backup resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * Backup resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.backupdr.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BackupDR\V1\Backup|null + */ + public function getBackup() + { + return $this->backup; + } + + public function hasBackup() + { + return isset($this->backup); + } + + public function clearBackup() + { + unset($this->backup); + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.backupdr.v1.Backup backup = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BackupDR\V1\Backup $var + * @return $this + */ + public function setBackup($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\Backup::class); + $this->backup = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/UpdateBackupVaultRequest.php b/BackupDr/src/V1/UpdateBackupVaultRequest.php new file mode 100644 index 000000000000..4a985422b43f --- /dev/null +++ b/BackupDr/src/V1/UpdateBackupVaultRequest.php @@ -0,0 +1,306 @@ +google.cloud.backupdr.v1.UpdateBackupVaultRequest + */ +class UpdateBackupVaultRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * BackupVault resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupVault backup_vault = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backup_vault = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + /** + * Optional. If set to true, will not check plan duration against backup vault + * enforcement duration. + * + * Generated from protobuf field bool force = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $force = false; + + /** + * @param \Google\Cloud\BackupDR\V1\BackupVault $backupVault Required. The resource being updated + * @param \Google\Protobuf\FieldMask $updateMask Required. Field mask is used to specify the fields to be overwritten in the + * BackupVault resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * + * @return \Google\Cloud\BackupDR\V1\UpdateBackupVaultRequest + * + * @experimental + */ + public static function build(\Google\Cloud\BackupDR\V1\BackupVault $backupVault, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setBackupVault($backupVault) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Required. Field mask is used to specify the fields to be overwritten in the + * BackupVault resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * @type \Google\Cloud\BackupDR\V1\BackupVault $backup_vault + * Required. The resource being updated + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $validate_only + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + * @type bool $force + * Optional. If set to true, will not check plan duration against backup vault + * enforcement duration. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * BackupVault resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * BackupVault resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupVault backup_vault = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BackupDR\V1\BackupVault|null + */ + public function getBackupVault() + { + return $this->backup_vault; + } + + public function hasBackupVault() + { + return isset($this->backup_vault); + } + + public function clearBackupVault() + { + unset($this->backup_vault); + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.backupdr.v1.BackupVault backup_vault = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BackupDR\V1\BackupVault $var + * @return $this + */ + public function setBackupVault($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\BackupVault::class); + $this->backup_vault = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * Optional. If set to true, will not check plan duration against backup vault + * enforcement duration. + * + * Generated from protobuf field bool force = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getForce() + { + return $this->force; + } + + /** + * Optional. If set to true, will not check plan duration against backup vault + * enforcement duration. + * + * Generated from protobuf field bool force = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setForce($var) + { + GPBUtil::checkBool($var); + $this->force = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/UpdateDataSourceRequest.php b/BackupDr/src/V1/UpdateDataSourceRequest.php new file mode 100644 index 000000000000..86e234620cef --- /dev/null +++ b/BackupDr/src/V1/UpdateDataSourceRequest.php @@ -0,0 +1,264 @@ +google.cloud.backupdr.v1.UpdateDataSourceRequest + */ +class UpdateDataSourceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * DataSource resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.backupdr.v1.DataSource data_source = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $data_source = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + /** + * Optional. Enable upsert. + * + * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $allow_missing = false; + + /** + * @param \Google\Cloud\BackupDR\V1\DataSource $dataSource Required. The resource being updated + * @param \Google\Protobuf\FieldMask $updateMask Required. Field mask is used to specify the fields to be overwritten in the + * DataSource resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * + * @return \Google\Cloud\BackupDR\V1\UpdateDataSourceRequest + * + * @experimental + */ + public static function build(\Google\Cloud\BackupDR\V1\DataSource $dataSource, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setDataSource($dataSource) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Required. Field mask is used to specify the fields to be overwritten in the + * DataSource resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * @type \Google\Cloud\BackupDR\V1\DataSource $data_source + * Required. The resource being updated + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $allow_missing + * Optional. Enable upsert. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce(); + parent::__construct($data); + } + + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * DataSource resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * DataSource resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.backupdr.v1.DataSource data_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\BackupDR\V1\DataSource|null + */ + public function getDataSource() + { + return $this->data_source; + } + + public function hasDataSource() + { + return isset($this->data_source); + } + + public function clearDataSource() + { + unset($this->data_source); + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.backupdr.v1.DataSource data_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\BackupDR\V1\DataSource $var + * @return $this + */ + public function setDataSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\DataSource::class); + $this->data_source = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. Enable upsert. + * + * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * Optional. Enable upsert. + * + * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/WeekDayOfMonth.php b/BackupDr/src/V1/WeekDayOfMonth.php new file mode 100644 index 000000000000..31a37263235e --- /dev/null +++ b/BackupDr/src/V1/WeekDayOfMonth.php @@ -0,0 +1,103 @@ +google.cloud.backupdr.v1.WeekDayOfMonth + */ +class WeekDayOfMonth extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Specifies the week of the month. + * + * Generated from protobuf field .google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth week_of_month = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $week_of_month = 0; + /** + * Required. Specifies the day of the week. + * + * Generated from protobuf field .google.type.DayOfWeek day_of_week = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $day_of_week = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $week_of_month + * Required. Specifies the week of the month. + * @type int $day_of_week + * Required. Specifies the day of the week. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Backupdr\V1\Backupplan::initOnce(); + parent::__construct($data); + } + + /** + * Required. Specifies the week of the month. + * + * Generated from protobuf field .google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth week_of_month = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getWeekOfMonth() + { + return $this->week_of_month; + } + + /** + * Required. Specifies the week of the month. + * + * Generated from protobuf field .google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth week_of_month = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setWeekOfMonth($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\WeekDayOfMonth\WeekOfMonth::class); + $this->week_of_month = $var; + + return $this; + } + + /** + * Required. Specifies the day of the week. + * + * Generated from protobuf field .google.type.DayOfWeek day_of_week = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getDayOfWeek() + { + return $this->day_of_week; + } + + /** + * Required. Specifies the day of the week. + * + * Generated from protobuf field .google.type.DayOfWeek day_of_week = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setDayOfWeek($var) + { + GPBUtil::checkEnum($var, \Google\Type\DayOfWeek::class); + $this->day_of_week = $var; + + return $this; + } + +} + diff --git a/BackupDr/src/V1/WeekDayOfMonth/WeekOfMonth.php b/BackupDr/src/V1/WeekDayOfMonth/WeekOfMonth.php new file mode 100644 index 000000000000..261806c3b318 --- /dev/null +++ b/BackupDr/src/V1/WeekDayOfMonth/WeekOfMonth.php @@ -0,0 +1,84 @@ +google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth + */ +class WeekOfMonth +{ + /** + * The zero value. Do not use. + * + * Generated from protobuf enum WEEK_OF_MONTH_UNSPECIFIED = 0; + */ + const WEEK_OF_MONTH_UNSPECIFIED = 0; + /** + * The first week of the month. + * + * Generated from protobuf enum FIRST = 1; + */ + const FIRST = 1; + /** + * The second week of the month. + * + * Generated from protobuf enum SECOND = 2; + */ + const SECOND = 2; + /** + * The third week of the month. + * + * Generated from protobuf enum THIRD = 3; + */ + const THIRD = 3; + /** + * The fourth week of the month. + * + * Generated from protobuf enum FOURTH = 4; + */ + const FOURTH = 4; + /** + * The last week of the month. + * + * Generated from protobuf enum LAST = 5; + */ + const LAST = 5; + + private static $valueToName = [ + self::WEEK_OF_MONTH_UNSPECIFIED => 'WEEK_OF_MONTH_UNSPECIFIED', + self::FIRST => 'FIRST', + self::SECOND => 'SECOND', + self::THIRD => 'THIRD', + self::FOURTH => 'FOURTH', + self::LAST => 'LAST', + ]; + + 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/BackupDr/src/V1/gapic_metadata.json b/BackupDr/src/V1/gapic_metadata.json index 37b3567fa87d..130c7f38a667 100644 --- a/BackupDr/src/V1/gapic_metadata.json +++ b/BackupDr/src/V1/gapic_metadata.json @@ -10,26 +10,141 @@ "grpc": { "libraryClient": "BackupDRGapicClient", "rpcs": { + "CreateBackupPlan": { + "methods": [ + "createBackupPlan" + ] + }, + "CreateBackupPlanAssociation": { + "methods": [ + "createBackupPlanAssociation" + ] + }, + "CreateBackupVault": { + "methods": [ + "createBackupVault" + ] + }, "CreateManagementServer": { "methods": [ "createManagementServer" ] }, + "DeleteBackup": { + "methods": [ + "deleteBackup" + ] + }, + "DeleteBackupPlan": { + "methods": [ + "deleteBackupPlan" + ] + }, + "DeleteBackupPlanAssociation": { + "methods": [ + "deleteBackupPlanAssociation" + ] + }, + "DeleteBackupVault": { + "methods": [ + "deleteBackupVault" + ] + }, "DeleteManagementServer": { "methods": [ "deleteManagementServer" ] }, + "FetchUsableBackupVaults": { + "methods": [ + "fetchUsableBackupVaults" + ] + }, + "GetBackup": { + "methods": [ + "getBackup" + ] + }, + "GetBackupPlan": { + "methods": [ + "getBackupPlan" + ] + }, + "GetBackupPlanAssociation": { + "methods": [ + "getBackupPlanAssociation" + ] + }, + "GetBackupVault": { + "methods": [ + "getBackupVault" + ] + }, + "GetDataSource": { + "methods": [ + "getDataSource" + ] + }, "GetManagementServer": { "methods": [ "getManagementServer" ] }, + "ListBackupPlanAssociations": { + "methods": [ + "listBackupPlanAssociations" + ] + }, + "ListBackupPlans": { + "methods": [ + "listBackupPlans" + ] + }, + "ListBackupVaults": { + "methods": [ + "listBackupVaults" + ] + }, + "ListBackups": { + "methods": [ + "listBackups" + ] + }, + "ListDataSources": { + "methods": [ + "listDataSources" + ] + }, "ListManagementServers": { "methods": [ "listManagementServers" ] }, + "RestoreBackup": { + "methods": [ + "restoreBackup" + ] + }, + "TriggerBackup": { + "methods": [ + "triggerBackup" + ] + }, + "UpdateBackup": { + "methods": [ + "updateBackup" + ] + }, + "UpdateBackupVault": { + "methods": [ + "updateBackupVault" + ] + }, + "UpdateDataSource": { + "methods": [ + "updateDataSource" + ] + }, "GetLocation": { "methods": [ "getLocation" diff --git a/BackupDr/src/V1/resources/backup_dr_client_config.json b/BackupDr/src/V1/resources/backup_dr_client_config.json index 5c162679d6d7..c505f44b1add 100644 --- a/BackupDr/src/V1/resources/backup_dr_client_config.json +++ b/BackupDr/src/V1/resources/backup_dr_client_config.json @@ -38,26 +38,141 @@ } }, "methods": { + "CreateBackupPlan": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "CreateBackupPlanAssociation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "CreateBackupVault": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "CreateManagementServer": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "DeleteBackup": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "DeleteBackupPlan": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "DeleteBackupPlanAssociation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "DeleteBackupVault": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "DeleteManagementServer": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "FetchUsableBackupVaults": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetBackup": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetBackupPlan": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetBackupPlanAssociation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetBackupVault": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetDataSource": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "GetManagementServer": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "ListBackupPlanAssociations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListBackupPlans": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListBackupVaults": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListBackups": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListDataSources": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "ListManagementServers": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "RestoreBackup": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TriggerBackup": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateBackup": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateBackupVault": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateDataSource": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "GetLocation": { "timeout_millis": 60000, "retry_codes_name": "no_retry_codes", diff --git a/BackupDr/src/V1/resources/backup_dr_descriptor_config.php b/BackupDr/src/V1/resources/backup_dr_descriptor_config.php index 44417b94b54a..669fa4bd998c 100644 --- a/BackupDr/src/V1/resources/backup_dr_descriptor_config.php +++ b/BackupDr/src/V1/resources/backup_dr_descriptor_config.php @@ -23,6 +23,63 @@ return [ 'interfaces' => [ 'google.cloud.backupdr.v1.BackupDR' => [ + 'CreateBackupPlan' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BackupDR\V1\BackupPlan', + 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateBackupPlanAssociation' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BackupDR\V1\BackupPlanAssociation', + 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateBackupVault' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BackupDR\V1\BackupVault', + 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'CreateManagementServer' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Cloud\BackupDR\V1\ManagementServer', @@ -42,6 +99,82 @@ ], ], ], + 'DeleteBackup' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BackupDR\V1\Backup', + 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteBackupPlan' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteBackupPlanAssociation' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteBackupVault' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'DeleteManagementServer' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Protobuf\GPBEmpty', @@ -61,6 +194,184 @@ ], ], ], + 'RestoreBackup' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BackupDR\V1\RestoreBackupResponse', + 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'TriggerBackup' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BackupDR\V1\BackupPlanAssociation', + 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateBackup' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BackupDR\V1\Backup', + 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'backup.name', + 'fieldAccessors' => [ + 'getBackup', + 'getName', + ], + ], + ], + ], + 'UpdateBackupVault' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BackupDR\V1\BackupVault', + 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'backup_vault.name', + 'fieldAccessors' => [ + 'getBackupVault', + 'getName', + ], + ], + ], + ], + 'UpdateDataSource' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\BackupDR\V1\DataSource', + 'metadataReturnType' => '\Google\Cloud\BackupDR\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'data_source.name', + 'fieldAccessors' => [ + 'getDataSource', + 'getName', + ], + ], + ], + ], + 'FetchUsableBackupVaults' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getBackupVaults', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BackupDR\V1\FetchUsableBackupVaultsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetBackup' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BackupDR\V1\Backup', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetBackupPlan' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BackupDR\V1\BackupPlan', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetBackupPlanAssociation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BackupDR\V1\BackupPlanAssociation', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetBackupVault' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BackupDR\V1\BackupVault', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetDataSource' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\BackupDR\V1\DataSource', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'GetManagementServer' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\BackupDR\V1\ManagementServer', @@ -73,6 +384,106 @@ ], ], ], + 'ListBackupPlanAssociations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getBackupPlanAssociations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BackupDR\V1\ListBackupPlanAssociationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListBackupPlans' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getBackupPlans', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BackupDR\V1\ListBackupPlansResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListBackupVaults' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getBackupVaults', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BackupDR\V1\ListBackupVaultsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListBackups' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getBackups', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BackupDR\V1\ListBackupsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListDataSources' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getDataSources', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\BackupDR\V1\ListDataSourcesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'ListManagementServers' => [ 'pageStreaming' => [ 'requestPageTokenGetMethod' => 'getPageToken', @@ -167,6 +578,11 @@ 'interfaceOverride' => 'google.iam.v1.IAMPolicy', ], 'templateMap' => [ + 'backup' => 'projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup}', + 'backupPlan' => 'projects/{project}/locations/{location}/backupPlans/{backup_plan}', + 'backupPlanAssociation' => 'projects/{project}/locations/{location}/backupPlanAssociations/{backup_plan_association}', + 'backupVault' => 'projects/{project}/locations/{location}/backupVaults/{backupvault}', + 'dataSource' => 'projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}', 'location' => 'projects/{project}/locations/{location}', 'managementServer' => 'projects/{project}/locations/{location}/managementServers/{managementserver}', ], diff --git a/BackupDr/src/V1/resources/backup_dr_rest_client_config.php b/BackupDr/src/V1/resources/backup_dr_rest_client_config.php index 41f4e3a9cf92..072b35af529f 100644 --- a/BackupDr/src/V1/resources/backup_dr_rest_client_config.php +++ b/BackupDr/src/V1/resources/backup_dr_rest_client_config.php @@ -23,6 +23,51 @@ return [ 'interfaces' => [ 'google.cloud.backupdr.v1.BackupDR' => [ + 'CreateBackupPlan' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/backupPlans', + 'body' => 'backup_plan', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'backup_plan_id', + ], + ], + 'CreateBackupPlanAssociation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/backupPlanAssociations', + 'body' => 'backup_plan_association', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'backup_plan_association_id', + ], + ], + 'CreateBackupVault' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/backupVaults', + 'body' => 'backup_vault', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'backup_vault_id', + ], + ], 'CreateManagementServer' => [ 'method' => 'post', 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/managementServers', @@ -38,6 +83,50 @@ 'management_server_id', ], ], + 'DeleteBackup' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteBackupPlan' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupPlans/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteBackupPlanAssociation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupPlanAssociations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteBackupVault' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupVaults/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'DeleteManagementServer' => [ 'method' => 'delete', 'uriTemplate' => '/v1/{name=projects/*/locations/*/managementServers/*}', @@ -49,6 +138,72 @@ ], ], ], + 'FetchUsableBackupVaults' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/backupVaults:fetchUsable', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'GetBackup' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetBackupPlan' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupPlans/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetBackupPlanAssociation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupPlanAssociations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetBackupVault' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupVaults/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetDataSource' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetManagementServer' => [ 'method' => 'get', 'uriTemplate' => '/v1/{name=projects/*/locations/*/managementServers/*}', @@ -60,6 +215,61 @@ ], ], ], + 'ListBackupPlanAssociations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/backupPlanAssociations', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListBackupPlans' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/backupPlans', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListBackupVaults' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/backupVaults', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListBackups' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/backupVaults/*/dataSources/*}/backups', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListDataSources' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/backupVaults/*}/dataSources', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'ListManagementServers' => [ 'method' => 'get', 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/managementServers', @@ -71,6 +281,78 @@ ], ], ], + 'RestoreBackup' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}:restore', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'TriggerBackup' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/backupPlanAssociations/*}:triggerBackup', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UpdateBackup' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{backup.name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}', + 'body' => 'backup', + 'placeholders' => [ + 'backup.name' => [ + 'getters' => [ + 'getBackup', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'UpdateBackupVault' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{backup_vault.name=projects/*/locations/*/backupVaults/*}', + 'body' => 'backup_vault', + 'placeholders' => [ + 'backup_vault.name' => [ + 'getters' => [ + 'getBackupVault', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'UpdateDataSource' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{data_source.name=projects/*/locations/*/backupVaults/*/dataSources/*}', + 'body' => 'data_source', + 'placeholders' => [ + 'data_source.name' => [ + 'getters' => [ + 'getDataSource', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], ], 'google.cloud.location.Locations' => [ 'GetLocation' => [ diff --git a/BackupDr/tests/Unit/V1/Client/BackupDRClientTest.php b/BackupDr/tests/Unit/V1/Client/BackupDRClientTest.php index 899c1b728151..f836c6098019 100644 --- a/BackupDr/tests/Unit/V1/Client/BackupDRClientTest.php +++ b/BackupDr/tests/Unit/V1/Client/BackupDRClientTest.php @@ -26,13 +26,48 @@ use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; +use Google\Cloud\BackupDR\V1\Backup; +use Google\Cloud\BackupDR\V1\BackupPlan; +use Google\Cloud\BackupDR\V1\BackupPlanAssociation; +use Google\Cloud\BackupDR\V1\BackupVault; use Google\Cloud\BackupDR\V1\Client\BackupDRClient; +use Google\Cloud\BackupDR\V1\CreateBackupPlanAssociationRequest; +use Google\Cloud\BackupDR\V1\CreateBackupPlanRequest; +use Google\Cloud\BackupDR\V1\CreateBackupVaultRequest; use Google\Cloud\BackupDR\V1\CreateManagementServerRequest; +use Google\Cloud\BackupDR\V1\DataSource; +use Google\Cloud\BackupDR\V1\DeleteBackupPlanAssociationRequest; +use Google\Cloud\BackupDR\V1\DeleteBackupPlanRequest; +use Google\Cloud\BackupDR\V1\DeleteBackupRequest; +use Google\Cloud\BackupDR\V1\DeleteBackupVaultRequest; use Google\Cloud\BackupDR\V1\DeleteManagementServerRequest; +use Google\Cloud\BackupDR\V1\FetchUsableBackupVaultsRequest; +use Google\Cloud\BackupDR\V1\FetchUsableBackupVaultsResponse; +use Google\Cloud\BackupDR\V1\GetBackupPlanAssociationRequest; +use Google\Cloud\BackupDR\V1\GetBackupPlanRequest; +use Google\Cloud\BackupDR\V1\GetBackupRequest; +use Google\Cloud\BackupDR\V1\GetBackupVaultRequest; +use Google\Cloud\BackupDR\V1\GetDataSourceRequest; use Google\Cloud\BackupDR\V1\GetManagementServerRequest; +use Google\Cloud\BackupDR\V1\ListBackupPlanAssociationsRequest; +use Google\Cloud\BackupDR\V1\ListBackupPlanAssociationsResponse; +use Google\Cloud\BackupDR\V1\ListBackupPlansRequest; +use Google\Cloud\BackupDR\V1\ListBackupPlansResponse; +use Google\Cloud\BackupDR\V1\ListBackupVaultsRequest; +use Google\Cloud\BackupDR\V1\ListBackupVaultsResponse; +use Google\Cloud\BackupDR\V1\ListBackupsRequest; +use Google\Cloud\BackupDR\V1\ListBackupsResponse; +use Google\Cloud\BackupDR\V1\ListDataSourcesRequest; +use Google\Cloud\BackupDR\V1\ListDataSourcesResponse; use Google\Cloud\BackupDR\V1\ListManagementServersRequest; use Google\Cloud\BackupDR\V1\ListManagementServersResponse; use Google\Cloud\BackupDR\V1\ManagementServer; +use Google\Cloud\BackupDR\V1\RestoreBackupRequest; +use Google\Cloud\BackupDR\V1\RestoreBackupResponse; +use Google\Cloud\BackupDR\V1\TriggerBackupRequest; +use Google\Cloud\BackupDR\V1\UpdateBackupRequest; +use Google\Cloud\BackupDR\V1\UpdateBackupVaultRequest; +use Google\Cloud\BackupDR\V1\UpdateDataSourceRequest; use Google\Cloud\Iam\V1\GetIamPolicyRequest; use Google\Cloud\Iam\V1\Policy; use Google\Cloud\Iam\V1\SetIamPolicyRequest; @@ -46,6 +81,8 @@ use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; +use Google\Protobuf\Duration; +use Google\Protobuf\FieldMask; use Google\Protobuf\GPBEmpty; use Google\Rpc\Code; use stdClass; @@ -81,7 +118,7 @@ private function createClient(array $options = []) } /** @test */ - public function createManagementServerTest() + public function createBackupPlanTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -98,38 +135,2387 @@ public function createManagementServerTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createManagementServerTest'); + $incompleteOperation->setName('operations/createBackupPlanTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); $name = 'name3373707'; $description = 'description-1724546052'; + $resourceType = 'resourceType979623115'; $etag = 'etag3123477'; - $oauth2ClientId = 'oauth2ClientId-1833466037'; - $satisfiesPzi = false; - $expectedResponse = new ManagementServer(); + $backupVault = 'backupVault353808757'; + $backupVaultServiceAccount = 'backupVaultServiceAccount-1170477095'; + $expectedResponse = new BackupPlan(); $expectedResponse->setName($name); $expectedResponse->setDescription($description); + $expectedResponse->setResourceType($resourceType); $expectedResponse->setEtag($etag); - $expectedResponse->setOauth2ClientId($oauth2ClientId); - $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setBackupVault($backupVault); + $expectedResponse->setBackupVaultServiceAccount($backupVaultServiceAccount); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); - $completeOperation->setName('operations/createManagementServerTest'); + $completeOperation->setName('operations/createBackupPlanTest'); $completeOperation->setDone(true); $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $managementServerId = 'managementServerId1884787355'; - $managementServer = new ManagementServer(); - $managementServerNetworks = []; - $managementServer->setNetworks($managementServerNetworks); - $request = (new CreateManagementServerRequest()) + $backupPlanId = 'backupPlanId-25762700'; + $backupPlan = new BackupPlan(); + $backupPlanBackupRules = []; + $backupPlan->setBackupRules($backupPlanBackupRules); + $backupPlanResourceType = 'backupPlanResourceType1515155475'; + $backupPlan->setResourceType($backupPlanResourceType); + $backupPlanBackupVault = $gapicClient->backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); + $backupPlan->setBackupVault($backupPlanBackupVault); + $request = (new CreateBackupPlanRequest()) ->setParent($formattedParent) - ->setManagementServerId($managementServerId) - ->setManagementServer($managementServer); - $response = $gapicClient->createManagementServer($request); + ->setBackupPlanId($backupPlanId) + ->setBackupPlan($backupPlan); + $response = $gapicClient->createBackupPlan($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/CreateBackupPlan', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getBackupPlanId(); + $this->assertProtobufEquals($backupPlanId, $actualValue); + $actualValue = $actualApiRequestObject->getBackupPlan(); + $this->assertProtobufEquals($backupPlan, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createBackupPlanTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createBackupPlanExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createBackupPlanTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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 + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $backupPlanId = 'backupPlanId-25762700'; + $backupPlan = new BackupPlan(); + $backupPlanBackupRules = []; + $backupPlan->setBackupRules($backupPlanBackupRules); + $backupPlanResourceType = 'backupPlanResourceType1515155475'; + $backupPlan->setResourceType($backupPlanResourceType); + $backupPlanBackupVault = $gapicClient->backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); + $backupPlan->setBackupVault($backupPlanBackupVault); + $request = (new CreateBackupPlanRequest()) + ->setParent($formattedParent) + ->setBackupPlanId($backupPlanId) + ->setBackupPlan($backupPlan); + $response = $gapicClient->createBackupPlan($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createBackupPlanTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createBackupPlanAssociationTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createBackupPlanAssociationTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $resourceType = 'resourceType979623115'; + $resource = 'resource-341064690'; + $backupPlan = 'backupPlan1119623046'; + $dataSource = 'dataSource-1333894576'; + $expectedResponse = new BackupPlanAssociation(); + $expectedResponse->setName($name); + $expectedResponse->setResourceType($resourceType); + $expectedResponse->setResource($resource); + $expectedResponse->setBackupPlan($backupPlan); + $expectedResponse->setDataSource($dataSource); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createBackupPlanAssociationTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $backupPlanAssociationId = 'backupPlanAssociationId133124978'; + $backupPlanAssociation = new BackupPlanAssociation(); + $backupPlanAssociationResource = 'backupPlanAssociationResource1527164324'; + $backupPlanAssociation->setResource($backupPlanAssociationResource); + $backupPlanAssociationBackupPlan = $gapicClient->backupPlanName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN]'); + $backupPlanAssociation->setBackupPlan($backupPlanAssociationBackupPlan); + $request = (new CreateBackupPlanAssociationRequest()) + ->setParent($formattedParent) + ->setBackupPlanAssociationId($backupPlanAssociationId) + ->setBackupPlanAssociation($backupPlanAssociation); + $response = $gapicClient->createBackupPlanAssociation($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/CreateBackupPlanAssociation', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getBackupPlanAssociationId(); + $this->assertProtobufEquals($backupPlanAssociationId, $actualValue); + $actualValue = $actualApiRequestObject->getBackupPlanAssociation(); + $this->assertProtobufEquals($backupPlanAssociation, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createBackupPlanAssociationTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createBackupPlanAssociationExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createBackupPlanAssociationTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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 + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $backupPlanAssociationId = 'backupPlanAssociationId133124978'; + $backupPlanAssociation = new BackupPlanAssociation(); + $backupPlanAssociationResource = 'backupPlanAssociationResource1527164324'; + $backupPlanAssociation->setResource($backupPlanAssociationResource); + $backupPlanAssociationBackupPlan = $gapicClient->backupPlanName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN]'); + $backupPlanAssociation->setBackupPlan($backupPlanAssociationBackupPlan); + $request = (new CreateBackupPlanAssociationRequest()) + ->setParent($formattedParent) + ->setBackupPlanAssociationId($backupPlanAssociationId) + ->setBackupPlanAssociation($backupPlanAssociation); + $response = $gapicClient->createBackupPlanAssociation($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createBackupPlanAssociationTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createBackupVaultTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createBackupVaultTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $deletable = true; + $etag = 'etag3123477'; + $backupCount = 336678994; + $serviceAccount = 'serviceAccount-1948028253'; + $totalStoredBytes = 1181597162; + $uid = 'uid115792'; + $expectedResponse = new BackupVault(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setDeletable($deletable); + $expectedResponse->setEtag($etag); + $expectedResponse->setBackupCount($backupCount); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setTotalStoredBytes($totalStoredBytes); + $expectedResponse->setUid($uid); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createBackupVaultTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $backupVaultId = 'backupVaultId467030053'; + $backupVault = new BackupVault(); + $backupVaultBackupMinimumEnforcedRetentionDuration = new Duration(); + $backupVault->setBackupMinimumEnforcedRetentionDuration($backupVaultBackupMinimumEnforcedRetentionDuration); + $request = (new CreateBackupVaultRequest()) + ->setParent($formattedParent) + ->setBackupVaultId($backupVaultId) + ->setBackupVault($backupVault); + $response = $gapicClient->createBackupVault($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/CreateBackupVault', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getBackupVaultId(); + $this->assertProtobufEquals($backupVaultId, $actualValue); + $actualValue = $actualApiRequestObject->getBackupVault(); + $this->assertProtobufEquals($backupVault, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createBackupVaultTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createBackupVaultExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createBackupVaultTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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 + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $backupVaultId = 'backupVaultId467030053'; + $backupVault = new BackupVault(); + $backupVaultBackupMinimumEnforcedRetentionDuration = new Duration(); + $backupVault->setBackupMinimumEnforcedRetentionDuration($backupVaultBackupMinimumEnforcedRetentionDuration); + $request = (new CreateBackupVaultRequest()) + ->setParent($formattedParent) + ->setBackupVaultId($backupVaultId) + ->setBackupVault($backupVault); + $response = $gapicClient->createBackupVault($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createBackupVaultTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createManagementServerTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createManagementServerTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $oauth2ClientId = 'oauth2ClientId-1833466037'; + $satisfiesPzi = false; + $expectedResponse = new ManagementServer(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $expectedResponse->setOauth2ClientId($oauth2ClientId); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createManagementServerTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $managementServerId = 'managementServerId1884787355'; + $managementServer = new ManagementServer(); + $managementServerNetworks = []; + $managementServer->setNetworks($managementServerNetworks); + $request = (new CreateManagementServerRequest()) + ->setParent($formattedParent) + ->setManagementServerId($managementServerId) + ->setManagementServer($managementServer); + $response = $gapicClient->createManagementServer($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/CreateManagementServer', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getManagementServerId(); + $this->assertProtobufEquals($managementServerId, $actualValue); + $actualValue = $actualApiRequestObject->getManagementServer(); + $this->assertProtobufEquals($managementServer, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createManagementServerTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createManagementServerExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createManagementServerTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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 + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $managementServerId = 'managementServerId1884787355'; + $managementServer = new ManagementServer(); + $managementServerNetworks = []; + $managementServer->setNetworks($managementServerNetworks); + $request = (new CreateManagementServerRequest()) + ->setParent($formattedParent) + ->setManagementServerId($managementServerId) + ->setManagementServer($managementServer); + $response = $gapicClient->createManagementServer($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createManagementServerTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteBackupTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteBackupTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $resourceSizeBytes = 275424386; + $expectedResponse = new Backup(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $expectedResponse->setResourceSizeBytes($resourceSizeBytes); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteBackupTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->backupName( + '[PROJECT]', + '[LOCATION]', + '[BACKUPVAULT]', + '[DATASOURCE]', + '[BACKUP]' + ); + $request = (new DeleteBackupRequest())->setName($formattedName); + $response = $gapicClient->deleteBackup($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/DeleteBackup', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteBackupTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteBackupExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteBackupTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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 + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->backupName( + '[PROJECT]', + '[LOCATION]', + '[BACKUPVAULT]', + '[DATASOURCE]', + '[BACKUP]' + ); + $request = (new DeleteBackupRequest())->setName($formattedName); + $response = $gapicClient->deleteBackup($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteBackupTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteBackupPlanTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteBackupPlanTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteBackupPlanTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->backupPlanName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN]'); + $request = (new DeleteBackupPlanRequest())->setName($formattedName); + $response = $gapicClient->deleteBackupPlan($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/DeleteBackupPlan', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteBackupPlanTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteBackupPlanExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteBackupPlanTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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 + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->backupPlanName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN]'); + $request = (new DeleteBackupPlanRequest())->setName($formattedName); + $response = $gapicClient->deleteBackupPlan($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteBackupPlanTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteBackupPlanAssociationTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteBackupPlanAssociationTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteBackupPlanAssociationTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->backupPlanAssociationName( + '[PROJECT]', + '[LOCATION]', + '[BACKUP_PLAN_ASSOCIATION]' + ); + $request = (new DeleteBackupPlanAssociationRequest())->setName($formattedName); + $response = $gapicClient->deleteBackupPlanAssociation($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/DeleteBackupPlanAssociation', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteBackupPlanAssociationTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteBackupPlanAssociationExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteBackupPlanAssociationTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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 + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->backupPlanAssociationName( + '[PROJECT]', + '[LOCATION]', + '[BACKUP_PLAN_ASSOCIATION]' + ); + $request = (new DeleteBackupPlanAssociationRequest())->setName($formattedName); + $response = $gapicClient->deleteBackupPlanAssociation($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteBackupPlanAssociationTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteBackupVaultTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteBackupVaultTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteBackupVaultTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); + $request = (new DeleteBackupVaultRequest())->setName($formattedName); + $response = $gapicClient->deleteBackupVault($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/DeleteBackupVault', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteBackupVaultTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteBackupVaultExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteBackupVaultTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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 + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); + $request = (new DeleteBackupVaultRequest())->setName($formattedName); + $response = $gapicClient->deleteBackupVault($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteBackupVaultTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteManagementServerTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteManagementServerTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteManagementServerTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->managementServerName('[PROJECT]', '[LOCATION]', '[MANAGEMENTSERVER]'); + $request = (new DeleteManagementServerRequest())->setName($formattedName); + $response = $gapicClient->deleteManagementServer($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/DeleteManagementServer', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteManagementServerTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteManagementServerExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteManagementServerTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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 + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->managementServerName('[PROJECT]', '[LOCATION]', '[MANAGEMENTSERVER]'); + $request = (new DeleteManagementServerRequest())->setName($formattedName); + $response = $gapicClient->deleteManagementServer($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteManagementServerTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function fetchUsableBackupVaultsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $backupVaultsElement = new BackupVault(); + $backupVaults = [$backupVaultsElement]; + $expectedResponse = new FetchUsableBackupVaultsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setBackupVaults($backupVaults); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new FetchUsableBackupVaultsRequest())->setParent($formattedParent); + $response = $gapicClient->fetchUsableBackupVaults($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getBackupVaults()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/FetchUsableBackupVaults', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function fetchUsableBackupVaultsExceptionTest() + { + $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 + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new FetchUsableBackupVaultsRequest())->setParent($formattedParent); + try { + $gapicClient->fetchUsableBackupVaults($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 getBackupTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $resourceSizeBytes = 275424386; + $expectedResponse = new Backup(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $expectedResponse->setResourceSizeBytes($resourceSizeBytes); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->backupName( + '[PROJECT]', + '[LOCATION]', + '[BACKUPVAULT]', + '[DATASOURCE]', + '[BACKUP]' + ); + $request = (new GetBackupRequest())->setName($formattedName); + $response = $gapicClient->getBackup($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.backupdr.v1.BackupDR/GetBackup', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getBackupExceptionTest() + { + $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 + $formattedName = $gapicClient->backupName( + '[PROJECT]', + '[LOCATION]', + '[BACKUPVAULT]', + '[DATASOURCE]', + '[BACKUP]' + ); + $request = (new GetBackupRequest())->setName($formattedName); + try { + $gapicClient->getBackup($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 getBackupPlanTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $resourceType = 'resourceType979623115'; + $etag = 'etag3123477'; + $backupVault = 'backupVault353808757'; + $backupVaultServiceAccount = 'backupVaultServiceAccount-1170477095'; + $expectedResponse = new BackupPlan(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setResourceType($resourceType); + $expectedResponse->setEtag($etag); + $expectedResponse->setBackupVault($backupVault); + $expectedResponse->setBackupVaultServiceAccount($backupVaultServiceAccount); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->backupPlanName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN]'); + $request = (new GetBackupPlanRequest())->setName($formattedName); + $response = $gapicClient->getBackupPlan($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.backupdr.v1.BackupDR/GetBackupPlan', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getBackupPlanExceptionTest() + { + $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 + $formattedName = $gapicClient->backupPlanName('[PROJECT]', '[LOCATION]', '[BACKUP_PLAN]'); + $request = (new GetBackupPlanRequest())->setName($formattedName); + try { + $gapicClient->getBackupPlan($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 getBackupPlanAssociationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $resourceType = 'resourceType979623115'; + $resource = 'resource-341064690'; + $backupPlan = 'backupPlan1119623046'; + $dataSource = 'dataSource-1333894576'; + $expectedResponse = new BackupPlanAssociation(); + $expectedResponse->setName($name2); + $expectedResponse->setResourceType($resourceType); + $expectedResponse->setResource($resource); + $expectedResponse->setBackupPlan($backupPlan); + $expectedResponse->setDataSource($dataSource); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->backupPlanAssociationName( + '[PROJECT]', + '[LOCATION]', + '[BACKUP_PLAN_ASSOCIATION]' + ); + $request = (new GetBackupPlanAssociationRequest())->setName($formattedName); + $response = $gapicClient->getBackupPlanAssociation($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.backupdr.v1.BackupDR/GetBackupPlanAssociation', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getBackupPlanAssociationExceptionTest() + { + $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 + $formattedName = $gapicClient->backupPlanAssociationName( + '[PROJECT]', + '[LOCATION]', + '[BACKUP_PLAN_ASSOCIATION]' + ); + $request = (new GetBackupPlanAssociationRequest())->setName($formattedName); + try { + $gapicClient->getBackupPlanAssociation($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 getBackupVaultTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $deletable = true; + $etag = 'etag3123477'; + $backupCount = 336678994; + $serviceAccount = 'serviceAccount-1948028253'; + $totalStoredBytes = 1181597162; + $uid = 'uid115792'; + $expectedResponse = new BackupVault(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setDeletable($deletable); + $expectedResponse->setEtag($etag); + $expectedResponse->setBackupCount($backupCount); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setTotalStoredBytes($totalStoredBytes); + $expectedResponse->setUid($uid); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); + $request = (new GetBackupVaultRequest())->setName($formattedName); + $response = $gapicClient->getBackupVault($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.backupdr.v1.BackupDR/GetBackupVault', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getBackupVaultExceptionTest() + { + $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 + $formattedName = $gapicClient->backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); + $request = (new GetBackupVaultRequest())->setName($formattedName); + try { + $gapicClient->getBackupVault($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 getDataSourceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $backupCount = 336678994; + $etag = 'etag3123477'; + $totalStoredBytes = 1181597162; + $expectedResponse = new DataSource(); + $expectedResponse->setName($name2); + $expectedResponse->setBackupCount($backupCount); + $expectedResponse->setEtag($etag); + $expectedResponse->setTotalStoredBytes($totalStoredBytes); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->dataSourceName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]', '[DATASOURCE]'); + $request = (new GetDataSourceRequest())->setName($formattedName); + $response = $gapicClient->getDataSource($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.backupdr.v1.BackupDR/GetDataSource', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getDataSourceExceptionTest() + { + $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 + $formattedName = $gapicClient->dataSourceName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]', '[DATASOURCE]'); + $request = (new GetDataSourceRequest())->setName($formattedName); + try { + $gapicClient->getDataSource($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 getManagementServerTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $oauth2ClientId = 'oauth2ClientId-1833466037'; + $satisfiesPzi = false; + $expectedResponse = new ManagementServer(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $expectedResponse->setOauth2ClientId($oauth2ClientId); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->managementServerName('[PROJECT]', '[LOCATION]', '[MANAGEMENTSERVER]'); + $request = (new GetManagementServerRequest())->setName($formattedName); + $response = $gapicClient->getManagementServer($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.backupdr.v1.BackupDR/GetManagementServer', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getManagementServerExceptionTest() + { + $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 + $formattedName = $gapicClient->managementServerName('[PROJECT]', '[LOCATION]', '[MANAGEMENTSERVER]'); + $request = (new GetManagementServerRequest())->setName($formattedName); + try { + $gapicClient->getManagementServer($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 listBackupPlanAssociationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $backupPlanAssociationsElement = new BackupPlanAssociation(); + $backupPlanAssociations = [$backupPlanAssociationsElement]; + $expectedResponse = new ListBackupPlanAssociationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setBackupPlanAssociations($backupPlanAssociations); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListBackupPlanAssociationsRequest())->setParent($formattedParent); + $response = $gapicClient->listBackupPlanAssociations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getBackupPlanAssociations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/ListBackupPlanAssociations', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listBackupPlanAssociationsExceptionTest() + { + $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 + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListBackupPlanAssociationsRequest())->setParent($formattedParent); + try { + $gapicClient->listBackupPlanAssociations($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 listBackupPlansTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $backupPlansElement = new BackupPlan(); + $backupPlans = [$backupPlansElement]; + $expectedResponse = new ListBackupPlansResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setBackupPlans($backupPlans); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListBackupPlansRequest())->setParent($formattedParent); + $response = $gapicClient->listBackupPlans($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getBackupPlans()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/ListBackupPlans', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listBackupPlansExceptionTest() + { + $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 + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListBackupPlansRequest())->setParent($formattedParent); + try { + $gapicClient->listBackupPlans($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 listBackupVaultsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $backupVaultsElement = new BackupVault(); + $backupVaults = [$backupVaultsElement]; + $expectedResponse = new ListBackupVaultsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setBackupVaults($backupVaults); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListBackupVaultsRequest())->setParent($formattedParent); + $response = $gapicClient->listBackupVaults($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getBackupVaults()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/ListBackupVaults', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listBackupVaultsExceptionTest() + { + $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 + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListBackupVaultsRequest())->setParent($formattedParent); + try { + $gapicClient->listBackupVaults($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 listBackupsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $backupsElement = new Backup(); + $backups = [$backupsElement]; + $expectedResponse = new ListBackupsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setBackups($backups); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->dataSourceName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]', '[DATASOURCE]'); + $request = (new ListBackupsRequest())->setParent($formattedParent); + $response = $gapicClient->listBackups($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getBackups()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/ListBackups', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listBackupsExceptionTest() + { + $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 + $formattedParent = $gapicClient->dataSourceName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]', '[DATASOURCE]'); + $request = (new ListBackupsRequest())->setParent($formattedParent); + try { + $gapicClient->listBackups($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 listDataSourcesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $dataSourcesElement = new DataSource(); + $dataSources = [$dataSourcesElement]; + $expectedResponse = new ListDataSourcesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setDataSources($dataSources); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); + $request = (new ListDataSourcesRequest())->setParent($formattedParent); + $response = $gapicClient->listDataSources($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getDataSources()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/ListDataSources', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listDataSourcesExceptionTest() + { + $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 + $formattedParent = $gapicClient->backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); + $request = (new ListDataSourcesRequest())->setParent($formattedParent); + try { + $gapicClient->listDataSources($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 listManagementServersTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $managementServersElement = new ManagementServer(); + $managementServers = [$managementServersElement]; + $expectedResponse = new ListManagementServersResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setManagementServers($managementServers); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListManagementServersRequest())->setParent($formattedParent); + $response = $gapicClient->listManagementServers($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getManagementServers()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/ListManagementServers', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listManagementServersExceptionTest() + { + $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 + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListManagementServersRequest())->setParent($formattedParent); + try { + $gapicClient->listManagementServers($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 restoreBackupTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/restoreBackupTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new RestoreBackupResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/restoreBackupTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->backupName( + '[PROJECT]', + '[LOCATION]', + '[BACKUPVAULT]', + '[DATASOURCE]', + '[BACKUP]' + ); + $request = (new RestoreBackupRequest())->setName($formattedName); + $response = $gapicClient->restoreBackup($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/RestoreBackup', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/restoreBackupTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function restoreBackupExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/restoreBackupTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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 + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->backupName( + '[PROJECT]', + '[LOCATION]', + '[BACKUPVAULT]', + '[DATASOURCE]', + '[BACKUP]' + ); + $request = (new RestoreBackupRequest())->setName($formattedName); + $response = $gapicClient->restoreBackup($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/restoreBackupTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function triggerBackupTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/triggerBackupTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $resourceType = 'resourceType979623115'; + $resource = 'resource-341064690'; + $backupPlan = 'backupPlan1119623046'; + $dataSource = 'dataSource-1333894576'; + $expectedResponse = new BackupPlanAssociation(); + $expectedResponse->setName($name2); + $expectedResponse->setResourceType($resourceType); + $expectedResponse->setResource($resource); + $expectedResponse->setBackupPlan($backupPlan); + $expectedResponse->setDataSource($dataSource); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/triggerBackupTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->backupPlanAssociationName( + '[PROJECT]', + '[LOCATION]', + '[BACKUP_PLAN_ASSOCIATION]' + ); + $ruleId = 'ruleId1548659006'; + $request = (new TriggerBackupRequest())->setName($formattedName)->setRuleId($ruleId); + $response = $gapicClient->triggerBackup($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $apiRequests = $transport->popReceivedCalls(); @@ -138,15 +2524,13 @@ public function createManagementServerTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.backupdr.v1.BackupDR/CreateManagementServer', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getManagementServerId(); - $this->assertProtobufEquals($managementServerId, $actualValue); - $actualValue = $actualApiRequestObject->getManagementServer(); - $this->assertProtobufEquals($managementServer, $actualValue); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/TriggerBackup', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualApiRequestObject->getRuleId(); + $this->assertProtobufEquals($ruleId, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createManagementServerTest'); + $expectedOperationsRequestObject->setName('operations/triggerBackupTest'); $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, ]); @@ -165,7 +2549,7 @@ public function createManagementServerTest() } /** @test */ - public function createManagementServerExceptionTest() + public function triggerBackupExceptionTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -182,7 +2566,7 @@ public function createManagementServerExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createManagementServerTest'); + $incompleteOperation->setName('operations/triggerBackupTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); $status = new stdClass(); @@ -199,20 +2583,18 @@ public function createManagementServerExceptionTest() ); $operationsTransport->addResponse(null, $status); // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $managementServerId = 'managementServerId1884787355'; - $managementServer = new ManagementServer(); - $managementServerNetworks = []; - $managementServer->setNetworks($managementServerNetworks); - $request = (new CreateManagementServerRequest()) - ->setParent($formattedParent) - ->setManagementServerId($managementServerId) - ->setManagementServer($managementServer); - $response = $gapicClient->createManagementServer($request); + $formattedName = $gapicClient->backupPlanAssociationName( + '[PROJECT]', + '[LOCATION]', + '[BACKUP_PLAN_ASSOCIATION]' + ); + $ruleId = 'ruleId1548659006'; + $request = (new TriggerBackupRequest())->setName($formattedName)->setRuleId($ruleId); + $response = $gapicClient->triggerBackup($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createManagementServerTest'); + $expectedOperationsRequestObject->setName('operations/triggerBackupTest'); try { $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, @@ -231,7 +2613,7 @@ public function createManagementServerExceptionTest() } /** @test */ - public function deleteManagementServerTest() + public function updateBackupTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -248,21 +2630,30 @@ public function deleteManagementServerTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteManagementServerTest'); + $incompleteOperation->setName('operations/updateBackupTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); + $name = 'name3373707'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $resourceSizeBytes = 275424386; + $expectedResponse = new Backup(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $expectedResponse->setResourceSizeBytes($resourceSizeBytes); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteManagementServerTest'); + $completeOperation->setName('operations/updateBackupTest'); $completeOperation->setDone(true); $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request - $formattedName = $gapicClient->managementServerName('[PROJECT]', '[LOCATION]', '[MANAGEMENTSERVER]'); - $request = (new DeleteManagementServerRequest())->setName($formattedName); - $response = $gapicClient->deleteManagementServer($request); + $updateMask = new FieldMask(); + $backup = new Backup(); + $request = (new UpdateBackupRequest())->setUpdateMask($updateMask)->setBackup($backup); + $response = $gapicClient->updateBackup($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $apiRequests = $transport->popReceivedCalls(); @@ -271,11 +2662,13 @@ public function deleteManagementServerTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.backupdr.v1.BackupDR/DeleteManagementServer', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/UpdateBackup', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualApiRequestObject->getBackup(); + $this->assertProtobufEquals($backup, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteManagementServerTest'); + $expectedOperationsRequestObject->setName('operations/updateBackupTest'); $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, ]); @@ -294,7 +2687,7 @@ public function deleteManagementServerTest() } /** @test */ - public function deleteManagementServerExceptionTest() + public function updateBackupExceptionTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -311,7 +2704,7 @@ public function deleteManagementServerExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteManagementServerTest'); + $incompleteOperation->setName('operations/updateBackupTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); $status = new stdClass(); @@ -328,13 +2721,14 @@ public function deleteManagementServerExceptionTest() ); $operationsTransport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->managementServerName('[PROJECT]', '[LOCATION]', '[MANAGEMENTSERVER]'); - $request = (new DeleteManagementServerRequest())->setName($formattedName); - $response = $gapicClient->deleteManagementServer($request); + $updateMask = new FieldMask(); + $backup = new Backup(); + $request = (new UpdateBackupRequest())->setUpdateMask($updateMask)->setBackup($backup); + $response = $gapicClient->updateBackup($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteManagementServerTest'); + $expectedOperationsRequestObject->setName('operations/updateBackupTest'); try { $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, @@ -353,49 +2747,110 @@ public function deleteManagementServerExceptionTest() } /** @test */ - public function getManagementServerTest() + public function updateBackupVaultTest() { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); $transport = $this->createTransport(); $gapicClient = $this->createClient([ 'transport' => $transport, + 'operationsClient' => $operationsClient, ]); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); // Mock response - $name2 = 'name2-1052831874'; + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateBackupVaultTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; $description = 'description-1724546052'; + $deletable = true; $etag = 'etag3123477'; - $oauth2ClientId = 'oauth2ClientId-1833466037'; - $satisfiesPzi = false; - $expectedResponse = new ManagementServer(); - $expectedResponse->setName($name2); + $backupCount = 336678994; + $serviceAccount = 'serviceAccount-1948028253'; + $totalStoredBytes = 1181597162; + $uid = 'uid115792'; + $expectedResponse = new BackupVault(); + $expectedResponse->setName($name); $expectedResponse->setDescription($description); + $expectedResponse->setDeletable($deletable); $expectedResponse->setEtag($etag); - $expectedResponse->setOauth2ClientId($oauth2ClientId); - $expectedResponse->setSatisfiesPzi($satisfiesPzi); - $transport->addResponse($expectedResponse); + $expectedResponse->setBackupCount($backupCount); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setTotalStoredBytes($totalStoredBytes); + $expectedResponse->setUid($uid); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateBackupVaultTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); // Mock request - $formattedName = $gapicClient->managementServerName('[PROJECT]', '[LOCATION]', '[MANAGEMENTSERVER]'); - $request = (new GetManagementServerRequest())->setName($formattedName); - $response = $gapicClient->getManagementServer($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.backupdr.v1.BackupDR/GetManagementServer', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); + $updateMask = new FieldMask(); + $backupVault = new BackupVault(); + $backupVaultBackupMinimumEnforcedRetentionDuration = new Duration(); + $backupVault->setBackupMinimumEnforcedRetentionDuration($backupVaultBackupMinimumEnforcedRetentionDuration); + $request = (new UpdateBackupVaultRequest())->setUpdateMask($updateMask)->setBackupVault($backupVault); + $response = $gapicClient->updateBackupVault($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/UpdateBackupVault', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualApiRequestObject->getBackupVault(); + $this->assertProtobufEquals($backupVault, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateBackupVaultTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); } /** @test */ - public function getManagementServerExceptionTest() + public function updateBackupVaultExceptionTest() { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); $transport = $this->createTransport(); $gapicClient = $this->createClient([ 'transport' => $transport, + 'operationsClient' => $operationsClient, ]); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateBackupVaultTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; @@ -408,65 +2863,130 @@ public function getManagementServerExceptionTest() ], JSON_PRETTY_PRINT ); - $transport->addResponse(null, $status); + $operationsTransport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->managementServerName('[PROJECT]', '[LOCATION]', '[MANAGEMENTSERVER]'); - $request = (new GetManagementServerRequest())->setName($formattedName); + $updateMask = new FieldMask(); + $backupVault = new BackupVault(); + $backupVaultBackupMinimumEnforcedRetentionDuration = new Duration(); + $backupVault->setBackupMinimumEnforcedRetentionDuration($backupVaultBackupMinimumEnforcedRetentionDuration); + $request = (new UpdateBackupVaultRequest())->setUpdateMask($updateMask)->setBackupVault($backupVault); + $response = $gapicClient->updateBackupVault($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateBackupVaultTest'); try { - $gapicClient->getManagementServer($request); - // If the $gapicClient method call did not throw, fail the test + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 + // Call popReceivedCalls to ensure the stubs are exhausted $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); } /** @test */ - public function listManagementServersTest() + public function updateDataSourceTest() { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); $transport = $this->createTransport(); $gapicClient = $this->createClient([ 'transport' => $transport, + 'operationsClient' => $operationsClient, ]); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); // Mock response - $nextPageToken = ''; - $managementServersElement = new ManagementServer(); - $managementServers = [$managementServersElement]; - $expectedResponse = new ListManagementServersResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setManagementServers($managementServers); - $transport->addResponse($expectedResponse); + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateDataSourceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $backupCount = 336678994; + $etag = 'etag3123477'; + $totalStoredBytes = 1181597162; + $expectedResponse = new DataSource(); + $expectedResponse->setName($name); + $expectedResponse->setBackupCount($backupCount); + $expectedResponse->setEtag($etag); + $expectedResponse->setTotalStoredBytes($totalStoredBytes); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateDataSourceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListManagementServersRequest())->setParent($formattedParent); - $response = $gapicClient->listManagementServers($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getManagementServers()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.backupdr.v1.BackupDR/ListManagementServers', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); + $updateMask = new FieldMask(); + $dataSource = new DataSource(); + $request = (new UpdateDataSourceRequest())->setUpdateMask($updateMask)->setDataSource($dataSource); + $response = $gapicClient->updateDataSource($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/UpdateDataSource', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualApiRequestObject->getDataSource(); + $this->assertProtobufEquals($dataSource, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateDataSourceTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); } /** @test */ - public function listManagementServersExceptionTest() + public function updateDataSourceExceptionTest() { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); $transport = $this->createTransport(); $gapicClient = $this->createClient([ 'transport' => $transport, + 'operationsClient' => $operationsClient, ]); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateDataSourceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; @@ -479,21 +2999,31 @@ public function listManagementServersExceptionTest() ], JSON_PRETTY_PRINT ); - $transport->addResponse(null, $status); + $operationsTransport->addResponse(null, $status); // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListManagementServersRequest())->setParent($formattedParent); + $updateMask = new FieldMask(); + $dataSource = new DataSource(); + $request = (new UpdateDataSourceRequest())->setUpdateMask($updateMask)->setDataSource($dataSource); + $response = $gapicClient->updateDataSource($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateDataSourceTest'); try { - $gapicClient->listManagementServers($request); - // If the $gapicClient method call did not throw, fail the test + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 + // Call popReceivedCalls to ensure the stubs are exhausted $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); } /** @test */ @@ -830,7 +3360,7 @@ public function testIamPermissionsExceptionTest() } /** @test */ - public function createManagementServerAsyncTest() + public function createBackupPlanAsyncTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -847,38 +3377,44 @@ public function createManagementServerAsyncTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createManagementServerTest'); + $incompleteOperation->setName('operations/createBackupPlanTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); $name = 'name3373707'; $description = 'description-1724546052'; + $resourceType = 'resourceType979623115'; $etag = 'etag3123477'; - $oauth2ClientId = 'oauth2ClientId-1833466037'; - $satisfiesPzi = false; - $expectedResponse = new ManagementServer(); + $backupVault = 'backupVault353808757'; + $backupVaultServiceAccount = 'backupVaultServiceAccount-1170477095'; + $expectedResponse = new BackupPlan(); $expectedResponse->setName($name); $expectedResponse->setDescription($description); + $expectedResponse->setResourceType($resourceType); $expectedResponse->setEtag($etag); - $expectedResponse->setOauth2ClientId($oauth2ClientId); - $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setBackupVault($backupVault); + $expectedResponse->setBackupVaultServiceAccount($backupVaultServiceAccount); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); - $completeOperation->setName('operations/createManagementServerTest'); + $completeOperation->setName('operations/createBackupPlanTest'); $completeOperation->setDone(true); $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $managementServerId = 'managementServerId1884787355'; - $managementServer = new ManagementServer(); - $managementServerNetworks = []; - $managementServer->setNetworks($managementServerNetworks); - $request = (new CreateManagementServerRequest()) + $backupPlanId = 'backupPlanId-25762700'; + $backupPlan = new BackupPlan(); + $backupPlanBackupRules = []; + $backupPlan->setBackupRules($backupPlanBackupRules); + $backupPlanResourceType = 'backupPlanResourceType1515155475'; + $backupPlan->setResourceType($backupPlanResourceType); + $backupPlanBackupVault = $gapicClient->backupVaultName('[PROJECT]', '[LOCATION]', '[BACKUPVAULT]'); + $backupPlan->setBackupVault($backupPlanBackupVault); + $request = (new CreateBackupPlanRequest()) ->setParent($formattedParent) - ->setManagementServerId($managementServerId) - ->setManagementServer($managementServer); - $response = $gapicClient->createManagementServerAsync($request)->wait(); + ->setBackupPlanId($backupPlanId) + ->setBackupPlan($backupPlan); + $response = $gapicClient->createBackupPlanAsync($request)->wait(); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $apiRequests = $transport->popReceivedCalls(); @@ -887,15 +3423,15 @@ public function createManagementServerAsyncTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.backupdr.v1.BackupDR/CreateManagementServer', $actualApiFuncCall); + $this->assertSame('/google.cloud.backupdr.v1.BackupDR/CreateBackupPlan', $actualApiFuncCall); $actualValue = $actualApiRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getManagementServerId(); - $this->assertProtobufEquals($managementServerId, $actualValue); - $actualValue = $actualApiRequestObject->getManagementServer(); - $this->assertProtobufEquals($managementServer, $actualValue); + $actualValue = $actualApiRequestObject->getBackupPlanId(); + $this->assertProtobufEquals($backupPlanId, $actualValue); + $actualValue = $actualApiRequestObject->getBackupPlan(); + $this->assertProtobufEquals($backupPlan, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createManagementServerTest'); + $expectedOperationsRequestObject->setName('operations/createBackupPlanTest'); $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, ]); From b3466e9c20759b3fc88c13e587c3175b5ef2455f Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 12:23:00 -0700 Subject: [PATCH 11/34] chore(main): release 0.263.0 (#7741) --- BackupDr/VERSION | 2 +- CHANGELOG.md | 162 ++++++++++++++++++++++++++++ CommerceConsumerProcurement/VERSION | 2 +- ContactCenterInsights/VERSION | 2 +- Container/VERSION | 2 +- Datastore/VERSION | 2 +- Datastore/src/DatastoreClient.php | 2 +- DiscoveryEngine/VERSION | 2 +- PubSub/VERSION | 2 +- PubSub/src/PubSubClient.php | 2 +- Retail/VERSION | 2 +- Spanner/VERSION | 2 +- Spanner/src/SpannerClient.php | 2 +- TextToSpeech/VERSION | 2 +- composer.json | 20 ++-- 15 files changed, 185 insertions(+), 23 deletions(-) diff --git a/BackupDr/VERSION b/BackupDr/VERSION index 0d91a54c7d43..1d0ba9ea182b 100644 --- a/BackupDr/VERSION +++ b/BackupDr/VERSION @@ -1 +1 @@ -0.3.0 +0.4.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index 212fce24d2e8..a4dc7d395b82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,167 @@ # Changelog +## 0.263.0 + +
google/cloud-backupdr 0.4.0 + + + +### Features + +* Add backupplan proto ([764bb32](https://github.com/googleapis/google-cloud-php/commit/764bb32bb2c092828be889c3f951234f605b16ad)) +* Add backupplan proto ([#7732](https://github.com/googleapis/google-cloud-php/issues/7732)) ([764bb32](https://github.com/googleapis/google-cloud-php/commit/764bb32bb2c092828be889c3f951234f605b16ad)) +* Add backupplanassociation proto ([764bb32](https://github.com/googleapis/google-cloud-php/commit/764bb32bb2c092828be889c3f951234f605b16ad)) +* Add backupvault_ba proto ([764bb32](https://github.com/googleapis/google-cloud-php/commit/764bb32bb2c092828be889c3f951234f605b16ad)) +* Add backupvault_gce proto ([764bb32](https://github.com/googleapis/google-cloud-php/commit/764bb32bb2c092828be889c3f951234f605b16ad)) + +
+ +
google/cloud-commerce-consumer-procurement 1.1.0 + + + +### Features + +* Add Order modification RPCs and License Management Service ([#7729](https://github.com/googleapis/google-cloud-php/issues/7729)) ([3252d24](https://github.com/googleapis/google-cloud-php/commit/3252d24783823082ea5e0af837be3cbd84854639)) + + +### Documentation + +* A comment for enum value `LINE_ITEM_CHANGE_STATE_ABANDONED` in enum `LineItemChangeState` is changed ([3252d24](https://github.com/googleapis/google-cloud-php/commit/3252d24783823082ea5e0af837be3cbd84854639)) +* A comment for enum value `LINE_ITEM_CHANGE_STATE_ACTIVATING` in enum `LineItemChangeState` is changed ([3252d24](https://github.com/googleapis/google-cloud-php/commit/3252d24783823082ea5e0af837be3cbd84854639)) +* A comment for enum value `LINE_ITEM_CHANGE_STATE_APPROVED` in enum `LineItemChangeState` is changed ([3252d24](https://github.com/googleapis/google-cloud-php/commit/3252d24783823082ea5e0af837be3cbd84854639)) +* A comment for enum value `LINE_ITEM_CHANGE_STATE_COMPLETED` in enum `LineItemChangeState` is changed ([3252d24](https://github.com/googleapis/google-cloud-php/commit/3252d24783823082ea5e0af837be3cbd84854639)) +* A comment for enum value `LINE_ITEM_CHANGE_STATE_PENDING_APPROVAL` in enum `LineItemChangeState` is changed ([3252d24](https://github.com/googleapis/google-cloud-php/commit/3252d24783823082ea5e0af837be3cbd84854639)) +* A comment for enum value `LINE_ITEM_CHANGE_STATE_REJECTED` in enum `LineItemChangeState` is changed ([3252d24](https://github.com/googleapis/google-cloud-php/commit/3252d24783823082ea5e0af837be3cbd84854639)) +* A comment for field `filter` in message `.google.cloud.commerce.consumer.procurement.v1.ListOrdersRequest` is changed ([3252d24](https://github.com/googleapis/google-cloud-php/commit/3252d24783823082ea5e0af837be3cbd84854639)) +* A comment for field `request_id` in message `.google.cloud.commerce.consumer.procurement.v1.PlaceOrderRequest` is changed ([3252d24](https://github.com/googleapis/google-cloud-php/commit/3252d24783823082ea5e0af837be3cbd84854639)) + +
+ +
google/cloud-contact-center-insights 2.1.0 + + + +### Features + +* Add CMEK InitializeLroSpec ([534f367](https://github.com/googleapis/google-cloud-php/commit/534f3670edc86f7407c0224da4c4a48ea69d18fc)) +* Add import / export IssueModel ([#7731](https://github.com/googleapis/google-cloud-php/issues/7731)) ([534f367](https://github.com/googleapis/google-cloud-php/commit/534f3670edc86f7407c0224da4c4a48ea69d18fc)) +* Add metadata import to IngestConversations ([534f367](https://github.com/googleapis/google-cloud-php/commit/534f3670edc86f7407c0224da4c4a48ea69d18fc)) +* Add sampling to IngestConversations ([534f367](https://github.com/googleapis/google-cloud-php/commit/534f3670edc86f7407c0224da4c4a48ea69d18fc)) + + +### Documentation + +* Add a comment for valid `order_by` values in ListConversations ([534f367](https://github.com/googleapis/google-cloud-php/commit/534f3670edc86f7407c0224da4c4a48ea69d18fc)) +* Add a comment for valid `update_mask` values in UpdateConversation ([534f367](https://github.com/googleapis/google-cloud-php/commit/534f3670edc86f7407c0224da4c4a48ea69d18fc)) + +
+ +
google/cloud-container 2.2.0 + + + +### Features + +* Add an effective_cgroup_mode field in node config ([#7737](https://github.com/googleapis/google-cloud-php/issues/7737)) ([bb22cee](https://github.com/googleapis/google-cloud-php/commit/bb22cee327bb8a5a438bde0d39e6e48ae1d51b72)) +* Add API to enable/disable secret manager csi component on GKE clusters ([bb22cee](https://github.com/googleapis/google-cloud-php/commit/bb22cee327bb8a5a438bde0d39e6e48ae1d51b72)) +* Add CompliancePosture field for configuration of GKE Compliance Posture product ([bb22cee](https://github.com/googleapis/google-cloud-php/commit/bb22cee327bb8a5a438bde0d39e6e48ae1d51b72)) +* Add CompliancePosture field for configuration of GKE Compliance Posture product ([bb22cee](https://github.com/googleapis/google-cloud-php/commit/bb22cee327bb8a5a438bde0d39e6e48ae1d51b72)) +* Add KCP_SSHD and KCP_CONNECTION to the supported values for the --logging flag for the create and update cluster commands ([bb22cee](https://github.com/googleapis/google-cloud-php/commit/bb22cee327bb8a5a438bde0d39e6e48ae1d51b72)) +* Add RBACBindingConfig to API ([bb22cee](https://github.com/googleapis/google-cloud-php/commit/bb22cee327bb8a5a438bde0d39e6e48ae1d51b72)) +* Add storage pools field to NodePool API ([bb22cee](https://github.com/googleapis/google-cloud-php/commit/bb22cee327bb8a5a438bde0d39e6e48ae1d51b72)) +* Added support for Parallelstore CSI Driver ([bb22cee](https://github.com/googleapis/google-cloud-php/commit/bb22cee327bb8a5a438bde0d39e6e48ae1d51b72)) +* Surface upgrade_target_version in GetServerConfig for all supported release channels ([bb22cee](https://github.com/googleapis/google-cloud-php/commit/bb22cee327bb8a5a438bde0d39e6e48ae1d51b72)) + + +### Documentation + +* Minor documentation updates ([bb22cee](https://github.com/googleapis/google-cloud-php/commit/bb22cee327bb8a5a438bde0d39e6e48ae1d51b72)) + +
+ +
google/cloud-datastore 1.31.0 + + + +### Features + +* Support for field update operators in the Datastore API and resolution strategies when there is a conflict at write time ([#7733](https://github.com/googleapis/google-cloud-php/issues/7733)) ([c4a0d8d](https://github.com/googleapis/google-cloud-php/commit/c4a0d8d12ac9210d8b6a767133edb5bce1a0e20a)) + +
+ +
google/cloud-discoveryengine 1.2.0 + + + +### Features + +* Add BillingEstimation in data store ([a93ec74](https://github.com/googleapis/google-cloud-php/commit/a93ec74d89b046e5fd0f751c17eca18b840ac74a)) +* Add GroundedGenerationService API ([a93ec74](https://github.com/googleapis/google-cloud-php/commit/a93ec74d89b046e5fd0f751c17eca18b840ac74a)) +* Add one_box_page_size on search ([a93ec74](https://github.com/googleapis/google-cloud-php/commit/a93ec74d89b046e5fd0f751c17eca18b840ac74a)) +* Add site_credential for site search config ([a93ec74](https://github.com/googleapis/google-cloud-php/commit/a93ec74d89b046e5fd0f751c17eca18b840ac74a)) +* Support advanced boost search ([a93ec74](https://github.com/googleapis/google-cloud-php/commit/a93ec74d89b046e5fd0f751c17eca18b840ac74a)) +* Support Google Workspace search ([a93ec74](https://github.com/googleapis/google-cloud-php/commit/a93ec74d89b046e5fd0f751c17eca18b840ac74a)) + + +### Bug Fixes + +* Location type annotation ([#7739](https://github.com/googleapis/google-cloud-php/issues/7739)) ([a93ec74](https://github.com/googleapis/google-cloud-php/commit/a93ec74d89b046e5fd0f751c17eca18b840ac74a)) + + +### Documentation + +* Update documentation ([a93ec74](https://github.com/googleapis/google-cloud-php/commit/a93ec74d89b046e5fd0f751c17eca18b840ac74a)) + +
+ +
google/cloud-pubsub 2.8.0 + + + +### Features + +* Add IngestionFailureEvent to the external proto ([#7738](https://github.com/googleapis/google-cloud-php/issues/7738)) ([438b3e8](https://github.com/googleapis/google-cloud-php/commit/438b3e8a540f8b95e24eb10abcb061c90b5dec48)) + +
+ +
google/cloud-retail 2.1.0 + + + +### Features + +* Add conversational search ([#7734](https://github.com/googleapis/google-cloud-php/issues/7734)) ([7c553c2](https://github.com/googleapis/google-cloud-php/commit/7c553c279fdd3eee3eb07c062007f9b4f1aa6e20)) +* Add tile navigation ([7c553c2](https://github.com/googleapis/google-cloud-php/commit/7c553c279fdd3eee3eb07c062007f9b4f1aa6e20)) + + +### Documentation + +* Keep the API doc up-to-date with recent changes ([7c553c2](https://github.com/googleapis/google-cloud-php/commit/7c553c279fdd3eee3eb07c062007f9b4f1aa6e20)) + +
+ +
google/cloud-spanner 1.87.0 + + + +### Features + +* Protos for R/W transaction support on multiplexed sessions ([#7736](https://github.com/googleapis/google-cloud-php/issues/7736)) ([dd48f72](https://github.com/googleapis/google-cloud-php/commit/dd48f72f8ca75bb3d038fc717338a5a39d24c977)) + +
+ +
google/cloud-text-to-speech 1.10.0 + + + +### Features + +* Add CustomPronunciationParams for upcoming feature work ([ce39c2e](https://github.com/googleapis/google-cloud-php/commit/ce39c2ef70b75bda13fde63335fd6810480d606d)) +* Add low latency journey option to proto ([#7740](https://github.com/googleapis/google-cloud-php/issues/7740)) ([ce39c2e](https://github.com/googleapis/google-cloud-php/commit/ce39c2ef70b75bda13fde63335fd6810480d606d)) + +
+ ## 0.262.0
google/cloud-ai-platform 1.8.0 diff --git a/CommerceConsumerProcurement/VERSION b/CommerceConsumerProcurement/VERSION index 3eefcb9dd5b3..9084fa2f716a 100644 --- a/CommerceConsumerProcurement/VERSION +++ b/CommerceConsumerProcurement/VERSION @@ -1 +1 @@ -1.0.0 +1.1.0 diff --git a/ContactCenterInsights/VERSION b/ContactCenterInsights/VERSION index 38f77a65b301..7ec1d6db4087 100644 --- a/ContactCenterInsights/VERSION +++ b/ContactCenterInsights/VERSION @@ -1 +1 @@ -2.0.1 +2.1.0 diff --git a/Container/VERSION b/Container/VERSION index 7ec1d6db4087..ccbccc3dc626 100644 --- a/Container/VERSION +++ b/Container/VERSION @@ -1 +1 @@ -2.1.0 +2.2.0 diff --git a/Datastore/VERSION b/Datastore/VERSION index 034552a83eeb..34aae156b192 100644 --- a/Datastore/VERSION +++ b/Datastore/VERSION @@ -1 +1 @@ -1.30.0 +1.31.0 diff --git a/Datastore/src/DatastoreClient.php b/Datastore/src/DatastoreClient.php index 4db0b68e9b46..d4ef798e4417 100644 --- a/Datastore/src/DatastoreClient.php +++ b/Datastore/src/DatastoreClient.php @@ -92,7 +92,7 @@ class DatastoreClient use ClientTrait; use DatastoreTrait; - const VERSION = '1.30.0'; + const VERSION = '1.31.0'; const FULL_CONTROL_SCOPE = 'https://www.googleapis.com/auth/datastore'; diff --git a/DiscoveryEngine/VERSION b/DiscoveryEngine/VERSION index 9084fa2f716a..26aaba0e8663 100644 --- a/DiscoveryEngine/VERSION +++ b/DiscoveryEngine/VERSION @@ -1 +1 @@ -1.1.0 +1.2.0 diff --git a/PubSub/VERSION b/PubSub/VERSION index 24ba9a38de68..834f26295383 100644 --- a/PubSub/VERSION +++ b/PubSub/VERSION @@ -1 +1 @@ -2.7.0 +2.8.0 diff --git a/PubSub/src/PubSubClient.php b/PubSub/src/PubSubClient.php index 938d05cfc093..1711371f87d3 100644 --- a/PubSub/src/PubSubClient.php +++ b/PubSub/src/PubSubClient.php @@ -99,7 +99,7 @@ class PubSubClient use ApiHelperTrait; use ClientOptionsTrait; - const VERSION = '2.7.0'; + const VERSION = '2.8.0'; const FULL_CONTROL_SCOPE = 'https://www.googleapis.com/auth/pubsub'; diff --git a/Retail/VERSION b/Retail/VERSION index 227cea215648..7ec1d6db4087 100644 --- a/Retail/VERSION +++ b/Retail/VERSION @@ -1 +1 @@ -2.0.0 +2.1.0 diff --git a/Spanner/VERSION b/Spanner/VERSION index b7844a6ffdcb..f6342716723f 100644 --- a/Spanner/VERSION +++ b/Spanner/VERSION @@ -1 +1 @@ -1.86.0 +1.87.0 diff --git a/Spanner/src/SpannerClient.php b/Spanner/src/SpannerClient.php index 64ad7f2c1c6c..7c379c418cfa 100644 --- a/Spanner/src/SpannerClient.php +++ b/Spanner/src/SpannerClient.php @@ -120,7 +120,7 @@ class SpannerClient use LROTrait; use ValidateTrait; - const VERSION = '1.86.0'; + const VERSION = '1.87.0'; const FULL_CONTROL_SCOPE = 'https://www.googleapis.com/auth/spanner.data'; const ADMIN_SCOPE = 'https://www.googleapis.com/auth/spanner.admin'; diff --git a/TextToSpeech/VERSION b/TextToSpeech/VERSION index 9ab8337f3962..81c871de46b3 100644 --- a/TextToSpeech/VERSION +++ b/TextToSpeech/VERSION @@ -1 +1 @@ -1.9.1 +1.10.0 diff --git a/composer.json b/composer.json index cef449693376..a853a691adae 100644 --- a/composer.json +++ b/composer.json @@ -89,7 +89,7 @@ "google/cloud-asset": "2.1.0", "google/cloud-assured-workloads": "1.0.0", "google/cloud-automl": "2.0.0", - "google/cloud-backupdr": "0.3.0", + "google/cloud-backupdr": "0.4.0", "google/cloud-bare-metal-solution": "1.0.0", "google/cloud-batch": "1.1.1", "google/cloud-beyondcorp-appconnections": "1.0.0", @@ -114,13 +114,13 @@ "google/cloud-certificate-manager": "1.0.0", "google/cloud-channel": "2.1.0", "google/cloud-cloudcontrolspartner": "0.2.0", - "google/cloud-commerce-consumer-procurement": "1.0.0", + "google/cloud-commerce-consumer-procurement": "1.1.0", "google/cloud-common-protos": "0.6.0", "google/cloud-compute": "1.19.0", "google/cloud-confidentialcomputing": "1.1.0", "google/cloud-config": "1.0.0", - "google/cloud-contact-center-insights": "2.0.1", - "google/cloud-container": "2.1.0", + "google/cloud-contact-center-insights": "2.1.0", + "google/cloud-container": "2.2.0", "google/cloud-container-analysis": "1.0.1", "google/cloud-core": "1.60.0", "google/cloud-data-catalog": "2.0.1", @@ -132,7 +132,7 @@ "google/cloud-dataplex": "1.0.0", "google/cloud-dataproc": "2.1.0", "google/cloud-dataproc-metastore": "1.0.0", - "google/cloud-datastore": "1.30.0", + "google/cloud-datastore": "1.31.0", "google/cloud-datastore-admin": "1.0.0", "google/cloud-datastream": "2.0.0", "google/cloud-debugger": "1.9.0", @@ -140,7 +140,7 @@ "google/cloud-developerconnect": "0.1.1", "google/cloud-dialogflow": "1.15.0", "google/cloud-dialogflow-cx": "0.4.0", - "google/cloud-discoveryengine": "1.1.0", + "google/cloud-discoveryengine": "1.2.0", "google/cloud-dlp": "2.1.0", "google/cloud-dms": "2.0.1", "google/cloud-document-ai": "2.0.0", @@ -192,7 +192,7 @@ "google/cloud-private-catalog": "0.4.4", "google/cloud-privilegedaccessmanager": "0.1.0", "google/cloud-profiler": "2.0.0", - "google/cloud-pubsub": "2.7.0", + "google/cloud-pubsub": "2.8.0", "google/cloud-quotas": "1.0.0", "google/cloud-rapidmigrationassessment": "1.0.0", "google/cloud-recaptcha-enterprise": "1.15.0", @@ -202,7 +202,7 @@ "google/cloud-redis-cluster": "0.3.0", "google/cloud-resource-manager": "1.0.0", "google/cloud-resource-settings": "2.0.1", - "google/cloud-retail": "2.0.0", + "google/cloud-retail": "2.1.0", "google/cloud-run": "1.2.0", "google/cloud-scheduler": "2.0.0", "google/cloud-secret-manager": "1.15.2", @@ -217,7 +217,7 @@ "google/cloud-service-usage": "2.0.0", "google/cloud-servicehealth": "0.1.6", "google/cloud-shell": "2.0.1", - "google/cloud-spanner": "1.86.0", + "google/cloud-spanner": "1.87.0", "google/cloud-speech": "1.19.0", "google/cloud-sql-admin": "1.2.0", "google/cloud-storage": "1.43.1", @@ -228,7 +228,7 @@ "google/cloud-talent": "2.0.0", "google/cloud-tasks": "1.15.0", "google/cloud-telcoautomation": "1.0.0", - "google/cloud-text-to-speech": "1.9.1", + "google/cloud-text-to-speech": "1.10.0", "google/cloud-tpu": "1.4.5", "google/cloud-trace": "1.8.6", "google/cloud-translate": "1.19.0", From 129458ae6916e651a3165e4bc0b23a3edbf5cd09 Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Fri, 11 Oct 2024 13:34:49 -0600 Subject: [PATCH 12/34] fix(ci): ref in backwards-compatibility-checks (#7728) --- .github/workflows/backwards-compatibility-checks.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backwards-compatibility-checks.yaml b/.github/workflows/backwards-compatibility-checks.yaml index d70fede112d9..284f12f30e9e 100644 --- a/.github/workflows/backwards-compatibility-checks.yaml +++ b/.github/workflows/backwards-compatibility-checks.yaml @@ -69,7 +69,7 @@ jobs: # OwlBot PRs which are not labelled feat should not add new files or methods run: | ~/.composer/vendor/bin/roave-backward-compatibility-check \ - --from=${{ github.ref_name }} \ + --from=${{ github.head_ref || github.ref_name }} \ --to=origin/main --format=github-actions - name: "Print the action item" run: | From 6865827d0c14684460a2565b0f6ecc1610c1ee3a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 17 Oct 2024 15:38:00 -0400 Subject: [PATCH 13/34] feat: add experimental ArrowData type and arrow_data field within AppendRowsRequest (#7743) PiperOrigin-RevId: 684900949 Source-Link: https://github.com/googleapis/googleapis/commit/b49a983820806fc0d903370c0e75129fe7ae3c7b Source-Link: https://github.com/googleapis/googleapis-gen/commit/34ddd0399386aeb1d4ab5d397a6dcce5908a16f0 Copy-Tag: eyJwIjoiQmlnUXVlcnlTdG9yYWdlLy5Pd2xCb3QueWFtbCIsImgiOiIzNGRkZDAzOTkzODZhZWIxZDRhYjVkMzk3YTZkY2NlNTkwOGExNmYwIn0= --- BigQueryStorage/metadata/V1/Storage.php | Bin 8676 -> 8911 bytes BigQueryStorage/src/V1/AppendRowsRequest.php | 36 +++++ .../src/V1/AppendRowsRequest/ArrowData.php | 124 ++++++++++++++++++ 3 files changed, 160 insertions(+) create mode 100644 BigQueryStorage/src/V1/AppendRowsRequest/ArrowData.php diff --git a/BigQueryStorage/metadata/V1/Storage.php b/BigQueryStorage/metadata/V1/Storage.php index 4799af5a28cb4ea7e53d82bd6eab129f860c58b0..b6dc4a5859a8ae18fcbcc9fa6638ee7200c7b512 100644 GIT binary patch delta 126 zcmaFjeBO1#BNmoL)?9j%ds!7H=J0M7Vcp5j^n+vad7cNN!CYL4MMe4L@jzTG!K%Qh z!EIza*^x_m@_GSo?!wa4;u1Yakb=!Cc%>LQCo^(!g1M7V^Vv^c$Hgrmhtq&p-N@)%| diff --git a/BigQueryStorage/src/V1/AppendRowsRequest.php b/BigQueryStorage/src/V1/AppendRowsRequest.php index a28d688b2ddb..0b1e665e3d46 100644 --- a/BigQueryStorage/src/V1/AppendRowsRequest.php +++ b/BigQueryStorage/src/V1/AppendRowsRequest.php @@ -174,6 +174,9 @@ public static function build(string $writeStream): self * when calling AppendRows for the '_default' stream. * @type \Google\Cloud\BigQuery\Storage\V1\AppendRowsRequest\ProtoData $proto_rows * Rows in proto format. + * @type \Google\Cloud\BigQuery\Storage\V1\AppendRowsRequest\ArrowData $arrow_rows + * Rows in arrow format. This is an experimental feature only selected for + * allowlisted customers. * @type string $trace_id * Id set by client to annotate its identity. Only initial request setting is * respected. @@ -377,6 +380,39 @@ public function setProtoRows($var) return $this; } + /** + * Rows in arrow format. This is an experimental feature only selected for + * allowlisted customers. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.AppendRowsRequest.ArrowData arrow_rows = 5; + * @return \Google\Cloud\BigQuery\Storage\V1\AppendRowsRequest\ArrowData|null + */ + public function getArrowRows() + { + return $this->readOneof(5); + } + + public function hasArrowRows() + { + return $this->hasOneof(5); + } + + /** + * Rows in arrow format. This is an experimental feature only selected for + * allowlisted customers. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.AppendRowsRequest.ArrowData arrow_rows = 5; + * @param \Google\Cloud\BigQuery\Storage\V1\AppendRowsRequest\ArrowData $var + * @return $this + */ + public function setArrowRows($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Storage\V1\AppendRowsRequest\ArrowData::class); + $this->writeOneof(5, $var); + + return $this; + } + /** * Id set by client to annotate its identity. Only initial request setting is * respected. diff --git a/BigQueryStorage/src/V1/AppendRowsRequest/ArrowData.php b/BigQueryStorage/src/V1/AppendRowsRequest/ArrowData.php new file mode 100644 index 000000000000..cc96f42dad0f --- /dev/null +++ b/BigQueryStorage/src/V1/AppendRowsRequest/ArrowData.php @@ -0,0 +1,124 @@ +google.cloud.bigquery.storage.v1.AppendRowsRequest.ArrowData + */ +class ArrowData extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Arrow Schema used to serialize the data. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ArrowSchema writer_schema = 1; + */ + protected $writer_schema = null; + /** + * Required. Serialized row data in Arrow format. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ArrowRecordBatch rows = 2; + */ + protected $rows = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BigQuery\Storage\V1\ArrowSchema $writer_schema + * Optional. Arrow Schema used to serialize the data. + * @type \Google\Cloud\BigQuery\Storage\V1\ArrowRecordBatch $rows + * Required. Serialized row data in Arrow format. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Storage\V1\Storage::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Arrow Schema used to serialize the data. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ArrowSchema writer_schema = 1; + * @return \Google\Cloud\BigQuery\Storage\V1\ArrowSchema|null + */ + public function getWriterSchema() + { + return $this->writer_schema; + } + + public function hasWriterSchema() + { + return isset($this->writer_schema); + } + + public function clearWriterSchema() + { + unset($this->writer_schema); + } + + /** + * Optional. Arrow Schema used to serialize the data. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ArrowSchema writer_schema = 1; + * @param \Google\Cloud\BigQuery\Storage\V1\ArrowSchema $var + * @return $this + */ + public function setWriterSchema($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Storage\V1\ArrowSchema::class); + $this->writer_schema = $var; + + return $this; + } + + /** + * Required. Serialized row data in Arrow format. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ArrowRecordBatch rows = 2; + * @return \Google\Cloud\BigQuery\Storage\V1\ArrowRecordBatch|null + */ + public function getRows() + { + return $this->rows; + } + + public function hasRows() + { + return isset($this->rows); + } + + public function clearRows() + { + unset($this->rows); + } + + /** + * Required. Serialized row data in Arrow format. + * + * Generated from protobuf field .google.cloud.bigquery.storage.v1.ArrowRecordBatch rows = 2; + * @param \Google\Cloud\BigQuery\Storage\V1\ArrowRecordBatch $var + * @return $this + */ + public function setRows($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Storage\V1\ArrowRecordBatch::class); + $this->rows = $var; + + return $this; + } + +} + + From 327de673ae8bcb59533d906237ce5c73416293c4 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 17 Oct 2024 15:44:50 -0400 Subject: [PATCH 14/34] feat: Add FindNearest API to the stable branch (#7744) PiperOrigin-RevId: 684905940 Source-Link: https://github.com/googleapis/googleapis/commit/2196d4843a22befdc7bc3b7b676eeb392c31b3cf Source-Link: https://github.com/googleapis/googleapis-gen/commit/05df6fa16ab93bd9da17b56edd379b43963de167 Copy-Tag: eyJwIjoiRGF0YXN0b3JlLy5Pd2xCb3QueWFtbCIsImgiOiIwNWRmNmZhMTZhYjkzYmQ5ZGExN2I1NmVkZDM3OWI0Mzk2M2RlMTY3In0= --- Datastore/metadata/V1/Query.php | Bin 4366 -> 4897 bytes Datastore/src/V1/FindNearest.php | 390 ++++++++++++++++++ .../src/V1/FindNearest/DistanceMeasure.php | 82 ++++ Datastore/src/V1/Query.php | 60 +++ 4 files changed, 532 insertions(+) create mode 100644 Datastore/src/V1/FindNearest.php create mode 100644 Datastore/src/V1/FindNearest/DistanceMeasure.php diff --git a/Datastore/metadata/V1/Query.php b/Datastore/metadata/V1/Query.php index 04f68361a258e850ff80a5bdba11974d64b91292..a42f6011f29891340783c73ac1e44cf2d3b47cc8 100644 GIT binary patch delta 441 zcmZ9H&r8B!7{}Y@1m9_n7lI)MOGtuXl~9-Hu(nqi9!2Y5={ zkj$x6l9>acAumq~J7O~l%xr$i{isa*&EMxMUmOrN5~zdnE$P!B#7jXq+f7Lpo`T{{ zM8XBmB8gpTE2*}A?fMbPFbjwSZ%*B5pWq2`=TS%`ETaaYxbrz*fd(f+N8D z-o&F)Zu!aY-DSglAg!&*Q;|>cEDUBOqzj2p?1dC#;01tdjE)m<9QXq%ziL`lMnN$0 ziIObRpcf4lJ&1ZfS$Ah@7?l52f-M#7ZX#b%;r5z>lm3nF>TIaDPr6#&DO%Uxs-1W3jofc3wrgoogle.datastore.v1.FindNearest + */ +class FindNearest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. An indexed vector property to search upon. Only documents which + * contain vectors whose dimensionality match the query_vector can be + * returned. + * + * Generated from protobuf field .google.datastore.v1.PropertyReference vector_property = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $vector_property = null; + /** + * Required. The query vector that we are searching on. Must be a vector of no + * more than 2048 dimensions. + * + * Generated from protobuf field .google.datastore.v1.Value query_vector = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $query_vector = null; + /** + * Required. The Distance Measure to use, required. + * + * Generated from protobuf field .google.datastore.v1.FindNearest.DistanceMeasure distance_measure = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + private $distance_measure = 0; + /** + * Required. The number of nearest neighbors to return. Must be a positive + * integer of no more than 100. + * + * Generated from protobuf field .google.protobuf.Int32Value limit = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + private $limit = null; + /** + * Optional. Optional name of the field to output the result of the vector + * distance calculation. Must conform to [entity + * property][google.datastore.v1.Entity.properties] limitations. + * + * Generated from protobuf field string distance_result_property = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $distance_result_property = ''; + /** + * Optional. Option to specify a threshold for which no less similar documents + * will be returned. The behavior of the specified `distance_measure` will + * affect the meaning of the distance threshold. Since DOT_PRODUCT distances + * increase when the vectors are more similar, the comparison is inverted. + * For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold + * For DOT_PRODUCT: WHERE distance >= distance_threshold + * + * Generated from protobuf field .google.protobuf.DoubleValue distance_threshold = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $distance_threshold = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Datastore\V1\PropertyReference $vector_property + * Required. An indexed vector property to search upon. Only documents which + * contain vectors whose dimensionality match the query_vector can be + * returned. + * @type \Google\Cloud\Datastore\V1\Value $query_vector + * Required. The query vector that we are searching on. Must be a vector of no + * more than 2048 dimensions. + * @type int $distance_measure + * Required. The Distance Measure to use, required. + * @type \Google\Protobuf\Int32Value $limit + * Required. The number of nearest neighbors to return. Must be a positive + * integer of no more than 100. + * @type string $distance_result_property + * Optional. Optional name of the field to output the result of the vector + * distance calculation. Must conform to [entity + * property][google.datastore.v1.Entity.properties] limitations. + * @type \Google\Protobuf\DoubleValue $distance_threshold + * Optional. Option to specify a threshold for which no less similar documents + * will be returned. The behavior of the specified `distance_measure` will + * affect the meaning of the distance threshold. Since DOT_PRODUCT distances + * increase when the vectors are more similar, the comparison is inverted. + * For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold + * For DOT_PRODUCT: WHERE distance >= distance_threshold + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Query::initOnce(); + parent::__construct($data); + } + + /** + * Required. An indexed vector property to search upon. Only documents which + * contain vectors whose dimensionality match the query_vector can be + * returned. + * + * Generated from protobuf field .google.datastore.v1.PropertyReference vector_property = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Datastore\V1\PropertyReference|null + */ + public function getVectorProperty() + { + return $this->vector_property; + } + + public function hasVectorProperty() + { + return isset($this->vector_property); + } + + public function clearVectorProperty() + { + unset($this->vector_property); + } + + /** + * Required. An indexed vector property to search upon. Only documents which + * contain vectors whose dimensionality match the query_vector can be + * returned. + * + * Generated from protobuf field .google.datastore.v1.PropertyReference vector_property = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Datastore\V1\PropertyReference $var + * @return $this + */ + public function setVectorProperty($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\PropertyReference::class); + $this->vector_property = $var; + + return $this; + } + + /** + * Required. The query vector that we are searching on. Must be a vector of no + * more than 2048 dimensions. + * + * Generated from protobuf field .google.datastore.v1.Value query_vector = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Datastore\V1\Value|null + */ + public function getQueryVector() + { + return $this->query_vector; + } + + public function hasQueryVector() + { + return isset($this->query_vector); + } + + public function clearQueryVector() + { + unset($this->query_vector); + } + + /** + * Required. The query vector that we are searching on. Must be a vector of no + * more than 2048 dimensions. + * + * Generated from protobuf field .google.datastore.v1.Value query_vector = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Datastore\V1\Value $var + * @return $this + */ + public function setQueryVector($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Value::class); + $this->query_vector = $var; + + return $this; + } + + /** + * Required. The Distance Measure to use, required. + * + * Generated from protobuf field .google.datastore.v1.FindNearest.DistanceMeasure distance_measure = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getDistanceMeasure() + { + return $this->distance_measure; + } + + /** + * Required. The Distance Measure to use, required. + * + * Generated from protobuf field .google.datastore.v1.FindNearest.DistanceMeasure distance_measure = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setDistanceMeasure($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Datastore\V1\FindNearest\DistanceMeasure::class); + $this->distance_measure = $var; + + return $this; + } + + /** + * Required. The number of nearest neighbors to return. Must be a positive + * integer of no more than 100. + * + * Generated from protobuf field .google.protobuf.Int32Value limit = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Int32Value|null + */ + public function getLimit() + { + return $this->limit; + } + + public function hasLimit() + { + return isset($this->limit); + } + + public function clearLimit() + { + unset($this->limit); + } + + /** + * Returns the unboxed value from getLimit() + + * Required. The number of nearest neighbors to return. Must be a positive + * integer of no more than 100. + * + * Generated from protobuf field .google.protobuf.Int32Value limit = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return int|null + */ + public function getLimitValue() + { + return $this->readWrapperValue("limit"); + } + + /** + * Required. The number of nearest neighbors to return. Must be a positive + * integer of no more than 100. + * + * Generated from protobuf field .google.protobuf.Int32Value limit = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Int32Value $var + * @return $this + */ + public function setLimit($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class); + $this->limit = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object. + + * Required. The number of nearest neighbors to return. Must be a positive + * integer of no more than 100. + * + * Generated from protobuf field .google.protobuf.Int32Value limit = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param int|null $var + * @return $this + */ + public function setLimitValue($var) + { + $this->writeWrapperValue("limit", $var); + return $this;} + + /** + * Optional. Optional name of the field to output the result of the vector + * distance calculation. Must conform to [entity + * property][google.datastore.v1.Entity.properties] limitations. + * + * Generated from protobuf field string distance_result_property = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDistanceResultProperty() + { + return $this->distance_result_property; + } + + /** + * Optional. Optional name of the field to output the result of the vector + * distance calculation. Must conform to [entity + * property][google.datastore.v1.Entity.properties] limitations. + * + * Generated from protobuf field string distance_result_property = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDistanceResultProperty($var) + { + GPBUtil::checkString($var, True); + $this->distance_result_property = $var; + + return $this; + } + + /** + * Optional. Option to specify a threshold for which no less similar documents + * will be returned. The behavior of the specified `distance_measure` will + * affect the meaning of the distance threshold. Since DOT_PRODUCT distances + * increase when the vectors are more similar, the comparison is inverted. + * For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold + * For DOT_PRODUCT: WHERE distance >= distance_threshold + * + * Generated from protobuf field .google.protobuf.DoubleValue distance_threshold = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\DoubleValue|null + */ + public function getDistanceThreshold() + { + return $this->distance_threshold; + } + + public function hasDistanceThreshold() + { + return isset($this->distance_threshold); + } + + public function clearDistanceThreshold() + { + unset($this->distance_threshold); + } + + /** + * Returns the unboxed value from getDistanceThreshold() + + * Optional. Option to specify a threshold for which no less similar documents + * will be returned. The behavior of the specified `distance_measure` will + * affect the meaning of the distance threshold. Since DOT_PRODUCT distances + * increase when the vectors are more similar, the comparison is inverted. + * For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold + * For DOT_PRODUCT: WHERE distance >= distance_threshold + * + * Generated from protobuf field .google.protobuf.DoubleValue distance_threshold = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return float|null + */ + public function getDistanceThresholdValue() + { + return $this->readWrapperValue("distance_threshold"); + } + + /** + * Optional. Option to specify a threshold for which no less similar documents + * will be returned. The behavior of the specified `distance_measure` will + * affect the meaning of the distance threshold. Since DOT_PRODUCT distances + * increase when the vectors are more similar, the comparison is inverted. + * For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold + * For DOT_PRODUCT: WHERE distance >= distance_threshold + * + * Generated from protobuf field .google.protobuf.DoubleValue distance_threshold = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\DoubleValue $var + * @return $this + */ + public function setDistanceThreshold($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\DoubleValue::class); + $this->distance_threshold = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\DoubleValue object. + + * Optional. Option to specify a threshold for which no less similar documents + * will be returned. The behavior of the specified `distance_measure` will + * affect the meaning of the distance threshold. Since DOT_PRODUCT distances + * increase when the vectors are more similar, the comparison is inverted. + * For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold + * For DOT_PRODUCT: WHERE distance >= distance_threshold + * + * Generated from protobuf field .google.protobuf.DoubleValue distance_threshold = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param float|null $var + * @return $this + */ + public function setDistanceThresholdValue($var) + { + $this->writeWrapperValue("distance_threshold", $var); + return $this;} + +} + diff --git a/Datastore/src/V1/FindNearest/DistanceMeasure.php b/Datastore/src/V1/FindNearest/DistanceMeasure.php new file mode 100644 index 000000000000..5eb0ccc00196 --- /dev/null +++ b/Datastore/src/V1/FindNearest/DistanceMeasure.php @@ -0,0 +1,82 @@ +google.datastore.v1.FindNearest.DistanceMeasure + */ +class DistanceMeasure +{ + /** + * Should not be set. + * + * Generated from protobuf enum DISTANCE_MEASURE_UNSPECIFIED = 0; + */ + const DISTANCE_MEASURE_UNSPECIFIED = 0; + /** + * Measures the EUCLIDEAN distance between the vectors. See + * [Euclidean](https://en.wikipedia.org/wiki/Euclidean_distance) to learn + * more. The resulting distance decreases the more similar two vectors are. + * + * Generated from protobuf enum EUCLIDEAN = 1; + */ + const EUCLIDEAN = 1; + /** + * COSINE distance compares vectors based on the angle between them, which + * allows you to measure similarity that isn't based on the vectors + * magnitude. We recommend using DOT_PRODUCT with unit normalized vectors + * instead of COSINE distance, which is mathematically equivalent with + * better performance. See [Cosine + * Similarity](https://en.wikipedia.org/wiki/Cosine_similarity) to learn + * more about COSINE similarity and COSINE distance. The resulting COSINE + * distance decreases the more similar two vectors are. + * + * Generated from protobuf enum COSINE = 2; + */ + const COSINE = 2; + /** + * Similar to cosine but is affected by the magnitude of the vectors. See + * [Dot Product](https://en.wikipedia.org/wiki/Dot_product) to learn more. + * The resulting distance increases the more similar two vectors are. + * + * Generated from protobuf enum DOT_PRODUCT = 3; + */ + const DOT_PRODUCT = 3; + + private static $valueToName = [ + self::DISTANCE_MEASURE_UNSPECIFIED => 'DISTANCE_MEASURE_UNSPECIFIED', + self::EUCLIDEAN => 'EUCLIDEAN', + self::COSINE => 'COSINE', + self::DOT_PRODUCT => 'DOT_PRODUCT', + ]; + + 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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DistanceMeasure::class, \Google\Cloud\Datastore\V1\FindNearest_DistanceMeasure::class); + diff --git a/Datastore/src/V1/Query.php b/Datastore/src/V1/Query.php index 0c752662bf17..e89908155e7d 100644 --- a/Datastore/src/V1/Query.php +++ b/Datastore/src/V1/Query.php @@ -10,6 +10,14 @@ /** * A query for entities. + * The query stages are executed in the following order: + * 1. kind + * 2. filter + * 3. projection + * 4. order + start_cursor + end_cursor + * 5. offset + * 6. limit + * 7. find_nearest * * Generated from protobuf message google.datastore.v1.Query */ @@ -85,6 +93,14 @@ class Query extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.protobuf.Int32Value limit = 12; */ private $limit = null; + /** + * Optional. A potential Nearest Neighbors Search. + * Applies after all other filters and ordering. + * Finds the closest vector embeddings to the given query vector. + * + * Generated from protobuf field .google.datastore.v1.FindNearest find_nearest = 13 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $find_nearest = null; /** * Constructor. @@ -126,6 +142,10 @@ class Query extends \Google\Protobuf\Internal\Message * constraints. Optional. * Unspecified is interpreted as no limit. * Must be >= 0 if specified. + * @type \Google\Cloud\Datastore\V1\FindNearest $find_nearest + * Optional. A potential Nearest Neighbors Search. + * Applies after all other filters and ordering. + * Finds the closest vector embeddings to the given query vector. * } */ public function __construct($data = NULL) { @@ -452,5 +472,45 @@ public function setLimitValue($var) $this->writeWrapperValue("limit", $var); return $this;} + /** + * Optional. A potential Nearest Neighbors Search. + * Applies after all other filters and ordering. + * Finds the closest vector embeddings to the given query vector. + * + * Generated from protobuf field .google.datastore.v1.FindNearest find_nearest = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Datastore\V1\FindNearest|null + */ + public function getFindNearest() + { + return $this->find_nearest; + } + + public function hasFindNearest() + { + return isset($this->find_nearest); + } + + public function clearFindNearest() + { + unset($this->find_nearest); + } + + /** + * Optional. A potential Nearest Neighbors Search. + * Applies after all other filters and ordering. + * Finds the closest vector embeddings to the given query vector. + * + * Generated from protobuf field .google.datastore.v1.FindNearest find_nearest = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Datastore\V1\FindNearest $var + * @return $this + */ + public function setFindNearest($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\FindNearest::class); + $this->find_nearest = $var; + + return $this; + } + } From 72df650c65a54e473aeb0e186901295c40d0c7e8 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 17 Oct 2024 15:46:55 -0400 Subject: [PATCH 15/34] feat: add messages and fields related to Redis Instances (#7748) feat: add messages and fields related to Redis Clusters feat: add PSC network attachment URI to the InstanceInfo proto feat: add subnet URI and region name to the NetworkInfo proto feat: add firewall policy URI to the FirewallInfo proto feat: add fields related to advertised routes to the RouteInfo proto feat: add region name field to the RouteInfo proto feat: add region name to the ForwardingRuleInfo proto feat: add load balancer name to the ForwardingRuleInfo proto feat: add PSC target fields to the ForwardingRuleInfo proto feat: add more detailed abort and drop causes to corresponding enums chore: update Google API field annotations format docs: update outdated comments in the FirewallInfo proto PiperOrigin-RevId: 686129238 Source-Link: https://github.com/googleapis/googleapis/commit/cab65d56577608266888c9800ba42c2bf4704805 Source-Link: https://github.com/googleapis/googleapis-gen/commit/cd5b0a24acc4c2824dcb0db4e969c3551a9470cf Copy-Tag: eyJwIjoiTmV0d29ya01hbmFnZW1lbnQvLk93bEJvdC55YW1sIiwiaCI6ImNkNWIwYTI0YWNjNGMyODI0ZGNiMGRiNGU5NjljMzU1MWE5NDcwY2YifQ== --- .../metadata/V1/ConnectivityTest.php | Bin 4760 -> 4807 bytes .../metadata/V1/Reachability.php | 33 ++- NetworkManagement/metadata/V1/Trace.php | Bin 15054 -> 17412 bytes .../create_connectivity_test.php | 36 ++- .../delete_connectivity_test.php | 13 +- .../get_connectivity_test.php | 13 +- .../list_connectivity_tests.php | 13 +- .../rerun_connectivity_test.php | 13 +- .../update_connectivity_test.php | 28 +- NetworkManagement/src/V1/AbortInfo/Cause.php | 31 +++ .../V1/Client/ReachabilityServiceClient.php | 18 +- NetworkManagement/src/V1/ConnectivityTest.php | 14 +- .../src/V1/CreateConnectivityTestRequest.php | 7 +- .../src/V1/DeleteConnectivityTestRequest.php | 7 +- NetworkManagement/src/V1/DeliverInfo.php | 72 +++++ .../src/V1/DeliverInfo/Target.php | 23 +- NetworkManagement/src/V1/DropInfo/Cause.php | 184 +++++++++++++ NetworkManagement/src/V1/Endpoint.php | 76 ++++++ NetworkManagement/src/V1/FirewallInfo.php | 104 ++++++-- .../src/V1/ForwardingRuleInfo.php | 184 +++++++++++-- .../src/V1/GetConnectivityTestRequest.php | 7 +- NetworkManagement/src/V1/InstanceInfo.php | 34 +++ .../src/V1/ListConnectivityTestsRequest.php | 7 +- NetworkManagement/src/V1/NetworkInfo.php | 77 +++++- NetworkManagement/src/V1/RedisClusterInfo.php | 249 ++++++++++++++++++ .../src/V1/RedisInstanceInfo.php | 237 +++++++++++++++++ .../src/V1/RerunConnectivityTestRequest.php | 6 +- NetworkManagement/src/V1/RouteInfo.php | 158 +++++++++-- .../src/V1/RouteInfo/RouteType.php | 8 + .../src/V1/ServerlessNegInfo.php | 68 +++++ NetworkManagement/src/V1/Step.php | 102 +++++++ NetworkManagement/src/V1/Step/State.php | 25 ++ ...reachability_service_descriptor_config.php | 1 + .../Client/ReachabilityServiceClientTest.php | 66 ++--- 34 files changed, 1703 insertions(+), 211 deletions(-) create mode 100644 NetworkManagement/src/V1/RedisClusterInfo.php create mode 100644 NetworkManagement/src/V1/RedisInstanceInfo.php create mode 100644 NetworkManagement/src/V1/ServerlessNegInfo.php diff --git a/NetworkManagement/metadata/V1/ConnectivityTest.php b/NetworkManagement/metadata/V1/ConnectivityTest.php index 841f6d992685d1dc82ed3c21740516097179786f..840c90b792b3d775859ed7d5c2706aea0d0adabf 100644 GIT binary patch delta 76 zcmbQCdR%pbCNtxu&05S{jEo$cO<6>k8BcEZVy|J;664}4N=?Zuj?c_1E=kNwPL&W; cVAS9g66NBBh$rWi7MG+JNeFE|$Z?$$05~fabpQYW delta 33 pcmX@EIzx4XCNtyW&05S{jEqd1O<6>k8E0+wVy|J`{FUPpCjg;;3BmvX diff --git a/NetworkManagement/metadata/V1/Reachability.php b/NetworkManagement/metadata/V1/Reachability.php index dbd733b1ad58..20446620128e 100644 --- a/NetworkManagement/metadata/V1/Reachability.php +++ b/NetworkManagement/metadata/V1/Reachability.php @@ -25,10 +25,11 @@ public static function initOnce() { \GPBMetadata\Google\Protobuf\Timestamp::initOnce(); $pool->internalAddGeneratedFile( ' - -4google/cloud/networkmanagement/v1/reachability.proto!google.cloud.networkmanagement.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto9google/cloud/networkmanagement/v1/connectivity_test.proto#google/longrunning/operations.protogoogle/protobuf/empty.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto"| -ListConnectivityTestsRequest -parent ( BA + +4google/cloud/networkmanagement/v1/reachability.proto!google.cloud.networkmanagement.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto9google/cloud/networkmanagement/v1/connectivity_test.proto#google/longrunning/operations.protogoogle/protobuf/empty.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto" +ListConnectivityTestsRequestC +parent ( B3AA- ++cloudresourcemanager.googleapis.com/Project page_size ( page_token (  @@ -37,20 +38,24 @@ public static function initOnce() { ListConnectivityTestsResponseF resources ( 23.google.cloud.networkmanagement.v1.ConnectivityTest next_page_token (  - unreachable ( "/ -GetConnectivityTestRequest -name ( BA" -CreateConnectivityTestRequest -parent ( BA + unreachable ( "e +GetConnectivityTestRequestG +name ( B9AA3 +1networkmanagement.googleapis.com/ConnectivityTest" +CreateConnectivityTestRequestC +parent ( B3AA- ++cloudresourcemanager.googleapis.com/Project test_id ( BAJ resource ( 23.google.cloud.networkmanagement.v1.ConnectivityTestBA" UpdateConnectivityTestRequest4 update_mask ( 2.google.protobuf.FieldMaskBAJ -resource ( 23.google.cloud.networkmanagement.v1.ConnectivityTestBA"2 -DeleteConnectivityTestRequest -name ( BA"1 -RerunConnectivityTestRequest -name ( BA" +resource ( 23.google.cloud.networkmanagement.v1.ConnectivityTestBA"h +DeleteConnectivityTestRequestG +name ( B9AA3 +1networkmanagement.googleapis.com/ConnectivityTest"g +RerunConnectivityTestRequestG +name ( B9AA3 +1networkmanagement.googleapis.com/ConnectivityTest" OperationMetadata/ create_time ( 2.google.protobuf.Timestamp, end_time ( 2.google.protobuf.Timestamp diff --git a/NetworkManagement/metadata/V1/Trace.php b/NetworkManagement/metadata/V1/Trace.php index 738b6a5c755c5e209e43bebf8d52dfab781cbae7..58bcbc14658afb5e5b020ac99439c482959152eb 100644 GIT binary patch delta 2151 zcmZuyQEb~}5XNrWwSU^i`MY%{Ytl4HyKY_AZitC#u#wtsV&dAF?R0D~{Yn$lMN5;) zNd^-_)zBpN00`}WLokF85@HA;jF8{~A>Po$03ifINKCxI<9M0`L*nctEJ^p4_`bXQ z?(X~VZZ@5Iom3hYNS-D)$^5t#YgDP!F>mG_oLkU zCRd)RrXRox8fjt+p@)-WrN77VJ1~U;-Yv0@$g$W$+E7kkfvEsa)v4C z+!X!Ve?1aL4|X67Nne$8MKTPcN-1vAsSV#^e7`Vgm~JdC(w9ar&)^seZPp4vsQzr# zK2P%XdcJUO!>ZIt!!GedP}ETD0v!n)+8si8BVR9^vx=nFSOW(S(NB*CB4cK3V08+O5J{;|C%K{r8~y}~efKMHSis94X{$+_yLhs7SY53sT8^tZ7$I3S9W zB6P)+4N2rI=lPwVGSbpCij!@TwxwQ*qR4hwJE1c_o?_TnS$bjjTht#8x(zE=^F^|j zFS}y0NhQBw@k2CmB+ek3J`!R4PLO|X!2g*K`9-T-g3@UvdX#=X;HS4E$9Cdz5KX;m z=hrQ=)+n5}>b%eO8|?Rbe21mCqf?GHImY;K2#wS4=EnDN0gTaTk90U3L?hjL2|8=h zD#QMa=nqrxu^$dOFT@rY`psNuIHzV*?UYL7EElEM<8RY&f*%(YEhiFP%YoL2psCAp z%HR@CCUK2X5-4hDIbD#tB}sCsk;`T^-GoNR@HCq0LbY|>1&h-^r{7^;57Ad zgEM!6+Vf}59ze6JS)s$;@q$b}xx6e3WJ%G440t?>52F3u=(Lnn%rp_wl8_<2_{W?Z z^Yct1jwZ8);96BfHsw{>Jniw#>RL9LO1iyzoZdNjcMR`C(;|G#N}{_1WKkmSfVa5g zu0_$3B3Vi*?q<;82T)R7+-g#hMR@JzDNWCCNq8YMZKGR@3`0_rD-hD1i){J1n&25*>Wo42S#e@#)j7#IgsAoSyF-?6EQ=^ySyS8LJg~B~i0V6#L5>}In ztM4bgntL!^^mNVC1Wn;oJc|-N<7oP|7BFd7oPm`Z0n-+=uWjoJ3619z41(M5cE;}VmODxLzv5wk8U@B_15FIEDR)iGJKj4~_%lif4>ldU)Tv-~+72eUsx F#RAU*T}J=_ diff --git a/NetworkManagement/samples/V1/ReachabilityServiceClient/create_connectivity_test.php b/NetworkManagement/samples/V1/ReachabilityServiceClient/create_connectivity_test.php index b2032d2d9485..42fa394cc492 100644 --- a/NetworkManagement/samples/V1/ReachabilityServiceClient/create_connectivity_test.php +++ b/NetworkManagement/samples/V1/ReachabilityServiceClient/create_connectivity_test.php @@ -46,24 +46,20 @@ * AMBIGUOUS. For more information, * see the Connectivity Test documentation. * - * @param string $parent The parent resource of the Connectivity Test to create: - * `projects/{project_id}/locations/global` - * @param string $testId The logical name of the Connectivity Test in your project - * with the following restrictions: + * @param string $formattedParent The parent resource of the Connectivity Test to create: + * `projects/{project_id}/locations/global` + * Please see {@see ReachabilityServiceClient::projectName()} for help formatting this field. + * @param string $testId The logical name of the Connectivity Test in your project + * with the following restrictions: * - * * Must contain only lowercase letters, numbers, and hyphens. - * * Must start with a letter. - * * Must be between 1-40 characters. - * * Must end with a number or a letter. - * * Must be unique within the customer project - * @param string $resourceName Unique name of the resource using the form: - * `projects/{project_id}/locations/global/connectivityTests/{test_id}` + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-40 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project */ -function create_connectivity_test_sample( - string $parent, - string $testId, - string $resourceName -): void { +function create_connectivity_test_sample(string $formattedParent, string $testId): void +{ // Create a client. $reachabilityServiceClient = new ReachabilityServiceClient(); @@ -71,11 +67,10 @@ function create_connectivity_test_sample( $resourceSource = new Endpoint(); $resourceDestination = new Endpoint(); $resource = (new ConnectivityTest()) - ->setName($resourceName) ->setSource($resourceSource) ->setDestination($resourceDestination); $request = (new CreateConnectivityTestRequest()) - ->setParent($parent) + ->setParent($formattedParent) ->setTestId($testId) ->setResource($resource); @@ -110,10 +105,9 @@ function create_connectivity_test_sample( */ function callSample(): void { - $parent = '[PARENT]'; + $formattedParent = ReachabilityServiceClient::projectName('[PROJECT]'); $testId = '[TEST_ID]'; - $resourceName = '[NAME]'; - create_connectivity_test_sample($parent, $testId, $resourceName); + create_connectivity_test_sample($formattedParent, $testId); } // [END networkmanagement_v1_generated_ReachabilityService_CreateConnectivityTest_sync] diff --git a/NetworkManagement/samples/V1/ReachabilityServiceClient/delete_connectivity_test.php b/NetworkManagement/samples/V1/ReachabilityServiceClient/delete_connectivity_test.php index bf2f5342673a..cbc34275e1c0 100644 --- a/NetworkManagement/samples/V1/ReachabilityServiceClient/delete_connectivity_test.php +++ b/NetworkManagement/samples/V1/ReachabilityServiceClient/delete_connectivity_test.php @@ -32,17 +32,18 @@ /** * Deletes a specific `ConnectivityTest`. * - * @param string $name Connectivity Test resource name using the form: - * `projects/{project_id}/locations/global/connectivityTests/{test_id}` + * @param string $formattedName Connectivity Test resource name using the form: + * `projects/{project_id}/locations/global/connectivityTests/{test_id}` + * Please see {@see ReachabilityServiceClient::connectivityTestName()} for help formatting this field. */ -function delete_connectivity_test_sample(string $name): void +function delete_connectivity_test_sample(string $formattedName): void { // Create a client. $reachabilityServiceClient = new ReachabilityServiceClient(); // Prepare the request message. $request = (new DeleteConnectivityTestRequest()) - ->setName($name); + ->setName($formattedName); // Call the API and handle any network failures. try { @@ -73,8 +74,8 @@ function delete_connectivity_test_sample(string $name): void */ function callSample(): void { - $name = '[NAME]'; + $formattedName = ReachabilityServiceClient::connectivityTestName('[PROJECT]', '[TEST]'); - delete_connectivity_test_sample($name); + delete_connectivity_test_sample($formattedName); } // [END networkmanagement_v1_generated_ReachabilityService_DeleteConnectivityTest_sync] diff --git a/NetworkManagement/samples/V1/ReachabilityServiceClient/get_connectivity_test.php b/NetworkManagement/samples/V1/ReachabilityServiceClient/get_connectivity_test.php index 5fa1ba48f793..d54ff9897940 100644 --- a/NetworkManagement/samples/V1/ReachabilityServiceClient/get_connectivity_test.php +++ b/NetworkManagement/samples/V1/ReachabilityServiceClient/get_connectivity_test.php @@ -31,17 +31,18 @@ /** * Gets the details of a specific Connectivity Test. * - * @param string $name `ConnectivityTest` resource name using the form: - * `projects/{project_id}/locations/global/connectivityTests/{test_id}` + * @param string $formattedName `ConnectivityTest` resource name using the form: + * `projects/{project_id}/locations/global/connectivityTests/{test_id}` + * Please see {@see ReachabilityServiceClient::connectivityTestName()} for help formatting this field. */ -function get_connectivity_test_sample(string $name): void +function get_connectivity_test_sample(string $formattedName): void { // Create a client. $reachabilityServiceClient = new ReachabilityServiceClient(); // Prepare the request message. $request = (new GetConnectivityTestRequest()) - ->setName($name); + ->setName($formattedName); // Call the API and handle any network failures. try { @@ -64,8 +65,8 @@ function get_connectivity_test_sample(string $name): void */ function callSample(): void { - $name = '[NAME]'; + $formattedName = ReachabilityServiceClient::connectivityTestName('[PROJECT]', '[TEST]'); - get_connectivity_test_sample($name); + get_connectivity_test_sample($formattedName); } // [END networkmanagement_v1_generated_ReachabilityService_GetConnectivityTest_sync] diff --git a/NetworkManagement/samples/V1/ReachabilityServiceClient/list_connectivity_tests.php b/NetworkManagement/samples/V1/ReachabilityServiceClient/list_connectivity_tests.php index aa81aa5d1534..3282f4a1ee6a 100644 --- a/NetworkManagement/samples/V1/ReachabilityServiceClient/list_connectivity_tests.php +++ b/NetworkManagement/samples/V1/ReachabilityServiceClient/list_connectivity_tests.php @@ -32,17 +32,18 @@ /** * Lists all Connectivity Tests owned by a project. * - * @param string $parent The parent resource of the Connectivity Tests: - * `projects/{project_id}/locations/global` + * @param string $formattedParent The parent resource of the Connectivity Tests: + * `projects/{project_id}/locations/global` + * Please see {@see ReachabilityServiceClient::projectName()} for help formatting this field. */ -function list_connectivity_tests_sample(string $parent): void +function list_connectivity_tests_sample(string $formattedParent): void { // Create a client. $reachabilityServiceClient = new ReachabilityServiceClient(); // Prepare the request message. $request = (new ListConnectivityTestsRequest()) - ->setParent($parent); + ->setParent($formattedParent); // Call the API and handle any network failures. try { @@ -69,8 +70,8 @@ function list_connectivity_tests_sample(string $parent): void */ function callSample(): void { - $parent = '[PARENT]'; + $formattedParent = ReachabilityServiceClient::projectName('[PROJECT]'); - list_connectivity_tests_sample($parent); + list_connectivity_tests_sample($formattedParent); } // [END networkmanagement_v1_generated_ReachabilityService_ListConnectivityTests_sync] diff --git a/NetworkManagement/samples/V1/ReachabilityServiceClient/rerun_connectivity_test.php b/NetworkManagement/samples/V1/ReachabilityServiceClient/rerun_connectivity_test.php index 5beebc05a823..b60c00cc5640 100644 --- a/NetworkManagement/samples/V1/ReachabilityServiceClient/rerun_connectivity_test.php +++ b/NetworkManagement/samples/V1/ReachabilityServiceClient/rerun_connectivity_test.php @@ -44,17 +44,18 @@ * read permissions to the network configurations of listed projects), then * the reachability result returns a value of `UNKNOWN`. * - * @param string $name Connectivity Test resource name using the form: - * `projects/{project_id}/locations/global/connectivityTests/{test_id}` + * @param string $formattedName Connectivity Test resource name using the form: + * `projects/{project_id}/locations/global/connectivityTests/{test_id}` + * Please see {@see ReachabilityServiceClient::connectivityTestName()} for help formatting this field. */ -function rerun_connectivity_test_sample(string $name): void +function rerun_connectivity_test_sample(string $formattedName): void { // Create a client. $reachabilityServiceClient = new ReachabilityServiceClient(); // Prepare the request message. $request = (new RerunConnectivityTestRequest()) - ->setName($name); + ->setName($formattedName); // Call the API and handle any network failures. try { @@ -87,8 +88,8 @@ function rerun_connectivity_test_sample(string $name): void */ function callSample(): void { - $name = '[NAME]'; + $formattedName = ReachabilityServiceClient::connectivityTestName('[PROJECT]', '[TEST]'); - rerun_connectivity_test_sample($name); + rerun_connectivity_test_sample($formattedName); } // [END networkmanagement_v1_generated_ReachabilityService_RerunConnectivityTest_sync] diff --git a/NetworkManagement/samples/V1/ReachabilityServiceClient/update_connectivity_test.php b/NetworkManagement/samples/V1/ReachabilityServiceClient/update_connectivity_test.php index 03bd16e73d41..23379ee02d96 100644 --- a/NetworkManagement/samples/V1/ReachabilityServiceClient/update_connectivity_test.php +++ b/NetworkManagement/samples/V1/ReachabilityServiceClient/update_connectivity_test.php @@ -46,12 +46,15 @@ * * If the endpoint specifications in `ConnectivityTest` are incomplete, the * reachability result returns a value of `AMBIGUOUS`. See the documentation - * in `ConnectivityTest` for for more details. + * in `ConnectivityTest` for more details. * - * @param string $resourceName Unique name of the resource using the form: - * `projects/{project_id}/locations/global/connectivityTests/{test_id}` + * 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 update_connectivity_test_sample(string $resourceName): void +function update_connectivity_test_sample(): void { // Create a client. $reachabilityServiceClient = new ReachabilityServiceClient(); @@ -61,7 +64,6 @@ function update_connectivity_test_sample(string $resourceName): void $resourceSource = new Endpoint(); $resourceDestination = new Endpoint(); $resource = (new ConnectivityTest()) - ->setName($resourceName) ->setSource($resourceSource) ->setDestination($resourceDestination); $request = (new UpdateConnectivityTestRequest()) @@ -87,20 +89,4 @@ function update_connectivity_test_sample(string $resourceName): void 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 -{ - $resourceName = '[NAME]'; - - update_connectivity_test_sample($resourceName); -} // [END networkmanagement_v1_generated_ReachabilityService_UpdateConnectivityTest_sync] diff --git a/NetworkManagement/src/V1/AbortInfo/Cause.php b/NetworkManagement/src/V1/AbortInfo/Cause.php index 4ad6af599b68..83139256a8e3 100644 --- a/NetworkManagement/src/V1/AbortInfo/Cause.php +++ b/NetworkManagement/src/V1/AbortInfo/Cause.php @@ -82,6 +82,13 @@ class Cause * Generated from protobuf enum UNKNOWN_IP = 2; */ const UNKNOWN_IP = 2; + /** + * Aborted because no endpoint with the packet's destination IP is found in + * the Google-managed project. + * + * Generated from protobuf enum GOOGLE_MANAGED_SERVICE_UNKNOWN_IP = 32; + */ + const GOOGLE_MANAGED_SERVICE_UNKNOWN_IP = 32; /** * Aborted because the source IP address doesn't belong to any of the * subnets of the source VPC network. @@ -110,6 +117,13 @@ class Cause * Generated from protobuf enum PERMISSION_DENIED_NO_NEG_ENDPOINT_CONFIGS = 29; */ const PERMISSION_DENIED_NO_NEG_ENDPOINT_CONFIGS = 29; + /** + * Aborted because user lacks permission to access Cloud Router configs + * required to run the test. + * + * Generated from protobuf enum PERMISSION_DENIED_NO_CLOUD_ROUTER_CONFIGS = 36; + */ + const PERMISSION_DENIED_NO_CLOUD_ROUTER_CONFIGS = 36; /** * Aborted because no valid source or destination endpoint is derived from * the input test request. @@ -207,6 +221,19 @@ class Cause * Generated from protobuf enum SOURCE_PSC_CLOUD_SQL_UNSUPPORTED = 20; */ const SOURCE_PSC_CLOUD_SQL_UNSUPPORTED = 20; + /** + * Aborted because tests with a Redis Cluster as a source are not supported. + * + * Generated from protobuf enum SOURCE_REDIS_CLUSTER_UNSUPPORTED = 34; + */ + const SOURCE_REDIS_CLUSTER_UNSUPPORTED = 34; + /** + * Aborted because tests with a Redis Instance as a source are not + * supported. + * + * Generated from protobuf enum SOURCE_REDIS_INSTANCE_UNSUPPORTED = 35; + */ + const SOURCE_REDIS_INSTANCE_UNSUPPORTED = 35; /** * Aborted because tests with a forwarding rule as a source are not * supported. @@ -246,10 +273,12 @@ class Cause self::DESTINATION_ENDPOINT_NOT_FOUND => 'DESTINATION_ENDPOINT_NOT_FOUND', self::MISMATCHED_DESTINATION_NETWORK => 'MISMATCHED_DESTINATION_NETWORK', self::UNKNOWN_IP => 'UNKNOWN_IP', + self::GOOGLE_MANAGED_SERVICE_UNKNOWN_IP => 'GOOGLE_MANAGED_SERVICE_UNKNOWN_IP', self::SOURCE_IP_ADDRESS_NOT_IN_SOURCE_NETWORK => 'SOURCE_IP_ADDRESS_NOT_IN_SOURCE_NETWORK', self::PERMISSION_DENIED => 'PERMISSION_DENIED', self::PERMISSION_DENIED_NO_CLOUD_NAT_CONFIGS => 'PERMISSION_DENIED_NO_CLOUD_NAT_CONFIGS', self::PERMISSION_DENIED_NO_NEG_ENDPOINT_CONFIGS => 'PERMISSION_DENIED_NO_NEG_ENDPOINT_CONFIGS', + self::PERMISSION_DENIED_NO_CLOUD_ROUTER_CONFIGS => 'PERMISSION_DENIED_NO_CLOUD_ROUTER_CONFIGS', self::NO_SOURCE_LOCATION => 'NO_SOURCE_LOCATION', self::INVALID_ARGUMENT => 'INVALID_ARGUMENT', self::TRACE_TOO_LONG => 'TRACE_TOO_LONG', @@ -264,6 +293,8 @@ class Cause self::ROUTE_CONFIG_NOT_FOUND => 'ROUTE_CONFIG_NOT_FOUND', self::GOOGLE_MANAGED_SERVICE_AMBIGUOUS_PSC_ENDPOINT => 'GOOGLE_MANAGED_SERVICE_AMBIGUOUS_PSC_ENDPOINT', self::SOURCE_PSC_CLOUD_SQL_UNSUPPORTED => 'SOURCE_PSC_CLOUD_SQL_UNSUPPORTED', + self::SOURCE_REDIS_CLUSTER_UNSUPPORTED => 'SOURCE_REDIS_CLUSTER_UNSUPPORTED', + self::SOURCE_REDIS_INSTANCE_UNSUPPORTED => 'SOURCE_REDIS_INSTANCE_UNSUPPORTED', self::SOURCE_FORWARDING_RULE_UNSUPPORTED => 'SOURCE_FORWARDING_RULE_UNSUPPORTED', self::NON_ROUTABLE_IP_ADDRESS => 'NON_ROUTABLE_IP_ADDRESS', self::UNKNOWN_ISSUE_IN_GOOGLE_MANAGED_PROJECT => 'UNKNOWN_ISSUE_IN_GOOGLE_MANAGED_PROJECT', diff --git a/NetworkManagement/src/V1/Client/ReachabilityServiceClient.php b/NetworkManagement/src/V1/Client/ReachabilityServiceClient.php index 488d77ce1be7..8996957f5fdb 100644 --- a/NetworkManagement/src/V1/Client/ReachabilityServiceClient.php +++ b/NetworkManagement/src/V1/Client/ReachabilityServiceClient.php @@ -198,11 +198,27 @@ public static function connectivityTestName(string $project, string $test): stri ]); } + /** + * Formats a string containing the fully-qualified path to represent a project + * resource. + * + * @param string $project + * + * @return string The formatted project resource. + */ + public static function projectName(string $project): string + { + return self::getPathTemplate('project')->render([ + 'project' => $project, + ]); + } + /** * Parses a formatted name string and returns an associative array of the components in the name. * The following name formats are supported: * Template: Pattern * - connectivityTest: projects/{project}/locations/global/connectivityTests/{test} + * - project: projects/{project} * * 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 @@ -474,7 +490,7 @@ public function rerunConnectivityTest( * * If the endpoint specifications in `ConnectivityTest` are incomplete, the * reachability result returns a value of `AMBIGUOUS`. See the documentation - * in `ConnectivityTest` for for more details. + * in `ConnectivityTest` for more details. * * The async variant is * {@see ReachabilityServiceClient::updateConnectivityTestAsync()} . diff --git a/NetworkManagement/src/V1/ConnectivityTest.php b/NetworkManagement/src/V1/ConnectivityTest.php index d2eb35c0ac04..d6a8f62740fe 100644 --- a/NetworkManagement/src/V1/ConnectivityTest.php +++ b/NetworkManagement/src/V1/ConnectivityTest.php @@ -16,10 +16,10 @@ class ConnectivityTest extends \Google\Protobuf\Internal\Message { /** - * Required. Unique name of the resource using the form: + * Identifier. Unique name of the resource using the form: * `projects/{project_id}/locations/global/connectivityTests/{test_id}` * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; */ protected $name = ''; /** @@ -139,7 +139,7 @@ class ConnectivityTest extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $name - * Required. Unique name of the resource using the form: + * Identifier. Unique name of the resource using the form: * `projects/{project_id}/locations/global/connectivityTests/{test_id}` * @type string $description * The user-supplied description of the Connectivity Test. @@ -210,10 +210,10 @@ public function __construct($data = NULL) { } /** - * Required. Unique name of the resource using the form: + * Identifier. Unique name of the resource using the form: * `projects/{project_id}/locations/global/connectivityTests/{test_id}` * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; * @return string */ public function getName() @@ -222,10 +222,10 @@ public function getName() } /** - * Required. Unique name of the resource using the form: + * Identifier. Unique name of the resource using the form: * `projects/{project_id}/locations/global/connectivityTests/{test_id}` * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; * @param string $var * @return $this */ diff --git a/NetworkManagement/src/V1/CreateConnectivityTestRequest.php b/NetworkManagement/src/V1/CreateConnectivityTestRequest.php index 04926c31350f..1fdd275480d8 100644 --- a/NetworkManagement/src/V1/CreateConnectivityTestRequest.php +++ b/NetworkManagement/src/V1/CreateConnectivityTestRequest.php @@ -19,7 +19,7 @@ class CreateConnectivityTestRequest extends \Google\Protobuf\Internal\Message * Required. The parent resource of the Connectivity Test to create: * `projects/{project_id}/locations/global` * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ protected $parent = ''; /** @@ -44,6 +44,7 @@ class CreateConnectivityTestRequest extends \Google\Protobuf\Internal\Message /** * @param string $parent Required. The parent resource of the Connectivity Test to create: * `projects/{project_id}/locations/global` + * Please see {@see ReachabilityServiceClient::projectName()} for help formatting this field. * @param string $testId Required. The logical name of the Connectivity Test in your project * with the following restrictions: * @@ -96,7 +97,7 @@ public function __construct($data = NULL) { * Required. The parent resource of the Connectivity Test to create: * `projects/{project_id}/locations/global` * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string */ public function getParent() @@ -108,7 +109,7 @@ public function getParent() * Required. The parent resource of the Connectivity Test to create: * `projects/{project_id}/locations/global` * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var * @return $this */ diff --git a/NetworkManagement/src/V1/DeleteConnectivityTestRequest.php b/NetworkManagement/src/V1/DeleteConnectivityTestRequest.php index e5318082aa1f..32c0612f03aa 100644 --- a/NetworkManagement/src/V1/DeleteConnectivityTestRequest.php +++ b/NetworkManagement/src/V1/DeleteConnectivityTestRequest.php @@ -19,13 +19,14 @@ class DeleteConnectivityTestRequest extends \Google\Protobuf\Internal\Message * Required. Connectivity Test resource name using the form: * `projects/{project_id}/locations/global/connectivityTests/{test_id}` * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ protected $name = ''; /** * @param string $name Required. Connectivity Test resource name using the form: * `projects/{project_id}/locations/global/connectivityTests/{test_id}` + * Please see {@see ReachabilityServiceClient::connectivityTestName()} for help formatting this field. * * @return \Google\Cloud\NetworkManagement\V1\DeleteConnectivityTestRequest * @@ -57,7 +58,7 @@ public function __construct($data = NULL) { * Required. Connectivity Test resource name using the form: * `projects/{project_id}/locations/global/connectivityTests/{test_id}` * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string */ public function getName() @@ -69,7 +70,7 @@ public function getName() * Required. Connectivity Test resource name using the form: * `projects/{project_id}/locations/global/connectivityTests/{test_id}` * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var * @return $this */ diff --git a/NetworkManagement/src/V1/DeliverInfo.php b/NetworkManagement/src/V1/DeliverInfo.php index 89bf7090122b..c21cb8450cb3 100644 --- a/NetworkManagement/src/V1/DeliverInfo.php +++ b/NetworkManagement/src/V1/DeliverInfo.php @@ -33,6 +33,19 @@ class DeliverInfo extends \Google\Protobuf\Internal\Message * Generated from protobuf field string ip_address = 3 [(.google.api.field_info) = { */ protected $ip_address = ''; + /** + * Name of the Cloud Storage Bucket the packet is delivered to (if + * applicable). + * + * Generated from protobuf field string storage_bucket = 4; + */ + protected $storage_bucket = ''; + /** + * PSC Google API target the packet is delivered to (if applicable). + * + * Generated from protobuf field string psc_google_api_target = 5; + */ + protected $psc_google_api_target = ''; /** * Constructor. @@ -46,6 +59,11 @@ class DeliverInfo extends \Google\Protobuf\Internal\Message * URI of the resource that the packet is delivered to. * @type string $ip_address * IP address of the target (if applicable). + * @type string $storage_bucket + * Name of the Cloud Storage Bucket the packet is delivered to (if + * applicable). + * @type string $psc_google_api_target + * PSC Google API target the packet is delivered to (if applicable). * } */ public function __construct($data = NULL) { @@ -131,5 +149,59 @@ public function setIpAddress($var) return $this; } + /** + * Name of the Cloud Storage Bucket the packet is delivered to (if + * applicable). + * + * Generated from protobuf field string storage_bucket = 4; + * @return string + */ + public function getStorageBucket() + { + return $this->storage_bucket; + } + + /** + * Name of the Cloud Storage Bucket the packet is delivered to (if + * applicable). + * + * Generated from protobuf field string storage_bucket = 4; + * @param string $var + * @return $this + */ + public function setStorageBucket($var) + { + GPBUtil::checkString($var, True); + $this->storage_bucket = $var; + + return $this; + } + + /** + * PSC Google API target the packet is delivered to (if applicable). + * + * Generated from protobuf field string psc_google_api_target = 5; + * @return string + */ + public function getPscGoogleApiTarget() + { + return $this->psc_google_api_target; + } + + /** + * PSC Google API target the packet is delivered to (if applicable). + * + * Generated from protobuf field string psc_google_api_target = 5; + * @param string $var + * @return $this + */ + public function setPscGoogleApiTarget($var) + { + GPBUtil::checkString($var, True); + $this->psc_google_api_target = $var; + + return $this; + } + } diff --git a/NetworkManagement/src/V1/DeliverInfo/Target.php b/NetworkManagement/src/V1/DeliverInfo/Target.php index 9f2f8e775efb..5b7310f647e0 100644 --- a/NetworkManagement/src/V1/DeliverInfo/Target.php +++ b/NetworkManagement/src/V1/DeliverInfo/Target.php @@ -57,7 +57,7 @@ class Target */ const PSC_PUBLISHED_SERVICE = 6; /** - * Target is all Google APIs that use [Private Service + * Target is Google APIs that use [Private Service * Connect](https://cloud.google.com/vpc/docs/configure-private-service-connect-apis). * * Generated from protobuf enum PSC_GOOGLE_API = 7; @@ -106,6 +106,24 @@ class Target * Generated from protobuf enum CLOUD_RUN_REVISION = 14; */ const CLOUD_RUN_REVISION = 14; + /** + * Target is a Google-managed service. Used only for return traces. + * + * Generated from protobuf enum GOOGLE_MANAGED_SERVICE = 15; + */ + const GOOGLE_MANAGED_SERVICE = 15; + /** + * Target is a Redis Instance. + * + * Generated from protobuf enum REDIS_INSTANCE = 16; + */ + const REDIS_INSTANCE = 16; + /** + * Target is a Redis Cluster. + * + * Generated from protobuf enum REDIS_CLUSTER = 17; + */ + const REDIS_CLUSTER = 17; private static $valueToName = [ self::TARGET_UNSPECIFIED => 'TARGET_UNSPECIFIED', @@ -123,6 +141,9 @@ class Target self::CLOUD_FUNCTION => 'CLOUD_FUNCTION', self::APP_ENGINE_VERSION => 'APP_ENGINE_VERSION', self::CLOUD_RUN_REVISION => 'CLOUD_RUN_REVISION', + self::GOOGLE_MANAGED_SERVICE => 'GOOGLE_MANAGED_SERVICE', + self::REDIS_INSTANCE => 'REDIS_INSTANCE', + self::REDIS_CLUSTER => 'REDIS_CLUSTER', ]; public static function name($value) diff --git a/NetworkManagement/src/V1/DropInfo/Cause.php b/NetworkManagement/src/V1/DropInfo/Cause.php index ea2af29e0c9d..226a8444f9d8 100644 --- a/NetworkManagement/src/V1/DropInfo/Cause.php +++ b/NetworkManagement/src/V1/DropInfo/Cause.php @@ -201,6 +201,18 @@ class Cause * Generated from protobuf enum CLOUD_SQL_INSTANCE_NOT_RUNNING = 28; */ const CLOUD_SQL_INSTANCE_NOT_RUNNING = 28; + /** + * Packet sent from or to a Redis Instance that is not in running state. + * + * Generated from protobuf enum REDIS_INSTANCE_NOT_RUNNING = 68; + */ + const REDIS_INSTANCE_NOT_RUNNING = 68; + /** + * Packet sent from or to a Redis Cluster that is not in running state. + * + * Generated from protobuf enum REDIS_CLUSTER_NOT_RUNNING = 69; + */ + const REDIS_CLUSTER_NOT_RUNNING = 69; /** * The type of traffic is blocked and the user cannot configure a firewall * rule to enable it. See [Always blocked @@ -311,6 +323,14 @@ class Cause * Generated from protobuf enum CLOUD_SQL_INSTANCE_NO_ROUTE = 35; */ const CLOUD_SQL_INSTANCE_NO_ROUTE = 35; + /** + * Packet was dropped because the Cloud SQL instance requires all + * connections to use Cloud SQL connectors and to target the Cloud SQL proxy + * port (3307). + * + * Generated from protobuf enum CLOUD_SQL_CONNECTOR_REQUIRED = 63; + */ + const CLOUD_SQL_CONNECTOR_REQUIRED = 63; /** * Packet could be dropped because the Cloud Function is not in an active * status. @@ -331,6 +351,20 @@ class Cause * Generated from protobuf enum VPC_CONNECTOR_NOT_RUNNING = 24; */ const VPC_CONNECTOR_NOT_RUNNING = 24; + /** + * Packet could be dropped because the traffic from the serverless service + * to the VPC connector is not allowed. + * + * Generated from protobuf enum VPC_CONNECTOR_SERVERLESS_TRAFFIC_BLOCKED = 60; + */ + const VPC_CONNECTOR_SERVERLESS_TRAFFIC_BLOCKED = 60; + /** + * Packet could be dropped because the health check traffic to the VPC + * connector is not allowed. + * + * Generated from protobuf enum VPC_CONNECTOR_HEALTH_CHECK_TRAFFIC_BLOCKED = 61; + */ + const VPC_CONNECTOR_HEALTH_CHECK_TRAFFIC_BLOCKED = 61; /** * Packet could be dropped because it was sent from a different region * to a regional forwarding without global access. @@ -383,6 +417,13 @@ class Cause * Generated from protobuf enum NO_NAT_SUBNETS_FOR_PSC_SERVICE_ATTACHMENT = 57; */ const NO_NAT_SUBNETS_FOR_PSC_SERVICE_ATTACHMENT = 57; + /** + * PSC endpoint is accessed via NCC, but PSC transitivity configuration is + * not yet propagated. + * + * Generated from protobuf enum PSC_TRANSITIVITY_NOT_PROPAGATED = 64; + */ + const PSC_TRANSITIVITY_NOT_PROPAGATED = 64; /** * The packet sent from the hybrid NEG proxy matches a non-dynamic route, * but such a configuration is not supported. @@ -429,6 +470,126 @@ class Cause * Generated from protobuf enum ROUTING_LOOP = 59; */ const ROUTING_LOOP = 59; + /** + * Packet is dropped inside a Google-managed service due to being delivered + * in return trace to an endpoint that doesn't match the endpoint the packet + * was sent from in forward trace. Used only for return traces. + * + * Generated from protobuf enum DROPPED_INSIDE_GOOGLE_MANAGED_SERVICE = 62; + */ + const DROPPED_INSIDE_GOOGLE_MANAGED_SERVICE = 62; + /** + * Packet is dropped due to a load balancer backend instance not having a + * network interface in the network expected by the load balancer. + * + * Generated from protobuf enum LOAD_BALANCER_BACKEND_INVALID_NETWORK = 65; + */ + const LOAD_BALANCER_BACKEND_INVALID_NETWORK = 65; + /** + * Packet is dropped due to a backend service named port not being defined + * on the instance group level. + * + * Generated from protobuf enum BACKEND_SERVICE_NAMED_PORT_NOT_DEFINED = 66; + */ + const BACKEND_SERVICE_NAMED_PORT_NOT_DEFINED = 66; + /** + * Packet is dropped due to a destination IP range being part of a Private + * NAT IP range. + * + * Generated from protobuf enum DESTINATION_IS_PRIVATE_NAT_IP_RANGE = 67; + */ + const DESTINATION_IS_PRIVATE_NAT_IP_RANGE = 67; + /** + * Generic drop cause for a packet being dropped inside a Redis Instance + * service project. + * + * Generated from protobuf enum DROPPED_INSIDE_REDIS_INSTANCE_SERVICE = 70; + */ + const DROPPED_INSIDE_REDIS_INSTANCE_SERVICE = 70; + /** + * Packet is dropped due to an unsupported port being used to connect to a + * Redis Instance. Port 6379 should be used to connect to a Redis Instance. + * + * Generated from protobuf enum REDIS_INSTANCE_UNSUPPORTED_PORT = 71; + */ + const REDIS_INSTANCE_UNSUPPORTED_PORT = 71; + /** + * Packet is dropped due to connecting from PUPI address to a PSA based + * Redis Instance. + * + * Generated from protobuf enum REDIS_INSTANCE_CONNECTING_FROM_PUPI_ADDRESS = 72; + */ + const REDIS_INSTANCE_CONNECTING_FROM_PUPI_ADDRESS = 72; + /** + * Packet is dropped due to no route to the destination network. + * + * Generated from protobuf enum REDIS_INSTANCE_NO_ROUTE_TO_DESTINATION_NETWORK = 73; + */ + const REDIS_INSTANCE_NO_ROUTE_TO_DESTINATION_NETWORK = 73; + /** + * Redis Instance does not have an external IP address. + * + * Generated from protobuf enum REDIS_INSTANCE_NO_EXTERNAL_IP = 74; + */ + const REDIS_INSTANCE_NO_EXTERNAL_IP = 74; + /** + * Packet is dropped due to an unsupported protocol being used to connect to + * a Redis Instance. Only TCP connections are accepted by a Redis Instance. + * + * Generated from protobuf enum REDIS_INSTANCE_UNSUPPORTED_PROTOCOL = 78; + */ + const REDIS_INSTANCE_UNSUPPORTED_PROTOCOL = 78; + /** + * Generic drop cause for a packet being dropped inside a Redis Cluster + * service project. + * + * Generated from protobuf enum DROPPED_INSIDE_REDIS_CLUSTER_SERVICE = 75; + */ + const DROPPED_INSIDE_REDIS_CLUSTER_SERVICE = 75; + /** + * Packet is dropped due to an unsupported port being used to connect to a + * Redis Cluster. Ports 6379 and 11000 to 13047 should be used to connect to + * a Redis Cluster. + * + * Generated from protobuf enum REDIS_CLUSTER_UNSUPPORTED_PORT = 76; + */ + const REDIS_CLUSTER_UNSUPPORTED_PORT = 76; + /** + * Redis Cluster does not have an external IP address. + * + * Generated from protobuf enum REDIS_CLUSTER_NO_EXTERNAL_IP = 77; + */ + const REDIS_CLUSTER_NO_EXTERNAL_IP = 77; + /** + * Packet is dropped due to an unsupported protocol being used to connect to + * a Redis Cluster. Only TCP connections are accepted by a Redis Cluster. + * + * Generated from protobuf enum REDIS_CLUSTER_UNSUPPORTED_PROTOCOL = 79; + */ + const REDIS_CLUSTER_UNSUPPORTED_PROTOCOL = 79; + /** + * Packet from the non-GCP (on-prem) or unknown GCP network is dropped due + * to the destination IP address not belonging to any IP prefix advertised + * via BGP by the Cloud Router. + * + * Generated from protobuf enum NO_ADVERTISED_ROUTE_TO_GCP_DESTINATION = 80; + */ + const NO_ADVERTISED_ROUTE_TO_GCP_DESTINATION = 80; + /** + * Packet from the non-GCP (on-prem) or unknown GCP network is dropped due + * to the destination IP address not belonging to any IP prefix included to + * the local traffic selector of the VPN tunnel. + * + * Generated from protobuf enum NO_TRAFFIC_SELECTOR_TO_GCP_DESTINATION = 81; + */ + const NO_TRAFFIC_SELECTOR_TO_GCP_DESTINATION = 81; + /** + * Packet from the unknown peered network is dropped due to no known route + * from the source network to the destination IP address. + * + * Generated from protobuf enum NO_KNOWN_ROUTE_FROM_PEERED_NETWORK_TO_DESTINATION = 82; + */ + const NO_KNOWN_ROUTE_FROM_PEERED_NETWORK_TO_DESTINATION = 82; private static $valueToName = [ self::CAUSE_UNSPECIFIED => 'CAUSE_UNSPECIFIED', @@ -459,6 +620,8 @@ class Cause self::INSTANCE_NOT_RUNNING => 'INSTANCE_NOT_RUNNING', self::GKE_CLUSTER_NOT_RUNNING => 'GKE_CLUSTER_NOT_RUNNING', self::CLOUD_SQL_INSTANCE_NOT_RUNNING => 'CLOUD_SQL_INSTANCE_NOT_RUNNING', + self::REDIS_INSTANCE_NOT_RUNNING => 'REDIS_INSTANCE_NOT_RUNNING', + self::REDIS_CLUSTER_NOT_RUNNING => 'REDIS_CLUSTER_NOT_RUNNING', self::TRAFFIC_TYPE_BLOCKED => 'TRAFFIC_TYPE_BLOCKED', self::GKE_MASTER_UNAUTHORIZED_ACCESS => 'GKE_MASTER_UNAUTHORIZED_ACCESS', self::CLOUD_SQL_INSTANCE_UNAUTHORIZED_ACCESS => 'CLOUD_SQL_INSTANCE_UNAUTHORIZED_ACCESS', @@ -474,9 +637,12 @@ class Cause self::CLOUD_SQL_INSTANCE_NOT_CONFIGURED_FOR_EXTERNAL_TRAFFIC => 'CLOUD_SQL_INSTANCE_NOT_CONFIGURED_FOR_EXTERNAL_TRAFFIC', self::PUBLIC_CLOUD_SQL_INSTANCE_TO_PRIVATE_DESTINATION => 'PUBLIC_CLOUD_SQL_INSTANCE_TO_PRIVATE_DESTINATION', self::CLOUD_SQL_INSTANCE_NO_ROUTE => 'CLOUD_SQL_INSTANCE_NO_ROUTE', + self::CLOUD_SQL_CONNECTOR_REQUIRED => 'CLOUD_SQL_CONNECTOR_REQUIRED', self::CLOUD_FUNCTION_NOT_ACTIVE => 'CLOUD_FUNCTION_NOT_ACTIVE', self::VPC_CONNECTOR_NOT_SET => 'VPC_CONNECTOR_NOT_SET', self::VPC_CONNECTOR_NOT_RUNNING => 'VPC_CONNECTOR_NOT_RUNNING', + self::VPC_CONNECTOR_SERVERLESS_TRAFFIC_BLOCKED => 'VPC_CONNECTOR_SERVERLESS_TRAFFIC_BLOCKED', + self::VPC_CONNECTOR_HEALTH_CHECK_TRAFFIC_BLOCKED => 'VPC_CONNECTOR_HEALTH_CHECK_TRAFFIC_BLOCKED', self::FORWARDING_RULE_REGION_MISMATCH => 'FORWARDING_RULE_REGION_MISMATCH', self::PSC_CONNECTION_NOT_ACCEPTED => 'PSC_CONNECTION_NOT_ACCEPTED', self::PSC_ENDPOINT_ACCESSED_FROM_PEERED_NETWORK => 'PSC_ENDPOINT_ACCESSED_FROM_PEERED_NETWORK', @@ -484,6 +650,7 @@ class Cause self::PSC_NEG_PRODUCER_FORWARDING_RULE_MULTIPLE_PORTS => 'PSC_NEG_PRODUCER_FORWARDING_RULE_MULTIPLE_PORTS', self::CLOUD_SQL_PSC_NEG_UNSUPPORTED => 'CLOUD_SQL_PSC_NEG_UNSUPPORTED', self::NO_NAT_SUBNETS_FOR_PSC_SERVICE_ATTACHMENT => 'NO_NAT_SUBNETS_FOR_PSC_SERVICE_ATTACHMENT', + self::PSC_TRANSITIVITY_NOT_PROPAGATED => 'PSC_TRANSITIVITY_NOT_PROPAGATED', self::HYBRID_NEG_NON_DYNAMIC_ROUTE_MATCHED => 'HYBRID_NEG_NON_DYNAMIC_ROUTE_MATCHED', self::HYBRID_NEG_NON_LOCAL_DYNAMIC_ROUTE_MATCHED => 'HYBRID_NEG_NON_LOCAL_DYNAMIC_ROUTE_MATCHED', self::CLOUD_RUN_REVISION_NOT_READY => 'CLOUD_RUN_REVISION_NOT_READY', @@ -491,6 +658,23 @@ class Cause self::LOAD_BALANCER_HAS_NO_PROXY_SUBNET => 'LOAD_BALANCER_HAS_NO_PROXY_SUBNET', self::CLOUD_NAT_NO_ADDRESSES => 'CLOUD_NAT_NO_ADDRESSES', self::ROUTING_LOOP => 'ROUTING_LOOP', + self::DROPPED_INSIDE_GOOGLE_MANAGED_SERVICE => 'DROPPED_INSIDE_GOOGLE_MANAGED_SERVICE', + self::LOAD_BALANCER_BACKEND_INVALID_NETWORK => 'LOAD_BALANCER_BACKEND_INVALID_NETWORK', + self::BACKEND_SERVICE_NAMED_PORT_NOT_DEFINED => 'BACKEND_SERVICE_NAMED_PORT_NOT_DEFINED', + self::DESTINATION_IS_PRIVATE_NAT_IP_RANGE => 'DESTINATION_IS_PRIVATE_NAT_IP_RANGE', + self::DROPPED_INSIDE_REDIS_INSTANCE_SERVICE => 'DROPPED_INSIDE_REDIS_INSTANCE_SERVICE', + self::REDIS_INSTANCE_UNSUPPORTED_PORT => 'REDIS_INSTANCE_UNSUPPORTED_PORT', + self::REDIS_INSTANCE_CONNECTING_FROM_PUPI_ADDRESS => 'REDIS_INSTANCE_CONNECTING_FROM_PUPI_ADDRESS', + self::REDIS_INSTANCE_NO_ROUTE_TO_DESTINATION_NETWORK => 'REDIS_INSTANCE_NO_ROUTE_TO_DESTINATION_NETWORK', + self::REDIS_INSTANCE_NO_EXTERNAL_IP => 'REDIS_INSTANCE_NO_EXTERNAL_IP', + self::REDIS_INSTANCE_UNSUPPORTED_PROTOCOL => 'REDIS_INSTANCE_UNSUPPORTED_PROTOCOL', + self::DROPPED_INSIDE_REDIS_CLUSTER_SERVICE => 'DROPPED_INSIDE_REDIS_CLUSTER_SERVICE', + self::REDIS_CLUSTER_UNSUPPORTED_PORT => 'REDIS_CLUSTER_UNSUPPORTED_PORT', + self::REDIS_CLUSTER_NO_EXTERNAL_IP => 'REDIS_CLUSTER_NO_EXTERNAL_IP', + self::REDIS_CLUSTER_UNSUPPORTED_PROTOCOL => 'REDIS_CLUSTER_UNSUPPORTED_PROTOCOL', + self::NO_ADVERTISED_ROUTE_TO_GCP_DESTINATION => 'NO_ADVERTISED_ROUTE_TO_GCP_DESTINATION', + self::NO_TRAFFIC_SELECTOR_TO_GCP_DESTINATION => 'NO_TRAFFIC_SELECTOR_TO_GCP_DESTINATION', + self::NO_KNOWN_ROUTE_FROM_PEERED_NETWORK_TO_DESTINATION => 'NO_KNOWN_ROUTE_FROM_PEERED_NETWORK_TO_DESTINATION', ]; public static function name($value) diff --git a/NetworkManagement/src/V1/Endpoint.php b/NetworkManagement/src/V1/Endpoint.php index 882249111f50..1ea2ffa0a266 100644 --- a/NetworkManagement/src/V1/Endpoint.php +++ b/NetworkManagement/src/V1/Endpoint.php @@ -77,6 +77,20 @@ class Endpoint extends \Google\Protobuf\Internal\Message * Generated from protobuf field string cloud_sql_instance = 8; */ protected $cloud_sql_instance = ''; + /** + * A [Redis Instance](https://cloud.google.com/memorystore/docs/redis) + * URI. + * + * Generated from protobuf field string redis_instance = 17; + */ + protected $redis_instance = ''; + /** + * A [Redis Cluster](https://cloud.google.com/memorystore/docs/cluster) + * URI. + * + * Generated from protobuf field string redis_cluster = 18; + */ + protected $redis_cluster = ''; /** * A [Cloud Function](https://cloud.google.com/functions). * @@ -158,6 +172,12 @@ class Endpoint extends \Google\Protobuf\Internal\Message * master](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture). * @type string $cloud_sql_instance * A [Cloud SQL](https://cloud.google.com/sql) instance URI. + * @type string $redis_instance + * A [Redis Instance](https://cloud.google.com/memorystore/docs/redis) + * URI. + * @type string $redis_cluster + * A [Redis Cluster](https://cloud.google.com/memorystore/docs/cluster) + * URI. * @type \Google\Cloud\NetworkManagement\V1\Endpoint\CloudFunctionEndpoint $cloud_function * A [Cloud Function](https://cloud.google.com/functions). * @type \Google\Cloud\NetworkManagement\V1\Endpoint\AppEngineVersionEndpoint $app_engine_version @@ -469,6 +489,62 @@ public function setCloudSqlInstance($var) return $this; } + /** + * A [Redis Instance](https://cloud.google.com/memorystore/docs/redis) + * URI. + * + * Generated from protobuf field string redis_instance = 17; + * @return string + */ + public function getRedisInstance() + { + return $this->redis_instance; + } + + /** + * A [Redis Instance](https://cloud.google.com/memorystore/docs/redis) + * URI. + * + * Generated from protobuf field string redis_instance = 17; + * @param string $var + * @return $this + */ + public function setRedisInstance($var) + { + GPBUtil::checkString($var, True); + $this->redis_instance = $var; + + return $this; + } + + /** + * A [Redis Cluster](https://cloud.google.com/memorystore/docs/cluster) + * URI. + * + * Generated from protobuf field string redis_cluster = 18; + * @return string + */ + public function getRedisCluster() + { + return $this->redis_cluster; + } + + /** + * A [Redis Cluster](https://cloud.google.com/memorystore/docs/cluster) + * URI. + * + * Generated from protobuf field string redis_cluster = 18; + * @param string $var + * @return $this + */ + public function setRedisCluster($var) + { + GPBUtil::checkString($var, True); + $this->redis_cluster = $var; + + return $this; + } + /** * A [Cloud Function](https://cloud.google.com/functions). * diff --git a/NetworkManagement/src/V1/FirewallInfo.php b/NetworkManagement/src/V1/FirewallInfo.php index 116158a17d76..7f3337c1308b 100644 --- a/NetworkManagement/src/V1/FirewallInfo.php +++ b/NetworkManagement/src/V1/FirewallInfo.php @@ -10,22 +10,22 @@ /** * For display only. Metadata associated with a VPC firewall rule, an implied - * VPC firewall rule, or a hierarchical firewall policy rule. + * VPC firewall rule, or a firewall policy rule. * * Generated from protobuf message google.cloud.networkmanagement.v1.FirewallInfo */ class FirewallInfo extends \Google\Protobuf\Internal\Message { /** - * The display name of the VPC firewall rule. This field is not applicable - * to hierarchical firewall policy rules. + * The display name of the firewall rule. This field might be empty for + * firewall policy rules. * * Generated from protobuf field string display_name = 1; */ protected $display_name = ''; /** - * The URI of the VPC firewall rule. This field is not applicable to - * implied firewall rules or hierarchical firewall policy rules. + * The URI of the firewall rule. This field is not applicable to implied + * VPC firewall rules. * * Generated from protobuf field string uri = 2; */ @@ -57,7 +57,7 @@ class FirewallInfo extends \Google\Protobuf\Internal\Message protected $network_uri = ''; /** * The target tags defined by the VPC firewall rule. This field is not - * applicable to hierarchical firewall policy rules. + * applicable to firewall policy rules. * * Generated from protobuf field repeated string target_tags = 7; */ @@ -69,12 +69,21 @@ class FirewallInfo extends \Google\Protobuf\Internal\Message */ private $target_service_accounts; /** - * The hierarchical firewall policy that this rule is associated with. - * This field is not applicable to VPC firewall rules. + * The name of the firewall policy that this rule is associated with. + * This field is not applicable to VPC firewall rules and implied VPC firewall + * rules. * * Generated from protobuf field string policy = 9; */ protected $policy = ''; + /** + * The URI of the firewall policy that this rule is associated with. + * This field is not applicable to VPC firewall rules and implied VPC firewall + * rules. + * + * Generated from protobuf field string policy_uri = 11; + */ + protected $policy_uri = ''; /** * The firewall rule's type. * @@ -89,11 +98,11 @@ class FirewallInfo extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $display_name - * The display name of the VPC firewall rule. This field is not applicable - * to hierarchical firewall policy rules. + * The display name of the firewall rule. This field might be empty for + * firewall policy rules. * @type string $uri - * The URI of the VPC firewall rule. This field is not applicable to - * implied firewall rules or hierarchical firewall policy rules. + * The URI of the firewall rule. This field is not applicable to implied + * VPC firewall rules. * @type string $direction * Possible values: INGRESS, EGRESS * @type string $action @@ -105,12 +114,17 @@ class FirewallInfo extends \Google\Protobuf\Internal\Message * This field is not applicable to hierarchical firewall policy rules. * @type array|\Google\Protobuf\Internal\RepeatedField $target_tags * The target tags defined by the VPC firewall rule. This field is not - * applicable to hierarchical firewall policy rules. + * applicable to firewall policy rules. * @type array|\Google\Protobuf\Internal\RepeatedField $target_service_accounts * The target service accounts specified by the firewall rule. * @type string $policy - * The hierarchical firewall policy that this rule is associated with. - * This field is not applicable to VPC firewall rules. + * The name of the firewall policy that this rule is associated with. + * This field is not applicable to VPC firewall rules and implied VPC firewall + * rules. + * @type string $policy_uri + * The URI of the firewall policy that this rule is associated with. + * This field is not applicable to VPC firewall rules and implied VPC firewall + * rules. * @type int $firewall_rule_type * The firewall rule's type. * } @@ -121,8 +135,8 @@ public function __construct($data = NULL) { } /** - * The display name of the VPC firewall rule. This field is not applicable - * to hierarchical firewall policy rules. + * The display name of the firewall rule. This field might be empty for + * firewall policy rules. * * Generated from protobuf field string display_name = 1; * @return string @@ -133,8 +147,8 @@ public function getDisplayName() } /** - * The display name of the VPC firewall rule. This field is not applicable - * to hierarchical firewall policy rules. + * The display name of the firewall rule. This field might be empty for + * firewall policy rules. * * Generated from protobuf field string display_name = 1; * @param string $var @@ -149,8 +163,8 @@ public function setDisplayName($var) } /** - * The URI of the VPC firewall rule. This field is not applicable to - * implied firewall rules or hierarchical firewall policy rules. + * The URI of the firewall rule. This field is not applicable to implied + * VPC firewall rules. * * Generated from protobuf field string uri = 2; * @return string @@ -161,8 +175,8 @@ public function getUri() } /** - * The URI of the VPC firewall rule. This field is not applicable to - * implied firewall rules or hierarchical firewall policy rules. + * The URI of the firewall rule. This field is not applicable to implied + * VPC firewall rules. * * Generated from protobuf field string uri = 2; * @param string $var @@ -284,7 +298,7 @@ public function setNetworkUri($var) /** * The target tags defined by the VPC firewall rule. This field is not - * applicable to hierarchical firewall policy rules. + * applicable to firewall policy rules. * * Generated from protobuf field repeated string target_tags = 7; * @return \Google\Protobuf\Internal\RepeatedField @@ -296,7 +310,7 @@ public function getTargetTags() /** * The target tags defined by the VPC firewall rule. This field is not - * applicable to hierarchical firewall policy rules. + * applicable to firewall policy rules. * * Generated from protobuf field repeated string target_tags = 7; * @param array|\Google\Protobuf\Internal\RepeatedField $var @@ -337,8 +351,9 @@ public function setTargetServiceAccounts($var) } /** - * The hierarchical firewall policy that this rule is associated with. - * This field is not applicable to VPC firewall rules. + * The name of the firewall policy that this rule is associated with. + * This field is not applicable to VPC firewall rules and implied VPC firewall + * rules. * * Generated from protobuf field string policy = 9; * @return string @@ -349,8 +364,9 @@ public function getPolicy() } /** - * The hierarchical firewall policy that this rule is associated with. - * This field is not applicable to VPC firewall rules. + * The name of the firewall policy that this rule is associated with. + * This field is not applicable to VPC firewall rules and implied VPC firewall + * rules. * * Generated from protobuf field string policy = 9; * @param string $var @@ -364,6 +380,36 @@ public function setPolicy($var) return $this; } + /** + * The URI of the firewall policy that this rule is associated with. + * This field is not applicable to VPC firewall rules and implied VPC firewall + * rules. + * + * Generated from protobuf field string policy_uri = 11; + * @return string + */ + public function getPolicyUri() + { + return $this->policy_uri; + } + + /** + * The URI of the firewall policy that this rule is associated with. + * This field is not applicable to VPC firewall rules and implied VPC firewall + * rules. + * + * Generated from protobuf field string policy_uri = 11; + * @param string $var + * @return $this + */ + public function setPolicyUri($var) + { + GPBUtil::checkString($var, True); + $this->policy_uri = $var; + + return $this; + } + /** * The firewall rule's type. * diff --git a/NetworkManagement/src/V1/ForwardingRuleInfo.php b/NetworkManagement/src/V1/ForwardingRuleInfo.php index 14cffe6e3ef0..831116bed4ee 100644 --- a/NetworkManagement/src/V1/ForwardingRuleInfo.php +++ b/NetworkManagement/src/V1/ForwardingRuleInfo.php @@ -16,25 +16,25 @@ class ForwardingRuleInfo extends \Google\Protobuf\Internal\Message { /** - * Name of a Compute Engine forwarding rule. + * Name of the forwarding rule. * * Generated from protobuf field string display_name = 1; */ protected $display_name = ''; /** - * URI of a Compute Engine forwarding rule. + * URI of the forwarding rule. * * Generated from protobuf field string uri = 2; */ protected $uri = ''; /** - * Protocol defined in the forwarding rule that matches the test. + * Protocol defined in the forwarding rule that matches the packet. * * Generated from protobuf field string matched_protocol = 3; */ protected $matched_protocol = ''; /** - * Port range defined in the forwarding rule that matches the test. + * Port range defined in the forwarding rule that matches the packet. * * Generated from protobuf field string matched_port_range = 6; */ @@ -52,11 +52,37 @@ class ForwardingRuleInfo extends \Google\Protobuf\Internal\Message */ protected $target = ''; /** - * Network URI. Only valid for Internal Load Balancer. + * Network URI. * * Generated from protobuf field string network_uri = 7; */ protected $network_uri = ''; + /** + * Region of the forwarding rule. Set only for regional forwarding rules. + * + * Generated from protobuf field string region = 8; + */ + protected $region = ''; + /** + * Name of the load balancer the forwarding rule belongs to. Empty for + * forwarding rules not related to load balancers (like PSC forwarding rules). + * + * Generated from protobuf field string load_balancer_name = 9; + */ + protected $load_balancer_name = ''; + /** + * URI of the PSC service attachment this forwarding rule targets (if + * applicable). + * + * Generated from protobuf field string psc_service_attachment_uri = 10; + */ + protected $psc_service_attachment_uri = ''; + /** + * PSC Google API target this forwarding rule targets (if applicable). + * + * Generated from protobuf field string psc_google_api_target = 11; + */ + protected $psc_google_api_target = ''; /** * Constructor. @@ -65,19 +91,29 @@ class ForwardingRuleInfo extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $display_name - * Name of a Compute Engine forwarding rule. + * Name of the forwarding rule. * @type string $uri - * URI of a Compute Engine forwarding rule. + * URI of the forwarding rule. * @type string $matched_protocol - * Protocol defined in the forwarding rule that matches the test. + * Protocol defined in the forwarding rule that matches the packet. * @type string $matched_port_range - * Port range defined in the forwarding rule that matches the test. + * Port range defined in the forwarding rule that matches the packet. * @type string $vip * VIP of the forwarding rule. * @type string $target * Target type of the forwarding rule. * @type string $network_uri - * Network URI. Only valid for Internal Load Balancer. + * Network URI. + * @type string $region + * Region of the forwarding rule. Set only for regional forwarding rules. + * @type string $load_balancer_name + * Name of the load balancer the forwarding rule belongs to. Empty for + * forwarding rules not related to load balancers (like PSC forwarding rules). + * @type string $psc_service_attachment_uri + * URI of the PSC service attachment this forwarding rule targets (if + * applicable). + * @type string $psc_google_api_target + * PSC Google API target this forwarding rule targets (if applicable). * } */ public function __construct($data = NULL) { @@ -86,7 +122,7 @@ public function __construct($data = NULL) { } /** - * Name of a Compute Engine forwarding rule. + * Name of the forwarding rule. * * Generated from protobuf field string display_name = 1; * @return string @@ -97,7 +133,7 @@ public function getDisplayName() } /** - * Name of a Compute Engine forwarding rule. + * Name of the forwarding rule. * * Generated from protobuf field string display_name = 1; * @param string $var @@ -112,7 +148,7 @@ public function setDisplayName($var) } /** - * URI of a Compute Engine forwarding rule. + * URI of the forwarding rule. * * Generated from protobuf field string uri = 2; * @return string @@ -123,7 +159,7 @@ public function getUri() } /** - * URI of a Compute Engine forwarding rule. + * URI of the forwarding rule. * * Generated from protobuf field string uri = 2; * @param string $var @@ -138,7 +174,7 @@ public function setUri($var) } /** - * Protocol defined in the forwarding rule that matches the test. + * Protocol defined in the forwarding rule that matches the packet. * * Generated from protobuf field string matched_protocol = 3; * @return string @@ -149,7 +185,7 @@ public function getMatchedProtocol() } /** - * Protocol defined in the forwarding rule that matches the test. + * Protocol defined in the forwarding rule that matches the packet. * * Generated from protobuf field string matched_protocol = 3; * @param string $var @@ -164,7 +200,7 @@ public function setMatchedProtocol($var) } /** - * Port range defined in the forwarding rule that matches the test. + * Port range defined in the forwarding rule that matches the packet. * * Generated from protobuf field string matched_port_range = 6; * @return string @@ -175,7 +211,7 @@ public function getMatchedPortRange() } /** - * Port range defined in the forwarding rule that matches the test. + * Port range defined in the forwarding rule that matches the packet. * * Generated from protobuf field string matched_port_range = 6; * @param string $var @@ -242,7 +278,7 @@ public function setTarget($var) } /** - * Network URI. Only valid for Internal Load Balancer. + * Network URI. * * Generated from protobuf field string network_uri = 7; * @return string @@ -253,7 +289,7 @@ public function getNetworkUri() } /** - * Network URI. Only valid for Internal Load Balancer. + * Network URI. * * Generated from protobuf field string network_uri = 7; * @param string $var @@ -267,5 +303,113 @@ public function setNetworkUri($var) return $this; } + /** + * Region of the forwarding rule. Set only for regional forwarding rules. + * + * Generated from protobuf field string region = 8; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Region of the forwarding rule. Set only for regional forwarding rules. + * + * Generated from protobuf field string region = 8; + * @param string $var + * @return $this + */ + public function setRegion($var) + { + GPBUtil::checkString($var, True); + $this->region = $var; + + return $this; + } + + /** + * Name of the load balancer the forwarding rule belongs to. Empty for + * forwarding rules not related to load balancers (like PSC forwarding rules). + * + * Generated from protobuf field string load_balancer_name = 9; + * @return string + */ + public function getLoadBalancerName() + { + return $this->load_balancer_name; + } + + /** + * Name of the load balancer the forwarding rule belongs to. Empty for + * forwarding rules not related to load balancers (like PSC forwarding rules). + * + * Generated from protobuf field string load_balancer_name = 9; + * @param string $var + * @return $this + */ + public function setLoadBalancerName($var) + { + GPBUtil::checkString($var, True); + $this->load_balancer_name = $var; + + return $this; + } + + /** + * URI of the PSC service attachment this forwarding rule targets (if + * applicable). + * + * Generated from protobuf field string psc_service_attachment_uri = 10; + * @return string + */ + public function getPscServiceAttachmentUri() + { + return $this->psc_service_attachment_uri; + } + + /** + * URI of the PSC service attachment this forwarding rule targets (if + * applicable). + * + * Generated from protobuf field string psc_service_attachment_uri = 10; + * @param string $var + * @return $this + */ + public function setPscServiceAttachmentUri($var) + { + GPBUtil::checkString($var, True); + $this->psc_service_attachment_uri = $var; + + return $this; + } + + /** + * PSC Google API target this forwarding rule targets (if applicable). + * + * Generated from protobuf field string psc_google_api_target = 11; + * @return string + */ + public function getPscGoogleApiTarget() + { + return $this->psc_google_api_target; + } + + /** + * PSC Google API target this forwarding rule targets (if applicable). + * + * Generated from protobuf field string psc_google_api_target = 11; + * @param string $var + * @return $this + */ + public function setPscGoogleApiTarget($var) + { + GPBUtil::checkString($var, True); + $this->psc_google_api_target = $var; + + return $this; + } + } diff --git a/NetworkManagement/src/V1/GetConnectivityTestRequest.php b/NetworkManagement/src/V1/GetConnectivityTestRequest.php index d85b7ebb7475..dcd27f465a8a 100644 --- a/NetworkManagement/src/V1/GetConnectivityTestRequest.php +++ b/NetworkManagement/src/V1/GetConnectivityTestRequest.php @@ -19,13 +19,14 @@ class GetConnectivityTestRequest extends \Google\Protobuf\Internal\Message * Required. `ConnectivityTest` resource name using the form: * `projects/{project_id}/locations/global/connectivityTests/{test_id}` * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ protected $name = ''; /** * @param string $name Required. `ConnectivityTest` resource name using the form: * `projects/{project_id}/locations/global/connectivityTests/{test_id}` + * Please see {@see ReachabilityServiceClient::connectivityTestName()} for help formatting this field. * * @return \Google\Cloud\NetworkManagement\V1\GetConnectivityTestRequest * @@ -57,7 +58,7 @@ public function __construct($data = NULL) { * Required. `ConnectivityTest` resource name using the form: * `projects/{project_id}/locations/global/connectivityTests/{test_id}` * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string */ public function getName() @@ -69,7 +70,7 @@ public function getName() * Required. `ConnectivityTest` resource name using the form: * `projects/{project_id}/locations/global/connectivityTests/{test_id}` * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var * @return $this */ diff --git a/NetworkManagement/src/V1/InstanceInfo.php b/NetworkManagement/src/V1/InstanceInfo.php index 0dab4eebffcc..a4e9c57509fd 100644 --- a/NetworkManagement/src/V1/InstanceInfo.php +++ b/NetworkManagement/src/V1/InstanceInfo.php @@ -64,6 +64,12 @@ class InstanceInfo extends \Google\Protobuf\Internal\Message * @deprecated */ protected $service_account = ''; + /** + * URI of the PSC network attachment the NIC is attached to (if relevant). + * + * Generated from protobuf field string psc_network_attachment_uri = 9; + */ + protected $psc_network_attachment_uri = ''; /** * Constructor. @@ -87,6 +93,8 @@ class InstanceInfo extends \Google\Protobuf\Internal\Message * Network tags configured on the instance. * @type string $service_account * Service account authorized for the instance. + * @type string $psc_network_attachment_uri + * URI of the PSC network attachment the NIC is attached to (if relevant). * } */ public function __construct($data = NULL) { @@ -306,5 +314,31 @@ public function setServiceAccount($var) return $this; } + /** + * URI of the PSC network attachment the NIC is attached to (if relevant). + * + * Generated from protobuf field string psc_network_attachment_uri = 9; + * @return string + */ + public function getPscNetworkAttachmentUri() + { + return $this->psc_network_attachment_uri; + } + + /** + * URI of the PSC network attachment the NIC is attached to (if relevant). + * + * Generated from protobuf field string psc_network_attachment_uri = 9; + * @param string $var + * @return $this + */ + public function setPscNetworkAttachmentUri($var) + { + GPBUtil::checkString($var, True); + $this->psc_network_attachment_uri = $var; + + return $this; + } + } diff --git a/NetworkManagement/src/V1/ListConnectivityTestsRequest.php b/NetworkManagement/src/V1/ListConnectivityTestsRequest.php index caa5de5fb4f7..60845fff13b3 100644 --- a/NetworkManagement/src/V1/ListConnectivityTestsRequest.php +++ b/NetworkManagement/src/V1/ListConnectivityTestsRequest.php @@ -19,7 +19,7 @@ class ListConnectivityTestsRequest extends \Google\Protobuf\Internal\Message * Required. The parent resource of the Connectivity Tests: * `projects/{project_id}/locations/global` * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ protected $parent = ''; /** @@ -65,6 +65,7 @@ class ListConnectivityTestsRequest extends \Google\Protobuf\Internal\Message /** * @param string $parent Required. The parent resource of the Connectivity Tests: * `projects/{project_id}/locations/global` + * Please see {@see ReachabilityServiceClient::projectName()} for help formatting this field. * * @return \Google\Cloud\NetworkManagement\V1\ListConnectivityTestsRequest * @@ -119,7 +120,7 @@ public function __construct($data = NULL) { * Required. The parent resource of the Connectivity Tests: * `projects/{project_id}/locations/global` * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string */ public function getParent() @@ -131,7 +132,7 @@ public function getParent() * Required. The parent resource of the Connectivity Tests: * `projects/{project_id}/locations/global` * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var * @return $this */ diff --git a/NetworkManagement/src/V1/NetworkInfo.php b/NetworkManagement/src/V1/NetworkInfo.php index 55f66ee49157..d148d0ea4fcb 100644 --- a/NetworkManagement/src/V1/NetworkInfo.php +++ b/NetworkManagement/src/V1/NetworkInfo.php @@ -10,6 +10,7 @@ /** * For display only. Metadata associated with a Compute Engine network. + * Next ID: 7 * * Generated from protobuf message google.cloud.networkmanagement.v1.NetworkInfo */ @@ -28,11 +29,23 @@ class NetworkInfo extends \Google\Protobuf\Internal\Message */ protected $uri = ''; /** - * The IP range that matches the test. + * URI of the subnet matching the source IP address of the test. + * + * Generated from protobuf field string matched_subnet_uri = 5; + */ + protected $matched_subnet_uri = ''; + /** + * The IP range of the subnet matching the source IP address of the test. * * Generated from protobuf field string matched_ip_range = 4; */ protected $matched_ip_range = ''; + /** + * The region of the subnet matching the source IP address of the test. + * + * Generated from protobuf field string region = 6; + */ + protected $region = ''; /** * Constructor. @@ -44,8 +57,12 @@ class NetworkInfo extends \Google\Protobuf\Internal\Message * Name of a Compute Engine network. * @type string $uri * URI of a Compute Engine network. + * @type string $matched_subnet_uri + * URI of the subnet matching the source IP address of the test. * @type string $matched_ip_range - * The IP range that matches the test. + * The IP range of the subnet matching the source IP address of the test. + * @type string $region + * The region of the subnet matching the source IP address of the test. * } */ public function __construct($data = NULL) { @@ -106,7 +123,33 @@ public function setUri($var) } /** - * The IP range that matches the test. + * URI of the subnet matching the source IP address of the test. + * + * Generated from protobuf field string matched_subnet_uri = 5; + * @return string + */ + public function getMatchedSubnetUri() + { + return $this->matched_subnet_uri; + } + + /** + * URI of the subnet matching the source IP address of the test. + * + * Generated from protobuf field string matched_subnet_uri = 5; + * @param string $var + * @return $this + */ + public function setMatchedSubnetUri($var) + { + GPBUtil::checkString($var, True); + $this->matched_subnet_uri = $var; + + return $this; + } + + /** + * The IP range of the subnet matching the source IP address of the test. * * Generated from protobuf field string matched_ip_range = 4; * @return string @@ -117,7 +160,7 @@ public function getMatchedIpRange() } /** - * The IP range that matches the test. + * The IP range of the subnet matching the source IP address of the test. * * Generated from protobuf field string matched_ip_range = 4; * @param string $var @@ -131,5 +174,31 @@ public function setMatchedIpRange($var) return $this; } + /** + * The region of the subnet matching the source IP address of the test. + * + * Generated from protobuf field string region = 6; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * The region of the subnet matching the source IP address of the test. + * + * Generated from protobuf field string region = 6; + * @param string $var + * @return $this + */ + public function setRegion($var) + { + GPBUtil::checkString($var, True); + $this->region = $var; + + return $this; + } + } diff --git a/NetworkManagement/src/V1/RedisClusterInfo.php b/NetworkManagement/src/V1/RedisClusterInfo.php new file mode 100644 index 000000000000..f0d07036a9fe --- /dev/null +++ b/NetworkManagement/src/V1/RedisClusterInfo.php @@ -0,0 +1,249 @@ +google.cloud.networkmanagement.v1.RedisClusterInfo + */ +class RedisClusterInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Name of a Redis Cluster. + * + * Generated from protobuf field string display_name = 1; + */ + protected $display_name = ''; + /** + * URI of a Redis Cluster in format + * "projects/{project_id}/locations/{location}/clusters/{cluster_id}" + * + * Generated from protobuf field string uri = 2; + */ + protected $uri = ''; + /** + * URI of a Redis Cluster network in format + * "projects/{project_id}/global/networks/{network_id}". + * + * Generated from protobuf field string network_uri = 3; + */ + protected $network_uri = ''; + /** + * Discovery endpoint IP address of a Redis Cluster. + * + * Generated from protobuf field string discovery_endpoint_ip_address = 4 [(.google.api.field_info) = { + */ + protected $discovery_endpoint_ip_address = ''; + /** + * Secondary endpoint IP address of a Redis Cluster. + * + * Generated from protobuf field string secondary_endpoint_ip_address = 5 [(.google.api.field_info) = { + */ + protected $secondary_endpoint_ip_address = ''; + /** + * Name of the region in which the Redis Cluster is defined. For example, + * "us-central1". + * + * Generated from protobuf field string location = 6; + */ + protected $location = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $display_name + * Name of a Redis Cluster. + * @type string $uri + * URI of a Redis Cluster in format + * "projects/{project_id}/locations/{location}/clusters/{cluster_id}" + * @type string $network_uri + * URI of a Redis Cluster network in format + * "projects/{project_id}/global/networks/{network_id}". + * @type string $discovery_endpoint_ip_address + * Discovery endpoint IP address of a Redis Cluster. + * @type string $secondary_endpoint_ip_address + * Secondary endpoint IP address of a Redis Cluster. + * @type string $location + * Name of the region in which the Redis Cluster is defined. For example, + * "us-central1". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkmanagement\V1\Trace::initOnce(); + parent::__construct($data); + } + + /** + * Name of a Redis Cluster. + * + * Generated from protobuf field string display_name = 1; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Name of a Redis Cluster. + * + * Generated from protobuf field string display_name = 1; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * URI of a Redis Cluster in format + * "projects/{project_id}/locations/{location}/clusters/{cluster_id}" + * + * Generated from protobuf field string uri = 2; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * URI of a Redis Cluster in format + * "projects/{project_id}/locations/{location}/clusters/{cluster_id}" + * + * Generated from protobuf field string uri = 2; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + + /** + * URI of a Redis Cluster network in format + * "projects/{project_id}/global/networks/{network_id}". + * + * Generated from protobuf field string network_uri = 3; + * @return string + */ + public function getNetworkUri() + { + return $this->network_uri; + } + + /** + * URI of a Redis Cluster network in format + * "projects/{project_id}/global/networks/{network_id}". + * + * Generated from protobuf field string network_uri = 3; + * @param string $var + * @return $this + */ + public function setNetworkUri($var) + { + GPBUtil::checkString($var, True); + $this->network_uri = $var; + + return $this; + } + + /** + * Discovery endpoint IP address of a Redis Cluster. + * + * Generated from protobuf field string discovery_endpoint_ip_address = 4 [(.google.api.field_info) = { + * @return string + */ + public function getDiscoveryEndpointIpAddress() + { + return $this->discovery_endpoint_ip_address; + } + + /** + * Discovery endpoint IP address of a Redis Cluster. + * + * Generated from protobuf field string discovery_endpoint_ip_address = 4 [(.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setDiscoveryEndpointIpAddress($var) + { + GPBUtil::checkString($var, True); + $this->discovery_endpoint_ip_address = $var; + + return $this; + } + + /** + * Secondary endpoint IP address of a Redis Cluster. + * + * Generated from protobuf field string secondary_endpoint_ip_address = 5 [(.google.api.field_info) = { + * @return string + */ + public function getSecondaryEndpointIpAddress() + { + return $this->secondary_endpoint_ip_address; + } + + /** + * Secondary endpoint IP address of a Redis Cluster. + * + * Generated from protobuf field string secondary_endpoint_ip_address = 5 [(.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setSecondaryEndpointIpAddress($var) + { + GPBUtil::checkString($var, True); + $this->secondary_endpoint_ip_address = $var; + + return $this; + } + + /** + * Name of the region in which the Redis Cluster is defined. For example, + * "us-central1". + * + * Generated from protobuf field string location = 6; + * @return string + */ + public function getLocation() + { + return $this->location; + } + + /** + * Name of the region in which the Redis Cluster is defined. For example, + * "us-central1". + * + * Generated from protobuf field string location = 6; + * @param string $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkString($var, True); + $this->location = $var; + + return $this; + } + +} + diff --git a/NetworkManagement/src/V1/RedisInstanceInfo.php b/NetworkManagement/src/V1/RedisInstanceInfo.php new file mode 100644 index 000000000000..7e8a8f9bf987 --- /dev/null +++ b/NetworkManagement/src/V1/RedisInstanceInfo.php @@ -0,0 +1,237 @@ +google.cloud.networkmanagement.v1.RedisInstanceInfo + */ +class RedisInstanceInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Name of a Cloud Redis Instance. + * + * Generated from protobuf field string display_name = 1; + */ + protected $display_name = ''; + /** + * URI of a Cloud Redis Instance. + * + * Generated from protobuf field string uri = 2; + */ + protected $uri = ''; + /** + * URI of a Cloud Redis Instance network. + * + * Generated from protobuf field string network_uri = 3; + */ + protected $network_uri = ''; + /** + * Primary endpoint IP address of a Cloud Redis Instance. + * + * Generated from protobuf field string primary_endpoint_ip = 4; + */ + protected $primary_endpoint_ip = ''; + /** + * Read endpoint IP address of a Cloud Redis Instance (if applicable). + * + * Generated from protobuf field string read_endpoint_ip = 5; + */ + protected $read_endpoint_ip = ''; + /** + * Region in which the Cloud Redis Instance is defined. + * + * Generated from protobuf field string region = 6; + */ + protected $region = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $display_name + * Name of a Cloud Redis Instance. + * @type string $uri + * URI of a Cloud Redis Instance. + * @type string $network_uri + * URI of a Cloud Redis Instance network. + * @type string $primary_endpoint_ip + * Primary endpoint IP address of a Cloud Redis Instance. + * @type string $read_endpoint_ip + * Read endpoint IP address of a Cloud Redis Instance (if applicable). + * @type string $region + * Region in which the Cloud Redis Instance is defined. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkmanagement\V1\Trace::initOnce(); + parent::__construct($data); + } + + /** + * Name of a Cloud Redis Instance. + * + * Generated from protobuf field string display_name = 1; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Name of a Cloud Redis Instance. + * + * Generated from protobuf field string display_name = 1; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * URI of a Cloud Redis Instance. + * + * Generated from protobuf field string uri = 2; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * URI of a Cloud Redis Instance. + * + * Generated from protobuf field string uri = 2; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + + /** + * URI of a Cloud Redis Instance network. + * + * Generated from protobuf field string network_uri = 3; + * @return string + */ + public function getNetworkUri() + { + return $this->network_uri; + } + + /** + * URI of a Cloud Redis Instance network. + * + * Generated from protobuf field string network_uri = 3; + * @param string $var + * @return $this + */ + public function setNetworkUri($var) + { + GPBUtil::checkString($var, True); + $this->network_uri = $var; + + return $this; + } + + /** + * Primary endpoint IP address of a Cloud Redis Instance. + * + * Generated from protobuf field string primary_endpoint_ip = 4; + * @return string + */ + public function getPrimaryEndpointIp() + { + return $this->primary_endpoint_ip; + } + + /** + * Primary endpoint IP address of a Cloud Redis Instance. + * + * Generated from protobuf field string primary_endpoint_ip = 4; + * @param string $var + * @return $this + */ + public function setPrimaryEndpointIp($var) + { + GPBUtil::checkString($var, True); + $this->primary_endpoint_ip = $var; + + return $this; + } + + /** + * Read endpoint IP address of a Cloud Redis Instance (if applicable). + * + * Generated from protobuf field string read_endpoint_ip = 5; + * @return string + */ + public function getReadEndpointIp() + { + return $this->read_endpoint_ip; + } + + /** + * Read endpoint IP address of a Cloud Redis Instance (if applicable). + * + * Generated from protobuf field string read_endpoint_ip = 5; + * @param string $var + * @return $this + */ + public function setReadEndpointIp($var) + { + GPBUtil::checkString($var, True); + $this->read_endpoint_ip = $var; + + return $this; + } + + /** + * Region in which the Cloud Redis Instance is defined. + * + * Generated from protobuf field string region = 6; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Region in which the Cloud Redis Instance is defined. + * + * Generated from protobuf field string region = 6; + * @param string $var + * @return $this + */ + public function setRegion($var) + { + GPBUtil::checkString($var, True); + $this->region = $var; + + return $this; + } + +} + diff --git a/NetworkManagement/src/V1/RerunConnectivityTestRequest.php b/NetworkManagement/src/V1/RerunConnectivityTestRequest.php index fa21f9b7053f..6a28cefac964 100644 --- a/NetworkManagement/src/V1/RerunConnectivityTestRequest.php +++ b/NetworkManagement/src/V1/RerunConnectivityTestRequest.php @@ -19,7 +19,7 @@ class RerunConnectivityTestRequest extends \Google\Protobuf\Internal\Message * Required. Connectivity Test resource name using the form: * `projects/{project_id}/locations/global/connectivityTests/{test_id}` * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ protected $name = ''; @@ -43,7 +43,7 @@ public function __construct($data = NULL) { * Required. Connectivity Test resource name using the form: * `projects/{project_id}/locations/global/connectivityTests/{test_id}` * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string */ public function getName() @@ -55,7 +55,7 @@ public function getName() * Required. Connectivity Test resource name using the form: * `projects/{project_id}/locations/global/connectivityTests/{test_id}` * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var * @return $this */ diff --git a/NetworkManagement/src/V1/RouteInfo.php b/NetworkManagement/src/V1/RouteInfo.php index adbf221856b8..e457ff0ffe52 100644 --- a/NetworkManagement/src/V1/RouteInfo.php +++ b/NetworkManagement/src/V1/RouteInfo.php @@ -40,14 +40,17 @@ class RouteInfo extends \Google\Protobuf\Internal\Message */ protected $display_name = ''; /** - * URI of a route. - * Dynamic, peering static and peering dynamic routes do not have an URI. - * Advertised route from Google Cloud VPC to on-premises network also does - * not have an URI. + * URI of a route (if applicable). * * Generated from protobuf field string uri = 2; */ protected $uri = ''; + /** + * Region of the route (if applicable). + * + * Generated from protobuf field string region = 19; + */ + protected $region = ''; /** * Destination IP range of the route. * @@ -114,6 +117,22 @@ class RouteInfo extends \Google\Protobuf\Internal\Message * Generated from protobuf field optional string ncc_spoke_uri = 16; */ protected $ncc_spoke_uri = null; + /** + * For advertised dynamic routes, the URI of the Cloud Router that advertised + * the corresponding IP prefix. + * + * Generated from protobuf field optional string advertised_route_source_router_uri = 17; + */ + protected $advertised_route_source_router_uri = null; + /** + * For advertised routes, the URI of their next hop, i.e. the URI of the + * hybrid endpoint (VPN tunnel, Interconnect attachment, NCC router appliance) + * the advertised prefix is advertised through, or URI of the source peered + * network. + * + * Generated from protobuf field optional string advertised_route_next_hop_uri = 18; + */ + protected $advertised_route_next_hop_uri = null; /** * Constructor. @@ -130,10 +149,9 @@ class RouteInfo extends \Google\Protobuf\Internal\Message * @type string $display_name * Name of a route. * @type string $uri - * URI of a route. - * Dynamic, peering static and peering dynamic routes do not have an URI. - * Advertised route from Google Cloud VPC to on-premises network also does - * not have an URI. + * URI of a route (if applicable). + * @type string $region + * Region of the route (if applicable). * @type string $dest_ip_range * Destination IP range of the route. * @type string $next_hop @@ -156,6 +174,14 @@ class RouteInfo extends \Google\Protobuf\Internal\Message * URI of a NCC Hub. NCC_HUB routes only. * @type string $ncc_spoke_uri * URI of a NCC Spoke. NCC_HUB routes only. + * @type string $advertised_route_source_router_uri + * For advertised dynamic routes, the URI of the Cloud Router that advertised + * the corresponding IP prefix. + * @type string $advertised_route_next_hop_uri + * For advertised routes, the URI of their next hop, i.e. the URI of the + * hybrid endpoint (VPN tunnel, Interconnect attachment, NCC router appliance) + * the advertised prefix is advertised through, or URI of the source peered + * network. * } */ public function __construct($data = NULL) { @@ -268,10 +294,7 @@ public function setDisplayName($var) } /** - * URI of a route. - * Dynamic, peering static and peering dynamic routes do not have an URI. - * Advertised route from Google Cloud VPC to on-premises network also does - * not have an URI. + * URI of a route (if applicable). * * Generated from protobuf field string uri = 2; * @return string @@ -282,10 +305,7 @@ public function getUri() } /** - * URI of a route. - * Dynamic, peering static and peering dynamic routes do not have an URI. - * Advertised route from Google Cloud VPC to on-premises network also does - * not have an URI. + * URI of a route (if applicable). * * Generated from protobuf field string uri = 2; * @param string $var @@ -299,6 +319,32 @@ public function setUri($var) return $this; } + /** + * Region of the route (if applicable). + * + * Generated from protobuf field string region = 19; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Region of the route (if applicable). + * + * Generated from protobuf field string region = 19; + * @param string $var + * @return $this + */ + public function setRegion($var) + { + GPBUtil::checkString($var, True); + $this->region = $var; + + return $this; + } + /** * Destination IP range of the route. * @@ -605,5 +651,85 @@ public function setNccSpokeUri($var) return $this; } + /** + * For advertised dynamic routes, the URI of the Cloud Router that advertised + * the corresponding IP prefix. + * + * Generated from protobuf field optional string advertised_route_source_router_uri = 17; + * @return string + */ + public function getAdvertisedRouteSourceRouterUri() + { + return isset($this->advertised_route_source_router_uri) ? $this->advertised_route_source_router_uri : ''; + } + + public function hasAdvertisedRouteSourceRouterUri() + { + return isset($this->advertised_route_source_router_uri); + } + + public function clearAdvertisedRouteSourceRouterUri() + { + unset($this->advertised_route_source_router_uri); + } + + /** + * For advertised dynamic routes, the URI of the Cloud Router that advertised + * the corresponding IP prefix. + * + * Generated from protobuf field optional string advertised_route_source_router_uri = 17; + * @param string $var + * @return $this + */ + public function setAdvertisedRouteSourceRouterUri($var) + { + GPBUtil::checkString($var, True); + $this->advertised_route_source_router_uri = $var; + + return $this; + } + + /** + * For advertised routes, the URI of their next hop, i.e. the URI of the + * hybrid endpoint (VPN tunnel, Interconnect attachment, NCC router appliance) + * the advertised prefix is advertised through, or URI of the source peered + * network. + * + * Generated from protobuf field optional string advertised_route_next_hop_uri = 18; + * @return string + */ + public function getAdvertisedRouteNextHopUri() + { + return isset($this->advertised_route_next_hop_uri) ? $this->advertised_route_next_hop_uri : ''; + } + + public function hasAdvertisedRouteNextHopUri() + { + return isset($this->advertised_route_next_hop_uri); + } + + public function clearAdvertisedRouteNextHopUri() + { + unset($this->advertised_route_next_hop_uri); + } + + /** + * For advertised routes, the URI of their next hop, i.e. the URI of the + * hybrid endpoint (VPN tunnel, Interconnect attachment, NCC router appliance) + * the advertised prefix is advertised through, or URI of the source peered + * network. + * + * Generated from protobuf field optional string advertised_route_next_hop_uri = 18; + * @param string $var + * @return $this + */ + public function setAdvertisedRouteNextHopUri($var) + { + GPBUtil::checkString($var, True); + $this->advertised_route_next_hop_uri = $var; + + return $this; + } + } diff --git a/NetworkManagement/src/V1/RouteInfo/RouteType.php b/NetworkManagement/src/V1/RouteInfo/RouteType.php index 985c5887280a..522e8c65676b 100644 --- a/NetworkManagement/src/V1/RouteInfo/RouteType.php +++ b/NetworkManagement/src/V1/RouteInfo/RouteType.php @@ -62,6 +62,13 @@ class RouteType * Generated from protobuf enum POLICY_BASED = 7; */ const POLICY_BASED = 7; + /** + * Advertised route. Synthetic route which is used to transition from the + * StartFromPrivateNetwork state in Connectivity tests. + * + * Generated from protobuf enum ADVERTISED = 101; + */ + const ADVERTISED = 101; private static $valueToName = [ self::ROUTE_TYPE_UNSPECIFIED => 'ROUTE_TYPE_UNSPECIFIED', @@ -72,6 +79,7 @@ class RouteType self::PEERING_STATIC => 'PEERING_STATIC', self::PEERING_DYNAMIC => 'PEERING_DYNAMIC', self::POLICY_BASED => 'POLICY_BASED', + self::ADVERTISED => 'ADVERTISED', ]; public static function name($value) diff --git a/NetworkManagement/src/V1/ServerlessNegInfo.php b/NetworkManagement/src/V1/ServerlessNegInfo.php new file mode 100644 index 000000000000..582fd758a26c --- /dev/null +++ b/NetworkManagement/src/V1/ServerlessNegInfo.php @@ -0,0 +1,68 @@ +google.cloud.networkmanagement.v1.ServerlessNegInfo + */ +class ServerlessNegInfo extends \Google\Protobuf\Internal\Message +{ + /** + * URI of the serverless network endpoint group. + * + * Generated from protobuf field string neg_uri = 1; + */ + protected $neg_uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $neg_uri + * URI of the serverless network endpoint group. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networkmanagement\V1\Trace::initOnce(); + parent::__construct($data); + } + + /** + * URI of the serverless network endpoint group. + * + * Generated from protobuf field string neg_uri = 1; + * @return string + */ + public function getNegUri() + { + return $this->neg_uri; + } + + /** + * URI of the serverless network endpoint group. + * + * Generated from protobuf field string neg_uri = 1; + * @param string $var + * @return $this + */ + public function setNegUri($var) + { + GPBUtil::checkString($var, True); + $this->neg_uri = $var; + + return $this; + } + +} + diff --git a/NetworkManagement/src/V1/Step.php b/NetworkManagement/src/V1/Step.php index 84600bb5a6e7..80fb590eea88 100644 --- a/NetworkManagement/src/V1/Step.php +++ b/NetworkManagement/src/V1/Step.php @@ -94,6 +94,10 @@ class Step extends \Google\Protobuf\Internal\Message * Display information of a Google Kubernetes Engine cluster master. * @type \Google\Cloud\NetworkManagement\V1\CloudSQLInstanceInfo $cloud_sql_instance * Display information of a Cloud SQL instance. + * @type \Google\Cloud\NetworkManagement\V1\RedisInstanceInfo $redis_instance + * Display information of a Redis Instance. + * @type \Google\Cloud\NetworkManagement\V1\RedisClusterInfo $redis_cluster + * Display information of a Redis Cluster. * @type \Google\Cloud\NetworkManagement\V1\CloudFunctionInfo $cloud_function * Display information of a Cloud Function. * @type \Google\Cloud\NetworkManagement\V1\AppEngineVersionInfo $app_engine_version @@ -108,6 +112,9 @@ class Step extends \Google\Protobuf\Internal\Message * Display information of a specific load balancer backend. * @type \Google\Cloud\NetworkManagement\V1\StorageBucketInfo $storage_bucket * Display information of a Storage Bucket. Used only for return traces. + * @type \Google\Cloud\NetworkManagement\V1\ServerlessNegInfo $serverless_neg + * Display information of a Serverless network endpoint group backend. Used + * only for return traces. * } */ public function __construct($data = NULL) { @@ -759,6 +766,68 @@ public function setCloudSqlInstance($var) return $this; } + /** + * Display information of a Redis Instance. + * + * Generated from protobuf field .google.cloud.networkmanagement.v1.RedisInstanceInfo redis_instance = 30; + * @return \Google\Cloud\NetworkManagement\V1\RedisInstanceInfo|null + */ + public function getRedisInstance() + { + return $this->readOneof(30); + } + + public function hasRedisInstance() + { + return $this->hasOneof(30); + } + + /** + * Display information of a Redis Instance. + * + * Generated from protobuf field .google.cloud.networkmanagement.v1.RedisInstanceInfo redis_instance = 30; + * @param \Google\Cloud\NetworkManagement\V1\RedisInstanceInfo $var + * @return $this + */ + public function setRedisInstance($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkManagement\V1\RedisInstanceInfo::class); + $this->writeOneof(30, $var); + + return $this; + } + + /** + * Display information of a Redis Cluster. + * + * Generated from protobuf field .google.cloud.networkmanagement.v1.RedisClusterInfo redis_cluster = 31; + * @return \Google\Cloud\NetworkManagement\V1\RedisClusterInfo|null + */ + public function getRedisCluster() + { + return $this->readOneof(31); + } + + public function hasRedisCluster() + { + return $this->hasOneof(31); + } + + /** + * Display information of a Redis Cluster. + * + * Generated from protobuf field .google.cloud.networkmanagement.v1.RedisClusterInfo redis_cluster = 31; + * @param \Google\Cloud\NetworkManagement\V1\RedisClusterInfo $var + * @return $this + */ + public function setRedisCluster($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkManagement\V1\RedisClusterInfo::class); + $this->writeOneof(31, $var); + + return $this; + } + /** * Display information of a Cloud Function. * @@ -976,6 +1045,39 @@ public function setStorageBucket($var) return $this; } + /** + * Display information of a Serverless network endpoint group backend. Used + * only for return traces. + * + * Generated from protobuf field .google.cloud.networkmanagement.v1.ServerlessNegInfo serverless_neg = 29; + * @return \Google\Cloud\NetworkManagement\V1\ServerlessNegInfo|null + */ + public function getServerlessNeg() + { + return $this->readOneof(29); + } + + public function hasServerlessNeg() + { + return $this->hasOneof(29); + } + + /** + * Display information of a Serverless network endpoint group backend. Used + * only for return traces. + * + * Generated from protobuf field .google.cloud.networkmanagement.v1.ServerlessNegInfo serverless_neg = 29; + * @param \Google\Cloud\NetworkManagement\V1\ServerlessNegInfo $var + * @return $this + */ + public function setServerlessNeg($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkManagement\V1\ServerlessNegInfo::class); + $this->writeOneof(29, $var); + + return $this; + } + /** * @return string */ diff --git a/NetworkManagement/src/V1/Step/State.php b/NetworkManagement/src/V1/Step/State.php index 83e44e0a16e2..92cb3840938c 100644 --- a/NetworkManagement/src/V1/Step/State.php +++ b/NetworkManagement/src/V1/Step/State.php @@ -64,6 +64,20 @@ class State * Generated from protobuf enum START_FROM_CLOUD_SQL_INSTANCE = 22; */ const START_FROM_CLOUD_SQL_INSTANCE = 22; + /** + * Initial state: packet originating from a Redis instance. + * A RedisInstanceInfo is populated with starting instance information. + * + * Generated from protobuf enum START_FROM_REDIS_INSTANCE = 32; + */ + const START_FROM_REDIS_INSTANCE = 32; + /** + * Initial state: packet originating from a Redis Cluster. + * A RedisClusterInfo is populated with starting Cluster information. + * + * Generated from protobuf enum START_FROM_REDIS_CLUSTER = 33; + */ + const START_FROM_REDIS_CLUSTER = 33; /** * Initial state: packet originating from a Cloud Function. * A CloudFunctionInfo is populated with starting function information. @@ -100,6 +114,14 @@ class State * Generated from protobuf enum START_FROM_PSC_PUBLISHED_SERVICE = 30; */ const START_FROM_PSC_PUBLISHED_SERVICE = 30; + /** + * Initial state: packet originating from a serverless network endpoint + * group backend. Used only for return traces. + * The serverless_neg information is populated. + * + * Generated from protobuf enum START_FROM_SERVERLESS_NEG = 31; + */ + const START_FROM_SERVERLESS_NEG = 31; /** * Config checking state: verify ingress firewall rule. * @@ -227,11 +249,14 @@ class State self::START_FROM_PRIVATE_NETWORK => 'START_FROM_PRIVATE_NETWORK', self::START_FROM_GKE_MASTER => 'START_FROM_GKE_MASTER', self::START_FROM_CLOUD_SQL_INSTANCE => 'START_FROM_CLOUD_SQL_INSTANCE', + self::START_FROM_REDIS_INSTANCE => 'START_FROM_REDIS_INSTANCE', + self::START_FROM_REDIS_CLUSTER => 'START_FROM_REDIS_CLUSTER', self::START_FROM_CLOUD_FUNCTION => 'START_FROM_CLOUD_FUNCTION', self::START_FROM_APP_ENGINE_VERSION => 'START_FROM_APP_ENGINE_VERSION', self::START_FROM_CLOUD_RUN_REVISION => 'START_FROM_CLOUD_RUN_REVISION', self::START_FROM_STORAGE_BUCKET => 'START_FROM_STORAGE_BUCKET', self::START_FROM_PSC_PUBLISHED_SERVICE => 'START_FROM_PSC_PUBLISHED_SERVICE', + self::START_FROM_SERVERLESS_NEG => 'START_FROM_SERVERLESS_NEG', self::APPLY_INGRESS_FIREWALL_RULE => 'APPLY_INGRESS_FIREWALL_RULE', self::APPLY_EGRESS_FIREWALL_RULE => 'APPLY_EGRESS_FIREWALL_RULE', self::APPLY_ROUTE => 'APPLY_ROUTE', diff --git a/NetworkManagement/src/V1/resources/reachability_service_descriptor_config.php b/NetworkManagement/src/V1/resources/reachability_service_descriptor_config.php index 2026717dc44c..5e5df79c8de4 100644 --- a/NetworkManagement/src/V1/resources/reachability_service_descriptor_config.php +++ b/NetworkManagement/src/V1/resources/reachability_service_descriptor_config.php @@ -207,6 +207,7 @@ ], 'templateMap' => [ 'connectivityTest' => 'projects/{project}/locations/global/connectivityTests/{test}', + 'project' => 'projects/{project}', ], ], ], diff --git a/NetworkManagement/tests/Unit/V1/Client/ReachabilityServiceClientTest.php b/NetworkManagement/tests/Unit/V1/Client/ReachabilityServiceClientTest.php index e059b6463d73..343ead7ede47 100644 --- a/NetworkManagement/tests/Unit/V1/Client/ReachabilityServiceClientTest.php +++ b/NetworkManagement/tests/Unit/V1/Client/ReachabilityServiceClientTest.php @@ -124,17 +124,15 @@ public function createConnectivityTestTest() $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request - $parent = 'parent-995424086'; + $formattedParent = $gapicClient->projectName('[PROJECT]'); $testId = 'testId-1422455832'; $resource = new ConnectivityTest(); - $resourceName = 'resourceName-384566343'; - $resource->setName($resourceName); $resourceSource = new Endpoint(); $resource->setSource($resourceSource); $resourceDestination = new Endpoint(); $resource->setDestination($resourceDestination); $request = (new CreateConnectivityTestRequest()) - ->setParent($parent) + ->setParent($formattedParent) ->setTestId($testId) ->setResource($resource); $response = $gapicClient->createConnectivityTest($request); @@ -151,7 +149,7 @@ public function createConnectivityTestTest() $actualApiFuncCall ); $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); + $this->assertProtobufEquals($formattedParent, $actualValue); $actualValue = $actualApiRequestObject->getTestId(); $this->assertProtobufEquals($testId, $actualValue); $actualValue = $actualApiRequestObject->getResource(); @@ -210,17 +208,15 @@ public function createConnectivityTestExceptionTest() ); $operationsTransport->addResponse(null, $status); // Mock request - $parent = 'parent-995424086'; + $formattedParent = $gapicClient->projectName('[PROJECT]'); $testId = 'testId-1422455832'; $resource = new ConnectivityTest(); - $resourceName = 'resourceName-384566343'; - $resource->setName($resourceName); $resourceSource = new Endpoint(); $resource->setSource($resourceSource); $resourceDestination = new Endpoint(); $resource->setDestination($resourceDestination); $request = (new CreateConnectivityTestRequest()) - ->setParent($parent) + ->setParent($formattedParent) ->setTestId($testId) ->setResource($resource); $response = $gapicClient->createConnectivityTest($request); @@ -275,8 +271,8 @@ public function deleteConnectivityTestTest() $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request - $name = 'name3373707'; - $request = (new DeleteConnectivityTestRequest())->setName($name); + $formattedName = $gapicClient->connectivityTestName('[PROJECT]', '[TEST]'); + $request = (new DeleteConnectivityTestRequest())->setName($formattedName); $response = $gapicClient->deleteConnectivityTest($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -291,7 +287,7 @@ public function deleteConnectivityTestTest() $actualApiFuncCall ); $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); + $this->assertProtobufEquals($formattedName, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); $expectedOperationsRequestObject->setName('operations/deleteConnectivityTestTest'); $response->pollUntilComplete([ @@ -346,8 +342,8 @@ public function deleteConnectivityTestExceptionTest() ); $operationsTransport->addResponse(null, $status); // Mock request - $name = 'name3373707'; - $request = (new DeleteConnectivityTestRequest())->setName($name); + $formattedName = $gapicClient->connectivityTestName('[PROJECT]', '[TEST]'); + $request = (new DeleteConnectivityTestRequest())->setName($formattedName); $response = $gapicClient->deleteConnectivityTest($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -392,8 +388,8 @@ public function getConnectivityTestTest() $expectedResponse->setBypassFirewallChecks($bypassFirewallChecks); $transport->addResponse($expectedResponse); // Mock request - $name = 'name3373707'; - $request = (new GetConnectivityTestRequest())->setName($name); + $formattedName = $gapicClient->connectivityTestName('[PROJECT]', '[TEST]'); + $request = (new GetConnectivityTestRequest())->setName($formattedName); $response = $gapicClient->getConnectivityTest($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -405,7 +401,7 @@ public function getConnectivityTestTest() $actualFuncCall ); $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); + $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); } @@ -431,8 +427,8 @@ public function getConnectivityTestExceptionTest() ); $transport->addResponse(null, $status); // Mock request - $name = 'name3373707'; - $request = (new GetConnectivityTestRequest())->setName($name); + $formattedName = $gapicClient->connectivityTestName('[PROJECT]', '[TEST]'); + $request = (new GetConnectivityTestRequest())->setName($formattedName); try { $gapicClient->getConnectivityTest($request); // If the $gapicClient method call did not throw, fail the test @@ -463,8 +459,8 @@ public function listConnectivityTestsTest() $expectedResponse->setResources($resources); $transport->addResponse($expectedResponse); // Mock request - $parent = 'parent-995424086'; - $request = (new ListConnectivityTestsRequest())->setParent($parent); + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new ListConnectivityTestsRequest())->setParent($formattedParent); $response = $gapicClient->listConnectivityTests($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -479,7 +475,7 @@ public function listConnectivityTestsTest() $actualFuncCall ); $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); + $this->assertProtobufEquals($formattedParent, $actualValue); $this->assertTrue($transport->isExhausted()); } @@ -505,8 +501,8 @@ public function listConnectivityTestsExceptionTest() ); $transport->addResponse(null, $status); // Mock request - $parent = 'parent-995424086'; - $request = (new ListConnectivityTestsRequest())->setParent($parent); + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new ListConnectivityTestsRequest())->setParent($formattedParent); try { $gapicClient->listConnectivityTests($request); // If the $gapicClient method call did not throw, fail the test @@ -560,8 +556,8 @@ public function rerunConnectivityTestTest() $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request - $name = 'name3373707'; - $request = (new RerunConnectivityTestRequest())->setName($name); + $formattedName = $gapicClient->connectivityTestName('[PROJECT]', '[TEST]'); + $request = (new RerunConnectivityTestRequest())->setName($formattedName); $response = $gapicClient->rerunConnectivityTest($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -576,7 +572,7 @@ public function rerunConnectivityTestTest() $actualApiFuncCall ); $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); + $this->assertProtobufEquals($formattedName, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); $expectedOperationsRequestObject->setName('operations/rerunConnectivityTestTest'); $response->pollUntilComplete([ @@ -631,8 +627,8 @@ public function rerunConnectivityTestExceptionTest() ); $operationsTransport->addResponse(null, $status); // Mock request - $name = 'name3373707'; - $request = (new RerunConnectivityTestRequest())->setName($name); + $formattedName = $gapicClient->connectivityTestName('[PROJECT]', '[TEST]'); + $request = (new RerunConnectivityTestRequest())->setName($formattedName); $response = $gapicClient->rerunConnectivityTest($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -697,8 +693,6 @@ public function updateConnectivityTestTest() // Mock request $updateMask = new FieldMask(); $resource = new ConnectivityTest(); - $resourceName = 'resourceName-384566343'; - $resource->setName($resourceName); $resourceSource = new Endpoint(); $resource->setSource($resourceSource); $resourceDestination = new Endpoint(); @@ -777,8 +771,6 @@ public function updateConnectivityTestExceptionTest() // Mock request $updateMask = new FieldMask(); $resource = new ConnectivityTest(); - $resourceName = 'resourceName-384566343'; - $resource->setName($resourceName); $resourceSource = new Endpoint(); $resource->setSource($resourceSource); $resourceDestination = new Endpoint(); @@ -1179,17 +1171,15 @@ public function createConnectivityTestAsyncTest() $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request - $parent = 'parent-995424086'; + $formattedParent = $gapicClient->projectName('[PROJECT]'); $testId = 'testId-1422455832'; $resource = new ConnectivityTest(); - $resourceName = 'resourceName-384566343'; - $resource->setName($resourceName); $resourceSource = new Endpoint(); $resource->setSource($resourceSource); $resourceDestination = new Endpoint(); $resource->setDestination($resourceDestination); $request = (new CreateConnectivityTestRequest()) - ->setParent($parent) + ->setParent($formattedParent) ->setTestId($testId) ->setResource($resource); $response = $gapicClient->createConnectivityTestAsync($request)->wait(); @@ -1206,7 +1196,7 @@ public function createConnectivityTestAsyncTest() $actualApiFuncCall ); $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); + $this->assertProtobufEquals($formattedParent, $actualValue); $actualValue = $actualApiRequestObject->getTestId(); $this->assertProtobufEquals($testId, $actualValue); $actualValue = $actualApiRequestObject->getResource(); From 21b4eb508f3ecbc690ccddb25993b3975cc4aa31 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 17 Oct 2024 15:50:07 -0400 Subject: [PATCH 16/34] feat: Add `ProvisioningModelMix` to support mixing of spot and standard instances for secondary workers (#7746) feat: Add support for configuration of bootdisk IOPS and throughput when bootdisk is a hyperdisk PiperOrigin-RevId: 686008645 Source-Link: https://github.com/googleapis/googleapis/commit/2f49d448f995c57186bec996ddc1bb50b1944f6c Source-Link: https://github.com/googleapis/googleapis-gen/commit/5dc57b00d9a1355d020496abe5600e78202d5d3b Copy-Tag: eyJwIjoiRGF0YXByb2MvLk93bEJvdC55YW1sIiwiaCI6IjVkYzU3YjAwZDlhMTM1NWQwMjA0OTZhYmU1NjAwZTc4MjAyZDVkM2IifQ== --- Dataproc/metadata/V1/Clusters.php | Bin 15194 -> 15663 bytes Dataproc/src/V1/DiskConfig.php | 108 +++++++++++ Dataproc/src/V1/InstanceFlexibilityPolicy.php | 48 +++++ .../ProvisioningModelMix.php | 171 ++++++++++++++++++ 4 files changed, 327 insertions(+) create mode 100644 Dataproc/src/V1/InstanceFlexibilityPolicy/ProvisioningModelMix.php diff --git a/Dataproc/metadata/V1/Clusters.php b/Dataproc/metadata/V1/Clusters.php index 3962d2eb574def42308956d327997996057cce11..e1fed04500dcad607f07da9d771f2d54b99ca618 100644 GIT binary patch delta 476 zcmcarw!Uh^Ll)M*`CKvTlj~R|H~(kJ6lHqKIyp;9MlqL5te_~rEVDQ>KQA*cJw7)- zB{e5LH?u;5QGro|+sI?GqJ*)OUI3CBUyu^t%nB#w2ab%BTcw`V?_uN;!KOk;gG;Qq zBrz`~u_z@zIk6xyIkTiPJ}I#{6>K^y*aQ!T4n{^HGcFZOl?ACq$*FlI@rggEh-4o0SROp}XbI_iaVxTKQu^Go7W zGK;h0;enHy5}%o0P%Oa;bO1Aw!;QEUu&XY~D9SHQ&nPG@kzhmU0XtfjOFACArp$cx Uf?_9SE=3&j2tzmjl1Y#Q09pg1`v3p{ delta 52 zcmV-40L%ZcdfIld;RFS#YzkZ_lYRvmv;PEX6$G~f3K^5Z8X1%H8sxK>90vgchyjzK K9f-5f9$+3Rb`$pi diff --git a/Dataproc/src/V1/DiskConfig.php b/Dataproc/src/V1/DiskConfig.php index 23f3a85cd58b..0ff25d83c2df 100644 --- a/Dataproc/src/V1/DiskConfig.php +++ b/Dataproc/src/V1/DiskConfig.php @@ -54,6 +54,23 @@ class DiskConfig extends \Google\Protobuf\Internal\Message * Generated from protobuf field string local_ssd_interface = 4 [(.google.api.field_behavior) = OPTIONAL]; */ protected $local_ssd_interface = ''; + /** + * Optional. Indicates how many IOPS to provision for the disk. This sets the + * number of I/O operations per second that the disk can handle. Note: This + * field is only supported if boot_disk_type is hyperdisk-balanced. + * + * Generated from protobuf field optional int64 boot_disk_provisioned_iops = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $boot_disk_provisioned_iops = null; + /** + * Optional. Indicates how much throughput to provision for the disk. This + * sets the number of throughput mb per second that the disk can handle. + * Values must be greater than or equal to 1. Note: This field is only + * supported if boot_disk_type is hyperdisk-balanced. + * + * Generated from protobuf field optional int64 boot_disk_provisioned_throughput = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $boot_disk_provisioned_throughput = null; /** * Constructor. @@ -84,6 +101,15 @@ class DiskConfig extends \Google\Protobuf\Internal\Message * "nvme" (Non-Volatile Memory Express). * See [local SSD * performance](https://cloud.google.com/compute/docs/disks/local-ssd#performance). + * @type int|string $boot_disk_provisioned_iops + * Optional. Indicates how many IOPS to provision for the disk. This sets the + * number of I/O operations per second that the disk can handle. Note: This + * field is only supported if boot_disk_type is hyperdisk-balanced. + * @type int|string $boot_disk_provisioned_throughput + * Optional. Indicates how much throughput to provision for the disk. This + * sets the number of throughput mb per second that the disk can handle. + * Values must be greater than or equal to 1. Note: This field is only + * supported if boot_disk_type is hyperdisk-balanced. * } */ public function __construct($data = NULL) { @@ -225,5 +251,87 @@ public function setLocalSsdInterface($var) return $this; } + /** + * Optional. Indicates how many IOPS to provision for the disk. This sets the + * number of I/O operations per second that the disk can handle. Note: This + * field is only supported if boot_disk_type is hyperdisk-balanced. + * + * Generated from protobuf field optional int64 boot_disk_provisioned_iops = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getBootDiskProvisionedIops() + { + return isset($this->boot_disk_provisioned_iops) ? $this->boot_disk_provisioned_iops : 0; + } + + public function hasBootDiskProvisionedIops() + { + return isset($this->boot_disk_provisioned_iops); + } + + public function clearBootDiskProvisionedIops() + { + unset($this->boot_disk_provisioned_iops); + } + + /** + * Optional. Indicates how many IOPS to provision for the disk. This sets the + * number of I/O operations per second that the disk can handle. Note: This + * field is only supported if boot_disk_type is hyperdisk-balanced. + * + * Generated from protobuf field optional int64 boot_disk_provisioned_iops = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setBootDiskProvisionedIops($var) + { + GPBUtil::checkInt64($var); + $this->boot_disk_provisioned_iops = $var; + + return $this; + } + + /** + * Optional. Indicates how much throughput to provision for the disk. This + * sets the number of throughput mb per second that the disk can handle. + * Values must be greater than or equal to 1. Note: This field is only + * supported if boot_disk_type is hyperdisk-balanced. + * + * Generated from protobuf field optional int64 boot_disk_provisioned_throughput = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getBootDiskProvisionedThroughput() + { + return isset($this->boot_disk_provisioned_throughput) ? $this->boot_disk_provisioned_throughput : 0; + } + + public function hasBootDiskProvisionedThroughput() + { + return isset($this->boot_disk_provisioned_throughput); + } + + public function clearBootDiskProvisionedThroughput() + { + unset($this->boot_disk_provisioned_throughput); + } + + /** + * Optional. Indicates how much throughput to provision for the disk. This + * sets the number of throughput mb per second that the disk can handle. + * Values must be greater than or equal to 1. Note: This field is only + * supported if boot_disk_type is hyperdisk-balanced. + * + * Generated from protobuf field optional int64 boot_disk_provisioned_throughput = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setBootDiskProvisionedThroughput($var) + { + GPBUtil::checkInt64($var); + $this->boot_disk_provisioned_throughput = $var; + + return $this; + } + } diff --git a/Dataproc/src/V1/InstanceFlexibilityPolicy.php b/Dataproc/src/V1/InstanceFlexibilityPolicy.php index 60e39ca8fc1d..dd374b64833e 100644 --- a/Dataproc/src/V1/InstanceFlexibilityPolicy.php +++ b/Dataproc/src/V1/InstanceFlexibilityPolicy.php @@ -16,6 +16,13 @@ */ class InstanceFlexibilityPolicy extends \Google\Protobuf\Internal\Message { + /** + * Optional. Defines how the Group selects the provisioning model to ensure + * required reliability. + * + * Generated from protobuf field .google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix provisioning_model_mix = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $provisioning_model_mix = null; /** * Optional. List of instance selection options that the group will use when * creating new VMs. @@ -36,6 +43,9 @@ class InstanceFlexibilityPolicy extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * + * @type \Google\Cloud\Dataproc\V1\InstanceFlexibilityPolicy\ProvisioningModelMix $provisioning_model_mix + * Optional. Defines how the Group selects the provisioning model to ensure + * required reliability. * @type array<\Google\Cloud\Dataproc\V1\InstanceFlexibilityPolicy\InstanceSelection>|\Google\Protobuf\Internal\RepeatedField $instance_selection_list * Optional. List of instance selection options that the group will use when * creating new VMs. @@ -48,6 +58,44 @@ public function __construct($data = NULL) { parent::__construct($data); } + /** + * Optional. Defines how the Group selects the provisioning model to ensure + * required reliability. + * + * Generated from protobuf field .google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix provisioning_model_mix = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Dataproc\V1\InstanceFlexibilityPolicy\ProvisioningModelMix|null + */ + public function getProvisioningModelMix() + { + return $this->provisioning_model_mix; + } + + public function hasProvisioningModelMix() + { + return isset($this->provisioning_model_mix); + } + + public function clearProvisioningModelMix() + { + unset($this->provisioning_model_mix); + } + + /** + * Optional. Defines how the Group selects the provisioning model to ensure + * required reliability. + * + * Generated from protobuf field .google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix provisioning_model_mix = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Dataproc\V1\InstanceFlexibilityPolicy\ProvisioningModelMix $var + * @return $this + */ + public function setProvisioningModelMix($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Dataproc\V1\InstanceFlexibilityPolicy\ProvisioningModelMix::class); + $this->provisioning_model_mix = $var; + + return $this; + } + /** * Optional. List of instance selection options that the group will use when * creating new VMs. diff --git a/Dataproc/src/V1/InstanceFlexibilityPolicy/ProvisioningModelMix.php b/Dataproc/src/V1/InstanceFlexibilityPolicy/ProvisioningModelMix.php new file mode 100644 index 000000000000..ca3b6bff75ca --- /dev/null +++ b/Dataproc/src/V1/InstanceFlexibilityPolicy/ProvisioningModelMix.php @@ -0,0 +1,171 @@ +google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix + */ +class ProvisioningModelMix extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The base capacity that will always use Standard VMs to avoid + * risk of more preemption than the minimum capacity you need. Dataproc will + * create only standard VMs until it reaches standard_capacity_base, then it + * will start using standard_capacity_percent_above_base to mix Spot with + * Standard VMs. eg. If 15 instances are requested and + * standard_capacity_base is 5, Dataproc will create 5 standard VMs and then + * start mixing spot and standard VMs for remaining 10 instances. + * + * Generated from protobuf field optional int32 standard_capacity_base = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $standard_capacity_base = null; + /** + * Optional. The percentage of target capacity that should use Standard VM. + * The remaining percentage will use Spot VMs. The percentage applies only + * to the capacity above standard_capacity_base. eg. If 15 instances are + * requested and standard_capacity_base is 5 and + * standard_capacity_percent_above_base is 30, Dataproc will create 5 + * standard VMs and then start mixing spot and standard VMs for remaining 10 + * instances. The mix will be 30% standard and 70% spot. + * + * Generated from protobuf field optional int32 standard_capacity_percent_above_base = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $standard_capacity_percent_above_base = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $standard_capacity_base + * Optional. The base capacity that will always use Standard VMs to avoid + * risk of more preemption than the minimum capacity you need. Dataproc will + * create only standard VMs until it reaches standard_capacity_base, then it + * will start using standard_capacity_percent_above_base to mix Spot with + * Standard VMs. eg. If 15 instances are requested and + * standard_capacity_base is 5, Dataproc will create 5 standard VMs and then + * start mixing spot and standard VMs for remaining 10 instances. + * @type int $standard_capacity_percent_above_base + * Optional. The percentage of target capacity that should use Standard VM. + * The remaining percentage will use Spot VMs. The percentage applies only + * to the capacity above standard_capacity_base. eg. If 15 instances are + * requested and standard_capacity_base is 5 and + * standard_capacity_percent_above_base is 30, Dataproc will create 5 + * standard VMs and then start mixing spot and standard VMs for remaining 10 + * instances. The mix will be 30% standard and 70% spot. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Dataproc\V1\Clusters::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The base capacity that will always use Standard VMs to avoid + * risk of more preemption than the minimum capacity you need. Dataproc will + * create only standard VMs until it reaches standard_capacity_base, then it + * will start using standard_capacity_percent_above_base to mix Spot with + * Standard VMs. eg. If 15 instances are requested and + * standard_capacity_base is 5, Dataproc will create 5 standard VMs and then + * start mixing spot and standard VMs for remaining 10 instances. + * + * Generated from protobuf field optional int32 standard_capacity_base = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getStandardCapacityBase() + { + return isset($this->standard_capacity_base) ? $this->standard_capacity_base : 0; + } + + public function hasStandardCapacityBase() + { + return isset($this->standard_capacity_base); + } + + public function clearStandardCapacityBase() + { + unset($this->standard_capacity_base); + } + + /** + * Optional. The base capacity that will always use Standard VMs to avoid + * risk of more preemption than the minimum capacity you need. Dataproc will + * create only standard VMs until it reaches standard_capacity_base, then it + * will start using standard_capacity_percent_above_base to mix Spot with + * Standard VMs. eg. If 15 instances are requested and + * standard_capacity_base is 5, Dataproc will create 5 standard VMs and then + * start mixing spot and standard VMs for remaining 10 instances. + * + * Generated from protobuf field optional int32 standard_capacity_base = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setStandardCapacityBase($var) + { + GPBUtil::checkInt32($var); + $this->standard_capacity_base = $var; + + return $this; + } + + /** + * Optional. The percentage of target capacity that should use Standard VM. + * The remaining percentage will use Spot VMs. The percentage applies only + * to the capacity above standard_capacity_base. eg. If 15 instances are + * requested and standard_capacity_base is 5 and + * standard_capacity_percent_above_base is 30, Dataproc will create 5 + * standard VMs and then start mixing spot and standard VMs for remaining 10 + * instances. The mix will be 30% standard and 70% spot. + * + * Generated from protobuf field optional int32 standard_capacity_percent_above_base = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getStandardCapacityPercentAboveBase() + { + return isset($this->standard_capacity_percent_above_base) ? $this->standard_capacity_percent_above_base : 0; + } + + public function hasStandardCapacityPercentAboveBase() + { + return isset($this->standard_capacity_percent_above_base); + } + + public function clearStandardCapacityPercentAboveBase() + { + unset($this->standard_capacity_percent_above_base); + } + + /** + * Optional. The percentage of target capacity that should use Standard VM. + * The remaining percentage will use Spot VMs. The percentage applies only + * to the capacity above standard_capacity_base. eg. If 15 instances are + * requested and standard_capacity_base is 5 and + * standard_capacity_percent_above_base is 30, Dataproc will create 5 + * standard VMs and then start mixing spot and standard VMs for remaining 10 + * instances. The mix will be 30% standard and 70% spot. + * + * Generated from protobuf field optional int32 standard_capacity_percent_above_base = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setStandardCapacityPercentAboveBase($var) + { + GPBUtil::checkInt32($var); + $this->standard_capacity_percent_above_base = $var; + + return $this; + } + +} + + From 273bc5c899391c7aee545523a2dc734debf8cee8 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 17 Oct 2024 17:06:38 -0400 Subject: [PATCH 17/34] feat: discovery of BigQuery snapshots (#7751) docs: documentation revisions for data profiles PiperOrigin-RevId: 686533927 Source-Link: https://github.com/googleapis/googleapis/commit/4c44b3061bb776caeeb5b73307786678e6191e05 Source-Link: https://github.com/googleapis/googleapis-gen/commit/51494a604e6656406118a2911bd484aa14382df7 Copy-Tag: eyJwIjoiRGxwLy5Pd2xCb3QueWFtbCIsImgiOiI1MTQ5NGE2MDRlNjY1NjQwNjExOGEyOTExYmQ0ODRhYTE0MzgyZGY3In0= --- Dlp/metadata/V2/Dlp.php | Bin 83947 -> 83982 bytes Dlp/src/V2/BigQueryTableType.php | 11 +++++-- Dlp/src/V2/BigQueryTableTypeCollection.php | 4 +-- Dlp/src/V2/Client/DlpServiceClient.php | 10 ++----- Dlp/src/V2/ColumnDataProfile.php | 32 ++++++++++----------- Dlp/src/V2/TableDataProfile.php | 28 ++++++++++-------- 6 files changed, 46 insertions(+), 39 deletions(-) diff --git a/Dlp/metadata/V2/Dlp.php b/Dlp/metadata/V2/Dlp.php index 237116b315a86a6211c3a11103193921f5a6b3de..3ed2683588ef5157ddb1531ea7c02226b9dbe415 100644 GIT binary patch delta 74 zcmV-Q0JZgoogle.privacy.dlp.v2.BigQueryTableType */ @@ -32,11 +32,18 @@ class BigQueryTableType * Generated from protobuf enum BIG_QUERY_TABLE_TYPE_EXTERNAL_BIG_LAKE = 2; */ const BIG_QUERY_TABLE_TYPE_EXTERNAL_BIG_LAKE = 2; + /** + * A snapshot of a BigQuery table. + * + * Generated from protobuf enum BIG_QUERY_TABLE_TYPE_SNAPSHOT = 3; + */ + const BIG_QUERY_TABLE_TYPE_SNAPSHOT = 3; private static $valueToName = [ self::BIG_QUERY_TABLE_TYPE_UNSPECIFIED => 'BIG_QUERY_TABLE_TYPE_UNSPECIFIED', self::BIG_QUERY_TABLE_TYPE_TABLE => 'BIG_QUERY_TABLE_TYPE_TABLE', self::BIG_QUERY_TABLE_TYPE_EXTERNAL_BIG_LAKE => 'BIG_QUERY_TABLE_TYPE_EXTERNAL_BIG_LAKE', + self::BIG_QUERY_TABLE_TYPE_SNAPSHOT => 'BIG_QUERY_TABLE_TYPE_SNAPSHOT', ]; public static function name($value) diff --git a/Dlp/src/V2/BigQueryTableTypeCollection.php b/Dlp/src/V2/BigQueryTableTypeCollection.php index b6e5441108ea..28c960f7cf56 100644 --- a/Dlp/src/V2/BigQueryTableTypeCollection.php +++ b/Dlp/src/V2/BigQueryTableTypeCollection.php @@ -7,8 +7,8 @@ use UnexpectedValueException; /** - * Over time new types may be added. Currently VIEW, MATERIALIZED_VIEW, - * and SNAPSHOT are not supported. + * Over time new types may be added. Currently VIEW, MATERIALIZED_VIEW, and + * non-BigLake external tables are not supported. * * Protobuf type google.privacy.dlp.v2.BigQueryTableTypeCollection */ diff --git a/Dlp/src/V2/Client/DlpServiceClient.php b/Dlp/src/V2/Client/DlpServiceClient.php index 2791f5142e59..f90d8b555805 100644 --- a/Dlp/src/V2/Client/DlpServiceClient.php +++ b/Dlp/src/V2/Client/DlpServiceClient.php @@ -108,13 +108,9 @@ use GuzzleHttp\Promise\PromiseInterface; /** - * Service Description: The Cloud Data Loss Prevention (DLP) API is a service that allows clients - * to detect the presence of Personally Identifiable Information (PII) and other - * privacy-sensitive data in user-supplied, unstructured data streams, like text - * blocks or images. - * The service also includes methods for sensitive data redaction and - * scheduling of data scans on Google Cloud Platform based data sets. - * + * Service Description: Sensitive Data Protection provides access to a powerful sensitive data + * inspection, classification, and de-identification platform that works + * on text, images, and Google Cloud storage repositories. * To learn more about concepts and find how-to guides see * https://cloud.google.com/sensitive-data-protection/docs/. * diff --git a/Dlp/src/V2/ColumnDataProfile.php b/Dlp/src/V2/ColumnDataProfile.php index 6afebd01c479..31666dd0d547 100644 --- a/Dlp/src/V2/ColumnDataProfile.php +++ b/Dlp/src/V2/ColumnDataProfile.php @@ -59,21 +59,21 @@ class ColumnDataProfile extends \Google\Protobuf\Internal\Message */ protected $dataset_project_id = ''; /** - * The BigQuery location where the dataset's data is stored. + * If supported, the location where the dataset's data is stored. * See https://cloud.google.com/bigquery/docs/locations for supported - * locations. + * BigQuery locations. * * Generated from protobuf field string dataset_location = 20; */ protected $dataset_location = ''; /** - * The BigQuery dataset ID. + * The BigQuery dataset ID, if the resource profiled is a BigQuery table. * * Generated from protobuf field string dataset_id = 21; */ protected $dataset_id = ''; /** - * The BigQuery table ID. + * The table ID. * * Generated from protobuf field string table_id = 22; */ @@ -166,13 +166,13 @@ class ColumnDataProfile extends \Google\Protobuf\Internal\Message * @type string $dataset_project_id * The Google Cloud project ID that owns the profiled resource. * @type string $dataset_location - * The BigQuery location where the dataset's data is stored. + * If supported, the location where the dataset's data is stored. * See https://cloud.google.com/bigquery/docs/locations for supported - * locations. + * BigQuery locations. * @type string $dataset_id - * The BigQuery dataset ID. + * The BigQuery dataset ID, if the resource profiled is a BigQuery table. * @type string $table_id - * The BigQuery table ID. + * The table ID. * @type string $column * The name of the column. * @type \Google\Cloud\Dlp\V2\SensitivityScore $sensitivity_score @@ -410,9 +410,9 @@ public function setDatasetProjectId($var) } /** - * The BigQuery location where the dataset's data is stored. + * If supported, the location where the dataset's data is stored. * See https://cloud.google.com/bigquery/docs/locations for supported - * locations. + * BigQuery locations. * * Generated from protobuf field string dataset_location = 20; * @return string @@ -423,9 +423,9 @@ public function getDatasetLocation() } /** - * The BigQuery location where the dataset's data is stored. + * If supported, the location where the dataset's data is stored. * See https://cloud.google.com/bigquery/docs/locations for supported - * locations. + * BigQuery locations. * * Generated from protobuf field string dataset_location = 20; * @param string $var @@ -440,7 +440,7 @@ public function setDatasetLocation($var) } /** - * The BigQuery dataset ID. + * The BigQuery dataset ID, if the resource profiled is a BigQuery table. * * Generated from protobuf field string dataset_id = 21; * @return string @@ -451,7 +451,7 @@ public function getDatasetId() } /** - * The BigQuery dataset ID. + * The BigQuery dataset ID, if the resource profiled is a BigQuery table. * * Generated from protobuf field string dataset_id = 21; * @param string $var @@ -466,7 +466,7 @@ public function setDatasetId($var) } /** - * The BigQuery table ID. + * The table ID. * * Generated from protobuf field string table_id = 22; * @return string @@ -477,7 +477,7 @@ public function getTableId() } /** - * The BigQuery table ID. + * The table ID. * * Generated from protobuf field string table_id = 22; * @param string $var diff --git a/Dlp/src/V2/TableDataProfile.php b/Dlp/src/V2/TableDataProfile.php index 504ea9e5786a..d7f617c0c325 100644 --- a/Dlp/src/V2/TableDataProfile.php +++ b/Dlp/src/V2/TableDataProfile.php @@ -48,19 +48,20 @@ class TableDataProfile extends \Google\Protobuf\Internal\Message */ protected $dataset_location = ''; /** - * If the resource is BigQuery, the dataset ID. + * If the resource is BigQuery, the dataset ID. * * Generated from protobuf field string dataset_id = 25; */ protected $dataset_id = ''; /** - * If the resource is BigQuery, the BigQuery table ID. + * The table ID. * * Generated from protobuf field string table_id = 26; */ protected $table_id = ''; /** - * The resource name of the resource profiled. + * The Cloud Asset Inventory resource that was profiled in order to generate + * this TableDataProfile. * https://cloud.google.com/apis/design/resource_names#full_resource_name * * Generated from protobuf field string full_resource = 3; @@ -196,11 +197,12 @@ class TableDataProfile extends \Google\Protobuf\Internal\Message * See https://cloud.google.com/bigquery/docs/locations for supported * locations. * @type string $dataset_id - * If the resource is BigQuery, the dataset ID. + * If the resource is BigQuery, the dataset ID. * @type string $table_id - * If the resource is BigQuery, the BigQuery table ID. + * The table ID. * @type string $full_resource - * The resource name of the resource profiled. + * The Cloud Asset Inventory resource that was profiled in order to generate + * this TableDataProfile. * https://cloud.google.com/apis/design/resource_names#full_resource_name * @type \Google\Cloud\Dlp\V2\ProfileStatus $profile_status * Success or error status from the most recent profile generation attempt. @@ -392,7 +394,7 @@ public function setDatasetLocation($var) } /** - * If the resource is BigQuery, the dataset ID. + * If the resource is BigQuery, the dataset ID. * * Generated from protobuf field string dataset_id = 25; * @return string @@ -403,7 +405,7 @@ public function getDatasetId() } /** - * If the resource is BigQuery, the dataset ID. + * If the resource is BigQuery, the dataset ID. * * Generated from protobuf field string dataset_id = 25; * @param string $var @@ -418,7 +420,7 @@ public function setDatasetId($var) } /** - * If the resource is BigQuery, the BigQuery table ID. + * The table ID. * * Generated from protobuf field string table_id = 26; * @return string @@ -429,7 +431,7 @@ public function getTableId() } /** - * If the resource is BigQuery, the BigQuery table ID. + * The table ID. * * Generated from protobuf field string table_id = 26; * @param string $var @@ -444,7 +446,8 @@ public function setTableId($var) } /** - * The resource name of the resource profiled. + * The Cloud Asset Inventory resource that was profiled in order to generate + * this TableDataProfile. * https://cloud.google.com/apis/design/resource_names#full_resource_name * * Generated from protobuf field string full_resource = 3; @@ -456,7 +459,8 @@ public function getFullResource() } /** - * The resource name of the resource profiled. + * The Cloud Asset Inventory resource that was profiled in order to generate + * this TableDataProfile. * https://cloud.google.com/apis/design/resource_names#full_resource_name * * Generated from protobuf field string full_resource = 3; From 869923514bca067beac9c0b754b47435fb1d8f05 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 17 Oct 2024 17:07:29 -0400 Subject: [PATCH 18/34] docs: Marks the `google.cloud.essentialcontacts.v1.Contact.validation_state` field as `output_only` (#7745) PiperOrigin-RevId: 685731240 Source-Link: https://github.com/googleapis/googleapis/commit/f78cd2f7943b9a2eb9734e56a8f3428da75917e2 Source-Link: https://github.com/googleapis/googleapis-gen/commit/1d05fdc15839d2f02bf73dd7b6f30f58f9ad701e Copy-Tag: eyJwIjoiRXNzZW50aWFsQ29udGFjdHMvLk93bEJvdC55YW1sIiwiaCI6IjFkMDVmZGMxNTgzOWQyZjAyYmY3M2RkN2I2ZjMwZjU4ZjlhZDcwMWUifQ== --- EssentialContacts/metadata/V1/Service.php | 8 ++++---- EssentialContacts/src/V1/Contact.php | 22 +++++++++++----------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/EssentialContacts/metadata/V1/Service.php b/EssentialContacts/metadata/V1/Service.php index 7c03e8cd390d..cd7ede5d98f6 100644 --- a/EssentialContacts/metadata/V1/Service.php +++ b/EssentialContacts/metadata/V1/Service.php @@ -24,14 +24,14 @@ public static function initOnce() { \GPBMetadata\Google\Protobuf\Timestamp::initOnce(); $pool->internalAddGeneratedFile( ' -" -/google/cloud/essentialcontacts/v1/service.proto!google.cloud.essentialcontacts.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto-google/cloud/essentialcontacts/v1/enums.protogoogle/protobuf/empty.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto" +" +/google/cloud/essentialcontacts/v1/service.proto!google.cloud.essentialcontacts.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto-google/cloud/essentialcontacts/v1/enums.protogoogle/protobuf/empty.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto" Contact name ( BA email ( BAi #notification_category_subscriptions (27.google.cloud.essentialcontacts.v1.NotificationCategoryBA - language_tag ( BAL -validation_state (22.google.cloud.essentialcontacts.v1.ValidationState1 + language_tag ( BAQ +validation_state (22.google.cloud.essentialcontacts.v1.ValidationStateBA1 validate_time ( 2.google.protobuf.Timestamp:A (essentialcontacts.googleapis.com/Contact%projects/{project}/contacts/{contact}#folders/{folder}/contacts/{contact}/organizations/{organization}/contacts/{contact}" ListContactsRequest@ diff --git a/EssentialContacts/src/V1/Contact.php b/EssentialContacts/src/V1/Contact.php index c0a08d7aeb7f..7c3a10ac5fa8 100644 --- a/EssentialContacts/src/V1/Contact.php +++ b/EssentialContacts/src/V1/Contact.php @@ -46,10 +46,10 @@ class Contact extends \Google\Protobuf\Internal\Message */ protected $language_tag = ''; /** - * The validity of the contact. A contact is considered valid if it is the - * correct recipient for notifications for a particular resource. + * Output only. The validity of the contact. A contact is considered valid if + * it is the correct recipient for notifications for a particular resource. * - * Generated from protobuf field .google.cloud.essentialcontacts.v1.ValidationState validation_state = 8; + * Generated from protobuf field .google.cloud.essentialcontacts.v1.ValidationState validation_state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ protected $validation_state = 0; /** @@ -82,8 +82,8 @@ class Contact extends \Google\Protobuf\Internal\Message * languages](https://cloud.google.com/resource-manager/docs/managing-notification-contacts#supported-languages) * for a list of supported languages. * @type int $validation_state - * The validity of the contact. A contact is considered valid if it is the - * correct recipient for notifications for a particular resource. + * Output only. The validity of the contact. A contact is considered valid if + * it is the correct recipient for notifications for a particular resource. * @type \Google\Protobuf\Timestamp $validate_time * The last time the validation_state was updated, either manually or * automatically. A contact is considered stale if its validation state was @@ -212,10 +212,10 @@ public function setLanguageTag($var) } /** - * The validity of the contact. A contact is considered valid if it is the - * correct recipient for notifications for a particular resource. + * Output only. The validity of the contact. A contact is considered valid if + * it is the correct recipient for notifications for a particular resource. * - * Generated from protobuf field .google.cloud.essentialcontacts.v1.ValidationState validation_state = 8; + * Generated from protobuf field .google.cloud.essentialcontacts.v1.ValidationState validation_state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return int */ public function getValidationState() @@ -224,10 +224,10 @@ public function getValidationState() } /** - * The validity of the contact. A contact is considered valid if it is the - * correct recipient for notifications for a particular resource. + * Output only. The validity of the contact. A contact is considered valid if + * it is the correct recipient for notifications for a particular resource. * - * Generated from protobuf field .google.cloud.essentialcontacts.v1.ValidationState validation_state = 8; + * Generated from protobuf field .google.cloud.essentialcontacts.v1.ValidationState validation_state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param int $var * @return $this */ From 600d1af1e1e258e2ba6110ce1ae842637a8f8a5d Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 18 Oct 2024 16:08:17 -0400 Subject: [PATCH 19/34] feat: Add field `instance` to message `.google.cloud.securesourcemanager.v1.ListRepositoriesRequest` (#7752) docs: A comment for field `instance` in message `.google.cloud.securesourcemanager.v1.Repository` is changed PiperOrigin-RevId: 686540736 Source-Link: https://github.com/googleapis/googleapis/commit/d3566d5efe21e5736269f71247bde7a2b487be73 Source-Link: https://github.com/googleapis/googleapis-gen/commit/a481bc86211bc24fd5a72d55cf8c42dd4649b609 Copy-Tag: eyJwIjoiU2VjdXJlU291cmNlTWFuYWdlci8uT3dsQm90LnlhbWwiLCJoIjoiYTQ4MWJjODYyMTFiYzI0ZmQ1YTcyZDU1Y2Y4YzQyZGQ0NjQ5YjYwOSJ9 --- .../metadata/V1/SecureSourceManager.php | Bin 8162 -> 8281 bytes .../src/V1/ListRepositoriesRequest.php | 58 ++++++++++++++++++ SecureSourceManager/src/V1/Repository.php | 34 ++++++---- 3 files changed, 81 insertions(+), 11 deletions(-) diff --git a/SecureSourceManager/metadata/V1/SecureSourceManager.php b/SecureSourceManager/metadata/V1/SecureSourceManager.php index f9bc756b7e88fe7ee87dc9f3421fed3bcb6a4f45..a5a3a2cde5fd977498dd55c2ee03a3f237994ed9 100644 GIT binary patch delta 91 zcmaE4f74+DKMUjE%>pbF*%&WOUc_ZB=E}v9nO9trn3tR?!K}cj!RciDz>#tCJU)ZX cpSg6{7+*|Q5L_fKgshAeS()MH!-DdB07@Sm3IG5A delta 68 zcmV-K0K5O$K;l2J4+H^*vk(N41_7Xxq6#|}6$%JxZgX^DZewK_10Vq?2|@$lK>@QP a3oHf!p_5P%q68v(3K)|v7#Oov5(EyvH4=^h diff --git a/SecureSourceManager/src/V1/ListRepositoriesRequest.php b/SecureSourceManager/src/V1/ListRepositoriesRequest.php index 5d93ea44b71f..c62729e85029 100644 --- a/SecureSourceManager/src/V1/ListRepositoriesRequest.php +++ b/SecureSourceManager/src/V1/ListRepositoriesRequest.php @@ -40,6 +40,18 @@ class ListRepositoriesRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; */ protected $filter = ''; + /** + * Optional. The name of the instance in which the repository is hosted, + * formatted as + * `projects/{project_number}/locations/{location_id}/instances/{instance_id}`. + * When listing repositories via + * securesourcemanager.googleapis.com (Control Plane API), this field is + * required. When listing repositories via *.sourcemanager.dev (Data Plane + * API), this field is ignored. + * + * Generated from protobuf field string instance = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $instance = ''; /** * @param string $parent Required. Parent value for ListRepositoriesRequest. Please see @@ -70,6 +82,14 @@ public static function build(string $parent): self * A token identifying a page of results the server should return. * @type string $filter * Optional. Filter results. + * @type string $instance + * Optional. The name of the instance in which the repository is hosted, + * formatted as + * `projects/{project_number}/locations/{location_id}/instances/{instance_id}`. + * When listing repositories via + * securesourcemanager.googleapis.com (Control Plane API), this field is + * required. When listing repositories via *.sourcemanager.dev (Data Plane + * API), this field is ignored. * } */ public function __construct($data = NULL) { @@ -183,5 +203,43 @@ public function setFilter($var) return $this; } + /** + * Optional. The name of the instance in which the repository is hosted, + * formatted as + * `projects/{project_number}/locations/{location_id}/instances/{instance_id}`. + * When listing repositories via + * securesourcemanager.googleapis.com (Control Plane API), this field is + * required. When listing repositories via *.sourcemanager.dev (Data Plane + * API), this field is ignored. + * + * Generated from protobuf field string instance = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * Optional. The name of the instance in which the repository is hosted, + * formatted as + * `projects/{project_number}/locations/{location_id}/instances/{instance_id}`. + * When listing repositories via + * securesourcemanager.googleapis.com (Control Plane API), this field is + * required. When listing repositories via *.sourcemanager.dev (Data Plane + * API), this field is ignored. + * + * Generated from protobuf field string instance = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkString($var, True); + $this->instance = $var; + + return $this; + } + } diff --git a/SecureSourceManager/src/V1/Repository.php b/SecureSourceManager/src/V1/Repository.php index 647cac650cf7..c43a041a3fff 100644 --- a/SecureSourceManager/src/V1/Repository.php +++ b/SecureSourceManager/src/V1/Repository.php @@ -34,10 +34,13 @@ class Repository extends \Google\Protobuf\Internal\Message * Optional. The name of the instance in which the repository is hosted, * formatted as * `projects/{project_number}/locations/{location_id}/instances/{instance_id}` - * For data plane CreateRepository requests, this field is output only. - * For control plane CreateRepository requests, this field is used as input. + * When creating repository via + * securesourcemanager.googleapis.com (Control Plane API), this field is used + * as input. + * When creating repository via *.sourcemanager.dev (Data Plane API), this + * field is output only. * - * Generated from protobuf field string instance = 3 [(.google.api.field_behavior) = OPTIONAL]; + * Generated from protobuf field string instance = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { */ protected $instance = ''; /** @@ -96,8 +99,11 @@ class Repository extends \Google\Protobuf\Internal\Message * Optional. The name of the instance in which the repository is hosted, * formatted as * `projects/{project_number}/locations/{location_id}/instances/{instance_id}` - * For data plane CreateRepository requests, this field is output only. - * For control plane CreateRepository requests, this field is used as input. + * When creating repository via + * securesourcemanager.googleapis.com (Control Plane API), this field is used + * as input. + * When creating repository via *.sourcemanager.dev (Data Plane API), this + * field is output only. * @type string $uid * Output only. Unique identifier of the repository. * @type \Google\Protobuf\Timestamp $create_time @@ -181,10 +187,13 @@ public function setDescription($var) * Optional. The name of the instance in which the repository is hosted, * formatted as * `projects/{project_number}/locations/{location_id}/instances/{instance_id}` - * For data plane CreateRepository requests, this field is output only. - * For control plane CreateRepository requests, this field is used as input. + * When creating repository via + * securesourcemanager.googleapis.com (Control Plane API), this field is used + * as input. + * When creating repository via *.sourcemanager.dev (Data Plane API), this + * field is output only. * - * Generated from protobuf field string instance = 3 [(.google.api.field_behavior) = OPTIONAL]; + * Generated from protobuf field string instance = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { * @return string */ public function getInstance() @@ -196,10 +205,13 @@ public function getInstance() * Optional. The name of the instance in which the repository is hosted, * formatted as * `projects/{project_number}/locations/{location_id}/instances/{instance_id}` - * For data plane CreateRepository requests, this field is output only. - * For control plane CreateRepository requests, this field is used as input. + * When creating repository via + * securesourcemanager.googleapis.com (Control Plane API), this field is used + * as input. + * When creating repository via *.sourcemanager.dev (Data Plane API), this + * field is output only. * - * Generated from protobuf field string instance = 3 [(.google.api.field_behavior) = OPTIONAL]; + * Generated from protobuf field string instance = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { * @param string $var * @return $this */ From 1d6c067b446bfe6cd2875f93ec7cf8447f882955 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 18 Oct 2024 16:09:05 -0400 Subject: [PATCH 20/34] feat: add `SamplingLevel` type to Data API v1alpha (#7753) feat: add `sampling_level` to the `ReportDefinition` type PiperOrigin-RevId: 686560382 Source-Link: https://github.com/googleapis/googleapis/commit/7b6975c4bb1f02bb05fd94cb6f8614f08fb55d24 Source-Link: https://github.com/googleapis/googleapis-gen/commit/52607af0302837ce880471a94e473deab5ca0e4f Copy-Tag: eyJwIjoiQW5hbHl0aWNzRGF0YS8uT3dsQm90LnlhbWwiLCJoIjoiNTI2MDdhZjAzMDI4MzdjZTg4MDQ3MWE5NGU0NzNkZWFiNWNhMGU0ZiJ9 --- .../metadata/V1Alpha/AnalyticsDataApi.php | Bin 12708 -> 12808 bytes AnalyticsData/metadata/V1Alpha/Data.php | Bin 15349 -> 15434 bytes .../V1alpha/ReportTask/ReportDefinition.php | 44 +++++++++++ AnalyticsData/src/V1alpha/SamplingLevel.php | 73 ++++++++++++++++++ 4 files changed, 117 insertions(+) create mode 100644 AnalyticsData/src/V1alpha/SamplingLevel.php diff --git a/AnalyticsData/metadata/V1Alpha/AnalyticsDataApi.php b/AnalyticsData/metadata/V1Alpha/AnalyticsDataApi.php index 0e18d43baed40009898cc8efab83989fa990db84..50549f2f578d3eaa2b59c27c496948d9fd3bb135 100644 GIT binary patch delta 113 zcmZ3I+>x?j8Z+zCm>4dziQZ4nqI{ diff --git a/AnalyticsData/metadata/V1Alpha/Data.php b/AnalyticsData/metadata/V1Alpha/Data.php index 281b7c696ed61165745b56ae7630f657304ff057..e82dcc15264d70356044922f7524769ce746838c 100644 GIT binary patch delta 104 zcmexbeyU=F1QX-S&5}$)mZ4g~T)e@Fxdl0ydFei>WvMwra$Hiuj=ljto__A}KCWS| zKJlS`!2zz$o^GD5E&>cf>|D$~{^0_QLR?&IzOF8wp}qo4LcCm@Kvf`ZKsC&hwXIJ9 E09Fbcl>h($ delta 18 acmX?A@wI$|1QX+w&5}$)mXjN-PXPc+00%z+ diff --git a/AnalyticsData/src/V1alpha/ReportTask/ReportDefinition.php b/AnalyticsData/src/V1alpha/ReportTask/ReportDefinition.php index 4aa90625bd5e..1aaec94828ea 100644 --- a/AnalyticsData/src/V1alpha/ReportTask/ReportDefinition.php +++ b/AnalyticsData/src/V1alpha/ReportTask/ReportDefinition.php @@ -122,6 +122,12 @@ class ReportDefinition extends \Google\Protobuf\Internal\Message * Generated from protobuf field bool keep_empty_rows = 13 [(.google.api.field_behavior) = OPTIONAL]; */ private $keep_empty_rows = false; + /** + * Optional. The report's sampling level. + * + * Generated from protobuf field optional .google.analytics.data.v1alpha.SamplingLevel sampling_level = 14 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $sampling_level = null; /** * Constructor. @@ -188,6 +194,8 @@ class ReportDefinition extends \Google\Protobuf\Internal\Message * For example if a property never logs a `purchase` event, then a query for * the `eventName` dimension and `eventCount` metric will not have a row * containing eventName: "purchase" and eventCount: 0. + * @type int $sampling_level + * Optional. The report's sampling level. * } */ public function __construct($data = NULL) { @@ -607,6 +615,42 @@ public function setKeepEmptyRows($var) return $this; } + /** + * Optional. The report's sampling level. + * + * Generated from protobuf field optional .google.analytics.data.v1alpha.SamplingLevel sampling_level = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getSamplingLevel() + { + return isset($this->sampling_level) ? $this->sampling_level : 0; + } + + public function hasSamplingLevel() + { + return isset($this->sampling_level); + } + + public function clearSamplingLevel() + { + unset($this->sampling_level); + } + + /** + * Optional. The report's sampling level. + * + * Generated from protobuf field optional .google.analytics.data.v1alpha.SamplingLevel sampling_level = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setSamplingLevel($var) + { + GPBUtil::checkEnum($var, \Google\Analytics\Data\V1alpha\SamplingLevel::class); + $this->sampling_level = $var; + + return $this; + } + } diff --git a/AnalyticsData/src/V1alpha/SamplingLevel.php b/AnalyticsData/src/V1alpha/SamplingLevel.php new file mode 100644 index 000000000000..0891f0b9c2e8 --- /dev/null +++ b/AnalyticsData/src/V1alpha/SamplingLevel.php @@ -0,0 +1,73 @@ +google.analytics.data.v1alpha.SamplingLevel + */ +class SamplingLevel +{ + /** + * Unspecified type. + * + * Generated from protobuf enum SAMPLING_LEVEL_UNSPECIFIED = 0; + */ + const SAMPLING_LEVEL_UNSPECIFIED = 0; + /** + * Applies a sampling level of 10 million to standard properties and + * 100 million to Google Analytics 360 properties. + * + * Generated from protobuf enum LOW = 1; + */ + const LOW = 1; + /** + * Exclusive to Google Analytics 360 properties with a sampling level of 1 + * billion. + * + * Generated from protobuf enum MEDIUM = 2; + */ + const MEDIUM = 2; + /** + * Exclusive to Google Analytics 360 properties. Unsampled explorations are + * more accurate and can reveal insights that aren't visible in standard + * explorations. To learn more, see + * https://support.google.com/analytics/answer/10896953. + * + * Generated from protobuf enum UNSAMPLED = 3; + */ + const UNSAMPLED = 3; + + private static $valueToName = [ + self::SAMPLING_LEVEL_UNSPECIFIED => 'SAMPLING_LEVEL_UNSPECIFIED', + self::LOW => 'LOW', + self::MEDIUM => 'MEDIUM', + self::UNSAMPLED => 'UNSAMPLED', + ]; + + 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); + } +} + From 6dcd0cd102770392a240cd1a5152e927a9ca55f7 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 18 Oct 2024 18:26:02 -0400 Subject: [PATCH 21/34] chore(main): release 0.264.0 (#7742) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- AnalyticsData/VERSION | 2 +- BigQueryStorage/VERSION | 2 +- CHANGELOG.md | 109 ++++++++++++++++++++++++++++++ Dataproc/VERSION | 2 +- Datastore/VERSION | 2 +- Datastore/src/DatastoreClient.php | 2 +- Dlp/VERSION | 2 +- EssentialContacts/VERSION | 2 +- NetworkManagement/VERSION | 2 +- SecureSourceManager/VERSION | 2 +- composer.json | 16 ++--- 11 files changed, 126 insertions(+), 17 deletions(-) diff --git a/AnalyticsData/VERSION b/AnalyticsData/VERSION index 1cf0537c3438..5a03fb737b38 100644 --- a/AnalyticsData/VERSION +++ b/AnalyticsData/VERSION @@ -1 +1 @@ -0.19.0 +0.20.0 diff --git a/BigQueryStorage/VERSION b/BigQueryStorage/VERSION index 227cea215648..7ec1d6db4087 100644 --- a/BigQueryStorage/VERSION +++ b/BigQueryStorage/VERSION @@ -1 +1 @@ -2.0.0 +2.1.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index a4dc7d395b82..d2abfc83f13d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,114 @@ # Changelog +## 0.264.0 + +
google/analytics-data 0.20.0 + + + +### Features + +* Add `sampling_level` to the `ReportDefinition` type ([1d6c067](https://github.com/googleapis/google-cloud-php/commit/1d6c067b446bfe6cd2875f93ec7cf8447f882955)) +* Add `SamplingLevel` type to Data API v1alpha ([#7753](https://github.com/googleapis/google-cloud-php/issues/7753)) ([1d6c067](https://github.com/googleapis/google-cloud-php/commit/1d6c067b446bfe6cd2875f93ec7cf8447f882955)) + +
+ +
google/cloud-bigquery-storage 2.1.0 + + + +### Features + +* Add experimental ArrowData type and arrow_data field within AppendRowsRequest ([#7743](https://github.com/googleapis/google-cloud-php/issues/7743)) ([6865827](https://github.com/googleapis/google-cloud-php/commit/6865827d0c14684460a2565b0f6ecc1610c1ee3a)) + +
+ +
google/cloud-dataproc 2.2.0 + + + +### Features + +* Add `ProvisioningModelMix` to support mixing of spot and standard instances for secondary workers ([#7746](https://github.com/googleapis/google-cloud-php/issues/7746)) ([21b4eb5](https://github.com/googleapis/google-cloud-php/commit/21b4eb508f3ecbc690ccddb25993b3975cc4aa31)) +* Add support for configuration of bootdisk IOPS and throughput when bootdisk is a hyperdisk ([21b4eb5](https://github.com/googleapis/google-cloud-php/commit/21b4eb508f3ecbc690ccddb25993b3975cc4aa31)) + +
+ +
google/cloud-datastore 1.32.0 + + + +### Features + +* Add FindNearest API to the stable branch ([#7744](https://github.com/googleapis/google-cloud-php/issues/7744)) ([327de67](https://github.com/googleapis/google-cloud-php/commit/327de673ae8bcb59533d906237ce5c73416293c4)) + +
+ +
google/cloud-dlp 2.2.0 + + + +### Features + +* Discovery of BigQuery snapshots ([#7751](https://github.com/googleapis/google-cloud-php/issues/7751)) ([273bc5c](https://github.com/googleapis/google-cloud-php/commit/273bc5c899391c7aee545523a2dc734debf8cee8)) + + +### Documentation + +* Documentation revisions for data profiles ([273bc5c](https://github.com/googleapis/google-cloud-php/commit/273bc5c899391c7aee545523a2dc734debf8cee8)) + +
+ +
google/cloud-essential-contacts 1.0.1 + + + +### Documentation + +* Marks the `google.cloud.essentialcontacts.v1.Contact.validation_state` field as `output_only` ([#7745](https://github.com/googleapis/google-cloud-php/issues/7745)) ([8699235](https://github.com/googleapis/google-cloud-php/commit/869923514bca067beac9c0b754b47435fb1d8f05)) + +
+ +
google/cloud-network-management 2.1.0 + + + +### Features + +* Add fields related to advertised routes to the RouteInfo proto ([72df650](https://github.com/googleapis/google-cloud-php/commit/72df650c65a54e473aeb0e186901295c40d0c7e8)) +* Add firewall policy URI to the FirewallInfo proto ([72df650](https://github.com/googleapis/google-cloud-php/commit/72df650c65a54e473aeb0e186901295c40d0c7e8)) +* Add load balancer name to the ForwardingRuleInfo proto ([72df650](https://github.com/googleapis/google-cloud-php/commit/72df650c65a54e473aeb0e186901295c40d0c7e8)) +* Add messages and fields related to Redis Clusters ([72df650](https://github.com/googleapis/google-cloud-php/commit/72df650c65a54e473aeb0e186901295c40d0c7e8)) +* Add messages and fields related to Redis Instances ([#7748](https://github.com/googleapis/google-cloud-php/issues/7748)) ([72df650](https://github.com/googleapis/google-cloud-php/commit/72df650c65a54e473aeb0e186901295c40d0c7e8)) +* Add more detailed abort and drop causes to corresponding enums ([72df650](https://github.com/googleapis/google-cloud-php/commit/72df650c65a54e473aeb0e186901295c40d0c7e8)) +* Add PSC network attachment URI to the InstanceInfo proto ([72df650](https://github.com/googleapis/google-cloud-php/commit/72df650c65a54e473aeb0e186901295c40d0c7e8)) +* Add PSC target fields to the ForwardingRuleInfo proto ([72df650](https://github.com/googleapis/google-cloud-php/commit/72df650c65a54e473aeb0e186901295c40d0c7e8)) +* Add region name field to the RouteInfo proto ([72df650](https://github.com/googleapis/google-cloud-php/commit/72df650c65a54e473aeb0e186901295c40d0c7e8)) +* Add region name to the ForwardingRuleInfo proto ([72df650](https://github.com/googleapis/google-cloud-php/commit/72df650c65a54e473aeb0e186901295c40d0c7e8)) +* Add subnet URI and region name to the NetworkInfo proto ([72df650](https://github.com/googleapis/google-cloud-php/commit/72df650c65a54e473aeb0e186901295c40d0c7e8)) + + +### Documentation + +* Update outdated comments in the FirewallInfo proto ([72df650](https://github.com/googleapis/google-cloud-php/commit/72df650c65a54e473aeb0e186901295c40d0c7e8)) + +
+ +
google/cloud-securesourcemanager 1.2.0 + + + +### Features + +* Add field `instance` to message `.google.cloud.securesourcemanager.v1.ListRepositoriesRequest` ([#7752](https://github.com/googleapis/google-cloud-php/issues/7752)) ([600d1af](https://github.com/googleapis/google-cloud-php/commit/600d1af1e1e258e2ba6110ce1ae842637a8f8a5d)) + + +### Documentation + +* A comment for field `instance` in message `.google.cloud.securesourcemanager.v1.Repository` is changed ([600d1af](https://github.com/googleapis/google-cloud-php/commit/600d1af1e1e258e2ba6110ce1ae842637a8f8a5d)) + +
+ ## 0.263.0
google/cloud-backupdr 0.4.0 diff --git a/Dataproc/VERSION b/Dataproc/VERSION index 7ec1d6db4087..ccbccc3dc626 100644 --- a/Dataproc/VERSION +++ b/Dataproc/VERSION @@ -1 +1 @@ -2.1.0 +2.2.0 diff --git a/Datastore/VERSION b/Datastore/VERSION index 34aae156b192..359c41089a42 100644 --- a/Datastore/VERSION +++ b/Datastore/VERSION @@ -1 +1 @@ -1.31.0 +1.32.0 diff --git a/Datastore/src/DatastoreClient.php b/Datastore/src/DatastoreClient.php index d4ef798e4417..35ca4a8a93a0 100644 --- a/Datastore/src/DatastoreClient.php +++ b/Datastore/src/DatastoreClient.php @@ -92,7 +92,7 @@ class DatastoreClient use ClientTrait; use DatastoreTrait; - const VERSION = '1.31.0'; + const VERSION = '1.32.0'; const FULL_CONTROL_SCOPE = 'https://www.googleapis.com/auth/datastore'; diff --git a/Dlp/VERSION b/Dlp/VERSION index 7ec1d6db4087..ccbccc3dc626 100644 --- a/Dlp/VERSION +++ b/Dlp/VERSION @@ -1 +1 @@ -2.1.0 +2.2.0 diff --git a/EssentialContacts/VERSION b/EssentialContacts/VERSION index 3eefcb9dd5b3..7dea76edb3dc 100644 --- a/EssentialContacts/VERSION +++ b/EssentialContacts/VERSION @@ -1 +1 @@ -1.0.0 +1.0.1 diff --git a/NetworkManagement/VERSION b/NetworkManagement/VERSION index 38f77a65b301..7ec1d6db4087 100644 --- a/NetworkManagement/VERSION +++ b/NetworkManagement/VERSION @@ -1 +1 @@ -2.0.1 +2.1.0 diff --git a/SecureSourceManager/VERSION b/SecureSourceManager/VERSION index 9084fa2f716a..26aaba0e8663 100644 --- a/SecureSourceManager/VERSION +++ b/SecureSourceManager/VERSION @@ -1 +1 @@ -1.1.0 +1.2.0 diff --git a/composer.json b/composer.json index a853a691adae..86d464ebec10 100644 --- a/composer.json +++ b/composer.json @@ -70,7 +70,7 @@ "google/access-context-manager": "1.0.0", "google/ads-marketingplatform-admin": "0.1.0", "google/analytics-admin": "0.24.0", - "google/analytics-data": "0.19.0", + "google/analytics-data": "0.20.0", "google/apps-chat": "0.6.0", "google/apps-events-subscriptions": "0.1.3", "google/apps-meet": "0.2.3", @@ -104,7 +104,7 @@ "google/cloud-bigquery-datapolicies": "1.0.0", "google/cloud-bigquery-migration": "1.1.0", "google/cloud-bigquery-reservation": "2.0.1", - "google/cloud-bigquery-storage": "2.0.0", + "google/cloud-bigquery-storage": "2.1.0", "google/cloud-bigquerydatatransfer": "2.1.0", "google/cloud-bigtable": "2.5.0", "google/cloud-billing": "2.0.0", @@ -130,9 +130,9 @@ "google/cloud-dataform": "0.4.5", "google/cloud-datalabeling": "0.5.5", "google/cloud-dataplex": "1.0.0", - "google/cloud-dataproc": "2.1.0", + "google/cloud-dataproc": "2.2.0", "google/cloud-dataproc-metastore": "1.0.0", - "google/cloud-datastore": "1.31.0", + "google/cloud-datastore": "1.32.0", "google/cloud-datastore-admin": "1.0.0", "google/cloud-datastream": "2.0.0", "google/cloud-debugger": "1.9.0", @@ -141,13 +141,13 @@ "google/cloud-dialogflow": "1.15.0", "google/cloud-dialogflow-cx": "0.4.0", "google/cloud-discoveryengine": "1.2.0", - "google/cloud-dlp": "2.1.0", + "google/cloud-dlp": "2.2.0", "google/cloud-dms": "2.0.1", "google/cloud-document-ai": "2.0.0", "google/cloud-domains": "1.0.0", "google/cloud-edgenetwork": "1.1.1", "google/cloud-error-reporting": "0.22.7", - "google/cloud-essential-contacts": "1.0.0", + "google/cloud-essential-contacts": "1.0.1", "google/cloud-eventarc": "2.0.1", "google/cloud-eventarc-publishing": "1.0.0", "google/cloud-filestore": "2.0.1", @@ -175,7 +175,7 @@ "google/cloud-monitoring": "1.11.0", "google/cloud-netapp": "1.1.0", "google/cloud-network-connectivity": "2.0.1", - "google/cloud-network-management": "2.0.1", + "google/cloud-network-management": "2.1.0", "google/cloud-network-security": "1.0.0", "google/cloud-networkservices": "0.2.0", "google/cloud-notebooks": "1.0.0", @@ -206,7 +206,7 @@ "google/cloud-run": "1.2.0", "google/cloud-scheduler": "2.0.0", "google/cloud-secret-manager": "1.15.2", - "google/cloud-securesourcemanager": "1.1.0", + "google/cloud-securesourcemanager": "1.2.0", "google/cloud-security-center": "2.0.1", "google/cloud-security-private-ca": "2.0.0", "google/cloud-security-public-ca": "1.0.0", From 12921fc2da9f29aea11ab9e6d4eb222f3b7d920c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Mendoza?= Date: Mon, 21 Oct 2024 17:55:16 -0400 Subject: [PATCH 22/34] Chore: Rework the compile splitsh command (#7755) --- .github/workflows/release.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 65749cf74998..dd7d41caf7aa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,11 +29,17 @@ jobs: mkdir libgit2/build && cd libgit2/build cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local sudo cmake --build . --target install - - name: Compile splitsh + - name: Clone splitsh/lite + uses: actions/checkout@master + with: + repository: splitsh/lite + ref: v2.0.0 + path: lite + - name: Build splitsh-lite run: | - go env -w GO111MODULE=off - go get github.com/splitsh/lite - go build -o /usr/local/bin/splitsh-lite github.com/splitsh/lite + cd lite + go build -o splitsh-lite github.com/splitsh/lite + mv splitsh-lite /usr/local/bin/splitsh-lite - name: Checkout google/cloud uses: actions/checkout@v4 with: From be3a11c9f4b18c20264399206e6aa2c7716adb6a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 23 Oct 2024 18:28:14 -0700 Subject: [PATCH 23/34] feat: Add branch rule APIs (#7754) feat: Add field `psc_allowed_projects` to message `.google.cloud.securesourcemanager.v1.Instance` docs: A comment for field `instance` in message `.google.cloud.securesourcemanager.v1.Repository` is changed PiperOrigin-RevId: 688170540 Source-Link: https://github.com/googleapis/googleapis/commit/b6a9d807da8fb0f767a7b5b5b2d773e41e7d52b5 Source-Link: https://github.com/googleapis/googleapis-gen/commit/d9406c5e840d1e8289232ca089827b71c7601c00 Copy-Tag: eyJwIjoiU2VjdXJlU291cmNlTWFuYWdlci8uT3dsQm90LnlhbWwiLCJoIjoiZDk0MDZjNWU4NDBkMWU4Mjg5MjMyY2EwODk4MjdiNzFjNzYwMWMwMCJ9 --- .../metadata/V1/SecureSourceManager.php | Bin 8281 -> 11360 bytes .../create_branch_rule.php | 91 +++ .../delete_branch_rule.php | 84 +++ .../get_branch_rule.php | 78 +++ .../list_branch_rules.php | 79 +++ .../update_branch_rule.php | 74 ++ SecureSourceManager/src/V1/BranchRule.php | 620 +++++++++++++++++ .../src/V1/BranchRule/Check.php | 68 ++ .../V1/Client/SecureSourceManagerClient.php | 167 +++++ .../src/V1/CreateBranchRuleRequest.php | 141 ++++ .../src/V1/DeleteBranchRuleRequest.php | 111 +++ .../src/V1/GetBranchRuleRequest.php | 91 +++ .../src/V1/Instance/PrivateConfig.php | 42 ++ .../src/V1/ListBranchRulesRequest.php | 127 ++++ .../src/V1/ListBranchRulesResponse.php | 101 +++ SecureSourceManager/src/V1/Repository.php | 20 +- .../src/V1/UpdateBranchRuleRequest.php | 187 +++++ .../src/V1/gapic_metadata.json | 25 + .../secure_source_manager_client_config.json | 25 + ...ecure_source_manager_descriptor_config.php | 91 +++ ...cure_source_manager_rest_client_config.php | 64 ++ .../Client/SecureSourceManagerClientTest.php | 657 +++++++++++++++++- 22 files changed, 2912 insertions(+), 31 deletions(-) create mode 100644 SecureSourceManager/samples/V1/SecureSourceManagerClient/create_branch_rule.php create mode 100644 SecureSourceManager/samples/V1/SecureSourceManagerClient/delete_branch_rule.php create mode 100644 SecureSourceManager/samples/V1/SecureSourceManagerClient/get_branch_rule.php create mode 100644 SecureSourceManager/samples/V1/SecureSourceManagerClient/list_branch_rules.php create mode 100644 SecureSourceManager/samples/V1/SecureSourceManagerClient/update_branch_rule.php create mode 100644 SecureSourceManager/src/V1/BranchRule.php create mode 100644 SecureSourceManager/src/V1/BranchRule/Check.php create mode 100644 SecureSourceManager/src/V1/CreateBranchRuleRequest.php create mode 100644 SecureSourceManager/src/V1/DeleteBranchRuleRequest.php create mode 100644 SecureSourceManager/src/V1/GetBranchRuleRequest.php create mode 100644 SecureSourceManager/src/V1/ListBranchRulesRequest.php create mode 100644 SecureSourceManager/src/V1/ListBranchRulesResponse.php create mode 100644 SecureSourceManager/src/V1/UpdateBranchRuleRequest.php diff --git a/SecureSourceManager/metadata/V1/SecureSourceManager.php b/SecureSourceManager/metadata/V1/SecureSourceManager.php index a5a3a2cde5fd977498dd55c2ee03a3f237994ed9..ce998e64e2ba268ced99505696b5ac159bc773c9 100644 GIT binary patch delta 1812 zcma)6&2QX99F^_e?d~|6-F2MUyW7yjg-x^yyXqDW4OJAUNf93*C=y=@l9}vI6BDm( z>~TtpstT@vR5T|<{{|>pi8HxXxzGx6AQGa7UVsCfk&qaBKgMe=+&nXHe!usg-*0|i zef;+Q6CroqL{?`L`iJBaUnjSP961qQ;~#AGN~vY8I=AmQ`xa`to`ape;70RC2sgSR zem%X&{nYEGzvsF8y+(GDyC}^A+4b87v@GW)>KOFa`>2h5H8UqH=GKJAI@i0JyOOH^ zngL+VgLeC1JFt*c0x27Ik;=_+1DI3Da!SrnSY^DuJ12?y#B-ok2Ei>>Wql!%hgpeM)H5={zWycH0U%$Z#RX$g|aR>~tDr zJEjl!EYwl6bUWLxLxppCVrE|pPa{Q@S&)ua zk_^tZ9UG$$G5fE4r3H%Y&ybB=Ew_A^`(6Kx1J4qelF5Wvm|%saT>`-(+0B>B&Am}x z{N_jfh2hck^!)sjOi9}X@{0(wtK`qAwF_*iJ>Y z4w21nbJ{JStRoAJ5v5|{_g|3DU)H{(ir#QLV~Vz;9O9&saIgkSmPe#eUr7bzY3j_d zj^WtWaU^>X^XGsVL>>AQ|1e$FNAE>+TRR5Im{R0#Bj2TSiKGoM5wpmrDF_EOvNNvb zo>UfEe^+}u@^4v1`jiL7(ov_f;F&(} zLXS?(QjAahoBqB}etbgsO>KpU(;E4@T5QDgwj7Uz^a}?H3C$9DFH<9bDJhw`ON|KM z1YC*OhljPX!@f(})|sB^vx_LKN+SwS#VJUq9LSFc{9}0`vGar4sInf~=9wP7tE0jv z)AQt;>SQfmxLLm~eNIhJCTU=LayvBrt*`!<=}O$~Sd1b%@3dZS9$gw6setParent($formattedParent) + ->setBranchRule($branchRule) + ->setBranchRuleId($branchRuleId); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $secureSourceManagerClient->createBranchRule($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var BranchRule $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $formattedParent = SecureSourceManagerClient::repositoryName( + '[PROJECT]', + '[LOCATION]', + '[REPOSITORY]' + ); + $branchRuleId = '[BRANCH_RULE_ID]'; + + create_branch_rule_sample($formattedParent, $branchRuleId); +} +// [END securesourcemanager_v1_generated_SecureSourceManager_CreateBranchRule_sync] diff --git a/SecureSourceManager/samples/V1/SecureSourceManagerClient/delete_branch_rule.php b/SecureSourceManager/samples/V1/SecureSourceManagerClient/delete_branch_rule.php new file mode 100644 index 000000000000..ea41d7e97423 --- /dev/null +++ b/SecureSourceManager/samples/V1/SecureSourceManagerClient/delete_branch_rule.php @@ -0,0 +1,84 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $secureSourceManagerClient->deleteBranchRule($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $formattedName = SecureSourceManagerClient::branchRuleName( + '[PROJECT]', + '[LOCATION]', + '[REPOSITORY]', + '[BRANCH_RULE]' + ); + + delete_branch_rule_sample($formattedName); +} +// [END securesourcemanager_v1_generated_SecureSourceManager_DeleteBranchRule_sync] diff --git a/SecureSourceManager/samples/V1/SecureSourceManagerClient/get_branch_rule.php b/SecureSourceManager/samples/V1/SecureSourceManagerClient/get_branch_rule.php new file mode 100644 index 000000000000..92d58064f39b --- /dev/null +++ b/SecureSourceManager/samples/V1/SecureSourceManagerClient/get_branch_rule.php @@ -0,0 +1,78 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var BranchRule $response */ + $response = $secureSourceManagerClient->getBranchRule($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 +{ + $formattedName = SecureSourceManagerClient::branchRuleName( + '[PROJECT]', + '[LOCATION]', + '[REPOSITORY]', + '[BRANCH_RULE]' + ); + + get_branch_rule_sample($formattedName); +} +// [END securesourcemanager_v1_generated_SecureSourceManager_GetBranchRule_sync] diff --git a/SecureSourceManager/samples/V1/SecureSourceManagerClient/list_branch_rules.php b/SecureSourceManager/samples/V1/SecureSourceManagerClient/list_branch_rules.php new file mode 100644 index 000000000000..22314e1df0b1 --- /dev/null +++ b/SecureSourceManager/samples/V1/SecureSourceManagerClient/list_branch_rules.php @@ -0,0 +1,79 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $secureSourceManagerClient->listBranchRules($request); + + /** @var BranchRule $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = SecureSourceManagerClient::repositoryName( + '[PROJECT]', + '[LOCATION]', + '[REPOSITORY]' + ); + + list_branch_rules_sample($formattedParent); +} +// [END securesourcemanager_v1_generated_SecureSourceManager_ListBranchRules_sync] diff --git a/SecureSourceManager/samples/V1/SecureSourceManagerClient/update_branch_rule.php b/SecureSourceManager/samples/V1/SecureSourceManagerClient/update_branch_rule.php new file mode 100644 index 000000000000..6baafcb1d6b8 --- /dev/null +++ b/SecureSourceManager/samples/V1/SecureSourceManagerClient/update_branch_rule.php @@ -0,0 +1,74 @@ +setBranchRule($branchRule) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $secureSourceManagerClient->updateBranchRule($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var BranchRule $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END securesourcemanager_v1_generated_SecureSourceManager_UpdateBranchRule_sync] diff --git a/SecureSourceManager/src/V1/BranchRule.php b/SecureSourceManager/src/V1/BranchRule.php new file mode 100644 index 000000000000..8bb18a7dca9a --- /dev/null +++ b/SecureSourceManager/src/V1/BranchRule.php @@ -0,0 +1,620 @@ +google.cloud.securesourcemanager.v1.BranchRule + */ +class BranchRule extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. A unique identifier for a BranchRule. The name should be of the + * format: + * `projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $name = ''; + /** + * Output only. Unique identifier of the repository. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + /** + * Output only. Create timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Update timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Optional. User annotations. These attributes can only be set and used by + * the user. See https://google.aip.dev/128#annotations for more details such + * as format and size limitations. + * + * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $annotations; + /** + * Optional. This checksum is computed by the server based on the value of + * other fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + /** + * Optional. The pattern of the branch that can match to this BranchRule. + * Specified as regex. + * .* for all branches. Examples: main, (main|release.*). + * Current MVP phase only support `.*` for wildcard. + * + * Generated from protobuf field string include_pattern = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $include_pattern = ''; + /** + * Optional. Determines if the branch rule is disabled or not. + * + * Generated from protobuf field bool disabled = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $disabled = false; + /** + * Optional. Determines if the branch rule requires a pull request or not. + * + * Generated from protobuf field bool require_pull_request = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $require_pull_request = false; + /** + * Optional. The minimum number of reviews required for the branch rule to be + * matched. + * + * Generated from protobuf field int32 minimum_reviews_count = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $minimum_reviews_count = 0; + /** + * Optional. The minimum number of approvals required for the branch rule to + * be matched. + * + * Generated from protobuf field int32 minimum_approvals_count = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $minimum_approvals_count = 0; + /** + * Optional. Determines if require comments resolved before merging to the + * branch. + * + * Generated from protobuf field bool require_comments_resolved = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $require_comments_resolved = false; + /** + * Optional. Determines if allow stale reviews or approvals before merging to + * the branch. + * + * Generated from protobuf field bool allow_stale_reviews = 15 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $allow_stale_reviews = false; + /** + * Optional. Determines if require linear history before merging to the + * branch. + * + * Generated from protobuf field bool require_linear_history = 13 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $require_linear_history = false; + /** + * Optional. List of required status checks before merging to the branch. + * + * Generated from protobuf field repeated .google.cloud.securesourcemanager.v1.BranchRule.Check required_status_checks = 14 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $required_status_checks; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Optional. A unique identifier for a BranchRule. The name should be of the + * format: + * `projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}` + * @type string $uid + * Output only. Unique identifier of the repository. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Create timestamp. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Update timestamp. + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Optional. User annotations. These attributes can only be set and used by + * the user. See https://google.aip.dev/128#annotations for more details such + * as format and size limitations. + * @type string $etag + * Optional. This checksum is computed by the server based on the value of + * other fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * @type string $include_pattern + * Optional. The pattern of the branch that can match to this BranchRule. + * Specified as regex. + * .* for all branches. Examples: main, (main|release.*). + * Current MVP phase only support `.*` for wildcard. + * @type bool $disabled + * Optional. Determines if the branch rule is disabled or not. + * @type bool $require_pull_request + * Optional. Determines if the branch rule requires a pull request or not. + * @type int $minimum_reviews_count + * Optional. The minimum number of reviews required for the branch rule to be + * matched. + * @type int $minimum_approvals_count + * Optional. The minimum number of approvals required for the branch rule to + * be matched. + * @type bool $require_comments_resolved + * Optional. Determines if require comments resolved before merging to the + * branch. + * @type bool $allow_stale_reviews + * Optional. Determines if allow stale reviews or approvals before merging to + * the branch. + * @type bool $require_linear_history + * Optional. Determines if require linear history before merging to the + * branch. + * @type array<\Google\Cloud\SecureSourceManager\V1\BranchRule\Check>|\Google\Protobuf\Internal\RepeatedField $required_status_checks + * Optional. List of required status checks before merging to the branch. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Securesourcemanager\V1\SecureSourceManager::initOnce(); + parent::__construct($data); + } + + /** + * Optional. A unique identifier for a BranchRule. The name should be of the + * format: + * `projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Optional. A unique identifier for a BranchRule. The name should be of the + * format: + * `projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Unique identifier of the repository. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. Unique identifier of the repository. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Output only. Create timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. Create timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Update timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. Update timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Optional. User annotations. These attributes can only be set and used by + * the user. See https://google.aip.dev/128#annotations for more details such + * as format and size limitations. + * + * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Optional. User annotations. These attributes can only be set and used by + * the user. See https://google.aip.dev/128#annotations for more details such + * as format and size limitations. + * + * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Optional. This checksum is computed by the server based on the value of + * other fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. This checksum is computed by the server based on the value of + * other fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Optional. The pattern of the branch that can match to this BranchRule. + * Specified as regex. + * .* for all branches. Examples: main, (main|release.*). + * Current MVP phase only support `.*` for wildcard. + * + * Generated from protobuf field string include_pattern = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getIncludePattern() + { + return $this->include_pattern; + } + + /** + * Optional. The pattern of the branch that can match to this BranchRule. + * Specified as regex. + * .* for all branches. Examples: main, (main|release.*). + * Current MVP phase only support `.*` for wildcard. + * + * Generated from protobuf field string include_pattern = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setIncludePattern($var) + { + GPBUtil::checkString($var, True); + $this->include_pattern = $var; + + return $this; + } + + /** + * Optional. Determines if the branch rule is disabled or not. + * + * Generated from protobuf field bool disabled = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getDisabled() + { + return $this->disabled; + } + + /** + * Optional. Determines if the branch rule is disabled or not. + * + * Generated from protobuf field bool disabled = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setDisabled($var) + { + GPBUtil::checkBool($var); + $this->disabled = $var; + + return $this; + } + + /** + * Optional. Determines if the branch rule requires a pull request or not. + * + * Generated from protobuf field bool require_pull_request = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getRequirePullRequest() + { + return $this->require_pull_request; + } + + /** + * Optional. Determines if the branch rule requires a pull request or not. + * + * Generated from protobuf field bool require_pull_request = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setRequirePullRequest($var) + { + GPBUtil::checkBool($var); + $this->require_pull_request = $var; + + return $this; + } + + /** + * Optional. The minimum number of reviews required for the branch rule to be + * matched. + * + * Generated from protobuf field int32 minimum_reviews_count = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMinimumReviewsCount() + { + return $this->minimum_reviews_count; + } + + /** + * Optional. The minimum number of reviews required for the branch rule to be + * matched. + * + * Generated from protobuf field int32 minimum_reviews_count = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMinimumReviewsCount($var) + { + GPBUtil::checkInt32($var); + $this->minimum_reviews_count = $var; + + return $this; + } + + /** + * Optional. The minimum number of approvals required for the branch rule to + * be matched. + * + * Generated from protobuf field int32 minimum_approvals_count = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMinimumApprovalsCount() + { + return $this->minimum_approvals_count; + } + + /** + * Optional. The minimum number of approvals required for the branch rule to + * be matched. + * + * Generated from protobuf field int32 minimum_approvals_count = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMinimumApprovalsCount($var) + { + GPBUtil::checkInt32($var); + $this->minimum_approvals_count = $var; + + return $this; + } + + /** + * Optional. Determines if require comments resolved before merging to the + * branch. + * + * Generated from protobuf field bool require_comments_resolved = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getRequireCommentsResolved() + { + return $this->require_comments_resolved; + } + + /** + * Optional. Determines if require comments resolved before merging to the + * branch. + * + * Generated from protobuf field bool require_comments_resolved = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setRequireCommentsResolved($var) + { + GPBUtil::checkBool($var); + $this->require_comments_resolved = $var; + + return $this; + } + + /** + * Optional. Determines if allow stale reviews or approvals before merging to + * the branch. + * + * Generated from protobuf field bool allow_stale_reviews = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowStaleReviews() + { + return $this->allow_stale_reviews; + } + + /** + * Optional. Determines if allow stale reviews or approvals before merging to + * the branch. + * + * Generated from protobuf field bool allow_stale_reviews = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowStaleReviews($var) + { + GPBUtil::checkBool($var); + $this->allow_stale_reviews = $var; + + return $this; + } + + /** + * Optional. Determines if require linear history before merging to the + * branch. + * + * Generated from protobuf field bool require_linear_history = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getRequireLinearHistory() + { + return $this->require_linear_history; + } + + /** + * Optional. Determines if require linear history before merging to the + * branch. + * + * Generated from protobuf field bool require_linear_history = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setRequireLinearHistory($var) + { + GPBUtil::checkBool($var); + $this->require_linear_history = $var; + + return $this; + } + + /** + * Optional. List of required status checks before merging to the branch. + * + * Generated from protobuf field repeated .google.cloud.securesourcemanager.v1.BranchRule.Check required_status_checks = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRequiredStatusChecks() + { + return $this->required_status_checks; + } + + /** + * Optional. List of required status checks before merging to the branch. + * + * Generated from protobuf field repeated .google.cloud.securesourcemanager.v1.BranchRule.Check required_status_checks = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\SecureSourceManager\V1\BranchRule\Check>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRequiredStatusChecks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\SecureSourceManager\V1\BranchRule\Check::class); + $this->required_status_checks = $arr; + + return $this; + } + +} + diff --git a/SecureSourceManager/src/V1/BranchRule/Check.php b/SecureSourceManager/src/V1/BranchRule/Check.php new file mode 100644 index 000000000000..f222c46b9575 --- /dev/null +++ b/SecureSourceManager/src/V1/BranchRule/Check.php @@ -0,0 +1,68 @@ +google.cloud.securesourcemanager.v1.BranchRule.Check + */ +class Check extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The context of the check. + * + * Generated from protobuf field string context = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $context = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $context + * Required. The context of the check. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Securesourcemanager\V1\SecureSourceManager::initOnce(); + parent::__construct($data); + } + + /** + * Required. The context of the check. + * + * Generated from protobuf field string context = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getContext() + { + return $this->context; + } + + /** + * Required. The context of the check. + * + * Generated from protobuf field string context = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setContext($var) + { + GPBUtil::checkString($var, True); + $this->context = $var; + + return $this; + } + +} + + diff --git a/SecureSourceManager/src/V1/Client/SecureSourceManagerClient.php b/SecureSourceManager/src/V1/Client/SecureSourceManagerClient.php index aea6eda4a9e4..74d9b8633cd0 100644 --- a/SecureSourceManager/src/V1/Client/SecureSourceManagerClient.php +++ b/SecureSourceManager/src/V1/Client/SecureSourceManagerClient.php @@ -42,16 +42,22 @@ use Google\Cloud\Location\GetLocationRequest; use Google\Cloud\Location\ListLocationsRequest; use Google\Cloud\Location\Location; +use Google\Cloud\SecureSourceManager\V1\BranchRule; +use Google\Cloud\SecureSourceManager\V1\CreateBranchRuleRequest; use Google\Cloud\SecureSourceManager\V1\CreateInstanceRequest; use Google\Cloud\SecureSourceManager\V1\CreateRepositoryRequest; +use Google\Cloud\SecureSourceManager\V1\DeleteBranchRuleRequest; use Google\Cloud\SecureSourceManager\V1\DeleteInstanceRequest; use Google\Cloud\SecureSourceManager\V1\DeleteRepositoryRequest; +use Google\Cloud\SecureSourceManager\V1\GetBranchRuleRequest; use Google\Cloud\SecureSourceManager\V1\GetInstanceRequest; use Google\Cloud\SecureSourceManager\V1\GetRepositoryRequest; use Google\Cloud\SecureSourceManager\V1\Instance; +use Google\Cloud\SecureSourceManager\V1\ListBranchRulesRequest; use Google\Cloud\SecureSourceManager\V1\ListInstancesRequest; use Google\Cloud\SecureSourceManager\V1\ListRepositoriesRequest; use Google\Cloud\SecureSourceManager\V1\Repository; +use Google\Cloud\SecureSourceManager\V1\UpdateBranchRuleRequest; use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; @@ -86,17 +92,22 @@ * name, and additionally a parseName method to extract the individual identifiers * contained within formatted names that are returned by the API. * + * @method PromiseInterface createBranchRuleAsync(CreateBranchRuleRequest $request, array $optionalArgs = []) * @method PromiseInterface createInstanceAsync(CreateInstanceRequest $request, array $optionalArgs = []) * @method PromiseInterface createRepositoryAsync(CreateRepositoryRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteBranchRuleAsync(DeleteBranchRuleRequest $request, array $optionalArgs = []) * @method PromiseInterface deleteInstanceAsync(DeleteInstanceRequest $request, array $optionalArgs = []) * @method PromiseInterface deleteRepositoryAsync(DeleteRepositoryRequest $request, array $optionalArgs = []) + * @method PromiseInterface getBranchRuleAsync(GetBranchRuleRequest $request, array $optionalArgs = []) * @method PromiseInterface getIamPolicyRepoAsync(GetIamPolicyRequest $request, array $optionalArgs = []) * @method PromiseInterface getInstanceAsync(GetInstanceRequest $request, array $optionalArgs = []) * @method PromiseInterface getRepositoryAsync(GetRepositoryRequest $request, array $optionalArgs = []) + * @method PromiseInterface listBranchRulesAsync(ListBranchRulesRequest $request, array $optionalArgs = []) * @method PromiseInterface listInstancesAsync(ListInstancesRequest $request, array $optionalArgs = []) * @method PromiseInterface listRepositoriesAsync(ListRepositoriesRequest $request, array $optionalArgs = []) * @method PromiseInterface setIamPolicyRepoAsync(SetIamPolicyRequest $request, array $optionalArgs = []) * @method PromiseInterface testIamPermissionsRepoAsync(TestIamPermissionsRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateBranchRuleAsync(UpdateBranchRuleRequest $request, array $optionalArgs = []) * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = []) * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = []) * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRequest $request, array $optionalArgs = []) @@ -201,6 +212,31 @@ private function createOperationsClient(array $options) return new OperationsClient($options); } + /** + * Formats a string containing the fully-qualified path to represent a branch_rule + * resource. + * + * @param string $project + * @param string $location + * @param string $repository + * @param string $branchRule + * + * @return string The formatted branch_rule resource. + */ + public static function branchRuleName( + string $project, + string $location, + string $repository, + string $branchRule + ): string { + return self::getPathTemplate('branchRule')->render([ + 'project' => $project, + 'location' => $location, + 'repository' => $repository, + 'branch_rule' => $branchRule, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a ca_pool * resource. @@ -319,6 +355,7 @@ public static function serviceAttachmentName(string $project, string $region, st * Parses a formatted name string and returns an associative array of the components in the name. * The following name formats are supported: * Template: Pattern + * - branchRule: projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule} * - caPool: projects/{project}/locations/{location}/caPools/{ca_pool} * - cryptoKey: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key} * - instance: projects/{project}/locations/{location}/instances/{instance} @@ -416,6 +453,32 @@ public function __call($method, $args) return call_user_func_array([$this, 'startAsyncCall'], $args); } + /** + * CreateBranchRule creates a branch rule in a given repository. + * + * The async variant is {@see SecureSourceManagerClient::createBranchRuleAsync()} . + * + * @example samples/V1/SecureSourceManagerClient/create_branch_rule.php + * + * @param CreateBranchRuleRequest $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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createBranchRule(CreateBranchRuleRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateBranchRule', $request, $callOptions)->wait(); + } + /** * Creates a new instance in a given project and location. * @@ -470,6 +533,32 @@ public function createRepository(CreateRepositoryRequest $request, array $callOp return $this->startApiCall('CreateRepository', $request, $callOptions)->wait(); } + /** + * DeleteBranchRule deletes a branch rule. + * + * The async variant is {@see SecureSourceManagerClient::deleteBranchRuleAsync()} . + * + * @example samples/V1/SecureSourceManagerClient/delete_branch_rule.php + * + * @param DeleteBranchRuleRequest $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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteBranchRule(DeleteBranchRuleRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteBranchRule', $request, $callOptions)->wait(); + } + /** * Deletes a single instance. * @@ -524,6 +613,32 @@ public function deleteRepository(DeleteRepositoryRequest $request, array $callOp return $this->startApiCall('DeleteRepository', $request, $callOptions)->wait(); } + /** + * GetBranchRule gets a branch rule. + * + * The async variant is {@see SecureSourceManagerClient::getBranchRuleAsync()} . + * + * @example samples/V1/SecureSourceManagerClient/get_branch_rule.php + * + * @param GetBranchRuleRequest $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 BranchRule + * + * @throws ApiException Thrown if the API call fails. + */ + public function getBranchRule(GetBranchRuleRequest $request, array $callOptions = []): BranchRule + { + return $this->startApiCall('GetBranchRule', $request, $callOptions)->wait(); + } + /** * Get IAM policy for a repository. * @@ -604,6 +719,32 @@ public function getRepository(GetRepositoryRequest $request, array $callOptions return $this->startApiCall('GetRepository', $request, $callOptions)->wait(); } + /** + * ListBranchRules lists branch rules in a given repository. + * + * The async variant is {@see SecureSourceManagerClient::listBranchRulesAsync()} . + * + * @example samples/V1/SecureSourceManagerClient/list_branch_rules.php + * + * @param ListBranchRulesRequest $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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listBranchRules(ListBranchRulesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListBranchRules', $request, $callOptions); + } + /** * Lists Instances in a given project and location. * @@ -714,6 +855,32 @@ public function testIamPermissionsRepo( return $this->startApiCall('TestIamPermissionsRepo', $request, $callOptions)->wait(); } + /** + * UpdateBranchRule updates a branch rule. + * + * The async variant is {@see SecureSourceManagerClient::updateBranchRuleAsync()} . + * + * @example samples/V1/SecureSourceManagerClient/update_branch_rule.php + * + * @param UpdateBranchRuleRequest $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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateBranchRule(UpdateBranchRuleRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateBranchRule', $request, $callOptions)->wait(); + } + /** * Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. diff --git a/SecureSourceManager/src/V1/CreateBranchRuleRequest.php b/SecureSourceManager/src/V1/CreateBranchRuleRequest.php new file mode 100644 index 000000000000..2afd8aa99c0e --- /dev/null +++ b/SecureSourceManager/src/V1/CreateBranchRuleRequest.php @@ -0,0 +1,141 @@ +google.cloud.securesourcemanager.v1.CreateBranchRuleRequest + */ +class CreateBranchRuleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Generated from protobuf field .google.cloud.securesourcemanager.v1.BranchRule branch_rule = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $branch_rule = null; + /** + * Generated from protobuf field string branch_rule_id = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $branch_rule_id = ''; + + /** + * @param string $parent Please see {@see SecureSourceManagerClient::repositoryName()} for help formatting this field. + * @param \Google\Cloud\SecureSourceManager\V1\BranchRule $branchRule + * @param string $branchRuleId + * + * @return \Google\Cloud\SecureSourceManager\V1\CreateBranchRuleRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\SecureSourceManager\V1\BranchRule $branchRule, string $branchRuleId): self + { + return (new self()) + ->setParent($parent) + ->setBranchRule($branchRule) + ->setBranchRuleId($branchRuleId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * @type \Google\Cloud\SecureSourceManager\V1\BranchRule $branch_rule + * @type string $branch_rule_id + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Securesourcemanager\V1\SecureSourceManager::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Generated from protobuf field .google.cloud.securesourcemanager.v1.BranchRule branch_rule = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\SecureSourceManager\V1\BranchRule|null + */ + public function getBranchRule() + { + return $this->branch_rule; + } + + public function hasBranchRule() + { + return isset($this->branch_rule); + } + + public function clearBranchRule() + { + unset($this->branch_rule); + } + + /** + * Generated from protobuf field .google.cloud.securesourcemanager.v1.BranchRule branch_rule = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\SecureSourceManager\V1\BranchRule $var + * @return $this + */ + public function setBranchRule($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\SecureSourceManager\V1\BranchRule::class); + $this->branch_rule = $var; + + return $this; + } + + /** + * Generated from protobuf field string branch_rule_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBranchRuleId() + { + return $this->branch_rule_id; + } + + /** + * Generated from protobuf field string branch_rule_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBranchRuleId($var) + { + GPBUtil::checkString($var, True); + $this->branch_rule_id = $var; + + return $this; + } + +} + diff --git a/SecureSourceManager/src/V1/DeleteBranchRuleRequest.php b/SecureSourceManager/src/V1/DeleteBranchRuleRequest.php new file mode 100644 index 000000000000..e69e241dd971 --- /dev/null +++ b/SecureSourceManager/src/V1/DeleteBranchRuleRequest.php @@ -0,0 +1,111 @@ +google.cloud.securesourcemanager.v1.DeleteBranchRuleRequest + */ +class DeleteBranchRuleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. If set to true, and the branch rule is not found, the request + * will succeed but no action will be taken on the server. + * + * Generated from protobuf field bool allow_missing = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $allow_missing = false; + + /** + * @param string $name Please see {@see SecureSourceManagerClient::branchRuleName()} for help formatting this field. + * + * @return \Google\Cloud\SecureSourceManager\V1\DeleteBranchRuleRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * @type bool $allow_missing + * Optional. If set to true, and the branch rule is not found, the request + * will succeed but no action will be taken on the server. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Securesourcemanager\V1\SecureSourceManager::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. If set to true, and the branch rule is not found, the request + * will succeed but no action will be taken on the server. + * + * Generated from protobuf field bool allow_missing = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * Optional. If set to true, and the branch rule is not found, the request + * will succeed but no action will be taken on the server. + * + * Generated from protobuf field bool allow_missing = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + +} + diff --git a/SecureSourceManager/src/V1/GetBranchRuleRequest.php b/SecureSourceManager/src/V1/GetBranchRuleRequest.php new file mode 100644 index 000000000000..99448568e4c7 --- /dev/null +++ b/SecureSourceManager/src/V1/GetBranchRuleRequest.php @@ -0,0 +1,91 @@ +google.cloud.securesourcemanager.v1.GetBranchRuleRequest + */ +class GetBranchRuleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the repository to retrieve. + * The format is + * `projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the repository to retrieve. + * The format is + * `projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}`. Please see + * {@see SecureSourceManagerClient::branchRuleName()} for help formatting this field. + * + * @return \Google\Cloud\SecureSourceManager\V1\GetBranchRuleRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the repository to retrieve. + * The format is + * `projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Securesourcemanager\V1\SecureSourceManager::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the repository to retrieve. + * The format is + * `projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the repository to retrieve. + * The format is + * `projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/SecureSourceManager/src/V1/Instance/PrivateConfig.php b/SecureSourceManager/src/V1/Instance/PrivateConfig.php index e3d8cec08fb0..23b157197bd8 100644 --- a/SecureSourceManager/src/V1/Instance/PrivateConfig.php +++ b/SecureSourceManager/src/V1/Instance/PrivateConfig.php @@ -42,6 +42,14 @@ class PrivateConfig extends \Google\Protobuf\Internal\Message * Generated from protobuf field string ssh_service_attachment = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ protected $ssh_service_attachment = ''; + /** + * Optional. Additional allowed projects for setting up PSC connections. + * Instance host project is automatically allowed and does not need to be + * included in this list. + * + * Generated from protobuf field repeated string psc_allowed_projects = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $psc_allowed_projects; /** * Constructor. @@ -60,6 +68,10 @@ class PrivateConfig extends \Google\Protobuf\Internal\Message * @type string $ssh_service_attachment * Output only. Service Attachment for SSH, resource is in the format of * `projects/{project}/regions/{region}/serviceAttachments/{service_attachment}`. + * @type array|\Google\Protobuf\Internal\RepeatedField $psc_allowed_projects + * Optional. Additional allowed projects for setting up PSC connections. + * Instance host project is automatically allowed and does not need to be + * included in this list. * } */ public function __construct($data = NULL) { @@ -177,6 +189,36 @@ public function setSshServiceAttachment($var) return $this; } + /** + * Optional. Additional allowed projects for setting up PSC connections. + * Instance host project is automatically allowed and does not need to be + * included in this list. + * + * Generated from protobuf field repeated string psc_allowed_projects = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPscAllowedProjects() + { + return $this->psc_allowed_projects; + } + + /** + * Optional. Additional allowed projects for setting up PSC connections. + * Instance host project is automatically allowed and does not need to be + * included in this list. + * + * Generated from protobuf field repeated string psc_allowed_projects = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPscAllowedProjects($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->psc_allowed_projects = $arr; + + return $this; + } + } diff --git a/SecureSourceManager/src/V1/ListBranchRulesRequest.php b/SecureSourceManager/src/V1/ListBranchRulesRequest.php new file mode 100644 index 000000000000..209d3240ebb7 --- /dev/null +++ b/SecureSourceManager/src/V1/ListBranchRulesRequest.php @@ -0,0 +1,127 @@ +google.cloud.securesourcemanager.v1.ListBranchRulesRequest + */ +class ListBranchRulesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Please see {@see SecureSourceManagerClient::repositoryName()} for help formatting this field. + * + * @return \Google\Cloud\SecureSourceManager\V1\ListBranchRulesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * @type int $page_size + * @type string $page_token + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Securesourcemanager\V1\SecureSourceManager::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/SecureSourceManager/src/V1/ListBranchRulesResponse.php b/SecureSourceManager/src/V1/ListBranchRulesResponse.php new file mode 100644 index 000000000000..f0b2969182dd --- /dev/null +++ b/SecureSourceManager/src/V1/ListBranchRulesResponse.php @@ -0,0 +1,101 @@ +google.cloud.securesourcemanager.v1.ListBranchRulesResponse + */ +class ListBranchRulesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of branch rules. + * + * Generated from protobuf field repeated .google.cloud.securesourcemanager.v1.BranchRule branch_rules = 1; + */ + private $branch_rules; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\SecureSourceManager\V1\BranchRule>|\Google\Protobuf\Internal\RepeatedField $branch_rules + * The list of branch rules. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Securesourcemanager\V1\SecureSourceManager::initOnce(); + parent::__construct($data); + } + + /** + * The list of branch rules. + * + * Generated from protobuf field repeated .google.cloud.securesourcemanager.v1.BranchRule branch_rules = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBranchRules() + { + return $this->branch_rules; + } + + /** + * The list of branch rules. + * + * Generated from protobuf field repeated .google.cloud.securesourcemanager.v1.BranchRule branch_rules = 1; + * @param array<\Google\Cloud\SecureSourceManager\V1\BranchRule>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBranchRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\SecureSourceManager\V1\BranchRule::class); + $this->branch_rules = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/SecureSourceManager/src/V1/Repository.php b/SecureSourceManager/src/V1/Repository.php index c43a041a3fff..114d1759a1fa 100644 --- a/SecureSourceManager/src/V1/Repository.php +++ b/SecureSourceManager/src/V1/Repository.php @@ -36,9 +36,8 @@ class Repository extends \Google\Protobuf\Internal\Message * `projects/{project_number}/locations/{location_id}/instances/{instance_id}` * When creating repository via * securesourcemanager.googleapis.com (Control Plane API), this field is used - * as input. - * When creating repository via *.sourcemanager.dev (Data Plane API), this - * field is output only. + * as input. When creating repository via *.sourcemanager.dev (Data Plane + * API), this field is output only. * * Generated from protobuf field string instance = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { */ @@ -101,9 +100,8 @@ class Repository extends \Google\Protobuf\Internal\Message * `projects/{project_number}/locations/{location_id}/instances/{instance_id}` * When creating repository via * securesourcemanager.googleapis.com (Control Plane API), this field is used - * as input. - * When creating repository via *.sourcemanager.dev (Data Plane API), this - * field is output only. + * as input. When creating repository via *.sourcemanager.dev (Data Plane + * API), this field is output only. * @type string $uid * Output only. Unique identifier of the repository. * @type \Google\Protobuf\Timestamp $create_time @@ -189,9 +187,8 @@ public function setDescription($var) * `projects/{project_number}/locations/{location_id}/instances/{instance_id}` * When creating repository via * securesourcemanager.googleapis.com (Control Plane API), this field is used - * as input. - * When creating repository via *.sourcemanager.dev (Data Plane API), this - * field is output only. + * as input. When creating repository via *.sourcemanager.dev (Data Plane + * API), this field is output only. * * Generated from protobuf field string instance = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { * @return string @@ -207,9 +204,8 @@ public function getInstance() * `projects/{project_number}/locations/{location_id}/instances/{instance_id}` * When creating repository via * securesourcemanager.googleapis.com (Control Plane API), this field is used - * as input. - * When creating repository via *.sourcemanager.dev (Data Plane API), this - * field is output only. + * as input. When creating repository via *.sourcemanager.dev (Data Plane + * API), this field is output only. * * Generated from protobuf field string instance = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { * @param string $var diff --git a/SecureSourceManager/src/V1/UpdateBranchRuleRequest.php b/SecureSourceManager/src/V1/UpdateBranchRuleRequest.php new file mode 100644 index 000000000000..be3e12441d0a --- /dev/null +++ b/SecureSourceManager/src/V1/UpdateBranchRuleRequest.php @@ -0,0 +1,187 @@ +google.cloud.securesourcemanager.v1.UpdateBranchRuleRequest + */ +class UpdateBranchRuleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field .google.cloud.securesourcemanager.v1.BranchRule branch_rule = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $branch_rule = null; + /** + * Optional. If set, validate the request and preview the review, but do not + * actually post it. (https://google.aip.dev/163, for declarative friendly) + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * branchRule resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. + * The special value "*" means full replacement. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\SecureSourceManager\V1\BranchRule $branchRule + * @param \Google\Protobuf\FieldMask $updateMask Required. Field mask is used to specify the fields to be overwritten in the + * branchRule resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. + * The special value "*" means full replacement. + * + * @return \Google\Cloud\SecureSourceManager\V1\UpdateBranchRuleRequest + * + * @experimental + */ + public static function build(\Google\Cloud\SecureSourceManager\V1\BranchRule $branchRule, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setBranchRule($branchRule) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\SecureSourceManager\V1\BranchRule $branch_rule + * @type bool $validate_only + * Optional. If set, validate the request and preview the review, but do not + * actually post it. (https://google.aip.dev/163, for declarative friendly) + * @type \Google\Protobuf\FieldMask $update_mask + * Required. Field mask is used to specify the fields to be overwritten in the + * branchRule resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. + * The special value "*" means full replacement. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Securesourcemanager\V1\SecureSourceManager::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field .google.cloud.securesourcemanager.v1.BranchRule branch_rule = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\SecureSourceManager\V1\BranchRule|null + */ + public function getBranchRule() + { + return $this->branch_rule; + } + + public function hasBranchRule() + { + return isset($this->branch_rule); + } + + public function clearBranchRule() + { + unset($this->branch_rule); + } + + /** + * Generated from protobuf field .google.cloud.securesourcemanager.v1.BranchRule branch_rule = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\SecureSourceManager\V1\BranchRule $var + * @return $this + */ + public function setBranchRule($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\SecureSourceManager\V1\BranchRule::class); + $this->branch_rule = $var; + + return $this; + } + + /** + * Optional. If set, validate the request and preview the review, but do not + * actually post it. (https://google.aip.dev/163, for declarative friendly) + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, validate the request and preview the review, but do not + * actually post it. (https://google.aip.dev/163, for declarative friendly) + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * branchRule resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. + * The special value "*" means full replacement. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * branchRule resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. + * The special value "*" means full replacement. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/SecureSourceManager/src/V1/gapic_metadata.json b/SecureSourceManager/src/V1/gapic_metadata.json index af0aaf0c1662..765eced17b9b 100644 --- a/SecureSourceManager/src/V1/gapic_metadata.json +++ b/SecureSourceManager/src/V1/gapic_metadata.json @@ -10,6 +10,11 @@ "grpc": { "libraryClient": "SecureSourceManagerGapicClient", "rpcs": { + "CreateBranchRule": { + "methods": [ + "createBranchRule" + ] + }, "CreateInstance": { "methods": [ "createInstance" @@ -20,6 +25,11 @@ "createRepository" ] }, + "DeleteBranchRule": { + "methods": [ + "deleteBranchRule" + ] + }, "DeleteInstance": { "methods": [ "deleteInstance" @@ -30,6 +40,11 @@ "deleteRepository" ] }, + "GetBranchRule": { + "methods": [ + "getBranchRule" + ] + }, "GetIamPolicyRepo": { "methods": [ "getIamPolicyRepo" @@ -45,6 +60,11 @@ "getRepository" ] }, + "ListBranchRules": { + "methods": [ + "listBranchRules" + ] + }, "ListInstances": { "methods": [ "listInstances" @@ -65,6 +85,11 @@ "testIamPermissionsRepo" ] }, + "UpdateBranchRule": { + "methods": [ + "updateBranchRule" + ] + }, "GetIamPolicy": { "methods": [ "getIamPolicy" diff --git a/SecureSourceManager/src/V1/resources/secure_source_manager_client_config.json b/SecureSourceManager/src/V1/resources/secure_source_manager_client_config.json index ad14bc6042a2..deeb50b01083 100644 --- a/SecureSourceManager/src/V1/resources/secure_source_manager_client_config.json +++ b/SecureSourceManager/src/V1/resources/secure_source_manager_client_config.json @@ -28,6 +28,11 @@ } }, "methods": { + "CreateBranchRule": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, "CreateInstance": { "timeout_millis": 60000, "retry_codes_name": "no_retry_codes", @@ -38,6 +43,11 @@ "retry_codes_name": "no_retry_codes", "retry_params_name": "no_retry_params" }, + "DeleteBranchRule": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, "DeleteInstance": { "timeout_millis": 60000, "retry_codes_name": "no_retry_codes", @@ -48,6 +58,11 @@ "retry_codes_name": "no_retry_codes", "retry_params_name": "no_retry_params" }, + "GetBranchRule": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, "GetIamPolicyRepo": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", @@ -63,6 +78,11 @@ "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "ListBranchRules": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, "ListInstances": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", @@ -83,6 +103,11 @@ "retry_codes_name": "no_retry_codes", "retry_params_name": "no_retry_params" }, + "UpdateBranchRule": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, "GetIamPolicy": { "timeout_millis": 60000, "retry_codes_name": "no_retry_codes", diff --git a/SecureSourceManager/src/V1/resources/secure_source_manager_descriptor_config.php b/SecureSourceManager/src/V1/resources/secure_source_manager_descriptor_config.php index 4f4cb90c3153..30aede09a29d 100644 --- a/SecureSourceManager/src/V1/resources/secure_source_manager_descriptor_config.php +++ b/SecureSourceManager/src/V1/resources/secure_source_manager_descriptor_config.php @@ -23,6 +23,25 @@ return [ 'interfaces' => [ 'google.cloud.securesourcemanager.v1.SecureSourceManager' => [ + 'CreateBranchRule' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\SecureSourceManager\V1\BranchRule', + 'metadataReturnType' => '\Google\Cloud\SecureSourceManager\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'CreateInstance' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Cloud\SecureSourceManager\V1\Instance', @@ -61,6 +80,25 @@ ], ], ], + 'DeleteBranchRule' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\SecureSourceManager\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'DeleteInstance' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Protobuf\GPBEmpty', @@ -99,6 +137,38 @@ ], ], ], + 'UpdateBranchRule' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\SecureSourceManager\V1\BranchRule', + 'metadataReturnType' => '\Google\Cloud\SecureSourceManager\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'branch_rule.name', + 'fieldAccessors' => [ + 'getBranchRule', + 'getName', + ], + ], + ], + ], + 'GetBranchRule' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\SecureSourceManager\V1\BranchRule', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'GetIamPolicyRepo' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\Iam\V1\Policy', @@ -135,6 +205,26 @@ ], ], ], + 'ListBranchRules' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getBranchRules', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\SecureSourceManager\V1\ListBranchRulesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'ListInstances' => [ 'pageStreaming' => [ 'requestPageTokenGetMethod' => 'getPageToken', @@ -273,6 +363,7 @@ 'interfaceOverride' => 'google.cloud.location.Locations', ], 'templateMap' => [ + 'branchRule' => 'projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}', 'caPool' => 'projects/{project}/locations/{location}/caPools/{ca_pool}', 'cryptoKey' => 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}', 'instance' => 'projects/{project}/locations/{location}/instances/{instance}', diff --git a/SecureSourceManager/src/V1/resources/secure_source_manager_rest_client_config.php b/SecureSourceManager/src/V1/resources/secure_source_manager_rest_client_config.php index 75f081095832..38d22efe24dc 100644 --- a/SecureSourceManager/src/V1/resources/secure_source_manager_rest_client_config.php +++ b/SecureSourceManager/src/V1/resources/secure_source_manager_rest_client_config.php @@ -47,6 +47,21 @@ ], ], 'google.cloud.securesourcemanager.v1.SecureSourceManager' => [ + 'CreateBranchRule' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/repositories/*}/branchRules', + 'body' => 'branch_rule', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'branch_rule_id', + ], + ], 'CreateInstance' => [ 'method' => 'post', 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/instances', @@ -77,6 +92,17 @@ 'repository_id', ], ], + 'DeleteBranchRule' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/repositories/*/branchRules/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'DeleteInstance' => [ 'method' => 'delete', 'uriTemplate' => '/v1/{name=projects/*/locations/*/instances/*}', @@ -99,6 +125,17 @@ ], ], ], + 'GetBranchRule' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/repositories/*/branchRules/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetIamPolicyRepo' => [ 'method' => 'get', 'uriTemplate' => '/v1/{resource=projects/*/locations/*/repositories/*}:getIamPolicy', @@ -132,6 +169,17 @@ ], ], ], + 'ListBranchRules' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/repositories/*}/branchRules', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'ListInstances' => [ 'method' => 'get', 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/instances', @@ -178,6 +226,22 @@ ], ], ], + 'UpdateBranchRule' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{branch_rule.name=projects/*/locations/*/repositories/*/branchRules/*}', + 'body' => 'branch_rule', + 'placeholders' => [ + 'branch_rule.name' => [ + 'getters' => [ + 'getBranchRule', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], ], 'google.iam.v1.IAMPolicy' => [ 'GetIamPolicy' => [ diff --git a/SecureSourceManager/tests/Unit/V1/Client/SecureSourceManagerClientTest.php b/SecureSourceManager/tests/Unit/V1/Client/SecureSourceManagerClientTest.php index 5376a56ca926..e4c0d3de71b8 100644 --- a/SecureSourceManager/tests/Unit/V1/Client/SecureSourceManagerClientTest.php +++ b/SecureSourceManager/tests/Unit/V1/Client/SecureSourceManagerClientTest.php @@ -35,23 +35,31 @@ use Google\Cloud\Location\ListLocationsRequest; use Google\Cloud\Location\ListLocationsResponse; use Google\Cloud\Location\Location; +use Google\Cloud\SecureSourceManager\V1\BranchRule; use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient; +use Google\Cloud\SecureSourceManager\V1\CreateBranchRuleRequest; use Google\Cloud\SecureSourceManager\V1\CreateInstanceRequest; use Google\Cloud\SecureSourceManager\V1\CreateRepositoryRequest; +use Google\Cloud\SecureSourceManager\V1\DeleteBranchRuleRequest; use Google\Cloud\SecureSourceManager\V1\DeleteInstanceRequest; use Google\Cloud\SecureSourceManager\V1\DeleteRepositoryRequest; +use Google\Cloud\SecureSourceManager\V1\GetBranchRuleRequest; use Google\Cloud\SecureSourceManager\V1\GetInstanceRequest; use Google\Cloud\SecureSourceManager\V1\GetRepositoryRequest; use Google\Cloud\SecureSourceManager\V1\Instance; +use Google\Cloud\SecureSourceManager\V1\ListBranchRulesRequest; +use Google\Cloud\SecureSourceManager\V1\ListBranchRulesResponse; use Google\Cloud\SecureSourceManager\V1\ListInstancesRequest; use Google\Cloud\SecureSourceManager\V1\ListInstancesResponse; use Google\Cloud\SecureSourceManager\V1\ListRepositoriesRequest; use Google\Cloud\SecureSourceManager\V1\ListRepositoriesResponse; use Google\Cloud\SecureSourceManager\V1\Repository; +use Google\Cloud\SecureSourceManager\V1\UpdateBranchRuleRequest; use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; +use Google\Protobuf\FieldMask; use Google\Protobuf\GPBEmpty; use Google\Rpc\Code; use stdClass; @@ -86,6 +94,167 @@ private function createClient(array $options = []) return new SecureSourceManagerClient($options); } + /** @test */ + public function createBranchRuleTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createBranchRuleTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $uid = 'uid115792'; + $etag = 'etag3123477'; + $includePattern = 'includePattern-1182351623'; + $disabled = true; + $requirePullRequest = false; + $minimumReviewsCount = 672799098; + $minimumApprovalsCount = 579210129; + $requireCommentsResolved = false; + $allowStaleReviews = false; + $requireLinearHistory = true; + $expectedResponse = new BranchRule(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $expectedResponse->setEtag($etag); + $expectedResponse->setIncludePattern($includePattern); + $expectedResponse->setDisabled($disabled); + $expectedResponse->setRequirePullRequest($requirePullRequest); + $expectedResponse->setMinimumReviewsCount($minimumReviewsCount); + $expectedResponse->setMinimumApprovalsCount($minimumApprovalsCount); + $expectedResponse->setRequireCommentsResolved($requireCommentsResolved); + $expectedResponse->setAllowStaleReviews($allowStaleReviews); + $expectedResponse->setRequireLinearHistory($requireLinearHistory); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createBranchRuleTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); + $branchRule = new BranchRule(); + $branchRuleId = 'branchRuleId786871201'; + $request = (new CreateBranchRuleRequest()) + ->setParent($formattedParent) + ->setBranchRule($branchRule) + ->setBranchRuleId($branchRuleId); + $response = $gapicClient->createBranchRule($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.securesourcemanager.v1.SecureSourceManager/CreateBranchRule', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getBranchRule(); + $this->assertProtobufEquals($branchRule, $actualValue); + $actualValue = $actualApiRequestObject->getBranchRuleId(); + $this->assertProtobufEquals($branchRuleId, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createBranchRuleTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createBranchRuleExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createBranchRuleTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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 + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); + $branchRule = new BranchRule(); + $branchRuleId = 'branchRuleId786871201'; + $request = (new CreateBranchRuleRequest()) + ->setParent($formattedParent) + ->setBranchRule($branchRule) + ->setBranchRuleId($branchRuleId); + $response = $gapicClient->createBranchRule($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createBranchRuleTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + /** @test */ public function createInstanceTest() { @@ -378,6 +547,131 @@ public function createRepositoryExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); } + /** @test */ + public function deleteBranchRuleTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteBranchRuleTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteBranchRuleTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->branchRuleName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[BRANCH_RULE]'); + $request = (new DeleteBranchRuleRequest())->setName($formattedName); + $response = $gapicClient->deleteBranchRule($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.securesourcemanager.v1.SecureSourceManager/DeleteBranchRule', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteBranchRuleTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteBranchRuleExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteBranchRuleTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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 + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->branchRuleName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[BRANCH_RULE]'); + $request = (new DeleteBranchRuleRequest())->setName($formattedName); + $response = $gapicClient->deleteBranchRule($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteBranchRuleTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + /** @test */ public function deleteInstanceTest() { @@ -628,6 +922,91 @@ public function deleteRepositoryExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); } + /** @test */ + public function getBranchRuleTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $etag = 'etag3123477'; + $includePattern = 'includePattern-1182351623'; + $disabled = true; + $requirePullRequest = false; + $minimumReviewsCount = 672799098; + $minimumApprovalsCount = 579210129; + $requireCommentsResolved = false; + $allowStaleReviews = false; + $requireLinearHistory = true; + $expectedResponse = new BranchRule(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setEtag($etag); + $expectedResponse->setIncludePattern($includePattern); + $expectedResponse->setDisabled($disabled); + $expectedResponse->setRequirePullRequest($requirePullRequest); + $expectedResponse->setMinimumReviewsCount($minimumReviewsCount); + $expectedResponse->setMinimumApprovalsCount($minimumApprovalsCount); + $expectedResponse->setRequireCommentsResolved($requireCommentsResolved); + $expectedResponse->setAllowStaleReviews($allowStaleReviews); + $expectedResponse->setRequireLinearHistory($requireLinearHistory); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->branchRuleName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[BRANCH_RULE]'); + $request = (new GetBranchRuleRequest())->setName($formattedName); + $response = $gapicClient->getBranchRule($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.securesourcemanager.v1.SecureSourceManager/GetBranchRule', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getBranchRuleExceptionTest() + { + $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 + $formattedName = $gapicClient->branchRuleName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[BRANCH_RULE]'); + $request = (new GetBranchRuleRequest())->setName($formattedName); + try { + $gapicClient->getBranchRule($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 getIamPolicyRepoTest() { @@ -835,6 +1214,77 @@ public function getRepositoryExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function listBranchRulesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $branchRulesElement = new BranchRule(); + $branchRules = [$branchRulesElement]; + $expectedResponse = new ListBranchRulesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setBranchRules($branchRules); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); + $request = (new ListBranchRulesRequest())->setParent($formattedParent); + $response = $gapicClient->listBranchRules($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getBranchRules()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.securesourcemanager.v1.SecureSourceManager/ListBranchRules', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listBranchRulesExceptionTest() + { + $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 + $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); + $request = (new ListBranchRulesRequest())->setParent($formattedParent); + try { + $gapicClient->listBranchRules($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 listInstancesTest() { @@ -1118,6 +1568,157 @@ public function testIamPermissionsRepoExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function updateBranchRuleTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateBranchRuleTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $uid = 'uid115792'; + $etag = 'etag3123477'; + $includePattern = 'includePattern-1182351623'; + $disabled = true; + $requirePullRequest = false; + $minimumReviewsCount = 672799098; + $minimumApprovalsCount = 579210129; + $requireCommentsResolved = false; + $allowStaleReviews = false; + $requireLinearHistory = true; + $expectedResponse = new BranchRule(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $expectedResponse->setEtag($etag); + $expectedResponse->setIncludePattern($includePattern); + $expectedResponse->setDisabled($disabled); + $expectedResponse->setRequirePullRequest($requirePullRequest); + $expectedResponse->setMinimumReviewsCount($minimumReviewsCount); + $expectedResponse->setMinimumApprovalsCount($minimumApprovalsCount); + $expectedResponse->setRequireCommentsResolved($requireCommentsResolved); + $expectedResponse->setAllowStaleReviews($allowStaleReviews); + $expectedResponse->setRequireLinearHistory($requireLinearHistory); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateBranchRuleTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $branchRule = new BranchRule(); + $updateMask = new FieldMask(); + $request = (new UpdateBranchRuleRequest())->setBranchRule($branchRule)->setUpdateMask($updateMask); + $response = $gapicClient->updateBranchRule($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.securesourcemanager.v1.SecureSourceManager/UpdateBranchRule', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getBranchRule(); + $this->assertProtobufEquals($branchRule, $actualValue); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateBranchRuleTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateBranchRuleExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateBranchRuleTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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 + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $branchRule = new BranchRule(); + $updateMask = new FieldMask(); + $request = (new UpdateBranchRuleRequest())->setBranchRule($branchRule)->setUpdateMask($updateMask); + $response = $gapicClient->updateBranchRule($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateBranchRuleTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + /** @test */ public function getIamPolicyTest() { @@ -1452,7 +2053,7 @@ public function listLocationsExceptionTest() } /** @test */ - public function createInstanceAsyncTest() + public function createBranchRuleAsyncTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -1469,30 +2070,48 @@ public function createInstanceAsyncTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createInstanceTest'); + $incompleteOperation->setName('operations/createBranchRuleTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); $name = 'name3373707'; - $kmsKey = 'kmsKey-591635343'; - $expectedResponse = new Instance(); + $uid = 'uid115792'; + $etag = 'etag3123477'; + $includePattern = 'includePattern-1182351623'; + $disabled = true; + $requirePullRequest = false; + $minimumReviewsCount = 672799098; + $minimumApprovalsCount = 579210129; + $requireCommentsResolved = false; + $allowStaleReviews = false; + $requireLinearHistory = true; + $expectedResponse = new BranchRule(); $expectedResponse->setName($name); - $expectedResponse->setKmsKey($kmsKey); + $expectedResponse->setUid($uid); + $expectedResponse->setEtag($etag); + $expectedResponse->setIncludePattern($includePattern); + $expectedResponse->setDisabled($disabled); + $expectedResponse->setRequirePullRequest($requirePullRequest); + $expectedResponse->setMinimumReviewsCount($minimumReviewsCount); + $expectedResponse->setMinimumApprovalsCount($minimumApprovalsCount); + $expectedResponse->setRequireCommentsResolved($requireCommentsResolved); + $expectedResponse->setAllowStaleReviews($allowStaleReviews); + $expectedResponse->setRequireLinearHistory($requireLinearHistory); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); - $completeOperation->setName('operations/createInstanceTest'); + $completeOperation->setName('operations/createBranchRuleTest'); $completeOperation->setDone(true); $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $instanceId = 'instanceId-2101995259'; - $instance = new Instance(); - $request = (new CreateInstanceRequest()) + $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); + $branchRule = new BranchRule(); + $branchRuleId = 'branchRuleId786871201'; + $request = (new CreateBranchRuleRequest()) ->setParent($formattedParent) - ->setInstanceId($instanceId) - ->setInstance($instance); - $response = $gapicClient->createInstanceAsync($request)->wait(); + ->setBranchRule($branchRule) + ->setBranchRuleId($branchRuleId); + $response = $gapicClient->createBranchRuleAsync($request)->wait(); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $apiRequests = $transport->popReceivedCalls(); @@ -1502,17 +2121,17 @@ public function createInstanceAsyncTest() $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); $this->assertSame( - '/google.cloud.securesourcemanager.v1.SecureSourceManager/CreateInstance', + '/google.cloud.securesourcemanager.v1.SecureSourceManager/CreateBranchRule', $actualApiFuncCall ); $actualValue = $actualApiRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getInstanceId(); - $this->assertProtobufEquals($instanceId, $actualValue); - $actualValue = $actualApiRequestObject->getInstance(); - $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getBranchRule(); + $this->assertProtobufEquals($branchRule, $actualValue); + $actualValue = $actualApiRequestObject->getBranchRuleId(); + $this->assertProtobufEquals($branchRuleId, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createInstanceTest'); + $expectedOperationsRequestObject->setName('operations/createBranchRuleTest'); $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, ]); From 385c1e763613e3c5683757447a36f133c9787530 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 23 Oct 2024 18:32:20 -0700 Subject: [PATCH 24/34] feat: add `text` field for Grounding metadata support chunk output (#7758) PiperOrigin-RevId: 688271012 Source-Link: https://github.com/googleapis/googleapis/commit/09f411dc4d24214e67e74a8b52577db1c6609b46 Source-Link: https://github.com/googleapis/googleapis-gen/commit/c0e3a9274a5d5bf62faf7b448815e6a2e5906352 Copy-Tag: eyJwIjoiQWlQbGF0Zm9ybS8uT3dsQm90LnlhbWwiLCJoIjoiYzBlM2E5Mjc0YTVkNWJmNjJmYWY3YjQ0ODgxNWU2YTJlNTkwNjM1MiJ9 --- AiPlatform/metadata/V1/Content.php | Bin 7208 -> 7236 bytes .../V1/GroundingChunk/RetrievedContext.php | 44 ++++++++++++++++++ AiPlatform/src/V1/RetrievalMetadata.php | 24 +++++----- AiPlatform/src/V1/VertexAISearch.php | 10 ++-- 4 files changed, 61 insertions(+), 17 deletions(-) diff --git a/AiPlatform/metadata/V1/Content.php b/AiPlatform/metadata/V1/Content.php index 2f518197707f8ef06b56007a2eab203c024376e4..08bfd7dfd1f094241601e1fc27b86b28d2e4de45 100644 GIT binary patch delta 62 zcmZ2sal~Q+FEitt&3w#!!i@JO%Zj~XOqA^JlqnIeC Q6FV1cJV diff --git a/AiPlatform/src/V1/GroundingChunk/RetrievedContext.php b/AiPlatform/src/V1/GroundingChunk/RetrievedContext.php index add14f056d98..d827b5940307 100644 --- a/AiPlatform/src/V1/GroundingChunk/RetrievedContext.php +++ b/AiPlatform/src/V1/GroundingChunk/RetrievedContext.php @@ -27,6 +27,12 @@ class RetrievedContext extends \Google\Protobuf\Internal\Message * Generated from protobuf field optional string title = 2; */ protected $title = null; + /** + * Text of the attribution. + * + * Generated from protobuf field optional string text = 3; + */ + protected $text = null; /** * Constructor. @@ -38,6 +44,8 @@ class RetrievedContext extends \Google\Protobuf\Internal\Message * URI reference of the attribution. * @type string $title * Title of the attribution. + * @type string $text + * Text of the attribution. * } */ public function __construct($data = NULL) { @@ -117,6 +125,42 @@ public function setTitle($var) return $this; } + /** + * Text of the attribution. + * + * Generated from protobuf field optional string text = 3; + * @return string + */ + public function getText() + { + return isset($this->text) ? $this->text : ''; + } + + public function hasText() + { + return isset($this->text); + } + + public function clearText() + { + unset($this->text); + } + + /** + * Text of the attribution. + * + * Generated from protobuf field optional string text = 3; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + } diff --git a/AiPlatform/src/V1/RetrievalMetadata.php b/AiPlatform/src/V1/RetrievalMetadata.php index 8cf571a16f22..9c32e59b9ef9 100644 --- a/AiPlatform/src/V1/RetrievalMetadata.php +++ b/AiPlatform/src/V1/RetrievalMetadata.php @@ -16,11 +16,11 @@ class RetrievalMetadata extends \Google\Protobuf\Internal\Message { /** - * Optional. Score indicating how likely information from google search could + * Optional. Score indicating how likely information from Google Search could * help answer the prompt. The score is in the range `[0, 1]`, where 0 is the * least likely and 1 is the most likely. This score is only populated when - * google search grounding and dynamic retrieval is enabled. It will be - * compared to the threshold to determine whether to trigger google search. + * Google Search grounding and dynamic retrieval is enabled. It will be + * compared to the threshold to determine whether to trigger Google Search. * * Generated from protobuf field float google_search_dynamic_retrieval_score = 2 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -33,11 +33,11 @@ class RetrievalMetadata extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type float $google_search_dynamic_retrieval_score - * Optional. Score indicating how likely information from google search could + * Optional. Score indicating how likely information from Google Search could * help answer the prompt. The score is in the range `[0, 1]`, where 0 is the * least likely and 1 is the most likely. This score is only populated when - * google search grounding and dynamic retrieval is enabled. It will be - * compared to the threshold to determine whether to trigger google search. + * Google Search grounding and dynamic retrieval is enabled. It will be + * compared to the threshold to determine whether to trigger Google Search. * } */ public function __construct($data = NULL) { @@ -46,11 +46,11 @@ public function __construct($data = NULL) { } /** - * Optional. Score indicating how likely information from google search could + * Optional. Score indicating how likely information from Google Search could * help answer the prompt. The score is in the range `[0, 1]`, where 0 is the * least likely and 1 is the most likely. This score is only populated when - * google search grounding and dynamic retrieval is enabled. It will be - * compared to the threshold to determine whether to trigger google search. + * Google Search grounding and dynamic retrieval is enabled. It will be + * compared to the threshold to determine whether to trigger Google Search. * * Generated from protobuf field float google_search_dynamic_retrieval_score = 2 [(.google.api.field_behavior) = OPTIONAL]; * @return float @@ -61,11 +61,11 @@ public function getGoogleSearchDynamicRetrievalScore() } /** - * Optional. Score indicating how likely information from google search could + * Optional. Score indicating how likely information from Google Search could * help answer the prompt. The score is in the range `[0, 1]`, where 0 is the * least likely and 1 is the most likely. This score is only populated when - * google search grounding and dynamic retrieval is enabled. It will be - * compared to the threshold to determine whether to trigger google search. + * Google Search grounding and dynamic retrieval is enabled. It will be + * compared to the threshold to determine whether to trigger Google Search. * * Generated from protobuf field float google_search_dynamic_retrieval_score = 2 [(.google.api.field_behavior) = OPTIONAL]; * @param float $var diff --git a/AiPlatform/src/V1/VertexAISearch.php b/AiPlatform/src/V1/VertexAISearch.php index 9c1e78170308..f1e9f9157e9f 100644 --- a/AiPlatform/src/V1/VertexAISearch.php +++ b/AiPlatform/src/V1/VertexAISearch.php @@ -10,14 +10,14 @@ /** * Retrieve from Vertex AI Search datastore for grounding. - * See https://cloud.google.com/vertex-ai-search-and-conversation + * See https://cloud.google.com/products/agent-builder * * Generated from protobuf message google.cloud.aiplatform.v1.VertexAISearch */ class VertexAISearch extends \Google\Protobuf\Internal\Message { /** - * Required. Fully-qualified Vertex AI Search's datastore resource ID. + * Required. Fully-qualified Vertex AI Search data store resource ID. * Format: * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}` * @@ -32,7 +32,7 @@ class VertexAISearch extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $datastore - * Required. Fully-qualified Vertex AI Search's datastore resource ID. + * Required. Fully-qualified Vertex AI Search data store resource ID. * Format: * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}` * } @@ -43,7 +43,7 @@ public function __construct($data = NULL) { } /** - * Required. Fully-qualified Vertex AI Search's datastore resource ID. + * Required. Fully-qualified Vertex AI Search data store resource ID. * Format: * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}` * @@ -56,7 +56,7 @@ public function getDatastore() } /** - * Required. Fully-qualified Vertex AI Search's datastore resource ID. + * Required. Fully-qualified Vertex AI Search data store resource ID. * Format: * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}` * From 3b5afb394afe814d2fa2de028e214b528c80a234 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 23 Oct 2024 18:32:36 -0700 Subject: [PATCH 25/34] feat: add brand voice lite, which lets you clone a voice with just 10 seconds of audio (#7759) PiperOrigin-RevId: 688491221 Source-Link: https://github.com/googleapis/googleapis/commit/60688dc3302894cb893531383d6a26d9416a1364 Source-Link: https://github.com/googleapis/googleapis-gen/commit/4072c999b36baa21ccb29c5f5d5608962840b31a Copy-Tag: eyJwIjoiVGV4dFRvU3BlZWNoLy5Pd2xCb3QueWFtbCIsImgiOiI0MDcyYzk5OWIzNmJhYTIxY2NiMjljNWY1ZDU2MDg5NjI4NDBiMzFhIn0= --- TextToSpeech/metadata/V1/CloudTts.php | Bin 4560 -> 4683 bytes TextToSpeech/metadata/V1/CloudTtsLrs.php | 6 +- TextToSpeech/src/V1/VoiceCloneParams.php | 67 +++++++++++++++++++ TextToSpeech/src/V1/VoiceSelectionParams.php | 52 ++++++++++++++ 4 files changed, 122 insertions(+), 3 deletions(-) create mode 100644 TextToSpeech/src/V1/VoiceCloneParams.php diff --git a/TextToSpeech/metadata/V1/CloudTts.php b/TextToSpeech/metadata/V1/CloudTts.php index 3125c7df3ed56a36b203843004a7237903f7e3ab..cee048c39aed1706ac68ec1f4ab27f126319418c 100644 GIT binary patch delta 144 zcmcbhd|GA0Atsi6a$GtSy>&K!Vp_+_G?i)cB97DILLOY)W%-%Osqx7<`FW`ltO|@8 z+(vqn_c1FAIDinternalAddGeneratedFile( ' - + 0google/cloud/texttospeech/v1/cloud_tts_lrs.protogoogle.cloud.texttospeech.v1google/api/client.protogoogle/api/field_behavior.proto,google/cloud/texttospeech/v1/cloud_tts.proto#google/longrunning/operations.protogoogle/protobuf/timestamp.proto" SynthesizeLongAudioRequest @@ -39,8 +39,8 @@ public static function initOnce() { progress_percentage (2 TextToSpeechLongAudioSynthesize SynthesizeLongAudio8.google.cloud.texttospeech.v1.SynthesizeLongAudioRequest.google.longrunning.Operation"At -8google.cloud.texttospeech.v1.SynthesizeLongAudioResponse8google.cloud.texttospeech.v1.SynthesizeLongAudioMetadata<"7/v1/{parent=projects/*/locations/*}:synthesizeLongAudio:*OAtexttospeech.googleapis.comA.https://www.googleapis.com/auth/cloud-platformB - com.google.cloud.texttospeech.v1B#TextToSpeechLongAudioSynthesisProtoPZDcloud.google.com/go/texttospeech/apiv1/texttospeechpb;texttospeechpbGoogle.Cloud.TextToSpeech.V1Google\\Cloud\\TextToSpeech\\V1Google::Cloud::TextToSpeech::V1bproto3' +8google.cloud.texttospeech.v1.SynthesizeLongAudioResponse8google.cloud.texttospeech.v1.SynthesizeLongAudioMetadata<"7/v1/{parent=projects/*/locations/*}:synthesizeLongAudio:*OAtexttospeech.googleapis.comA.https://www.googleapis.com/auth/cloud-platformB + com.google.cloud.texttospeech.v1B#TextToSpeechLongAudioSynthesisProtoPZDcloud.google.com/go/texttospeech/apiv1/texttospeechpb;texttospeechpbGoogle.Cloud.TextToSpeech.V1Google\\Cloud\\TextToSpeech\\V1Google::Cloud::TextToSpeech::V1bproto3' , true); static::$is_initialized = true; diff --git a/TextToSpeech/src/V1/VoiceCloneParams.php b/TextToSpeech/src/V1/VoiceCloneParams.php new file mode 100644 index 000000000000..dcdf28485990 --- /dev/null +++ b/TextToSpeech/src/V1/VoiceCloneParams.php @@ -0,0 +1,67 @@ +google.cloud.texttospeech.v1.VoiceCloneParams + */ +class VoiceCloneParams extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Created by GenerateVoiceCloningKey. + * + * Generated from protobuf field string voice_cloning_key = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $voice_cloning_key = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $voice_cloning_key + * Required. Created by GenerateVoiceCloningKey. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce(); + parent::__construct($data); + } + + /** + * Required. Created by GenerateVoiceCloningKey. + * + * Generated from protobuf field string voice_cloning_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getVoiceCloningKey() + { + return $this->voice_cloning_key; + } + + /** + * Required. Created by GenerateVoiceCloningKey. + * + * Generated from protobuf field string voice_cloning_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setVoiceCloningKey($var) + { + GPBUtil::checkString($var, True); + $this->voice_cloning_key = $var; + + return $this; + } + +} + diff --git a/TextToSpeech/src/V1/VoiceSelectionParams.php b/TextToSpeech/src/V1/VoiceSelectionParams.php index 9dcb6cf601d0..2075fbe1535a 100644 --- a/TextToSpeech/src/V1/VoiceSelectionParams.php +++ b/TextToSpeech/src/V1/VoiceSelectionParams.php @@ -57,6 +57,14 @@ class VoiceSelectionParams extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.texttospeech.v1.CustomVoiceParams custom_voice = 4; */ private $custom_voice = null; + /** + * Optional. The configuration for a voice clone. If + * [VoiceCloneParams.voice_clone_key] is set, the service will choose the + * voice clone matching the specified configuration. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceCloneParams voice_clone = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $voice_clone = null; /** * Constructor. @@ -90,6 +98,10 @@ class VoiceSelectionParams extends \Google\Protobuf\Internal\Message * The configuration for a custom voice. If [CustomVoiceParams.model] is set, * the service will choose the custom voice matching the specified * configuration. + * @type \Google\Cloud\TextToSpeech\V1\VoiceCloneParams $voice_clone + * Optional. The configuration for a voice clone. If + * [VoiceCloneParams.voice_clone_key] is set, the service will choose the + * voice clone matching the specified configuration. * } */ public function __construct($data = NULL) { @@ -247,5 +259,45 @@ public function setCustomVoice($var) return $this; } + /** + * Optional. The configuration for a voice clone. If + * [VoiceCloneParams.voice_clone_key] is set, the service will choose the + * voice clone matching the specified configuration. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceCloneParams voice_clone = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\TextToSpeech\V1\VoiceCloneParams|null + */ + public function getVoiceClone() + { + return $this->voice_clone; + } + + public function hasVoiceClone() + { + return isset($this->voice_clone); + } + + public function clearVoiceClone() + { + unset($this->voice_clone); + } + + /** + * Optional. The configuration for a voice clone. If + * [VoiceCloneParams.voice_clone_key] is set, the service will choose the + * voice clone matching the specified configuration. + * + * Generated from protobuf field .google.cloud.texttospeech.v1.VoiceCloneParams voice_clone = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\TextToSpeech\V1\VoiceCloneParams $var + * @return $this + */ + public function setVoiceClone($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\TextToSpeech\V1\VoiceCloneParams::class); + $this->voice_clone = $var; + + return $this; + } + } From 22357f5392c482243dd47d17383d0af6367d3911 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 23 Oct 2024 18:32:54 -0700 Subject: [PATCH 26/34] feat: add new PSC instance configuration setting and output the PSC DNS name (#7760) feat: add new API to execute SQL statements feat: add support for Free Trials feat: add support to schedule maintenance feat: additional field to set tags on a backup or cluster feat: add more observability options on the Instance level feat: add new API to perform a promotion or switchover on secondary instances feat: support for obtaining the public ip addresses of an instance and enabling either inbound or outbound public ip feat: add new API to list the databases in a project and location feat: add optional field to keep extra roles on a user if it already exists docs: various typo fixes, correcting the formatting, and clarifications on the request_id and validate_only fields in API requests and on the page_size when listing the database PiperOrigin-RevId: 688544999 Source-Link: https://github.com/googleapis/googleapis/commit/113ddfebbe8d4e0639eb19fe91817a13edfc0c5c Source-Link: https://github.com/googleapis/googleapis-gen/commit/14fa50edd57629ab318bb7b98a7286b46749e8df Copy-Tag: eyJwIjoiQWxsb3lEYi8uT3dsQm90LnlhbWwiLCJoIjoiMTRmYTUwZWRkNTc2MjlhYjMxOGJiN2I5OGE3Mjg2YjQ2NzQ5ZThkZiJ9 --- AlloyDb/metadata/V1/DataModel.php | Bin 0 -> 1145 bytes AlloyDb/metadata/V1/Resources.php | Bin 11817 -> 14378 bytes AlloyDb/metadata/V1/Service.php | Bin 15637 -> 17488 bytes .../V1/AlloyDBAdminClient/create_cluster.php | 2 +- .../create_secondary_cluster.php | 2 +- .../V1/AlloyDBAdminClient/execute_sql.php | 95 +++++ .../V1/AlloyDBAdminClient/list_databases.php | 76 ++++ .../V1/AlloyDBAdminClient/restore_cluster.php | 2 +- .../AlloyDBAdminClient/switchover_cluster.php | 86 +++++ .../V1/AlloyDBAdminClient/update_cluster.php | 2 +- AlloyDb/src/V1/Backup.php | 88 +++++ .../V1/BatchCreateInstanceStatus/State.php | 2 +- .../src/V1/BatchCreateInstancesRequest.php | 40 +- AlloyDb/src/V1/Client/AlloyDBAdminClient.php | 87 +++++ AlloyDb/src/V1/Cluster.php | 318 +++++++++++++++- AlloyDb/src/V1/Cluster/NetworkConfig.php | 22 +- AlloyDb/src/V1/Cluster/PscConfig.php | 72 ++++ AlloyDb/src/V1/Cluster/TrialMetadata.php | 210 +++++++++++ AlloyDb/src/V1/ConnectionInfo.php | 42 +++ AlloyDb/src/V1/CreateBackupRequest.php | 40 +- AlloyDb/src/V1/CreateClusterRequest.php | 64 ++-- AlloyDb/src/V1/CreateInstanceRequest.php | 64 ++-- .../src/V1/CreateSecondaryClusterRequest.php | 64 ++-- .../src/V1/CreateSecondaryInstanceRequest.php | 64 ++-- AlloyDb/src/V1/CreateUserRequest.php | 40 +- AlloyDb/src/V1/Database.php | 155 ++++++++ AlloyDb/src/V1/DatabaseVersion.php | 14 + AlloyDb/src/V1/DeleteBackupRequest.php | 40 +- AlloyDb/src/V1/DeleteClusterRequest.php | 60 +-- AlloyDb/src/V1/DeleteInstanceRequest.php | 60 +-- AlloyDb/src/V1/DeleteUserRequest.php | 40 +- AlloyDb/src/V1/ExecuteSqlMetadata.php | 195 ++++++++++ AlloyDb/src/V1/ExecuteSqlMetadata/Status.php | 77 ++++ AlloyDb/src/V1/ExecuteSqlRequest.php | 263 +++++++++++++ AlloyDb/src/V1/ExecuteSqlResponse.php | 115 ++++++ AlloyDb/src/V1/FailoverInstanceRequest.php | 60 +-- .../V1/GenerateClientCertificateRequest.php | 40 +- AlloyDb/src/V1/GetConnectionInfoRequest.php | 40 +- AlloyDb/src/V1/InjectFaultRequest.php | 64 ++-- AlloyDb/src/V1/Instance.php | 202 ++++++++++ .../V1/Instance/ClientConnectionConfig.php | 8 +- .../src/V1/Instance/InstanceNetworkConfig.php | 140 +++++++ .../AuthorizedNetwork.php | 68 ++++ AlloyDb/src/V1/Instance/PscInstanceConfig.php | 157 ++++++++ AlloyDb/src/V1/ListDatabasesRequest.php | 207 +++++++++++ AlloyDb/src/V1/ListDatabasesResponse.php | 105 ++++++ AlloyDb/src/V1/MaintenanceSchedule.php | 81 ++++ AlloyDb/src/V1/MaintenanceUpdatePolicy.php | 67 ++++ .../MaintenanceWindow.php | 116 ++++++ AlloyDb/src/V1/PromoteClusterRequest.php | 44 ++- AlloyDb/src/V1/RestartInstanceRequest.php | 98 +++-- AlloyDb/src/V1/RestoreClusterRequest.php | 64 ++-- AlloyDb/src/V1/SqlResult.php | 105 ++++++ AlloyDb/src/V1/SqlResultColumn.php | 109 ++++++ AlloyDb/src/V1/SqlResultRow.php | 67 ++++ AlloyDb/src/V1/SqlResultValue.php | 125 +++++++ AlloyDb/src/V1/SslConfig/SslMode.php | 4 +- AlloyDb/src/V1/SubscriptionType.php | 64 ++++ AlloyDb/src/V1/SwitchoverClusterRequest.php | 202 ++++++++++ AlloyDb/src/V1/UpdateBackupRequest.php | 40 +- AlloyDb/src/V1/UpdateClusterRequest.php | 64 ++-- AlloyDb/src/V1/UpdateInstanceRequest.php | 64 ++-- AlloyDb/src/V1/UpdateUserRequest.php | 40 +- AlloyDb/src/V1/User.php | 38 ++ AlloyDb/src/V1/gapic_metadata.json | 15 + .../alloy_db_admin_client_config.json | 15 + .../alloy_db_admin_descriptor_config.php | 51 +++ .../alloy_db_admin_rest_client_config.php | 35 ++ .../Unit/V1/Client/AlloyDBAdminClientTest.php | 350 ++++++++++++++++++ 69 files changed, 4856 insertions(+), 594 deletions(-) create mode 100644 AlloyDb/metadata/V1/DataModel.php create mode 100644 AlloyDb/samples/V1/AlloyDBAdminClient/execute_sql.php create mode 100644 AlloyDb/samples/V1/AlloyDBAdminClient/list_databases.php create mode 100644 AlloyDb/samples/V1/AlloyDBAdminClient/switchover_cluster.php create mode 100644 AlloyDb/src/V1/Cluster/PscConfig.php create mode 100644 AlloyDb/src/V1/Cluster/TrialMetadata.php create mode 100644 AlloyDb/src/V1/Database.php create mode 100644 AlloyDb/src/V1/ExecuteSqlMetadata.php create mode 100644 AlloyDb/src/V1/ExecuteSqlMetadata/Status.php create mode 100644 AlloyDb/src/V1/ExecuteSqlRequest.php create mode 100644 AlloyDb/src/V1/ExecuteSqlResponse.php create mode 100644 AlloyDb/src/V1/Instance/InstanceNetworkConfig.php create mode 100644 AlloyDb/src/V1/Instance/InstanceNetworkConfig/AuthorizedNetwork.php create mode 100644 AlloyDb/src/V1/Instance/PscInstanceConfig.php create mode 100644 AlloyDb/src/V1/ListDatabasesRequest.php create mode 100644 AlloyDb/src/V1/ListDatabasesResponse.php create mode 100644 AlloyDb/src/V1/MaintenanceSchedule.php create mode 100644 AlloyDb/src/V1/MaintenanceUpdatePolicy.php create mode 100644 AlloyDb/src/V1/MaintenanceUpdatePolicy/MaintenanceWindow.php create mode 100644 AlloyDb/src/V1/SqlResult.php create mode 100644 AlloyDb/src/V1/SqlResultColumn.php create mode 100644 AlloyDb/src/V1/SqlResultRow.php create mode 100644 AlloyDb/src/V1/SqlResultValue.php create mode 100644 AlloyDb/src/V1/SubscriptionType.php create mode 100644 AlloyDb/src/V1/SwitchoverClusterRequest.php diff --git a/AlloyDb/metadata/V1/DataModel.php b/AlloyDb/metadata/V1/DataModel.php new file mode 100644 index 0000000000000000000000000000000000000000..f334a578ea62c9be4e6ae928c56472a835c9febc GIT binary patch literal 1145 zcma)5-EPw`7$v2Y%^O3?O((c9WvH3NQk4lIQVLoY=yow$jj0zXQspFWXUUC&<8&HR z?|BwpfOp`M$KWaOPa7ttYUC!dea`v5_&ev#yX-szPhk(Im?MD`7+pefj$y``U@@aG zD#l~XVa%o(p_sc627UOke+J(N$7fF@HD?8nu?HuNO(<@~lod$}QOYips5NW15+u-Q z$`VXnEeb%2rZ~?~jA3u!pJ0I$BVtnqb-M9klpT5vj zoEKEsufcukiDH`O+ZMd*Y`k#X6+E{j9cqHT52~D9iM>`)OJL$FmU=^fh!_q3KNe01lV zW!ZJ<<$}_YIZ!>U9a-|gUjsF>=|2D)qrVvchXo$XD6MM4-zr_MZ8xw!zcdqBUNf7v zCajDX%7{$ZVp>_$DZjo~>OGw&SLeyqc?u$T*#5aZ2^Uc_Sqq|2hV6Idk)e5>=6RkW g`kpszM>U<_{buR2=f=L*+`iK38fi>D2Xg@a00r=Ds{jB1 literal 0 HcmV?d00001 diff --git a/AlloyDb/metadata/V1/Resources.php b/AlloyDb/metadata/V1/Resources.php index 1ab8a44321b87ccb5ca10a506988fe5fef98191c..06fc70f26aebc7ff49deeb0e5bcc714ccc0a2bf6 100644 GIT binary patch delta 2150 zcmZ`)Pi)&{6qn;Re_qopaof~Q(BOakPv)!>@FeY>A>Zx4mY_z33R5dpy|SV~2tTE(N_MbzXE<~c?V#H@%-)YD9xt1DRacoAp2>q>5 zu-61X<_4H_0-R_G;5XT8MB zrJ7hrmP7|D@t4QRABl|9Wv=R2<~>6*%`9|T(kkXB+zIai(qE;@Gn!>?mLfaFuAO2x zg@ruZpJy0yrT_C6#~`u?8OKA911+V~at$fYXq%ujsUH~VZA;2cbqp{Y`mPxio@a`vzgmTNY)kckT+Pg-J_QW%0*w@n%49u79XP5#b~=OJO(%as12YKW4emAI#qzn9CfU&pd5w=uQ^?Am zv6XFAh-t{$(9Lz0>XTb4z<0B+wTkq zZoCPJj!L*u7{tiDs?xe8%aY`^I?^n$rfTc%KqF1Mn{IqLa)$|SF}ub086suOVIiV=EWm}ZFH&yiwgcp+%rpBFvfD+l zjgawdy8AO4_70iJzBeiypcB#PAn3Jl{tCDdYggpHi8dZ&Z?nmcGdbY2NG`-v1dl!y z=Stp97;q;-4+cwVq zMea>(WjH$Tb%YFuLZ&2|dW|ka(4S)$IW1I!o4duUFzhD2E6k^bZky5{7rLB}Q{m4H zguN2Tqh#O7FxL+uc}+4gvRv+XOiw~Y)@wET+tD?bD^2~Wy?GCX{4j54o}X||veOkl zcHI}>5+c4x`QVG>Z{d69I{EJCtLL}_(6e~4Qa!hHrXtRqh_mgAlkqNL0pkDtA8?0Y zq;jcLnO!O`R?8O`L?Q+IvQY?Es>Ox5;?i84;UdsoT`CtZ!~>=KEDXzfo$eOjn4A2S F`4_}=v8w<8 delta 298 zcmV+_0oDGhaH(9d{{gc$0&f8Y=u`?^Cy`4hlhFejvj_xY3IePVvzreg29u^2CX;~@ zC6n%fxL0^+lDj|~;8#@qE0Rch?3I=m;b#h~6B8(EVavSXflZPMC zqf{XRlb#DMvkE1t0R(vJL3NY4CUOQ+0RbZ50h2~2I3O7c3~6q2bYX5|WnXn^WEcb> z0VoMV1K>deI*S47L5GvZCx{CorV9!NLSbWTb#Rk>8@IDDDdYl^)e#hvMJzOvy)3+w zrY)caU+O_zT$4&JSp`x70V2q=xh~NH1ZV0&WRs9FWD-IS3Jh{(b98cPV{~b6ZgV2e wlQlAqlj1T|1Z?U-X_GoLW|NFG%>h}HS~Xb+Lb3x28)I*6lYt5tvqd)L0Zlt+k^lez diff --git a/AlloyDb/metadata/V1/Service.php b/AlloyDb/metadata/V1/Service.php index c0e1f525cbfe9db730d0678dbfd02934a00f8f18..62ea24282470aad66efe7dc1f452ffbdcce0a106 100644 GIT binary patch delta 1056 zcmZXT%}*0S7{;A#>Bkhxb`)4Bgk}p^q0qE35=9dW6eO0fwj7Mn&DtGclkEqcT~LXV zkZ3q~Fqv@jpvI%d7<=*t|A0dDq9+cX)T>@~r)+5(Z9+1?Vgl%dA6Wntz6`O0`A2_ddt4q?q4YsRx})ui)v(<^++mfI<$)* zL?ycb6|+ssRr-F}51PD>02I<2s-9gftm6{(!`t+$+Xrmr_t0nt&uFOQ@gi!2uDsbI zsR|M70b9sDZaaztaSuRW;x5h_I!>=?DZFN2qN5JzD$0ax6iSNF6aZH7wNvOKbg6lw z%lRzjy|FEGD1*5p6D)AmIu7}u-5|Im*lJQ2Y$0o!WVY%!hx5A0V2$O*eXy04OW6`u z%qvya#3ulvdMr{bb<+mM@hZlDNJd;$3&N652i|+Gd z&g!|lrHlUU9qtpCVOw1dCMj$ge;&H6MboFgpv!8+^rNHG7W;jn%m<&_+di3Ds^xG( zGl*`+ac|TQYbu=^h|*X6z4Xlhv|ScQ=}~m3`N1V}65sOcv-cqX13*~w1PwBiPS*r0 zr(Ko3-l*4)dBtt;Ek0}|6^AW!9A+^KH!Lh%&H47{@03f5(~Cvj6}9 delta 93 zcmV-j0HXiUhyj&)uxJ94p8`X(CIhem1mbWCC6kN=7?bh@VUutL8?&_q$py0p3~LMv zgaHZ`Qe|^=VRCenP8MO4-549QZ5v+;12XzCv(P7>1hYXcbqceiIGqWz{6bU#CRriK diff --git a/AlloyDb/samples/V1/AlloyDBAdminClient/create_cluster.php b/AlloyDb/samples/V1/AlloyDBAdminClient/create_cluster.php index 428b9bdd7ecd..10c0d66c6a5b 100644 --- a/AlloyDb/samples/V1/AlloyDBAdminClient/create_cluster.php +++ b/AlloyDb/samples/V1/AlloyDBAdminClient/create_cluster.php @@ -40,7 +40,7 @@ * @param string $formattedClusterNetwork The resource link for the VPC network in which cluster resources * are created and from which they are accessible via Private IP. The network * must belong to the same project as the cluster. It is specified in the - * form: "projects/{project}/global/networks/{network_id}". This is required + * form: `projects/{project}/global/networks/{network_id}`. This is required * to create a cluster. Deprecated, use network_config.network instead. Please see * {@see AlloyDBAdminClient::networkName()} for help formatting this field. */ diff --git a/AlloyDb/samples/V1/AlloyDBAdminClient/create_secondary_cluster.php b/AlloyDb/samples/V1/AlloyDBAdminClient/create_secondary_cluster.php index e832e93faf37..4473dad7bca3 100644 --- a/AlloyDb/samples/V1/AlloyDBAdminClient/create_secondary_cluster.php +++ b/AlloyDb/samples/V1/AlloyDBAdminClient/create_secondary_cluster.php @@ -41,7 +41,7 @@ * @param string $formattedClusterNetwork The resource link for the VPC network in which cluster resources * are created and from which they are accessible via Private IP. The network * must belong to the same project as the cluster. It is specified in the - * form: "projects/{project}/global/networks/{network_id}". This is required + * form: `projects/{project}/global/networks/{network_id}`. This is required * to create a cluster. Deprecated, use network_config.network instead. Please see * {@see AlloyDBAdminClient::networkName()} for help formatting this field. */ diff --git a/AlloyDb/samples/V1/AlloyDBAdminClient/execute_sql.php b/AlloyDb/samples/V1/AlloyDBAdminClient/execute_sql.php new file mode 100644 index 000000000000..7e9ed33563c5 --- /dev/null +++ b/AlloyDb/samples/V1/AlloyDBAdminClient/execute_sql.php @@ -0,0 +1,95 @@ +setInstance($formattedInstance) + ->setDatabase($database) + ->setUser($user) + ->setSqlStatement($sqlStatement); + + // Call the API and handle any network failures. + try { + /** @var ExecuteSqlResponse $response */ + $response = $alloyDBAdminClient->executeSql($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 +{ + $formattedInstance = AlloyDBAdminClient::instanceName( + '[PROJECT]', + '[LOCATION]', + '[CLUSTER]', + '[INSTANCE]' + ); + $database = '[DATABASE]'; + $user = '[USER]'; + $sqlStatement = '[SQL_STATEMENT]'; + + execute_sql_sample($formattedInstance, $database, $user, $sqlStatement); +} +// [END alloydb_v1_generated_AlloyDBAdmin_ExecuteSql_sync] diff --git a/AlloyDb/samples/V1/AlloyDBAdminClient/list_databases.php b/AlloyDb/samples/V1/AlloyDBAdminClient/list_databases.php new file mode 100644 index 000000000000..bf3389d01c64 --- /dev/null +++ b/AlloyDb/samples/V1/AlloyDBAdminClient/list_databases.php @@ -0,0 +1,76 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $alloyDBAdminClient->listDatabases($request); + + /** @var Database $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + + list_databases_sample($formattedParent); +} +// [END alloydb_v1_generated_AlloyDBAdmin_ListDatabases_sync] diff --git a/AlloyDb/samples/V1/AlloyDBAdminClient/restore_cluster.php b/AlloyDb/samples/V1/AlloyDBAdminClient/restore_cluster.php index 7517809adc5c..c18415e00df7 100644 --- a/AlloyDb/samples/V1/AlloyDBAdminClient/restore_cluster.php +++ b/AlloyDb/samples/V1/AlloyDBAdminClient/restore_cluster.php @@ -42,7 +42,7 @@ * @param string $formattedClusterNetwork The resource link for the VPC network in which cluster resources * are created and from which they are accessible via Private IP. The network * must belong to the same project as the cluster. It is specified in the - * form: "projects/{project}/global/networks/{network_id}". This is required + * form: `projects/{project}/global/networks/{network_id}`. This is required * to create a cluster. Deprecated, use network_config.network instead. Please see * {@see AlloyDBAdminClient::networkName()} for help formatting this field. */ diff --git a/AlloyDb/samples/V1/AlloyDBAdminClient/switchover_cluster.php b/AlloyDb/samples/V1/AlloyDBAdminClient/switchover_cluster.php new file mode 100644 index 000000000000..8b2f64626634 --- /dev/null +++ b/AlloyDb/samples/V1/AlloyDBAdminClient/switchover_cluster.php @@ -0,0 +1,86 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $alloyDBAdminClient->switchoverCluster($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Cluster $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $formattedName = AlloyDBAdminClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + + switchover_cluster_sample($formattedName); +} +// [END alloydb_v1_generated_AlloyDBAdmin_SwitchoverCluster_sync] diff --git a/AlloyDb/samples/V1/AlloyDBAdminClient/update_cluster.php b/AlloyDb/samples/V1/AlloyDBAdminClient/update_cluster.php index 58655649630f..17c67c5cde04 100644 --- a/AlloyDb/samples/V1/AlloyDBAdminClient/update_cluster.php +++ b/AlloyDb/samples/V1/AlloyDBAdminClient/update_cluster.php @@ -36,7 +36,7 @@ * @param string $formattedClusterNetwork The resource link for the VPC network in which cluster resources * are created and from which they are accessible via Private IP. The network * must belong to the same project as the cluster. It is specified in the - * form: "projects/{project}/global/networks/{network_id}". This is required + * form: `projects/{project}/global/networks/{network_id}`. This is required * to create a cluster. Deprecated, use network_config.network instead. Please see * {@see AlloyDBAdminClient::networkName()} for help formatting this field. */ diff --git a/AlloyDb/src/V1/Backup.php b/AlloyDb/src/V1/Backup.php index eb9d0691371e..3d01d0602fea 100644 --- a/AlloyDb/src/V1/Backup.php +++ b/AlloyDb/src/V1/Backup.php @@ -158,6 +158,12 @@ class Backup extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.alloydb.v1.Backup.QuantityBasedExpiry expiry_quantity = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ protected $expiry_quantity = null; + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $satisfies_pzs = false; /** * Output only. The database engine major version of the cluster this backup * was created from. Any restored cluster created from this backup will have @@ -166,6 +172,17 @@ class Backup extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.alloydb.v1.DatabaseVersion database_version = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ protected $database_version = 0; + /** + * Optional. Input only. Immutable. Tag keys/values directly bound to this + * resource. For example: + * ``` + * "123/environment": "production", + * "123/costCenter": "marketing" + * ``` + * + * Generated from protobuf field map tags = 25 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + */ + private $tags; /** * Constructor. @@ -236,10 +253,19 @@ class Backup extends \Google\Protobuf\Internal\Message * Output only. The QuantityBasedExpiry of the backup, specified by the * backup's retention policy. Once the expiry quantity is over retention, the * backup is eligible to be garbage collected. + * @type bool $satisfies_pzs + * Output only. Reserved for future use. * @type int $database_version * Output only. The database engine major version of the cluster this backup * was created from. Any restored cluster created from this backup will have * the same database version. + * @type array|\Google\Protobuf\Internal\MapField $tags + * Optional. Input only. Immutable. Tag keys/values directly bound to this + * resource. For example: + * ``` + * "123/environment": "production", + * "123/costCenter": "marketing" + * ``` * } */ public function __construct($data = NULL) { @@ -883,6 +909,32 @@ public function setExpiryQuantity($var) return $this; } + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzs() + { + return $this->satisfies_pzs; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + /** * Output only. The database engine major version of the cluster this backup * was created from. Any restored cluster created from this backup will have @@ -913,5 +965,41 @@ public function setDatabaseVersion($var) return $this; } + /** + * Optional. Input only. Immutable. Tag keys/values directly bound to this + * resource. For example: + * ``` + * "123/environment": "production", + * "123/costCenter": "marketing" + * ``` + * + * Generated from protobuf field map tags = 25 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getTags() + { + return $this->tags; + } + + /** + * Optional. Input only. Immutable. Tag keys/values directly bound to this + * resource. For example: + * ``` + * "123/environment": "production", + * "123/costCenter": "marketing" + * ``` + * + * Generated from protobuf field map tags = 25 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setTags($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->tags = $arr; + + return $this; + } + } diff --git a/AlloyDb/src/V1/BatchCreateInstanceStatus/State.php b/AlloyDb/src/V1/BatchCreateInstanceStatus/State.php index 1197165ad623..e5e4d8a1179b 100644 --- a/AlloyDb/src/V1/BatchCreateInstanceStatus/State.php +++ b/AlloyDb/src/V1/BatchCreateInstanceStatus/State.php @@ -23,7 +23,7 @@ class State const STATE_UNSPECIFIED = 0; /** * Instance is pending creation and has not yet been picked up for - * processsing in the backend. + * processing in the backend. * * Generated from protobuf enum PENDING_CREATE = 1; */ diff --git a/AlloyDb/src/V1/BatchCreateInstancesRequest.php b/AlloyDb/src/V1/BatchCreateInstancesRequest.php index 5be73ca95737..638507a533ef 100644 --- a/AlloyDb/src/V1/BatchCreateInstancesRequest.php +++ b/AlloyDb/src/V1/BatchCreateInstancesRequest.php @@ -29,13 +29,13 @@ class BatchCreateInstancesRequest extends \Google\Protobuf\Internal\Message protected $requests = null; /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -56,13 +56,13 @@ class BatchCreateInstancesRequest extends \Google\Protobuf\Internal\Message * Required. Resources being created. * @type string $request_id * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -137,13 +137,13 @@ public function setRequests($var) /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -158,13 +158,13 @@ public function getRequestId() /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). diff --git a/AlloyDb/src/V1/Client/AlloyDBAdminClient.php b/AlloyDb/src/V1/Client/AlloyDBAdminClient.php index a53f30a4baf3..dabcddfb3eb2 100644 --- a/AlloyDb/src/V1/Client/AlloyDBAdminClient.php +++ b/AlloyDb/src/V1/Client/AlloyDBAdminClient.php @@ -48,6 +48,8 @@ use Google\Cloud\AlloyDb\V1\DeleteClusterRequest; use Google\Cloud\AlloyDb\V1\DeleteInstanceRequest; use Google\Cloud\AlloyDb\V1\DeleteUserRequest; +use Google\Cloud\AlloyDb\V1\ExecuteSqlRequest; +use Google\Cloud\AlloyDb\V1\ExecuteSqlResponse; use Google\Cloud\AlloyDb\V1\FailoverInstanceRequest; use Google\Cloud\AlloyDb\V1\GenerateClientCertificateRequest; use Google\Cloud\AlloyDb\V1\GenerateClientCertificateResponse; @@ -60,12 +62,14 @@ use Google\Cloud\AlloyDb\V1\Instance; use Google\Cloud\AlloyDb\V1\ListBackupsRequest; use Google\Cloud\AlloyDb\V1\ListClustersRequest; +use Google\Cloud\AlloyDb\V1\ListDatabasesRequest; use Google\Cloud\AlloyDb\V1\ListInstancesRequest; use Google\Cloud\AlloyDb\V1\ListSupportedDatabaseFlagsRequest; use Google\Cloud\AlloyDb\V1\ListUsersRequest; use Google\Cloud\AlloyDb\V1\PromoteClusterRequest; use Google\Cloud\AlloyDb\V1\RestartInstanceRequest; use Google\Cloud\AlloyDb\V1\RestoreClusterRequest; +use Google\Cloud\AlloyDb\V1\SwitchoverClusterRequest; use Google\Cloud\AlloyDb\V1\UpdateBackupRequest; use Google\Cloud\AlloyDb\V1\UpdateClusterRequest; use Google\Cloud\AlloyDb\V1\UpdateInstanceRequest; @@ -100,6 +104,7 @@ * @method PromiseInterface deleteClusterAsync(DeleteClusterRequest $request, array $optionalArgs = []) * @method PromiseInterface deleteInstanceAsync(DeleteInstanceRequest $request, array $optionalArgs = []) * @method PromiseInterface deleteUserAsync(DeleteUserRequest $request, array $optionalArgs = []) + * @method PromiseInterface executeSqlAsync(ExecuteSqlRequest $request, array $optionalArgs = []) * @method PromiseInterface failoverInstanceAsync(FailoverInstanceRequest $request, array $optionalArgs = []) * @method PromiseInterface generateClientCertificateAsync(GenerateClientCertificateRequest $request, array $optionalArgs = []) * @method PromiseInterface getBackupAsync(GetBackupRequest $request, array $optionalArgs = []) @@ -110,12 +115,14 @@ * @method PromiseInterface injectFaultAsync(InjectFaultRequest $request, array $optionalArgs = []) * @method PromiseInterface listBackupsAsync(ListBackupsRequest $request, array $optionalArgs = []) * @method PromiseInterface listClustersAsync(ListClustersRequest $request, array $optionalArgs = []) + * @method PromiseInterface listDatabasesAsync(ListDatabasesRequest $request, array $optionalArgs = []) * @method PromiseInterface listInstancesAsync(ListInstancesRequest $request, array $optionalArgs = []) * @method PromiseInterface listSupportedDatabaseFlagsAsync(ListSupportedDatabaseFlagsRequest $request, array $optionalArgs = []) * @method PromiseInterface listUsersAsync(ListUsersRequest $request, array $optionalArgs = []) * @method PromiseInterface promoteClusterAsync(PromoteClusterRequest $request, array $optionalArgs = []) * @method PromiseInterface restartInstanceAsync(RestartInstanceRequest $request, array $optionalArgs = []) * @method PromiseInterface restoreClusterAsync(RestoreClusterRequest $request, array $optionalArgs = []) + * @method PromiseInterface switchoverClusterAsync(SwitchoverClusterRequest $request, array $optionalArgs = []) * @method PromiseInterface updateBackupAsync(UpdateBackupRequest $request, array $optionalArgs = []) * @method PromiseInterface updateClusterAsync(UpdateClusterRequest $request, array $optionalArgs = []) * @method PromiseInterface updateInstanceAsync(UpdateInstanceRequest $request, array $optionalArgs = []) @@ -765,6 +772,32 @@ public function deleteUser(DeleteUserRequest $request, array $callOptions = []): $this->startApiCall('DeleteUser', $request, $callOptions)->wait(); } + /** + * Executes a SQL statement in a database inside an AlloyDB instance. + * + * The async variant is {@see AlloyDBAdminClient::executeSqlAsync()} . + * + * @example samples/V1/AlloyDBAdminClient/execute_sql.php + * + * @param ExecuteSqlRequest $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 ExecuteSqlResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function executeSql(ExecuteSqlRequest $request, array $callOptions = []): ExecuteSqlResponse + { + return $this->startApiCall('ExecuteSql', $request, $callOptions)->wait(); + } + /** * Forces a Failover for a highly available instance. * Failover promotes the HA standby instance as the new primary. @@ -1035,6 +1068,32 @@ public function listClusters(ListClustersRequest $request, array $callOptions = return $this->startApiCall('ListClusters', $request, $callOptions); } + /** + * Lists Databases in a given project and location. + * + * The async variant is {@see AlloyDBAdminClient::listDatabasesAsync()} . + * + * @example samples/V1/AlloyDBAdminClient/list_databases.php + * + * @param ListDatabasesRequest $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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listDatabases(ListDatabasesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListDatabases', $request, $callOptions); + } + /** * Lists Instances in a given project and location. * @@ -1200,6 +1259,34 @@ public function restoreCluster(RestoreClusterRequest $request, array $callOption return $this->startApiCall('RestoreCluster', $request, $callOptions)->wait(); } + /** + * Switches the roles of PRIMARY and SECONDARY clusters without any data loss. + * This promotes the SECONDARY cluster to PRIMARY and sets up the original + * PRIMARY cluster to replicate from this newly promoted cluster. + * + * The async variant is {@see AlloyDBAdminClient::switchoverClusterAsync()} . + * + * @example samples/V1/AlloyDBAdminClient/switchover_cluster.php + * + * @param SwitchoverClusterRequest $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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function switchoverCluster(SwitchoverClusterRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SwitchoverCluster', $request, $callOptions)->wait(); + } + /** * Updates the parameters of a single Backup. * diff --git a/AlloyDb/src/V1/Cluster.php b/AlloyDb/src/V1/Cluster.php index 7a3c30dcc531..fb37d3ae0ec5 100644 --- a/AlloyDb/src/V1/Cluster.php +++ b/AlloyDb/src/V1/Cluster.php @@ -97,7 +97,7 @@ class Cluster extends \Google\Protobuf\Internal\Message * Required. The resource link for the VPC network in which cluster resources * are created and from which they are accessible via Private IP. The network * must belong to the same project as the cluster. It is specified in the - * form: "projects/{project}/global/networks/{network_id}". This is required + * form: `projects/{project}/global/networks/{network_id}`. This is required * to create a cluster. Deprecated, use network_config.network instead. * * Generated from protobuf field string network = 10 [deprecated = true, (.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { @@ -193,6 +193,56 @@ class Cluster extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.alloydb.v1.Cluster.PrimaryConfig primary_config = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ protected $primary_config = null; + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 30 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $satisfies_pzs = false; + /** + * Optional. The configuration for Private Service Connect (PSC) for the + * cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Cluster.PscConfig psc_config = 31 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $psc_config = null; + /** + * Optional. The maintenance update policy determines when to allow or deny + * updates. + * + * Generated from protobuf field .google.cloud.alloydb.v1.MaintenanceUpdatePolicy maintenance_update_policy = 32 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $maintenance_update_policy = null; + /** + * Output only. The maintenance schedule for the cluster, generated for a + * specific rollout if a maintenance window is set. + * + * Generated from protobuf field .google.cloud.alloydb.v1.MaintenanceSchedule maintenance_schedule = 37 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $maintenance_schedule = null; + /** + * Optional. Subscription type of the cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1.SubscriptionType subscription_type = 38 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $subscription_type = 0; + /** + * Output only. Metadata for free trial clusters + * + * Generated from protobuf field .google.cloud.alloydb.v1.Cluster.TrialMetadata trial_metadata = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $trial_metadata = null; + /** + * Optional. Input only. Immutable. Tag keys/values directly bound to this + * resource. For example: + * ``` + * "123/environment": "production", + * "123/costCenter": "marketing" + * ``` + * + * Generated from protobuf field map tags = 41 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + */ + private $tags; protected $source; /** @@ -242,7 +292,7 @@ class Cluster extends \Google\Protobuf\Internal\Message * Required. The resource link for the VPC network in which cluster resources * are created and from which they are accessible via Private IP. The network * must belong to the same project as the cluster. It is specified in the - * form: "projects/{project}/global/networks/{network_id}". This is required + * form: `projects/{project}/global/networks/{network_id}`. This is required * to create a cluster. Deprecated, use network_config.network instead. * @type string $etag * For Resource freshness validation (https://google.aip.dev/154) @@ -284,6 +334,28 @@ class Cluster extends \Google\Protobuf\Internal\Message * Cross Region replication config specific to SECONDARY cluster. * @type \Google\Cloud\AlloyDb\V1\Cluster\PrimaryConfig $primary_config * Output only. Cross Region replication config specific to PRIMARY cluster. + * @type bool $satisfies_pzs + * Output only. Reserved for future use. + * @type \Google\Cloud\AlloyDb\V1\Cluster\PscConfig $psc_config + * Optional. The configuration for Private Service Connect (PSC) for the + * cluster. + * @type \Google\Cloud\AlloyDb\V1\MaintenanceUpdatePolicy $maintenance_update_policy + * Optional. The maintenance update policy determines when to allow or deny + * updates. + * @type \Google\Cloud\AlloyDb\V1\MaintenanceSchedule $maintenance_schedule + * Output only. The maintenance schedule for the cluster, generated for a + * specific rollout if a maintenance window is set. + * @type int $subscription_type + * Optional. Subscription type of the cluster. + * @type \Google\Cloud\AlloyDb\V1\Cluster\TrialMetadata $trial_metadata + * Output only. Metadata for free trial clusters + * @type array|\Google\Protobuf\Internal\MapField $tags + * Optional. Input only. Immutable. Tag keys/values directly bound to this + * resource. For example: + * ``` + * "123/environment": "production", + * "123/costCenter": "marketing" + * ``` * } */ public function __construct($data = NULL) { @@ -703,7 +775,7 @@ public function setNetworkConfig($var) * Required. The resource link for the VPC network in which cluster resources * are created and from which they are accessible via Private IP. The network * must belong to the same project as the cluster. It is specified in the - * form: "projects/{project}/global/networks/{network_id}". This is required + * form: `projects/{project}/global/networks/{network_id}`. This is required * to create a cluster. Deprecated, use network_config.network instead. * * Generated from protobuf field string network = 10 [deprecated = true, (.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { @@ -720,7 +792,7 @@ public function getNetwork() * Required. The resource link for the VPC network in which cluster resources * are created and from which they are accessible via Private IP. The network * must belong to the same project as the cluster. It is specified in the - * form: "projects/{project}/global/networks/{network_id}". This is required + * form: `projects/{project}/global/networks/{network_id}`. This is required * to create a cluster. Deprecated, use network_config.network instead. * * Generated from protobuf field string network = 10 [deprecated = true, (.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { @@ -1177,6 +1249,244 @@ public function setPrimaryConfig($var) return $this; } + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 30 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzs() + { + return $this->satisfies_pzs; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 30 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + + /** + * Optional. The configuration for Private Service Connect (PSC) for the + * cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Cluster.PscConfig psc_config = 31 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\AlloyDb\V1\Cluster\PscConfig|null + */ + public function getPscConfig() + { + return $this->psc_config; + } + + public function hasPscConfig() + { + return isset($this->psc_config); + } + + public function clearPscConfig() + { + unset($this->psc_config); + } + + /** + * Optional. The configuration for Private Service Connect (PSC) for the + * cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Cluster.PscConfig psc_config = 31 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\AlloyDb\V1\Cluster\PscConfig $var + * @return $this + */ + public function setPscConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\Cluster\PscConfig::class); + $this->psc_config = $var; + + return $this; + } + + /** + * Optional. The maintenance update policy determines when to allow or deny + * updates. + * + * Generated from protobuf field .google.cloud.alloydb.v1.MaintenanceUpdatePolicy maintenance_update_policy = 32 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\AlloyDb\V1\MaintenanceUpdatePolicy|null + */ + public function getMaintenanceUpdatePolicy() + { + return $this->maintenance_update_policy; + } + + public function hasMaintenanceUpdatePolicy() + { + return isset($this->maintenance_update_policy); + } + + public function clearMaintenanceUpdatePolicy() + { + unset($this->maintenance_update_policy); + } + + /** + * Optional. The maintenance update policy determines when to allow or deny + * updates. + * + * Generated from protobuf field .google.cloud.alloydb.v1.MaintenanceUpdatePolicy maintenance_update_policy = 32 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\AlloyDb\V1\MaintenanceUpdatePolicy $var + * @return $this + */ + public function setMaintenanceUpdatePolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\MaintenanceUpdatePolicy::class); + $this->maintenance_update_policy = $var; + + return $this; + } + + /** + * Output only. The maintenance schedule for the cluster, generated for a + * specific rollout if a maintenance window is set. + * + * Generated from protobuf field .google.cloud.alloydb.v1.MaintenanceSchedule maintenance_schedule = 37 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\AlloyDb\V1\MaintenanceSchedule|null + */ + public function getMaintenanceSchedule() + { + return $this->maintenance_schedule; + } + + public function hasMaintenanceSchedule() + { + return isset($this->maintenance_schedule); + } + + public function clearMaintenanceSchedule() + { + unset($this->maintenance_schedule); + } + + /** + * Output only. The maintenance schedule for the cluster, generated for a + * specific rollout if a maintenance window is set. + * + * Generated from protobuf field .google.cloud.alloydb.v1.MaintenanceSchedule maintenance_schedule = 37 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\AlloyDb\V1\MaintenanceSchedule $var + * @return $this + */ + public function setMaintenanceSchedule($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\MaintenanceSchedule::class); + $this->maintenance_schedule = $var; + + return $this; + } + + /** + * Optional. Subscription type of the cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1.SubscriptionType subscription_type = 38 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getSubscriptionType() + { + return $this->subscription_type; + } + + /** + * Optional. Subscription type of the cluster. + * + * Generated from protobuf field .google.cloud.alloydb.v1.SubscriptionType subscription_type = 38 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setSubscriptionType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\SubscriptionType::class); + $this->subscription_type = $var; + + return $this; + } + + /** + * Output only. Metadata for free trial clusters + * + * Generated from protobuf field .google.cloud.alloydb.v1.Cluster.TrialMetadata trial_metadata = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\AlloyDb\V1\Cluster\TrialMetadata|null + */ + public function getTrialMetadata() + { + return $this->trial_metadata; + } + + public function hasTrialMetadata() + { + return isset($this->trial_metadata); + } + + public function clearTrialMetadata() + { + unset($this->trial_metadata); + } + + /** + * Output only. Metadata for free trial clusters + * + * Generated from protobuf field .google.cloud.alloydb.v1.Cluster.TrialMetadata trial_metadata = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\AlloyDb\V1\Cluster\TrialMetadata $var + * @return $this + */ + public function setTrialMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\Cluster\TrialMetadata::class); + $this->trial_metadata = $var; + + return $this; + } + + /** + * Optional. Input only. Immutable. Tag keys/values directly bound to this + * resource. For example: + * ``` + * "123/environment": "production", + * "123/costCenter": "marketing" + * ``` + * + * Generated from protobuf field map tags = 41 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getTags() + { + return $this->tags; + } + + /** + * Optional. Input only. Immutable. Tag keys/values directly bound to this + * resource. For example: + * ``` + * "123/environment": "production", + * "123/costCenter": "marketing" + * ``` + * + * Generated from protobuf field map tags = 41 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setTags($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->tags = $arr; + + return $this; + } + /** * @return string */ diff --git a/AlloyDb/src/V1/Cluster/NetworkConfig.php b/AlloyDb/src/V1/Cluster/NetworkConfig.php index 38e319e5da18..08a44dcb134f 100644 --- a/AlloyDb/src/V1/Cluster/NetworkConfig.php +++ b/AlloyDb/src/V1/Cluster/NetworkConfig.php @@ -16,14 +16,14 @@ class NetworkConfig extends \Google\Protobuf\Internal\Message { /** - * Required. The resource link for the VPC network in which cluster + * Optional. The resource link for the VPC network in which cluster * resources are created and from which they are accessible via Private IP. * The network must belong to the same project as the cluster. It is * specified in the form: - * "projects/{project_number}/global/networks/{network_id}". This is + * `projects/{project_number}/global/networks/{network_id}`. This is * required to create a cluster. * - * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { */ protected $network = ''; /** @@ -46,11 +46,11 @@ class NetworkConfig extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $network - * Required. The resource link for the VPC network in which cluster + * Optional. The resource link for the VPC network in which cluster * resources are created and from which they are accessible via Private IP. * The network must belong to the same project as the cluster. It is * specified in the form: - * "projects/{project_number}/global/networks/{network_id}". This is + * `projects/{project_number}/global/networks/{network_id}`. This is * required to create a cluster. * @type string $allocated_ip_range * Optional. Name of the allocated IP range for the private IP AlloyDB @@ -68,14 +68,14 @@ public function __construct($data = NULL) { } /** - * Required. The resource link for the VPC network in which cluster + * Optional. The resource link for the VPC network in which cluster * resources are created and from which they are accessible via Private IP. * The network must belong to the same project as the cluster. It is * specified in the form: - * "projects/{project_number}/global/networks/{network_id}". This is + * `projects/{project_number}/global/networks/{network_id}`. This is * required to create a cluster. * - * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { * @return string */ public function getNetwork() @@ -84,14 +84,14 @@ public function getNetwork() } /** - * Required. The resource link for the VPC network in which cluster + * Optional. The resource link for the VPC network in which cluster * resources are created and from which they are accessible via Private IP. * The network must belong to the same project as the cluster. It is * specified in the form: - * "projects/{project_number}/global/networks/{network_id}". This is + * `projects/{project_number}/global/networks/{network_id}`. This is * required to create a cluster. * - * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { * @param string $var * @return $this */ diff --git a/AlloyDb/src/V1/Cluster/PscConfig.php b/AlloyDb/src/V1/Cluster/PscConfig.php new file mode 100644 index 000000000000..6264b574acdc --- /dev/null +++ b/AlloyDb/src/V1/Cluster/PscConfig.php @@ -0,0 +1,72 @@ +google.cloud.alloydb.v1.Cluster.PscConfig + */ +class PscConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Create an instance that allows connections from Private Service + * Connect endpoints to the instance. + * + * Generated from protobuf field bool psc_enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $psc_enabled = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $psc_enabled + * Optional. Create an instance that allows connections from Private Service + * Connect endpoints to the instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Create an instance that allows connections from Private Service + * Connect endpoints to the instance. + * + * Generated from protobuf field bool psc_enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getPscEnabled() + { + return $this->psc_enabled; + } + + /** + * Optional. Create an instance that allows connections from Private Service + * Connect endpoints to the instance. + * + * Generated from protobuf field bool psc_enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setPscEnabled($var) + { + GPBUtil::checkBool($var); + $this->psc_enabled = $var; + + return $this; + } + +} + + diff --git a/AlloyDb/src/V1/Cluster/TrialMetadata.php b/AlloyDb/src/V1/Cluster/TrialMetadata.php new file mode 100644 index 000000000000..54be80c90f8c --- /dev/null +++ b/AlloyDb/src/V1/Cluster/TrialMetadata.php @@ -0,0 +1,210 @@ +google.cloud.alloydb.v1.Cluster.TrialMetadata + */ +class TrialMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * start time of the trial cluster. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + */ + protected $start_time = null; + /** + * End time of the trial cluster. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + */ + protected $end_time = null; + /** + * Upgrade time of trial cluster to Standard cluster. + * + * Generated from protobuf field .google.protobuf.Timestamp upgrade_time = 3; + */ + protected $upgrade_time = null; + /** + * grace end time of the cluster. + * + * Generated from protobuf field .google.protobuf.Timestamp grace_end_time = 4; + */ + protected $grace_end_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $start_time + * start time of the trial cluster. + * @type \Google\Protobuf\Timestamp $end_time + * End time of the trial cluster. + * @type \Google\Protobuf\Timestamp $upgrade_time + * Upgrade time of trial cluster to Standard cluster. + * @type \Google\Protobuf\Timestamp $grace_end_time + * grace end time of the cluster. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * start time of the trial cluster. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * start time of the trial cluster. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * End time of the trial cluster. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * End time of the trial cluster. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Upgrade time of trial cluster to Standard cluster. + * + * Generated from protobuf field .google.protobuf.Timestamp upgrade_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpgradeTime() + { + return $this->upgrade_time; + } + + public function hasUpgradeTime() + { + return isset($this->upgrade_time); + } + + public function clearUpgradeTime() + { + unset($this->upgrade_time); + } + + /** + * Upgrade time of trial cluster to Standard cluster. + * + * Generated from protobuf field .google.protobuf.Timestamp upgrade_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpgradeTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->upgrade_time = $var; + + return $this; + } + + /** + * grace end time of the cluster. + * + * Generated from protobuf field .google.protobuf.Timestamp grace_end_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getGraceEndTime() + { + return $this->grace_end_time; + } + + public function hasGraceEndTime() + { + return isset($this->grace_end_time); + } + + public function clearGraceEndTime() + { + unset($this->grace_end_time); + } + + /** + * grace end time of the cluster. + * + * Generated from protobuf field .google.protobuf.Timestamp grace_end_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setGraceEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->grace_end_time = $var; + + return $this; + } + +} + + diff --git a/AlloyDb/src/V1/ConnectionInfo.php b/AlloyDb/src/V1/ConnectionInfo.php index 6232de3da334..c037ffcc12d2 100644 --- a/AlloyDb/src/V1/ConnectionInfo.php +++ b/AlloyDb/src/V1/ConnectionInfo.php @@ -32,6 +32,14 @@ class ConnectionInfo extends \Google\Protobuf\Internal\Message * Generated from protobuf field string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ protected $ip_address = ''; + /** + * Output only. The public IP addresses for the Instance. This is available + * ONLY when enable_public_ip is set. This is the connection endpoint for an + * end-user application. + * + * Generated from protobuf field string public_ip_address = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { + */ + protected $public_ip_address = ''; /** * Output only. The unique ID of the Instance. * @@ -53,6 +61,10 @@ class ConnectionInfo extends \Google\Protobuf\Internal\Message * Output only. The private network IP address for the Instance. This is the * default IP for the instance and is always created (even if enable_public_ip * is set). This is the connection endpoint for an end-user application. + * @type string $public_ip_address + * Output only. The public IP addresses for the Instance. This is available + * ONLY when enable_public_ip is set. This is the connection endpoint for an + * end-user application. * @type string $instance_uid * Output only. The unique ID of the Instance. * } @@ -122,6 +134,36 @@ public function setIpAddress($var) return $this; } + /** + * Output only. The public IP addresses for the Instance. This is available + * ONLY when enable_public_ip is set. This is the connection endpoint for an + * end-user application. + * + * Generated from protobuf field string public_ip_address = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { + * @return string + */ + public function getPublicIpAddress() + { + return $this->public_ip_address; + } + + /** + * Output only. The public IP addresses for the Instance. This is available + * ONLY when enable_public_ip is set. This is the connection endpoint for an + * end-user application. + * + * Generated from protobuf field string public_ip_address = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setPublicIpAddress($var) + { + GPBUtil::checkString($var, True); + $this->public_ip_address = $var; + + return $this; + } + /** * Output only. The unique ID of the Instance. * diff --git a/AlloyDb/src/V1/CreateBackupRequest.php b/AlloyDb/src/V1/CreateBackupRequest.php index 8311f1385500..4eedda5e924c 100644 --- a/AlloyDb/src/V1/CreateBackupRequest.php +++ b/AlloyDb/src/V1/CreateBackupRequest.php @@ -35,13 +35,13 @@ class CreateBackupRequest extends \Google\Protobuf\Internal\Message protected $backup = null; /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -89,13 +89,13 @@ public static function build(string $parent, \Google\Cloud\AlloyDb\V1\Backup $ba * Required. The resource being created * @type string $request_id * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -199,13 +199,13 @@ public function setBackup($var) /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -220,13 +220,13 @@ public function getRequestId() /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). diff --git a/AlloyDb/src/V1/CreateClusterRequest.php b/AlloyDb/src/V1/CreateClusterRequest.php index 7904fcc3a9a4..4bccb5c86b9c 100644 --- a/AlloyDb/src/V1/CreateClusterRequest.php +++ b/AlloyDb/src/V1/CreateClusterRequest.php @@ -36,13 +36,13 @@ class CreateClusterRequest extends \Google\Protobuf\Internal\Message protected $cluster = null; /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -51,9 +51,9 @@ class CreateClusterRequest extends \Google\Protobuf\Internal\Message */ protected $request_id = ''; /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -93,20 +93,20 @@ public static function build(string $parent, \Google\Cloud\AlloyDb\V1\Cluster $c * Required. The resource being created * @type string $request_id * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * } */ public function __construct($data = NULL) { @@ -206,13 +206,13 @@ public function setCluster($var) /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -227,13 +227,13 @@ public function getRequestId() /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -251,9 +251,9 @@ public function setRequestId($var) } /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; * @return bool @@ -264,9 +264,9 @@ public function getValidateOnly() } /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; * @param bool $var diff --git a/AlloyDb/src/V1/CreateInstanceRequest.php b/AlloyDb/src/V1/CreateInstanceRequest.php index 8da4cc57bd3d..27a56f4d8b4a 100644 --- a/AlloyDb/src/V1/CreateInstanceRequest.php +++ b/AlloyDb/src/V1/CreateInstanceRequest.php @@ -36,13 +36,13 @@ class CreateInstanceRequest extends \Google\Protobuf\Internal\Message protected $instance = null; /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -51,9 +51,9 @@ class CreateInstanceRequest extends \Google\Protobuf\Internal\Message */ protected $request_id = ''; /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -93,20 +93,20 @@ public static function build(string $parent, \Google\Cloud\AlloyDb\V1\Instance $ * Required. The resource being created * @type string $request_id * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * } */ public function __construct($data = NULL) { @@ -206,13 +206,13 @@ public function setInstance($var) /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -227,13 +227,13 @@ public function getRequestId() /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -251,9 +251,9 @@ public function setRequestId($var) } /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; * @return bool @@ -264,9 +264,9 @@ public function getValidateOnly() } /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; * @param bool $var diff --git a/AlloyDb/src/V1/CreateSecondaryClusterRequest.php b/AlloyDb/src/V1/CreateSecondaryClusterRequest.php index 11b2c6c2e1ec..2f275466f8bc 100644 --- a/AlloyDb/src/V1/CreateSecondaryClusterRequest.php +++ b/AlloyDb/src/V1/CreateSecondaryClusterRequest.php @@ -34,13 +34,13 @@ class CreateSecondaryClusterRequest extends \Google\Protobuf\Internal\Message protected $cluster = null; /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -49,9 +49,9 @@ class CreateSecondaryClusterRequest extends \Google\Protobuf\Internal\Message */ protected $request_id = ''; /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -91,20 +91,20 @@ public static function build(string $parent, \Google\Cloud\AlloyDb\V1\Cluster $c * Required. Configuration of the requesting object (the secondary cluster). * @type string $request_id * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * } */ public function __construct($data = NULL) { @@ -204,13 +204,13 @@ public function setCluster($var) /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -225,13 +225,13 @@ public function getRequestId() /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -249,9 +249,9 @@ public function setRequestId($var) } /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; * @return bool @@ -262,9 +262,9 @@ public function getValidateOnly() } /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; * @param bool $var diff --git a/AlloyDb/src/V1/CreateSecondaryInstanceRequest.php b/AlloyDb/src/V1/CreateSecondaryInstanceRequest.php index a7f3586d36a0..0ba7eb3b2352 100644 --- a/AlloyDb/src/V1/CreateSecondaryInstanceRequest.php +++ b/AlloyDb/src/V1/CreateSecondaryInstanceRequest.php @@ -36,13 +36,13 @@ class CreateSecondaryInstanceRequest extends \Google\Protobuf\Internal\Message protected $instance = null; /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -51,9 +51,9 @@ class CreateSecondaryInstanceRequest extends \Google\Protobuf\Internal\Message */ protected $request_id = ''; /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -93,20 +93,20 @@ public static function build(string $parent, \Google\Cloud\AlloyDb\V1\Instance $ * Required. The resource being created * @type string $request_id * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * } */ public function __construct($data = NULL) { @@ -206,13 +206,13 @@ public function setInstance($var) /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -227,13 +227,13 @@ public function getRequestId() /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -251,9 +251,9 @@ public function setRequestId($var) } /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; * @return bool @@ -264,9 +264,9 @@ public function getValidateOnly() } /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; * @param bool $var diff --git a/AlloyDb/src/V1/CreateUserRequest.php b/AlloyDb/src/V1/CreateUserRequest.php index 3fe9ac1ec46b..6985a4a313b1 100644 --- a/AlloyDb/src/V1/CreateUserRequest.php +++ b/AlloyDb/src/V1/CreateUserRequest.php @@ -35,13 +35,13 @@ class CreateUserRequest extends \Google\Protobuf\Internal\Message protected $user = null; /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -89,13 +89,13 @@ public static function build(string $parent, \Google\Cloud\AlloyDb\V1\User $user * Required. The resource being created * @type string $request_id * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -199,13 +199,13 @@ public function setUser($var) /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -220,13 +220,13 @@ public function getRequestId() /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). diff --git a/AlloyDb/src/V1/Database.php b/AlloyDb/src/V1/Database.php new file mode 100644 index 000000000000..532aefbcfc1b --- /dev/null +++ b/AlloyDb/src/V1/Database.php @@ -0,0 +1,155 @@ +google.cloud.alloydb.v1.Database + */ +class Database extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. Name of the resource in the form of + * `projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Optional. Charset for the database. + * This field can contain any PostgreSQL supported charset name. + * Example values include "UTF8", "SQL_ASCII", etc. + * + * Generated from protobuf field string charset = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $charset = ''; + /** + * Optional. Collation for the database. + * Name of the custom or native collation for postgres. + * Example values include "C", "POSIX", etc + * + * Generated from protobuf field string collation = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $collation = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. Name of the resource in the form of + * `projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}`. + * @type string $charset + * Optional. Charset for the database. + * This field can contain any PostgreSQL supported charset name. + * Example values include "UTF8", "SQL_ASCII", etc. + * @type string $collation + * Optional. Collation for the database. + * Name of the custom or native collation for postgres. + * Example values include "C", "POSIX", etc + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. Name of the resource in the form of + * `projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. Name of the resource in the form of + * `projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Charset for the database. + * This field can contain any PostgreSQL supported charset name. + * Example values include "UTF8", "SQL_ASCII", etc. + * + * Generated from protobuf field string charset = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getCharset() + { + return $this->charset; + } + + /** + * Optional. Charset for the database. + * This field can contain any PostgreSQL supported charset name. + * Example values include "UTF8", "SQL_ASCII", etc. + * + * Generated from protobuf field string charset = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setCharset($var) + { + GPBUtil::checkString($var, True); + $this->charset = $var; + + return $this; + } + + /** + * Optional. Collation for the database. + * Name of the custom or native collation for postgres. + * Example values include "C", "POSIX", etc + * + * Generated from protobuf field string collation = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getCollation() + { + return $this->collation; + } + + /** + * Optional. Collation for the database. + * Name of the custom or native collation for postgres. + * Example values include "C", "POSIX", etc + * + * Generated from protobuf field string collation = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setCollation($var) + { + GPBUtil::checkString($var, True); + $this->collation = $var; + + return $this; + } + +} + diff --git a/AlloyDb/src/V1/DatabaseVersion.php b/AlloyDb/src/V1/DatabaseVersion.php index 43b351f9d5d9..8bfebc860bb2 100644 --- a/AlloyDb/src/V1/DatabaseVersion.php +++ b/AlloyDb/src/V1/DatabaseVersion.php @@ -31,11 +31,25 @@ class DatabaseVersion * Generated from protobuf enum POSTGRES_14 = 2; */ const POSTGRES_14 = 2; + /** + * The database version is Postgres 15. + * + * Generated from protobuf enum POSTGRES_15 = 3; + */ + const POSTGRES_15 = 3; + /** + * The database version is Postgres 16. + * + * Generated from protobuf enum POSTGRES_16 = 4; + */ + const POSTGRES_16 = 4; private static $valueToName = [ self::DATABASE_VERSION_UNSPECIFIED => 'DATABASE_VERSION_UNSPECIFIED', self::POSTGRES_13 => 'POSTGRES_13', self::POSTGRES_14 => 'POSTGRES_14', + self::POSTGRES_15 => 'POSTGRES_15', + self::POSTGRES_16 => 'POSTGRES_16', ]; public static function name($value) diff --git a/AlloyDb/src/V1/DeleteBackupRequest.php b/AlloyDb/src/V1/DeleteBackupRequest.php index 8b9db4c24a07..7d9e222ccca8 100644 --- a/AlloyDb/src/V1/DeleteBackupRequest.php +++ b/AlloyDb/src/V1/DeleteBackupRequest.php @@ -24,13 +24,13 @@ class DeleteBackupRequest extends \Google\Protobuf\Internal\Message protected $name = ''; /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -80,13 +80,13 @@ public static function build(string $name): self * the Backup.name field. * @type string $request_id * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -134,13 +134,13 @@ public function setName($var) /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -155,13 +155,13 @@ public function getRequestId() /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). diff --git a/AlloyDb/src/V1/DeleteClusterRequest.php b/AlloyDb/src/V1/DeleteClusterRequest.php index 89e72f18c978..a0224fa99fca 100644 --- a/AlloyDb/src/V1/DeleteClusterRequest.php +++ b/AlloyDb/src/V1/DeleteClusterRequest.php @@ -24,13 +24,13 @@ class DeleteClusterRequest extends \Google\Protobuf\Internal\Message protected $name = ''; /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -47,8 +47,9 @@ class DeleteClusterRequest extends \Google\Protobuf\Internal\Message */ protected $etag = ''; /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -86,13 +87,13 @@ public static function build(string $name): self * comment on the Cluster.name field. * @type string $request_id * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -101,8 +102,9 @@ public static function build(string $name): self * If an etag is provided and does not match the current etag of the Cluster, * deletion will be blocked and an ABORTED error will be returned. * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * @type bool $force * Optional. Whether to cascade delete child instances for given cluster. * } @@ -142,13 +144,13 @@ public function setName($var) /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -163,13 +165,13 @@ public function getRequestId() /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -217,8 +219,9 @@ public function setEtag($var) } /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; * @return bool @@ -229,8 +232,9 @@ public function getValidateOnly() } /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; * @param bool $var diff --git a/AlloyDb/src/V1/DeleteInstanceRequest.php b/AlloyDb/src/V1/DeleteInstanceRequest.php index 8e177fbb3777..6b04bdf45b51 100644 --- a/AlloyDb/src/V1/DeleteInstanceRequest.php +++ b/AlloyDb/src/V1/DeleteInstanceRequest.php @@ -24,13 +24,13 @@ class DeleteInstanceRequest extends \Google\Protobuf\Internal\Message protected $name = ''; /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -47,8 +47,9 @@ class DeleteInstanceRequest extends \Google\Protobuf\Internal\Message */ protected $etag = ''; /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -80,13 +81,13 @@ public static function build(string $name): self * comment on the Instance.name field. * @type string $request_id * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -95,8 +96,9 @@ public static function build(string $name): self * If an etag is provided and does not match the current etag of the Instance, * deletion will be blocked and an ABORTED error will be returned. * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * } */ public function __construct($data = NULL) { @@ -134,13 +136,13 @@ public function setName($var) /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -155,13 +157,13 @@ public function getRequestId() /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -209,8 +211,9 @@ public function setEtag($var) } /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; * @return bool @@ -221,8 +224,9 @@ public function getValidateOnly() } /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; * @param bool $var diff --git a/AlloyDb/src/V1/DeleteUserRequest.php b/AlloyDb/src/V1/DeleteUserRequest.php index 05a7ca8e1900..92f7de7ab342 100644 --- a/AlloyDb/src/V1/DeleteUserRequest.php +++ b/AlloyDb/src/V1/DeleteUserRequest.php @@ -24,13 +24,13 @@ class DeleteUserRequest extends \Google\Protobuf\Internal\Message protected $name = ''; /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -72,13 +72,13 @@ public static function build(string $name): self * comment on the User.name field. * @type string $request_id * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -122,13 +122,13 @@ public function setName($var) /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -143,13 +143,13 @@ public function getRequestId() /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). diff --git a/AlloyDb/src/V1/ExecuteSqlMetadata.php b/AlloyDb/src/V1/ExecuteSqlMetadata.php new file mode 100644 index 000000000000..7b47cf87ca66 --- /dev/null +++ b/AlloyDb/src/V1/ExecuteSqlMetadata.php @@ -0,0 +1,195 @@ +google.cloud.alloydb.v1.ExecuteSqlMetadata + */ +class ExecuteSqlMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Message related to SQL execution. Marked as core content since it + * can potentially contain details related to the query or result set. This + * field can be used to convey messages such as "when the SQL result set + * exceeds the acceptable response size limits." + * + * Generated from protobuf field string message = 1; + */ + protected $message = ''; + /** + * Set to true if SQL returned a result set larger than the acceptable + * response size limits and the result was truncated. + * + * Generated from protobuf field bool partial_result = 2; + */ + protected $partial_result = false; + /** + * The time duration taken to execute the sql statement. + * + * Generated from protobuf field .google.protobuf.Duration sql_statement_execution_duration = 3; + */ + protected $sql_statement_execution_duration = null; + /** + * Status of SQL execution. + * + * Generated from protobuf field .google.cloud.alloydb.v1.ExecuteSqlMetadata.Status status = 4; + */ + protected $status = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $message + * Message related to SQL execution. Marked as core content since it + * can potentially contain details related to the query or result set. This + * field can be used to convey messages such as "when the SQL result set + * exceeds the acceptable response size limits." + * @type bool $partial_result + * Set to true if SQL returned a result set larger than the acceptable + * response size limits and the result was truncated. + * @type \Google\Protobuf\Duration $sql_statement_execution_duration + * The time duration taken to execute the sql statement. + * @type int $status + * Status of SQL execution. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Message related to SQL execution. Marked as core content since it + * can potentially contain details related to the query or result set. This + * field can be used to convey messages such as "when the SQL result set + * exceeds the acceptable response size limits." + * + * Generated from protobuf field string message = 1; + * @return string + */ + public function getMessage() + { + return $this->message; + } + + /** + * Message related to SQL execution. Marked as core content since it + * can potentially contain details related to the query or result set. This + * field can be used to convey messages such as "when the SQL result set + * exceeds the acceptable response size limits." + * + * Generated from protobuf field string message = 1; + * @param string $var + * @return $this + */ + public function setMessage($var) + { + GPBUtil::checkString($var, True); + $this->message = $var; + + return $this; + } + + /** + * Set to true if SQL returned a result set larger than the acceptable + * response size limits and the result was truncated. + * + * Generated from protobuf field bool partial_result = 2; + * @return bool + */ + public function getPartialResult() + { + return $this->partial_result; + } + + /** + * Set to true if SQL returned a result set larger than the acceptable + * response size limits and the result was truncated. + * + * Generated from protobuf field bool partial_result = 2; + * @param bool $var + * @return $this + */ + public function setPartialResult($var) + { + GPBUtil::checkBool($var); + $this->partial_result = $var; + + return $this; + } + + /** + * The time duration taken to execute the sql statement. + * + * Generated from protobuf field .google.protobuf.Duration sql_statement_execution_duration = 3; + * @return \Google\Protobuf\Duration|null + */ + public function getSqlStatementExecutionDuration() + { + return $this->sql_statement_execution_duration; + } + + public function hasSqlStatementExecutionDuration() + { + return isset($this->sql_statement_execution_duration); + } + + public function clearSqlStatementExecutionDuration() + { + unset($this->sql_statement_execution_duration); + } + + /** + * The time duration taken to execute the sql statement. + * + * Generated from protobuf field .google.protobuf.Duration sql_statement_execution_duration = 3; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setSqlStatementExecutionDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->sql_statement_execution_duration = $var; + + return $this; + } + + /** + * Status of SQL execution. + * + * Generated from protobuf field .google.cloud.alloydb.v1.ExecuteSqlMetadata.Status status = 4; + * @return int + */ + public function getStatus() + { + return $this->status; + } + + /** + * Status of SQL execution. + * + * Generated from protobuf field .google.cloud.alloydb.v1.ExecuteSqlMetadata.Status status = 4; + * @param int $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AlloyDb\V1\ExecuteSqlMetadata\Status::class); + $this->status = $var; + + return $this; + } + +} + diff --git a/AlloyDb/src/V1/ExecuteSqlMetadata/Status.php b/AlloyDb/src/V1/ExecuteSqlMetadata/Status.php new file mode 100644 index 000000000000..ba62ca093038 --- /dev/null +++ b/AlloyDb/src/V1/ExecuteSqlMetadata/Status.php @@ -0,0 +1,77 @@ +google.cloud.alloydb.v1.ExecuteSqlMetadata.Status + */ +class Status +{ + /** + * The status is unknown. + * + * Generated from protobuf enum STATUS_UNSPECIFIED = 0; + */ + const STATUS_UNSPECIFIED = 0; + /** + * No error during SQL execution i.e. All SQL statements ran to completion. + * The "message" will be empty. + * + * Generated from protobuf enum OK = 1; + */ + const OK = 1; + /** + * Same as OK, except indicates that only partial results were + * returned. The "message" field will contain details on why results were + * truncated. + * + * Generated from protobuf enum PARTIAL = 2; + */ + const PARTIAL = 2; + /** + * Error during SQL execution. Atleast 1 SQL statement execution resulted in + * a error. Side effects of other statements are rolled back. The "message" + * field will contain human readable error given by Postgres of the first + * bad SQL statement. SQL execution errors don't constitute API errors as + * defined in https://google.aip.dev/193 but will be returned as part of + * this message. + * + * Generated from protobuf enum ERROR = 3; + */ + const ERROR = 3; + + private static $valueToName = [ + self::STATUS_UNSPECIFIED => 'STATUS_UNSPECIFIED', + self::OK => 'OK', + self::PARTIAL => 'PARTIAL', + self::ERROR => 'ERROR', + ]; + + 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/AlloyDb/src/V1/ExecuteSqlRequest.php b/AlloyDb/src/V1/ExecuteSqlRequest.php new file mode 100644 index 000000000000..55f92039e662 --- /dev/null +++ b/AlloyDb/src/V1/ExecuteSqlRequest.php @@ -0,0 +1,263 @@ +google.cloud.alloydb.v1.ExecuteSqlRequest + */ +class ExecuteSqlRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The instance where the SQL will be executed. For the required + * format, see the comment on the Instance.name field. + * + * Generated from protobuf field string instance = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $instance = ''; + /** + * Required. Name of the database where the query will be executed. + * Note - Value provided should be the same as expected from `SELECT + * current_database();` and NOT as a resource reference. + * + * Generated from protobuf field string database = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $database = ''; + /** + * Required. Database user to be used for executing the SQL. + * Note - Value provided should be the same as expected from + * `SELECT current_user;` and NOT as a resource reference. + * + * Generated from protobuf field string user = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $user = ''; + /** + * Required. SQL statement to execute on database. Any valid statement is + * permitted, including DDL, DML, DQL statements. + * + * Generated from protobuf field string sql_statement = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $sql_statement = ''; + protected $user_credential; + + /** + * @param string $instance Required. The instance where the SQL will be executed. For the required + * format, see the comment on the Instance.name field. Please see + * {@see AlloyDBAdminClient::instanceName()} for help formatting this field. + * @param string $database Required. Name of the database where the query will be executed. + * Note - Value provided should be the same as expected from `SELECT + * current_database();` and NOT as a resource reference. + * @param string $user Required. Database user to be used for executing the SQL. + * Note - Value provided should be the same as expected from + * `SELECT current_user;` and NOT as a resource reference. + * @param string $sqlStatement Required. SQL statement to execute on database. Any valid statement is + * permitted, including DDL, DML, DQL statements. + * @param string $password Optional. The database native user’s password. + * + * @return \Google\Cloud\AlloyDb\V1\ExecuteSqlRequest + * + * @experimental + */ + public static function build(string $instance, string $database, string $user, string $sqlStatement, string $password): self + { + return (new self()) + ->setInstance($instance) + ->setDatabase($database) + ->setUser($user) + ->setSqlStatement($sqlStatement) + ->setPassword($password); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $password + * Optional. The database native user’s password. + * @type string $instance + * Required. The instance where the SQL will be executed. For the required + * format, see the comment on the Instance.name field. + * @type string $database + * Required. Name of the database where the query will be executed. + * Note - Value provided should be the same as expected from `SELECT + * current_database();` and NOT as a resource reference. + * @type string $user + * Required. Database user to be used for executing the SQL. + * Note - Value provided should be the same as expected from + * `SELECT current_user;` and NOT as a resource reference. + * @type string $sql_statement + * Required. SQL statement to execute on database. Any valid statement is + * permitted, including DDL, DML, DQL statements. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The database native user’s password. + * + * Generated from protobuf field string password = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPassword() + { + return $this->readOneof(5); + } + + public function hasPassword() + { + return $this->hasOneof(5); + } + + /** + * Optional. The database native user’s password. + * + * Generated from protobuf field string password = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPassword($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Required. The instance where the SQL will be executed. For the required + * format, see the comment on the Instance.name field. + * + * Generated from protobuf field string instance = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * Required. The instance where the SQL will be executed. For the required + * format, see the comment on the Instance.name field. + * + * Generated from protobuf field string instance = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkString($var, True); + $this->instance = $var; + + return $this; + } + + /** + * Required. Name of the database where the query will be executed. + * Note - Value provided should be the same as expected from `SELECT + * current_database();` and NOT as a resource reference. + * + * Generated from protobuf field string database = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDatabase() + { + return $this->database; + } + + /** + * Required. Name of the database where the query will be executed. + * Note - Value provided should be the same as expected from `SELECT + * current_database();` and NOT as a resource reference. + * + * Generated from protobuf field string database = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDatabase($var) + { + GPBUtil::checkString($var, True); + $this->database = $var; + + return $this; + } + + /** + * Required. Database user to be used for executing the SQL. + * Note - Value provided should be the same as expected from + * `SELECT current_user;` and NOT as a resource reference. + * + * Generated from protobuf field string user = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUser() + { + return $this->user; + } + + /** + * Required. Database user to be used for executing the SQL. + * Note - Value provided should be the same as expected from + * `SELECT current_user;` and NOT as a resource reference. + * + * Generated from protobuf field string user = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setUser($var) + { + GPBUtil::checkString($var, True); + $this->user = $var; + + return $this; + } + + /** + * Required. SQL statement to execute on database. Any valid statement is + * permitted, including DDL, DML, DQL statements. + * + * Generated from protobuf field string sql_statement = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSqlStatement() + { + return $this->sql_statement; + } + + /** + * Required. SQL statement to execute on database. Any valid statement is + * permitted, including DDL, DML, DQL statements. + * + * Generated from protobuf field string sql_statement = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSqlStatement($var) + { + GPBUtil::checkString($var, True); + $this->sql_statement = $var; + + return $this; + } + + /** + * @return string + */ + public function getUserCredential() + { + return $this->whichOneof("user_credential"); + } + +} + diff --git a/AlloyDb/src/V1/ExecuteSqlResponse.php b/AlloyDb/src/V1/ExecuteSqlResponse.php new file mode 100644 index 000000000000..3e192ce9f60f --- /dev/null +++ b/AlloyDb/src/V1/ExecuteSqlResponse.php @@ -0,0 +1,115 @@ +google.cloud.alloydb.v1.ExecuteSqlResponse + */ +class ExecuteSqlResponse extends \Google\Protobuf\Internal\Message +{ + /** + * SqlResult represents the results for the execution of sql statements. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.SqlResult sql_results = 1; + */ + private $sql_results; + /** + * Any additional metadata information regarding the execution of the sql + * statement. + * + * Generated from protobuf field .google.cloud.alloydb.v1.ExecuteSqlMetadata metadata = 3; + */ + protected $metadata = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\AlloyDb\V1\SqlResult>|\Google\Protobuf\Internal\RepeatedField $sql_results + * SqlResult represents the results for the execution of sql statements. + * @type \Google\Cloud\AlloyDb\V1\ExecuteSqlMetadata $metadata + * Any additional metadata information regarding the execution of the sql + * statement. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * SqlResult represents the results for the execution of sql statements. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.SqlResult sql_results = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSqlResults() + { + return $this->sql_results; + } + + /** + * SqlResult represents the results for the execution of sql statements. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.SqlResult sql_results = 1; + * @param array<\Google\Cloud\AlloyDb\V1\SqlResult>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSqlResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1\SqlResult::class); + $this->sql_results = $arr; + + return $this; + } + + /** + * Any additional metadata information regarding the execution of the sql + * statement. + * + * Generated from protobuf field .google.cloud.alloydb.v1.ExecuteSqlMetadata metadata = 3; + * @return \Google\Cloud\AlloyDb\V1\ExecuteSqlMetadata|null + */ + public function getMetadata() + { + return $this->metadata; + } + + public function hasMetadata() + { + return isset($this->metadata); + } + + public function clearMetadata() + { + unset($this->metadata); + } + + /** + * Any additional metadata information regarding the execution of the sql + * statement. + * + * Generated from protobuf field .google.cloud.alloydb.v1.ExecuteSqlMetadata metadata = 3; + * @param \Google\Cloud\AlloyDb\V1\ExecuteSqlMetadata $var + * @return $this + */ + public function setMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\ExecuteSqlMetadata::class); + $this->metadata = $var; + + return $this; + } + +} + diff --git a/AlloyDb/src/V1/FailoverInstanceRequest.php b/AlloyDb/src/V1/FailoverInstanceRequest.php index 385f6cee2600..8aa80e2d0244 100644 --- a/AlloyDb/src/V1/FailoverInstanceRequest.php +++ b/AlloyDb/src/V1/FailoverInstanceRequest.php @@ -24,13 +24,13 @@ class FailoverInstanceRequest extends \Google\Protobuf\Internal\Message protected $name = ''; /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -39,8 +39,9 @@ class FailoverInstanceRequest extends \Google\Protobuf\Internal\Message */ protected $request_id = ''; /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the failover. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -72,19 +73,20 @@ public static function build(string $name): self * comment on the Instance.name field. * @type string $request_id * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the failover. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * } */ public function __construct($data = NULL) { @@ -122,13 +124,13 @@ public function setName($var) /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -143,13 +145,13 @@ public function getRequestId() /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -167,8 +169,9 @@ public function setRequestId($var) } /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the failover. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; * @return bool @@ -179,8 +182,9 @@ public function getValidateOnly() } /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the failover. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; * @param bool $var diff --git a/AlloyDb/src/V1/GenerateClientCertificateRequest.php b/AlloyDb/src/V1/GenerateClientCertificateRequest.php index a66f9ccd2a1a..2b1570826e21 100644 --- a/AlloyDb/src/V1/GenerateClientCertificateRequest.php +++ b/AlloyDb/src/V1/GenerateClientCertificateRequest.php @@ -25,13 +25,13 @@ class GenerateClientCertificateRequest extends \Google\Protobuf\Internal\Message protected $parent = ''; /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -90,13 +90,13 @@ public static function build(string $parent): self * * projects/{project}/locations/{location}/clusters/{cluster} * @type string $request_id * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -149,13 +149,13 @@ public function setParent($var) /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -170,13 +170,13 @@ public function getRequestId() /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). diff --git a/AlloyDb/src/V1/GetConnectionInfoRequest.php b/AlloyDb/src/V1/GetConnectionInfoRequest.php index e62b821f8334..20b558bedf58 100644 --- a/AlloyDb/src/V1/GetConnectionInfoRequest.php +++ b/AlloyDb/src/V1/GetConnectionInfoRequest.php @@ -24,13 +24,13 @@ class GetConnectionInfoRequest extends \Google\Protobuf\Internal\Message protected $parent = ''; /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -65,13 +65,13 @@ public static function build(string $parent): self * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} * @type string $request_id * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -112,13 +112,13 @@ public function setParent($var) /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -133,13 +133,13 @@ public function getRequestId() /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). diff --git a/AlloyDb/src/V1/InjectFaultRequest.php b/AlloyDb/src/V1/InjectFaultRequest.php index 223a6851d23d..49bb9a450557 100644 --- a/AlloyDb/src/V1/InjectFaultRequest.php +++ b/AlloyDb/src/V1/InjectFaultRequest.php @@ -30,13 +30,13 @@ class InjectFaultRequest extends \Google\Protobuf\Internal\Message protected $name = ''; /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -45,9 +45,9 @@ class InjectFaultRequest extends \Google\Protobuf\Internal\Message */ protected $request_id = ''; /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the fault - * injection. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -84,20 +84,20 @@ public static function build(int $faultType, string $name): self * comment on the Instance.name field. * @type string $request_id * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the fault - * injection. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * } */ public function __construct($data = NULL) { @@ -161,13 +161,13 @@ public function setName($var) /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -182,13 +182,13 @@ public function getRequestId() /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -206,9 +206,9 @@ public function setRequestId($var) } /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the fault - * injection. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; * @return bool @@ -219,9 +219,9 @@ public function getValidateOnly() } /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the fault - * injection. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; * @param bool $var diff --git a/AlloyDb/src/V1/Instance.php b/AlloyDb/src/V1/Instance.php index 8a5e4930c841..85eeb7dbcba6 100644 --- a/AlloyDb/src/V1/Instance.php +++ b/AlloyDb/src/V1/Instance.php @@ -159,6 +159,14 @@ class Instance extends \Google\Protobuf\Internal\Message * Generated from protobuf field string ip_address = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ protected $ip_address = ''; + /** + * Output only. The public IP addresses for the Instance. This is available + * ONLY when enable_public_ip is set. This is the connection endpoint for an + * end-user application. + * + * Generated from protobuf field string public_ip_address = 27 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { + */ + protected $public_ip_address = ''; /** * Output only. Reconciling (https://google.aip.dev/128#reconciliation). * Set to true if the current state of Instance does not match the user's @@ -189,6 +197,31 @@ class Instance extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.alloydb.v1.Instance.ClientConnectionConfig client_connection_config = 23 [(.google.api.field_behavior) = OPTIONAL]; */ protected $client_connection_config = null; + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $satisfies_pzs = false; + /** + * Optional. The configuration for Private Service Connect (PSC) for the + * instance. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Instance.PscInstanceConfig psc_instance_config = 28 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $psc_instance_config = null; + /** + * Optional. Instance-level network configuration. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Instance.InstanceNetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $network_config = null; + /** + * Output only. All outbound public IP addresses configured for the instance. + * + * Generated from protobuf field repeated string outbound_public_ip_addresses = 34 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { + */ + private $outbound_public_ip_addresses; /** * Constructor. @@ -267,6 +300,10 @@ class Instance extends \Google\Protobuf\Internal\Message * @type string $ip_address * Output only. The IP address for the Instance. * This is the connection endpoint for an end-user application. + * @type string $public_ip_address + * Output only. The public IP addresses for the Instance. This is available + * ONLY when enable_public_ip is set. This is the connection endpoint for an + * end-user application. * @type bool $reconciling * Output only. Reconciling (https://google.aip.dev/128#reconciliation). * Set to true if the current state of Instance does not match the user's @@ -281,6 +318,15 @@ class Instance extends \Google\Protobuf\Internal\Message * https://google.aip.dev/128 * @type \Google\Cloud\AlloyDb\V1\Instance\ClientConnectionConfig $client_connection_config * Optional. Client connection specific configurations + * @type bool $satisfies_pzs + * Output only. Reserved for future use. + * @type \Google\Cloud\AlloyDb\V1\Instance\PscInstanceConfig $psc_instance_config + * Optional. The configuration for Private Service Connect (PSC) for the + * instance. + * @type \Google\Cloud\AlloyDb\V1\Instance\InstanceNetworkConfig $network_config + * Optional. Instance-level network configuration. + * @type array|\Google\Protobuf\Internal\RepeatedField $outbound_public_ip_addresses + * Output only. All outbound public IP addresses configured for the instance. * } */ public function __construct($data = NULL) { @@ -896,6 +942,36 @@ public function setIpAddress($var) return $this; } + /** + * Output only. The public IP addresses for the Instance. This is available + * ONLY when enable_public_ip is set. This is the connection endpoint for an + * end-user application. + * + * Generated from protobuf field string public_ip_address = 27 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { + * @return string + */ + public function getPublicIpAddress() + { + return $this->public_ip_address; + } + + /** + * Output only. The public IP addresses for the Instance. This is available + * ONLY when enable_public_ip is set. This is the connection endpoint for an + * end-user application. + * + * Generated from protobuf field string public_ip_address = 27 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setPublicIpAddress($var) + { + GPBUtil::checkString($var, True); + $this->public_ip_address = $var; + + return $this; + } + /** * Output only. Reconciling (https://google.aip.dev/128#reconciliation). * Set to true if the current state of Instance does not match the user's @@ -1022,5 +1098,131 @@ public function setClientConnectionConfig($var) return $this; } + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzs() + { + return $this->satisfies_pzs; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + + /** + * Optional. The configuration for Private Service Connect (PSC) for the + * instance. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Instance.PscInstanceConfig psc_instance_config = 28 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\AlloyDb\V1\Instance\PscInstanceConfig|null + */ + public function getPscInstanceConfig() + { + return $this->psc_instance_config; + } + + public function hasPscInstanceConfig() + { + return isset($this->psc_instance_config); + } + + public function clearPscInstanceConfig() + { + unset($this->psc_instance_config); + } + + /** + * Optional. The configuration for Private Service Connect (PSC) for the + * instance. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Instance.PscInstanceConfig psc_instance_config = 28 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\AlloyDb\V1\Instance\PscInstanceConfig $var + * @return $this + */ + public function setPscInstanceConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\Instance\PscInstanceConfig::class); + $this->psc_instance_config = $var; + + return $this; + } + + /** + * Optional. Instance-level network configuration. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Instance.InstanceNetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\AlloyDb\V1\Instance\InstanceNetworkConfig|null + */ + public function getNetworkConfig() + { + return $this->network_config; + } + + public function hasNetworkConfig() + { + return isset($this->network_config); + } + + public function clearNetworkConfig() + { + unset($this->network_config); + } + + /** + * Optional. Instance-level network configuration. + * + * Generated from protobuf field .google.cloud.alloydb.v1.Instance.InstanceNetworkConfig network_config = 29 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\AlloyDb\V1\Instance\InstanceNetworkConfig $var + * @return $this + */ + public function setNetworkConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AlloyDb\V1\Instance\InstanceNetworkConfig::class); + $this->network_config = $var; + + return $this; + } + + /** + * Output only. All outbound public IP addresses configured for the instance. + * + * Generated from protobuf field repeated string outbound_public_ip_addresses = 34 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOutboundPublicIpAddresses() + { + return $this->outbound_public_ip_addresses; + } + + /** + * Output only. All outbound public IP addresses configured for the instance. + * + * Generated from protobuf field repeated string outbound_public_ip_addresses = 34 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOutboundPublicIpAddresses($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->outbound_public_ip_addresses = $arr; + + return $this; + } + } diff --git a/AlloyDb/src/V1/Instance/ClientConnectionConfig.php b/AlloyDb/src/V1/Instance/ClientConnectionConfig.php index d4bf05943e8e..c7e245923cf7 100644 --- a/AlloyDb/src/V1/Instance/ClientConnectionConfig.php +++ b/AlloyDb/src/V1/Instance/ClientConnectionConfig.php @@ -23,7 +23,7 @@ class ClientConnectionConfig extends \Google\Protobuf\Internal\Message */ protected $require_connectors = false; /** - * Optional. SSL config option for this instance. + * Optional. SSL configuration option for this instance. * * Generated from protobuf field .google.cloud.alloydb.v1.SslConfig ssl_config = 2 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -39,7 +39,7 @@ class ClientConnectionConfig extends \Google\Protobuf\Internal\Message * Optional. Configuration to enforce connectors only (ex: AuthProxy) * connections to the database. * @type \Google\Cloud\AlloyDb\V1\SslConfig $ssl_config - * Optional. SSL config option for this instance. + * Optional. SSL configuration option for this instance. * } */ public function __construct($data = NULL) { @@ -76,7 +76,7 @@ public function setRequireConnectors($var) } /** - * Optional. SSL config option for this instance. + * Optional. SSL configuration option for this instance. * * Generated from protobuf field .google.cloud.alloydb.v1.SslConfig ssl_config = 2 [(.google.api.field_behavior) = OPTIONAL]; * @return \Google\Cloud\AlloyDb\V1\SslConfig|null @@ -97,7 +97,7 @@ public function clearSslConfig() } /** - * Optional. SSL config option for this instance. + * Optional. SSL configuration option for this instance. * * Generated from protobuf field .google.cloud.alloydb.v1.SslConfig ssl_config = 2 [(.google.api.field_behavior) = OPTIONAL]; * @param \Google\Cloud\AlloyDb\V1\SslConfig $var diff --git a/AlloyDb/src/V1/Instance/InstanceNetworkConfig.php b/AlloyDb/src/V1/Instance/InstanceNetworkConfig.php new file mode 100644 index 000000000000..b6cb205089a9 --- /dev/null +++ b/AlloyDb/src/V1/Instance/InstanceNetworkConfig.php @@ -0,0 +1,140 @@ +google.cloud.alloydb.v1.Instance.InstanceNetworkConfig + */ +class InstanceNetworkConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. A list of external network authorized to access this instance. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork authorized_external_networks = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $authorized_external_networks; + /** + * Optional. Enabling public ip for the instance. + * + * Generated from protobuf field bool enable_public_ip = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_public_ip = false; + /** + * Optional. Enabling an outbound public IP address to support a database + * server sending requests out into the internet. + * + * Generated from protobuf field bool enable_outbound_public_ip = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_outbound_public_ip = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\AlloyDb\V1\Instance\InstanceNetworkConfig\AuthorizedNetwork>|\Google\Protobuf\Internal\RepeatedField $authorized_external_networks + * Optional. A list of external network authorized to access this instance. + * @type bool $enable_public_ip + * Optional. Enabling public ip for the instance. + * @type bool $enable_outbound_public_ip + * Optional. Enabling an outbound public IP address to support a database + * server sending requests out into the internet. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Optional. A list of external network authorized to access this instance. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork authorized_external_networks = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAuthorizedExternalNetworks() + { + return $this->authorized_external_networks; + } + + /** + * Optional. A list of external network authorized to access this instance. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork authorized_external_networks = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\AlloyDb\V1\Instance\InstanceNetworkConfig\AuthorizedNetwork>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAuthorizedExternalNetworks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1\Instance\InstanceNetworkConfig\AuthorizedNetwork::class); + $this->authorized_external_networks = $arr; + + return $this; + } + + /** + * Optional. Enabling public ip for the instance. + * + * Generated from protobuf field bool enable_public_ip = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnablePublicIp() + { + return $this->enable_public_ip; + } + + /** + * Optional. Enabling public ip for the instance. + * + * Generated from protobuf field bool enable_public_ip = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnablePublicIp($var) + { + GPBUtil::checkBool($var); + $this->enable_public_ip = $var; + + return $this; + } + + /** + * Optional. Enabling an outbound public IP address to support a database + * server sending requests out into the internet. + * + * Generated from protobuf field bool enable_outbound_public_ip = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableOutboundPublicIp() + { + return $this->enable_outbound_public_ip; + } + + /** + * Optional. Enabling an outbound public IP address to support a database + * server sending requests out into the internet. + * + * Generated from protobuf field bool enable_outbound_public_ip = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableOutboundPublicIp($var) + { + GPBUtil::checkBool($var); + $this->enable_outbound_public_ip = $var; + + return $this; + } + +} + + diff --git a/AlloyDb/src/V1/Instance/InstanceNetworkConfig/AuthorizedNetwork.php b/AlloyDb/src/V1/Instance/InstanceNetworkConfig/AuthorizedNetwork.php new file mode 100644 index 000000000000..6b50658955b3 --- /dev/null +++ b/AlloyDb/src/V1/Instance/InstanceNetworkConfig/AuthorizedNetwork.php @@ -0,0 +1,68 @@ +google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork + */ +class AuthorizedNetwork extends \Google\Protobuf\Internal\Message +{ + /** + * CIDR range for one authorzied network of the instance. + * + * Generated from protobuf field string cidr_range = 1 [(.google.api.field_info) = { + */ + protected $cidr_range = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $cidr_range + * CIDR range for one authorzied network of the instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * CIDR range for one authorzied network of the instance. + * + * Generated from protobuf field string cidr_range = 1 [(.google.api.field_info) = { + * @return string + */ + public function getCidrRange() + { + return $this->cidr_range; + } + + /** + * CIDR range for one authorzied network of the instance. + * + * Generated from protobuf field string cidr_range = 1 [(.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setCidrRange($var) + { + GPBUtil::checkString($var, True); + $this->cidr_range = $var; + + return $this; + } + +} + + diff --git a/AlloyDb/src/V1/Instance/PscInstanceConfig.php b/AlloyDb/src/V1/Instance/PscInstanceConfig.php new file mode 100644 index 000000000000..f2a5c2b4a257 --- /dev/null +++ b/AlloyDb/src/V1/Instance/PscInstanceConfig.php @@ -0,0 +1,157 @@ +google.cloud.alloydb.v1.Instance.PscInstanceConfig + */ +class PscInstanceConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The service attachment created when Private + * Service Connect (PSC) is enabled for the instance. + * The name of the resource will be in the format of + * `projects//regions//serviceAttachments/` + * + * Generated from protobuf field string service_attachment_link = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $service_attachment_link = ''; + /** + * Optional. List of consumer projects that are allowed to create + * PSC endpoints to service-attachments to this instance. + * + * Generated from protobuf field repeated string allowed_consumer_projects = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $allowed_consumer_projects; + /** + * Output only. The DNS name of the instance for PSC connectivity. + * Name convention: ...alloydb-psc.goog + * + * Generated from protobuf field string psc_dns_name = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $psc_dns_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $service_attachment_link + * Output only. The service attachment created when Private + * Service Connect (PSC) is enabled for the instance. + * The name of the resource will be in the format of + * `projects//regions//serviceAttachments/` + * @type array|\Google\Protobuf\Internal\RepeatedField $allowed_consumer_projects + * Optional. List of consumer projects that are allowed to create + * PSC endpoints to service-attachments to this instance. + * @type string $psc_dns_name + * Output only. The DNS name of the instance for PSC connectivity. + * Name convention: ...alloydb-psc.goog + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The service attachment created when Private + * Service Connect (PSC) is enabled for the instance. + * The name of the resource will be in the format of + * `projects//regions//serviceAttachments/` + * + * Generated from protobuf field string service_attachment_link = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getServiceAttachmentLink() + { + return $this->service_attachment_link; + } + + /** + * Output only. The service attachment created when Private + * Service Connect (PSC) is enabled for the instance. + * The name of the resource will be in the format of + * `projects//regions//serviceAttachments/` + * + * Generated from protobuf field string service_attachment_link = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setServiceAttachmentLink($var) + { + GPBUtil::checkString($var, True); + $this->service_attachment_link = $var; + + return $this; + } + + /** + * Optional. List of consumer projects that are allowed to create + * PSC endpoints to service-attachments to this instance. + * + * Generated from protobuf field repeated string allowed_consumer_projects = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAllowedConsumerProjects() + { + return $this->allowed_consumer_projects; + } + + /** + * Optional. List of consumer projects that are allowed to create + * PSC endpoints to service-attachments to this instance. + * + * Generated from protobuf field repeated string allowed_consumer_projects = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAllowedConsumerProjects($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->allowed_consumer_projects = $arr; + + return $this; + } + + /** + * Output only. The DNS name of the instance for PSC connectivity. + * Name convention: ...alloydb-psc.goog + * + * Generated from protobuf field string psc_dns_name = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getPscDnsName() + { + return $this->psc_dns_name; + } + + /** + * Output only. The DNS name of the instance for PSC connectivity. + * Name convention: ...alloydb-psc.goog + * + * Generated from protobuf field string psc_dns_name = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setPscDnsName($var) + { + GPBUtil::checkString($var, True); + $this->psc_dns_name = $var; + + return $this; + } + +} + + diff --git a/AlloyDb/src/V1/ListDatabasesRequest.php b/AlloyDb/src/V1/ListDatabasesRequest.php new file mode 100644 index 000000000000..d94d59530e6a --- /dev/null +++ b/AlloyDb/src/V1/ListDatabasesRequest.php @@ -0,0 +1,207 @@ +google.cloud.alloydb.v1.ListDatabasesRequest + */ +class ListDatabasesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent value for ListDatabasesRequest. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of databases to return. The service may return + * fewer than this value. If unspecified, 2000 is the default page_size. The + * max value of page_size will be 4000, values above max will be coerced to + * max. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous `ListDatabases` call. + * This should be provided to retrieve the subsequent page. + * This field is currently not supported, its value will be ignored if passed. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filtering results. + * This field is currently not supported, its value will be ignored if passed. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + + /** + * @param string $parent Required. Parent value for ListDatabasesRequest. Please see + * {@see AlloyDBAdminClient::clusterName()} for help formatting this field. + * + * @return \Google\Cloud\AlloyDb\V1\ListDatabasesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Parent value for ListDatabasesRequest. + * @type int $page_size + * Optional. The maximum number of databases to return. The service may return + * fewer than this value. If unspecified, 2000 is the default page_size. The + * max value of page_size will be 4000, values above max will be coerced to + * max. + * @type string $page_token + * Optional. A page token, received from a previous `ListDatabases` call. + * This should be provided to retrieve the subsequent page. + * This field is currently not supported, its value will be ignored if passed. + * @type string $filter + * Optional. Filtering results. + * This field is currently not supported, its value will be ignored if passed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent value for ListDatabasesRequest. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Parent value for ListDatabasesRequest. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of databases to return. The service may return + * fewer than this value. If unspecified, 2000 is the default page_size. The + * max value of page_size will be 4000, values above max will be coerced to + * max. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of databases to return. The service may return + * fewer than this value. If unspecified, 2000 is the default page_size. The + * max value of page_size will be 4000, values above max will be coerced to + * max. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from a previous `ListDatabases` call. + * This should be provided to retrieve the subsequent page. + * This field is currently not supported, its value will be ignored if passed. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous `ListDatabases` call. + * This should be provided to retrieve the subsequent page. + * This field is currently not supported, its value will be ignored if passed. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Filtering results. + * This field is currently not supported, its value will be ignored if passed. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering results. + * This field is currently not supported, its value will be ignored if passed. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + +} + diff --git a/AlloyDb/src/V1/ListDatabasesResponse.php b/AlloyDb/src/V1/ListDatabasesResponse.php new file mode 100644 index 000000000000..782f84025b54 --- /dev/null +++ b/AlloyDb/src/V1/ListDatabasesResponse.php @@ -0,0 +1,105 @@ +google.cloud.alloydb.v1.ListDatabasesResponse + */ +class ListDatabasesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of databases + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.Database databases = 1; + */ + private $databases; + /** + * A token identifying the next page of results the server should return. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\AlloyDb\V1\Database>|\Google\Protobuf\Internal\RepeatedField $databases + * The list of databases + * @type string $next_page_token + * A token identifying the next page of results the server should return. + * If this field is omitted, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of databases + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.Database databases = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDatabases() + { + return $this->databases; + } + + /** + * The list of databases + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.Database databases = 1; + * @param array<\Google\Cloud\AlloyDb\V1\Database>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDatabases($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1\Database::class); + $this->databases = $arr; + + return $this; + } + + /** + * A token identifying the next page of results the server should return. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying the next page of results the server should return. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/AlloyDb/src/V1/MaintenanceSchedule.php b/AlloyDb/src/V1/MaintenanceSchedule.php new file mode 100644 index 000000000000..ddb853c704c1 --- /dev/null +++ b/AlloyDb/src/V1/MaintenanceSchedule.php @@ -0,0 +1,81 @@ +google.cloud.alloydb.v1.MaintenanceSchedule + */ +class MaintenanceSchedule extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The scheduled start time for the maintenance. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $start_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $start_time + * Output only. The scheduled start time for the maintenance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The scheduled start time for the maintenance. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Output only. The scheduled start time for the maintenance. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + +} + diff --git a/AlloyDb/src/V1/MaintenanceUpdatePolicy.php b/AlloyDb/src/V1/MaintenanceUpdatePolicy.php new file mode 100644 index 000000000000..d606702528c3 --- /dev/null +++ b/AlloyDb/src/V1/MaintenanceUpdatePolicy.php @@ -0,0 +1,67 @@ +google.cloud.alloydb.v1.MaintenanceUpdatePolicy + */ +class MaintenanceUpdatePolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Preferred windows to perform maintenance. Currently limited to 1. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow maintenance_windows = 1; + */ + private $maintenance_windows; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\AlloyDb\V1\MaintenanceUpdatePolicy\MaintenanceWindow>|\Google\Protobuf\Internal\RepeatedField $maintenance_windows + * Preferred windows to perform maintenance. Currently limited to 1. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Preferred windows to perform maintenance. Currently limited to 1. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow maintenance_windows = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMaintenanceWindows() + { + return $this->maintenance_windows; + } + + /** + * Preferred windows to perform maintenance. Currently limited to 1. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow maintenance_windows = 1; + * @param array<\Google\Cloud\AlloyDb\V1\MaintenanceUpdatePolicy\MaintenanceWindow>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMaintenanceWindows($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1\MaintenanceUpdatePolicy\MaintenanceWindow::class); + $this->maintenance_windows = $arr; + + return $this; + } + +} + diff --git a/AlloyDb/src/V1/MaintenanceUpdatePolicy/MaintenanceWindow.php b/AlloyDb/src/V1/MaintenanceUpdatePolicy/MaintenanceWindow.php new file mode 100644 index 000000000000..203857d59a8b --- /dev/null +++ b/AlloyDb/src/V1/MaintenanceUpdatePolicy/MaintenanceWindow.php @@ -0,0 +1,116 @@ +google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow + */ +class MaintenanceWindow extends \Google\Protobuf\Internal\Message +{ + /** + * Preferred day of the week for maintenance, e.g. MONDAY, TUESDAY, etc. + * + * Generated from protobuf field .google.type.DayOfWeek day = 1; + */ + protected $day = 0; + /** + * Preferred time to start the maintenance operation on the specified day. + * Maintenance will start within 1 hour of this time. + * + * Generated from protobuf field .google.type.TimeOfDay start_time = 2; + */ + protected $start_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $day + * Preferred day of the week for maintenance, e.g. MONDAY, TUESDAY, etc. + * @type \Google\Type\TimeOfDay $start_time + * Preferred time to start the maintenance operation on the specified day. + * Maintenance will start within 1 hour of this time. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Preferred day of the week for maintenance, e.g. MONDAY, TUESDAY, etc. + * + * Generated from protobuf field .google.type.DayOfWeek day = 1; + * @return int + */ + public function getDay() + { + return $this->day; + } + + /** + * Preferred day of the week for maintenance, e.g. MONDAY, TUESDAY, etc. + * + * Generated from protobuf field .google.type.DayOfWeek day = 1; + * @param int $var + * @return $this + */ + public function setDay($var) + { + GPBUtil::checkEnum($var, \Google\Type\DayOfWeek::class); + $this->day = $var; + + return $this; + } + + /** + * Preferred time to start the maintenance operation on the specified day. + * Maintenance will start within 1 hour of this time. + * + * Generated from protobuf field .google.type.TimeOfDay start_time = 2; + * @return \Google\Type\TimeOfDay|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Preferred time to start the maintenance operation on the specified day. + * Maintenance will start within 1 hour of this time. + * + * Generated from protobuf field .google.type.TimeOfDay start_time = 2; + * @param \Google\Type\TimeOfDay $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Type\TimeOfDay::class); + $this->start_time = $var; + + return $this; + } + +} + + diff --git a/AlloyDb/src/V1/PromoteClusterRequest.php b/AlloyDb/src/V1/PromoteClusterRequest.php index 94a00b7fb9d8..688fae81ebc5 100644 --- a/AlloyDb/src/V1/PromoteClusterRequest.php +++ b/AlloyDb/src/V1/PromoteClusterRequest.php @@ -24,9 +24,9 @@ class PromoteClusterRequest extends \Google\Protobuf\Internal\Message protected $name = ''; /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID @@ -47,8 +47,9 @@ class PromoteClusterRequest extends \Google\Protobuf\Internal\Message */ protected $etag = ''; /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -80,9 +81,9 @@ public static function build(string $name): self * comment on the Cluster.name field * @type string $request_id * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID @@ -95,8 +96,9 @@ public static function build(string $name): self * If an etag is provided and does not match the current etag of the Cluster, * deletion will be blocked and an ABORTED error will be returned. * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * } */ public function __construct($data = NULL) { @@ -134,9 +136,9 @@ public function setName($var) /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID @@ -155,9 +157,9 @@ public function getRequestId() /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID @@ -209,8 +211,9 @@ public function setEtag($var) } /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; * @return bool @@ -221,8 +224,9 @@ public function getValidateOnly() } /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; * @param bool $var diff --git a/AlloyDb/src/V1/RestartInstanceRequest.php b/AlloyDb/src/V1/RestartInstanceRequest.php index d1c80af90179..b678b232cf93 100644 --- a/AlloyDb/src/V1/RestartInstanceRequest.php +++ b/AlloyDb/src/V1/RestartInstanceRequest.php @@ -22,13 +22,13 @@ class RestartInstanceRequest extends \Google\Protobuf\Internal\Message protected $name = ''; /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -37,12 +37,20 @@ class RestartInstanceRequest extends \Google\Protobuf\Internal\Message */ protected $request_id = ''; /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the restart. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; */ protected $validate_only = false; + /** + * Optional. Full name of the nodes as obtained from INSTANCE_VIEW_FULL to + * restart upon. Applicable only to read instances. + * + * Generated from protobuf field repeated string node_ids = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $node_ids; /** * @param string $name Required. The name of the resource. For the required format, see the @@ -70,19 +78,23 @@ public static function build(string $name): self * comment on the Instance.name field. * @type string $request_id * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the restart. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + * @type array|\Google\Protobuf\Internal\RepeatedField $node_ids + * Optional. Full name of the nodes as obtained from INSTANCE_VIEW_FULL to + * restart upon. Applicable only to read instances. * } */ public function __construct($data = NULL) { @@ -120,13 +132,13 @@ public function setName($var) /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -141,13 +153,13 @@ public function getRequestId() /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -165,8 +177,9 @@ public function setRequestId($var) } /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the restart. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; * @return bool @@ -177,8 +190,9 @@ public function getValidateOnly() } /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the restart. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; * @param bool $var @@ -192,5 +206,33 @@ public function setValidateOnly($var) return $this; } + /** + * Optional. Full name of the nodes as obtained from INSTANCE_VIEW_FULL to + * restart upon. Applicable only to read instances. + * + * Generated from protobuf field repeated string node_ids = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNodeIds() + { + return $this->node_ids; + } + + /** + * Optional. Full name of the nodes as obtained from INSTANCE_VIEW_FULL to + * restart upon. Applicable only to read instances. + * + * Generated from protobuf field repeated string node_ids = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNodeIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->node_ids = $arr; + + return $this; + } + } diff --git a/AlloyDb/src/V1/RestoreClusterRequest.php b/AlloyDb/src/V1/RestoreClusterRequest.php index ce7a85bdb5ed..13f6cf83e847 100644 --- a/AlloyDb/src/V1/RestoreClusterRequest.php +++ b/AlloyDb/src/V1/RestoreClusterRequest.php @@ -37,13 +37,13 @@ class RestoreClusterRequest extends \Google\Protobuf\Internal\Message protected $cluster = null; /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -52,9 +52,9 @@ class RestoreClusterRequest extends \Google\Protobuf\Internal\Message */ protected $request_id = ''; /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the import - * request. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -81,20 +81,20 @@ class RestoreClusterRequest extends \Google\Protobuf\Internal\Message * Required. The resource being created * @type string $request_id * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the import - * request. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * } */ public function __construct($data = NULL) { @@ -258,13 +258,13 @@ public function setCluster($var) /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -279,13 +279,13 @@ public function getRequestId() /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -303,9 +303,9 @@ public function setRequestId($var) } /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the import - * request. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; * @return bool @@ -316,9 +316,9 @@ public function getValidateOnly() } /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the import - * request. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * * Generated from protobuf field bool validate_only = 6 [(.google.api.field_behavior) = OPTIONAL]; * @param bool $var diff --git a/AlloyDb/src/V1/SqlResult.php b/AlloyDb/src/V1/SqlResult.php new file mode 100644 index 000000000000..2ff9cba3af42 --- /dev/null +++ b/AlloyDb/src/V1/SqlResult.php @@ -0,0 +1,105 @@ +google.cloud.alloydb.v1.SqlResult + */ +class SqlResult extends \Google\Protobuf\Internal\Message +{ + /** + * List of columns included in the result. This also includes the data type + * of the column. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.SqlResultColumn columns = 1; + */ + private $columns; + /** + * Rows returned by the SQL statement. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.SqlResultRow rows = 2; + */ + private $rows; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\AlloyDb\V1\SqlResultColumn>|\Google\Protobuf\Internal\RepeatedField $columns + * List of columns included in the result. This also includes the data type + * of the column. + * @type array<\Google\Cloud\AlloyDb\V1\SqlResultRow>|\Google\Protobuf\Internal\RepeatedField $rows + * Rows returned by the SQL statement. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\DataModel::initOnce(); + parent::__construct($data); + } + + /** + * List of columns included in the result. This also includes the data type + * of the column. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.SqlResultColumn columns = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getColumns() + { + return $this->columns; + } + + /** + * List of columns included in the result. This also includes the data type + * of the column. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.SqlResultColumn columns = 1; + * @param array<\Google\Cloud\AlloyDb\V1\SqlResultColumn>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setColumns($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1\SqlResultColumn::class); + $this->columns = $arr; + + return $this; + } + + /** + * Rows returned by the SQL statement. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.SqlResultRow rows = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRows() + { + return $this->rows; + } + + /** + * Rows returned by the SQL statement. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.SqlResultRow rows = 2; + * @param array<\Google\Cloud\AlloyDb\V1\SqlResultRow>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRows($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1\SqlResultRow::class); + $this->rows = $arr; + + return $this; + } + +} + diff --git a/AlloyDb/src/V1/SqlResultColumn.php b/AlloyDb/src/V1/SqlResultColumn.php new file mode 100644 index 000000000000..a382717fb18d --- /dev/null +++ b/AlloyDb/src/V1/SqlResultColumn.php @@ -0,0 +1,109 @@ +google.cloud.alloydb.v1.SqlResultColumn + */ +class SqlResultColumn extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the column. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Datatype of the column as reported by the postgres driver. + * Common type names are "VARCHAR", "TEXT", "NVARCHAR", "DECIMAL", "BOOL", + * "INT", and "BIGINT". + * + * Generated from protobuf field string type = 2; + */ + protected $type = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Name of the column. + * @type string $type + * Datatype of the column as reported by the postgres driver. + * Common type names are "VARCHAR", "TEXT", "NVARCHAR", "DECIMAL", "BOOL", + * "INT", and "BIGINT". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\DataModel::initOnce(); + parent::__construct($data); + } + + /** + * Name of the column. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Name of the column. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Datatype of the column as reported by the postgres driver. + * Common type names are "VARCHAR", "TEXT", "NVARCHAR", "DECIMAL", "BOOL", + * "INT", and "BIGINT". + * + * Generated from protobuf field string type = 2; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * Datatype of the column as reported by the postgres driver. + * Common type names are "VARCHAR", "TEXT", "NVARCHAR", "DECIMAL", "BOOL", + * "INT", and "BIGINT". + * + * Generated from protobuf field string type = 2; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + +} + diff --git a/AlloyDb/src/V1/SqlResultRow.php b/AlloyDb/src/V1/SqlResultRow.php new file mode 100644 index 000000000000..65e45b3cb121 --- /dev/null +++ b/AlloyDb/src/V1/SqlResultRow.php @@ -0,0 +1,67 @@ +google.cloud.alloydb.v1.SqlResultRow + */ +class SqlResultRow extends \Google\Protobuf\Internal\Message +{ + /** + * List of values in a row of sql result. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.SqlResultValue values = 1; + */ + private $values; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\AlloyDb\V1\SqlResultValue>|\Google\Protobuf\Internal\RepeatedField $values + * List of values in a row of sql result. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\DataModel::initOnce(); + parent::__construct($data); + } + + /** + * List of values in a row of sql result. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.SqlResultValue values = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getValues() + { + return $this->values; + } + + /** + * List of values in a row of sql result. + * + * Generated from protobuf field repeated .google.cloud.alloydb.v1.SqlResultValue values = 1; + * @param array<\Google\Cloud\AlloyDb\V1\SqlResultValue>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AlloyDb\V1\SqlResultValue::class); + $this->values = $arr; + + return $this; + } + +} + diff --git a/AlloyDb/src/V1/SqlResultValue.php b/AlloyDb/src/V1/SqlResultValue.php new file mode 100644 index 000000000000..091242f1f175 --- /dev/null +++ b/AlloyDb/src/V1/SqlResultValue.php @@ -0,0 +1,125 @@ +google.cloud.alloydb.v1.SqlResultValue + */ +class SqlResultValue extends \Google\Protobuf\Internal\Message +{ + /** + * The cell value represented in string format. + * Timestamps are converted to string using RFC3339Nano format. + * + * Generated from protobuf field optional string value = 1; + */ + protected $value = null; + /** + * Set to true if cell value is null. + * + * Generated from protobuf field optional bool null_value = 2; + */ + protected $null_value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $value + * The cell value represented in string format. + * Timestamps are converted to string using RFC3339Nano format. + * @type bool $null_value + * Set to true if cell value is null. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\DataModel::initOnce(); + parent::__construct($data); + } + + /** + * The cell value represented in string format. + * Timestamps are converted to string using RFC3339Nano format. + * + * Generated from protobuf field optional string value = 1; + * @return string + */ + public function getValue() + { + return isset($this->value) ? $this->value : ''; + } + + public function hasValue() + { + return isset($this->value); + } + + public function clearValue() + { + unset($this->value); + } + + /** + * The cell value represented in string format. + * Timestamps are converted to string using RFC3339Nano format. + * + * Generated from protobuf field optional string value = 1; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + + /** + * Set to true if cell value is null. + * + * Generated from protobuf field optional bool null_value = 2; + * @return bool + */ + public function getNullValue() + { + return isset($this->null_value) ? $this->null_value : false; + } + + public function hasNullValue() + { + return isset($this->null_value); + } + + public function clearNullValue() + { + unset($this->null_value); + } + + /** + * Set to true if cell value is null. + * + * Generated from protobuf field optional bool null_value = 2; + * @param bool $var + * @return $this + */ + public function setNullValue($var) + { + GPBUtil::checkBool($var); + $this->null_value = $var; + + return $this; + } + +} + diff --git a/AlloyDb/src/V1/SslConfig/SslMode.php b/AlloyDb/src/V1/SslConfig/SslMode.php index cbbac57c134a..f6fd884e7966 100644 --- a/AlloyDb/src/V1/SslConfig/SslMode.php +++ b/AlloyDb/src/V1/SslConfig/SslMode.php @@ -14,7 +14,7 @@ class SslMode { /** - * SSL mode not specified. Defaults to ENCRYPTED_ONLY. + * SSL mode is not specified. Defaults to ENCRYPTED_ONLY. * * Generated from protobuf enum SSL_MODE_UNSPECIFIED = 0; */ @@ -35,7 +35,7 @@ class SslMode const SSL_MODE_REQUIRE = 2; /** * SSL connections are required. CA verification enforced. - * Clients must have certificates signed by a Cluster CA, e.g. via + * Clients must have certificates signed by a Cluster CA, for example, using * GenerateClientCertificate. * * Generated from protobuf enum SSL_MODE_VERIFY_CA = 3 [deprecated = true]; diff --git a/AlloyDb/src/V1/SubscriptionType.php b/AlloyDb/src/V1/SubscriptionType.php new file mode 100644 index 000000000000..68a7e3303762 --- /dev/null +++ b/AlloyDb/src/V1/SubscriptionType.php @@ -0,0 +1,64 @@ +google.cloud.alloydb.v1.SubscriptionType + */ +class SubscriptionType +{ + /** + * This is an unknown subscription type. By default, the subscription type is + * STANDARD. + * + * Generated from protobuf enum SUBSCRIPTION_TYPE_UNSPECIFIED = 0; + */ + const SUBSCRIPTION_TYPE_UNSPECIFIED = 0; + /** + * Standard subscription. + * + * Generated from protobuf enum STANDARD = 1; + */ + const STANDARD = 1; + /** + * Trial subscription. + * + * Generated from protobuf enum TRIAL = 2; + */ + const TRIAL = 2; + + private static $valueToName = [ + self::SUBSCRIPTION_TYPE_UNSPECIFIED => 'SUBSCRIPTION_TYPE_UNSPECIFIED', + self::STANDARD => 'STANDARD', + self::TRIAL => 'TRIAL', + ]; + + 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/AlloyDb/src/V1/SwitchoverClusterRequest.php b/AlloyDb/src/V1/SwitchoverClusterRequest.php new file mode 100644 index 000000000000..571773ce71cc --- /dev/null +++ b/AlloyDb/src/V1/SwitchoverClusterRequest.php @@ -0,0 +1,202 @@ +google.cloud.alloydb.v1.SwitchoverClusterRequest + */ +class SwitchoverClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * @param string $name Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field + * Please see {@see AlloyDBAdminClient::clusterName()} for help formatting this field. + * + * @return \Google\Cloud\AlloyDb\V1\SwitchoverClusterRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $validate_only + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Alloydb\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/AlloyDb/src/V1/UpdateBackupRequest.php b/AlloyDb/src/V1/UpdateBackupRequest.php index 4925904e8fd7..4c31c2d1ec6b 100644 --- a/AlloyDb/src/V1/UpdateBackupRequest.php +++ b/AlloyDb/src/V1/UpdateBackupRequest.php @@ -33,13 +33,13 @@ class UpdateBackupRequest extends \Google\Protobuf\Internal\Message protected $backup = null; /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -97,13 +97,13 @@ public static function build(\Google\Cloud\AlloyDb\V1\Backup $backup, \Google\Pr * Required. The resource being updated * @type string $request_id * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -202,13 +202,13 @@ public function setBackup($var) /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -223,13 +223,13 @@ public function getRequestId() /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). diff --git a/AlloyDb/src/V1/UpdateClusterRequest.php b/AlloyDb/src/V1/UpdateClusterRequest.php index 2727a2df5cd9..e2da04b561bf 100644 --- a/AlloyDb/src/V1/UpdateClusterRequest.php +++ b/AlloyDb/src/V1/UpdateClusterRequest.php @@ -33,13 +33,13 @@ class UpdateClusterRequest extends \Google\Protobuf\Internal\Message protected $cluster = null; /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -48,9 +48,9 @@ class UpdateClusterRequest extends \Google\Protobuf\Internal\Message */ protected $request_id = ''; /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -98,20 +98,20 @@ public static function build(\Google\Cloud\AlloyDb\V1\Cluster $cluster, \Google\ * Required. The resource being updated * @type string $request_id * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * @type bool $allow_missing * Optional. If set to true, update succeeds even if cluster is not found. In * that case, a new cluster is created and `update_mask` is ignored. @@ -204,13 +204,13 @@ public function setCluster($var) /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -225,13 +225,13 @@ public function getRequestId() /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -249,9 +249,9 @@ public function setRequestId($var) } /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; * @return bool @@ -262,9 +262,9 @@ public function getValidateOnly() } /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; * @param bool $var diff --git a/AlloyDb/src/V1/UpdateInstanceRequest.php b/AlloyDb/src/V1/UpdateInstanceRequest.php index 45b774ddbd49..f75183733d59 100644 --- a/AlloyDb/src/V1/UpdateInstanceRequest.php +++ b/AlloyDb/src/V1/UpdateInstanceRequest.php @@ -33,13 +33,13 @@ class UpdateInstanceRequest extends \Google\Protobuf\Internal\Message protected $instance = null; /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -48,9 +48,9 @@ class UpdateInstanceRequest extends \Google\Protobuf\Internal\Message */ protected $request_id = ''; /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -98,20 +98,20 @@ public static function build(\Google\Cloud\AlloyDb\V1\Instance $instance, \Googl * Required. The resource being updated * @type string $request_id * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). * @type bool $validate_only - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * @type bool $allow_missing * Optional. If set to true, update succeeds even if instance is not found. In * that case, a new instance is created and `update_mask` is ignored. @@ -204,13 +204,13 @@ public function setInstance($var) /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -225,13 +225,13 @@ public function getRequestId() /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -249,9 +249,9 @@ public function setRequestId($var) } /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; * @return bool @@ -262,9 +262,9 @@ public function getValidateOnly() } /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. * * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; * @param bool $var diff --git a/AlloyDb/src/V1/UpdateUserRequest.php b/AlloyDb/src/V1/UpdateUserRequest.php index 0afb7647923a..eab90f471ca7 100644 --- a/AlloyDb/src/V1/UpdateUserRequest.php +++ b/AlloyDb/src/V1/UpdateUserRequest.php @@ -33,13 +33,13 @@ class UpdateUserRequest extends \Google\Protobuf\Internal\Message protected $user = null; /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -96,13 +96,13 @@ public static function build(\Google\Cloud\AlloyDb\V1\User $user, \Google\Protob * Required. The resource being updated * @type string $request_id * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -200,13 +200,13 @@ public function setUser($var) /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -221,13 +221,13 @@ public function getRequestId() /** * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). diff --git a/AlloyDb/src/V1/User.php b/AlloyDb/src/V1/User.php index 5936d629c1da..f64046478ae2 100644 --- a/AlloyDb/src/V1/User.php +++ b/AlloyDb/src/V1/User.php @@ -41,6 +41,13 @@ class User extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.alloydb.v1.User.UserType user_type = 5 [(.google.api.field_behavior) = OPTIONAL]; */ protected $user_type = 0; + /** + * Input only. If the user already exists and it has additional roles, keep + * them granted. + * + * Generated from protobuf field bool keep_extra_roles = 6 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $keep_extra_roles = false; /** * Constructor. @@ -58,6 +65,9 @@ class User extends \Google\Protobuf\Internal\Message * The database role strings are subject to the PostgreSQL naming conventions. * @type int $user_type * Optional. Type of this user. + * @type bool $keep_extra_roles + * Input only. If the user already exists and it has additional roles, keep + * them granted. * } */ public function __construct($data = NULL) { @@ -173,5 +183,33 @@ public function setUserType($var) return $this; } + /** + * Input only. If the user already exists and it has additional roles, keep + * them granted. + * + * Generated from protobuf field bool keep_extra_roles = 6 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return bool + */ + public function getKeepExtraRoles() + { + return $this->keep_extra_roles; + } + + /** + * Input only. If the user already exists and it has additional roles, keep + * them granted. + * + * Generated from protobuf field bool keep_extra_roles = 6 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setKeepExtraRoles($var) + { + GPBUtil::checkBool($var); + $this->keep_extra_roles = $var; + + return $this; + } + } diff --git a/AlloyDb/src/V1/gapic_metadata.json b/AlloyDb/src/V1/gapic_metadata.json index acfc6419e997..a68014194117 100644 --- a/AlloyDb/src/V1/gapic_metadata.json +++ b/AlloyDb/src/V1/gapic_metadata.json @@ -65,6 +65,11 @@ "deleteUser" ] }, + "ExecuteSql": { + "methods": [ + "executeSql" + ] + }, "FailoverInstance": { "methods": [ "failoverInstance" @@ -115,6 +120,11 @@ "listClusters" ] }, + "ListDatabases": { + "methods": [ + "listDatabases" + ] + }, "ListInstances": { "methods": [ "listInstances" @@ -145,6 +155,11 @@ "restoreCluster" ] }, + "SwitchoverCluster": { + "methods": [ + "switchoverCluster" + ] + }, "UpdateBackup": { "methods": [ "updateBackup" diff --git a/AlloyDb/src/V1/resources/alloy_db_admin_client_config.json b/AlloyDb/src/V1/resources/alloy_db_admin_client_config.json index 3643e0bcf47b..dce1aa00708b 100644 --- a/AlloyDb/src/V1/resources/alloy_db_admin_client_config.json +++ b/AlloyDb/src/V1/resources/alloy_db_admin_client_config.json @@ -93,6 +93,11 @@ "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "ExecuteSql": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "FailoverInstance": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", @@ -143,6 +148,11 @@ "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "ListDatabases": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "ListInstances": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", @@ -173,6 +183,11 @@ "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "SwitchoverCluster": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "UpdateBackup": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", diff --git a/AlloyDb/src/V1/resources/alloy_db_admin_descriptor_config.php b/AlloyDb/src/V1/resources/alloy_db_admin_descriptor_config.php index 14f17c2c70d3..9ef950d79dea 100644 --- a/AlloyDb/src/V1/resources/alloy_db_admin_descriptor_config.php +++ b/AlloyDb/src/V1/resources/alloy_db_admin_descriptor_config.php @@ -289,6 +289,25 @@ ], ], ], + 'SwitchoverCluster' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\AlloyDb\V1\Cluster', + 'metadataReturnType' => '\Google\Cloud\AlloyDb\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'UpdateBackup' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Cloud\AlloyDb\V1\Backup', @@ -373,6 +392,18 @@ ], ], ], + 'ExecuteSql' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\AlloyDb\V1\ExecuteSqlResponse', + 'headerParams' => [ + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], 'GenerateClientCertificate' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\AlloyDb\V1\GenerateClientCertificateResponse', @@ -485,6 +516,26 @@ ], ], ], + 'ListDatabases' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getDatabases', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\AlloyDb\V1\ListDatabasesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'ListInstances' => [ 'pageStreaming' => [ 'requestPageTokenGetMethod' => 'getPageToken', diff --git a/AlloyDb/src/V1/resources/alloy_db_admin_rest_client_config.php b/AlloyDb/src/V1/resources/alloy_db_admin_rest_client_config.php index 06450b4dfd5b..cf153a4e6a9f 100644 --- a/AlloyDb/src/V1/resources/alloy_db_admin_rest_client_config.php +++ b/AlloyDb/src/V1/resources/alloy_db_admin_rest_client_config.php @@ -163,6 +163,18 @@ ], ], ], + 'ExecuteSql' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{instance=projects/*/locations/*/clusters/*/instances/*}:executeSql', + 'body' => '*', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + ], + ], 'FailoverInstance' => [ 'method' => 'post', 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*/instances/*}:failover', @@ -276,6 +288,17 @@ ], ], ], + 'ListDatabases' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/clusters/*}/databases', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'ListInstances' => [ 'method' => 'get', 'uriTemplate' => '/v1/{parent=projects/*/locations/*/clusters/*}/instances', @@ -345,6 +368,18 @@ ], ], ], + 'SwitchoverCluster' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*}:switchover', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'UpdateBackup' => [ 'method' => 'patch', 'uriTemplate' => '/v1/{backup.name=projects/*/locations/*/backups/*}', diff --git a/AlloyDb/tests/Unit/V1/Client/AlloyDBAdminClientTest.php b/AlloyDb/tests/Unit/V1/Client/AlloyDBAdminClientTest.php index d01084f02807..716c9a867e40 100644 --- a/AlloyDb/tests/Unit/V1/Client/AlloyDBAdminClientTest.php +++ b/AlloyDb/tests/Unit/V1/Client/AlloyDBAdminClientTest.php @@ -39,10 +39,13 @@ use Google\Cloud\AlloyDb\V1\CreateSecondaryClusterRequest; use Google\Cloud\AlloyDb\V1\CreateSecondaryInstanceRequest; use Google\Cloud\AlloyDb\V1\CreateUserRequest; +use Google\Cloud\AlloyDb\V1\Database; use Google\Cloud\AlloyDb\V1\DeleteBackupRequest; use Google\Cloud\AlloyDb\V1\DeleteClusterRequest; use Google\Cloud\AlloyDb\V1\DeleteInstanceRequest; use Google\Cloud\AlloyDb\V1\DeleteUserRequest; +use Google\Cloud\AlloyDb\V1\ExecuteSqlRequest; +use Google\Cloud\AlloyDb\V1\ExecuteSqlResponse; use Google\Cloud\AlloyDb\V1\FailoverInstanceRequest; use Google\Cloud\AlloyDb\V1\GenerateClientCertificateRequest; use Google\Cloud\AlloyDb\V1\GenerateClientCertificateResponse; @@ -59,6 +62,8 @@ use Google\Cloud\AlloyDb\V1\ListBackupsResponse; use Google\Cloud\AlloyDb\V1\ListClustersRequest; use Google\Cloud\AlloyDb\V1\ListClustersResponse; +use Google\Cloud\AlloyDb\V1\ListDatabasesRequest; +use Google\Cloud\AlloyDb\V1\ListDatabasesResponse; use Google\Cloud\AlloyDb\V1\ListInstancesRequest; use Google\Cloud\AlloyDb\V1\ListInstancesResponse; use Google\Cloud\AlloyDb\V1\ListSupportedDatabaseFlagsRequest; @@ -69,6 +74,7 @@ use Google\Cloud\AlloyDb\V1\RestartInstanceRequest; use Google\Cloud\AlloyDb\V1\RestoreClusterRequest; use Google\Cloud\AlloyDb\V1\SupportedDatabaseFlag; +use Google\Cloud\AlloyDb\V1\SwitchoverClusterRequest; use Google\Cloud\AlloyDb\V1\UpdateBackupRequest; use Google\Cloud\AlloyDb\V1\UpdateClusterRequest; use Google\Cloud\AlloyDb\V1\UpdateInstanceRequest; @@ -276,6 +282,7 @@ public function createBackupTest() $reconciling = false; $etag = 'etag3123477'; $sizeBytes = 1796325715; + $satisfiesPzs = false; $expectedResponse = new Backup(); $expectedResponse->setName($name); $expectedResponse->setDisplayName($displayName); @@ -286,6 +293,7 @@ public function createBackupTest() $expectedResponse->setReconciling($reconciling); $expectedResponse->setEtag($etag); $expectedResponse->setSizeBytes($sizeBytes); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); @@ -431,6 +439,7 @@ public function createClusterTest() $network = 'network1843485230'; $etag = 'etag3123477'; $reconciling = false; + $satisfiesPzs = false; $expectedResponse = new Cluster(); $expectedResponse->setName($name); $expectedResponse->setDisplayName($displayName); @@ -438,6 +447,7 @@ public function createClusterTest() $expectedResponse->setNetwork($network); $expectedResponse->setEtag($etag); $expectedResponse->setReconciling($reconciling); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); @@ -582,16 +592,20 @@ public function createInstanceTest() $uid = 'uid115792'; $gceZone = 'gceZone-227587294'; $ipAddress = 'ipAddress1480014044'; + $publicIpAddress = 'publicIpAddress2014408818'; $reconciling = false; $etag = 'etag3123477'; + $satisfiesPzs = false; $expectedResponse = new Instance(); $expectedResponse->setName($name); $expectedResponse->setDisplayName($displayName); $expectedResponse->setUid($uid); $expectedResponse->setGceZone($gceZone); $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setPublicIpAddress($publicIpAddress); $expectedResponse->setReconciling($reconciling); $expectedResponse->setEtag($etag); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); @@ -737,6 +751,7 @@ public function createSecondaryClusterTest() $network = 'network1843485230'; $etag = 'etag3123477'; $reconciling = false; + $satisfiesPzs = false; $expectedResponse = new Cluster(); $expectedResponse->setName($name); $expectedResponse->setDisplayName($displayName); @@ -744,6 +759,7 @@ public function createSecondaryClusterTest() $expectedResponse->setNetwork($network); $expectedResponse->setEtag($etag); $expectedResponse->setReconciling($reconciling); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); @@ -888,16 +904,20 @@ public function createSecondaryInstanceTest() $uid = 'uid115792'; $gceZone = 'gceZone-227587294'; $ipAddress = 'ipAddress1480014044'; + $publicIpAddress = 'publicIpAddress2014408818'; $reconciling = false; $etag = 'etag3123477'; + $satisfiesPzs = false; $expectedResponse = new Instance(); $expectedResponse->setName($name); $expectedResponse->setDisplayName($displayName); $expectedResponse->setUid($uid); $expectedResponse->setGceZone($gceZone); $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setPublicIpAddress($publicIpAddress); $expectedResponse->setReconciling($reconciling); $expectedResponse->setEtag($etag); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); @@ -1027,9 +1047,11 @@ public function createUserTest() // Mock response $name = 'name3373707'; $password = 'password1216985755'; + $keepExtraRoles = true; $expectedResponse = new User(); $expectedResponse->setName($name); $expectedResponse->setPassword($password); + $expectedResponse->setKeepExtraRoles($keepExtraRoles); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); @@ -1525,6 +1547,89 @@ public function deleteUserExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function executeSqlTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ExecuteSqlResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedInstance = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $database = 'database1789464955'; + $user = 'user3599307'; + $sqlStatement = 'sqlStatement-2051442626'; + $request = (new ExecuteSqlRequest()) + ->setInstance($formattedInstance) + ->setDatabase($database) + ->setUser($user) + ->setSqlStatement($sqlStatement); + $response = $gapicClient->executeSql($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.alloydb.v1.AlloyDBAdmin/ExecuteSql', $actualFuncCall); + $actualValue = $actualRequestObject->getInstance(); + $this->assertProtobufEquals($formattedInstance, $actualValue); + $actualValue = $actualRequestObject->getDatabase(); + $this->assertProtobufEquals($database, $actualValue); + $actualValue = $actualRequestObject->getUser(); + $this->assertProtobufEquals($user, $actualValue); + $actualValue = $actualRequestObject->getSqlStatement(); + $this->assertProtobufEquals($sqlStatement, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function executeSqlExceptionTest() + { + $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 + $formattedInstance = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); + $database = 'database1789464955'; + $user = 'user3599307'; + $sqlStatement = 'sqlStatement-2051442626'; + $request = (new ExecuteSqlRequest()) + ->setInstance($formattedInstance) + ->setDatabase($database) + ->setUser($user) + ->setSqlStatement($sqlStatement); + try { + $gapicClient->executeSql($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 failoverInstanceTest() { @@ -1551,16 +1656,20 @@ public function failoverInstanceTest() $uid = 'uid115792'; $gceZone = 'gceZone-227587294'; $ipAddress = 'ipAddress1480014044'; + $publicIpAddress = 'publicIpAddress2014408818'; $reconciling = false; $etag = 'etag3123477'; + $satisfiesPzs = false; $expectedResponse = new Instance(); $expectedResponse->setName($name2); $expectedResponse->setDisplayName($displayName); $expectedResponse->setUid($uid); $expectedResponse->setGceZone($gceZone); $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setPublicIpAddress($publicIpAddress); $expectedResponse->setReconciling($reconciling); $expectedResponse->setEtag($etag); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); @@ -1744,6 +1853,7 @@ public function getBackupTest() $reconciling = false; $etag = 'etag3123477'; $sizeBytes = 1796325715; + $satisfiesPzs = false; $expectedResponse = new Backup(); $expectedResponse->setName($name2); $expectedResponse->setDisplayName($displayName); @@ -1754,6 +1864,7 @@ public function getBackupTest() $expectedResponse->setReconciling($reconciling); $expectedResponse->setEtag($etag); $expectedResponse->setSizeBytes($sizeBytes); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); @@ -1822,6 +1933,7 @@ public function getClusterTest() $network = 'network1843485230'; $etag = 'etag3123477'; $reconciling = false; + $satisfiesPzs = false; $expectedResponse = new Cluster(); $expectedResponse->setName($name2); $expectedResponse->setDisplayName($displayName); @@ -1829,6 +1941,7 @@ public function getClusterTest() $expectedResponse->setNetwork($network); $expectedResponse->setEtag($etag); $expectedResponse->setReconciling($reconciling); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); @@ -1893,10 +2006,12 @@ public function getConnectionInfoTest() // Mock response $name = 'name3373707'; $ipAddress = 'ipAddress1480014044'; + $publicIpAddress = 'publicIpAddress2014408818'; $instanceUid = 'instanceUid-737331802'; $expectedResponse = new ConnectionInfo(); $expectedResponse->setName($name); $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setPublicIpAddress($publicIpAddress); $expectedResponse->setInstanceUid($instanceUid); $transport->addResponse($expectedResponse); // Mock request @@ -1965,16 +2080,20 @@ public function getInstanceTest() $uid = 'uid115792'; $gceZone = 'gceZone-227587294'; $ipAddress = 'ipAddress1480014044'; + $publicIpAddress = 'publicIpAddress2014408818'; $reconciling = false; $etag = 'etag3123477'; + $satisfiesPzs = false; $expectedResponse = new Instance(); $expectedResponse->setName($name2); $expectedResponse->setDisplayName($displayName); $expectedResponse->setUid($uid); $expectedResponse->setGceZone($gceZone); $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setPublicIpAddress($publicIpAddress); $expectedResponse->setReconciling($reconciling); $expectedResponse->setEtag($etag); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[INSTANCE]'); @@ -2039,9 +2158,11 @@ public function getUserTest() // Mock response $name2 = 'name2-1052831874'; $password = 'password1216985755'; + $keepExtraRoles = true; $expectedResponse = new User(); $expectedResponse->setName($name2); $expectedResponse->setPassword($password); + $expectedResponse->setKeepExtraRoles($keepExtraRoles); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->userName('[PROJECT]', '[LOCATION]', '[CLUSTER]', '[USER]'); @@ -2121,16 +2242,20 @@ public function injectFaultTest() $uid = 'uid115792'; $gceZone = 'gceZone-227587294'; $ipAddress = 'ipAddress1480014044'; + $publicIpAddress = 'publicIpAddress2014408818'; $reconciling = false; $etag = 'etag3123477'; + $satisfiesPzs = false; $expectedResponse = new Instance(); $expectedResponse->setName($name2); $expectedResponse->setDisplayName($displayName); $expectedResponse->setUid($uid); $expectedResponse->setGceZone($gceZone); $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setPublicIpAddress($publicIpAddress); $expectedResponse->setReconciling($reconciling); $expectedResponse->setEtag($etag); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); @@ -2377,6 +2502,77 @@ public function listClustersExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function listDatabasesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $databasesElement = new Database(); + $databases = [$databasesElement]; + $expectedResponse = new ListDatabasesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setDatabases($databases); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new ListDatabasesRequest())->setParent($formattedParent); + $response = $gapicClient->listDatabases($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getDatabases()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1.AlloyDBAdmin/ListDatabases', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listDatabasesExceptionTest() + { + $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 + $formattedParent = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new ListDatabasesRequest())->setParent($formattedParent); + try { + $gapicClient->listDatabases($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 listInstancesTest() { @@ -2617,6 +2813,7 @@ public function promoteClusterTest() $network = 'network1843485230'; $etag2 = 'etag2-1293302904'; $reconciling = false; + $satisfiesPzs = false; $expectedResponse = new Cluster(); $expectedResponse->setName($name2); $expectedResponse->setDisplayName($displayName); @@ -2624,6 +2821,7 @@ public function promoteClusterTest() $expectedResponse->setNetwork($network); $expectedResponse->setEtag($etag2); $expectedResponse->setReconciling($reconciling); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); @@ -2750,16 +2948,20 @@ public function restartInstanceTest() $uid = 'uid115792'; $gceZone = 'gceZone-227587294'; $ipAddress = 'ipAddress1480014044'; + $publicIpAddress = 'publicIpAddress2014408818'; $reconciling = false; $etag = 'etag3123477'; + $satisfiesPzs = false; $expectedResponse = new Instance(); $expectedResponse->setName($name2); $expectedResponse->setDisplayName($displayName); $expectedResponse->setUid($uid); $expectedResponse->setGceZone($gceZone); $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setPublicIpAddress($publicIpAddress); $expectedResponse->setReconciling($reconciling); $expectedResponse->setEtag($etag); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); @@ -2887,6 +3089,7 @@ public function restoreClusterTest() $network = 'network1843485230'; $etag = 'etag3123477'; $reconciling = false; + $satisfiesPzs = false; $expectedResponse = new Cluster(); $expectedResponse->setName($name); $expectedResponse->setDisplayName($displayName); @@ -2894,6 +3097,7 @@ public function restoreClusterTest() $expectedResponse->setNetwork($network); $expectedResponse->setEtag($etag); $expectedResponse->setReconciling($reconciling); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); @@ -3012,6 +3216,142 @@ public function restoreClusterExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); } + /** @test */ + public function switchoverClusterTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/switchoverClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $network = 'network1843485230'; + $etag = 'etag3123477'; + $reconciling = false; + $satisfiesPzs = false; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $expectedResponse->setNetwork($network); + $expectedResponse->setEtag($etag); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/switchoverClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new SwitchoverClusterRequest())->setName($formattedName); + $response = $gapicClient->switchoverCluster($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.alloydb.v1.AlloyDBAdmin/SwitchoverCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/switchoverClusterTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function switchoverClusterExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/switchoverClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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 + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new SwitchoverClusterRequest())->setName($formattedName); + $response = $gapicClient->switchoverCluster($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/switchoverClusterTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + /** @test */ public function updateBackupTest() { @@ -3042,6 +3382,7 @@ public function updateBackupTest() $reconciling = false; $etag = 'etag3123477'; $sizeBytes = 1796325715; + $satisfiesPzs = false; $expectedResponse = new Backup(); $expectedResponse->setName($name); $expectedResponse->setDisplayName($displayName); @@ -3052,6 +3393,7 @@ public function updateBackupTest() $expectedResponse->setReconciling($reconciling); $expectedResponse->setEtag($etag); $expectedResponse->setSizeBytes($sizeBytes); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); @@ -3183,6 +3525,7 @@ public function updateClusterTest() $network = 'network1843485230'; $etag = 'etag3123477'; $reconciling = false; + $satisfiesPzs = false; $expectedResponse = new Cluster(); $expectedResponse->setName($name); $expectedResponse->setDisplayName($displayName); @@ -3190,6 +3533,7 @@ public function updateClusterTest() $expectedResponse->setNetwork($network); $expectedResponse->setEtag($etag); $expectedResponse->setReconciling($reconciling); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); @@ -3320,16 +3664,20 @@ public function updateInstanceTest() $uid = 'uid115792'; $gceZone = 'gceZone-227587294'; $ipAddress = 'ipAddress1480014044'; + $publicIpAddress = 'publicIpAddress2014408818'; $reconciling = false; $etag = 'etag3123477'; + $satisfiesPzs = false; $expectedResponse = new Instance(); $expectedResponse->setName($name); $expectedResponse->setDisplayName($displayName); $expectedResponse->setUid($uid); $expectedResponse->setGceZone($gceZone); $expectedResponse->setIpAddress($ipAddress); + $expectedResponse->setPublicIpAddress($publicIpAddress); $expectedResponse->setReconciling($reconciling); $expectedResponse->setEtag($etag); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); @@ -3445,9 +3793,11 @@ public function updateUserTest() // Mock response $name = 'name3373707'; $password = 'password1216985755'; + $keepExtraRoles = true; $expectedResponse = new User(); $expectedResponse->setName($name); $expectedResponse->setPassword($password); + $expectedResponse->setKeepExtraRoles($keepExtraRoles); $transport->addResponse($expectedResponse); // Mock request $user = new User(); From 8afaa8c19587006d276ded057c684b9a59836c66 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 23 Oct 2024 18:33:12 -0700 Subject: [PATCH 27/34] feat: A new field `headline_offer_installment` is added to message `.google.shopping.css.v1.Attributes` (#7761) feat: A new field `headline_offer_subscription_cost` is added to message `.google.shopping.css.v1.Attributes` feat: A new message `HeadlineOfferSubscriptionCost` is added feat: A new message `HeadlineOfferInstallment` is added feat: A new enum `SubscriptionPeriod` is added PiperOrigin-RevId: 688649184 Source-Link: https://github.com/googleapis/googleapis/commit/c8a726182c087afc514aa51a980b937d07f86540 Source-Link: https://github.com/googleapis/googleapis-gen/commit/3dcef19e307b679a3f6c881d79f064e885fd52fd Copy-Tag: eyJwIjoiU2hvcHBpbmdDc3MvLk93bEJvdC55YW1sIiwiaCI6IjNkY2VmMTllMzA3YjY3OWEzZjZjODgxZDc5ZjA2NGU4ODVmZDUyZmQifQ== --- ShoppingCss/metadata/V1/CssProductCommon.php | Bin 4194 -> 4759 bytes ShoppingCss/src/V1/Attributes.php | 92 ++++++++++ .../src/V1/HeadlineOfferInstallment.php | 155 +++++++++++++++++ .../src/V1/HeadlineOfferSubscriptionCost.php | 157 ++++++++++++++++++ ShoppingCss/src/V1/SubscriptionPeriod.php | 61 +++++++ 5 files changed, 465 insertions(+) create mode 100644 ShoppingCss/src/V1/HeadlineOfferInstallment.php create mode 100644 ShoppingCss/src/V1/HeadlineOfferSubscriptionCost.php create mode 100644 ShoppingCss/src/V1/SubscriptionPeriod.php diff --git a/ShoppingCss/metadata/V1/CssProductCommon.php b/ShoppingCss/metadata/V1/CssProductCommon.php index 2292a7adc7a7fcceb2f12b316b2f52b30df26960..180c55b9b5fd4e89dbe7afa61c2fd28ee8623f53 100644 GIT binary patch delta 457 zcmaE)FkN-STqdS<@{{K?^)f9G+N{T1#-=6|!X=fFnwXN4nU@-$pO%(d6rY(_T#}fR zlbf1XB4Mn+sKISyFxh}t!o>rs%pau66QM{bo=XAEh~m-qS#hxyq!wl7r${gY&E_-G0-0@!Y+L|X zT1b?O7ospeCp9moptional string custom_label_4 = 50; */ protected $custom_label_4 = null; + /** + * Number and amount of installments to pay for an item. + * + * Generated from protobuf field .google.shopping.css.v1.HeadlineOfferInstallment headline_offer_installment = 51; + */ + protected $headline_offer_installment = null; + /** + * Number of periods (months or years) and amount of payment per period + * for an item with an associated subscription contract. + * + * Generated from protobuf field .google.shopping.css.v1.HeadlineOfferSubscriptionCost headline_offer_subscription_cost = 52; + */ + protected $headline_offer_subscription_cost = null; /** * Constructor. @@ -470,6 +483,11 @@ class Attributes extends \Google\Protobuf\Internal\Message * Custom label 3 for custom grouping of items in a Shopping campaign. * @type string $custom_label_4 * Custom label 4 for custom grouping of items in a Shopping campaign. + * @type \Google\Shopping\Css\V1\HeadlineOfferInstallment $headline_offer_installment + * Number and amount of installments to pay for an item. + * @type \Google\Shopping\Css\V1\HeadlineOfferSubscriptionCost $headline_offer_subscription_cost + * Number of periods (months or years) and amount of payment per period + * for an item with an associated subscription contract. * } */ public function __construct($data = NULL) { @@ -2189,5 +2207,79 @@ public function setCustomLabel4($var) return $this; } + /** + * Number and amount of installments to pay for an item. + * + * Generated from protobuf field .google.shopping.css.v1.HeadlineOfferInstallment headline_offer_installment = 51; + * @return \Google\Shopping\Css\V1\HeadlineOfferInstallment|null + */ + public function getHeadlineOfferInstallment() + { + return $this->headline_offer_installment; + } + + public function hasHeadlineOfferInstallment() + { + return isset($this->headline_offer_installment); + } + + public function clearHeadlineOfferInstallment() + { + unset($this->headline_offer_installment); + } + + /** + * Number and amount of installments to pay for an item. + * + * Generated from protobuf field .google.shopping.css.v1.HeadlineOfferInstallment headline_offer_installment = 51; + * @param \Google\Shopping\Css\V1\HeadlineOfferInstallment $var + * @return $this + */ + public function setHeadlineOfferInstallment($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Css\V1\HeadlineOfferInstallment::class); + $this->headline_offer_installment = $var; + + return $this; + } + + /** + * Number of periods (months or years) and amount of payment per period + * for an item with an associated subscription contract. + * + * Generated from protobuf field .google.shopping.css.v1.HeadlineOfferSubscriptionCost headline_offer_subscription_cost = 52; + * @return \Google\Shopping\Css\V1\HeadlineOfferSubscriptionCost|null + */ + public function getHeadlineOfferSubscriptionCost() + { + return $this->headline_offer_subscription_cost; + } + + public function hasHeadlineOfferSubscriptionCost() + { + return isset($this->headline_offer_subscription_cost); + } + + public function clearHeadlineOfferSubscriptionCost() + { + unset($this->headline_offer_subscription_cost); + } + + /** + * Number of periods (months or years) and amount of payment per period + * for an item with an associated subscription contract. + * + * Generated from protobuf field .google.shopping.css.v1.HeadlineOfferSubscriptionCost headline_offer_subscription_cost = 52; + * @param \Google\Shopping\Css\V1\HeadlineOfferSubscriptionCost $var + * @return $this + */ + public function setHeadlineOfferSubscriptionCost($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Css\V1\HeadlineOfferSubscriptionCost::class); + $this->headline_offer_subscription_cost = $var; + + return $this; + } + } diff --git a/ShoppingCss/src/V1/HeadlineOfferInstallment.php b/ShoppingCss/src/V1/HeadlineOfferInstallment.php new file mode 100644 index 000000000000..ee950616963f --- /dev/null +++ b/ShoppingCss/src/V1/HeadlineOfferInstallment.php @@ -0,0 +1,155 @@ +google.shopping.css.v1.HeadlineOfferInstallment + */ +class HeadlineOfferInstallment extends \Google\Protobuf\Internal\Message +{ + /** + * The number of installments the buyer has to pay. + * + * Generated from protobuf field int64 months = 1; + */ + protected $months = 0; + /** + * The amount the buyer has to pay per month. + * + * Generated from protobuf field .google.shopping.type.Price amount = 2; + */ + protected $amount = null; + /** + * The up-front down payment amount the buyer has to pay. + * + * Generated from protobuf field .google.shopping.type.Price downpayment = 3; + */ + protected $downpayment = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $months + * The number of installments the buyer has to pay. + * @type \Google\Shopping\Type\Price $amount + * The amount the buyer has to pay per month. + * @type \Google\Shopping\Type\Price $downpayment + * The up-front down payment amount the buyer has to pay. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Css\V1\CssProductCommon::initOnce(); + parent::__construct($data); + } + + /** + * The number of installments the buyer has to pay. + * + * Generated from protobuf field int64 months = 1; + * @return int|string + */ + public function getMonths() + { + return $this->months; + } + + /** + * The number of installments the buyer has to pay. + * + * Generated from protobuf field int64 months = 1; + * @param int|string $var + * @return $this + */ + public function setMonths($var) + { + GPBUtil::checkInt64($var); + $this->months = $var; + + return $this; + } + + /** + * The amount the buyer has to pay per month. + * + * Generated from protobuf field .google.shopping.type.Price amount = 2; + * @return \Google\Shopping\Type\Price|null + */ + public function getAmount() + { + return $this->amount; + } + + public function hasAmount() + { + return isset($this->amount); + } + + public function clearAmount() + { + unset($this->amount); + } + + /** + * The amount the buyer has to pay per month. + * + * Generated from protobuf field .google.shopping.type.Price amount = 2; + * @param \Google\Shopping\Type\Price $var + * @return $this + */ + public function setAmount($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Type\Price::class); + $this->amount = $var; + + return $this; + } + + /** + * The up-front down payment amount the buyer has to pay. + * + * Generated from protobuf field .google.shopping.type.Price downpayment = 3; + * @return \Google\Shopping\Type\Price|null + */ + public function getDownpayment() + { + return $this->downpayment; + } + + public function hasDownpayment() + { + return isset($this->downpayment); + } + + public function clearDownpayment() + { + unset($this->downpayment); + } + + /** + * The up-front down payment amount the buyer has to pay. + * + * Generated from protobuf field .google.shopping.type.Price downpayment = 3; + * @param \Google\Shopping\Type\Price $var + * @return $this + */ + public function setDownpayment($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Type\Price::class); + $this->downpayment = $var; + + return $this; + } + +} + diff --git a/ShoppingCss/src/V1/HeadlineOfferSubscriptionCost.php b/ShoppingCss/src/V1/HeadlineOfferSubscriptionCost.php new file mode 100644 index 000000000000..d2769f8faceb --- /dev/null +++ b/ShoppingCss/src/V1/HeadlineOfferSubscriptionCost.php @@ -0,0 +1,157 @@ +google.shopping.css.v1.HeadlineOfferSubscriptionCost + */ +class HeadlineOfferSubscriptionCost extends \Google\Protobuf\Internal\Message +{ + /** + * The type of subscription period. + * Supported values are: + * * "`month`" + * * "`year`" + * + * Generated from protobuf field .google.shopping.css.v1.SubscriptionPeriod period = 1; + */ + protected $period = 0; + /** + * The number of subscription periods the buyer has to pay. + * + * Generated from protobuf field int64 period_length = 2; + */ + protected $period_length = 0; + /** + * The amount the buyer has to pay per subscription period. + * + * Generated from protobuf field .google.shopping.type.Price amount = 3; + */ + protected $amount = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $period + * The type of subscription period. + * Supported values are: + * * "`month`" + * * "`year`" + * @type int|string $period_length + * The number of subscription periods the buyer has to pay. + * @type \Google\Shopping\Type\Price $amount + * The amount the buyer has to pay per subscription period. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Shopping\Css\V1\CssProductCommon::initOnce(); + parent::__construct($data); + } + + /** + * The type of subscription period. + * Supported values are: + * * "`month`" + * * "`year`" + * + * Generated from protobuf field .google.shopping.css.v1.SubscriptionPeriod period = 1; + * @return int + */ + public function getPeriod() + { + return $this->period; + } + + /** + * The type of subscription period. + * Supported values are: + * * "`month`" + * * "`year`" + * + * Generated from protobuf field .google.shopping.css.v1.SubscriptionPeriod period = 1; + * @param int $var + * @return $this + */ + public function setPeriod($var) + { + GPBUtil::checkEnum($var, \Google\Shopping\Css\V1\SubscriptionPeriod::class); + $this->period = $var; + + return $this; + } + + /** + * The number of subscription periods the buyer has to pay. + * + * Generated from protobuf field int64 period_length = 2; + * @return int|string + */ + public function getPeriodLength() + { + return $this->period_length; + } + + /** + * The number of subscription periods the buyer has to pay. + * + * Generated from protobuf field int64 period_length = 2; + * @param int|string $var + * @return $this + */ + public function setPeriodLength($var) + { + GPBUtil::checkInt64($var); + $this->period_length = $var; + + return $this; + } + + /** + * The amount the buyer has to pay per subscription period. + * + * Generated from protobuf field .google.shopping.type.Price amount = 3; + * @return \Google\Shopping\Type\Price|null + */ + public function getAmount() + { + return $this->amount; + } + + public function hasAmount() + { + return isset($this->amount); + } + + public function clearAmount() + { + unset($this->amount); + } + + /** + * The amount the buyer has to pay per subscription period. + * + * Generated from protobuf field .google.shopping.type.Price amount = 3; + * @param \Google\Shopping\Type\Price $var + * @return $this + */ + public function setAmount($var) + { + GPBUtil::checkMessage($var, \Google\Shopping\Type\Price::class); + $this->amount = $var; + + return $this; + } + +} + diff --git a/ShoppingCss/src/V1/SubscriptionPeriod.php b/ShoppingCss/src/V1/SubscriptionPeriod.php new file mode 100644 index 000000000000..0d83dbf1474f --- /dev/null +++ b/ShoppingCss/src/V1/SubscriptionPeriod.php @@ -0,0 +1,61 @@ +google.shopping.css.v1.SubscriptionPeriod + */ +class SubscriptionPeriod +{ + /** + * Indicates that the subscription period is unspecified. + * + * Generated from protobuf enum SUBSCRIPTION_PERIOD_UNSPECIFIED = 0; + */ + const SUBSCRIPTION_PERIOD_UNSPECIFIED = 0; + /** + * Indicates that the subscription period is month. + * + * Generated from protobuf enum MONTH = 1; + */ + const MONTH = 1; + /** + * Indicates that the subscription period is year. + * + * Generated from protobuf enum YEAR = 2; + */ + const YEAR = 2; + + private static $valueToName = [ + self::SUBSCRIPTION_PERIOD_UNSPECIFIED => 'SUBSCRIPTION_PERIOD_UNSPECIFIED', + self::MONTH => 'MONTH', + self::YEAR => 'YEAR', + ]; + + 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); + } +} + From c134d3debb4e4afa724c2e769c4adaff113a3477 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 23 Oct 2024 18:33:28 -0700 Subject: [PATCH 28/34] feat(spanner): Add support for Cloud Spanner Default Backup Schedules (#7762) PiperOrigin-RevId: 688946300 Source-Link: https://github.com/googleapis/googleapis/commit/b11e6b0741fc333f7d558447f2efda76db44243d Source-Link: https://github.com/googleapis/googleapis-gen/commit/f93f56b21ff01e499977c4dd54689cce1b7cf530 Copy-Tag: eyJwIjoiU3Bhbm5lci8uT3dsQm90LnlhbWwiLCJoIjoiZjkzZjU2YjIxZmYwMWU0OTk5NzdjNGRkNTQ2ODljY2UxYjdjZjUzMCJ9 --- .../Instance/V1/SpannerInstanceAdmin.php | Bin 16388 -> 16601 bytes Spanner/src/Admin/Instance/V1/Instance.php | 58 +++++++++++++++ .../V1/Instance/DefaultBackupScheduleType.php | 70 ++++++++++++++++++ 3 files changed, 128 insertions(+) create mode 100644 Spanner/src/Admin/Instance/V1/Instance/DefaultBackupScheduleType.php diff --git a/Spanner/metadata/Admin/Instance/V1/SpannerInstanceAdmin.php b/Spanner/metadata/Admin/Instance/V1/SpannerInstanceAdmin.php index 1e2e58c40e2cbb5bc005178fc1d3b852ce4d36e8..8b5e9db042db74928e64a578df25e8e81c54bec9 100644 GIT binary patch delta 225 zcmZo^V7%GLxM3m-%ky$B+sQm^iW75WHeX^X=VF@0x!Ie42a|?SK9@{NYFc7xPDy-H zVsdtAL40v?MrulFPHKEfWkIThxB{aFpOMStg)&-FdM*%^PGE(>P<0_dWt0C29?4Wn z;*!LvLP&>8!^PFjG1Mm{-pSF~J2W6Z*xAF?CDg|?J|r^0H9piYIKb7})6LV>MSwww qgNwz_-_KQmQHYm|(=jx}-`6q3(^-JY%J-F{*JOTa#mz5-WOMOo4A L?.google.spanner.admin.instance.v1.Instance.Edition edition = 20 [(.google.api.field_behavior) = OPTIONAL]; */ private $edition = 0; + /** + * Optional. Controls the default backup behavior for new databases within the + * instance. + * Note that `AUTOMATIC` is not permitted for free instances, as backups and + * backup schedules are not allowed for free instances. + * In the `GetInstance` or `ListInstances` response, if the value of + * default_backup_schedule_type is unset or NONE, no default backup + * schedule will be created for new databases within the instance. + * + * Generated from protobuf field .google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType default_backup_schedule_type = 23 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $default_backup_schedule_type = 0; /** * Constructor. @@ -248,6 +260,14 @@ class Instance extends \Google\Protobuf\Internal\Message * Output only. The time at which the instance was most recently updated. * @type int $edition * Optional. The `Edition` of the current instance. + * @type int $default_backup_schedule_type + * Optional. Controls the default backup behavior for new databases within the + * instance. + * Note that `AUTOMATIC` is not permitted for free instances, as backups and + * backup schedules are not allowed for free instances. + * In the `GetInstance` or `ListInstances` response, if the value of + * default_backup_schedule_type is unset or NONE, no default backup + * schedule will be created for new databases within the instance. * } */ public function __construct($data = NULL) { @@ -745,5 +765,43 @@ public function setEdition($var) return $this; } + /** + * Optional. Controls the default backup behavior for new databases within the + * instance. + * Note that `AUTOMATIC` is not permitted for free instances, as backups and + * backup schedules are not allowed for free instances. + * In the `GetInstance` or `ListInstances` response, if the value of + * default_backup_schedule_type is unset or NONE, no default backup + * schedule will be created for new databases within the instance. + * + * Generated from protobuf field .google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType default_backup_schedule_type = 23 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getDefaultBackupScheduleType() + { + return $this->default_backup_schedule_type; + } + + /** + * Optional. Controls the default backup behavior for new databases within the + * instance. + * Note that `AUTOMATIC` is not permitted for free instances, as backups and + * backup schedules are not allowed for free instances. + * In the `GetInstance` or `ListInstances` response, if the value of + * default_backup_schedule_type is unset or NONE, no default backup + * schedule will be created for new databases within the instance. + * + * Generated from protobuf field .google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType default_backup_schedule_type = 23 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setDefaultBackupScheduleType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Spanner\Admin\Instance\V1\Instance\DefaultBackupScheduleType::class); + $this->default_backup_schedule_type = $var; + + return $this; + } + } diff --git a/Spanner/src/Admin/Instance/V1/Instance/DefaultBackupScheduleType.php b/Spanner/src/Admin/Instance/V1/Instance/DefaultBackupScheduleType.php new file mode 100644 index 000000000000..ee1c54f26a01 --- /dev/null +++ b/Spanner/src/Admin/Instance/V1/Instance/DefaultBackupScheduleType.php @@ -0,0 +1,70 @@ +google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType + */ +class DefaultBackupScheduleType +{ + /** + * Not specified. + * + * Generated from protobuf enum DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED = 0; + */ + const DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED = 0; + /** + * No default backup schedule will be created automatically on creation of a + * database within the instance. + * + * Generated from protobuf enum NONE = 1; + */ + const NONE = 1; + /** + * A default backup schedule will be created automatically on creation of a + * database within the instance. The default backup schedule creates a full + * backup every 24 hours and retains the backup for a period of 7 days. Once + * created, the default backup schedule can be edited/deleted similar to any + * other backup schedule. + * + * Generated from protobuf enum AUTOMATIC = 2; + */ + const AUTOMATIC = 2; + + private static $valueToName = [ + self::DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED => 'DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED', + self::NONE => 'NONE', + self::AUTOMATIC => 'AUTOMATIC', + ]; + + 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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DefaultBackupScheduleType::class, \Google\Cloud\Spanner\Admin\Instance\V1\Instance_DefaultBackupScheduleType::class); + From 4d427bf3f9b23c2d790e0d23ad0b9e842ceed691 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 23 Oct 2024 18:33:57 -0700 Subject: [PATCH 29/34] feat: Updated the exponential backoff settings for the Document AI ProcessDocument and BatchProcessDocuments methods (#7757) feat: Add RESOURCE_EXHAUSTED to retryable status codes for ProcessDocument method feat: Added an url for issue reporting and api short name PiperOrigin-RevId: 688214664 Source-Link: https://github.com/googleapis/googleapis/commit/76ca663d1df1cdd8e48f45af6e84212c551533ed Source-Link: https://github.com/googleapis/googleapis-gen/commit/6ad97277430744dd9c73e7ff397dce00547d8e0c Copy-Tag: eyJwIjoiRG9jdW1lbnRBaS8uT3dsQm90LnlhbWwiLCJoIjoiNmFkOTcyNzc0MzA3NDRkZDljNzNlN2ZmMzk3ZGNlMDA1NDdkOGUwYyJ9 --- .../document_processor_service_client_config.json | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/DocumentAi/src/V1/resources/document_processor_service_client_config.json b/DocumentAi/src/V1/resources/document_processor_service_client_config.json index 30f1e5961a04..d750f74493d7 100644 --- a/DocumentAi/src/V1/resources/document_processor_service_client_config.json +++ b/DocumentAi/src/V1/resources/document_processor_service_client_config.json @@ -5,7 +5,8 @@ "no_retry_codes": [], "retry_policy_1_codes": [ "DEADLINE_EXCEEDED", - "UNAVAILABLE" + "UNAVAILABLE", + "RESOURCE_EXHAUSTED" ], "retry_policy_2_codes": [ "DEADLINE_EXCEEDED", @@ -23,17 +24,17 @@ "total_timeout_millis": 0 }, "retry_policy_1_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 9.0, + "max_retry_delay_millis": 90000, "initial_rpc_timeout_millis": 300000, "rpc_timeout_multiplier": 1.0, "max_rpc_timeout_millis": 300000, "total_timeout_millis": 300000 }, "retry_policy_2_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.5, "max_retry_delay_millis": 60000, "initial_rpc_timeout_millis": 120000, "rpc_timeout_multiplier": 1.0, From c8289d51320fc3367fa1ab837c777288352f4bf3 Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Mon, 28 Oct 2024 11:08:18 -0700 Subject: [PATCH 30/34] feat: add Parallelstore V1 (#7764) --- Parallelstore/.OwlBot.yaml | 2 +- Parallelstore/metadata/V1/Parallelstore.php | Bin 0 -> 8431 bytes .../ParallelstoreClient/create_instance.php | 104 ++ .../ParallelstoreClient/delete_instance.php | 80 ++ .../V1/ParallelstoreClient/export_data.php | 83 ++ .../V1/ParallelstoreClient/get_instance.php | 72 ++ .../V1/ParallelstoreClient/get_location.php | 57 + .../V1/ParallelstoreClient/import_data.php | 83 ++ .../V1/ParallelstoreClient/list_instances.php | 80 ++ .../V1/ParallelstoreClient/list_locations.php | 62 + .../ParallelstoreClient/update_instance.php | 89 ++ .../src/V1/Client/ParallelstoreClient.php | 607 +++++++++ .../src/V1/CreateInstanceRequest.php | 273 ++++ .../src/V1/DeleteInstanceRequest.php | 155 +++ Parallelstore/src/V1/DestinationGcsBucket.php | 75 ++ .../src/V1/DestinationParallelstore.php | 71 ++ Parallelstore/src/V1/DirectoryStripeLevel.php | 68 + Parallelstore/src/V1/ExportDataMetadata.php | 351 ++++++ Parallelstore/src/V1/ExportDataRequest.php | 287 +++++ Parallelstore/src/V1/ExportDataResponse.php | 33 + Parallelstore/src/V1/FileStripeLevel.php | 68 + Parallelstore/src/V1/GetInstanceRequest.php | 86 ++ Parallelstore/src/V1/ImportDataMetadata.php | 351 ++++++ Parallelstore/src/V1/ImportDataRequest.php | 287 +++++ Parallelstore/src/V1/ImportDataResponse.php | 33 + Parallelstore/src/V1/Instance.php | 625 ++++++++++ Parallelstore/src/V1/Instance/State.php | 83 ++ Parallelstore/src/V1/ListInstancesRequest.php | 237 ++++ .../src/V1/ListInstancesResponse.php | 136 ++ Parallelstore/src/V1/OperationMetadata.php | 307 +++++ Parallelstore/src/V1/SourceGcsBucket.php | 75 ++ Parallelstore/src/V1/SourceParallelstore.php | 71 ++ Parallelstore/src/V1/TransferCounters.php | 261 ++++ .../src/V1/TransferOperationMetadata.php | 261 ++++ Parallelstore/src/V1/TransferType.php | 61 + .../src/V1/UpdateInstanceRequest.php | 225 ++++ Parallelstore/src/V1/gapic_metadata.json | 63 + .../parallelstore_client_config.json | 67 + .../parallelstore_descriptor_config.php | 197 +++ .../parallelstore_rest_client_config.php | 188 +++ .../V1/Client/ParallelstoreClientTest.php | 1111 +++++++++++++++++ 41 files changed, 7424 insertions(+), 1 deletion(-) create mode 100644 Parallelstore/metadata/V1/Parallelstore.php create mode 100644 Parallelstore/samples/V1/ParallelstoreClient/create_instance.php create mode 100644 Parallelstore/samples/V1/ParallelstoreClient/delete_instance.php create mode 100644 Parallelstore/samples/V1/ParallelstoreClient/export_data.php create mode 100644 Parallelstore/samples/V1/ParallelstoreClient/get_instance.php create mode 100644 Parallelstore/samples/V1/ParallelstoreClient/get_location.php create mode 100644 Parallelstore/samples/V1/ParallelstoreClient/import_data.php create mode 100644 Parallelstore/samples/V1/ParallelstoreClient/list_instances.php create mode 100644 Parallelstore/samples/V1/ParallelstoreClient/list_locations.php create mode 100644 Parallelstore/samples/V1/ParallelstoreClient/update_instance.php create mode 100644 Parallelstore/src/V1/Client/ParallelstoreClient.php create mode 100644 Parallelstore/src/V1/CreateInstanceRequest.php create mode 100644 Parallelstore/src/V1/DeleteInstanceRequest.php create mode 100644 Parallelstore/src/V1/DestinationGcsBucket.php create mode 100644 Parallelstore/src/V1/DestinationParallelstore.php create mode 100644 Parallelstore/src/V1/DirectoryStripeLevel.php create mode 100644 Parallelstore/src/V1/ExportDataMetadata.php create mode 100644 Parallelstore/src/V1/ExportDataRequest.php create mode 100644 Parallelstore/src/V1/ExportDataResponse.php create mode 100644 Parallelstore/src/V1/FileStripeLevel.php create mode 100644 Parallelstore/src/V1/GetInstanceRequest.php create mode 100644 Parallelstore/src/V1/ImportDataMetadata.php create mode 100644 Parallelstore/src/V1/ImportDataRequest.php create mode 100644 Parallelstore/src/V1/ImportDataResponse.php create mode 100644 Parallelstore/src/V1/Instance.php create mode 100644 Parallelstore/src/V1/Instance/State.php create mode 100644 Parallelstore/src/V1/ListInstancesRequest.php create mode 100644 Parallelstore/src/V1/ListInstancesResponse.php create mode 100644 Parallelstore/src/V1/OperationMetadata.php create mode 100644 Parallelstore/src/V1/SourceGcsBucket.php create mode 100644 Parallelstore/src/V1/SourceParallelstore.php create mode 100644 Parallelstore/src/V1/TransferCounters.php create mode 100644 Parallelstore/src/V1/TransferOperationMetadata.php create mode 100644 Parallelstore/src/V1/TransferType.php create mode 100644 Parallelstore/src/V1/UpdateInstanceRequest.php create mode 100644 Parallelstore/src/V1/gapic_metadata.json create mode 100644 Parallelstore/src/V1/resources/parallelstore_client_config.json create mode 100644 Parallelstore/src/V1/resources/parallelstore_descriptor_config.php create mode 100644 Parallelstore/src/V1/resources/parallelstore_rest_client_config.php create mode 100644 Parallelstore/tests/Unit/V1/Client/ParallelstoreClientTest.php diff --git a/Parallelstore/.OwlBot.yaml b/Parallelstore/.OwlBot.yaml index 7822dbcb99dd..b4d71bfaf41d 100644 --- a/Parallelstore/.OwlBot.yaml +++ b/Parallelstore/.OwlBot.yaml @@ -1,4 +1,4 @@ deep-copy-regex: - - source: /google/cloud/parallelstore/(v1beta)/.*-php/(.*) + - source: /google/cloud/parallelstore/(v1|v1beta)/.*-php/(.*) dest: /owl-bot-staging/Parallelstore/$1/$2 api-name: Parallelstore diff --git a/Parallelstore/metadata/V1/Parallelstore.php b/Parallelstore/metadata/V1/Parallelstore.php new file mode 100644 index 0000000000000000000000000000000000000000..0da87d8cc8afb9f56b4d726ce21300ad34db8e43 GIT binary patch literal 8431 zcmeHM&2QVt6<><6R~diL+KJ+Jh;FiDYMf<-8*;<+KK_G;_HV_ zcUl&qOZSZ+9@R!848ILX+l4S-X!zVfpMQjw&z-M$j+10qif3Xeo;g~cy&Q1V9RpB+ zh7r&6*=v!7JsK-oEeMui!_`w83L7rA_g;G|%O5I)@D3s3M3>0c#LvS@*C05$Lwx0#fD_(*1#5>e(dzKureE`gsK6)SZC7>%sV3PwWa zOc*^ORm%aa4XB0&qk4dbO}z$~o*GtU_{<05Gu`8%E$0^7E z^t+5~i&Am3KS7roh70o9?s1&yBxBmoq3eRUlk@Bn8i_a=k0AMg9P=c=V`%6|H(P{9 zelBrGO6zEd#W0>hQ@a(lQqUf4@0JQ{#f@TNeex|lijr&Pf?6qVZ%#@Wp<#8cQhZ#P zOwg6}!d8K;$aG~xEp7qL1^CRxN2SfOx=x9PawlJ@pQ3NXF^Z>G=zNh+_#WiR55X*6 z_IdDhk~Qr*FA>@2;_)PF1ZfT%#pB81Me*pZB*kO;4-%T*GCaR1D9YqVEdX%5iiSZb zz{UU~mLTH4R;xGgfU;gf7ahF`F##u4 zAjme-vH-s7`+Ci!FbK(<{yxH+Bs83`+uazj3abt1;q;$Cu{DO1LMXxaP5lArE}X6z zjW)U`@O>191M|l@EJj_L0J9;NM-Amnp*?WZZ$O(z48J?IfpQQ4JFQ?W#JZJ(uo2-O zib_fy^M;brY8FU(h-TJ_Nqo{N=o`7S!!qrPn*K=wO@-Z^7$`c6B(2TetkO{=mr;^f z4PIBdRr=Od$TeSgq4#empiEl=sARRa17&;_jnl&4@-%4bJV@tu63TcUT?*U|#i&lZ z3e#jz1Z7uRNK%){w5b3b3rpnN!sK##9!>1BiEOj(yq6g&>a2amw)*p znMg`Fk0xkGV$_KSJ&)ajlEI-G`Wk3z=FxRSKkRI1b~%O03Gzua%*~k}V_m2)MVeZ_ z@JXlj%V;{Ve%w?%{8##ziaQ|YcyPiaXgVT3h`5#FME@=_;(#zt|Hq9#jc_#bd5KMb zk%+zy!K;FBIMM)I@H3JC+3)o6NCg^M4^D6TLgIk<7KKFay>mcfSistl7`7hWAd#XS zD+y)Yk&-^h=4Su zZncAk!MSUP;P`P*?4mR2>tPq?En)qv+JqSU*R4(B6B{VW>ITfwLAA>c2pDU$+yEKl zgg4QcA0Ub5A3KCKBI7IH8jx89NEoBu<>)gBO^S#S--h9E%&xJyOxpu_8VvMgIyBUd zec}Z#DRjwn#1MPE1H*AhgJ~>NCVaPeO<_pJm(aM_U$-3two@#U@iZFc+k>|>Ddfch z8Wqw}W$+xtcUj%u-6)i`%F|Nk_zGib@nLDFT;aoO;R$$f1>f$mkIOcXuJu@t2zUk)D&@*AM$uTTqriWZ&{%9n#r=*gV!MMz zbM|(h;O!s^YR3JSYB0Y4?C)RxI+4Xo^lsxhbW1SNuZG76i;?4l#mKP%{;h;YBEv0S z?juEHuMm9Tu{(Y5rOFN?W1`a2$sU46jyD!h@Rt%AkB`i_pUvXig}`${$H*ydChSPk zCoj~w=mBcDA}aDr^(wdTEh9Kg2_IlCX3Bk(KA#_Q;be~g32Me?>Aq^lw-2c1kNc}R z9qJdE;hBE+gxZZX{Q@a~e!KwW&F}KNXs55KyhB_1bSmyEa3$b1euCP1qu;CK>tAxT? zVt+3#<&#jxLUDM5Ma1#Ot)xi^-hd=GfP+T~C*oC1>n)IeL z`UD^QX2*;-~Ql6c!hb3-;hTx)ahZG SQSWk@&UW%k?-O)_(0>5sx$5iy literal 0 HcmV?d00001 diff --git a/Parallelstore/samples/V1/ParallelstoreClient/create_instance.php b/Parallelstore/samples/V1/ParallelstoreClient/create_instance.php new file mode 100644 index 000000000000..56f45bf3e947 --- /dev/null +++ b/Parallelstore/samples/V1/ParallelstoreClient/create_instance.php @@ -0,0 +1,104 @@ +setCapacityGib($instanceCapacityGib); + $request = (new CreateInstanceRequest()) + ->setParent($formattedParent) + ->setInstanceId($instanceId) + ->setInstance($instance); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $parallelstoreClient->createInstance($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Instance $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $formattedParent = ParallelstoreClient::locationName('[PROJECT]', '[LOCATION]'); + $instanceId = '[INSTANCE_ID]'; + $instanceCapacityGib = 0; + + create_instance_sample($formattedParent, $instanceId, $instanceCapacityGib); +} +// [END parallelstore_v1_generated_Parallelstore_CreateInstance_sync] diff --git a/Parallelstore/samples/V1/ParallelstoreClient/delete_instance.php b/Parallelstore/samples/V1/ParallelstoreClient/delete_instance.php new file mode 100644 index 000000000000..8202d349d9ba --- /dev/null +++ b/Parallelstore/samples/V1/ParallelstoreClient/delete_instance.php @@ -0,0 +1,80 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $parallelstoreClient->deleteInstance($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $formattedName = ParallelstoreClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + + delete_instance_sample($formattedName); +} +// [END parallelstore_v1_generated_Parallelstore_DeleteInstance_sync] diff --git a/Parallelstore/samples/V1/ParallelstoreClient/export_data.php b/Parallelstore/samples/V1/ParallelstoreClient/export_data.php new file mode 100644 index 000000000000..9a64b7551feb --- /dev/null +++ b/Parallelstore/samples/V1/ParallelstoreClient/export_data.php @@ -0,0 +1,83 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $parallelstoreClient->exportData($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ExportDataResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $formattedName = ParallelstoreClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + + export_data_sample($formattedName); +} +// [END parallelstore_v1_generated_Parallelstore_ExportData_sync] diff --git a/Parallelstore/samples/V1/ParallelstoreClient/get_instance.php b/Parallelstore/samples/V1/ParallelstoreClient/get_instance.php new file mode 100644 index 000000000000..aba7bdaedf3d --- /dev/null +++ b/Parallelstore/samples/V1/ParallelstoreClient/get_instance.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Instance $response */ + $response = $parallelstoreClient->getInstance($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 +{ + $formattedName = ParallelstoreClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + + get_instance_sample($formattedName); +} +// [END parallelstore_v1_generated_Parallelstore_GetInstance_sync] diff --git a/Parallelstore/samples/V1/ParallelstoreClient/get_location.php b/Parallelstore/samples/V1/ParallelstoreClient/get_location.php new file mode 100644 index 000000000000..0950b50a4c68 --- /dev/null +++ b/Parallelstore/samples/V1/ParallelstoreClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END parallelstore_v1_generated_Parallelstore_GetLocation_sync] diff --git a/Parallelstore/samples/V1/ParallelstoreClient/import_data.php b/Parallelstore/samples/V1/ParallelstoreClient/import_data.php new file mode 100644 index 000000000000..a4e745a904ed --- /dev/null +++ b/Parallelstore/samples/V1/ParallelstoreClient/import_data.php @@ -0,0 +1,83 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $parallelstoreClient->importData($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ImportDataResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $formattedName = ParallelstoreClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + + import_data_sample($formattedName); +} +// [END parallelstore_v1_generated_Parallelstore_ImportData_sync] diff --git a/Parallelstore/samples/V1/ParallelstoreClient/list_instances.php b/Parallelstore/samples/V1/ParallelstoreClient/list_instances.php new file mode 100644 index 000000000000..8388dfa1a884 --- /dev/null +++ b/Parallelstore/samples/V1/ParallelstoreClient/list_instances.php @@ -0,0 +1,80 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $parallelstoreClient->listInstances($request); + + /** @var Instance $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = ParallelstoreClient::locationName('[PROJECT]', '[LOCATION]'); + + list_instances_sample($formattedParent); +} +// [END parallelstore_v1_generated_Parallelstore_ListInstances_sync] diff --git a/Parallelstore/samples/V1/ParallelstoreClient/list_locations.php b/Parallelstore/samples/V1/ParallelstoreClient/list_locations.php new file mode 100644 index 000000000000..05b2ed1ff36a --- /dev/null +++ b/Parallelstore/samples/V1/ParallelstoreClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END parallelstore_v1_generated_Parallelstore_ListLocations_sync] diff --git a/Parallelstore/samples/V1/ParallelstoreClient/update_instance.php b/Parallelstore/samples/V1/ParallelstoreClient/update_instance.php new file mode 100644 index 000000000000..a4aff2499ae7 --- /dev/null +++ b/Parallelstore/samples/V1/ParallelstoreClient/update_instance.php @@ -0,0 +1,89 @@ +setCapacityGib($instanceCapacityGib); + $request = (new UpdateInstanceRequest()) + ->setUpdateMask($updateMask) + ->setInstance($instance); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $parallelstoreClient->updateInstance($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Instance $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $instanceCapacityGib = 0; + + update_instance_sample($instanceCapacityGib); +} +// [END parallelstore_v1_generated_Parallelstore_UpdateInstance_sync] diff --git a/Parallelstore/src/V1/Client/ParallelstoreClient.php b/Parallelstore/src/V1/Client/ParallelstoreClient.php new file mode 100644 index 000000000000..d7f7d28afc7a --- /dev/null +++ b/Parallelstore/src/V1/Client/ParallelstoreClient.php @@ -0,0 +1,607 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/parallelstore_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/parallelstore_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/parallelstore_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/parallelstore_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a address + * resource. + * + * @param string $project + * @param string $region + * @param string $address + * + * @return string The formatted address resource. + */ + public static function addressName(string $project, string $region, string $address): string + { + return self::getPathTemplate('address')->render([ + 'project' => $project, + 'region' => $region, + 'address' => $address, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a instance + * resource. + * + * @param string $project + * @param string $location + * @param string $instance + * + * @return string The formatted instance resource. + */ + public static function instanceName(string $project, string $location, string $instance): string + { + return self::getPathTemplate('instance')->render([ + 'project' => $project, + 'location' => $location, + 'instance' => $instance, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a network + * resource. + * + * @param string $project + * @param string $network + * + * @return string The formatted network resource. + */ + public static function networkName(string $project, string $network): string + { + return self::getPathTemplate('network')->render([ + 'project' => $project, + 'network' => $network, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * service_account resource. + * + * @param string $project + * @param string $serviceAccount + * + * @return string The formatted service_account resource. + */ + public static function serviceAccountName(string $project, string $serviceAccount): string + { + return self::getPathTemplate('serviceAccount')->render([ + 'project' => $project, + 'service_account' => $serviceAccount, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - address: projects/{project}/regions/{region}/addresses/{address} + * - instance: projects/{project}/locations/{location}/instances/{instance} + * - location: projects/{project}/locations/{location} + * - network: projects/{project}/global/networks/{network} + * - serviceAccount: projects/{project}/serviceAccounts/{service_account} + * + * 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 'parallelstore.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); + $this->operationsClient = $this->createOperationsClient($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); + } + + /** + * Creates a Parallelstore instance in a given project and location. + * + * The async variant is {@see ParallelstoreClient::createInstanceAsync()} . + * + * @example samples/V1/ParallelstoreClient/create_instance.php + * + * @param CreateInstanceRequest $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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createInstance(CreateInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateInstance', $request, $callOptions)->wait(); + } + + /** + * Deletes a single instance. + * + * The async variant is {@see ParallelstoreClient::deleteInstanceAsync()} . + * + * @example samples/V1/ParallelstoreClient/delete_instance.php + * + * @param DeleteInstanceRequest $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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteInstance(DeleteInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteInstance', $request, $callOptions)->wait(); + } + + /** + * Copies data from Parallelstore to Cloud Storage. + * + * The async variant is {@see ParallelstoreClient::exportDataAsync()} . + * + * @example samples/V1/ParallelstoreClient/export_data.php + * + * @param ExportDataRequest $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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function exportData(ExportDataRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ExportData', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single instance. + * + * The async variant is {@see ParallelstoreClient::getInstanceAsync()} . + * + * @example samples/V1/ParallelstoreClient/get_instance.php + * + * @param GetInstanceRequest $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 Instance + * + * @throws ApiException Thrown if the API call fails. + */ + public function getInstance(GetInstanceRequest $request, array $callOptions = []): Instance + { + return $this->startApiCall('GetInstance', $request, $callOptions)->wait(); + } + + /** + * Copies data from Cloud Storage to Parallelstore. + * + * The async variant is {@see ParallelstoreClient::importDataAsync()} . + * + * @example samples/V1/ParallelstoreClient/import_data.php + * + * @param ImportDataRequest $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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function importData(ImportDataRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ImportData', $request, $callOptions)->wait(); + } + + /** + * Lists all instances in a given project and location. + * + * The async variant is {@see ParallelstoreClient::listInstancesAsync()} . + * + * @example samples/V1/ParallelstoreClient/list_instances.php + * + * @param ListInstancesRequest $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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listInstances(ListInstancesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListInstances', $request, $callOptions); + } + + /** + * Updates the parameters of a single instance. + * + * The async variant is {@see ParallelstoreClient::updateInstanceAsync()} . + * + * @example samples/V1/ParallelstoreClient/update_instance.php + * + * @param UpdateInstanceRequest $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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateInstance(UpdateInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateInstance', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see ParallelstoreClient::getLocationAsync()} . + * + * @example samples/V1/ParallelstoreClient/get_location.php + * + * @param GetLocationRequest $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 Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see ParallelstoreClient::listLocationsAsync()} . + * + * @example samples/V1/ParallelstoreClient/list_locations.php + * + * @param ListLocationsRequest $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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/Parallelstore/src/V1/CreateInstanceRequest.php b/Parallelstore/src/V1/CreateInstanceRequest.php new file mode 100644 index 000000000000..602bfbf612b0 --- /dev/null +++ b/Parallelstore/src/V1/CreateInstanceRequest.php @@ -0,0 +1,273 @@ +google.cloud.parallelstore.v1.CreateInstanceRequest + */ +class CreateInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The instance's project and location, in the format + * `projects/{project}/locations/{location}`. + * Locations map to Google Cloud zones; for example, `us-west1-b`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The name of the Parallelstore instance. + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-63 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project / location + * + * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_id = ''; + /** + * Required. The instance to create. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param string $parent Required. The instance's project and location, in the format + * `projects/{project}/locations/{location}`. + * Locations map to Google Cloud zones; for example, `us-west1-b`. Please see + * {@see ParallelstoreClient::locationName()} for help formatting this field. + * @param \Google\Cloud\Parallelstore\V1\Instance $instance Required. The instance to create. + * @param string $instanceId Required. The name of the Parallelstore instance. + * + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-63 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project / location + * + * @return \Google\Cloud\Parallelstore\V1\CreateInstanceRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Parallelstore\V1\Instance $instance, string $instanceId): self + { + return (new self()) + ->setParent($parent) + ->setInstance($instance) + ->setInstanceId($instanceId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The instance's project and location, in the format + * `projects/{project}/locations/{location}`. + * Locations map to Google Cloud zones; for example, `us-west1-b`. + * @type string $instance_id + * Required. The name of the Parallelstore instance. + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-63 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project / location + * @type \Google\Cloud\Parallelstore\V1\Instance $instance + * Required. The instance to create. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Required. The instance's project and location, in the format + * `projects/{project}/locations/{location}`. + * Locations map to Google Cloud zones; for example, `us-west1-b`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The instance's project and location, in the format + * `projects/{project}/locations/{location}`. + * Locations map to Google Cloud zones; for example, `us-west1-b`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The name of the Parallelstore instance. + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-63 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project / location + * + * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceId() + { + return $this->instance_id; + } + + /** + * Required. The name of the Parallelstore instance. + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-63 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project / location + * + * Generated from protobuf field string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceId($var) + { + GPBUtil::checkString($var, True); + $this->instance_id = $var; + + return $this; + } + + /** + * Required. The instance to create. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Parallelstore\V1\Instance|null + */ + public function getInstance() + { + return $this->instance; + } + + public function hasInstance() + { + return isset($this->instance); + } + + public function clearInstance() + { + unset($this->instance); + } + + /** + * Required. The instance to create. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Parallelstore\V1\Instance $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1\Instance::class); + $this->instance = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/Parallelstore/src/V1/DeleteInstanceRequest.php b/Parallelstore/src/V1/DeleteInstanceRequest.php new file mode 100644 index 000000000000..af5164d5b835 --- /dev/null +++ b/Parallelstore/src/V1/DeleteInstanceRequest.php @@ -0,0 +1,155 @@ +google.cloud.parallelstore.v1.DeleteInstanceRequest + */ +class DeleteInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param string $name Required. Name of the resource + * Please see {@see ParallelstoreClient::instanceName()} for help formatting this field. + * + * @return \Google\Cloud\Parallelstore\V1\DeleteInstanceRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the resource + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/Parallelstore/src/V1/DestinationGcsBucket.php b/Parallelstore/src/V1/DestinationGcsBucket.php new file mode 100644 index 000000000000..0acc29d59857 --- /dev/null +++ b/Parallelstore/src/V1/DestinationGcsBucket.php @@ -0,0 +1,75 @@ +google.cloud.parallelstore.v1.DestinationGcsBucket + */ +class DestinationGcsBucket extends \Google\Protobuf\Internal\Message +{ + /** + * Required. URI to a Cloud Storage bucket in the format: + * `gs:///`. The path inside the bucket is + * optional. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * Required. URI to a Cloud Storage bucket in the format: + * `gs:///`. The path inside the bucket is + * optional. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Required. URI to a Cloud Storage bucket in the format: + * `gs:///`. The path inside the bucket is + * optional. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * Required. URI to a Cloud Storage bucket in the format: + * `gs:///`. The path inside the bucket is + * optional. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + +} + diff --git a/Parallelstore/src/V1/DestinationParallelstore.php b/Parallelstore/src/V1/DestinationParallelstore.php new file mode 100644 index 000000000000..79e74ab6adf9 --- /dev/null +++ b/Parallelstore/src/V1/DestinationParallelstore.php @@ -0,0 +1,71 @@ +google.cloud.parallelstore.v1.DestinationParallelstore + */ +class DestinationParallelstore extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Root directory path to the Paralellstore filesystem, starting + * with `/`. Defaults to `/` if unset. + * + * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $path = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $path + * Optional. Root directory path to the Paralellstore filesystem, starting + * with `/`. Defaults to `/` if unset. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Root directory path to the Paralellstore filesystem, starting + * with `/`. Defaults to `/` if unset. + * + * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPath() + { + return $this->path; + } + + /** + * Optional. Root directory path to the Paralellstore filesystem, starting + * with `/`. Defaults to `/` if unset. + * + * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPath($var) + { + GPBUtil::checkString($var, True); + $this->path = $var; + + return $this; + } + +} + diff --git a/Parallelstore/src/V1/DirectoryStripeLevel.php b/Parallelstore/src/V1/DirectoryStripeLevel.php new file mode 100644 index 000000000000..d55b9050370c --- /dev/null +++ b/Parallelstore/src/V1/DirectoryStripeLevel.php @@ -0,0 +1,68 @@ +google.cloud.parallelstore.v1.DirectoryStripeLevel + */ +class DirectoryStripeLevel +{ + /** + * If not set, DirectoryStripeLevel will default to DIRECTORY_STRIPE_LEVEL_MAX + * + * Generated from protobuf enum DIRECTORY_STRIPE_LEVEL_UNSPECIFIED = 0; + */ + const DIRECTORY_STRIPE_LEVEL_UNSPECIFIED = 0; + /** + * Minimum directory striping + * + * Generated from protobuf enum DIRECTORY_STRIPE_LEVEL_MIN = 1; + */ + const DIRECTORY_STRIPE_LEVEL_MIN = 1; + /** + * Medium directory striping + * + * Generated from protobuf enum DIRECTORY_STRIPE_LEVEL_BALANCED = 2; + */ + const DIRECTORY_STRIPE_LEVEL_BALANCED = 2; + /** + * Maximum directory striping + * + * Generated from protobuf enum DIRECTORY_STRIPE_LEVEL_MAX = 3; + */ + const DIRECTORY_STRIPE_LEVEL_MAX = 3; + + private static $valueToName = [ + self::DIRECTORY_STRIPE_LEVEL_UNSPECIFIED => 'DIRECTORY_STRIPE_LEVEL_UNSPECIFIED', + self::DIRECTORY_STRIPE_LEVEL_MIN => 'DIRECTORY_STRIPE_LEVEL_MIN', + self::DIRECTORY_STRIPE_LEVEL_BALANCED => 'DIRECTORY_STRIPE_LEVEL_BALANCED', + self::DIRECTORY_STRIPE_LEVEL_MAX => 'DIRECTORY_STRIPE_LEVEL_MAX', + ]; + + 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/Parallelstore/src/V1/ExportDataMetadata.php b/Parallelstore/src/V1/ExportDataMetadata.php new file mode 100644 index 000000000000..946a522a2a00 --- /dev/null +++ b/Parallelstore/src/V1/ExportDataMetadata.php @@ -0,0 +1,351 @@ +google.cloud.parallelstore.v1.ExportDataMetadata + */ +class ExportDataMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Data transfer operation metadata. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.TransferOperationMetadata operation_metadata = 1; + */ + protected $operation_metadata = null; + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $target = ''; + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $verb = ''; + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status_message = ''; + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $requested_cancellation = false; + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $api_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Parallelstore\V1\TransferOperationMetadata $operation_metadata + * Data transfer operation metadata. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the operation was created. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the operation finished running. + * @type string $target + * Output only. Server-defined resource path for the target of the operation. + * @type string $verb + * Output only. Name of the verb executed by the operation. + * @type string $status_message + * Output only. Human-readable status of the operation, if any. + * @type bool $requested_cancellation + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * @type string $api_version + * Output only. API version used to start the operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Data transfer operation metadata. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.TransferOperationMetadata operation_metadata = 1; + * @return \Google\Cloud\Parallelstore\V1\TransferOperationMetadata|null + */ + public function getOperationMetadata() + { + return $this->operation_metadata; + } + + public function hasOperationMetadata() + { + return isset($this->operation_metadata); + } + + public function clearOperationMetadata() + { + unset($this->operation_metadata); + } + + /** + * Data transfer operation metadata. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.TransferOperationMetadata operation_metadata = 1; + * @param \Google\Cloud\Parallelstore\V1\TransferOperationMetadata $var + * @return $this + */ + public function setOperationMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1\TransferOperationMetadata::class); + $this->operation_metadata = $var; + + return $this; + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTarget() + { + return $this->target; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getVerb() + { + return $this->verb; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setVerb($var) + { + GPBUtil::checkString($var, True); + $this->verb = $var; + + return $this; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getStatusMessage() + { + return $this->status_message; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setStatusMessage($var) + { + GPBUtil::checkString($var, True); + $this->status_message = $var; + + return $this; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getRequestedCancellation() + { + return $this->requested_cancellation; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setRequestedCancellation($var) + { + GPBUtil::checkBool($var); + $this->requested_cancellation = $var; + + return $this; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getApiVersion() + { + return $this->api_version; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setApiVersion($var) + { + GPBUtil::checkString($var, True); + $this->api_version = $var; + + return $this; + } + +} + diff --git a/Parallelstore/src/V1/ExportDataRequest.php b/Parallelstore/src/V1/ExportDataRequest.php new file mode 100644 index 000000000000..25a1ed7d4d1e --- /dev/null +++ b/Parallelstore/src/V1/ExportDataRequest.php @@ -0,0 +1,287 @@ +google.cloud.parallelstore.v1.ExportDataRequest + */ +class ExportDataRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + /** + * Optional. User-specified Service Account (SA) credentials to be used when + * performing the transfer. + * Use one of the following formats: + * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * If unspecified, the Parallelstore service agent is used: + * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` + * + * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $service_account = ''; + protected $source; + protected $destination; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Parallelstore\V1\SourceParallelstore $source_parallelstore + * Parallelstore source. + * @type \Google\Cloud\Parallelstore\V1\DestinationGcsBucket $destination_gcs_bucket + * Cloud Storage destination. + * @type string $name + * Required. Name of the resource. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type string $service_account + * Optional. User-specified Service Account (SA) credentials to be used when + * performing the transfer. + * Use one of the following formats: + * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * If unspecified, the Parallelstore service agent is used: + * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Parallelstore source. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.SourceParallelstore source_parallelstore = 2; + * @return \Google\Cloud\Parallelstore\V1\SourceParallelstore|null + */ + public function getSourceParallelstore() + { + return $this->readOneof(2); + } + + public function hasSourceParallelstore() + { + return $this->hasOneof(2); + } + + /** + * Parallelstore source. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.SourceParallelstore source_parallelstore = 2; + * @param \Google\Cloud\Parallelstore\V1\SourceParallelstore $var + * @return $this + */ + public function setSourceParallelstore($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1\SourceParallelstore::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Cloud Storage destination. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.DestinationGcsBucket destination_gcs_bucket = 3; + * @return \Google\Cloud\Parallelstore\V1\DestinationGcsBucket|null + */ + public function getDestinationGcsBucket() + { + return $this->readOneof(3); + } + + public function hasDestinationGcsBucket() + { + return $this->hasOneof(3); + } + + /** + * Cloud Storage destination. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.DestinationGcsBucket destination_gcs_bucket = 3; + * @param \Google\Cloud\Parallelstore\V1\DestinationGcsBucket $var + * @return $this + */ + public function setDestinationGcsBucket($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1\DestinationGcsBucket::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. User-specified Service Account (SA) credentials to be used when + * performing the transfer. + * Use one of the following formats: + * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * If unspecified, the Parallelstore service agent is used: + * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` + * + * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getServiceAccount() + { + return $this->service_account; + } + + /** + * Optional. User-specified Service Account (SA) credentials to be used when + * performing the transfer. + * Use one of the following formats: + * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * If unspecified, the Parallelstore service agent is used: + * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` + * + * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setServiceAccount($var) + { + GPBUtil::checkString($var, True); + $this->service_account = $var; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + + /** + * @return string + */ + public function getDestination() + { + return $this->whichOneof("destination"); + } + +} + diff --git a/Parallelstore/src/V1/ExportDataResponse.php b/Parallelstore/src/V1/ExportDataResponse.php new file mode 100644 index 000000000000..7a2a7ca3f977 --- /dev/null +++ b/Parallelstore/src/V1/ExportDataResponse.php @@ -0,0 +1,33 @@ +google.cloud.parallelstore.v1.ExportDataResponse + */ +class ExportDataResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); + parent::__construct($data); + } + +} + diff --git a/Parallelstore/src/V1/FileStripeLevel.php b/Parallelstore/src/V1/FileStripeLevel.php new file mode 100644 index 000000000000..7f349e1ef995 --- /dev/null +++ b/Parallelstore/src/V1/FileStripeLevel.php @@ -0,0 +1,68 @@ +google.cloud.parallelstore.v1.FileStripeLevel + */ +class FileStripeLevel +{ + /** + * If not set, FileStripeLevel will default to FILE_STRIPE_LEVEL_BALANCED + * + * Generated from protobuf enum FILE_STRIPE_LEVEL_UNSPECIFIED = 0; + */ + const FILE_STRIPE_LEVEL_UNSPECIFIED = 0; + /** + * Minimum file striping + * + * Generated from protobuf enum FILE_STRIPE_LEVEL_MIN = 1; + */ + const FILE_STRIPE_LEVEL_MIN = 1; + /** + * Medium file striping + * + * Generated from protobuf enum FILE_STRIPE_LEVEL_BALANCED = 2; + */ + const FILE_STRIPE_LEVEL_BALANCED = 2; + /** + * Maximum file striping + * + * Generated from protobuf enum FILE_STRIPE_LEVEL_MAX = 3; + */ + const FILE_STRIPE_LEVEL_MAX = 3; + + private static $valueToName = [ + self::FILE_STRIPE_LEVEL_UNSPECIFIED => 'FILE_STRIPE_LEVEL_UNSPECIFIED', + self::FILE_STRIPE_LEVEL_MIN => 'FILE_STRIPE_LEVEL_MIN', + self::FILE_STRIPE_LEVEL_BALANCED => 'FILE_STRIPE_LEVEL_BALANCED', + self::FILE_STRIPE_LEVEL_MAX => 'FILE_STRIPE_LEVEL_MAX', + ]; + + 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/Parallelstore/src/V1/GetInstanceRequest.php b/Parallelstore/src/V1/GetInstanceRequest.php new file mode 100644 index 000000000000..1faa91f63398 --- /dev/null +++ b/Parallelstore/src/V1/GetInstanceRequest.php @@ -0,0 +1,86 @@ +google.cloud.parallelstore.v1.GetInstanceRequest + */ +class GetInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The instance resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The instance resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}`. Please see + * {@see ParallelstoreClient::instanceName()} for help formatting this field. + * + * @return \Google\Cloud\Parallelstore\V1\GetInstanceRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The instance resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Required. The instance resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The instance resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/Parallelstore/src/V1/ImportDataMetadata.php b/Parallelstore/src/V1/ImportDataMetadata.php new file mode 100644 index 000000000000..e64fbf40267f --- /dev/null +++ b/Parallelstore/src/V1/ImportDataMetadata.php @@ -0,0 +1,351 @@ +google.cloud.parallelstore.v1.ImportDataMetadata + */ +class ImportDataMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Data transfer operation metadata. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.TransferOperationMetadata operation_metadata = 1; + */ + protected $operation_metadata = null; + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $target = ''; + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $verb = ''; + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status_message = ''; + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $requested_cancellation = false; + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $api_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Parallelstore\V1\TransferOperationMetadata $operation_metadata + * Data transfer operation metadata. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the operation was created. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the operation finished running. + * @type string $target + * Output only. Server-defined resource path for the target of the operation. + * @type string $verb + * Output only. Name of the verb executed by the operation. + * @type string $status_message + * Output only. Human-readable status of the operation, if any. + * @type bool $requested_cancellation + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * @type string $api_version + * Output only. API version used to start the operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Data transfer operation metadata. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.TransferOperationMetadata operation_metadata = 1; + * @return \Google\Cloud\Parallelstore\V1\TransferOperationMetadata|null + */ + public function getOperationMetadata() + { + return $this->operation_metadata; + } + + public function hasOperationMetadata() + { + return isset($this->operation_metadata); + } + + public function clearOperationMetadata() + { + unset($this->operation_metadata); + } + + /** + * Data transfer operation metadata. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.TransferOperationMetadata operation_metadata = 1; + * @param \Google\Cloud\Parallelstore\V1\TransferOperationMetadata $var + * @return $this + */ + public function setOperationMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1\TransferOperationMetadata::class); + $this->operation_metadata = $var; + + return $this; + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTarget() + { + return $this->target; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getVerb() + { + return $this->verb; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setVerb($var) + { + GPBUtil::checkString($var, True); + $this->verb = $var; + + return $this; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getStatusMessage() + { + return $this->status_message; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setStatusMessage($var) + { + GPBUtil::checkString($var, True); + $this->status_message = $var; + + return $this; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getRequestedCancellation() + { + return $this->requested_cancellation; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setRequestedCancellation($var) + { + GPBUtil::checkBool($var); + $this->requested_cancellation = $var; + + return $this; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getApiVersion() + { + return $this->api_version; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setApiVersion($var) + { + GPBUtil::checkString($var, True); + $this->api_version = $var; + + return $this; + } + +} + diff --git a/Parallelstore/src/V1/ImportDataRequest.php b/Parallelstore/src/V1/ImportDataRequest.php new file mode 100644 index 000000000000..e9822439ab58 --- /dev/null +++ b/Parallelstore/src/V1/ImportDataRequest.php @@ -0,0 +1,287 @@ +google.cloud.parallelstore.v1.ImportDataRequest + */ +class ImportDataRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + /** + * Optional. User-specified service account credentials to be used when + * performing the transfer. + * Use one of the following formats: + * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * If unspecified, the Parallelstore service agent is used: + * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` + * + * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $service_account = ''; + protected $source; + protected $destination; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Parallelstore\V1\SourceGcsBucket $source_gcs_bucket + * The Cloud Storage source bucket and, optionally, path inside the bucket. + * @type \Google\Cloud\Parallelstore\V1\DestinationParallelstore $destination_parallelstore + * Parallelstore destination. + * @type string $name + * Required. Name of the resource. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type string $service_account + * Optional. User-specified service account credentials to be used when + * performing the transfer. + * Use one of the following formats: + * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * If unspecified, the Parallelstore service agent is used: + * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * The Cloud Storage source bucket and, optionally, path inside the bucket. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.SourceGcsBucket source_gcs_bucket = 2; + * @return \Google\Cloud\Parallelstore\V1\SourceGcsBucket|null + */ + public function getSourceGcsBucket() + { + return $this->readOneof(2); + } + + public function hasSourceGcsBucket() + { + return $this->hasOneof(2); + } + + /** + * The Cloud Storage source bucket and, optionally, path inside the bucket. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.SourceGcsBucket source_gcs_bucket = 2; + * @param \Google\Cloud\Parallelstore\V1\SourceGcsBucket $var + * @return $this + */ + public function setSourceGcsBucket($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1\SourceGcsBucket::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Parallelstore destination. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.DestinationParallelstore destination_parallelstore = 3; + * @return \Google\Cloud\Parallelstore\V1\DestinationParallelstore|null + */ + public function getDestinationParallelstore() + { + return $this->readOneof(3); + } + + public function hasDestinationParallelstore() + { + return $this->hasOneof(3); + } + + /** + * Parallelstore destination. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.DestinationParallelstore destination_parallelstore = 3; + * @param \Google\Cloud\Parallelstore\V1\DestinationParallelstore $var + * @return $this + */ + public function setDestinationParallelstore($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1\DestinationParallelstore::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the resource. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. User-specified service account credentials to be used when + * performing the transfer. + * Use one of the following formats: + * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * If unspecified, the Parallelstore service agent is used: + * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` + * + * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getServiceAccount() + { + return $this->service_account; + } + + /** + * Optional. User-specified service account credentials to be used when + * performing the transfer. + * Use one of the following formats: + * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * If unspecified, the Parallelstore service agent is used: + * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` + * + * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setServiceAccount($var) + { + GPBUtil::checkString($var, True); + $this->service_account = $var; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + + /** + * @return string + */ + public function getDestination() + { + return $this->whichOneof("destination"); + } + +} + diff --git a/Parallelstore/src/V1/ImportDataResponse.php b/Parallelstore/src/V1/ImportDataResponse.php new file mode 100644 index 000000000000..49d0ebaf5aee --- /dev/null +++ b/Parallelstore/src/V1/ImportDataResponse.php @@ -0,0 +1,33 @@ +google.cloud.parallelstore.v1.ImportDataResponse + */ +class ImportDataResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); + parent::__construct($data); + } + +} + diff --git a/Parallelstore/src/V1/Instance.php b/Parallelstore/src/V1/Instance.php new file mode 100644 index 000000000000..af2dc82ba626 --- /dev/null +++ b/Parallelstore/src/V1/Instance.php @@ -0,0 +1,625 @@ +google.cloud.parallelstore.v1.Instance + */ +class Instance extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The resource name of the instance, in the format + * `projects/{project}/locations/{location}/instances/{instance_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Optional. The description of the instance. 2048 characters or less. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Output only. The instance state. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.Instance.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. The time when the instance was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time when the instance was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Optional. Cloud Labels are a flexible and lightweight mechanism for + * organizing cloud resources into groups that reflect a customer's + * organizational needs and deployment strategies. See + * https://cloud.google.com/resource-manager/docs/labels-overview for details. + * + * Generated from protobuf field map labels = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Required. Immutable. The instance's storage capacity in Gibibytes (GiB). + * Allowed values are between 12000 and 100000, in multiples of 4000; e.g., + * 12000, 16000, 20000, ... + * + * Generated from protobuf field int64 capacity_gib = 8 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + */ + protected $capacity_gib = 0; + /** + * Output only. The version of DAOS software running in the instance. + * + * Generated from protobuf field string daos_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $daos_version = ''; + /** + * Output only. A list of IPv4 addresses used for client side configuration. + * + * Generated from protobuf field repeated string access_points = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $access_points; + /** + * Optional. Immutable. The name of the Compute Engine + * [VPC network](https://cloud.google.com/vpc/docs/vpc) to which the + * instance is connected. + * + * Generated from protobuf field string network = 11 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $network = ''; + /** + * Optional. Immutable. The ID of the IP address range being used by the + * instance's VPC network. See [Configure a VPC + * network](https://cloud.google.com/parallelstore/docs/vpc#create_and_configure_the_vpc). + * If no ID is provided, all ranges are considered. + * + * Generated from protobuf field string reserved_ip_range = 12 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $reserved_ip_range = ''; + /** + * Output only. Immutable. The ID of the IP address range being used by the + * instance's VPC network. This field is populated by the service and contains + * the value currently used by the service. + * + * Generated from protobuf field string effective_reserved_ip_range = 14 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $effective_reserved_ip_range = ''; + /** + * Optional. Stripe level for files. Allowed values are: + * * `FILE_STRIPE_LEVEL_MIN`: offers the best performance for small size + * files. + * * `FILE_STRIPE_LEVEL_BALANCED`: balances performance for workloads + * involving a mix of small and large files. + * * `FILE_STRIPE_LEVEL_MAX`: higher throughput performance for larger files. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.FileStripeLevel file_stripe_level = 15 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $file_stripe_level = 0; + /** + * Optional. Stripe level for directories. Allowed values are: + * * `DIRECTORY_STRIPE_LEVEL_MIN`: recommended when directories contain a + * small number of files. + * * `DIRECTORY_STRIPE_LEVEL_BALANCED`: balances performance for workloads + * involving a mix of small and large directories. + * * `DIRECTORY_STRIPE_LEVEL_MAX`: recommended for directories with a large + * number of files. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.DirectoryStripeLevel directory_stripe_level = 16 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $directory_stripe_level = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The resource name of the instance, in the format + * `projects/{project}/locations/{location}/instances/{instance_id}`. + * @type string $description + * Optional. The description of the instance. 2048 characters or less. + * @type int $state + * Output only. The instance state. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time when the instance was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The time when the instance was updated. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Cloud Labels are a flexible and lightweight mechanism for + * organizing cloud resources into groups that reflect a customer's + * organizational needs and deployment strategies. See + * https://cloud.google.com/resource-manager/docs/labels-overview for details. + * @type int|string $capacity_gib + * Required. Immutable. The instance's storage capacity in Gibibytes (GiB). + * Allowed values are between 12000 and 100000, in multiples of 4000; e.g., + * 12000, 16000, 20000, ... + * @type string $daos_version + * Output only. The version of DAOS software running in the instance. + * @type array|\Google\Protobuf\Internal\RepeatedField $access_points + * Output only. A list of IPv4 addresses used for client side configuration. + * @type string $network + * Optional. Immutable. The name of the Compute Engine + * [VPC network](https://cloud.google.com/vpc/docs/vpc) to which the + * instance is connected. + * @type string $reserved_ip_range + * Optional. Immutable. The ID of the IP address range being used by the + * instance's VPC network. See [Configure a VPC + * network](https://cloud.google.com/parallelstore/docs/vpc#create_and_configure_the_vpc). + * If no ID is provided, all ranges are considered. + * @type string $effective_reserved_ip_range + * Output only. Immutable. The ID of the IP address range being used by the + * instance's VPC network. This field is populated by the service and contains + * the value currently used by the service. + * @type int $file_stripe_level + * Optional. Stripe level for files. Allowed values are: + * * `FILE_STRIPE_LEVEL_MIN`: offers the best performance for small size + * files. + * * `FILE_STRIPE_LEVEL_BALANCED`: balances performance for workloads + * involving a mix of small and large files. + * * `FILE_STRIPE_LEVEL_MAX`: higher throughput performance for larger files. + * @type int $directory_stripe_level + * Optional. Stripe level for directories. Allowed values are: + * * `DIRECTORY_STRIPE_LEVEL_MIN`: recommended when directories contain a + * small number of files. + * * `DIRECTORY_STRIPE_LEVEL_BALANCED`: balances performance for workloads + * involving a mix of small and large directories. + * * `DIRECTORY_STRIPE_LEVEL_MAX`: recommended for directories with a large + * number of files. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The resource name of the instance, in the format + * `projects/{project}/locations/{location}/instances/{instance_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The resource name of the instance, in the format + * `projects/{project}/locations/{location}/instances/{instance_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The description of the instance. 2048 characters or less. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. The description of the instance. 2048 characters or less. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. The instance state. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.Instance.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The instance state. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.Instance.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Parallelstore\V1\Instance\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. The time when the instance was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time when the instance was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time when the instance was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The time when the instance was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Optional. Cloud Labels are a flexible and lightweight mechanism for + * organizing cloud resources into groups that reflect a customer's + * organizational needs and deployment strategies. See + * https://cloud.google.com/resource-manager/docs/labels-overview for details. + * + * Generated from protobuf field map labels = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Cloud Labels are a flexible and lightweight mechanism for + * organizing cloud resources into groups that reflect a customer's + * organizational needs and deployment strategies. See + * https://cloud.google.com/resource-manager/docs/labels-overview for details. + * + * Generated from protobuf field map labels = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Required. Immutable. The instance's storage capacity in Gibibytes (GiB). + * Allowed values are between 12000 and 100000, in multiples of 4000; e.g., + * 12000, 16000, 20000, ... + * + * Generated from protobuf field int64 capacity_gib = 8 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * @return int|string + */ + public function getCapacityGib() + { + return $this->capacity_gib; + } + + /** + * Required. Immutable. The instance's storage capacity in Gibibytes (GiB). + * Allowed values are between 12000 and 100000, in multiples of 4000; e.g., + * 12000, 16000, 20000, ... + * + * Generated from protobuf field int64 capacity_gib = 8 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * @param int|string $var + * @return $this + */ + public function setCapacityGib($var) + { + GPBUtil::checkInt64($var); + $this->capacity_gib = $var; + + return $this; + } + + /** + * Output only. The version of DAOS software running in the instance. + * + * Generated from protobuf field string daos_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDaosVersion() + { + return $this->daos_version; + } + + /** + * Output only. The version of DAOS software running in the instance. + * + * Generated from protobuf field string daos_version = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDaosVersion($var) + { + GPBUtil::checkString($var, True); + $this->daos_version = $var; + + return $this; + } + + /** + * Output only. A list of IPv4 addresses used for client side configuration. + * + * Generated from protobuf field repeated string access_points = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAccessPoints() + { + return $this->access_points; + } + + /** + * Output only. A list of IPv4 addresses used for client side configuration. + * + * Generated from protobuf field repeated string access_points = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAccessPoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->access_points = $arr; + + return $this; + } + + /** + * Optional. Immutable. The name of the Compute Engine + * [VPC network](https://cloud.google.com/vpc/docs/vpc) to which the + * instance is connected. + * + * Generated from protobuf field string network = 11 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getNetwork() + { + return $this->network; + } + + /** + * Optional. Immutable. The name of the Compute Engine + * [VPC network](https://cloud.google.com/vpc/docs/vpc) to which the + * instance is connected. + * + * Generated from protobuf field string network = 11 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * Optional. Immutable. The ID of the IP address range being used by the + * instance's VPC network. See [Configure a VPC + * network](https://cloud.google.com/parallelstore/docs/vpc#create_and_configure_the_vpc). + * If no ID is provided, all ranges are considered. + * + * Generated from protobuf field string reserved_ip_range = 12 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getReservedIpRange() + { + return $this->reserved_ip_range; + } + + /** + * Optional. Immutable. The ID of the IP address range being used by the + * instance's VPC network. See [Configure a VPC + * network](https://cloud.google.com/parallelstore/docs/vpc#create_and_configure_the_vpc). + * If no ID is provided, all ranges are considered. + * + * Generated from protobuf field string reserved_ip_range = 12 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setReservedIpRange($var) + { + GPBUtil::checkString($var, True); + $this->reserved_ip_range = $var; + + return $this; + } + + /** + * Output only. Immutable. The ID of the IP address range being used by the + * instance's VPC network. This field is populated by the service and contains + * the value currently used by the service. + * + * Generated from protobuf field string effective_reserved_ip_range = 14 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getEffectiveReservedIpRange() + { + return $this->effective_reserved_ip_range; + } + + /** + * Output only. Immutable. The ID of the IP address range being used by the + * instance's VPC network. This field is populated by the service and contains + * the value currently used by the service. + * + * Generated from protobuf field string effective_reserved_ip_range = 14 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setEffectiveReservedIpRange($var) + { + GPBUtil::checkString($var, True); + $this->effective_reserved_ip_range = $var; + + return $this; + } + + /** + * Optional. Stripe level for files. Allowed values are: + * * `FILE_STRIPE_LEVEL_MIN`: offers the best performance for small size + * files. + * * `FILE_STRIPE_LEVEL_BALANCED`: balances performance for workloads + * involving a mix of small and large files. + * * `FILE_STRIPE_LEVEL_MAX`: higher throughput performance for larger files. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.FileStripeLevel file_stripe_level = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getFileStripeLevel() + { + return $this->file_stripe_level; + } + + /** + * Optional. Stripe level for files. Allowed values are: + * * `FILE_STRIPE_LEVEL_MIN`: offers the best performance for small size + * files. + * * `FILE_STRIPE_LEVEL_BALANCED`: balances performance for workloads + * involving a mix of small and large files. + * * `FILE_STRIPE_LEVEL_MAX`: higher throughput performance for larger files. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.FileStripeLevel file_stripe_level = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setFileStripeLevel($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Parallelstore\V1\FileStripeLevel::class); + $this->file_stripe_level = $var; + + return $this; + } + + /** + * Optional. Stripe level for directories. Allowed values are: + * * `DIRECTORY_STRIPE_LEVEL_MIN`: recommended when directories contain a + * small number of files. + * * `DIRECTORY_STRIPE_LEVEL_BALANCED`: balances performance for workloads + * involving a mix of small and large directories. + * * `DIRECTORY_STRIPE_LEVEL_MAX`: recommended for directories with a large + * number of files. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.DirectoryStripeLevel directory_stripe_level = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getDirectoryStripeLevel() + { + return $this->directory_stripe_level; + } + + /** + * Optional. Stripe level for directories. Allowed values are: + * * `DIRECTORY_STRIPE_LEVEL_MIN`: recommended when directories contain a + * small number of files. + * * `DIRECTORY_STRIPE_LEVEL_BALANCED`: balances performance for workloads + * involving a mix of small and large directories. + * * `DIRECTORY_STRIPE_LEVEL_MAX`: recommended for directories with a large + * number of files. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.DirectoryStripeLevel directory_stripe_level = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setDirectoryStripeLevel($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Parallelstore\V1\DirectoryStripeLevel::class); + $this->directory_stripe_level = $var; + + return $this; + } + +} + diff --git a/Parallelstore/src/V1/Instance/State.php b/Parallelstore/src/V1/Instance/State.php new file mode 100644 index 000000000000..d0f8642ed08d --- /dev/null +++ b/Parallelstore/src/V1/Instance/State.php @@ -0,0 +1,83 @@ +google.cloud.parallelstore.v1.Instance.State + */ +class State +{ + /** + * Not set. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The instance is being created. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * The instance is available for use. + * + * Generated from protobuf enum ACTIVE = 2; + */ + const ACTIVE = 2; + /** + * The instance is being deleted. + * + * Generated from protobuf enum DELETING = 3; + */ + const DELETING = 3; + /** + * The instance is not usable. + * + * Generated from protobuf enum FAILED = 4; + */ + const FAILED = 4; + /** + * The instance is being upgraded. + * + * Generated from protobuf enum UPGRADING = 5; + */ + const UPGRADING = 5; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::ACTIVE => 'ACTIVE', + self::DELETING => 'DELETING', + self::FAILED => 'FAILED', + self::UPGRADING => 'UPGRADING', + ]; + + 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/Parallelstore/src/V1/ListInstancesRequest.php b/Parallelstore/src/V1/ListInstancesRequest.php new file mode 100644 index 000000000000..0a02c88d3081 --- /dev/null +++ b/Parallelstore/src/V1/ListInstancesRequest.php @@ -0,0 +1,237 @@ +google.cloud.parallelstore.v1.ListInstancesRequest + */ +class ListInstancesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location for which to retrieve instance + * information, in the format `projects/{project_id}/locations/{location}`. + * To retrieve instance information for all locations, use "-" as the value of + * `{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, the server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. The project and location for which to retrieve instance + * information, in the format `projects/{project_id}/locations/{location}`. + * + * To retrieve instance information for all locations, use "-" as the value of + * `{location}`. Please see + * {@see ParallelstoreClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\Parallelstore\V1\ListInstancesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location for which to retrieve instance + * information, in the format `projects/{project_id}/locations/{location}`. + * To retrieve instance information for all locations, use "-" as the value of + * `{location}`. + * @type int $page_size + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, the server will pick an appropriate default. + * @type string $page_token + * Optional. A token identifying a page of results the server should return. + * @type string $filter + * Optional. Filtering results. + * @type string $order_by + * Optional. Hint for how to order the results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location for which to retrieve instance + * information, in the format `projects/{project_id}/locations/{location}`. + * To retrieve instance information for all locations, use "-" as the value of + * `{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location for which to retrieve instance + * information, in the format `projects/{project_id}/locations/{location}`. + * To retrieve instance information for all locations, use "-" as the value of + * `{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, the server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, the server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/Parallelstore/src/V1/ListInstancesResponse.php b/Parallelstore/src/V1/ListInstancesResponse.php new file mode 100644 index 000000000000..c8b9fd39f5d9 --- /dev/null +++ b/Parallelstore/src/V1/ListInstancesResponse.php @@ -0,0 +1,136 @@ +google.cloud.parallelstore.v1.ListInstancesResponse + */ +class ListInstancesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of Parallelstore instances. + * + * Generated from protobuf field repeated .google.cloud.parallelstore.v1.Instance instances = 1; + */ + private $instances; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Parallelstore\V1\Instance>|\Google\Protobuf\Internal\RepeatedField $instances + * The list of Parallelstore instances. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * The list of Parallelstore instances. + * + * Generated from protobuf field repeated .google.cloud.parallelstore.v1.Instance instances = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstances() + { + return $this->instances; + } + + /** + * The list of Parallelstore instances. + * + * Generated from protobuf field repeated .google.cloud.parallelstore.v1.Instance instances = 1; + * @param array<\Google\Cloud\Parallelstore\V1\Instance>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Parallelstore\V1\Instance::class); + $this->instances = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/Parallelstore/src/V1/OperationMetadata.php b/Parallelstore/src/V1/OperationMetadata.php new file mode 100644 index 000000000000..98a34bef6798 --- /dev/null +++ b/Parallelstore/src/V1/OperationMetadata.php @@ -0,0 +1,307 @@ +google.cloud.parallelstore.v1.OperationMetadata + */ +class OperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $target = ''; + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $verb = ''; + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status_message = ''; + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have been cancelled successfully + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $requested_cancellation = false; + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $api_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the operation was created. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the operation finished running. + * @type string $target + * Output only. Server-defined resource path for the target of the operation. + * @type string $verb + * Output only. Name of the verb executed by the operation. + * @type string $status_message + * Output only. Human-readable status of the operation, if any. + * @type bool $requested_cancellation + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have been cancelled successfully + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * @type string $api_version + * Output only. API version used to start the operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTarget() + { + return $this->target; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getVerb() + { + return $this->verb; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setVerb($var) + { + GPBUtil::checkString($var, True); + $this->verb = $var; + + return $this; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getStatusMessage() + { + return $this->status_message; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setStatusMessage($var) + { + GPBUtil::checkString($var, True); + $this->status_message = $var; + + return $this; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have been cancelled successfully + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getRequestedCancellation() + { + return $this->requested_cancellation; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have been cancelled successfully + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setRequestedCancellation($var) + { + GPBUtil::checkBool($var); + $this->requested_cancellation = $var; + + return $this; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getApiVersion() + { + return $this->api_version; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setApiVersion($var) + { + GPBUtil::checkString($var, True); + $this->api_version = $var; + + return $this; + } + +} + diff --git a/Parallelstore/src/V1/SourceGcsBucket.php b/Parallelstore/src/V1/SourceGcsBucket.php new file mode 100644 index 000000000000..6b042397ff31 --- /dev/null +++ b/Parallelstore/src/V1/SourceGcsBucket.php @@ -0,0 +1,75 @@ +google.cloud.parallelstore.v1.SourceGcsBucket + */ +class SourceGcsBucket extends \Google\Protobuf\Internal\Message +{ + /** + * Required. URI to a Cloud Storage bucket in the format: + * `gs:///`. The path inside the bucket is + * optional. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * Required. URI to a Cloud Storage bucket in the format: + * `gs:///`. The path inside the bucket is + * optional. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Required. URI to a Cloud Storage bucket in the format: + * `gs:///`. The path inside the bucket is + * optional. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * Required. URI to a Cloud Storage bucket in the format: + * `gs:///`. The path inside the bucket is + * optional. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + +} + diff --git a/Parallelstore/src/V1/SourceParallelstore.php b/Parallelstore/src/V1/SourceParallelstore.php new file mode 100644 index 000000000000..63a37aaeebf2 --- /dev/null +++ b/Parallelstore/src/V1/SourceParallelstore.php @@ -0,0 +1,71 @@ +google.cloud.parallelstore.v1.SourceParallelstore + */ +class SourceParallelstore extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Root directory path to the Paralellstore filesystem, starting + * with `/`. Defaults to `/` if unset. + * + * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $path = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $path + * Optional. Root directory path to the Paralellstore filesystem, starting + * with `/`. Defaults to `/` if unset. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Root directory path to the Paralellstore filesystem, starting + * with `/`. Defaults to `/` if unset. + * + * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPath() + { + return $this->path; + } + + /** + * Optional. Root directory path to the Paralellstore filesystem, starting + * with `/`. Defaults to `/` if unset. + * + * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPath($var) + { + GPBUtil::checkString($var, True); + $this->path = $var; + + return $this; + } + +} + diff --git a/Parallelstore/src/V1/TransferCounters.php b/Parallelstore/src/V1/TransferCounters.php new file mode 100644 index 000000000000..9b4b96f6fd44 --- /dev/null +++ b/Parallelstore/src/V1/TransferCounters.php @@ -0,0 +1,261 @@ +google.cloud.parallelstore.v1.TransferCounters + */ +class TransferCounters extends \Google\Protobuf\Internal\Message +{ + /** + * Objects found in the data source that are scheduled to be transferred, + * excluding any that are filtered based on object conditions or skipped due + * to sync. + * + * Generated from protobuf field int64 objects_found = 1; + */ + protected $objects_found = 0; + /** + * Bytes found in the data source that are scheduled to be transferred, + * excluding any that are filtered based on object conditions or skipped due + * to sync. + * + * Generated from protobuf field int64 bytes_found = 2; + */ + protected $bytes_found = 0; + /** + * Objects in the data source that are not transferred because they already + * exist in the data destination. + * + * Generated from protobuf field int64 objects_skipped = 3; + */ + protected $objects_skipped = 0; + /** + * Bytes in the data source that are not transferred because they already + * exist in the data destination. + * + * Generated from protobuf field int64 bytes_skipped = 4; + */ + protected $bytes_skipped = 0; + /** + * Objects that are copied to the data destination. + * + * Generated from protobuf field int64 objects_copied = 5; + */ + protected $objects_copied = 0; + /** + * Bytes that are copied to the data destination. + * + * Generated from protobuf field int64 bytes_copied = 6; + */ + protected $bytes_copied = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $objects_found + * Objects found in the data source that are scheduled to be transferred, + * excluding any that are filtered based on object conditions or skipped due + * to sync. + * @type int|string $bytes_found + * Bytes found in the data source that are scheduled to be transferred, + * excluding any that are filtered based on object conditions or skipped due + * to sync. + * @type int|string $objects_skipped + * Objects in the data source that are not transferred because they already + * exist in the data destination. + * @type int|string $bytes_skipped + * Bytes in the data source that are not transferred because they already + * exist in the data destination. + * @type int|string $objects_copied + * Objects that are copied to the data destination. + * @type int|string $bytes_copied + * Bytes that are copied to the data destination. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Objects found in the data source that are scheduled to be transferred, + * excluding any that are filtered based on object conditions or skipped due + * to sync. + * + * Generated from protobuf field int64 objects_found = 1; + * @return int|string + */ + public function getObjectsFound() + { + return $this->objects_found; + } + + /** + * Objects found in the data source that are scheduled to be transferred, + * excluding any that are filtered based on object conditions or skipped due + * to sync. + * + * Generated from protobuf field int64 objects_found = 1; + * @param int|string $var + * @return $this + */ + public function setObjectsFound($var) + { + GPBUtil::checkInt64($var); + $this->objects_found = $var; + + return $this; + } + + /** + * Bytes found in the data source that are scheduled to be transferred, + * excluding any that are filtered based on object conditions or skipped due + * to sync. + * + * Generated from protobuf field int64 bytes_found = 2; + * @return int|string + */ + public function getBytesFound() + { + return $this->bytes_found; + } + + /** + * Bytes found in the data source that are scheduled to be transferred, + * excluding any that are filtered based on object conditions or skipped due + * to sync. + * + * Generated from protobuf field int64 bytes_found = 2; + * @param int|string $var + * @return $this + */ + public function setBytesFound($var) + { + GPBUtil::checkInt64($var); + $this->bytes_found = $var; + + return $this; + } + + /** + * Objects in the data source that are not transferred because they already + * exist in the data destination. + * + * Generated from protobuf field int64 objects_skipped = 3; + * @return int|string + */ + public function getObjectsSkipped() + { + return $this->objects_skipped; + } + + /** + * Objects in the data source that are not transferred because they already + * exist in the data destination. + * + * Generated from protobuf field int64 objects_skipped = 3; + * @param int|string $var + * @return $this + */ + public function setObjectsSkipped($var) + { + GPBUtil::checkInt64($var); + $this->objects_skipped = $var; + + return $this; + } + + /** + * Bytes in the data source that are not transferred because they already + * exist in the data destination. + * + * Generated from protobuf field int64 bytes_skipped = 4; + * @return int|string + */ + public function getBytesSkipped() + { + return $this->bytes_skipped; + } + + /** + * Bytes in the data source that are not transferred because they already + * exist in the data destination. + * + * Generated from protobuf field int64 bytes_skipped = 4; + * @param int|string $var + * @return $this + */ + public function setBytesSkipped($var) + { + GPBUtil::checkInt64($var); + $this->bytes_skipped = $var; + + return $this; + } + + /** + * Objects that are copied to the data destination. + * + * Generated from protobuf field int64 objects_copied = 5; + * @return int|string + */ + public function getObjectsCopied() + { + return $this->objects_copied; + } + + /** + * Objects that are copied to the data destination. + * + * Generated from protobuf field int64 objects_copied = 5; + * @param int|string $var + * @return $this + */ + public function setObjectsCopied($var) + { + GPBUtil::checkInt64($var); + $this->objects_copied = $var; + + return $this; + } + + /** + * Bytes that are copied to the data destination. + * + * Generated from protobuf field int64 bytes_copied = 6; + * @return int|string + */ + public function getBytesCopied() + { + return $this->bytes_copied; + } + + /** + * Bytes that are copied to the data destination. + * + * Generated from protobuf field int64 bytes_copied = 6; + * @param int|string $var + * @return $this + */ + public function setBytesCopied($var) + { + GPBUtil::checkInt64($var); + $this->bytes_copied = $var; + + return $this; + } + +} + diff --git a/Parallelstore/src/V1/TransferOperationMetadata.php b/Parallelstore/src/V1/TransferOperationMetadata.php new file mode 100644 index 000000000000..0cdbf05167ac --- /dev/null +++ b/Parallelstore/src/V1/TransferOperationMetadata.php @@ -0,0 +1,261 @@ +google.cloud.parallelstore.v1.TransferOperationMetadata + */ +class TransferOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The progress of the transfer operation. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.TransferCounters counters = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $counters = null; + /** + * Output only. The type of transfer occurring. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.TransferType transfer_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $transfer_type = 0; + protected $source; + protected $destination; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Parallelstore\V1\SourceParallelstore $source_parallelstore + * Output only. Parallelstore source. + * @type \Google\Cloud\Parallelstore\V1\SourceGcsBucket $source_gcs_bucket + * Output only. Cloud Storage source. + * @type \Google\Cloud\Parallelstore\V1\DestinationGcsBucket $destination_gcs_bucket + * Output only. Cloud Storage destination. + * @type \Google\Cloud\Parallelstore\V1\DestinationParallelstore $destination_parallelstore + * Output only. Parallelstore destination. + * @type \Google\Cloud\Parallelstore\V1\TransferCounters $counters + * Output only. The progress of the transfer operation. + * @type int $transfer_type + * Output only. The type of transfer occurring. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Parallelstore source. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.SourceParallelstore source_parallelstore = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Parallelstore\V1\SourceParallelstore|null + */ + public function getSourceParallelstore() + { + return $this->readOneof(7); + } + + public function hasSourceParallelstore() + { + return $this->hasOneof(7); + } + + /** + * Output only. Parallelstore source. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.SourceParallelstore source_parallelstore = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Parallelstore\V1\SourceParallelstore $var + * @return $this + */ + public function setSourceParallelstore($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1\SourceParallelstore::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * Output only. Cloud Storage source. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.SourceGcsBucket source_gcs_bucket = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Parallelstore\V1\SourceGcsBucket|null + */ + public function getSourceGcsBucket() + { + return $this->readOneof(8); + } + + public function hasSourceGcsBucket() + { + return $this->hasOneof(8); + } + + /** + * Output only. Cloud Storage source. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.SourceGcsBucket source_gcs_bucket = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Parallelstore\V1\SourceGcsBucket $var + * @return $this + */ + public function setSourceGcsBucket($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1\SourceGcsBucket::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * Output only. Cloud Storage destination. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.DestinationGcsBucket destination_gcs_bucket = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Parallelstore\V1\DestinationGcsBucket|null + */ + public function getDestinationGcsBucket() + { + return $this->readOneof(9); + } + + public function hasDestinationGcsBucket() + { + return $this->hasOneof(9); + } + + /** + * Output only. Cloud Storage destination. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.DestinationGcsBucket destination_gcs_bucket = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Parallelstore\V1\DestinationGcsBucket $var + * @return $this + */ + public function setDestinationGcsBucket($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1\DestinationGcsBucket::class); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * Output only. Parallelstore destination. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.DestinationParallelstore destination_parallelstore = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Parallelstore\V1\DestinationParallelstore|null + */ + public function getDestinationParallelstore() + { + return $this->readOneof(10); + } + + public function hasDestinationParallelstore() + { + return $this->hasOneof(10); + } + + /** + * Output only. Parallelstore destination. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.DestinationParallelstore destination_parallelstore = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Parallelstore\V1\DestinationParallelstore $var + * @return $this + */ + public function setDestinationParallelstore($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1\DestinationParallelstore::class); + $this->writeOneof(10, $var); + + return $this; + } + + /** + * Output only. The progress of the transfer operation. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.TransferCounters counters = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Parallelstore\V1\TransferCounters|null + */ + public function getCounters() + { + return $this->counters; + } + + public function hasCounters() + { + return isset($this->counters); + } + + public function clearCounters() + { + unset($this->counters); + } + + /** + * Output only. The progress of the transfer operation. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.TransferCounters counters = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Parallelstore\V1\TransferCounters $var + * @return $this + */ + public function setCounters($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1\TransferCounters::class); + $this->counters = $var; + + return $this; + } + + /** + * Output only. The type of transfer occurring. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.TransferType transfer_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getTransferType() + { + return $this->transfer_type; + } + + /** + * Output only. The type of transfer occurring. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.TransferType transfer_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setTransferType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Parallelstore\V1\TransferType::class); + $this->transfer_type = $var; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + + /** + * @return string + */ + public function getDestination() + { + return $this->whichOneof("destination"); + } + +} + diff --git a/Parallelstore/src/V1/TransferType.php b/Parallelstore/src/V1/TransferType.php new file mode 100644 index 000000000000..cecde2a1b640 --- /dev/null +++ b/Parallelstore/src/V1/TransferType.php @@ -0,0 +1,61 @@ +google.cloud.parallelstore.v1.TransferType + */ +class TransferType +{ + /** + * Zero is an illegal value. + * + * Generated from protobuf enum TRANSFER_TYPE_UNSPECIFIED = 0; + */ + const TRANSFER_TYPE_UNSPECIFIED = 0; + /** + * Imports to Parallelstore. + * + * Generated from protobuf enum IMPORT = 1; + */ + const IMPORT = 1; + /** + * Exports from Parallelstore. + * + * Generated from protobuf enum EXPORT = 2; + */ + const EXPORT = 2; + + private static $valueToName = [ + self::TRANSFER_TYPE_UNSPECIFIED => 'TRANSFER_TYPE_UNSPECIFIED', + self::IMPORT => 'IMPORT', + self::EXPORT => 'EXPORT', + ]; + + 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/Parallelstore/src/V1/UpdateInstanceRequest.php b/Parallelstore/src/V1/UpdateInstanceRequest.php new file mode 100644 index 000000000000..e2e23b6223a6 --- /dev/null +++ b/Parallelstore/src/V1/UpdateInstanceRequest.php @@ -0,0 +1,225 @@ +google.cloud.parallelstore.v1.UpdateInstanceRequest + */ +class UpdateInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Mask of fields to update. Field mask is used to specify the + * fields to be overwritten in the Instance resource by the update. At least + * one path must be supplied in this field. The fields specified in the + * update_mask are relative to the resource, not the full request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + /** + * Required. The instance to update. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param \Google\Cloud\Parallelstore\V1\Instance $instance Required. The instance to update. + * @param \Google\Protobuf\FieldMask $updateMask Required. Mask of fields to update. Field mask is used to specify the + * fields to be overwritten in the Instance resource by the update. At least + * one path must be supplied in this field. The fields specified in the + * update_mask are relative to the resource, not the full request. + * + * @return \Google\Cloud\Parallelstore\V1\UpdateInstanceRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Parallelstore\V1\Instance $instance, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setInstance($instance) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Required. Mask of fields to update. Field mask is used to specify the + * fields to be overwritten in the Instance resource by the update. At least + * one path must be supplied in this field. The fields specified in the + * update_mask are relative to the resource, not the full request. + * @type \Google\Cloud\Parallelstore\V1\Instance $instance + * Required. The instance to update. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Parallelstore\V1\Parallelstore::initOnce(); + parent::__construct($data); + } + + /** + * Required. Mask of fields to update. Field mask is used to specify the + * fields to be overwritten in the Instance resource by the update. At least + * one path must be supplied in this field. The fields specified in the + * update_mask are relative to the resource, not the full request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. Mask of fields to update. Field mask is used to specify the + * fields to be overwritten in the Instance resource by the update. At least + * one path must be supplied in this field. The fields specified in the + * update_mask are relative to the resource, not the full request. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. The instance to update. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Parallelstore\V1\Instance|null + */ + public function getInstance() + { + return $this->instance; + } + + public function hasInstance() + { + return isset($this->instance); + } + + public function clearInstance() + { + unset($this->instance); + } + + /** + * Required. The instance to update. + * + * Generated from protobuf field .google.cloud.parallelstore.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Parallelstore\V1\Instance $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Parallelstore\V1\Instance::class); + $this->instance = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/Parallelstore/src/V1/gapic_metadata.json b/Parallelstore/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..2eaf40bfd51c --- /dev/null +++ b/Parallelstore/src/V1/gapic_metadata.json @@ -0,0 +1,63 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.parallelstore.v1", + "libraryPackage": "Google\\Cloud\\Parallelstore\\V1", + "services": { + "Parallelstore": { + "clients": { + "grpc": { + "libraryClient": "ParallelstoreGapicClient", + "rpcs": { + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "ExportData": { + "methods": [ + "exportData" + ] + }, + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "ImportData": { + "methods": [ + "importData" + ] + }, + "ListInstances": { + "methods": [ + "listInstances" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/Parallelstore/src/V1/resources/parallelstore_client_config.json b/Parallelstore/src/V1/resources/parallelstore_client_config.json new file mode 100644 index 000000000000..bc0e63dce49b --- /dev/null +++ b/Parallelstore/src/V1/resources/parallelstore_client_config.json @@ -0,0 +1,67 @@ +{ + "interfaces": { + "google.cloud.parallelstore.v1.Parallelstore": { + "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": { + "CreateInstance": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "DeleteInstance": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ExportData": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetInstance": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ImportData": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListInstances": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateInstance": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/Parallelstore/src/V1/resources/parallelstore_descriptor_config.php b/Parallelstore/src/V1/resources/parallelstore_descriptor_config.php new file mode 100644 index 000000000000..8f886377a798 --- /dev/null +++ b/Parallelstore/src/V1/resources/parallelstore_descriptor_config.php @@ -0,0 +1,197 @@ + [ + 'google.cloud.parallelstore.v1.Parallelstore' => [ + 'CreateInstance' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Parallelstore\V1\Instance', + 'metadataReturnType' => '\Google\Cloud\Parallelstore\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteInstance' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\Parallelstore\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ExportData' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Parallelstore\V1\ExportDataResponse', + 'metadataReturnType' => '\Google\Cloud\Parallelstore\V1\ExportDataMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ImportData' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Parallelstore\V1\ImportDataResponse', + 'metadataReturnType' => '\Google\Cloud\Parallelstore\V1\ImportDataMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateInstance' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Parallelstore\V1\Instance', + 'metadataReturnType' => '\Google\Cloud\Parallelstore\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'instance.name', + 'fieldAccessors' => [ + 'getInstance', + 'getName', + ], + ], + ], + ], + 'GetInstance' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Parallelstore\V1\Instance', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListInstances' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getInstances', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Parallelstore\V1\ListInstancesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'address' => 'projects/{project}/regions/{region}/addresses/{address}', + 'instance' => 'projects/{project}/locations/{location}/instances/{instance}', + 'location' => 'projects/{project}/locations/{location}', + 'network' => 'projects/{project}/global/networks/{network}', + 'serviceAccount' => 'projects/{project}/serviceAccounts/{service_account}', + ], + ], + ], +]; diff --git a/Parallelstore/src/V1/resources/parallelstore_rest_client_config.php b/Parallelstore/src/V1/resources/parallelstore_rest_client_config.php new file mode 100644 index 000000000000..f7d9fb7afb54 --- /dev/null +++ b/Parallelstore/src/V1/resources/parallelstore_rest_client_config.php @@ -0,0 +1,188 @@ + [ + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.parallelstore.v1.Parallelstore' => [ + 'CreateInstance' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/instances', + 'body' => 'instance', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'instance_id', + ], + ], + 'DeleteInstance' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/instances/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ExportData' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/instances/*}:exportData', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetInstance' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/instances/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ImportData' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/instances/*}:importData', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListInstances' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/instances', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateInstance' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{instance.name=projects/*/locations/*/instances/*}', + 'body' => 'instance', + 'placeholders' => [ + 'instance.name' => [ + 'getters' => [ + 'getInstance', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/Parallelstore/tests/Unit/V1/Client/ParallelstoreClientTest.php b/Parallelstore/tests/Unit/V1/Client/ParallelstoreClientTest.php new file mode 100644 index 000000000000..0453788ed2cc --- /dev/null +++ b/Parallelstore/tests/Unit/V1/Client/ParallelstoreClientTest.php @@ -0,0 +1,1111 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return ParallelstoreClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ParallelstoreClient($options); + } + + /** @test */ + public function createInstanceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $capacityGib = 498394811; + $daosVersion = 'daosVersion-1809382982'; + $network = 'network1843485230'; + $reservedIpRange = 'reservedIpRange-1082940580'; + $effectiveReservedIpRange = 'effectiveReservedIpRange-598066492'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setCapacityGib($capacityGib); + $expectedResponse->setDaosVersion($daosVersion); + $expectedResponse->setNetwork($network); + $expectedResponse->setReservedIpRange($reservedIpRange); + $expectedResponse->setEffectiveReservedIpRange($effectiveReservedIpRange); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $instanceId = 'instanceId-2101995259'; + $instance = new Instance(); + $instanceCapacityGib = 1813257007; + $instance->setCapacityGib($instanceCapacityGib); + $request = (new CreateInstanceRequest()) + ->setParent($formattedParent) + ->setInstanceId($instanceId) + ->setInstance($instance); + $response = $gapicClient->createInstance($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.parallelstore.v1.Parallelstore/CreateInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceId(); + $this->assertProtobufEquals($instanceId, $actualValue); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createInstanceTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createInstanceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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 + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $instanceId = 'instanceId-2101995259'; + $instance = new Instance(); + $instanceCapacityGib = 1813257007; + $instance->setCapacityGib($instanceCapacityGib); + $request = (new CreateInstanceRequest()) + ->setParent($formattedParent) + ->setInstanceId($instanceId) + ->setInstance($instance); + $response = $gapicClient->createInstance($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createInstanceTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteInstanceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new DeleteInstanceRequest())->setName($formattedName); + $response = $gapicClient->deleteInstance($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.parallelstore.v1.Parallelstore/DeleteInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteInstanceTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteInstanceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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 + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new DeleteInstanceRequest())->setName($formattedName); + $response = $gapicClient->deleteInstance($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteInstanceTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function exportDataTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/exportDataTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new ExportDataResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/exportDataTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new ExportDataRequest())->setName($formattedName); + $response = $gapicClient->exportData($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.parallelstore.v1.Parallelstore/ExportData', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/exportDataTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function exportDataExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/exportDataTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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 + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new ExportDataRequest())->setName($formattedName); + $response = $gapicClient->exportData($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/exportDataTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getInstanceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $capacityGib = 498394811; + $daosVersion = 'daosVersion-1809382982'; + $network = 'network1843485230'; + $reservedIpRange = 'reservedIpRange-1082940580'; + $effectiveReservedIpRange = 'effectiveReservedIpRange-598066492'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setCapacityGib($capacityGib); + $expectedResponse->setDaosVersion($daosVersion); + $expectedResponse->setNetwork($network); + $expectedResponse->setReservedIpRange($reservedIpRange); + $expectedResponse->setEffectiveReservedIpRange($effectiveReservedIpRange); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new GetInstanceRequest())->setName($formattedName); + $response = $gapicClient->getInstance($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.parallelstore.v1.Parallelstore/GetInstance', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getInstanceExceptionTest() + { + $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 + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new GetInstanceRequest())->setName($formattedName); + try { + $gapicClient->getInstance($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 importDataTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/importDataTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new ImportDataResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/importDataTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new ImportDataRequest())->setName($formattedName); + $response = $gapicClient->importData($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.parallelstore.v1.Parallelstore/ImportData', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importDataTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function importDataExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/importDataTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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 + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); + $request = (new ImportDataRequest())->setName($formattedName); + $response = $gapicClient->importData($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importDataTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function listInstancesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $instancesElement = new Instance(); + $instances = [$instancesElement]; + $expectedResponse = new ListInstancesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setInstances($instances); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListInstancesRequest())->setParent($formattedParent); + $response = $gapicClient->listInstances($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getInstances()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.parallelstore.v1.Parallelstore/ListInstances', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listInstancesExceptionTest() + { + $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 + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListInstancesRequest())->setParent($formattedParent); + try { + $gapicClient->listInstances($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 updateInstanceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $capacityGib = 498394811; + $daosVersion = 'daosVersion-1809382982'; + $network = 'network1843485230'; + $reservedIpRange = 'reservedIpRange-1082940580'; + $effectiveReservedIpRange = 'effectiveReservedIpRange-598066492'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setCapacityGib($capacityGib); + $expectedResponse->setDaosVersion($daosVersion); + $expectedResponse->setNetwork($network); + $expectedResponse->setReservedIpRange($reservedIpRange); + $expectedResponse->setEffectiveReservedIpRange($effectiveReservedIpRange); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $updateMask = new FieldMask(); + $instance = new Instance(); + $instanceCapacityGib = 1813257007; + $instance->setCapacityGib($instanceCapacityGib); + $request = (new UpdateInstanceRequest())->setUpdateMask($updateMask)->setInstance($instance); + $response = $gapicClient->updateInstance($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.parallelstore.v1.Parallelstore/UpdateInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateInstanceTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateInstanceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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 + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $updateMask = new FieldMask(); + $instance = new Instance(); + $instanceCapacityGib = 1813257007; + $instance->setCapacityGib($instanceCapacityGib); + $request = (new UpdateInstanceRequest())->setUpdateMask($updateMask)->setInstance($instance); + $response = $gapicClient->updateInstance($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateInstanceTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($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.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $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); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($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 listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [$locationsElement]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $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); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($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 createInstanceAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createInstanceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $capacityGib = 498394811; + $daosVersion = 'daosVersion-1809382982'; + $network = 'network1843485230'; + $reservedIpRange = 'reservedIpRange-1082940580'; + $effectiveReservedIpRange = 'effectiveReservedIpRange-598066492'; + $expectedResponse = new Instance(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setCapacityGib($capacityGib); + $expectedResponse->setDaosVersion($daosVersion); + $expectedResponse->setNetwork($network); + $expectedResponse->setReservedIpRange($reservedIpRange); + $expectedResponse->setEffectiveReservedIpRange($effectiveReservedIpRange); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createInstanceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $instanceId = 'instanceId-2101995259'; + $instance = new Instance(); + $instanceCapacityGib = 1813257007; + $instance->setCapacityGib($instanceCapacityGib); + $request = (new CreateInstanceRequest()) + ->setParent($formattedParent) + ->setInstanceId($instanceId) + ->setInstance($instance); + $response = $gapicClient->createInstanceAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.parallelstore.v1.Parallelstore/CreateInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceId(); + $this->assertProtobufEquals($instanceId, $actualValue); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createInstanceTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} From 9b4de9431c6774156ac0a58271fd0355f7d3004f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Mendoza?= Date: Mon, 28 Oct 2024 15:10:25 -0400 Subject: [PATCH 31/34] feat: introduce AdManager component (#7767) --- .repo-metadata-full.json | 8 + AdsAdManager/.OwlBot.yaml | 4 + AdsAdManager/.gitattributes | 7 + AdsAdManager/.github/pull_request_template.md | 24 + AdsAdManager/CONTRIBUTING.md | 10 + AdsAdManager/LICENSE | 202 + AdsAdManager/README.md | 45 + AdsAdManager/VERSION | 1 + AdsAdManager/composer.json | 30 + AdsAdManager/metadata/V1/AdUnitEnums.php | Bin 0 -> 1115 bytes AdsAdManager/metadata/V1/AdUnitMessages.php | Bin 0 -> 3739 bytes AdsAdManager/metadata/V1/AdUnitService.php | 67 + AdsAdManager/metadata/V1/AdmanagerError.php | 37 + AdsAdManager/metadata/V1/AppliedLabel.php | 33 + .../metadata/V1/CompanyCreditStatusEnum.php | Bin 0 -> 1005 bytes AdsAdManager/metadata/V1/CompanyMessages.php | Bin 0 -> 2216 bytes AdsAdManager/metadata/V1/CompanyService.php | 53 + AdsAdManager/metadata/V1/CompanyTypeEnum.php | Bin 0 -> 968 bytes AdsAdManager/metadata/V1/ContactMessages.php | 34 + AdsAdManager/metadata/V1/CustomFieldEnums.php | Bin 0 -> 1388 bytes .../metadata/V1/CustomFieldMessages.php | 46 + .../metadata/V1/CustomFieldService.php | 52 + AdsAdManager/metadata/V1/CustomFieldValue.php | Bin 0 -> 1252 bytes .../metadata/V1/CustomTargetingKeyEnums.php | Bin 0 -> 1285 bytes .../V1/CustomTargetingKeyMessages.php | 39 + .../metadata/V1/CustomTargetingKeyService.php | 53 + .../metadata/V1/CustomTargetingValueEnums.php | Bin 0 -> 1200 bytes .../V1/CustomTargetingValueMessages.php | 38 + .../V1/CustomTargetingValueService.php | 53 + .../V1/EntitySignalsMappingMessages.php | Bin 0 -> 1411 bytes .../V1/EntitySignalsMappingService.php | 73 + .../metadata/V1/EnvironmentTypeEnum.php | Bin 0 -> 942 bytes AdsAdManager/metadata/V1/FrequencyCap.php | Bin 0 -> 1071 bytes AdsAdManager/metadata/V1/LabelMessages.php | 32 + AdsAdManager/metadata/V1/NetworkMessages.php | 44 + AdsAdManager/metadata/V1/NetworkService.php | 42 + AdsAdManager/metadata/V1/OrderEnums.php | Bin 0 -> 966 bytes AdsAdManager/metadata/V1/OrderMessages.php | 79 + AdsAdManager/metadata/V1/OrderService.php | 53 + AdsAdManager/metadata/V1/PlacementEnums.php | Bin 0 -> 929 bytes .../metadata/V1/PlacementMessages.php | 43 + AdsAdManager/metadata/V1/PlacementService.php | 53 + AdsAdManager/metadata/V1/ReportService.php | Bin 0 -> 35098 bytes AdsAdManager/metadata/V1/RoleEnums.php | Bin 0 -> 880 bytes AdsAdManager/metadata/V1/RoleMessages.php | 38 + AdsAdManager/metadata/V1/RoleService.php | 52 + AdsAdManager/metadata/V1/Size.php | 33 + AdsAdManager/metadata/V1/SizeTypeEnum.php | Bin 0 -> 958 bytes .../metadata/V1/TaxonomyCategoryMessages.php | 40 + .../metadata/V1/TaxonomyCategoryService.php | 52 + AdsAdManager/metadata/V1/TaxonomyTypeEnum.php | Bin 0 -> 1055 bytes AdsAdManager/metadata/V1/TeamMessages.php | 33 + AdsAdManager/metadata/V1/TimeUnitEnum.php | Bin 0 -> 950 bytes AdsAdManager/metadata/V1/UserMessages.php | 42 + AdsAdManager/metadata/V1/UserService.php | 37 + AdsAdManager/owlbot.py | 56 + AdsAdManager/phpunit.xml.dist | 16 + .../V1/AdUnitServiceClient/get_ad_unit.php | 72 + .../list_ad_unit_sizes.php | 75 + .../V1/AdUnitServiceClient/list_ad_units.php | 75 + .../V1/CompanyServiceClient/get_company.php | 72 + .../CompanyServiceClient/list_companies.php | 75 + .../get_custom_field.php | 72 + .../list_custom_fields.php | 75 + .../get_custom_targeting_key.php | 76 + .../list_custom_targeting_keys.php | 75 + .../get_custom_targeting_value.php | 77 + .../list_custom_targeting_values.php | 79 + .../batch_create_entity_signals_mappings.php | 99 + .../batch_update_entity_signals_mappings.php | 95 + .../create_entity_signals_mapping.php | 84 + .../get_entity_signals_mapping.php | 76 + .../list_entity_signals_mappings.php | 75 + .../update_entity_signals_mapping.php | 78 + .../V1/NetworkServiceClient/get_network.php | 72 + .../V1/NetworkServiceClient/list_networks.php | 57 + .../V1/OrderServiceClient/get_order.php | 72 + .../V1/OrderServiceClient/list_orders.php | 80 + .../PlacementServiceClient/get_placement.php | 72 + .../list_placements.php | 75 + .../V1/ReportServiceClient/create_report.php | 105 + .../fetch_report_result_rows.php | 60 + .../V1/ReportServiceClient/get_report.php | 72 + .../V1/ReportServiceClient/list_reports.php | 75 + .../V1/ReportServiceClient/run_report.php | 91 + .../V1/ReportServiceClient/update_report.php | 101 + .../samples/V1/RoleServiceClient/get_role.php | 72 + .../V1/RoleServiceClient/list_roles.php | 75 + .../get_taxonomy_category.php | 75 + .../list_taxonomy_categories.php | 75 + .../samples/V1/UserServiceClient/get_user.php | 75 + AdsAdManager/src/V1/AdManagerError.php | 241 + AdsAdManager/src/V1/AdUnit.php | 1049 +++++ AdsAdManager/src/V1/AdUnitParent.php | 143 + AdsAdManager/src/V1/AdUnitSize.php | 153 + AdsAdManager/src/V1/AdUnitStatusEnum.php | 34 + .../src/V1/AdUnitStatusEnum/AdUnitStatus.php | 69 + AdsAdManager/src/V1/AppliedLabel.php | 105 + ...atchCreateEntitySignalsMappingsRequest.php | 132 + ...tchCreateEntitySignalsMappingsResponse.php | 67 + ...atchUpdateEntitySignalsMappingsRequest.php | 132 + ...tchUpdateEntitySignalsMappingsResponse.php | 67 + .../src/V1/Client/AdUnitServiceClient.php | 317 ++ .../src/V1/Client/CompanyServiceClient.php | 289 ++ .../V1/Client/CustomFieldServiceClient.php | 289 ++ .../CustomTargetingKeyServiceClient.php | 296 ++ .../CustomTargetingValueServiceClient.php | 303 ++ .../EntitySignalsMappingServiceClient.php | 424 ++ .../src/V1/Client/NetworkServiceClient.php | 271 ++ .../src/V1/Client/OrderServiceClient.php | 294 ++ .../src/V1/Client/PlacementServiceClient.php | 289 ++ .../src/V1/Client/ReportServiceClient.php | 471 ++ .../src/V1/Client/RoleServiceClient.php | 289 ++ .../Client/TaxonomyCategoryServiceClient.php | 294 ++ .../src/V1/Client/UserServiceClient.php | 247 + AdsAdManager/src/V1/Company.php | 649 +++ .../src/V1/CompanyCreditStatusEnum.php | 34 + .../CompanyCreditStatus.php | 117 + AdsAdManager/src/V1/CompanyTypeEnum.php | 34 + .../src/V1/CompanyTypeEnum/CompanyType.php | 84 + AdsAdManager/src/V1/Contact.php | 112 + .../V1/CreateEntitySignalsMappingRequest.php | 132 + AdsAdManager/src/V1/CreateReportRequest.php | 132 + AdsAdManager/src/V1/CustomField.php | 355 ++ .../src/V1/CustomFieldDataTypeEnum.php | 34 + .../CustomFieldDataType.php | 77 + .../src/V1/CustomFieldEntityTypeEnum.php | 34 + .../CustomFieldEntityType.php | 83 + AdsAdManager/src/V1/CustomFieldOption.php | 105 + AdsAdManager/src/V1/CustomFieldStatusEnum.php | 34 + .../CustomFieldStatus.php | 62 + AdsAdManager/src/V1/CustomFieldValue.php | 115 + .../src/V1/CustomFieldValue/Value.php | 176 + .../src/V1/CustomFieldVisibilityEnum.php | 34 + .../CustomFieldVisibility.php | 70 + AdsAdManager/src/V1/CustomTargetingKey.php | 295 ++ .../CustomTargetingKeyReportableTypeEnum.php | 34 + .../CustomTargetingKeyReportableType.php | 69 + .../src/V1/CustomTargetingKeyStatusEnum.php | 34 + .../CustomTargetingKeyStatus.php | 62 + .../src/V1/CustomTargetingKeyTypeEnum.php | 34 + .../CustomTargetingKeyType.php | 62 + AdsAdManager/src/V1/CustomTargetingValue.php | 231 + .../V1/CustomTargetingValueMatchTypeEnum.php | 34 + .../CustomTargetingValueMatchType.php | 111 + .../src/V1/CustomTargetingValueStatusEnum.php | 34 + .../CustomTargetingValueStatus.php | 62 + AdsAdManager/src/V1/EntitySignalsMapping.php | 255 + AdsAdManager/src/V1/EnvironmentTypeEnum.php | 34 + .../EnvironmentTypeEnum/EnvironmentType.php | 62 + .../src/V1/FetchReportResultRowsRequest.php | 170 + .../src/V1/FetchReportResultRowsResponse.php | 283 ++ AdsAdManager/src/V1/FrequencyCap.php | 165 + AdsAdManager/src/V1/GetAdUnitRequest.php | 86 + AdsAdManager/src/V1/GetCompanyRequest.php | 86 + AdsAdManager/src/V1/GetCustomFieldRequest.php | 86 + .../src/V1/GetCustomTargetingKeyRequest.php | 91 + .../src/V1/GetCustomTargetingValueRequest.php | 91 + .../src/V1/GetEntitySignalsMappingRequest.php | 91 + AdsAdManager/src/V1/GetNetworkRequest.php | 86 + AdsAdManager/src/V1/GetOrderRequest.php | 86 + AdsAdManager/src/V1/GetPlacementRequest.php | 86 + AdsAdManager/src/V1/GetReportRequest.php | 86 + AdsAdManager/src/V1/GetRoleRequest.php | 86 + .../src/V1/GetTaxonomyCategoryRequest.php | 86 + AdsAdManager/src/V1/GetUserRequest.php | 86 + AdsAdManager/src/V1/Label.php | 71 + AdsAdManager/src/V1/LabelFrequencyCap.php | 115 + .../src/V1/ListAdUnitSizesRequest.php | 296 ++ .../src/V1/ListAdUnitSizesResponse.php | 171 + AdsAdManager/src/V1/ListAdUnitsRequest.php | 296 ++ AdsAdManager/src/V1/ListAdUnitsResponse.php | 171 + AdsAdManager/src/V1/ListCompaniesRequest.php | 296 ++ AdsAdManager/src/V1/ListCompaniesResponse.php | 172 + .../src/V1/ListCustomFieldsRequest.php | 296 ++ .../src/V1/ListCustomFieldsResponse.php | 172 + .../src/V1/ListCustomTargetingKeysRequest.php | 296 ++ .../V1/ListCustomTargetingKeysResponse.php | 172 + .../V1/ListCustomTargetingValuesRequest.php | 309 ++ .../V1/ListCustomTargetingValuesResponse.php | 172 + .../V1/ListEntitySignalsMappingsRequest.php | 304 ++ .../V1/ListEntitySignalsMappingsResponse.php | 172 + AdsAdManager/src/V1/ListNetworksRequest.php | 33 + AdsAdManager/src/V1/ListNetworksResponse.php | 67 + AdsAdManager/src/V1/ListOrdersRequest.php | 296 ++ AdsAdManager/src/V1/ListOrdersResponse.php | 172 + AdsAdManager/src/V1/ListPlacementsRequest.php | 296 ++ .../src/V1/ListPlacementsResponse.php | 172 + AdsAdManager/src/V1/ListReportsRequest.php | 296 ++ AdsAdManager/src/V1/ListReportsResponse.php | 172 + AdsAdManager/src/V1/ListRolesRequest.php | 292 ++ AdsAdManager/src/V1/ListRolesResponse.php | 171 + .../src/V1/ListTaxonomyCategoriesRequest.php | 296 ++ .../src/V1/ListTaxonomyCategoriesResponse.php | 172 + AdsAdManager/src/V1/Network.php | 393 ++ AdsAdManager/src/V1/Order.php | 1169 +++++ AdsAdManager/src/V1/OrderStatusEnum.php | 34 + .../src/V1/OrderStatusEnum/OrderStatus.php | 100 + AdsAdManager/src/V1/Placement.php | 339 ++ AdsAdManager/src/V1/PlacementStatusEnum.php | 34 + .../PlacementStatusEnum/PlacementStatus.php | 69 + AdsAdManager/src/V1/Report.php | 391 ++ AdsAdManager/src/V1/Report/DataTable.php | 34 + .../V1/Report/DataTable/MetricValueGroup.php | 287 ++ AdsAdManager/src/V1/Report/DataTable/Row.php | 134 + AdsAdManager/src/V1/Report/DateRange.php | 109 + .../V1/Report/DateRange/FixedDateRange.php | 122 + .../V1/Report/DateRange/RelativeDateRange.php | 276 ++ AdsAdManager/src/V1/Report/Dimension.php | 4169 +++++++++++++++++ AdsAdManager/src/V1/Report/Field.php | 109 + AdsAdManager/src/V1/Report/Filter.php | 175 + .../src/V1/Report/Filter/FieldFilter.php | 286 ++ .../src/V1/Report/Filter/FilterList.php | 68 + .../src/V1/Report/Filter/Operation.php | 132 + AdsAdManager/src/V1/Report/Flag.php | 118 + AdsAdManager/src/V1/Report/Metric.php | 1306 ++++++ .../src/V1/Report/MetricValueType.php | 83 + AdsAdManager/src/V1/Report/ReportType.php | 55 + AdsAdManager/src/V1/Report/Slice.php | 114 + AdsAdManager/src/V1/Report/Sort.php | 252 + .../src/V1/Report/TimePeriodColumn.php | 76 + AdsAdManager/src/V1/Report/Value.php | 274 ++ AdsAdManager/src/V1/Report/Value/IntList.php | 68 + .../src/V1/Report/Value/StringList.php | 68 + AdsAdManager/src/V1/Report/Visibility.php | 65 + AdsAdManager/src/V1/ReportDefinition.php | 667 +++ AdsAdManager/src/V1/Role.php | 241 + AdsAdManager/src/V1/RoleStatusEnum.php | 34 + .../src/V1/RoleStatusEnum/RoleStatus.php | 62 + AdsAdManager/src/V1/RunReportMetadata.php | 105 + AdsAdManager/src/V1/RunReportRequest.php | 86 + AdsAdManager/src/V1/RunReportResponse.php | 71 + AdsAdManager/src/V1/Schedule.php | 306 ++ AdsAdManager/src/V1/Schedule/Frequency.php | 97 + .../src/V1/Schedule/MonthlySchedule.php | 72 + .../src/V1/Schedule/WeeklySchedule.php | 68 + AdsAdManager/src/V1/ScheduleOptions.php | 149 + .../V1/ScheduleOptions/DeliveryCondition.php | 62 + AdsAdManager/src/V1/Size.php | 163 + AdsAdManager/src/V1/SizeTypeEnum.php | 34 + AdsAdManager/src/V1/SizeTypeEnum/SizeType.php | 103 + AdsAdManager/src/V1/SmartSizeModeEnum.php | 34 + .../V1/SmartSizeModeEnum/SmartSizeMode.php | 70 + AdsAdManager/src/V1/TargetWindowEnum.php | 34 + .../src/V1/TargetWindowEnum/TargetWindow.php | 63 + AdsAdManager/src/V1/TaxonomyCategory.php | 317 ++ AdsAdManager/src/V1/TaxonomyTypeEnum.php | 34 + .../src/V1/TaxonomyTypeEnum/TaxonomyType.php | 84 + AdsAdManager/src/V1/Team.php | 109 + AdsAdManager/src/V1/TimeUnitEnum.php | 33 + AdsAdManager/src/V1/TimeUnitEnum/TimeUnit.php | 105 + .../V1/UpdateEntitySignalsMappingRequest.php | 157 + AdsAdManager/src/V1/UpdateReportRequest.php | 136 + AdsAdManager/src/V1/User.php | 379 ++ AdsAdManager/src/V1/gapic_metadata.json | 296 ++ .../ad_unit_service_client_config.json | 37 + .../ad_unit_service_descriptor_config.php | 84 + .../ad_unit_service_rest_client_config.php | 81 + .../company_service_client_config.json | 32 + .../company_service_descriptor_config.php | 64 + .../company_service_rest_client_config.php | 70 + .../custom_field_service_client_config.json | 32 + ...custom_field_service_descriptor_config.php | 64 + ...ustom_field_service_rest_client_config.php | 70 + ...m_targeting_key_service_client_config.json | 32 + ...argeting_key_service_descriptor_config.php | 64 + ...rgeting_key_service_rest_client_config.php | 70 + ...targeting_value_service_client_config.json | 32 + ...geting_value_service_descriptor_config.php | 64 + ...eting_value_service_rest_client_config.php | 70 + ...signals_mapping_service_client_config.json | 52 + ...nals_mapping_service_descriptor_config.php | 113 + ...als_mapping_service_rest_client_config.php | 122 + .../network_service_client_config.json | 32 + .../network_service_descriptor_config.php | 47 + .../network_service_rest_client_config.php | 63 + .../order_service_client_config.json | 44 + .../order_service_descriptor_config.php | 64 + .../order_service_rest_client_config.php | 70 + .../placement_service_client_config.json | 32 + .../placement_service_descriptor_config.php | 64 + .../placement_service_rest_client_config.php | 70 + .../report_service_client_config.json | 52 + .../report_service_descriptor_config.php | 120 + .../report_service_rest_client_config.php | 121 + .../resources/role_service_client_config.json | 32 + .../role_service_descriptor_config.php | 64 + .../role_service_rest_client_config.php | 70 + ...xonomy_category_service_client_config.json | 32 + ...omy_category_service_descriptor_config.php | 64 + ...my_category_service_rest_client_config.php | 70 + .../resources/user_service_client_config.json | 27 + .../user_service_descriptor_config.php | 43 + .../user_service_rest_client_config.php | 59 + .../V1/Client/AdUnitServiceClientTest.php | 348 ++ .../V1/Client/CompanyServiceClientTest.php | 272 ++ .../Client/CustomFieldServiceClientTest.php | 244 + .../CustomTargetingKeyServiceClientTest.php | 247 + .../CustomTargetingValueServiceClientTest.php | 261 ++ .../EntitySignalsMappingServiceClientTest.php | 561 +++ .../V1/Client/NetworkServiceClientTest.php | 248 + .../Unit/V1/Client/OrderServiceClientTest.php | 292 ++ .../V1/Client/PlacementServiceClientTest.php | 248 + .../V1/Client/ReportServiceClientTest.php | 646 +++ .../Unit/V1/Client/RoleServiceClientTest.php | 248 + .../TaxonomyCategoryServiceClientTest.php | 248 + .../Unit/V1/Client/UserServiceClientTest.php | 189 + composer.json | 5 +- 308 files changed, 43635 insertions(+), 1 deletion(-) create mode 100644 AdsAdManager/.OwlBot.yaml create mode 100644 AdsAdManager/.gitattributes create mode 100644 AdsAdManager/.github/pull_request_template.md create mode 100644 AdsAdManager/CONTRIBUTING.md create mode 100644 AdsAdManager/LICENSE create mode 100644 AdsAdManager/README.md create mode 100644 AdsAdManager/VERSION create mode 100644 AdsAdManager/composer.json create mode 100644 AdsAdManager/metadata/V1/AdUnitEnums.php create mode 100644 AdsAdManager/metadata/V1/AdUnitMessages.php create mode 100644 AdsAdManager/metadata/V1/AdUnitService.php create mode 100644 AdsAdManager/metadata/V1/AdmanagerError.php create mode 100644 AdsAdManager/metadata/V1/AppliedLabel.php create mode 100644 AdsAdManager/metadata/V1/CompanyCreditStatusEnum.php create mode 100644 AdsAdManager/metadata/V1/CompanyMessages.php create mode 100644 AdsAdManager/metadata/V1/CompanyService.php create mode 100644 AdsAdManager/metadata/V1/CompanyTypeEnum.php create mode 100644 AdsAdManager/metadata/V1/ContactMessages.php create mode 100644 AdsAdManager/metadata/V1/CustomFieldEnums.php create mode 100644 AdsAdManager/metadata/V1/CustomFieldMessages.php create mode 100644 AdsAdManager/metadata/V1/CustomFieldService.php create mode 100644 AdsAdManager/metadata/V1/CustomFieldValue.php create mode 100644 AdsAdManager/metadata/V1/CustomTargetingKeyEnums.php create mode 100644 AdsAdManager/metadata/V1/CustomTargetingKeyMessages.php create mode 100644 AdsAdManager/metadata/V1/CustomTargetingKeyService.php create mode 100644 AdsAdManager/metadata/V1/CustomTargetingValueEnums.php create mode 100644 AdsAdManager/metadata/V1/CustomTargetingValueMessages.php create mode 100644 AdsAdManager/metadata/V1/CustomTargetingValueService.php create mode 100644 AdsAdManager/metadata/V1/EntitySignalsMappingMessages.php create mode 100644 AdsAdManager/metadata/V1/EntitySignalsMappingService.php create mode 100644 AdsAdManager/metadata/V1/EnvironmentTypeEnum.php create mode 100644 AdsAdManager/metadata/V1/FrequencyCap.php create mode 100644 AdsAdManager/metadata/V1/LabelMessages.php create mode 100644 AdsAdManager/metadata/V1/NetworkMessages.php create mode 100644 AdsAdManager/metadata/V1/NetworkService.php create mode 100644 AdsAdManager/metadata/V1/OrderEnums.php create mode 100644 AdsAdManager/metadata/V1/OrderMessages.php create mode 100644 AdsAdManager/metadata/V1/OrderService.php create mode 100644 AdsAdManager/metadata/V1/PlacementEnums.php create mode 100644 AdsAdManager/metadata/V1/PlacementMessages.php create mode 100644 AdsAdManager/metadata/V1/PlacementService.php create mode 100644 AdsAdManager/metadata/V1/ReportService.php create mode 100644 AdsAdManager/metadata/V1/RoleEnums.php create mode 100644 AdsAdManager/metadata/V1/RoleMessages.php create mode 100644 AdsAdManager/metadata/V1/RoleService.php create mode 100644 AdsAdManager/metadata/V1/Size.php create mode 100644 AdsAdManager/metadata/V1/SizeTypeEnum.php create mode 100644 AdsAdManager/metadata/V1/TaxonomyCategoryMessages.php create mode 100644 AdsAdManager/metadata/V1/TaxonomyCategoryService.php create mode 100644 AdsAdManager/metadata/V1/TaxonomyTypeEnum.php create mode 100644 AdsAdManager/metadata/V1/TeamMessages.php create mode 100644 AdsAdManager/metadata/V1/TimeUnitEnum.php create mode 100644 AdsAdManager/metadata/V1/UserMessages.php create mode 100644 AdsAdManager/metadata/V1/UserService.php create mode 100644 AdsAdManager/owlbot.py create mode 100644 AdsAdManager/phpunit.xml.dist create mode 100644 AdsAdManager/samples/V1/AdUnitServiceClient/get_ad_unit.php create mode 100644 AdsAdManager/samples/V1/AdUnitServiceClient/list_ad_unit_sizes.php create mode 100644 AdsAdManager/samples/V1/AdUnitServiceClient/list_ad_units.php create mode 100644 AdsAdManager/samples/V1/CompanyServiceClient/get_company.php create mode 100644 AdsAdManager/samples/V1/CompanyServiceClient/list_companies.php create mode 100644 AdsAdManager/samples/V1/CustomFieldServiceClient/get_custom_field.php create mode 100644 AdsAdManager/samples/V1/CustomFieldServiceClient/list_custom_fields.php create mode 100644 AdsAdManager/samples/V1/CustomTargetingKeyServiceClient/get_custom_targeting_key.php create mode 100644 AdsAdManager/samples/V1/CustomTargetingKeyServiceClient/list_custom_targeting_keys.php create mode 100644 AdsAdManager/samples/V1/CustomTargetingValueServiceClient/get_custom_targeting_value.php create mode 100644 AdsAdManager/samples/V1/CustomTargetingValueServiceClient/list_custom_targeting_values.php create mode 100644 AdsAdManager/samples/V1/EntitySignalsMappingServiceClient/batch_create_entity_signals_mappings.php create mode 100644 AdsAdManager/samples/V1/EntitySignalsMappingServiceClient/batch_update_entity_signals_mappings.php create mode 100644 AdsAdManager/samples/V1/EntitySignalsMappingServiceClient/create_entity_signals_mapping.php create mode 100644 AdsAdManager/samples/V1/EntitySignalsMappingServiceClient/get_entity_signals_mapping.php create mode 100644 AdsAdManager/samples/V1/EntitySignalsMappingServiceClient/list_entity_signals_mappings.php create mode 100644 AdsAdManager/samples/V1/EntitySignalsMappingServiceClient/update_entity_signals_mapping.php create mode 100644 AdsAdManager/samples/V1/NetworkServiceClient/get_network.php create mode 100644 AdsAdManager/samples/V1/NetworkServiceClient/list_networks.php create mode 100644 AdsAdManager/samples/V1/OrderServiceClient/get_order.php create mode 100644 AdsAdManager/samples/V1/OrderServiceClient/list_orders.php create mode 100644 AdsAdManager/samples/V1/PlacementServiceClient/get_placement.php create mode 100644 AdsAdManager/samples/V1/PlacementServiceClient/list_placements.php create mode 100644 AdsAdManager/samples/V1/ReportServiceClient/create_report.php create mode 100644 AdsAdManager/samples/V1/ReportServiceClient/fetch_report_result_rows.php create mode 100644 AdsAdManager/samples/V1/ReportServiceClient/get_report.php create mode 100644 AdsAdManager/samples/V1/ReportServiceClient/list_reports.php create mode 100644 AdsAdManager/samples/V1/ReportServiceClient/run_report.php create mode 100644 AdsAdManager/samples/V1/ReportServiceClient/update_report.php create mode 100644 AdsAdManager/samples/V1/RoleServiceClient/get_role.php create mode 100644 AdsAdManager/samples/V1/RoleServiceClient/list_roles.php create mode 100644 AdsAdManager/samples/V1/TaxonomyCategoryServiceClient/get_taxonomy_category.php create mode 100644 AdsAdManager/samples/V1/TaxonomyCategoryServiceClient/list_taxonomy_categories.php create mode 100644 AdsAdManager/samples/V1/UserServiceClient/get_user.php create mode 100644 AdsAdManager/src/V1/AdManagerError.php create mode 100644 AdsAdManager/src/V1/AdUnit.php create mode 100644 AdsAdManager/src/V1/AdUnitParent.php create mode 100644 AdsAdManager/src/V1/AdUnitSize.php create mode 100644 AdsAdManager/src/V1/AdUnitStatusEnum.php create mode 100644 AdsAdManager/src/V1/AdUnitStatusEnum/AdUnitStatus.php create mode 100644 AdsAdManager/src/V1/AppliedLabel.php create mode 100644 AdsAdManager/src/V1/BatchCreateEntitySignalsMappingsRequest.php create mode 100644 AdsAdManager/src/V1/BatchCreateEntitySignalsMappingsResponse.php create mode 100644 AdsAdManager/src/V1/BatchUpdateEntitySignalsMappingsRequest.php create mode 100644 AdsAdManager/src/V1/BatchUpdateEntitySignalsMappingsResponse.php create mode 100644 AdsAdManager/src/V1/Client/AdUnitServiceClient.php create mode 100644 AdsAdManager/src/V1/Client/CompanyServiceClient.php create mode 100644 AdsAdManager/src/V1/Client/CustomFieldServiceClient.php create mode 100644 AdsAdManager/src/V1/Client/CustomTargetingKeyServiceClient.php create mode 100644 AdsAdManager/src/V1/Client/CustomTargetingValueServiceClient.php create mode 100644 AdsAdManager/src/V1/Client/EntitySignalsMappingServiceClient.php create mode 100644 AdsAdManager/src/V1/Client/NetworkServiceClient.php create mode 100644 AdsAdManager/src/V1/Client/OrderServiceClient.php create mode 100644 AdsAdManager/src/V1/Client/PlacementServiceClient.php create mode 100644 AdsAdManager/src/V1/Client/ReportServiceClient.php create mode 100644 AdsAdManager/src/V1/Client/RoleServiceClient.php create mode 100644 AdsAdManager/src/V1/Client/TaxonomyCategoryServiceClient.php create mode 100644 AdsAdManager/src/V1/Client/UserServiceClient.php create mode 100644 AdsAdManager/src/V1/Company.php create mode 100644 AdsAdManager/src/V1/CompanyCreditStatusEnum.php create mode 100644 AdsAdManager/src/V1/CompanyCreditStatusEnum/CompanyCreditStatus.php create mode 100644 AdsAdManager/src/V1/CompanyTypeEnum.php create mode 100644 AdsAdManager/src/V1/CompanyTypeEnum/CompanyType.php create mode 100644 AdsAdManager/src/V1/Contact.php create mode 100644 AdsAdManager/src/V1/CreateEntitySignalsMappingRequest.php create mode 100644 AdsAdManager/src/V1/CreateReportRequest.php create mode 100644 AdsAdManager/src/V1/CustomField.php create mode 100644 AdsAdManager/src/V1/CustomFieldDataTypeEnum.php create mode 100644 AdsAdManager/src/V1/CustomFieldDataTypeEnum/CustomFieldDataType.php create mode 100644 AdsAdManager/src/V1/CustomFieldEntityTypeEnum.php create mode 100644 AdsAdManager/src/V1/CustomFieldEntityTypeEnum/CustomFieldEntityType.php create mode 100644 AdsAdManager/src/V1/CustomFieldOption.php create mode 100644 AdsAdManager/src/V1/CustomFieldStatusEnum.php create mode 100644 AdsAdManager/src/V1/CustomFieldStatusEnum/CustomFieldStatus.php create mode 100644 AdsAdManager/src/V1/CustomFieldValue.php create mode 100644 AdsAdManager/src/V1/CustomFieldValue/Value.php create mode 100644 AdsAdManager/src/V1/CustomFieldVisibilityEnum.php create mode 100644 AdsAdManager/src/V1/CustomFieldVisibilityEnum/CustomFieldVisibility.php create mode 100644 AdsAdManager/src/V1/CustomTargetingKey.php create mode 100644 AdsAdManager/src/V1/CustomTargetingKeyReportableTypeEnum.php create mode 100644 AdsAdManager/src/V1/CustomTargetingKeyReportableTypeEnum/CustomTargetingKeyReportableType.php create mode 100644 AdsAdManager/src/V1/CustomTargetingKeyStatusEnum.php create mode 100644 AdsAdManager/src/V1/CustomTargetingKeyStatusEnum/CustomTargetingKeyStatus.php create mode 100644 AdsAdManager/src/V1/CustomTargetingKeyTypeEnum.php create mode 100644 AdsAdManager/src/V1/CustomTargetingKeyTypeEnum/CustomTargetingKeyType.php create mode 100644 AdsAdManager/src/V1/CustomTargetingValue.php create mode 100644 AdsAdManager/src/V1/CustomTargetingValueMatchTypeEnum.php create mode 100644 AdsAdManager/src/V1/CustomTargetingValueMatchTypeEnum/CustomTargetingValueMatchType.php create mode 100644 AdsAdManager/src/V1/CustomTargetingValueStatusEnum.php create mode 100644 AdsAdManager/src/V1/CustomTargetingValueStatusEnum/CustomTargetingValueStatus.php create mode 100644 AdsAdManager/src/V1/EntitySignalsMapping.php create mode 100644 AdsAdManager/src/V1/EnvironmentTypeEnum.php create mode 100644 AdsAdManager/src/V1/EnvironmentTypeEnum/EnvironmentType.php create mode 100644 AdsAdManager/src/V1/FetchReportResultRowsRequest.php create mode 100644 AdsAdManager/src/V1/FetchReportResultRowsResponse.php create mode 100644 AdsAdManager/src/V1/FrequencyCap.php create mode 100644 AdsAdManager/src/V1/GetAdUnitRequest.php create mode 100644 AdsAdManager/src/V1/GetCompanyRequest.php create mode 100644 AdsAdManager/src/V1/GetCustomFieldRequest.php create mode 100644 AdsAdManager/src/V1/GetCustomTargetingKeyRequest.php create mode 100644 AdsAdManager/src/V1/GetCustomTargetingValueRequest.php create mode 100644 AdsAdManager/src/V1/GetEntitySignalsMappingRequest.php create mode 100644 AdsAdManager/src/V1/GetNetworkRequest.php create mode 100644 AdsAdManager/src/V1/GetOrderRequest.php create mode 100644 AdsAdManager/src/V1/GetPlacementRequest.php create mode 100644 AdsAdManager/src/V1/GetReportRequest.php create mode 100644 AdsAdManager/src/V1/GetRoleRequest.php create mode 100644 AdsAdManager/src/V1/GetTaxonomyCategoryRequest.php create mode 100644 AdsAdManager/src/V1/GetUserRequest.php create mode 100644 AdsAdManager/src/V1/Label.php create mode 100644 AdsAdManager/src/V1/LabelFrequencyCap.php create mode 100644 AdsAdManager/src/V1/ListAdUnitSizesRequest.php create mode 100644 AdsAdManager/src/V1/ListAdUnitSizesResponse.php create mode 100644 AdsAdManager/src/V1/ListAdUnitsRequest.php create mode 100644 AdsAdManager/src/V1/ListAdUnitsResponse.php create mode 100644 AdsAdManager/src/V1/ListCompaniesRequest.php create mode 100644 AdsAdManager/src/V1/ListCompaniesResponse.php create mode 100644 AdsAdManager/src/V1/ListCustomFieldsRequest.php create mode 100644 AdsAdManager/src/V1/ListCustomFieldsResponse.php create mode 100644 AdsAdManager/src/V1/ListCustomTargetingKeysRequest.php create mode 100644 AdsAdManager/src/V1/ListCustomTargetingKeysResponse.php create mode 100644 AdsAdManager/src/V1/ListCustomTargetingValuesRequest.php create mode 100644 AdsAdManager/src/V1/ListCustomTargetingValuesResponse.php create mode 100644 AdsAdManager/src/V1/ListEntitySignalsMappingsRequest.php create mode 100644 AdsAdManager/src/V1/ListEntitySignalsMappingsResponse.php create mode 100644 AdsAdManager/src/V1/ListNetworksRequest.php create mode 100644 AdsAdManager/src/V1/ListNetworksResponse.php create mode 100644 AdsAdManager/src/V1/ListOrdersRequest.php create mode 100644 AdsAdManager/src/V1/ListOrdersResponse.php create mode 100644 AdsAdManager/src/V1/ListPlacementsRequest.php create mode 100644 AdsAdManager/src/V1/ListPlacementsResponse.php create mode 100644 AdsAdManager/src/V1/ListReportsRequest.php create mode 100644 AdsAdManager/src/V1/ListReportsResponse.php create mode 100644 AdsAdManager/src/V1/ListRolesRequest.php create mode 100644 AdsAdManager/src/V1/ListRolesResponse.php create mode 100644 AdsAdManager/src/V1/ListTaxonomyCategoriesRequest.php create mode 100644 AdsAdManager/src/V1/ListTaxonomyCategoriesResponse.php create mode 100644 AdsAdManager/src/V1/Network.php create mode 100644 AdsAdManager/src/V1/Order.php create mode 100644 AdsAdManager/src/V1/OrderStatusEnum.php create mode 100644 AdsAdManager/src/V1/OrderStatusEnum/OrderStatus.php create mode 100644 AdsAdManager/src/V1/Placement.php create mode 100644 AdsAdManager/src/V1/PlacementStatusEnum.php create mode 100644 AdsAdManager/src/V1/PlacementStatusEnum/PlacementStatus.php create mode 100644 AdsAdManager/src/V1/Report.php create mode 100644 AdsAdManager/src/V1/Report/DataTable.php create mode 100644 AdsAdManager/src/V1/Report/DataTable/MetricValueGroup.php create mode 100644 AdsAdManager/src/V1/Report/DataTable/Row.php create mode 100644 AdsAdManager/src/V1/Report/DateRange.php create mode 100644 AdsAdManager/src/V1/Report/DateRange/FixedDateRange.php create mode 100644 AdsAdManager/src/V1/Report/DateRange/RelativeDateRange.php create mode 100644 AdsAdManager/src/V1/Report/Dimension.php create mode 100644 AdsAdManager/src/V1/Report/Field.php create mode 100644 AdsAdManager/src/V1/Report/Filter.php create mode 100644 AdsAdManager/src/V1/Report/Filter/FieldFilter.php create mode 100644 AdsAdManager/src/V1/Report/Filter/FilterList.php create mode 100644 AdsAdManager/src/V1/Report/Filter/Operation.php create mode 100644 AdsAdManager/src/V1/Report/Flag.php create mode 100644 AdsAdManager/src/V1/Report/Metric.php create mode 100644 AdsAdManager/src/V1/Report/MetricValueType.php create mode 100644 AdsAdManager/src/V1/Report/ReportType.php create mode 100644 AdsAdManager/src/V1/Report/Slice.php create mode 100644 AdsAdManager/src/V1/Report/Sort.php create mode 100644 AdsAdManager/src/V1/Report/TimePeriodColumn.php create mode 100644 AdsAdManager/src/V1/Report/Value.php create mode 100644 AdsAdManager/src/V1/Report/Value/IntList.php create mode 100644 AdsAdManager/src/V1/Report/Value/StringList.php create mode 100644 AdsAdManager/src/V1/Report/Visibility.php create mode 100644 AdsAdManager/src/V1/ReportDefinition.php create mode 100644 AdsAdManager/src/V1/Role.php create mode 100644 AdsAdManager/src/V1/RoleStatusEnum.php create mode 100644 AdsAdManager/src/V1/RoleStatusEnum/RoleStatus.php create mode 100644 AdsAdManager/src/V1/RunReportMetadata.php create mode 100644 AdsAdManager/src/V1/RunReportRequest.php create mode 100644 AdsAdManager/src/V1/RunReportResponse.php create mode 100644 AdsAdManager/src/V1/Schedule.php create mode 100644 AdsAdManager/src/V1/Schedule/Frequency.php create mode 100644 AdsAdManager/src/V1/Schedule/MonthlySchedule.php create mode 100644 AdsAdManager/src/V1/Schedule/WeeklySchedule.php create mode 100644 AdsAdManager/src/V1/ScheduleOptions.php create mode 100644 AdsAdManager/src/V1/ScheduleOptions/DeliveryCondition.php create mode 100644 AdsAdManager/src/V1/Size.php create mode 100644 AdsAdManager/src/V1/SizeTypeEnum.php create mode 100644 AdsAdManager/src/V1/SizeTypeEnum/SizeType.php create mode 100644 AdsAdManager/src/V1/SmartSizeModeEnum.php create mode 100644 AdsAdManager/src/V1/SmartSizeModeEnum/SmartSizeMode.php create mode 100644 AdsAdManager/src/V1/TargetWindowEnum.php create mode 100644 AdsAdManager/src/V1/TargetWindowEnum/TargetWindow.php create mode 100644 AdsAdManager/src/V1/TaxonomyCategory.php create mode 100644 AdsAdManager/src/V1/TaxonomyTypeEnum.php create mode 100644 AdsAdManager/src/V1/TaxonomyTypeEnum/TaxonomyType.php create mode 100644 AdsAdManager/src/V1/Team.php create mode 100644 AdsAdManager/src/V1/TimeUnitEnum.php create mode 100644 AdsAdManager/src/V1/TimeUnitEnum/TimeUnit.php create mode 100644 AdsAdManager/src/V1/UpdateEntitySignalsMappingRequest.php create mode 100644 AdsAdManager/src/V1/UpdateReportRequest.php create mode 100644 AdsAdManager/src/V1/User.php create mode 100644 AdsAdManager/src/V1/gapic_metadata.json create mode 100644 AdsAdManager/src/V1/resources/ad_unit_service_client_config.json create mode 100644 AdsAdManager/src/V1/resources/ad_unit_service_descriptor_config.php create mode 100644 AdsAdManager/src/V1/resources/ad_unit_service_rest_client_config.php create mode 100644 AdsAdManager/src/V1/resources/company_service_client_config.json create mode 100644 AdsAdManager/src/V1/resources/company_service_descriptor_config.php create mode 100644 AdsAdManager/src/V1/resources/company_service_rest_client_config.php create mode 100644 AdsAdManager/src/V1/resources/custom_field_service_client_config.json create mode 100644 AdsAdManager/src/V1/resources/custom_field_service_descriptor_config.php create mode 100644 AdsAdManager/src/V1/resources/custom_field_service_rest_client_config.php create mode 100644 AdsAdManager/src/V1/resources/custom_targeting_key_service_client_config.json create mode 100644 AdsAdManager/src/V1/resources/custom_targeting_key_service_descriptor_config.php create mode 100644 AdsAdManager/src/V1/resources/custom_targeting_key_service_rest_client_config.php create mode 100644 AdsAdManager/src/V1/resources/custom_targeting_value_service_client_config.json create mode 100644 AdsAdManager/src/V1/resources/custom_targeting_value_service_descriptor_config.php create mode 100644 AdsAdManager/src/V1/resources/custom_targeting_value_service_rest_client_config.php create mode 100644 AdsAdManager/src/V1/resources/entity_signals_mapping_service_client_config.json create mode 100644 AdsAdManager/src/V1/resources/entity_signals_mapping_service_descriptor_config.php create mode 100644 AdsAdManager/src/V1/resources/entity_signals_mapping_service_rest_client_config.php create mode 100644 AdsAdManager/src/V1/resources/network_service_client_config.json create mode 100644 AdsAdManager/src/V1/resources/network_service_descriptor_config.php create mode 100644 AdsAdManager/src/V1/resources/network_service_rest_client_config.php create mode 100644 AdsAdManager/src/V1/resources/order_service_client_config.json create mode 100644 AdsAdManager/src/V1/resources/order_service_descriptor_config.php create mode 100644 AdsAdManager/src/V1/resources/order_service_rest_client_config.php create mode 100644 AdsAdManager/src/V1/resources/placement_service_client_config.json create mode 100644 AdsAdManager/src/V1/resources/placement_service_descriptor_config.php create mode 100644 AdsAdManager/src/V1/resources/placement_service_rest_client_config.php create mode 100644 AdsAdManager/src/V1/resources/report_service_client_config.json create mode 100644 AdsAdManager/src/V1/resources/report_service_descriptor_config.php create mode 100644 AdsAdManager/src/V1/resources/report_service_rest_client_config.php create mode 100644 AdsAdManager/src/V1/resources/role_service_client_config.json create mode 100644 AdsAdManager/src/V1/resources/role_service_descriptor_config.php create mode 100644 AdsAdManager/src/V1/resources/role_service_rest_client_config.php create mode 100644 AdsAdManager/src/V1/resources/taxonomy_category_service_client_config.json create mode 100644 AdsAdManager/src/V1/resources/taxonomy_category_service_descriptor_config.php create mode 100644 AdsAdManager/src/V1/resources/taxonomy_category_service_rest_client_config.php create mode 100644 AdsAdManager/src/V1/resources/user_service_client_config.json create mode 100644 AdsAdManager/src/V1/resources/user_service_descriptor_config.php create mode 100644 AdsAdManager/src/V1/resources/user_service_rest_client_config.php create mode 100644 AdsAdManager/tests/Unit/V1/Client/AdUnitServiceClientTest.php create mode 100644 AdsAdManager/tests/Unit/V1/Client/CompanyServiceClientTest.php create mode 100644 AdsAdManager/tests/Unit/V1/Client/CustomFieldServiceClientTest.php create mode 100644 AdsAdManager/tests/Unit/V1/Client/CustomTargetingKeyServiceClientTest.php create mode 100644 AdsAdManager/tests/Unit/V1/Client/CustomTargetingValueServiceClientTest.php create mode 100644 AdsAdManager/tests/Unit/V1/Client/EntitySignalsMappingServiceClientTest.php create mode 100644 AdsAdManager/tests/Unit/V1/Client/NetworkServiceClientTest.php create mode 100644 AdsAdManager/tests/Unit/V1/Client/OrderServiceClientTest.php create mode 100644 AdsAdManager/tests/Unit/V1/Client/PlacementServiceClientTest.php create mode 100644 AdsAdManager/tests/Unit/V1/Client/ReportServiceClientTest.php create mode 100644 AdsAdManager/tests/Unit/V1/Client/RoleServiceClientTest.php create mode 100644 AdsAdManager/tests/Unit/V1/Client/TaxonomyCategoryServiceClientTest.php create mode 100644 AdsAdManager/tests/Unit/V1/Client/UserServiceClientTest.php diff --git a/.repo-metadata-full.json b/.repo-metadata-full.json index 14057a6a5f24..98e0ec780eb1 100644 --- a/.repo-metadata-full.json +++ b/.repo-metadata-full.json @@ -15,6 +15,14 @@ "library_type": "GAPIC_AUTO", "api_shortname": "accesscontextmanager" }, + "AdsAdManager": { + "language": "php", + "distribution_name": "googleads/ad-manager", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/googleads/ad-manager/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "admanager" + }, "AdsMarketingPlatformAdmin": { "language": "php", "distribution_name": "google/ads-marketingplatform-admin", diff --git a/AdsAdManager/.OwlBot.yaml b/AdsAdManager/.OwlBot.yaml new file mode 100644 index 000000000000..bb14e9bf83e7 --- /dev/null +++ b/AdsAdManager/.OwlBot.yaml @@ -0,0 +1,4 @@ +deep-copy-regex: + - source: /google/ads/admanager/(v1)/.*-php/(.*) + dest: /owl-bot-staging/AdsAdManager/$1/$2 +api-name: AdsAdManager diff --git a/AdsAdManager/.gitattributes b/AdsAdManager/.gitattributes new file mode 100644 index 000000000000..4bf0fe6f415b --- /dev/null +++ b/AdsAdManager/.gitattributes @@ -0,0 +1,7 @@ +/*.xml.dist export-ignore +/.OwlBot.yaml export-ignore +/.github export-ignore +/owlbot.py export-ignore +/src/**/gapic_metadata.json export-ignore +/samples export-ignore +/tests export-ignore diff --git a/AdsAdManager/.github/pull_request_template.md b/AdsAdManager/.github/pull_request_template.md new file mode 100644 index 000000000000..183b69e825e8 --- /dev/null +++ b/AdsAdManager/.github/pull_request_template.md @@ -0,0 +1,24 @@ +**PLEASE READ THIS ENTIRE MESSAGE** + +Hello, and thank you for your contribution! Please note that this repository is +a read-only split of `googleapis/google-cloud-php`. As such, we are +unable to accept pull requests to this repository. + +We welcome your pull request and would be happy to consider it for inclusion in +our library if you follow these steps: + +* Clone the parent client library repository: + +```sh +$ git clone git@github.com:googleapis/google-cloud-php.git +``` + +* Move your changes into the correct location in that library. Library code +belongs in `AdsAdManager/src`, and tests in `AdsAdManager/tests`. + +* Push the changes in a new branch to a fork, and open a new pull request +[here](https://github.com/googleapis/google-cloud-php). + +Thanks again, and we look forward to seeing your proposed change! + +The Google Cloud PHP team diff --git a/AdsAdManager/CONTRIBUTING.md b/AdsAdManager/CONTRIBUTING.md new file mode 100644 index 000000000000..76ea811cacdb --- /dev/null +++ b/AdsAdManager/CONTRIBUTING.md @@ -0,0 +1,10 @@ +# How to Contribute + +We'd love to accept your patches and contributions to this project. We accept +and review pull requests against the main +[Google Cloud PHP](https://github.com/googleapis/google-cloud-php) +repository, which contains all of our client libraries. You will also need to +sign a Contributor License Agreement. For more details about how to contribute, +see the +[CONTRIBUTING.md](https://github.com/googleapis/google-cloud-php/blob/main/CONTRIBUTING.md) +file in the main Google Cloud PHP repository. diff --git a/AdsAdManager/LICENSE b/AdsAdManager/LICENSE new file mode 100644 index 000000000000..8f71f43fee3f --- /dev/null +++ b/AdsAdManager/LICENSE @@ -0,0 +1,202 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + diff --git a/AdsAdManager/README.md b/AdsAdManager/README.md new file mode 100644 index 000000000000..1840ee564ef2 --- /dev/null +++ b/AdsAdManager/README.md @@ -0,0 +1,45 @@ +# Google Ads Ad Manager for PHP + +> Idiomatic PHP client for [Google Ads Ad Manager](https://developers.google.com/ad-manager). + +[![Latest Stable Version](https://poser.pugx.org/googleads/ad-manager/v/stable)](https://packagist.org/packages/googleads/ad-manager) [![Packagist](https://img.shields.io/packagist/dm/googleads/ad-manager.svg)](https://packagist.org/packages/googleads/ad-manager) + +* [API documentation](https://cloud.google.com/php/docs/reference/googleads/ad-manager/latest) + +**NOTE:** This repository is part of [Google Cloud PHP](https://github.com/googleapis/google-cloud-php). Any +support requests, bug reports, or development contributions should be directed to +that project. + +### Installation + +To begin, install the preferred dependency manager for PHP, [Composer](https://getcomposer.org/). + +Now, install this component: + +```sh +$ composer require googleads/ad-manager +``` + +> Browse the complete list of [Google Cloud APIs](https://cloud.google.com/php/docs/reference) +> for PHP + +This component supports both REST over HTTP/1.1 and gRPC. In order to take advantage of the benefits +offered by gRPC (such as streaming methods) please see our +[gRPC installation guide](https://cloud.google.com/php/grpc). + +### Authentication + +Please see our [Authentication guide](https://github.com/googleapis/google-cloud-php/blob/main/AUTHENTICATION.md) for more information +on authenticating your client. Once authenticated, you'll be ready to start making requests. + +### Sample + +See the [samples directory](https://github.com/googleapis/php-ads-ad-manager/tree/main/samples) for a canonical list of samples. + +### Version + +This component is considered alpha. As such, it is still a work-in-progress and is more likely to get backwards-incompatible updates. + +### Next Steps + +1. Understand the [official documentation](https://developers.google.com/ad-manager/api/beta). diff --git a/AdsAdManager/VERSION b/AdsAdManager/VERSION new file mode 100644 index 000000000000..77d6f4ca2371 --- /dev/null +++ b/AdsAdManager/VERSION @@ -0,0 +1 @@ +0.0.0 diff --git a/AdsAdManager/composer.json b/AdsAdManager/composer.json new file mode 100644 index 000000000000..7f03e4f66aee --- /dev/null +++ b/AdsAdManager/composer.json @@ -0,0 +1,30 @@ +{ + "name": "googleads/ad-manager", + "description": "Google Ads Ad Manager Client for PHP", + "license": "Apache-2.0", + "minimum-stability": "stable", + "autoload": { + "psr-4": { + "Google\\Ads\\AdManager\\": "src", + "GPBMetadata\\Google\\Ads\\Admanager\\": "metadata" + } + }, + "extra": { + "component": { + "id": "googleads/ad-manager", + "path": "AdsAdManager", + "target": "googleapis/php-ads-ad-manager" + } + }, + "require": { + "php": "^8.0", + "google/gax": "^1.34.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "suggest": { + "ext-grpc": "Enables use of gRPC, a universal high-performance RPC framework created by Google.", + "ext-protobuf": "Provides a significant increase in throughput over the pure PHP protobuf implementation. See https://cloud.google.com/php/grpc for installation instructions." + } +} diff --git a/AdsAdManager/metadata/V1/AdUnitEnums.php b/AdsAdManager/metadata/V1/AdUnitEnums.php new file mode 100644 index 0000000000000000000000000000000000000000..25564e2ab81ea80be3ee8d322809208f757197eb GIT binary patch literal 1115 zcmb7D+iuf95T$8>G76H(O9d6MluAtnIEr{nDd5CzupoAnIH{;Ctc|^KjU3xruZsZn zdyshIJNPQbmqux;K459>-Ptp9#xrx?yh~0Kcux8(Vw?)*k=b`5P8msfEMhkf$t;`C z87FSMNP>`YnGn?^hG`K^)vagfn#LJ-S%>&>?1!vHy%g7iM$~7#b=Jm%lSP4WSd=YN zxrhr8(FIEr>N3(Fb_YyQj|yt{ix9TrrMRjP_OyKf;D$6!iQ-K#l9mU8pFr?QvRN3o zBo$QPXE#Wl01*KVgCF=Whh$E}l%fB1>^zHH5yTP69n8pO&3#hF%(1&kjQ@T}E>ari z<-k(ddL$T+XlSb}b$O78m=6)!>G(`6ip=1Np4I^A)7B z{9~+jmgY^^nL>Tl)_4Ms6xEp+y5)>5#hQ$9KOSm5{YckT=~e^aj?%OAsV1#8>aeLB z)v1=Blu_>kUa8XhP6`jk3(Cb9yEuqFR*-#x`s@fI0P1rC@ zBPWxfUP8NyVQ3?%mRr=%hBDB5g*%c?K(Z*uHXa9&7k?`_6{xS;8js02vNhS^xk5 literal 0 HcmV?d00001 diff --git a/AdsAdManager/metadata/V1/AdUnitMessages.php b/AdsAdManager/metadata/V1/AdUnitMessages.php new file mode 100644 index 0000000000000000000000000000000000000000..0bd0922863bd0edb97dcc929d8e27ae578ea6ef9 GIT binary patch literal 3739 zcmbtX-Ez}L6t1HrkaY+}ltu}KEa5Mq!EQ|HbPP1L8%UXwCes9%q3)<_X>IRRmQ?LJ zkTSXK3^RR+Uh^ou=riQHkH8gYeO6`#XnP-;(> z?;zv_gmYZ+9|PFB!9p()hM%}o515C!AOikeVccb4#7MyYfD_%r4H9q)5QDajPUs01 zg;*}w2tB&6h&86Py%I+dfqOXhYEuRU0#bVz3Yvr@sI5}&B`g+EvI(Z;a+8WIlyYQY z(QGT>SOYI;AIs$dC+}gAbm+m|F;1xHB;g(9w*=VB-fBmP83a(q>VDX1^K!X+z%Jg= zP~tdX)PF?k6b|^_F!#e9mPBEjhGKg+rqZhqKzoqT-#aw)cE2O>2f%CrL5{IJX0->5 z27Z;c$PSB=<1PJ(no>D(5Hr55cAz+crbpi}Te{7l%mir<36rAu&2N|?bj9~G{yuv^PxbRac&?fr{!Yy)-Yq*<&`UdSS|%- znMFf)Xr%OUJrWz^`C&V7Ac?V=OKoCSY)B@!bwdSXFmu2lG5I!A7tNHCKM;|kZ<5-F zoz06hbJ}43uSqnnOWHnzMx}f@Ih~QB43{I84I%LN!Wh|w|xS$8L z3(wFwVu&S30z&ORXQ3ZGca{#p-d5I6m9fG;I3Tfewu`1Iv`J_sJJjt(zxhGv{-am9 zoP7<=bkEjrd_Fa{%D?_s`Q>owTnwpr9woo=;!E@9N}1b(?_&9N2E&HedpAy)q0+d1 zsm>zD9pd%;zd3}o&dQ_PU!YMLG1U?Br3=G@1x7L=Blgeecj)SOe8d&{ z#x(dce6PcefrOwOTC5IpYW~k0n$!ointernalAddGeneratedFile( + ' + +-google/ads/admanager/v1/ad_unit_service.protogoogle.ads.admanager.v1google/api/annotations.protogoogle/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto"I +GetAdUnitRequest5 +name ( B\'AA! +admanager.googleapis.com/AdUnit" +ListAdUnitsRequest8 +parent ( B(AA" + admanager.googleapis.com/Network + page_size (BA + +page_token ( BA +filter ( BA +order_by ( BA +skip (BA"u +ListAdUnitsResponse1 +ad_units ( 2.google.ads.admanager.v1.AdUnit +next_page_token (  + +total_size (" +ListAdUnitSizesRequest8 +parent ( B(AA" + admanager.googleapis.com/Network + page_size (BA + +page_token ( BA +filter ( BA +order_by ( BA +skip (BA" +ListAdUnitSizesResponse: + ad_unit_sizes ( 2#.google.ads.admanager.v1.AdUnitSize +next_page_token (  + +total_size (2 + AdUnitService + GetAdUnit).google.ads.admanager.v1.GetAdUnitRequest.google.ads.admanager.v1.AdUnit".Aname!/v1/{name=networks/*/adUnits/*} + ListAdUnits+.google.ads.admanager.v1.ListAdUnitsRequest,.google.ads.admanager.v1.ListAdUnitsResponse"0Aparent!/v1/{parent=networks/*}/adUnits +ListAdUnitSizes/.google.ads.admanager.v1.ListAdUnitSizesRequest0.google.ads.admanager.v1.ListAdUnitSizesResponse"4Aparent%#/v1/{parent=networks/*}/adUnitSizesAadmanager.googleapis.comB +com.google.ads.admanager.v1BAdUnitServiceProtoPZ@google.golang.org/genproto/googleapis/ads/admanager/v1;admanagerGoogle.Ads.AdManager.V1Google\\Ads\\AdManager\\V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/AdsAdManager/metadata/V1/AdmanagerError.php b/AdsAdManager/metadata/V1/AdmanagerError.php new file mode 100644 index 000000000000..8fc32636626a --- /dev/null +++ b/AdsAdManager/metadata/V1/AdmanagerError.php @@ -0,0 +1,37 @@ +internalAddGeneratedFile( + ' + +-google/ads/admanager/v1/admanager_error.protogoogle.ads.admanager.v1" +AdManagerError + +error_code (  +message (  + +field_path (  +trigger (  + stack_trace ( % +details ( 2.google.protobuf.AnyB +com.google.ads.admanager.v1BAdManagerErrorProtoPZ@google.golang.org/genproto/googleapis/ads/admanager/v1;admanagerGoogle.Ads.AdManager.V1Google\\Ads\\AdManager\\V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/AdsAdManager/metadata/V1/AppliedLabel.php b/AdsAdManager/metadata/V1/AppliedLabel.php new file mode 100644 index 000000000000..ccf44e94926e --- /dev/null +++ b/AdsAdManager/metadata/V1/AppliedLabel.php @@ -0,0 +1,33 @@ +internalAddGeneratedFile( + ' + ++google/ads/admanager/v1/applied_label.protogoogle.ads.admanager.v1google/api/resource.proto"V + AppliedLabel5 +label ( B&AA +admanager.googleapis.com/Label +negated (B +com.google.ads.admanager.v1BAppliedLabelProtoPZ@google.golang.org/genproto/googleapis/ads/admanager/v1;admanagerGoogle.Ads.AdManager.V1Google\\Ads\\AdManager\\V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/AdsAdManager/metadata/V1/CompanyCreditStatusEnum.php b/AdsAdManager/metadata/V1/CompanyCreditStatusEnum.php new file mode 100644 index 0000000000000000000000000000000000000000..da04aa2a013a71883c545d76bcf1d64ff1c9f7c5 GIT binary patch literal 1005 zcmbVLO>fgc5G8FX)xse%haBi(TZ)=W;3(pPk_JeeG*~pTMcharOV-BTxGOok)_Ps3 zMfn;02)Obu_*Lw#U8|_g1xw?vnR)X(@A>pYdYOWkaEvMDNZ<%AuA#WZFy&0JkR@=D zFPE6ZkgZaZU~WPp^5{oVHTFy@*Q^Rv+cEgL4c`5)WJaUtG^N-w zN^#7q_Ti5jXlxMX@CH18AZ5G)2bME&`_r$1^+lN~n0bBgVisIXXYRT7e zw{Lm&d{nO)&%mBNEuXfGr{IY*4L&*N!}_+d2X%qBWeU{yi2fu6Jg*2kM zf%jnl0cOfgT3)yI?PJ*(vjoxDWIS%gm}>vFiWEwTGXB5j?^etCwbdAFLz~jjGA6|j rV$R!tZZp32x;&LRU%Gv24gEBl)Tht)U-aKcRh4Ekgf<5!1}?wa3B`}d1~Ct*(oEyeL#_gzaLrlFf5MP<>5#<=5aYb;FiS$s(}Ws@qa=jJ6Ix&z z*@q&<6ztN{tz(lF%!vOY(I68R`}?3m$%RhkF^aa^Bha&48cO4dHEZDbkTwb*+wF5s z?our?ShP;51f9ubC->U`oX+0-DT z(X0&)aBdp2!kIEYCV$q5cfEmeHVb(V2MixO8s5qF)~A;Ng?Zru(|MT+083ZQ;8yc8 zO^pRwRJd0v2;Ll;G6Vx#2a9-jK|tDMTUM!?k3Y^(QK~n(&L*w^yGnTEE+M087**#kxfO9GVm1wOoocDGaswue$L`9Uwn3^x_R3wIQ&38b(*)d`bDB%) z@TyoL0Y+1sbI=loIe|pGWKR8_ti4f1w~oB^*8XJ?ot@b-vPHUyu;O&dIxE&i5Sx9W z+*`ETsJ9+nXku}@6c`8Owvc?nsit~)DmA+_T6XmX>E4A*U9OWK)??RM5N;^+UJrj6LATS-~-bN4Vt*tVQvi-c- zKo?!~fV`u}TtV17 zIUvItIQ^hjydkk=DsOIO*C89hnM`(ntB`k*U&e8E4Rr79y?Gk*&2?P)?u#PRs28(j zGfVQXOPjs?Dtma9@i{DRyZ3VY_mbo12OGaE&&QKJSjlaC a@_4rTJ}NHU!a=<780M12nK~t>g!}{Q3D=$g literal 0 HcmV?d00001 diff --git a/AdsAdManager/metadata/V1/CompanyService.php b/AdsAdManager/metadata/V1/CompanyService.php new file mode 100644 index 000000000000..f8993ba708f7 --- /dev/null +++ b/AdsAdManager/metadata/V1/CompanyService.php @@ -0,0 +1,53 @@ +internalAddGeneratedFile( + ' + +-google/ads/admanager/v1/company_service.protogoogle.ads.admanager.v1google/api/annotations.protogoogle/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto"K +GetCompanyRequest6 +name ( B(AA" + admanager.googleapis.com/Company" +ListCompaniesRequest8 +parent ( B(AA" + admanager.googleapis.com/Network + page_size (BA + +page_token ( BA +filter ( BA +order_by ( BA +skip (BA"y +ListCompaniesResponse3 + companies ( 2 .google.ads.admanager.v1.Company +next_page_token (  + +total_size (2 +CompanyService + +GetCompany*.google.ads.admanager.v1.GetCompanyRequest .google.ads.admanager.v1.Company"0Aname#!/v1/{name=networks/*/companies/*} + ListCompanies-.google.ads.admanager.v1.ListCompaniesRequest..google.ads.admanager.v1.ListCompaniesResponse"2Aparent#!/v1/{parent=networks/*}/companiesAadmanager.googleapis.comB +com.google.ads.admanager.v1BCompanyServiceProtoPZ@google.golang.org/genproto/googleapis/ads/admanager/v1;admanagerGoogle.Ads.AdManager.V1Google\\Ads\\AdManager\\V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/AdsAdManager/metadata/V1/CompanyTypeEnum.php b/AdsAdManager/metadata/V1/CompanyTypeEnum.php new file mode 100644 index 0000000000000000000000000000000000000000..b212272e79bdb310cf674b2b5515e836552396a7 GIT binary patch literal 968 zcmb7CU5nE|6t%m$52I)Z3oGcubzRslXiC|))~fx;)*@{}o2^s=VVX>{1L;hdOctsX z|AXM4(0}5ua`LgEy6l62n+bRBJ@@3E^X6TA6{D9hB#a0wNdU_Y$SVS|;F9}1f@Qi| z5dl75$220s02o*>u^cc5Bj<%`O?WDN(t?olFd_{cBr4XJ;gE>Nb+eImVz%+*CMF(X z>DtJ#5n^~vk{J60hIVgEBo45|?l6aOyFsF&gmLH1HbQ=clLYz&oTJc81%|#NP*0pL zBkDsUu~f$iO+3n|q&T8q)IW7#g`UiMiTA2X1KD z*;>>}+!2#RFdVr9lK6tgk_%gvwpt;P)iSe8{j40D!O<1e3y!VUEs`COA|<=i0R)k$ zVC|fD2C%KZa%QjJ(vn9v2&%CcN~n5On6;gvAN#2Bp9<+mMT4OvRZ(hTTsM!u*U*!H zbU6No9`2;{=jdtQ8r$8;!gCh3>0M4{w%H$DjLd;{Pk)S1cQ7}n&S+*%wVHm2v=7$h z%=C7$dpbe~-Jv<@FSLDKLyyXeB6GjM@Fu47$(nxD9`t_I&@<&V;||ij!yS5=b8;!| z+UNIWL&zh{LW7I25fYYrwA>huY3Av_eci4$@^kNKn48v6rd2U6yl>2#zi)2b+|TM& g-nq)r%Y%Hz`DvxptHJ;~e!0^td1YaXE!raV2NuLLz5oCK literal 0 HcmV?d00001 diff --git a/AdsAdManager/metadata/V1/ContactMessages.php b/AdsAdManager/metadata/V1/ContactMessages.php new file mode 100644 index 000000000000..54aed933eb50 --- /dev/null +++ b/AdsAdManager/metadata/V1/ContactMessages.php @@ -0,0 +1,34 @@ +internalAddGeneratedFile( + ' + +.google/ads/admanager/v1/contact_messages.protogoogle.ads.admanager.v1google/api/resource.proto" +Contact +name ( BA + +contact_id (BA:dAa + admanager.googleapis.com/Contact*networks/{network_code}/contacts/{contact}*contacts2contactB +com.google.ads.admanager.v1BContactMessagesProtoPZ@google.golang.org/genproto/googleapis/ads/admanager/v1;admanagerGoogle.Ads.AdManager.V1Google\\Ads\\AdManager\\V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/AdsAdManager/metadata/V1/CustomFieldEnums.php b/AdsAdManager/metadata/V1/CustomFieldEnums.php new file mode 100644 index 0000000000000000000000000000000000000000..8ea7ee7cff7c1fe1f4092de4a6a1d6a92713b505 GIT binary patch literal 1388 zcmb7E%Wl&^6eXpt=m?}>1QlYzkXAI6z#(FnQoxDbU@5V!*bOR*WKEojJHoLodt9lY zZrQNlKM-vB2)>FtcACaYyTH;oGrq5rbLQSR@8Z)K?cgpAX+k)i;PE-;rxeFY#3L^X z@Hm@JX@b3I7PEjRGRCTj4b#DzsyojhG>x*vqb=-5ksr_onWV60BqTmf8fVRhm!&+K zxl=}iiA%$5mdbf@ghDc-X-qtdyH>kTIhhbnM%_HmNSUOt=6OcL<^e)pK++U<@_a`k zohGuOuL#2vXXAi*IOT-H&n`<{7BbFAz`nr0I>b{Fq!f~@`cAXZ<17lX2rxsB*7tFd zQ~2)25wLKGFL7Cd7$9Y&hnyxM2}UYSy@bU)N-S_~wS3AKbc!$a{drlDj!kjBz}RZ7 zfIP%J$>?%*j1$VUBs|D*iv$;oU5@PKTQVGwowu=ZE zRE0HHLq2QPzE{xpk`gK?=bXn>C{l~jgKJFEb5!db+m6|Hk94i4x~k$Ru5)5(?y+H8 zT1SV^YW0?c(5CGSbfa6Xh`n*#Z)=0U!;W1wCFW zsfC>J^97zC74-00t5iq3B}kg#=+4P?prBw+H#Apwv_9b4LL25l&0*a|cRB-2arB`8 z1}6)EnYPlau1k-Qba`^G!Z&K4OMq;+vss!`H$eB7kQN4M2R$vJv>nAcwpUqGIys1n z0HGW6(^~CYnVca@*_Z`DP+pOhpj;WH(H`0ub z^iDuCKqBUZ(iW<33@wkHmmaK{XD{t0uuUil=uywhWQw26ebcg zF?Y(d=U{PVf39tJ^SL6!T!Gau=94^Z{=Kw}@{t3txorePXS|u$c)hpir58nuE_L*c O-JE+CjeCJE5c&tBldFFK literal 0 HcmV?d00001 diff --git a/AdsAdManager/metadata/V1/CustomFieldMessages.php b/AdsAdManager/metadata/V1/CustomFieldMessages.php new file mode 100644 index 000000000000..6e2776c20d37 --- /dev/null +++ b/AdsAdManager/metadata/V1/CustomFieldMessages.php @@ -0,0 +1,46 @@ +internalAddGeneratedFile( + ' + +3google/ads/admanager/v1/custom_field_messages.protogoogle.ads.admanager.v1google/api/field_behavior.protogoogle/api/resource.proto" + CustomField +name ( BA +custom_field_id (BA + display_name ( BA + description ( BAU +status (2@.google.ads.admanager.v1.CustomFieldStatusEnum.CustomFieldStatusBAb + entity_type (2H.google.ads.admanager.v1.CustomFieldEntityTypeEnum.CustomFieldEntityTypeBA\\ + data_type (2D.google.ads.admanager.v1.CustomFieldDataTypeEnum.CustomFieldDataTypeBAa + +visibility (2H.google.ads.admanager.v1.CustomFieldVisibilityEnum.CustomFieldVisibilityBA@ +options + ( 2*.google.ads.admanager.v1.CustomFieldOptionBA:yAv +$admanager.googleapis.com/CustomField3networks/{network_code}/customFields/{custom_field}* customFields2 customField"S +CustomFieldOption# +custom_field_option_id (BA + display_name ( BAB +com.google.ads.admanager.v1BCustomFieldMessagesProtoPZ@google.golang.org/genproto/googleapis/ads/admanager/v1;admanagerGoogle.Ads.AdManager.V1Google\\Ads\\AdManager\\V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/AdsAdManager/metadata/V1/CustomFieldService.php b/AdsAdManager/metadata/V1/CustomFieldService.php new file mode 100644 index 000000000000..6960a5365982 --- /dev/null +++ b/AdsAdManager/metadata/V1/CustomFieldService.php @@ -0,0 +1,52 @@ +internalAddGeneratedFile( + ' + +2google/ads/admanager/v1/custom_field_service.protogoogle.ads.admanager.v1google/api/annotations.protogoogle/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto"S +GetCustomFieldRequest: +name ( B,AA& +$admanager.googleapis.com/CustomField" +ListCustomFieldsRequest8 +parent ( B(AA" + admanager.googleapis.com/Network + page_size (BA + +page_token ( BA +filter ( BA +order_by ( BA +skip (BA" +ListCustomFieldsResponse; + custom_fields ( 2$.google.ads.admanager.v1.CustomField +next_page_token (  + +total_size (2 +CustomFieldService +GetCustomField..google.ads.admanager.v1.GetCustomFieldRequest$.google.ads.admanager.v1.CustomField"3Aname&$/v1/{name=networks/*/customFields/*} +ListCustomFields0.google.ads.admanager.v1.ListCustomFieldsRequest1.google.ads.admanager.v1.ListCustomFieldsResponse"5Aparent&$/v1/{parent=networks/*}/customFieldsAadmanager.googleapis.comB +com.google.ads.admanager.v1BCustomFieldServiceProtoPZ@google.golang.org/genproto/googleapis/ads/admanager/v1;admanagerGoogle.Ads.AdManager.V1Google\\Ads\\AdManager\\V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/AdsAdManager/metadata/V1/CustomFieldValue.php b/AdsAdManager/metadata/V1/CustomFieldValue.php new file mode 100644 index 0000000000000000000000000000000000000000..6111d1bcb16167ba6a319594a129860857036bc1 GIT binary patch literal 1252 zcmb7E-EPw`6mHsWY-U2J5^Rhc0~PC}kx;nH7|>AG?qak;(=Mh+m7AQVmQp*iogzTJ z=P7sq#53>!JO$6e6^@hsXj?Cc zB11!85!P3d4q_T$sff~#8kK#@sG=mMUvyW;ct~Oi8sz%fVaftUIm1~(mjzHiz&U1i zww7=`g=0M9)yoE>hvJ_y1%i>-Z-ER1O%xYBebjX$Q1fwSk@`VVHiM%>T+cbW?lqFf zScw#tt79xcrGgz9-WkAj{^s8_wS@X+G#-q|gmU4!i>?+Rt5QEg@ilMEGNX9*nih>W z!*Jf`iPlDa&Mf1(kAAJ8=l?5;>Q0_vYZ>WPe13b<*n2R8N~j|Wnz@i3e=noES5;B< z(Dt(Ob}ekxx4gqY&GO&oQ&d}E=eQ)H($*q(mVl}qv~C2uTh__9UpV#(a`sY^(WGte zUPV{yl)hQko@y$-jyH$|(Hql1D<^8nKL*3gd`rf^({Ef(a*5%ux;fTkCMK%|a69F^! zbry5G=J})fbbpk0+Q!ee_Oo7R`G3K_X#Ae-_{Qq`R_yuO?1K$c94e ze~sW*|A3$URo=WTY_|Ji;WjVloacFR&wb9j5AjJ1Ptk~mlo3v6Xu3rFgrb;5JaVG| zP1E_DGUP^!*bgX^5gO`9(=CLDs`W&aCQ-^<+C^Rzc>!&cSt8bggv6t)ecEZeX~Lt0 z!wK^!_e0P5LYEE=(?ufZBmf~<&?F`rkug)ly0Z9@x z$Z@R;*aN!687O=MBz|!^4SW|RoN#g3_7leseeRRM|0+ImAI(XSP=U3YJ5NKG`%#Fp z0zGtTYZn!mS?+cmiA~u@7xIj3pTr*7YRD-INnj6Y;xa$x5i>+;w=2H7+TH9;YqzA$ z;QTpi6&kzU6_NXhvy@(DM~G3LvT!fgodKLxce%2c@BLCoZ#JuF716m?m6(<7!0(&z z_J3O@Z55TWXtr2obL7)b^Lq^*uQp~Px{xMWdzu6uTo;#~gS|62oLKtUv3lkRTdFp4 z4)C!vv3l0w#5vR^1|F!2iieFG62N9}V5vvAQIqb#ZB;9u>dkX_xXNKIV_GV>zdkDM z!n3vX*0F*AA-@Y?n0Sa4RTE-z0g8#SqMPGJz4@aC+p8QVjU&d%G@zB1b69hXujWZ_ z;MH1HCN^}_>h(WiXN|yHu%Ro8P__wmU2D{(d(bFhhUyq=6IHz3=>Mw0BVld%ntt}z zG&6Tue(a6f=Z|Hf7X>8rnCEVWBfP1NaNMTAr-{ literal 0 HcmV?d00001 diff --git a/AdsAdManager/metadata/V1/CustomTargetingKeyMessages.php b/AdsAdManager/metadata/V1/CustomTargetingKeyMessages.php new file mode 100644 index 000000000000..d8f35616f16f --- /dev/null +++ b/AdsAdManager/metadata/V1/CustomTargetingKeyMessages.php @@ -0,0 +1,39 @@ +internalAddGeneratedFile( + ' + +;google/ads/admanager/v1/custom_targeting_key_messages.protogoogle.ads.admanager.v1google/api/field_behavior.protogoogle/api/resource.proto" +CustomTargetingKey +name ( BA$ +custom_targeting_key_id (BA + ad_tag_name ( BA + display_name ( BA] +type (2J.google.ads.admanager.v1.CustomTargetingKeyTypeEnum.CustomTargetingKeyTypeBAc +status (2N.google.ads.admanager.v1.CustomTargetingKeyStatusEnum.CustomTargetingKeyStatusBA| +reportable_type (2^.google.ads.admanager.v1.CustomTargetingKeyReportableTypeEnum.CustomTargetingKeyReportableTypeBA:A ++admanager.googleapis.com/CustomTargetingKeyBnetworks/{network_code}/customTargetingKeys/{custom_targeting_key}*customTargetingKeys2customTargetingKeyB +com.google.ads.admanager.v1BCustomTargetingKeyMessagesProtoPZ@google.golang.org/genproto/googleapis/ads/admanager/v1;admanagerGoogle.Ads.AdManager.V1Google\\Ads\\AdManager\\V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/AdsAdManager/metadata/V1/CustomTargetingKeyService.php b/AdsAdManager/metadata/V1/CustomTargetingKeyService.php new file mode 100644 index 000000000000..c8b81f388c75 --- /dev/null +++ b/AdsAdManager/metadata/V1/CustomTargetingKeyService.php @@ -0,0 +1,53 @@ +internalAddGeneratedFile( + ' + + +:google/ads/admanager/v1/custom_targeting_key_service.protogoogle.ads.admanager.v1google/api/annotations.protogoogle/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto"a +GetCustomTargetingKeyRequestA +name ( B3AA- ++admanager.googleapis.com/CustomTargetingKey" +ListCustomTargetingKeysRequest8 +parent ( B(AA" + admanager.googleapis.com/Network + page_size (BA + +page_token ( BA +filter ( BA +order_by ( BA +skip (BA" +ListCustomTargetingKeysResponseJ +custom_targeting_keys ( 2+.google.ads.admanager.v1.CustomTargetingKey +next_page_token (  + +total_size (2 +CustomTargetingKeyService +GetCustomTargetingKey5.google.ads.admanager.v1.GetCustomTargetingKeyRequest+.google.ads.admanager.v1.CustomTargetingKey":Aname-+/v1/{name=networks/*/customTargetingKeys/*} +ListCustomTargetingKeys7.google.ads.admanager.v1.ListCustomTargetingKeysRequest8.google.ads.admanager.v1.ListCustomTargetingKeysResponse"kNs+b1ZQ%Fo=OY&(targK6sofGELP z2D=6s-2hKDuA^bWX8_fc=Cg!GFq2rS&pypU%BZ9`p`X-6PvHV58Bu6=eHS^4B;^e1 zfH8|m;}8~@+IK(YsxYVUhM=cwrRo&8OcKFx67)zG37SeSJmuPMtDCPXtWO$;Wm*kK z7qC%qY`5=_JcUx^haG@lo1p#w zZL94Tv6gDNT4jT*%U1nM1w6m6Ilk&dp6M3V33#&Jqjm%iyAvOchas}h1`cvZgK%oU zpE#k9Y&7x1$;kJduG@E=UiCo@fNi^r+^JKo)ONrlcU1mu)PGdK-hFw7SVkA5fOpc1M17yYsyQo+=GmYf9d^x86n!W;(sf$G2r@%oEIFi;K7! z6J`Y1EKE41TDyPh_hi-CZyUPinternalAddGeneratedFile( + ' + +=google/ads/admanager/v1/custom_targeting_value_messages.protogoogle.ads.admanager.v1google/api/field_behavior.protogoogle/api/resource.proto" +CustomTargetingValue +name ( BA + ad_tag_name ( BA + display_name ( BAt + +match_type (2X.google.ads.admanager.v1.CustomTargetingValueMatchTypeEnum.CustomTargetingValueMatchTypeBAAg +status (2R.google.ads.admanager.v1.CustomTargetingValueStatusEnum.CustomTargetingValueStatusBA:A +-admanager.googleapis.com/CustomTargetingValueqnetworks/{network_code}/customTargetingKeys/{custom_targeting_key}/customTargetingValues/{custom_targeting_value}*customTargetingValues2customTargetingValueB +com.google.ads.admanager.v1B!CustomTargetingValueMessagesProtoPZ@google.golang.org/genproto/googleapis/ads/admanager/v1;admanagerGoogle.Ads.AdManager.V1Google\\Ads\\AdManager\\V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/AdsAdManager/metadata/V1/CustomTargetingValueService.php b/AdsAdManager/metadata/V1/CustomTargetingValueService.php new file mode 100644 index 000000000000..8de715a70ffa --- /dev/null +++ b/AdsAdManager/metadata/V1/CustomTargetingValueService.php @@ -0,0 +1,53 @@ +internalAddGeneratedFile( + ' + + +dSu2BTyElho|(_=@~sbJUQDyS1l9egF{0p!w75^Xk2|JSP04<)NBxj zo1v$9C|IPuK8s^6Laz^6BSc%-NrVW7J2CTtwmQu=7#1+Y+*U^FHUf>SAa&1c2ZZ<$ z)0!S-TC6WdFKZ@3gR zbvPA1RCj64nPRtNiRG!&s~9_J#jslLi7=orSN9OKuXt>v>LAo{LNMbxr#sc%;@Fgq z_h>bb(Q$4BS*J!NaQ$>j6_`YcgDmcpU^ISnr&TcK?lFfbXu<^>aH$+;lGTLdHrLls zT=P_~tQ7mtc#(J`2*!CHW7AZ}k)?6&kneM({$JfvS;^fkY&Kj)Us!|M{k1FJnA@s| zIq$H|Pi3++tz9Y)$UT+>9PolY4PhS}*5koynU<>Mmv<`bWYL$H8SZuy5k!z0XA9#N zS@RQZWZyGP;r*taJz!Cif#wR(BAHFQd$ok$cbny(jfKiXvWA4ybb;hEsb7jKS2oGA zVIQQB{h{ZhK0~R7c)nhpr{x?o<9sRoYJ4t{{YfG6BCwci3w3Kx&H7k?c`wyFZC@5| zo-YF!6?*+sQV5zJ?SZukrTcxl>pbAim~`^|49vW~G?w_Id%`4u7jHH8crM}Lrw6Y0f;e^4}&c~K@Ui)!nakJrre}&D(@zb5p a&UmsjZtT5Wpx5+#tCllluDB5y5%L?b9@+x{ literal 0 HcmV?d00001 diff --git a/AdsAdManager/metadata/V1/EntitySignalsMappingService.php b/AdsAdManager/metadata/V1/EntitySignalsMappingService.php new file mode 100644 index 000000000000..6bfe888da928 --- /dev/null +++ b/AdsAdManager/metadata/V1/EntitySignalsMappingService.php @@ -0,0 +1,73 @@ +internalAddGeneratedFile( + ' + +Aparent/-/v1/{parent=networks/*}/entitySignalsMappings +CreateEntitySignalsMapping:.google.ads.admanager.v1.CreateEntitySignalsMappingRequest-.google.ads.admanager.v1.EntitySignalsMapping"mAparent,entity_signals_mappingG"-/v1/{parent=networks/*}/entitySignalsMappings:entity_signals_mapping +UpdateEntitySignalsMapping:.google.ads.admanager.v1.UpdateEntitySignalsMappingRequest-.google.ads.admanager.v1.EntitySignalsMapping"A"entity_signals_mapping,update_mask^2D/v1/{entity_signals_mapping.name=networks/*/entitySignalsMappings/*}:entity_signals_mapping + BatchCreateEntitySignalsMappings@.google.ads.admanager.v1.BatchCreateEntitySignalsMappingsRequestA.google.ads.admanager.v1.BatchCreateEntitySignalsMappingsResponse"VAparent,requests>"9/v1/{parent=networks/*}/entitySignalsMappings:batchCreate:* + BatchUpdateEntitySignalsMappings@.google.ads.admanager.v1.BatchUpdateEntitySignalsMappingsRequestA.google.ads.admanager.v1.BatchUpdateEntitySignalsMappingsResponse"VAparent,requests>"9/v1/{parent=networks/*}/entitySignalsMappings:batchUpdate:*Aadmanager.googleapis.comB +com.google.ads.admanager.v1B EntitySignalsMappingServiceProtoPZ@google.golang.org/genproto/googleapis/ads/admanager/v1;admanagerGoogle.Ads.AdManager.V1Google\\Ads\\AdManager\\V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/AdsAdManager/metadata/V1/EnvironmentTypeEnum.php b/AdsAdManager/metadata/V1/EnvironmentTypeEnum.php new file mode 100644 index 0000000000000000000000000000000000000000..629c52c2bd780fefe81a5114bbe24805aaf1923a GIT binary patch literal 942 zcmbVKO>fgc5G6T)v>*|MLy_PxluAt{a1`~H5ZZ*ektGsaX$UH^WNqxRyOOhOt=EwX z${*sw|KRWN2Uvg9l$KtwG`2N6^XBcm_wFRQOvr1PB1cIT2C%*Yb%~Hjp@c7DSZ85~ z5`3{qSd7vDnAkA4mtan;J13-W16O5{()R-L{kHjZv^y{ zWb2sukSeP5=YXXi<4iFcv#BOmN5>Z0=*{2ujSn_8<{@7elzF z=H%bcf=5Q>8PRX&~ze92eN@jR-I)Fr# zNj@le=K#C2PD!`+0rh7LL`g>de)iT|X>l93R#?yeZ|q;f8yiP*j$p I@5qjj-+22pLjV8( literal 0 HcmV?d00001 diff --git a/AdsAdManager/metadata/V1/FrequencyCap.php b/AdsAdManager/metadata/V1/FrequencyCap.php new file mode 100644 index 0000000000000000000000000000000000000000..2d8f433f4630e14159d1944222723a5cb8318e43 GIT binary patch literal 1071 zcmb7D!EVz)5XFgv#1a+ArIFw;K&7Sv90hI;0cz5uJ(T1SdO((}jlFhPvUknyx}u=m z`4q%AaNx{Wv0gi_p^5~S)`>mi_vX#ad-*y$&(LF-5k>@7B!tx^sB;3D;ED%4fmI$w zL_omPj3z|b0Fybqn=j#La@Xm%Kgn|T13DXVKTb!XU2=tZZtAqw1 z6;}FZk4m31swhtAXDwz75l$r00M~P)oCS(<2E_++7Lfh{l$b^CUdFZfF>GpD6#dY> z@J^T_g5kuQ5E%%XDJ~W|)p25?>Mj;<`Ue$l0Y@X~mo+-hwIau$L{6IQ0D`Dou#u^| z09e=mynpDJx1=d~uXP=l5-e_b@fv{=zh&tu?nCfwaE zlWn~Y`c$*DFNTkPTBy^UWA_2Nlj2W4O*28H)B}+{3#@+o_{LYu>h{oWrM37t*!k*^R#(ZHx0*&{d%BJ%XMpP=hn?MndQ!`(Hf!O2Tohi literal 0 HcmV?d00001 diff --git a/AdsAdManager/metadata/V1/LabelMessages.php b/AdsAdManager/metadata/V1/LabelMessages.php new file mode 100644 index 000000000000..cff18e627525 --- /dev/null +++ b/AdsAdManager/metadata/V1/LabelMessages.php @@ -0,0 +1,32 @@ +internalAddGeneratedFile( + ' + +,google/ads/admanager/v1/label_messages.protogoogle.ads.admanager.v1google/api/resource.proto"v +Label +name ( BA:ZAW +admanager.googleapis.com/Label&networks/{network_code}/labels/{label}*labels2labelB +com.google.ads.admanager.v1BLabelMessagesProtoPZ@google.golang.org/genproto/googleapis/ads/admanager/v1;admanagerGoogle.Ads.AdManager.V1Google\\Ads\\AdManager\\V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/AdsAdManager/metadata/V1/NetworkMessages.php b/AdsAdManager/metadata/V1/NetworkMessages.php new file mode 100644 index 000000000000..a56a18beed04 --- /dev/null +++ b/AdsAdManager/metadata/V1/NetworkMessages.php @@ -0,0 +1,44 @@ +internalAddGeneratedFile( + ' + +.google/ads/admanager/v1/network_messages.protogoogle.ads.admanager.v1google/api/resource.proto" +Network +name ( BA + display_name ( BA + network_code ( BA + property_code ( BA + time_zone ( BA + currency_code ( BA% +secondary_currency_codes ( BAG +effective_root_ad_unit ( B\'AA! +admanager.googleapis.com/AdUnit + test_network + (BA + +network_id (BA:QAN + admanager.googleapis.com/Networknetworks/{network_code}*networks2networkB +com.google.ads.admanager.v1BNetworkMessagesProtoPZ@google.golang.org/genproto/googleapis/ads/admanager/v1;admanagerGoogle.Ads.AdManager.V1Google\\Ads\\AdManager\\V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/AdsAdManager/metadata/V1/NetworkService.php b/AdsAdManager/metadata/V1/NetworkService.php new file mode 100644 index 000000000000..a78ae63f7332 --- /dev/null +++ b/AdsAdManager/metadata/V1/NetworkService.php @@ -0,0 +1,42 @@ +internalAddGeneratedFile( + ' + +-google/ads/admanager/v1/network_service.protogoogle.ads.admanager.v1google/api/annotations.protogoogle/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto"K +GetNetworkRequest6 +name ( B(AA" + admanager.googleapis.com/Network" +ListNetworksRequest"J +ListNetworksResponse2 +networks ( 2 .google.ads.admanager.v1.Network2 +NetworkService + +GetNetwork*.google.ads.admanager.v1.GetNetworkRequest .google.ads.admanager.v1.Network"$Aname/v1/{name=networks/*} + ListNetworks,.google.ads.admanager.v1.ListNetworksRequest-.google.ads.admanager.v1.ListNetworksResponse" /v1/networksAadmanager.googleapis.comB +com.google.ads.admanager.v1BNetworkServiceProtoPZ@google.golang.org/genproto/googleapis/ads/admanager/v1;admanagerGoogle.Ads.AdManager.V1Google\\Ads\\AdManager\\V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/AdsAdManager/metadata/V1/OrderEnums.php b/AdsAdManager/metadata/V1/OrderEnums.php new file mode 100644 index 0000000000000000000000000000000000000000..50e78befe4b07a118820051a08f1a50b66146ea9 GIT binary patch literal 966 zcma)4%WB&|6s?oSNymj4QAnX(Ow&MYXk|=xcHLICWMfDyVaZ+;ff-9Zd9>BW1!so6h&ePq!1ond*(_iV z?vzO?7>Qh+CY}gm$%O^bUN4}snqYR*YL{sFA3f9l- z&IoqZUtZb!k6~Gd=KEFJF>I$*0kg16^z#t4|9dUUSpijHgJ9(X)VuEauNpedhi}8A z(&(M)R*TzosKzV_hmNC<( zv&l-cthu?=uA7I-b97Ri0RB`tMGbvwR~JVLLUl`9*x;;Z(2+J98P{++RvPG7hhGN{ zCqpRo6$n**q>*9KMJ}Oyr&jID=Mo$6h_FEABIpE^p@G5;SsCr$`b6j0kD|=TcVNW=ZiY7-E`q-fzLVp3-BP`$m literal 0 HcmV?d00001 diff --git a/AdsAdManager/metadata/V1/OrderMessages.php b/AdsAdManager/metadata/V1/OrderMessages.php new file mode 100644 index 000000000000..fd26aa927f01 --- /dev/null +++ b/AdsAdManager/metadata/V1/OrderMessages.php @@ -0,0 +1,79 @@ +internalAddGeneratedFile( + ' + +,google/ads/admanager/v1/order_messages.protogoogle.ads.admanager.v10google/ads/admanager/v1/custom_field_value.proto)google/ads/admanager/v1/order_enums.protogoogle/api/field_behavior.protogoogle/api/resource.protogoogle/protobuf/timestamp.proto" +Order +name ( BA +order_id (BA + display_name ( BA + programmatic (BA9 + +trafficker ( B%AA +admanager.googleapis.com/UserE +advertiser_contacts ( B(AA" + admanager.googleapis.com/Contact< + +advertiser ( B(AA" + admanager.googleapis.com/CompanyA +agency_contacts ( B(AA" + admanager.googleapis.com/Contact8 +agency ( B(AA" + admanager.googleapis.com/Company< + applied_teams ( B%AA +admanager.googleapis.com/Team> +effective_teams ( B%AA +admanager.googleapis.com/Team6 +creator + ( B%AA +admanager.googleapis.com/User + currency_code ( BA3 + +start_time ( 2.google.protobuf.TimestampBA1 +end_time ( 2.google.protobuf.TimestampBA +unlimited_end_time- (BA +external_order_id (BA +archived (BA! +last_modified_by_app ( BA4 + update_time ( 2.google.protobuf.TimestampBA +notes ( BA + po_number ( BAI +status (24.google.ads.admanager.v1.OrderStatusEnum.OrderStatusBA: + salesperson ( B%AA +admanager.googleapis.com/UserG +secondary_salespeople ( B(AAA +admanager.googleapis.com/UserG +secondary_traffickers ( B(AAA +admanager.googleapis.com/UserB +applied_labels ( 2%.google.ads.admanager.v1.AppliedLabelBAL +effective_applied_labels ( 2%.google.ads.admanager.v1.AppliedLabelBAK +custom_field_values& ( 2).google.ads.admanager.v1.CustomFieldValueBA:ZAW +admanager.googleapis.com/Order&networks/{network_code}/orders/{order}*orders2orderB +com.google.ads.admanager.v1BOrderMessagesProtoPZ@google.golang.org/genproto/googleapis/ads/admanager/v1;admanagerGoogle.Ads.AdManager.V1Google\\Ads\\AdManager\\V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/AdsAdManager/metadata/V1/OrderService.php b/AdsAdManager/metadata/V1/OrderService.php new file mode 100644 index 000000000000..71b9f7757efc --- /dev/null +++ b/AdsAdManager/metadata/V1/OrderService.php @@ -0,0 +1,53 @@ +internalAddGeneratedFile( + ' + ++google/ads/admanager/v1/order_service.protogoogle.ads.admanager.v1google/api/annotations.protogoogle/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto"G +GetOrderRequest4 +name ( B&AA +admanager.googleapis.com/Order" +ListOrdersRequest8 +parent ( B(AA" + admanager.googleapis.com/Network + page_size (BA + +page_token ( BA +filter ( BA +order_by ( BA +skip (BA"q +ListOrdersResponse. +orders ( 2.google.ads.admanager.v1.Order +next_page_token (  + +total_size (2 + OrderService +GetOrder(.google.ads.admanager.v1.GetOrderRequest.google.ads.admanager.v1.Order"-Aname /v1/{name=networks/*/orders/*} + +ListOrders*.google.ads.admanager.v1.ListOrdersRequest+.google.ads.admanager.v1.ListOrdersResponse"/Aparent /v1/{parent=networks/*}/ordersAadmanager.googleapis.comB +com.google.ads.admanager.v1BOrderServiceProtoPZ@google.golang.org/genproto/googleapis/ads/admanager/v1;admanagerGoogle.Ads.AdManager.V1Google\\Ads\\AdManager\\V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/AdsAdManager/metadata/V1/PlacementEnums.php b/AdsAdManager/metadata/V1/PlacementEnums.php new file mode 100644 index 0000000000000000000000000000000000000000..8eccdd7c4121bbd8c6e6e7a286ec98e2a528961e GIT binary patch literal 929 zcmb7C(QeZ)6s1L)kcC859`*namoaIb#8Oqfbt{mzS&2m3h-Q6&NR^wonWfZ@Y-bXn z{?I;!zu^zCoiq%lJrL<8vG4V{$M>9z_xW{>Uc-biBCsL}tiOS}CXfrRc+4|c7n=FJ5WKM;zS2h}FGNiGkaC`8q>B@&V~ZJ1iRj++x_O3UvL#Hd2rIVI zvB(H9yd^T%DVPMqDN#7V3P%$Q61j=gQGrCu-Z?^XhNXmH59S#x^aFu@@?xFQ7^K2V ze~zhKQAQQT8U3y=G=L4xB+(G}Yc~ap73B=ffjNsw=M+jzQ+u3qJ%9o1Sp{Y$dLEI_ z6cG$((U{0s&|Gm5=+b^aC90mJ+3B2CZ4DgVK&Rx`@82Ui03`}?w>y9!su1kl@-_gw z`p+^udq*oCZj#h(FSSaYy3iauLBE>l?7!q`AC~2gR#QhMgmcq766krY!9owbkVc84 zujtu7+igHEgHP_rn|iZwwFuqtYO%VSEdp=kU;5s-^{9=|fjbKQrPpe-pQ0!JtXehA z%Kbe0s8i$CinternalAddGeneratedFile( + ' + +0google/ads/admanager/v1/placement_messages.protogoogle.ads.admanager.v1google/api/field_behavior.protogoogle/api/resource.protogoogle/protobuf/timestamp.proto" + Placement +name ( BA + placement_id (BA + display_name ( BA + description ( BA +placement_code ( BAQ +status (2<.google.ads.admanager.v1.PlacementStatusEnum.PlacementStatusBAB +targeted_ad_units ( B\'AA! +admanager.googleapis.com/AdUnit4 + update_time ( 2.google.protobuf.TimestampBA:nAk +"admanager.googleapis.com/Placement.networks/{network_code}/placements/{placement}* +placements2 placementB +com.google.ads.admanager.v1BPlacementMessagesProtoPZ@google.golang.org/genproto/googleapis/ads/admanager/v1;admanagerGoogle.Ads.AdManager.V1Google\\Ads\\AdManager\\V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/AdsAdManager/metadata/V1/PlacementService.php b/AdsAdManager/metadata/V1/PlacementService.php new file mode 100644 index 000000000000..2512b3925512 --- /dev/null +++ b/AdsAdManager/metadata/V1/PlacementService.php @@ -0,0 +1,53 @@ +internalAddGeneratedFile( + ' + +/google/ads/admanager/v1/placement_service.protogoogle.ads.admanager.v1google/api/annotations.protogoogle/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto"O +GetPlacementRequest8 +name ( B*AA$ +"admanager.googleapis.com/Placement" +ListPlacementsRequest8 +parent ( B(AA" + admanager.googleapis.com/Network + page_size (BA + +page_token ( BA +filter ( BA +order_by ( BA +skip (BA"} +ListPlacementsResponse6 + +placements ( 2".google.ads.admanager.v1.Placement +next_page_token (  + +total_size (2 +PlacementService + GetPlacement,.google.ads.admanager.v1.GetPlacementRequest".google.ads.admanager.v1.Placement"1Aname$"/v1/{name=networks/*/placements/*} +ListPlacements..google.ads.admanager.v1.ListPlacementsRequest/.google.ads.admanager.v1.ListPlacementsResponse"3Aparent$"/v1/{parent=networks/*}/placementsAadmanager.googleapis.comB +com.google.ads.admanager.v1BPlacementServiceProtoPZ@google.golang.org/genproto/googleapis/ads/admanager/v1;admanagerGoogle.Ads.AdManager.V1Google\\Ads\\AdManager\\V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/AdsAdManager/metadata/V1/ReportService.php b/AdsAdManager/metadata/V1/ReportService.php new file mode 100644 index 0000000000000000000000000000000000000000..128aacca11e6462f885a65908f34f2bc0d33cb3f GIT binary patch literal 35098 zcmc(I33OaXm3F#i$yUir`FV*f$FVFsiS0O&CGQF$w7Q?9#=WJxB}X|5Z`xAJ=|6I} zrn_Y@jAyd%2_zv90)*_4u){DwfUwT|L)ZyxW@A`pfUs}F&fHted-b|sy?%!OoImFn z)Ky>Ix^?T;ty}e~>OSw{g)0`w*50vVxmYdKi?h8)PxjWYDE2N?EA`4uWxn_5;@n)Z z+B;J@zEGMkR{MK4xk5wwi=8FS`*&6&iUMLri6{`a$ z1_!Feg-W$<)r!>()3Yz_Vi8q<@5 z7ZNfvU#Qi3vy4`blOiu8z3|_{;?eoiOmD4TsKftlE7h!0xl}I|=1VVy=3LY}SD3FA zfkHEOZm~R5FICFDSRh@VDQ@4<%V{EZ+d>7Je^IYwDuWUMX-vn<^L$&g1ZK6O$M9)~ky}wf5fLYO%gpEnmp^Mgpho zzoxxJwosaml*<*ALZw_A9(LN~kkA#3&X^o((`%&NcZ};~p>}0(j_tDf5~yswaC{+n+5E|c;&cqg)oB+w zS($rrv3MG6vZ|29%G_+>q<4Kxr7w7XNhok+cGlL{Q5f9YZ4EXvH zlcW2=2*5uvfcsAj_K1vu!a`|ahG`o&1U;K2eaM(Ym9mZsof3cz3ZNJ4r09BKPTWSOy^bPB6kn(c0b^fpXyGopl?DAh_wOY^1r z$?h;@tQ^|e&$(!lc|WJ$KWUdhA|WGARtw^@#W`jwE9LGbK&xwLM+;gpy8x038ym>- z*-~v`zHriFO=y=*2pM}x*Wv=o%EGpHcQE=rlD-smKPoI6Q@nvtYNlGWODzpnY7Oa_ zugnzYi`~m418v3_p|zPSinELJMXR#F>_vAcqqkjh(Ws^UIZ+_Z@l0Ml&xA?)WMO`> zXsjWfFm$XF_=9y<+xQvKSIcKBFa;GwI`&G4r`PILFjyiTyRj3}*Aj9R<_3|9a$g3i zV`L?go-frTeJ-&Jw7kmRMP~Y8N=iUcAe1DlMYReoF2~)$Xyq8!g4{aNb@XJtSQG4` ze3y@((X)Xp6;&E5Ne2^14J6XGy{+dgLL3SWxt$|RNjpRLd@4+qek#-IWAt+B)A1{KeX1HuDv<}@k0#*(Uv}y!6JW!Bn720i1H4Ico zmXQvN@jkMa7;NmgxL~PG)%M)nPC8+lDdY>Fh&^uzk+y8*#m2>i&O$TFHJB_plf07x zNQALw93g95bsei#78hzD={7JH!>t-=Gt{p%cMM7Ne7%j(#zf;HvT~tXI$o%r{Ii%% zkeF)m6C$=37`)eq?FsI520t%rPefcOEk|ddi3sPImJ<=W5C0z~q8Adv zrHGmV>bZ1|DY=|?0_r9cUf+`;(rNdF(LuuT6g|Trqyu&zEciQQEGNsN=~O-vPvvOX zpkz7b*ePws3euS{b2%$N9!b$9;CfN}r)6F;5lQ4|I~E(unvuMj<+u*xOtMBzkcsXU#+; zAD=X>81%B0jikm*Ya*4)n9=xX+>C)zb&~dcIu@A%odTViGIO8}_%n<@^W*WH1)YAF zwi)ZlYWt^^Pcw>i6S%pAB_}}}$3fH96T|s!<9blnSUTul7ODX4>n3Z}6dSwIu6fFg zWNC+8Gyb$uXE7CzxRivg>tTs+;(;rd8y(#+=LIk0!JbP{Z* zl>+h5pCN~8rgMOaZ4V}({F`98r9_Nr7=y;K5A-m_R~>K&H*~6$vH^JH93c9oDFBuaWOLkRrthcQJ<|`+ou26j=`PRoL$n{%)gEfl zLHTq>bkH3*fbDU~27QmwgVu(RR7_F&bCcTBEKiQv&FY9yb9U1~UDhDoqstni`*c}* z=mA~UUV2EEwU1t?%i2#b(ll#`ZqelIp<6XMd+9lvoPBiqJWbYqx{e8y1v(CPA*<1ApC*Q|LYl7%6gOi!fp^kQ`ch^+in#-z`O8GNNwid;UDpUBbA zhM<0X6!S!G?LWt-g-phR2@U5udQ+RRjcgu?L=TU~(KT>pI(0Jpw=nYUg#s({Y#1ja zuS_w${YMyFflXQfo9F&L3|>dK7l!Hnzl4qLWUE(pr=TM{0?mu3 z#w;ea-@3_pg1E$fr$I&&@#tY#{bbVCDHbH-loBL~23`CEd7m!4r|k|!bUII=s^e6gtz5?+z1edX~pwq(u!oG;~=9L zeO1^PB)e=H4kDUPW+Ewcj$&p4px|nxGt95JCT#2{gQru3Gjna&m_Cp6X$nr{&6p+B z`AuPC7nwe4(as-!;%0TVm4CgE5gPW za+VIp#D7!RIG1ekgK+k4c6YZTVyUUn*L;!mhp^F4c6gDL&};i0gxhx7-= zbABGyic3}k-H^?5j()Ed*F-jJrlRP8f(Q9P7}l%jcraosPdpWigJTLheOF6t7MGx` zfscfZ0kYGNu8rl5dsHXvSUeX+!)irFa*HZP7gn5oHlHl2bcNuIa;ZDHdAvfZQYjY!_|tF?sX8YO1(h05#Q22)`{ zBEf>)scX(?7IuYr&qp%!?P2gy)_E`qB%aU?W42CBrekbt!5W#eBAE<*P-`C&@llhl z?U)VD(bwt;OJqC=YuFr4csY7s*w{yQd+=z}os7fW3(I3mE%rKHmnS2K&9OABn_r1* z(lb2>Gc*5Y-C$0^@Qr3-)<`;i7)%o^#?91(N$=Nn3)jvyKub8~sw0h`(_*lL}*Z)jDZ_!O5n9JFDt8S1@q!Q5OIB|jXpfA^1s>w)V z!UPMf&RlovG~|dm0vkJNFlyjmFsuCrx2Th_DF*YOGxOVS3k>F8G>kbtm?{4+-F6|J zjR9paq%dR9_q#nmH4pbuo(#iY&IWr_@oX_xqM0cDfNy@1e$YLRczJss5}NZRx3%;H z@jm*pyOTLm+I0FMcPG1Zxt4s`?JWz4VroAUhQ;FQh6aNmzUU=G;bDK)ONK0uIoF@_ zl7VgRgc<#qmkex>Y6?Fd#`Q%5hpeBU@!}(swo((x5!k!^gnPL2wu2ImWg|)W4iJyh zk9tWb7lCgOpr|=mul%E1pE-$~312W`xc?=f=?rXcezHMFeXyu#|Ljj0T*uK-@cDra z`l%L_6)aMI+Dk

p?&5)jdu=*PG9H5pgP_|Kz25PCoMSf4v}X+wzo~6}4}yk%=i7 zwLs_dZad`xV#@G^Fz$ekz{i7_z3}=|7#6aID~*q_maP?dWHpG_81jfM+LWqe*ve`K2{HI~W$OMM@2~*i9_#ip%e<({} zpn5&qY4y%#Ba zaL|UIXyDt7l^*3Ed6wYUkeHbSO|+u$VKZeW-~%M=bh^_xA%fqHL`H66MB>-u?psqb zFLEY)+3bkHSCptpzZt@BD*T6|$E$Ehs3DP;rMOWqa+pB>GlV-b=A~FMe05W|0r*_Z zbm9FWTyFZJ7_}#v{*K18;1ndl!-P3M9>w99oj?aSMt>c`rL7LYX#6IGq8(39Wa%t^ zM2Lfu;zHV9c>V{|^u}b~zHi_M3@8F#EiCt@tkHB9Og&wV1G_PmmoTumoGj)&t-;=M zr*ZIFv@!6pF%rAfip8@geEaw#QxQm08ik7;dS@Gg51X)`f}TL$o<@rd2o+I&vrci5Mk zR8aGd$MiIQR#P#myEuU}dqXDcfG@GZ?2*H3{xTcPO188Iwrli`5bm^iAl!Qx9}3~t zK`R)q^r;Z;D|%p^xs$#^L&`&a>qX+O7JdH}K zl96t!+)F6ns8*=Rd>Ckx?tXCZ8(hVXqBsQs-=OcFdj#)6rBnuu?X3!z*1}KF4plo_ zb!J}#yM@!|d4N230shJ@e0%Lbg*M9}!i-25?6{)vnsxqBx5(7h{be{oIz(LyX*MXo z*f6G=5WL%-3BeAtGNxQGT#&6JVNiR+II~}9 z&~L!(U3{y>AV_FBDP>ehhfHT%2S?5$sY!$7)?jU+vU>FVul8ce3aO@z;i@O=oz zr%A73O;b|i;GnXP9ap2fxb2f=0e zzA(BG3M>cSgh@}K1KgO(OZ<|3P7`@<*MZKU9rMiMW!Isx68X8`#|5fjk;3hQ>BI{UnV=@PGn$#)qZ_u;>t zeUk^6J1SDu?UL6kO;LAA9%QZtFW|j7@(8mEJ_zi?M?J|nn+iGlm?s$pfn?sO^toeE z>6;Y6Imx__9#@Ju)aXM>r#i`4$HPjF+s=N9outSlB2kllO#$#?s(?0vOnZym9BSoV}8PB z8Qmt#Pf;#wUAb~ay8`DruN*$AR^lgr_^1b4wXpGQuefvZ%S`%Jw!~tee!vdFDFygg z3+Xxf4Yt7|GWg_w7t>KSiPOJ31ZPN>CXfjXV!c;^_;nlpAt)|%_#(RNPF&tT8x9kP)5A=)I4% zRm}vc`~xGYCNk`ML+o3+9#W96Nj2;os9iLu_R)R5NVSh% z>x)$T=ykqGwU1u!i&XpQ{#3)3gxaFre2<0xdcp@ZC_umQ0}Tn#Z~Z`f1n75upuGb0 zdq2=V0s4a0(yZ*>@b* z<5aDErw>lm+jsfkRLy<24^GwHzxTnZR^vTBIMs0cgAY!%9q;wQspjK-J~-8ay#F}! z7ri^g<+VKNi&XpM1HMSLS3c;ARQu&azDTuao;r>n4ZIs94a>c_oua|W@$ecSj2sd7 z`C#Ojc&!gcj*8d$V5FUSy$?p3n)`h)(%QVi2O|y613nmOa~@p8iQHSxw%K{e4up(;5-*F1QRePVXSKBYm<9FfuVGz6=z~2jqmt*<+0r7HJKNk=$NB9o{ z;-zW*VL-ezvp))mmnQee0rArO{v;q?n&O`VzTflgxXZt?t@6(T;${E-JRn~7?=J%4 zW&i#%AYS(GuK@4TPtP?3Kc|74VxNakWUcV(IQ~KaygG=#7yz%1;AaBh)#3Z40C?4E ze>nhNwb@?@fLAT{R|DWxd;PTlc-2~e9q_6?dvveMR6iR4ulDc11i-8P`>z4;YXAOQ z0KD42{|@*a%I!Cg_Da+IJ~(vO0xC!C`&&chfPJzxRF2gTw1&!I`oY#vX@Nh~8Y+$N zQ>~%W?tZv6RGQq6w1!G+`%!@IR4(*+^p>mSQWtaUE zV0SAwu)N)S)i-_szN)q^p^m->1C>z6-$Q{)s3Y*RSS#<*>dr5LyoG+XA7bIles*T3X~g0->c*et96Y zw9BsugqEiHPC&aHJ@3x6>IW@v=Yf4v3dM`pSTK*{Ame#LHfN72vnP8GF8na~`-6 z+KRsK1Gjg0LPV1g@}LGHT7i&W?YKpgFSX%TO}^~?+cf$1DAwfL z<5rVzk5o;*JvKG@_GrAPqwl#3NC$s{5)alU%{<&rfGhXvLu2QVEqK=eo^Zeux$t-u zoPmRT5%%$1c8~fZJZr1M;FW^0c;g-3Vfbj!r=pT(BsY<5y6bz0oe6FYgon}K^vd%Z z>$X`_PkJ51Gq@^AFBB(uAsDG0kys9%qk_YjE!!T4`Dwcs+*1aluyoq#h1STzgf|5S zg5!A$#&s-tH5%Sh8YCBZRpEu^6^I9ugouPnn9)p<_TV8dNlYBWI}(_{E)I$lWQG`=iz=0JiwKS(X-(g zQnv)c8RiV!T8GOjc-Bko|=;|hDg7z zghqP~8wbdq(<{R}IOWHlmtMdNWc$dVt}3q*yrLwRwju{rn+!BdDp8>et9UOsrJ|r! zl=r`rs4B-wJaVj3YS6B=@VR8OSH4PQ4Oc;@21!I}**b2ylx}T6xHN4ud=@@St+Pqn zcJhJZR46N2&4&~`R{+mHL;V|BlUmx*{s^zeU5MCa~Le_zV_Y9O3u-;aqDXfk$-HsM^B*+{lkX zH{tkjyNR{iO-24e8-y8UmOh^U;r3{T0pj(FRq6-J9KyLUDpAy zK*KeWl2TQhb3W|9o;v}y!b$=`SS;k=CitkCJ%aCF+DW-_xQj$jqEn;8DlD0)F(8B& z2y*nLI6?4p-RhlZX(7}!wm^U@x8ON87k~$G6Ojz~cJy+zl+6J1Qh0O?3=6x**qjZb zN?1AA!+?bX{VQ}nnlVYZM4Y1q)RN}ROaxkLS|U=Bjy0?r=PlqjNZ1cmiA-hWCo_(O`RPhS~fag?9!#P-Zrp&RT=JcMIbQ zZz%ep1_cUkdibD*1PZQrXi-CUjc~oe2PJES%MLy$StIPO`=Is+zTn{mEozU=7u?G7 zK}o*gmX;4n@&%W+d{B}vxWlDI?X~%Wds#jx$rs$w@#NzVr*`GQM(KB&Dys&DZ@9kRKH z3q4v|hjvTu;WZVwe%WZ{)X5rNSMi`DCphUgz_(zS(;MmJ;UUO`#jPRN2zdAa&M&()hzx_ zjKfUTQ_{_PQbRwpi6<4ur1TL-r3TTJc8m;A?h%iK-Ez*lMr^5zZ1xwIA%Od;o8$1)HvYq){2H+1|E&V zgQ7Wl0$omTdg=o{Y=`o)zE_9fqP#nv8T!fMSp*2KfeQoiqQ6`g!&^qIQ>b_q3f|+* z#_>foe8y=bdxwVo#z$-MnNocGh!?1ndriFwI`G8Ps}wSI^JHo*BXwwH_b7gwrR)&^cC{<3B&v&B;) zNG>Gv(2S>cF6DpJhC28keQ{WkES5Q)Z1JxbA#5V-2&thXr_X~RRlkjFX~{<43|I!!P#K~Oqn6DVAv6mHTxo|`j)Dmm1Fv&rTcApIDwROQ*9C}5TZB!56}&wb z#PVF6ue0DUo!GdsV*US3h*PUcSwS$dg+djg!tp9cwliV%kzQ?|rFdV# zrfKH_1T(g35Kx#)1S8YnEq21v>y;~uWfp3Xhvorg?BHRKguEDf9a&bX&K9fI(UUAn zpuj@(&)Sux1r{Ka2X*SJ!=pti|3Y-TiPQ;b0mgdUEF(=w=K~5M_4EV}=uWP6|3@HmbhGBs@50}FmV#WH*6_NwgR0ybO>(X*{+?}?5 z^nE8xHfiXKzP^wwsX~3Cqgw_6g=k4U^kYAUecS~BoEFPG?kbmjbA#=;s}L}>%ZYze z12sm~`m^Il8JCjvO3Xu*GLLik=Tio4=1L2a0js$PBbh})^HOt+e%9Id%?_}cEMmA5 zxYihfprJCxAQ$lIL?z@}1#!)evl)+vlw8?5<{qCQ?b0$T8khEIL`B2r2Rd17(wA1s zMb*CakQFnFRWNWfC)u2$8X0V}9pgyE;%yb{mxbVB!NoY&S+dTvV?|Ki(<27~axsMJ zIi!1Lu~x4fx9l#lt}LFkO0zteBnx}Yb}D=3OXZ?fsuz!2q6Ckjh{!HbS%KV2)^j7< z1X}KZ&LtaIkYN`5l2`8#TjAhhq^rtf*JD&D7F#$#xMi+z=y7nlT|x{smh23RCe=+q zL01m7j7ZoRg$hZAATDM*hTW`nuVjODTZ?(19|O?YC2J6Lx7NKXSV@e~%Sw)Pll7oh zb~sc=o%$XMlT{6Yli?fEG8ufCO}AY`TeM8dvc@DaW{dOCD-Zy7rUF5IF=(?0L8lKk zD~pSm&HXV!A}T33;^Lz%xVZYp;qA;Oa^Ur);92u5_=4aUMiNJG$;h_9kBplsYcvrV zgB3SC6N^tu=3t99Ps4q;wv%O&Q{ymMg|Xe|Pg=H+c(iA|KFG5DM_57m6Ts%FGRj^6SKUz6-erujaWf53~h%kXT zfS9f88d@(2;Fx6L!_#xI!pR;8pzRh7ILGT6q>NDnPfDBbCIlqXb4Z|P5LPp8slY;b zeWQpKQtf^BLi9C6GH@LM54R*R&LFH<@<-BadpHO2DB_UFzM;YD(u9Xn zVb@qDv&V!-p`0sq2`)c)xpq`Ue1ipObg;OT7={pjEX8oqb{E*%HuTssvVz;GT(Nor zVqY6KLKAEc+|V0y8zbE6o>op>U;ncawn(|=nQz}6-ePPXI57x|9|(AVk-Zk$X)k|v zo-*zWK}15w{WbI&qo5==yQFqBxx_9o_pQRJ~^(231&K1`j_QF?dzG7MYW7 zpsy}PukT`;+4q3b+3QdrrL!@T%}uhK=PTu7;Omwl{(HY2Dz@)MPe;!6 zT6{JydR5)r-nX@dZVp3L!=atV(;*n*Uh4y6pJc2_|2*-sJ^N3$m{8ymmH&Ol9)JE} zl;J|AHn8*5@El_wmKZ%7pN@3vmcS#AhsZ{l^>yrx7+K~Z2`iGRR_c{Z=&~2^%?~Iw z4?#8iE7fBI$BN|z%pGv{MFv1d@b7q`42$b3uzsQa literal 0 HcmV?d00001 diff --git a/AdsAdManager/metadata/V1/RoleEnums.php b/AdsAdManager/metadata/V1/RoleEnums.php new file mode 100644 index 0000000000000000000000000000000000000000..39f8c01d5c9d7f3a48757661a7ad9475a23c7ae9 GIT binary patch literal 880 zcma)4U2EGg6kYOAh8UydB@cbM>k3U_a|nA&mTmcPgJDfV^YJhYL9uUKfg>47E^H+~ zr!V^{{Z*4>*Xt;S8LnkZ=YHs%^Z9Fblaco@L5`AYjA8o|^bJBLg%*)WVVm!EC?OL2 zjHM_&fbk5bvnBZBVEN9ZDv`?wyO0Qxq}ZmhGO?$eCMestowgJyZjk4D<+-ASaJom8 z(FkEOA6}uRG1WAjxcqPsD-&gYxbE}_iBhT*T$?(+Eko`Im?z7(DT_d9s?Bo7)P`}U z8BN(QbB#XiXsXa;KgaHJ9%&{x*n}C6uyp}NO^ZFtgt>Mf9tWCRCJYN z*R${bX0aSBSBuSRx|sW;;4<*X$FCZM91TXxVC^5*8gIz!U|RmwhxavdVm#%&(01sW zI=LPH^V*MZB{UH!<%uU`(oT>&OSOw5nlbCWfBo01Zu7g|oH&np#$zU~3Xgj0&cowL k=n+a literal 0 HcmV?d00001 diff --git a/AdsAdManager/metadata/V1/RoleMessages.php b/AdsAdManager/metadata/V1/RoleMessages.php new file mode 100644 index 000000000000..be6641a6d1b4 --- /dev/null +++ b/AdsAdManager/metadata/V1/RoleMessages.php @@ -0,0 +1,38 @@ +internalAddGeneratedFile( + ' + ++google/ads/admanager/v1/role_messages.protogoogle.ads.admanager.v1google/api/field_behavior.protogoogle/api/resource.proto" +Role +name ( BA +role_id (BA + display_name ( BA + description ( BA +built_in (BAG +status (22.google.ads.admanager.v1.RoleStatusEnum.RoleStatusBA:UAR +admanager.googleapis.com/Role$networks/{network_code}/roles/{role}*roles2roleB +com.google.ads.admanager.v1BRoleMessagesProtoPZ@google.golang.org/genproto/googleapis/ads/admanager/v1;admanagerGoogle.Ads.AdManager.V1Google\\Ads\\AdManager\\V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/AdsAdManager/metadata/V1/RoleService.php b/AdsAdManager/metadata/V1/RoleService.php new file mode 100644 index 000000000000..d3021bd5ff87 --- /dev/null +++ b/AdsAdManager/metadata/V1/RoleService.php @@ -0,0 +1,52 @@ +internalAddGeneratedFile( + ' + +*google/ads/admanager/v1/role_service.protogoogle.ads.admanager.v1google/api/annotations.protogoogle/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto"E +GetRoleRequest3 +name ( B%AA +admanager.googleapis.com/Role" +ListRolesRequest8 +parent ( B(AA" + admanager.googleapis.com/Network + page_size (BA + +page_token ( BA +filter ( BA +order_by ( BA +skip (BA"n +ListRolesResponse, +roles ( 2.google.ads.admanager.v1.Role +next_page_token (  + +total_size (2 + RoleService +GetRole\'.google.ads.admanager.v1.GetRoleRequest.google.ads.admanager.v1.Role",Aname/v1/{name=networks/*/roles/*} + ListRoles).google.ads.admanager.v1.ListRolesRequest*.google.ads.admanager.v1.ListRolesResponse".Aparent/v1/{parent=networks/*}/rolesAadmanager.googleapis.comB +com.google.ads.admanager.v1BRoleServiceProtoPZ@google.golang.org/genproto/googleapis/ads/admanager/v1;admanagerGoogle.Ads.AdManager.V1Google\\Ads\\AdManager\\V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/AdsAdManager/metadata/V1/Size.php b/AdsAdManager/metadata/V1/Size.php new file mode 100644 index 000000000000..f1880c9571c6 --- /dev/null +++ b/AdsAdManager/metadata/V1/Size.php @@ -0,0 +1,33 @@ +internalAddGeneratedFile( + ' + +"google/ads/admanager/v1/size.protogoogle.ads.admanager.v1google/api/field_behavior.proto"w +Size +width (BA +height (BAF + size_type (2..google.ads.admanager.v1.SizeTypeEnum.SizeTypeBAB +com.google.ads.admanager.v1B SizeProtoPZ@google.golang.org/genproto/googleapis/ads/admanager/v1;admanagerGoogle.Ads.AdManager.V1Google\\Ads\\AdManager\\V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/AdsAdManager/metadata/V1/SizeTypeEnum.php b/AdsAdManager/metadata/V1/SizeTypeEnum.php new file mode 100644 index 0000000000000000000000000000000000000000..3e89b84e3c031ce0a57e9d8f442a5f480c0b028f GIT binary patch literal 958 zcmb7C(Q4Z;6kXai-LyVZWmCwN-TS5;n>i+wFTpcA?-o+3gM? zCnD#xQ_QUh*4tAt+1vMVHHR67+qQivQDX~KWoO{WKDhWFZS><3ZAc|$R4N#^t&^WM zaI~wy$@dy~vboS-f)`VCZTs#Q$M$EVsbhaaePmnOBmF5jaL{LasMT~09GNQR`V-Sd zV{K2}ppk1&rY>@kIn?&`XW$SGM&pUBeXIjeA4%lg)(#X;e>g*yR#!)JW=Vp>-me;X zCGBZEFm~_xW<=$hLPn={{jowvEWtD~7>}9}p@lh{WeTUUa`L}!?razGd+&HqxYdwu um2p)%-k7)kY%*S9WcjLcp0x6!Ui7#;+p2U?iofHP2Ypf?OG~W58i2nO3@Z)* literal 0 HcmV?d00001 diff --git a/AdsAdManager/metadata/V1/TaxonomyCategoryMessages.php b/AdsAdManager/metadata/V1/TaxonomyCategoryMessages.php new file mode 100644 index 000000000000..10a791d6c682 --- /dev/null +++ b/AdsAdManager/metadata/V1/TaxonomyCategoryMessages.php @@ -0,0 +1,40 @@ +internalAddGeneratedFile( + ' + +8google/ads/admanager/v1/taxonomy_category_messages.protogoogle.ads.admanager.v1google/api/field_behavior.protogoogle/api/resource.proto" +TaxonomyCategory +name ( BA! +taxonomy_category_id (BA + display_name ( BA + grouping_only (BA( +parent_taxonomy_category_id (BAR + taxonomy_type (26.google.ads.admanager.v1.TaxonomyTypeEnum.TaxonomyTypeBA +ancestor_names ( BA+ +ancestor_taxonomy_category_ids (BA:A +)admanager.googleapis.com/TaxonomyCategory>networks/{network_code}/taxonomyCategories/{taxonomy_category}*taxonomyCategories2taxonomyCategoryB +com.google.ads.admanager.v1BTaxonomyCategoryMessagesProtoPZ@google.golang.org/genproto/googleapis/ads/admanager/v1;admanagerGoogle.Ads.AdManager.V1Google\\Ads\\AdManager\\V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/AdsAdManager/metadata/V1/TaxonomyCategoryService.php b/AdsAdManager/metadata/V1/TaxonomyCategoryService.php new file mode 100644 index 000000000000..e0d958fa9808 --- /dev/null +++ b/AdsAdManager/metadata/V1/TaxonomyCategoryService.php @@ -0,0 +1,52 @@ +internalAddGeneratedFile( + ' + +7google/ads/admanager/v1/taxonomy_category_service.protogoogle.ads.admanager.v1google/api/annotations.protogoogle/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto"] +GetTaxonomyCategoryRequest? +name ( B1AA+ +)admanager.googleapis.com/TaxonomyCategory" +ListTaxonomyCategoriesRequest8 +parent ( B(AA" + admanager.googleapis.com/Network + page_size (BA + +page_token ( BA +filter ( BA +order_by ( BA +skip (BA" +ListTaxonomyCategoriesResponseF +taxonomy_categories ( 2).google.ads.admanager.v1.TaxonomyCategory +next_page_token (  + +total_size (2 +TaxonomyCategoryService +GetTaxonomyCategory3.google.ads.admanager.v1.GetTaxonomyCategoryRequest).google.ads.admanager.v1.TaxonomyCategory"9Aname,*/v1/{name=networks/*/taxonomyCategories/*} +ListTaxonomyCategories6.google.ads.admanager.v1.ListTaxonomyCategoriesRequest7.google.ads.admanager.v1.ListTaxonomyCategoriesResponse";Aparent,*/v1/{parent=networks/*}/taxonomyCategoriesAadmanager.googleapis.comB +com.google.ads.admanager.v1BTaxonomyCategoryServiceProtoPZ@google.golang.org/genproto/googleapis/ads/admanager/v1;admanagerGoogle.Ads.AdManager.V1Google\\Ads\\AdManager\\V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/AdsAdManager/metadata/V1/TaxonomyTypeEnum.php b/AdsAdManager/metadata/V1/TaxonomyTypeEnum.php new file mode 100644 index 0000000000000000000000000000000000000000..7e0f028bad09eb63fb5d2931fd46b7d5be41f059 GIT binary patch literal 1055 zcmb7D-HOvd6t=FeFnAFPvWg1hTG%dV+U(x7R&ASX2-u|Trp1-OFiob}Kspm9lf^21 zA@NDP@+G|SDV+Rl=(?<6;3Q$bbG~!tobSAOms}*^B{T^o919Y_#TtqW0u#;z^H~fR z*>XuZ^w}zjV!~AjbqCsx3k}_JU&zpuW!xt{7%~>dq=SQ0+6q$~65hGgIs$)Yl&#iC ztP_F=%~onb4gkd~k|x+E(43AYMBo4m?3o3RHw;o~6^}R9`T+PbPE+Vse6FN3Bpdh& zpnQ^S5l22u1s3wtic%EONJKb}zQ|h*;1b6vkt8>Lml^d%#3;-I9O{$yAuKs_-&Vq8 z7Y6XEu4&#F*%Z&Bf^dpsPbaC*qeL)1m9D*BNJQPv{G@$YrOoN0C2W^9_Ifvp96-S{ zvYj15PDI9OzoaAXZ#<-zEC13Z=5S8wUV=+X9lb2%3Jm^MDWuOdPgV;ZWAhnOA;+>^y_k>mKF9{;OSRa+vwRe*(O KskIH*0PqKVuu%p8 literal 0 HcmV?d00001 diff --git a/AdsAdManager/metadata/V1/TeamMessages.php b/AdsAdManager/metadata/V1/TeamMessages.php new file mode 100644 index 000000000000..10949b444e90 --- /dev/null +++ b/AdsAdManager/metadata/V1/TeamMessages.php @@ -0,0 +1,33 @@ +internalAddGeneratedFile( + ' + ++google/ads/admanager/v1/team_messages.protogoogle.ads.admanager.v1google/api/resource.proto" +Team +name ( BA +team_id (BA:UAR +admanager.googleapis.com/Team$networks/{network_code}/teams/{team}*teams2teamB +com.google.ads.admanager.v1BTeamMessagesProtoPZ@google.golang.org/genproto/googleapis/ads/admanager/v1;admanagerGoogle.Ads.AdManager.V1Google\\Ads\\AdManager\\V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/AdsAdManager/metadata/V1/TimeUnitEnum.php b/AdsAdManager/metadata/V1/TimeUnitEnum.php new file mode 100644 index 0000000000000000000000000000000000000000..e19c07fce545fbe6f9f6488b0c6d800d83206875 GIT binary patch literal 950 zcmb7C-D=w~7+sqFWTF?IVU)2Ott&Kz&LQkBS+*s!lbX%3X`PM@Lr`qR6*!WS<-&gQ z0E0cq*rV*JCfSb3D7~2BlWpnfd`CLx)tmGt1<&CGQ_PXT5nOzM;s(Q%Gr>ZZz(u}X zVh%&LN=bsb0io%_sp~__wEbstYsPXO;vS3{ixb>IQ6_7JD2g%f+;%&HtnfUiM9eYG zS4Ke$07WaDr6|O3;*A_EP=o{uCIv?@j51jjM{wQk0}v)C%b+j0W|GR1OyC=U@=5bW zLPD4cB;@OaWOE_`1SRCFJk0%~~q*QjRNXH{E8N0zW%YV7syh#Ww{bG+RhLXJhw zX}{2|2-fviq3p$LQt22*QQdYdEo#?5we1xAXoBw`VE6s5MWu%2sb2a4*-zqE#q)*Ah4fTuE+#yxUJ zk2cy=S_=ET#^<*cI%Wx?vB7xUi7_og*(sM$N>qaXO>w`zh~GO$lOm;tOsOoVOuBL1 o{j*sKiU7-@S_@=^7yCtzm#4Km=cVae8M!wf1+t978ms~M3tSE+-v9sr literal 0 HcmV?d00001 diff --git a/AdsAdManager/metadata/V1/UserMessages.php b/AdsAdManager/metadata/V1/UserMessages.php new file mode 100644 index 000000000000..2e50bd46d2a4 --- /dev/null +++ b/AdsAdManager/metadata/V1/UserMessages.php @@ -0,0 +1,42 @@ +internalAddGeneratedFile( + ' + ++google/ads/admanager/v1/user_messages.protogoogle.ads.admanager.v1google/api/resource.proto" +User +name ( BA +user_id + (BA + display_name ( BA +email ( BA3 +role ( B%AA +admanager.googleapis.com/Role +active (BA + external_id ( BA +service_account (BA& +orders_ui_local_time_zone ( BA:UAR +admanager.googleapis.com/User$networks/{network_code}/users/{user}*users2userB +com.google.ads.admanager.v1BUserMessagesProtoPZ@google.golang.org/genproto/googleapis/ads/admanager/v1;admanagerGoogle.Ads.AdManager.V1Google\\Ads\\AdManager\\V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/AdsAdManager/metadata/V1/UserService.php b/AdsAdManager/metadata/V1/UserService.php new file mode 100644 index 000000000000..9bd35f41953e --- /dev/null +++ b/AdsAdManager/metadata/V1/UserService.php @@ -0,0 +1,37 @@ +internalAddGeneratedFile( + ' + +*google/ads/admanager/v1/user_service.protogoogle.ads.admanager.v1google/api/annotations.protogoogle/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto"E +GetUserRequest3 +name ( B%AA +admanager.googleapis.com/User2 + UserService +GetUser\'.google.ads.admanager.v1.GetUserRequest.google.ads.admanager.v1.User",Aname/v1/{name=networks/*/users/*}Aadmanager.googleapis.comB +com.google.ads.admanager.v1BUserServiceProtoPZ@google.golang.org/genproto/googleapis/ads/admanager/v1;admanagerGoogle.Ads.AdManager.V1Google\\Ads\\AdManager\\V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/AdsAdManager/owlbot.py b/AdsAdManager/owlbot.py new file mode 100644 index 000000000000..361341924d7c --- /dev/null +++ b/AdsAdManager/owlbot.py @@ -0,0 +1,56 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""This script is used to synthesize generated parts of this library.""" + +import logging +from pathlib import Path +import subprocess + +import synthtool as s +from synthtool.languages import php +from synthtool import _tracked_paths + +logging.basicConfig(level=logging.DEBUG) + +src = Path(f"../{php.STAGING_DIR}/AdsAdManager").resolve() +dest = Path().resolve() + +# Added so that we can pass copy_excludes in the owlbot_main() call +_tracked_paths.add(src) + +php.owlbot_main(src=src, dest=dest) + +# remove class_alias code +s.replace( + "src/V*/**/*.php", + r"^// Adding a class alias for backwards compatibility with the previous class name.$" + + "\n" + + r"^class_alias\(.*\);$" + + "\n", + '') + +# format generated clients +subprocess.run([ + 'npm', + 'exec', + '--yes', + '--package=@prettier/plugin-php@^0.16', + '--', + 'prettier', + '**/Client/*', + '--write', + '--parser=php', + '--single-quote', + '--print-width=120']) diff --git a/AdsAdManager/phpunit.xml.dist b/AdsAdManager/phpunit.xml.dist new file mode 100644 index 000000000000..97699d75cfd8 --- /dev/null +++ b/AdsAdManager/phpunit.xml.dist @@ -0,0 +1,16 @@ + + + + + src + + + src/V[!a-zA-Z]* + + + + + tests/Unit + + + diff --git a/AdsAdManager/samples/V1/AdUnitServiceClient/get_ad_unit.php b/AdsAdManager/samples/V1/AdUnitServiceClient/get_ad_unit.php new file mode 100644 index 000000000000..8846a613c9d3 --- /dev/null +++ b/AdsAdManager/samples/V1/AdUnitServiceClient/get_ad_unit.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var AdUnit $response */ + $response = $adUnitServiceClient->getAdUnit($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 +{ + $formattedName = AdUnitServiceClient::adUnitName('[NETWORK_CODE]', '[AD_UNIT]'); + + get_ad_unit_sample($formattedName); +} +// [END admanager_v1_generated_AdUnitService_GetAdUnit_sync] diff --git a/AdsAdManager/samples/V1/AdUnitServiceClient/list_ad_unit_sizes.php b/AdsAdManager/samples/V1/AdUnitServiceClient/list_ad_unit_sizes.php new file mode 100644 index 000000000000..ab8027b0a04f --- /dev/null +++ b/AdsAdManager/samples/V1/AdUnitServiceClient/list_ad_unit_sizes.php @@ -0,0 +1,75 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $adUnitServiceClient->listAdUnitSizes($request); + + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = AdUnitServiceClient::networkName('[NETWORK_CODE]'); + + list_ad_unit_sizes_sample($formattedParent); +} +// [END admanager_v1_generated_AdUnitService_ListAdUnitSizes_sync] diff --git a/AdsAdManager/samples/V1/AdUnitServiceClient/list_ad_units.php b/AdsAdManager/samples/V1/AdUnitServiceClient/list_ad_units.php new file mode 100644 index 000000000000..f1538e9f9629 --- /dev/null +++ b/AdsAdManager/samples/V1/AdUnitServiceClient/list_ad_units.php @@ -0,0 +1,75 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $adUnitServiceClient->listAdUnits($request); + + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = AdUnitServiceClient::networkName('[NETWORK_CODE]'); + + list_ad_units_sample($formattedParent); +} +// [END admanager_v1_generated_AdUnitService_ListAdUnits_sync] diff --git a/AdsAdManager/samples/V1/CompanyServiceClient/get_company.php b/AdsAdManager/samples/V1/CompanyServiceClient/get_company.php new file mode 100644 index 000000000000..0c1e0dc60633 --- /dev/null +++ b/AdsAdManager/samples/V1/CompanyServiceClient/get_company.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Company $response */ + $response = $companyServiceClient->getCompany($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 +{ + $formattedName = CompanyServiceClient::companyName('[NETWORK_CODE]', '[COMPANY]'); + + get_company_sample($formattedName); +} +// [END admanager_v1_generated_CompanyService_GetCompany_sync] diff --git a/AdsAdManager/samples/V1/CompanyServiceClient/list_companies.php b/AdsAdManager/samples/V1/CompanyServiceClient/list_companies.php new file mode 100644 index 000000000000..ce3426dcd278 --- /dev/null +++ b/AdsAdManager/samples/V1/CompanyServiceClient/list_companies.php @@ -0,0 +1,75 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $companyServiceClient->listCompanies($request); + + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = CompanyServiceClient::networkName('[NETWORK_CODE]'); + + list_companies_sample($formattedParent); +} +// [END admanager_v1_generated_CompanyService_ListCompanies_sync] diff --git a/AdsAdManager/samples/V1/CustomFieldServiceClient/get_custom_field.php b/AdsAdManager/samples/V1/CustomFieldServiceClient/get_custom_field.php new file mode 100644 index 000000000000..1d7294b16391 --- /dev/null +++ b/AdsAdManager/samples/V1/CustomFieldServiceClient/get_custom_field.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var CustomField $response */ + $response = $customFieldServiceClient->getCustomField($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 +{ + $formattedName = CustomFieldServiceClient::customFieldName('[NETWORK_CODE]', '[CUSTOM_FIELD]'); + + get_custom_field_sample($formattedName); +} +// [END admanager_v1_generated_CustomFieldService_GetCustomField_sync] diff --git a/AdsAdManager/samples/V1/CustomFieldServiceClient/list_custom_fields.php b/AdsAdManager/samples/V1/CustomFieldServiceClient/list_custom_fields.php new file mode 100644 index 000000000000..f473dc1ef5d3 --- /dev/null +++ b/AdsAdManager/samples/V1/CustomFieldServiceClient/list_custom_fields.php @@ -0,0 +1,75 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $customFieldServiceClient->listCustomFields($request); + + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = CustomFieldServiceClient::networkName('[NETWORK_CODE]'); + + list_custom_fields_sample($formattedParent); +} +// [END admanager_v1_generated_CustomFieldService_ListCustomFields_sync] diff --git a/AdsAdManager/samples/V1/CustomTargetingKeyServiceClient/get_custom_targeting_key.php b/AdsAdManager/samples/V1/CustomTargetingKeyServiceClient/get_custom_targeting_key.php new file mode 100644 index 000000000000..4ac51252a78c --- /dev/null +++ b/AdsAdManager/samples/V1/CustomTargetingKeyServiceClient/get_custom_targeting_key.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var CustomTargetingKey $response */ + $response = $customTargetingKeyServiceClient->getCustomTargetingKey($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 +{ + $formattedName = CustomTargetingKeyServiceClient::customTargetingKeyName( + '[NETWORK_CODE]', + '[CUSTOM_TARGETING_KEY]' + ); + + get_custom_targeting_key_sample($formattedName); +} +// [END admanager_v1_generated_CustomTargetingKeyService_GetCustomTargetingKey_sync] diff --git a/AdsAdManager/samples/V1/CustomTargetingKeyServiceClient/list_custom_targeting_keys.php b/AdsAdManager/samples/V1/CustomTargetingKeyServiceClient/list_custom_targeting_keys.php new file mode 100644 index 000000000000..29e88c3c2904 --- /dev/null +++ b/AdsAdManager/samples/V1/CustomTargetingKeyServiceClient/list_custom_targeting_keys.php @@ -0,0 +1,75 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $customTargetingKeyServiceClient->listCustomTargetingKeys($request); + + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = CustomTargetingKeyServiceClient::networkName('[NETWORK_CODE]'); + + list_custom_targeting_keys_sample($formattedParent); +} +// [END admanager_v1_generated_CustomTargetingKeyService_ListCustomTargetingKeys_sync] diff --git a/AdsAdManager/samples/V1/CustomTargetingValueServiceClient/get_custom_targeting_value.php b/AdsAdManager/samples/V1/CustomTargetingValueServiceClient/get_custom_targeting_value.php new file mode 100644 index 000000000000..4f15dfc8c026 --- /dev/null +++ b/AdsAdManager/samples/V1/CustomTargetingValueServiceClient/get_custom_targeting_value.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var CustomTargetingValue $response */ + $response = $customTargetingValueServiceClient->getCustomTargetingValue($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 +{ + $formattedName = CustomTargetingValueServiceClient::customTargetingValueName( + '[NETWORK_CODE]', + '[CUSTOM_TARGETING_KEY]', + '[CUSTOM_TARGETING_VALUE]' + ); + + get_custom_targeting_value_sample($formattedName); +} +// [END admanager_v1_generated_CustomTargetingValueService_GetCustomTargetingValue_sync] diff --git a/AdsAdManager/samples/V1/CustomTargetingValueServiceClient/list_custom_targeting_values.php b/AdsAdManager/samples/V1/CustomTargetingValueServiceClient/list_custom_targeting_values.php new file mode 100644 index 000000000000..f2e059ab37d9 --- /dev/null +++ b/AdsAdManager/samples/V1/CustomTargetingValueServiceClient/list_custom_targeting_values.php @@ -0,0 +1,79 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $customTargetingValueServiceClient->listCustomTargetingValues($request); + + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = CustomTargetingValueServiceClient::customTargetingKeyName( + '[NETWORK_CODE]', + '[CUSTOM_TARGETING_KEY]' + ); + + list_custom_targeting_values_sample($formattedParent); +} +// [END admanager_v1_generated_CustomTargetingValueService_ListCustomTargetingValues_sync] diff --git a/AdsAdManager/samples/V1/EntitySignalsMappingServiceClient/batch_create_entity_signals_mappings.php b/AdsAdManager/samples/V1/EntitySignalsMappingServiceClient/batch_create_entity_signals_mappings.php new file mode 100644 index 000000000000..a7b924a0dd25 --- /dev/null +++ b/AdsAdManager/samples/V1/EntitySignalsMappingServiceClient/batch_create_entity_signals_mappings.php @@ -0,0 +1,99 @@ +setTaxonomyCategoryIds($requestsEntitySignalsMappingTaxonomyCategoryIds); + $createEntitySignalsMappingRequest = (new CreateEntitySignalsMappingRequest()) + ->setParent($formattedRequestsParent) + ->setEntitySignalsMapping($requestsEntitySignalsMapping); + $requests = [$createEntitySignalsMappingRequest,]; + $request = (new BatchCreateEntitySignalsMappingsRequest()) + ->setParent($formattedParent) + ->setRequests($requests); + + // Call the API and handle any network failures. + try { + /** @var BatchCreateEntitySignalsMappingsResponse $response */ + $response = $entitySignalsMappingServiceClient->batchCreateEntitySignalsMappings($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 +{ + $formattedParent = EntitySignalsMappingServiceClient::networkName('[NETWORK_CODE]'); + $formattedRequestsParent = EntitySignalsMappingServiceClient::networkName('[NETWORK_CODE]'); + $requestsEntitySignalsMappingTaxonomyCategoryIdsElement = 0; + + batch_create_entity_signals_mappings_sample( + $formattedParent, + $formattedRequestsParent, + $requestsEntitySignalsMappingTaxonomyCategoryIdsElement + ); +} +// [END admanager_v1_generated_EntitySignalsMappingService_BatchCreateEntitySignalsMappings_sync] diff --git a/AdsAdManager/samples/V1/EntitySignalsMappingServiceClient/batch_update_entity_signals_mappings.php b/AdsAdManager/samples/V1/EntitySignalsMappingServiceClient/batch_update_entity_signals_mappings.php new file mode 100644 index 000000000000..3a8f3c005f14 --- /dev/null +++ b/AdsAdManager/samples/V1/EntitySignalsMappingServiceClient/batch_update_entity_signals_mappings.php @@ -0,0 +1,95 @@ +setTaxonomyCategoryIds($requestsEntitySignalsMappingTaxonomyCategoryIds); + $requestsUpdateMask = new FieldMask(); + $updateEntitySignalsMappingRequest = (new UpdateEntitySignalsMappingRequest()) + ->setEntitySignalsMapping($requestsEntitySignalsMapping) + ->setUpdateMask($requestsUpdateMask); + $requests = [$updateEntitySignalsMappingRequest,]; + $request = (new BatchUpdateEntitySignalsMappingsRequest()) + ->setParent($formattedParent) + ->setRequests($requests); + + // Call the API and handle any network failures. + try { + /** @var BatchUpdateEntitySignalsMappingsResponse $response */ + $response = $entitySignalsMappingServiceClient->batchUpdateEntitySignalsMappings($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 +{ + $formattedParent = EntitySignalsMappingServiceClient::networkName('[NETWORK_CODE]'); + $requestsEntitySignalsMappingTaxonomyCategoryIdsElement = 0; + + batch_update_entity_signals_mappings_sample( + $formattedParent, + $requestsEntitySignalsMappingTaxonomyCategoryIdsElement + ); +} +// [END admanager_v1_generated_EntitySignalsMappingService_BatchUpdateEntitySignalsMappings_sync] diff --git a/AdsAdManager/samples/V1/EntitySignalsMappingServiceClient/create_entity_signals_mapping.php b/AdsAdManager/samples/V1/EntitySignalsMappingServiceClient/create_entity_signals_mapping.php new file mode 100644 index 000000000000..c1fb72f8b838 --- /dev/null +++ b/AdsAdManager/samples/V1/EntitySignalsMappingServiceClient/create_entity_signals_mapping.php @@ -0,0 +1,84 @@ +setTaxonomyCategoryIds($entitySignalsMappingTaxonomyCategoryIds); + $request = (new CreateEntitySignalsMappingRequest()) + ->setParent($formattedParent) + ->setEntitySignalsMapping($entitySignalsMapping); + + // Call the API and handle any network failures. + try { + /** @var EntitySignalsMapping $response */ + $response = $entitySignalsMappingServiceClient->createEntitySignalsMapping($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 +{ + $formattedParent = EntitySignalsMappingServiceClient::networkName('[NETWORK_CODE]'); + $entitySignalsMappingTaxonomyCategoryIdsElement = 0; + + create_entity_signals_mapping_sample( + $formattedParent, + $entitySignalsMappingTaxonomyCategoryIdsElement + ); +} +// [END admanager_v1_generated_EntitySignalsMappingService_CreateEntitySignalsMapping_sync] diff --git a/AdsAdManager/samples/V1/EntitySignalsMappingServiceClient/get_entity_signals_mapping.php b/AdsAdManager/samples/V1/EntitySignalsMappingServiceClient/get_entity_signals_mapping.php new file mode 100644 index 000000000000..7b7aaf4d0295 --- /dev/null +++ b/AdsAdManager/samples/V1/EntitySignalsMappingServiceClient/get_entity_signals_mapping.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var EntitySignalsMapping $response */ + $response = $entitySignalsMappingServiceClient->getEntitySignalsMapping($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 +{ + $formattedName = EntitySignalsMappingServiceClient::entitySignalsMappingName( + '[NETWORK_CODE]', + '[ENTITY_SIGNALS_MAPPING]' + ); + + get_entity_signals_mapping_sample($formattedName); +} +// [END admanager_v1_generated_EntitySignalsMappingService_GetEntitySignalsMapping_sync] diff --git a/AdsAdManager/samples/V1/EntitySignalsMappingServiceClient/list_entity_signals_mappings.php b/AdsAdManager/samples/V1/EntitySignalsMappingServiceClient/list_entity_signals_mappings.php new file mode 100644 index 000000000000..d52e3906c8af --- /dev/null +++ b/AdsAdManager/samples/V1/EntitySignalsMappingServiceClient/list_entity_signals_mappings.php @@ -0,0 +1,75 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $entitySignalsMappingServiceClient->listEntitySignalsMappings($request); + + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = EntitySignalsMappingServiceClient::networkName('[NETWORK_CODE]'); + + list_entity_signals_mappings_sample($formattedParent); +} +// [END admanager_v1_generated_EntitySignalsMappingService_ListEntitySignalsMappings_sync] diff --git a/AdsAdManager/samples/V1/EntitySignalsMappingServiceClient/update_entity_signals_mapping.php b/AdsAdManager/samples/V1/EntitySignalsMappingServiceClient/update_entity_signals_mapping.php new file mode 100644 index 000000000000..a845c4403460 --- /dev/null +++ b/AdsAdManager/samples/V1/EntitySignalsMappingServiceClient/update_entity_signals_mapping.php @@ -0,0 +1,78 @@ +setTaxonomyCategoryIds($entitySignalsMappingTaxonomyCategoryIds); + $updateMask = new FieldMask(); + $request = (new UpdateEntitySignalsMappingRequest()) + ->setEntitySignalsMapping($entitySignalsMapping) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var EntitySignalsMapping $response */ + $response = $entitySignalsMappingServiceClient->updateEntitySignalsMapping($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 +{ + $entitySignalsMappingTaxonomyCategoryIdsElement = 0; + + update_entity_signals_mapping_sample($entitySignalsMappingTaxonomyCategoryIdsElement); +} +// [END admanager_v1_generated_EntitySignalsMappingService_UpdateEntitySignalsMapping_sync] diff --git a/AdsAdManager/samples/V1/NetworkServiceClient/get_network.php b/AdsAdManager/samples/V1/NetworkServiceClient/get_network.php new file mode 100644 index 000000000000..9818680de8f5 --- /dev/null +++ b/AdsAdManager/samples/V1/NetworkServiceClient/get_network.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Network $response */ + $response = $networkServiceClient->getNetwork($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 +{ + $formattedName = NetworkServiceClient::networkName('[NETWORK_CODE]'); + + get_network_sample($formattedName); +} +// [END admanager_v1_generated_NetworkService_GetNetwork_sync] diff --git a/AdsAdManager/samples/V1/NetworkServiceClient/list_networks.php b/AdsAdManager/samples/V1/NetworkServiceClient/list_networks.php new file mode 100644 index 000000000000..aa1441a7bd6c --- /dev/null +++ b/AdsAdManager/samples/V1/NetworkServiceClient/list_networks.php @@ -0,0 +1,57 @@ +listNetworks($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END admanager_v1_generated_NetworkService_ListNetworks_sync] diff --git a/AdsAdManager/samples/V1/OrderServiceClient/get_order.php b/AdsAdManager/samples/V1/OrderServiceClient/get_order.php new file mode 100644 index 000000000000..5fe249566baf --- /dev/null +++ b/AdsAdManager/samples/V1/OrderServiceClient/get_order.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Order $response */ + $response = $orderServiceClient->getOrder($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 +{ + $formattedName = OrderServiceClient::orderName('[NETWORK_CODE]', '[ORDER]'); + + get_order_sample($formattedName); +} +// [END admanager_v1_generated_OrderService_GetOrder_sync] diff --git a/AdsAdManager/samples/V1/OrderServiceClient/list_orders.php b/AdsAdManager/samples/V1/OrderServiceClient/list_orders.php new file mode 100644 index 000000000000..5d7c96bdc617 --- /dev/null +++ b/AdsAdManager/samples/V1/OrderServiceClient/list_orders.php @@ -0,0 +1,80 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $orderServiceClient->listOrders($request); + + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = OrderServiceClient::networkName('[NETWORK_CODE]'); + + list_orders_sample($formattedParent); +} +// [END admanager_v1_generated_OrderService_ListOrders_sync] diff --git a/AdsAdManager/samples/V1/PlacementServiceClient/get_placement.php b/AdsAdManager/samples/V1/PlacementServiceClient/get_placement.php new file mode 100644 index 000000000000..b9b03f3758f2 --- /dev/null +++ b/AdsAdManager/samples/V1/PlacementServiceClient/get_placement.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Placement $response */ + $response = $placementServiceClient->getPlacement($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 +{ + $formattedName = PlacementServiceClient::placementName('[NETWORK_CODE]', '[PLACEMENT]'); + + get_placement_sample($formattedName); +} +// [END admanager_v1_generated_PlacementService_GetPlacement_sync] diff --git a/AdsAdManager/samples/V1/PlacementServiceClient/list_placements.php b/AdsAdManager/samples/V1/PlacementServiceClient/list_placements.php new file mode 100644 index 000000000000..bd1d6b8e230b --- /dev/null +++ b/AdsAdManager/samples/V1/PlacementServiceClient/list_placements.php @@ -0,0 +1,75 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $placementServiceClient->listPlacements($request); + + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = PlacementServiceClient::networkName('[NETWORK_CODE]'); + + list_placements_sample($formattedParent); +} +// [END admanager_v1_generated_PlacementService_ListPlacements_sync] diff --git a/AdsAdManager/samples/V1/ReportServiceClient/create_report.php b/AdsAdManager/samples/V1/ReportServiceClient/create_report.php new file mode 100644 index 000000000000..ca38b7b8f5fe --- /dev/null +++ b/AdsAdManager/samples/V1/ReportServiceClient/create_report.php @@ -0,0 +1,105 @@ +setDimensions($reportReportDefinitionDimensions) + ->setMetrics($reportReportDefinitionMetrics) + ->setDateRange($reportReportDefinitionDateRange) + ->setReportType($reportReportDefinitionReportType); + $report = (new Report()) + ->setReportDefinition($reportReportDefinition); + $request = (new CreateReportRequest()) + ->setParent($formattedParent) + ->setReport($report); + + // Call the API and handle any network failures. + try { + /** @var Report $response */ + $response = $reportServiceClient->createReport($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 +{ + $formattedParent = ReportServiceClient::networkName('[NETWORK_CODE]'); + $reportReportDefinitionDimensionsElement = Dimension::DIMENSION_UNSPECIFIED; + $reportReportDefinitionMetricsElement = Metric::METRIC_UNSPECIFIED; + $reportReportDefinitionReportType = ReportType::REPORT_TYPE_UNSPECIFIED; + + create_report_sample( + $formattedParent, + $reportReportDefinitionDimensionsElement, + $reportReportDefinitionMetricsElement, + $reportReportDefinitionReportType + ); +} +// [END admanager_v1_generated_ReportService_CreateReport_sync] diff --git a/AdsAdManager/samples/V1/ReportServiceClient/fetch_report_result_rows.php b/AdsAdManager/samples/V1/ReportServiceClient/fetch_report_result_rows.php new file mode 100644 index 000000000000..3f7124c71921 --- /dev/null +++ b/AdsAdManager/samples/V1/ReportServiceClient/fetch_report_result_rows.php @@ -0,0 +1,60 @@ +fetchReportResultRows($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END admanager_v1_generated_ReportService_FetchReportResultRows_sync] diff --git a/AdsAdManager/samples/V1/ReportServiceClient/get_report.php b/AdsAdManager/samples/V1/ReportServiceClient/get_report.php new file mode 100644 index 000000000000..0b5d5b11d47e --- /dev/null +++ b/AdsAdManager/samples/V1/ReportServiceClient/get_report.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Report $response */ + $response = $reportServiceClient->getReport($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 +{ + $formattedName = ReportServiceClient::reportName('[NETWORK_CODE]', '[REPORT]'); + + get_report_sample($formattedName); +} +// [END admanager_v1_generated_ReportService_GetReport_sync] diff --git a/AdsAdManager/samples/V1/ReportServiceClient/list_reports.php b/AdsAdManager/samples/V1/ReportServiceClient/list_reports.php new file mode 100644 index 000000000000..aa12df99e9cb --- /dev/null +++ b/AdsAdManager/samples/V1/ReportServiceClient/list_reports.php @@ -0,0 +1,75 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $reportServiceClient->listReports($request); + + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = ReportServiceClient::networkName('[NETWORK_CODE]'); + + list_reports_sample($formattedParent); +} +// [END admanager_v1_generated_ReportService_ListReports_sync] diff --git a/AdsAdManager/samples/V1/ReportServiceClient/run_report.php b/AdsAdManager/samples/V1/ReportServiceClient/run_report.php new file mode 100644 index 000000000000..d3e4d98a6ef8 --- /dev/null +++ b/AdsAdManager/samples/V1/ReportServiceClient/run_report.php @@ -0,0 +1,91 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $reportServiceClient->runReport($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var RunReportResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $formattedName = ReportServiceClient::reportName('[NETWORK_CODE]', '[REPORT]'); + + run_report_sample($formattedName); +} +// [END admanager_v1_generated_ReportService_RunReport_sync] diff --git a/AdsAdManager/samples/V1/ReportServiceClient/update_report.php b/AdsAdManager/samples/V1/ReportServiceClient/update_report.php new file mode 100644 index 000000000000..84e9e65464c1 --- /dev/null +++ b/AdsAdManager/samples/V1/ReportServiceClient/update_report.php @@ -0,0 +1,101 @@ +setDimensions($reportReportDefinitionDimensions) + ->setMetrics($reportReportDefinitionMetrics) + ->setDateRange($reportReportDefinitionDateRange) + ->setReportType($reportReportDefinitionReportType); + $report = (new Report()) + ->setReportDefinition($reportReportDefinition); + $updateMask = new FieldMask(); + $request = (new UpdateReportRequest()) + ->setReport($report) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var Report $response */ + $response = $reportServiceClient->updateReport($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 +{ + $reportReportDefinitionDimensionsElement = Dimension::DIMENSION_UNSPECIFIED; + $reportReportDefinitionMetricsElement = Metric::METRIC_UNSPECIFIED; + $reportReportDefinitionReportType = ReportType::REPORT_TYPE_UNSPECIFIED; + + update_report_sample( + $reportReportDefinitionDimensionsElement, + $reportReportDefinitionMetricsElement, + $reportReportDefinitionReportType + ); +} +// [END admanager_v1_generated_ReportService_UpdateReport_sync] diff --git a/AdsAdManager/samples/V1/RoleServiceClient/get_role.php b/AdsAdManager/samples/V1/RoleServiceClient/get_role.php new file mode 100644 index 000000000000..3204222ed446 --- /dev/null +++ b/AdsAdManager/samples/V1/RoleServiceClient/get_role.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Role $response */ + $response = $roleServiceClient->getRole($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 +{ + $formattedName = RoleServiceClient::roleName('[NETWORK_CODE]', '[ROLE]'); + + get_role_sample($formattedName); +} +// [END admanager_v1_generated_RoleService_GetRole_sync] diff --git a/AdsAdManager/samples/V1/RoleServiceClient/list_roles.php b/AdsAdManager/samples/V1/RoleServiceClient/list_roles.php new file mode 100644 index 000000000000..d9adaa30e69c --- /dev/null +++ b/AdsAdManager/samples/V1/RoleServiceClient/list_roles.php @@ -0,0 +1,75 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $roleServiceClient->listRoles($request); + + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = RoleServiceClient::networkName('[NETWORK_CODE]'); + + list_roles_sample($formattedParent); +} +// [END admanager_v1_generated_RoleService_ListRoles_sync] diff --git a/AdsAdManager/samples/V1/TaxonomyCategoryServiceClient/get_taxonomy_category.php b/AdsAdManager/samples/V1/TaxonomyCategoryServiceClient/get_taxonomy_category.php new file mode 100644 index 000000000000..b0688bd41755 --- /dev/null +++ b/AdsAdManager/samples/V1/TaxonomyCategoryServiceClient/get_taxonomy_category.php @@ -0,0 +1,75 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var TaxonomyCategory $response */ + $response = $taxonomyCategoryServiceClient->getTaxonomyCategory($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 +{ + $formattedName = TaxonomyCategoryServiceClient::taxonomyCategoryName( + '[NETWORK_CODE]', + '[TAXONOMY_CATEGORY]' + ); + + get_taxonomy_category_sample($formattedName); +} +// [END admanager_v1_generated_TaxonomyCategoryService_GetTaxonomyCategory_sync] diff --git a/AdsAdManager/samples/V1/TaxonomyCategoryServiceClient/list_taxonomy_categories.php b/AdsAdManager/samples/V1/TaxonomyCategoryServiceClient/list_taxonomy_categories.php new file mode 100644 index 000000000000..285ee42ebaf4 --- /dev/null +++ b/AdsAdManager/samples/V1/TaxonomyCategoryServiceClient/list_taxonomy_categories.php @@ -0,0 +1,75 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $taxonomyCategoryServiceClient->listTaxonomyCategories($request); + + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->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 +{ + $formattedParent = TaxonomyCategoryServiceClient::networkName('[NETWORK_CODE]'); + + list_taxonomy_categories_sample($formattedParent); +} +// [END admanager_v1_generated_TaxonomyCategoryService_ListTaxonomyCategories_sync] diff --git a/AdsAdManager/samples/V1/UserServiceClient/get_user.php b/AdsAdManager/samples/V1/UserServiceClient/get_user.php new file mode 100644 index 000000000000..fdccc337f748 --- /dev/null +++ b/AdsAdManager/samples/V1/UserServiceClient/get_user.php @@ -0,0 +1,75 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var User $response */ + $response = $userServiceClient->getUser($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 +{ + $formattedName = UserServiceClient::userName('[NETWORK_CODE]', '[USER]'); + + get_user_sample($formattedName); +} +// [END admanager_v1_generated_UserService_GetUser_sync] diff --git a/AdsAdManager/src/V1/AdManagerError.php b/AdsAdManager/src/V1/AdManagerError.php new file mode 100644 index 000000000000..2db8e2369455 --- /dev/null +++ b/AdsAdManager/src/V1/AdManagerError.php @@ -0,0 +1,241 @@ +google.ads.admanager.v1.AdManagerError + */ +class AdManagerError extends \Google\Protobuf\Internal\Message +{ + /** + * The unique identifying string for this error. + * + * Generated from protobuf field string error_code = 1; + */ + protected $error_code = ''; + /** + * A publisher appropriate explanation of this error. + * + * Generated from protobuf field string message = 2; + */ + protected $message = ''; + /** + * The field path that triggered this error. + * + * Generated from protobuf field string field_path = 3; + */ + protected $field_path = ''; + /** + * The value that triggered this error. + * + * Generated from protobuf field string trigger = 4; + */ + protected $trigger = ''; + /** + * The stack trace that accompanies this error. + * + * Generated from protobuf field string stack_trace = 5; + */ + protected $stack_trace = ''; + /** + * A list of messages that carry any additional error details. + * + * Generated from protobuf field repeated .google.protobuf.Any details = 6; + */ + private $details; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $error_code + * The unique identifying string for this error. + * @type string $message + * A publisher appropriate explanation of this error. + * @type string $field_path + * The field path that triggered this error. + * @type string $trigger + * The value that triggered this error. + * @type string $stack_trace + * The stack trace that accompanies this error. + * @type array<\Google\Protobuf\Any>|\Google\Protobuf\Internal\RepeatedField $details + * A list of messages that carry any additional error details. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\AdmanagerError::initOnce(); + parent::__construct($data); + } + + /** + * The unique identifying string for this error. + * + * Generated from protobuf field string error_code = 1; + * @return string + */ + public function getErrorCode() + { + return $this->error_code; + } + + /** + * The unique identifying string for this error. + * + * Generated from protobuf field string error_code = 1; + * @param string $var + * @return $this + */ + public function setErrorCode($var) + { + GPBUtil::checkString($var, True); + $this->error_code = $var; + + return $this; + } + + /** + * A publisher appropriate explanation of this error. + * + * Generated from protobuf field string message = 2; + * @return string + */ + public function getMessage() + { + return $this->message; + } + + /** + * A publisher appropriate explanation of this error. + * + * Generated from protobuf field string message = 2; + * @param string $var + * @return $this + */ + public function setMessage($var) + { + GPBUtil::checkString($var, True); + $this->message = $var; + + return $this; + } + + /** + * The field path that triggered this error. + * + * Generated from protobuf field string field_path = 3; + * @return string + */ + public function getFieldPath() + { + return $this->field_path; + } + + /** + * The field path that triggered this error. + * + * Generated from protobuf field string field_path = 3; + * @param string $var + * @return $this + */ + public function setFieldPath($var) + { + GPBUtil::checkString($var, True); + $this->field_path = $var; + + return $this; + } + + /** + * The value that triggered this error. + * + * Generated from protobuf field string trigger = 4; + * @return string + */ + public function getTrigger() + { + return $this->trigger; + } + + /** + * The value that triggered this error. + * + * Generated from protobuf field string trigger = 4; + * @param string $var + * @return $this + */ + public function setTrigger($var) + { + GPBUtil::checkString($var, True); + $this->trigger = $var; + + return $this; + } + + /** + * The stack trace that accompanies this error. + * + * Generated from protobuf field string stack_trace = 5; + * @return string + */ + public function getStackTrace() + { + return $this->stack_trace; + } + + /** + * The stack trace that accompanies this error. + * + * Generated from protobuf field string stack_trace = 5; + * @param string $var + * @return $this + */ + public function setStackTrace($var) + { + GPBUtil::checkString($var, True); + $this->stack_trace = $var; + + return $this; + } + + /** + * A list of messages that carry any additional error details. + * + * Generated from protobuf field repeated .google.protobuf.Any details = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDetails() + { + return $this->details; + } + + /** + * A list of messages that carry any additional error details. + * + * Generated from protobuf field repeated .google.protobuf.Any details = 6; + * @param array<\Google\Protobuf\Any>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDetails($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Any::class); + $this->details = $arr; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/AdUnit.php b/AdsAdManager/src/V1/AdUnit.php new file mode 100644 index 000000000000..143f8778cc75 --- /dev/null +++ b/AdsAdManager/src/V1/AdUnit.php @@ -0,0 +1,1049 @@ +google.ads.admanager.v1.AdUnit + */ +class AdUnit extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The resource name of the AdUnit. + * Format: `networks/{network_code}/adUnits/{ad_unit_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. AdUnit ID. + * + * Generated from protobuf field int64 ad_unit_id = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $ad_unit_id = 0; + /** + * Required. Immutable. The AdUnit's parent. Every ad unit has a parent except + * for the root ad unit, which is created by Google. Format: + * "networks/{network_code}/adUnits/{ad_unit_id}" + * + * Generated from protobuf field string parent_ad_unit = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + */ + protected $parent_ad_unit = ''; + /** + * Output only. The path to this AdUnit in the ad unit hierarchy represented + * as a list from the root to this ad unit's parent. For root ad units, this + * list is empty. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.AdUnitParent parent_path = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $parent_path; + /** + * Required. The display name of the ad unit. Its maximum length is 255 + * characters. + * + * Generated from protobuf field string display_name = 9 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + /** + * Immutable. A string used to uniquely identify the ad unit for the purposes + * of serving the ad. This attribute is optional and can be set during ad unit + * creation. If it is not provided, it will be assigned by Google based on the + * ad unit ID. + * + * Generated from protobuf field string ad_unit_code = 2 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $ad_unit_code = ''; + /** + * Output only. The status of this ad unit. It defaults to ACTIVE. + * + * Generated from protobuf field .google.ads.admanager.v1.AdUnitStatusEnum.AdUnitStatus status = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status = 0; + /** + * Optional. The target window directly applied to this AdUnit. + * If this field is not set, this AdUnit uses the target window specified in + * effectiveTargetWindow. + * + * Generated from protobuf field .google.ads.admanager.v1.TargetWindowEnum.TargetWindow applied_target_window = 44 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $applied_target_window = 0; + /** + * Output only. Non-empty default. The target window of this AdUnit. This + * value is inherited from ancestor AdUnits and defaults to TOP if no AdUnit + * in the hierarchy specifies it. + * + * Generated from protobuf field .google.ads.admanager.v1.TargetWindowEnum.TargetWindow effective_target_window = 45 [(.google.api.field_behavior) = NON_EMPTY_DEFAULT, (.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $effective_target_window = 0; + /** + * Optional. The resource names of Teams directly applied to this AdUnit. + * Format: "networks/{network_code}/teams/{team_id}" + * + * Generated from protobuf field repeated string applied_teams = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + private $applied_teams; + /** + * Output only. The resource names of all Teams that this AdUnit is on as well + * as those inherited from parent AdUnits. Format: + * "networks/{network_code}/teams/{team_id}" + * + * Generated from protobuf field repeated string teams = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + private $teams; + /** + * Optional. A description of the ad unit. The maximum length is 65,535 + * characters. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Optional. If this field is set to true, then the AdUnit will not be + * implicitly targeted when its parent is. Traffickers must explicitly + * target such an AdUnit or else no line items will serve to it. This + * feature is only available for Ad Manager 360 accounts. + * + * Generated from protobuf field bool explicitly_targeted = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $explicitly_targeted = false; + /** + * Output only. This field is set to true if the ad unit has any children. + * + * Generated from protobuf field bool has_children = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $has_children = false; + /** + * Output only. The time this AdUnit was last modified. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Optional. The sizes that can be served inside this ad unit. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.AdUnitSize ad_unit_sizes = 14 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $ad_unit_sizes; + /** + * Optional. Determines what set top box video on demand channel this ad unit + * corresponds to in an external set top box ad campaign system. + * + * Generated from protobuf field string external_set_top_box_channel_id = 17 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $external_set_top_box_channel_id = ''; + /** + * Optional. The duration after which an Ad Unit will automatically refresh. + * This is only valid for ad units in mobile apps. If not set, the ad unit + * will not refresh. + * + * Generated from protobuf field .google.protobuf.Duration refresh_delay = 19 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $refresh_delay = null; + /** + * Optional. The set of labels applied directly to this ad unit. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.AppliedLabel applied_labels = 21 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $applied_labels; + /** + * Output only. Contains the set of labels applied directly to the ad unit as + * well as those inherited from the parent ad units. If a label has been + * negated, only the negated label is returned. This field is readonly and is + * assigned by Google. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.AppliedLabel effective_applied_labels = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $effective_applied_labels; + /** + * Optional. The set of label frequency caps applied directly to this ad unit. + * There is a limit of 10 label frequency caps per ad unit. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.LabelFrequencyCap applied_label_frequency_caps = 23 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $applied_label_frequency_caps; + /** + * Output only. The label frequency caps applied directly to the ad unit as + * well as those inherited from parent ad units. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.LabelFrequencyCap effective_label_frequency_caps = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $effective_label_frequency_caps; + /** + * Optional. The smart size mode for this ad unit. This attribute is optional + * and defaults to SmartSizeMode.NONE for fixed sizes. + * + * Generated from protobuf field .google.ads.admanager.v1.SmartSizeModeEnum.SmartSizeMode smart_size_mode = 25 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $smart_size_mode = 0; + /** + * Optional. The value of AdSense enabled directly applied to this ad unit. + * This attribute is optional and if not specified this ad unit will inherit + * the value of effectiveAdsenseEnabled from its ancestors. + * + * Generated from protobuf field optional bool applied_adsense_enabled = 26 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $applied_adsense_enabled = null; + /** + * Output only. Specifies whether or not the AdUnit is enabled for serving ads + * from the AdSense content network. This attribute defaults to the ad unit's + * parent or ancestor's setting if one has been set. If no ancestor of the ad + * unit has set appliedAdsenseEnabled, the attribute is defaulted to true. + * + * Generated from protobuf field bool effective_adsense_enabled = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $effective_adsense_enabled = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The resource name of the AdUnit. + * Format: `networks/{network_code}/adUnits/{ad_unit_id}` + * @type int|string $ad_unit_id + * Output only. AdUnit ID. + * @type string $parent_ad_unit + * Required. Immutable. The AdUnit's parent. Every ad unit has a parent except + * for the root ad unit, which is created by Google. Format: + * "networks/{network_code}/adUnits/{ad_unit_id}" + * @type array<\Google\Ads\AdManager\V1\AdUnitParent>|\Google\Protobuf\Internal\RepeatedField $parent_path + * Output only. The path to this AdUnit in the ad unit hierarchy represented + * as a list from the root to this ad unit's parent. For root ad units, this + * list is empty. + * @type string $display_name + * Required. The display name of the ad unit. Its maximum length is 255 + * characters. + * @type string $ad_unit_code + * Immutable. A string used to uniquely identify the ad unit for the purposes + * of serving the ad. This attribute is optional and can be set during ad unit + * creation. If it is not provided, it will be assigned by Google based on the + * ad unit ID. + * @type int $status + * Output only. The status of this ad unit. It defaults to ACTIVE. + * @type int $applied_target_window + * Optional. The target window directly applied to this AdUnit. + * If this field is not set, this AdUnit uses the target window specified in + * effectiveTargetWindow. + * @type int $effective_target_window + * Output only. Non-empty default. The target window of this AdUnit. This + * value is inherited from ancestor AdUnits and defaults to TOP if no AdUnit + * in the hierarchy specifies it. + * @type array|\Google\Protobuf\Internal\RepeatedField $applied_teams + * Optional. The resource names of Teams directly applied to this AdUnit. + * Format: "networks/{network_code}/teams/{team_id}" + * @type array|\Google\Protobuf\Internal\RepeatedField $teams + * Output only. The resource names of all Teams that this AdUnit is on as well + * as those inherited from parent AdUnits. Format: + * "networks/{network_code}/teams/{team_id}" + * @type string $description + * Optional. A description of the ad unit. The maximum length is 65,535 + * characters. + * @type bool $explicitly_targeted + * Optional. If this field is set to true, then the AdUnit will not be + * implicitly targeted when its parent is. Traffickers must explicitly + * target such an AdUnit or else no line items will serve to it. This + * feature is only available for Ad Manager 360 accounts. + * @type bool $has_children + * Output only. This field is set to true if the ad unit has any children. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The time this AdUnit was last modified. + * @type array<\Google\Ads\AdManager\V1\AdUnitSize>|\Google\Protobuf\Internal\RepeatedField $ad_unit_sizes + * Optional. The sizes that can be served inside this ad unit. + * @type string $external_set_top_box_channel_id + * Optional. Determines what set top box video on demand channel this ad unit + * corresponds to in an external set top box ad campaign system. + * @type \Google\Protobuf\Duration $refresh_delay + * Optional. The duration after which an Ad Unit will automatically refresh. + * This is only valid for ad units in mobile apps. If not set, the ad unit + * will not refresh. + * @type array<\Google\Ads\AdManager\V1\AppliedLabel>|\Google\Protobuf\Internal\RepeatedField $applied_labels + * Optional. The set of labels applied directly to this ad unit. + * @type array<\Google\Ads\AdManager\V1\AppliedLabel>|\Google\Protobuf\Internal\RepeatedField $effective_applied_labels + * Output only. Contains the set of labels applied directly to the ad unit as + * well as those inherited from the parent ad units. If a label has been + * negated, only the negated label is returned. This field is readonly and is + * assigned by Google. + * @type array<\Google\Ads\AdManager\V1\LabelFrequencyCap>|\Google\Protobuf\Internal\RepeatedField $applied_label_frequency_caps + * Optional. The set of label frequency caps applied directly to this ad unit. + * There is a limit of 10 label frequency caps per ad unit. + * @type array<\Google\Ads\AdManager\V1\LabelFrequencyCap>|\Google\Protobuf\Internal\RepeatedField $effective_label_frequency_caps + * Output only. The label frequency caps applied directly to the ad unit as + * well as those inherited from parent ad units. + * @type int $smart_size_mode + * Optional. The smart size mode for this ad unit. This attribute is optional + * and defaults to SmartSizeMode.NONE for fixed sizes. + * @type bool $applied_adsense_enabled + * Optional. The value of AdSense enabled directly applied to this ad unit. + * This attribute is optional and if not specified this ad unit will inherit + * the value of effectiveAdsenseEnabled from its ancestors. + * @type bool $effective_adsense_enabled + * Output only. Specifies whether or not the AdUnit is enabled for serving ads + * from the AdSense content network. This attribute defaults to the ad unit's + * parent or ancestor's setting if one has been set. If no ancestor of the ad + * unit has set appliedAdsenseEnabled, the attribute is defaulted to true. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\AdUnitMessages::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The resource name of the AdUnit. + * Format: `networks/{network_code}/adUnits/{ad_unit_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The resource name of the AdUnit. + * Format: `networks/{network_code}/adUnits/{ad_unit_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. AdUnit ID. + * + * Generated from protobuf field int64 ad_unit_id = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getAdUnitId() + { + return $this->ad_unit_id; + } + + /** + * Output only. AdUnit ID. + * + * Generated from protobuf field int64 ad_unit_id = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setAdUnitId($var) + { + GPBUtil::checkInt64($var); + $this->ad_unit_id = $var; + + return $this; + } + + /** + * Required. Immutable. The AdUnit's parent. Every ad unit has a parent except + * for the root ad unit, which is created by Google. Format: + * "networks/{network_code}/adUnits/{ad_unit_id}" + * + * Generated from protobuf field string parent_ad_unit = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @return string + */ + public function getParentAdUnit() + { + return $this->parent_ad_unit; + } + + /** + * Required. Immutable. The AdUnit's parent. Every ad unit has a parent except + * for the root ad unit, which is created by Google. Format: + * "networks/{network_code}/adUnits/{ad_unit_id}" + * + * Generated from protobuf field string parent_ad_unit = 10 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParentAdUnit($var) + { + GPBUtil::checkString($var, True); + $this->parent_ad_unit = $var; + + return $this; + } + + /** + * Output only. The path to this AdUnit in the ad unit hierarchy represented + * as a list from the root to this ad unit's parent. For root ad units, this + * list is empty. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.AdUnitParent parent_path = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getParentPath() + { + return $this->parent_path; + } + + /** + * Output only. The path to this AdUnit in the ad unit hierarchy represented + * as a list from the root to this ad unit's parent. For root ad units, this + * list is empty. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.AdUnitParent parent_path = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Ads\AdManager\V1\AdUnitParent>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setParentPath($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\AdUnitParent::class); + $this->parent_path = $arr; + + return $this; + } + + /** + * Required. The display name of the ad unit. Its maximum length is 255 + * characters. + * + * Generated from protobuf field string display_name = 9 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. The display name of the ad unit. Its maximum length is 255 + * characters. + * + * Generated from protobuf field string display_name = 9 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Immutable. A string used to uniquely identify the ad unit for the purposes + * of serving the ad. This attribute is optional and can be set during ad unit + * creation. If it is not provided, it will be assigned by Google based on the + * ad unit ID. + * + * Generated from protobuf field string ad_unit_code = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getAdUnitCode() + { + return $this->ad_unit_code; + } + + /** + * Immutable. A string used to uniquely identify the ad unit for the purposes + * of serving the ad. This attribute is optional and can be set during ad unit + * creation. If it is not provided, it will be assigned by Google based on the + * ad unit ID. + * + * Generated from protobuf field string ad_unit_code = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setAdUnitCode($var) + { + GPBUtil::checkString($var, True); + $this->ad_unit_code = $var; + + return $this; + } + + /** + * Output only. The status of this ad unit. It defaults to ACTIVE. + * + * Generated from protobuf field .google.ads.admanager.v1.AdUnitStatusEnum.AdUnitStatus status = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getStatus() + { + return $this->status; + } + + /** + * Output only. The status of this ad unit. It defaults to ACTIVE. + * + * Generated from protobuf field .google.ads.admanager.v1.AdUnitStatusEnum.AdUnitStatus status = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkEnum($var, \Google\Ads\AdManager\V1\AdUnitStatusEnum\AdUnitStatus::class); + $this->status = $var; + + return $this; + } + + /** + * Optional. The target window directly applied to this AdUnit. + * If this field is not set, this AdUnit uses the target window specified in + * effectiveTargetWindow. + * + * Generated from protobuf field .google.ads.admanager.v1.TargetWindowEnum.TargetWindow applied_target_window = 44 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getAppliedTargetWindow() + { + return $this->applied_target_window; + } + + /** + * Optional. The target window directly applied to this AdUnit. + * If this field is not set, this AdUnit uses the target window specified in + * effectiveTargetWindow. + * + * Generated from protobuf field .google.ads.admanager.v1.TargetWindowEnum.TargetWindow applied_target_window = 44 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setAppliedTargetWindow($var) + { + GPBUtil::checkEnum($var, \Google\Ads\AdManager\V1\TargetWindowEnum\TargetWindow::class); + $this->applied_target_window = $var; + + return $this; + } + + /** + * Output only. Non-empty default. The target window of this AdUnit. This + * value is inherited from ancestor AdUnits and defaults to TOP if no AdUnit + * in the hierarchy specifies it. + * + * Generated from protobuf field .google.ads.admanager.v1.TargetWindowEnum.TargetWindow effective_target_window = 45 [(.google.api.field_behavior) = NON_EMPTY_DEFAULT, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getEffectiveTargetWindow() + { + return $this->effective_target_window; + } + + /** + * Output only. Non-empty default. The target window of this AdUnit. This + * value is inherited from ancestor AdUnits and defaults to TOP if no AdUnit + * in the hierarchy specifies it. + * + * Generated from protobuf field .google.ads.admanager.v1.TargetWindowEnum.TargetWindow effective_target_window = 45 [(.google.api.field_behavior) = NON_EMPTY_DEFAULT, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setEffectiveTargetWindow($var) + { + GPBUtil::checkEnum($var, \Google\Ads\AdManager\V1\TargetWindowEnum\TargetWindow::class); + $this->effective_target_window = $var; + + return $this; + } + + /** + * Optional. The resource names of Teams directly applied to this AdUnit. + * Format: "networks/{network_code}/teams/{team_id}" + * + * Generated from protobuf field repeated string applied_teams = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAppliedTeams() + { + return $this->applied_teams; + } + + /** + * Optional. The resource names of Teams directly applied to this AdUnit. + * Format: "networks/{network_code}/teams/{team_id}" + * + * Generated from protobuf field repeated string applied_teams = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAppliedTeams($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->applied_teams = $arr; + + return $this; + } + + /** + * Output only. The resource names of all Teams that this AdUnit is on as well + * as those inherited from parent AdUnits. Format: + * "networks/{network_code}/teams/{team_id}" + * + * Generated from protobuf field repeated string teams = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTeams() + { + return $this->teams; + } + + /** + * Output only. The resource names of all Teams that this AdUnit is on as well + * as those inherited from parent AdUnits. Format: + * "networks/{network_code}/teams/{team_id}" + * + * Generated from protobuf field repeated string teams = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTeams($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->teams = $arr; + + return $this; + } + + /** + * Optional. A description of the ad unit. The maximum length is 65,535 + * characters. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. A description of the ad unit. The maximum length is 65,535 + * characters. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. If this field is set to true, then the AdUnit will not be + * implicitly targeted when its parent is. Traffickers must explicitly + * target such an AdUnit or else no line items will serve to it. This + * feature is only available for Ad Manager 360 accounts. + * + * Generated from protobuf field bool explicitly_targeted = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getExplicitlyTargeted() + { + return $this->explicitly_targeted; + } + + /** + * Optional. If this field is set to true, then the AdUnit will not be + * implicitly targeted when its parent is. Traffickers must explicitly + * target such an AdUnit or else no line items will serve to it. This + * feature is only available for Ad Manager 360 accounts. + * + * Generated from protobuf field bool explicitly_targeted = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setExplicitlyTargeted($var) + { + GPBUtil::checkBool($var); + $this->explicitly_targeted = $var; + + return $this; + } + + /** + * Output only. This field is set to true if the ad unit has any children. + * + * Generated from protobuf field bool has_children = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getHasChildren() + { + return $this->has_children; + } + + /** + * Output only. This field is set to true if the ad unit has any children. + * + * Generated from protobuf field bool has_children = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setHasChildren($var) + { + GPBUtil::checkBool($var); + $this->has_children = $var; + + return $this; + } + + /** + * Output only. The time this AdUnit was last modified. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The time this AdUnit was last modified. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Optional. The sizes that can be served inside this ad unit. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.AdUnitSize ad_unit_sizes = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAdUnitSizes() + { + return $this->ad_unit_sizes; + } + + /** + * Optional. The sizes that can be served inside this ad unit. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.AdUnitSize ad_unit_sizes = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Ads\AdManager\V1\AdUnitSize>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAdUnitSizes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\AdUnitSize::class); + $this->ad_unit_sizes = $arr; + + return $this; + } + + /** + * Optional. Determines what set top box video on demand channel this ad unit + * corresponds to in an external set top box ad campaign system. + * + * Generated from protobuf field string external_set_top_box_channel_id = 17 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getExternalSetTopBoxChannelId() + { + return $this->external_set_top_box_channel_id; + } + + /** + * Optional. Determines what set top box video on demand channel this ad unit + * corresponds to in an external set top box ad campaign system. + * + * Generated from protobuf field string external_set_top_box_channel_id = 17 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setExternalSetTopBoxChannelId($var) + { + GPBUtil::checkString($var, True); + $this->external_set_top_box_channel_id = $var; + + return $this; + } + + /** + * Optional. The duration after which an Ad Unit will automatically refresh. + * This is only valid for ad units in mobile apps. If not set, the ad unit + * will not refresh. + * + * Generated from protobuf field .google.protobuf.Duration refresh_delay = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Duration|null + */ + public function getRefreshDelay() + { + return $this->refresh_delay; + } + + public function hasRefreshDelay() + { + return isset($this->refresh_delay); + } + + public function clearRefreshDelay() + { + unset($this->refresh_delay); + } + + /** + * Optional. The duration after which an Ad Unit will automatically refresh. + * This is only valid for ad units in mobile apps. If not set, the ad unit + * will not refresh. + * + * Generated from protobuf field .google.protobuf.Duration refresh_delay = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setRefreshDelay($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->refresh_delay = $var; + + return $this; + } + + /** + * Optional. The set of labels applied directly to this ad unit. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.AppliedLabel applied_labels = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAppliedLabels() + { + return $this->applied_labels; + } + + /** + * Optional. The set of labels applied directly to this ad unit. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.AppliedLabel applied_labels = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Ads\AdManager\V1\AppliedLabel>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAppliedLabels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\AppliedLabel::class); + $this->applied_labels = $arr; + + return $this; + } + + /** + * Output only. Contains the set of labels applied directly to the ad unit as + * well as those inherited from the parent ad units. If a label has been + * negated, only the negated label is returned. This field is readonly and is + * assigned by Google. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.AppliedLabel effective_applied_labels = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEffectiveAppliedLabels() + { + return $this->effective_applied_labels; + } + + /** + * Output only. Contains the set of labels applied directly to the ad unit as + * well as those inherited from the parent ad units. If a label has been + * negated, only the negated label is returned. This field is readonly and is + * assigned by Google. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.AppliedLabel effective_applied_labels = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Ads\AdManager\V1\AppliedLabel>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEffectiveAppliedLabels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\AppliedLabel::class); + $this->effective_applied_labels = $arr; + + return $this; + } + + /** + * Optional. The set of label frequency caps applied directly to this ad unit. + * There is a limit of 10 label frequency caps per ad unit. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.LabelFrequencyCap applied_label_frequency_caps = 23 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAppliedLabelFrequencyCaps() + { + return $this->applied_label_frequency_caps; + } + + /** + * Optional. The set of label frequency caps applied directly to this ad unit. + * There is a limit of 10 label frequency caps per ad unit. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.LabelFrequencyCap applied_label_frequency_caps = 23 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Ads\AdManager\V1\LabelFrequencyCap>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAppliedLabelFrequencyCaps($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\LabelFrequencyCap::class); + $this->applied_label_frequency_caps = $arr; + + return $this; + } + + /** + * Output only. The label frequency caps applied directly to the ad unit as + * well as those inherited from parent ad units. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.LabelFrequencyCap effective_label_frequency_caps = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEffectiveLabelFrequencyCaps() + { + return $this->effective_label_frequency_caps; + } + + /** + * Output only. The label frequency caps applied directly to the ad unit as + * well as those inherited from parent ad units. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.LabelFrequencyCap effective_label_frequency_caps = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Ads\AdManager\V1\LabelFrequencyCap>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEffectiveLabelFrequencyCaps($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\LabelFrequencyCap::class); + $this->effective_label_frequency_caps = $arr; + + return $this; + } + + /** + * Optional. The smart size mode for this ad unit. This attribute is optional + * and defaults to SmartSizeMode.NONE for fixed sizes. + * + * Generated from protobuf field .google.ads.admanager.v1.SmartSizeModeEnum.SmartSizeMode smart_size_mode = 25 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getSmartSizeMode() + { + return $this->smart_size_mode; + } + + /** + * Optional. The smart size mode for this ad unit. This attribute is optional + * and defaults to SmartSizeMode.NONE for fixed sizes. + * + * Generated from protobuf field .google.ads.admanager.v1.SmartSizeModeEnum.SmartSizeMode smart_size_mode = 25 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setSmartSizeMode($var) + { + GPBUtil::checkEnum($var, \Google\Ads\AdManager\V1\SmartSizeModeEnum\SmartSizeMode::class); + $this->smart_size_mode = $var; + + return $this; + } + + /** + * Optional. The value of AdSense enabled directly applied to this ad unit. + * This attribute is optional and if not specified this ad unit will inherit + * the value of effectiveAdsenseEnabled from its ancestors. + * + * Generated from protobuf field optional bool applied_adsense_enabled = 26 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAppliedAdsenseEnabled() + { + return isset($this->applied_adsense_enabled) ? $this->applied_adsense_enabled : false; + } + + public function hasAppliedAdsenseEnabled() + { + return isset($this->applied_adsense_enabled); + } + + public function clearAppliedAdsenseEnabled() + { + unset($this->applied_adsense_enabled); + } + + /** + * Optional. The value of AdSense enabled directly applied to this ad unit. + * This attribute is optional and if not specified this ad unit will inherit + * the value of effectiveAdsenseEnabled from its ancestors. + * + * Generated from protobuf field optional bool applied_adsense_enabled = 26 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAppliedAdsenseEnabled($var) + { + GPBUtil::checkBool($var); + $this->applied_adsense_enabled = $var; + + return $this; + } + + /** + * Output only. Specifies whether or not the AdUnit is enabled for serving ads + * from the AdSense content network. This attribute defaults to the ad unit's + * parent or ancestor's setting if one has been set. If no ancestor of the ad + * unit has set appliedAdsenseEnabled, the attribute is defaulted to true. + * + * Generated from protobuf field bool effective_adsense_enabled = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getEffectiveAdsenseEnabled() + { + return $this->effective_adsense_enabled; + } + + /** + * Output only. Specifies whether or not the AdUnit is enabled for serving ads + * from the AdSense content network. This attribute defaults to the ad unit's + * parent or ancestor's setting if one has been set. If no ancestor of the ad + * unit has set appliedAdsenseEnabled, the attribute is defaulted to true. + * + * Generated from protobuf field bool effective_adsense_enabled = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setEffectiveAdsenseEnabled($var) + { + GPBUtil::checkBool($var); + $this->effective_adsense_enabled = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/AdUnitParent.php b/AdsAdManager/src/V1/AdUnitParent.php new file mode 100644 index 000000000000..558682858ed9 --- /dev/null +++ b/AdsAdManager/src/V1/AdUnitParent.php @@ -0,0 +1,143 @@ +google.ads.admanager.v1.AdUnitParent + */ +class AdUnitParent extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The parent of the current AdUnit + * Format: `networks/{network_code}/adUnits/{ad_unit_id}` + * + * Generated from protobuf field string parent_ad_unit = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $parent_ad_unit = ''; + /** + * Output only. The display name of the parent AdUnit. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $display_name = ''; + /** + * Output only. A string used to uniquely identify the ad unit for the + * purposes of serving the ad. + * + * Generated from protobuf field string ad_unit_code = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $ad_unit_code = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent_ad_unit + * Output only. The parent of the current AdUnit + * Format: `networks/{network_code}/adUnits/{ad_unit_id}` + * @type string $display_name + * Output only. The display name of the parent AdUnit. + * @type string $ad_unit_code + * Output only. A string used to uniquely identify the ad unit for the + * purposes of serving the ad. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\AdUnitMessages::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The parent of the current AdUnit + * Format: `networks/{network_code}/adUnits/{ad_unit_id}` + * + * Generated from protobuf field string parent_ad_unit = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getParentAdUnit() + { + return $this->parent_ad_unit; + } + + /** + * Output only. The parent of the current AdUnit + * Format: `networks/{network_code}/adUnits/{ad_unit_id}` + * + * Generated from protobuf field string parent_ad_unit = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParentAdUnit($var) + { + GPBUtil::checkString($var, True); + $this->parent_ad_unit = $var; + + return $this; + } + + /** + * Output only. The display name of the parent AdUnit. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Output only. The display name of the parent AdUnit. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. A string used to uniquely identify the ad unit for the + * purposes of serving the ad. + * + * Generated from protobuf field string ad_unit_code = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getAdUnitCode() + { + return $this->ad_unit_code; + } + + /** + * Output only. A string used to uniquely identify the ad unit for the + * purposes of serving the ad. + * + * Generated from protobuf field string ad_unit_code = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setAdUnitCode($var) + { + GPBUtil::checkString($var, True); + $this->ad_unit_code = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/AdUnitSize.php b/AdsAdManager/src/V1/AdUnitSize.php new file mode 100644 index 000000000000..43ee5cd761d8 --- /dev/null +++ b/AdsAdManager/src/V1/AdUnitSize.php @@ -0,0 +1,153 @@ +google.ads.admanager.v1.AdUnitSize + */ +class AdUnitSize extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Size of the AdUnit. + * + * Generated from protobuf field .google.ads.admanager.v1.Size size = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $size = null; + /** + * Required. The EnvironmentType of the AdUnit + * + * Generated from protobuf field .google.ads.admanager.v1.EnvironmentTypeEnum.EnvironmentType environment_type = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $environment_type = 0; + /** + * The companions for this ad unit size. Companions are only valid if the + * environment is + * [VIDEO_PLAYER][google.ads.admanager.v1.EnvironmentTypeEnum.EnvironmentType]. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Size companions = 3; + */ + private $companions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Ads\AdManager\V1\Size $size + * Required. The Size of the AdUnit. + * @type int $environment_type + * Required. The EnvironmentType of the AdUnit + * @type array<\Google\Ads\AdManager\V1\Size>|\Google\Protobuf\Internal\RepeatedField $companions + * The companions for this ad unit size. Companions are only valid if the + * environment is + * [VIDEO_PLAYER][google.ads.admanager.v1.EnvironmentTypeEnum.EnvironmentType]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\AdUnitMessages::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Size of the AdUnit. + * + * Generated from protobuf field .google.ads.admanager.v1.Size size = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Ads\AdManager\V1\Size|null + */ + public function getSize() + { + return $this->size; + } + + public function hasSize() + { + return isset($this->size); + } + + public function clearSize() + { + unset($this->size); + } + + /** + * Required. The Size of the AdUnit. + * + * Generated from protobuf field .google.ads.admanager.v1.Size size = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Ads\AdManager\V1\Size $var + * @return $this + */ + public function setSize($var) + { + GPBUtil::checkMessage($var, \Google\Ads\AdManager\V1\Size::class); + $this->size = $var; + + return $this; + } + + /** + * Required. The EnvironmentType of the AdUnit + * + * Generated from protobuf field .google.ads.admanager.v1.EnvironmentTypeEnum.EnvironmentType environment_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getEnvironmentType() + { + return $this->environment_type; + } + + /** + * Required. The EnvironmentType of the AdUnit + * + * Generated from protobuf field .google.ads.admanager.v1.EnvironmentTypeEnum.EnvironmentType environment_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setEnvironmentType($var) + { + GPBUtil::checkEnum($var, \Google\Ads\AdManager\V1\EnvironmentTypeEnum\EnvironmentType::class); + $this->environment_type = $var; + + return $this; + } + + /** + * The companions for this ad unit size. Companions are only valid if the + * environment is + * [VIDEO_PLAYER][google.ads.admanager.v1.EnvironmentTypeEnum.EnvironmentType]. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Size companions = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCompanions() + { + return $this->companions; + } + + /** + * The companions for this ad unit size. Companions are only valid if the + * environment is + * [VIDEO_PLAYER][google.ads.admanager.v1.EnvironmentTypeEnum.EnvironmentType]. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Size companions = 3; + * @param array<\Google\Ads\AdManager\V1\Size>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCompanions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\Size::class); + $this->companions = $arr; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/AdUnitStatusEnum.php b/AdsAdManager/src/V1/AdUnitStatusEnum.php new file mode 100644 index 000000000000..0b955366976a --- /dev/null +++ b/AdsAdManager/src/V1/AdUnitStatusEnum.php @@ -0,0 +1,34 @@ +google.ads.admanager.v1.AdUnitStatusEnum + */ +class AdUnitStatusEnum extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\AdUnitEnums::initOnce(); + parent::__construct($data); + } + +} + diff --git a/AdsAdManager/src/V1/AdUnitStatusEnum/AdUnitStatus.php b/AdsAdManager/src/V1/AdUnitStatusEnum/AdUnitStatus.php new file mode 100644 index 000000000000..68565e6436c7 --- /dev/null +++ b/AdsAdManager/src/V1/AdUnitStatusEnum/AdUnitStatus.php @@ -0,0 +1,69 @@ +google.ads.admanager.v1.AdUnitStatusEnum.AdUnitStatus + */ +class AdUnitStatus +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum AD_UNIT_STATUS_UNSPECIFIED = 0; + */ + const AD_UNIT_STATUS_UNSPECIFIED = 0; + /** + * The ad unit is active, available for targeting, and serving. + * + * Generated from protobuf enum ACTIVE = 1; + */ + const ACTIVE = 1; + /** + * The ad unit will be visible in the UI, but ignored by serving. + * + * Generated from protobuf enum INACTIVE = 2; + */ + const INACTIVE = 2; + /** + * The ad unit will be hidden in the UI and ignored by serving. + * + * Generated from protobuf enum ARCHIVED = 3; + */ + const ARCHIVED = 3; + + private static $valueToName = [ + self::AD_UNIT_STATUS_UNSPECIFIED => 'AD_UNIT_STATUS_UNSPECIFIED', + self::ACTIVE => 'ACTIVE', + self::INACTIVE => 'INACTIVE', + self::ARCHIVED => 'ARCHIVED', + ]; + + 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/AdsAdManager/src/V1/AppliedLabel.php b/AdsAdManager/src/V1/AppliedLabel.php new file mode 100644 index 000000000000..1bb8c2533c8d --- /dev/null +++ b/AdsAdManager/src/V1/AppliedLabel.php @@ -0,0 +1,105 @@ +google.ads.admanager.v1.AppliedLabel + */ +class AppliedLabel extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The label to be applied. + * Format: "networks/{network_code}/labels/{label_id}" + * + * Generated from protobuf field string label = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $label = ''; + /** + * Specifies whether or not to negate the effects of the label. + * + * Generated from protobuf field bool negated = 2; + */ + protected $negated = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $label + * Required. The label to be applied. + * Format: "networks/{network_code}/labels/{label_id}" + * @type bool $negated + * Specifies whether or not to negate the effects of the label. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\AppliedLabel::initOnce(); + parent::__construct($data); + } + + /** + * Required. The label to be applied. + * Format: "networks/{network_code}/labels/{label_id}" + * + * Generated from protobuf field string label = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getLabel() + { + return $this->label; + } + + /** + * Required. The label to be applied. + * Format: "networks/{network_code}/labels/{label_id}" + * + * Generated from protobuf field string label = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLabel($var) + { + GPBUtil::checkString($var, True); + $this->label = $var; + + return $this; + } + + /** + * Specifies whether or not to negate the effects of the label. + * + * Generated from protobuf field bool negated = 2; + * @return bool + */ + public function getNegated() + { + return $this->negated; + } + + /** + * Specifies whether or not to negate the effects of the label. + * + * Generated from protobuf field bool negated = 2; + * @param bool $var + * @return $this + */ + public function setNegated($var) + { + GPBUtil::checkBool($var); + $this->negated = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/BatchCreateEntitySignalsMappingsRequest.php b/AdsAdManager/src/V1/BatchCreateEntitySignalsMappingsRequest.php new file mode 100644 index 000000000000..abf061199fc7 --- /dev/null +++ b/AdsAdManager/src/V1/BatchCreateEntitySignalsMappingsRequest.php @@ -0,0 +1,132 @@ +google.ads.admanager.v1.BatchCreateEntitySignalsMappingsRequest + */ +class BatchCreateEntitySignalsMappingsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource where `EntitySignalsMappings` will be + * created. Format: `networks/{network_code}` The parent field in the + * CreateEntitySignalsMappingRequest must match this field. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The `EntitySignalsMapping` objects to create. + * A maximum of 100 objects can be created in a batch. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.CreateEntitySignalsMappingRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $requests; + + /** + * @param string $parent Required. The parent resource where `EntitySignalsMappings` will be + * created. Format: `networks/{network_code}` The parent field in the + * CreateEntitySignalsMappingRequest must match this field. Please see + * {@see EntitySignalsMappingServiceClient::networkName()} for help formatting this field. + * @param \Google\Ads\AdManager\V1\CreateEntitySignalsMappingRequest[] $requests Required. The `EntitySignalsMapping` objects to create. + * A maximum of 100 objects can be created in a batch. + * + * @return \Google\Ads\AdManager\V1\BatchCreateEntitySignalsMappingsRequest + * + * @experimental + */ + public static function build(string $parent, array $requests): self + { + return (new self()) + ->setParent($parent) + ->setRequests($requests); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource where `EntitySignalsMappings` will be + * created. Format: `networks/{network_code}` The parent field in the + * CreateEntitySignalsMappingRequest must match this field. + * @type array<\Google\Ads\AdManager\V1\CreateEntitySignalsMappingRequest>|\Google\Protobuf\Internal\RepeatedField $requests + * Required. The `EntitySignalsMapping` objects to create. + * A maximum of 100 objects can be created in a batch. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\EntitySignalsMappingService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource where `EntitySignalsMappings` will be + * created. Format: `networks/{network_code}` The parent field in the + * CreateEntitySignalsMappingRequest must match this field. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource where `EntitySignalsMappings` will be + * created. Format: `networks/{network_code}` The parent field in the + * CreateEntitySignalsMappingRequest must match this field. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The `EntitySignalsMapping` objects to create. + * A maximum of 100 objects can be created in a batch. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.CreateEntitySignalsMappingRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRequests() + { + return $this->requests; + } + + /** + * Required. The `EntitySignalsMapping` objects to create. + * A maximum of 100 objects can be created in a batch. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.CreateEntitySignalsMappingRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Ads\AdManager\V1\CreateEntitySignalsMappingRequest>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRequests($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\CreateEntitySignalsMappingRequest::class); + $this->requests = $arr; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/BatchCreateEntitySignalsMappingsResponse.php b/AdsAdManager/src/V1/BatchCreateEntitySignalsMappingsResponse.php new file mode 100644 index 000000000000..1b346912c6ce --- /dev/null +++ b/AdsAdManager/src/V1/BatchCreateEntitySignalsMappingsResponse.php @@ -0,0 +1,67 @@ +google.ads.admanager.v1.BatchCreateEntitySignalsMappingsResponse + */ +class BatchCreateEntitySignalsMappingsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The `EntitySignalsMapping` objects created. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.EntitySignalsMapping entity_signals_mappings = 1; + */ + private $entity_signals_mappings; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Ads\AdManager\V1\EntitySignalsMapping>|\Google\Protobuf\Internal\RepeatedField $entity_signals_mappings + * The `EntitySignalsMapping` objects created. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\EntitySignalsMappingService::initOnce(); + parent::__construct($data); + } + + /** + * The `EntitySignalsMapping` objects created. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.EntitySignalsMapping entity_signals_mappings = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEntitySignalsMappings() + { + return $this->entity_signals_mappings; + } + + /** + * The `EntitySignalsMapping` objects created. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.EntitySignalsMapping entity_signals_mappings = 1; + * @param array<\Google\Ads\AdManager\V1\EntitySignalsMapping>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEntitySignalsMappings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\EntitySignalsMapping::class); + $this->entity_signals_mappings = $arr; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/BatchUpdateEntitySignalsMappingsRequest.php b/AdsAdManager/src/V1/BatchUpdateEntitySignalsMappingsRequest.php new file mode 100644 index 000000000000..546c88476ab6 --- /dev/null +++ b/AdsAdManager/src/V1/BatchUpdateEntitySignalsMappingsRequest.php @@ -0,0 +1,132 @@ +google.ads.admanager.v1.BatchUpdateEntitySignalsMappingsRequest + */ +class BatchUpdateEntitySignalsMappingsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource where `EntitySignalsMappings` will be + * updated. Format: `networks/{network_code}` The parent field in the + * UpdateEntitySignalsMappingRequest must match this field. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The `EntitySignalsMapping` objects to update. + * A maximum of 100 objects can be updated in a batch. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.UpdateEntitySignalsMappingRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $requests; + + /** + * @param string $parent Required. The parent resource where `EntitySignalsMappings` will be + * updated. Format: `networks/{network_code}` The parent field in the + * UpdateEntitySignalsMappingRequest must match this field. Please see + * {@see EntitySignalsMappingServiceClient::networkName()} for help formatting this field. + * @param \Google\Ads\AdManager\V1\UpdateEntitySignalsMappingRequest[] $requests Required. The `EntitySignalsMapping` objects to update. + * A maximum of 100 objects can be updated in a batch. + * + * @return \Google\Ads\AdManager\V1\BatchUpdateEntitySignalsMappingsRequest + * + * @experimental + */ + public static function build(string $parent, array $requests): self + { + return (new self()) + ->setParent($parent) + ->setRequests($requests); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource where `EntitySignalsMappings` will be + * updated. Format: `networks/{network_code}` The parent field in the + * UpdateEntitySignalsMappingRequest must match this field. + * @type array<\Google\Ads\AdManager\V1\UpdateEntitySignalsMappingRequest>|\Google\Protobuf\Internal\RepeatedField $requests + * Required. The `EntitySignalsMapping` objects to update. + * A maximum of 100 objects can be updated in a batch. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\EntitySignalsMappingService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource where `EntitySignalsMappings` will be + * updated. Format: `networks/{network_code}` The parent field in the + * UpdateEntitySignalsMappingRequest must match this field. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource where `EntitySignalsMappings` will be + * updated. Format: `networks/{network_code}` The parent field in the + * UpdateEntitySignalsMappingRequest must match this field. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The `EntitySignalsMapping` objects to update. + * A maximum of 100 objects can be updated in a batch. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.UpdateEntitySignalsMappingRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRequests() + { + return $this->requests; + } + + /** + * Required. The `EntitySignalsMapping` objects to update. + * A maximum of 100 objects can be updated in a batch. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.UpdateEntitySignalsMappingRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Ads\AdManager\V1\UpdateEntitySignalsMappingRequest>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRequests($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\UpdateEntitySignalsMappingRequest::class); + $this->requests = $arr; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/BatchUpdateEntitySignalsMappingsResponse.php b/AdsAdManager/src/V1/BatchUpdateEntitySignalsMappingsResponse.php new file mode 100644 index 000000000000..0e3e8a5cff75 --- /dev/null +++ b/AdsAdManager/src/V1/BatchUpdateEntitySignalsMappingsResponse.php @@ -0,0 +1,67 @@ +google.ads.admanager.v1.BatchUpdateEntitySignalsMappingsResponse + */ +class BatchUpdateEntitySignalsMappingsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The `EntitySignalsMapping` objects updated. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.EntitySignalsMapping entity_signals_mappings = 1; + */ + private $entity_signals_mappings; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Ads\AdManager\V1\EntitySignalsMapping>|\Google\Protobuf\Internal\RepeatedField $entity_signals_mappings + * The `EntitySignalsMapping` objects updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\EntitySignalsMappingService::initOnce(); + parent::__construct($data); + } + + /** + * The `EntitySignalsMapping` objects updated. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.EntitySignalsMapping entity_signals_mappings = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEntitySignalsMappings() + { + return $this->entity_signals_mappings; + } + + /** + * The `EntitySignalsMapping` objects updated. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.EntitySignalsMapping entity_signals_mappings = 1; + * @param array<\Google\Ads\AdManager\V1\EntitySignalsMapping>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEntitySignalsMappings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\EntitySignalsMapping::class); + $this->entity_signals_mappings = $arr; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/Client/AdUnitServiceClient.php b/AdsAdManager/src/V1/Client/AdUnitServiceClient.php new file mode 100644 index 000000000000..238d03d40c37 --- /dev/null +++ b/AdsAdManager/src/V1/Client/AdUnitServiceClient.php @@ -0,0 +1,317 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/ad_unit_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/ad_unit_service_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/ad_unit_service_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return ['rest']; + } + + /** + * Formats a string containing the fully-qualified path to represent a ad_unit + * resource. + * + * @param string $networkCode + * @param string $adUnit + * + * @return string The formatted ad_unit resource. + */ + public static function adUnitName(string $networkCode, string $adUnit): string + { + return self::getPathTemplate('adUnit')->render([ + 'network_code' => $networkCode, + 'ad_unit' => $adUnit, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a network + * resource. + * + * @param string $networkCode + * + * @return string The formatted network resource. + */ + public static function networkName(string $networkCode): string + { + return self::getPathTemplate('network')->render([ + 'network_code' => $networkCode, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - adUnit: networks/{network_code}/adUnits/{ad_unit} + * - network: networks/{network_code} + * + * 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 'admanager.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. At the moment, supports only + * `rest`. *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 = [ + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\RestTransport::build()} method 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); + } + + /** + * API to retrieve an AdUnit object. + * + * The async variant is {@see AdUnitServiceClient::getAdUnitAsync()} . + * + * @example samples/V1/AdUnitServiceClient/get_ad_unit.php + * + * @param GetAdUnitRequest $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 AdUnit + * + * @throws ApiException Thrown if the API call fails. + */ + public function getAdUnit(GetAdUnitRequest $request, array $callOptions = []): AdUnit + { + return $this->startApiCall('GetAdUnit', $request, $callOptions)->wait(); + } + + /** + * API to retrieve a list of AdUnitSize objects. + * + * The async variant is {@see AdUnitServiceClient::listAdUnitSizesAsync()} . + * + * @example samples/V1/AdUnitServiceClient/list_ad_unit_sizes.php + * + * @param ListAdUnitSizesRequest $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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listAdUnitSizes(ListAdUnitSizesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListAdUnitSizes', $request, $callOptions); + } + + /** + * API to retrieve a list of AdUnit objects. + * + * The async variant is {@see AdUnitServiceClient::listAdUnitsAsync()} . + * + * @example samples/V1/AdUnitServiceClient/list_ad_units.php + * + * @param ListAdUnitsRequest $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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listAdUnits(ListAdUnitsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListAdUnits', $request, $callOptions); + } +} diff --git a/AdsAdManager/src/V1/Client/CompanyServiceClient.php b/AdsAdManager/src/V1/Client/CompanyServiceClient.php new file mode 100644 index 000000000000..03298df70dd2 --- /dev/null +++ b/AdsAdManager/src/V1/Client/CompanyServiceClient.php @@ -0,0 +1,289 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/company_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/company_service_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/company_service_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return ['rest']; + } + + /** + * Formats a string containing the fully-qualified path to represent a company + * resource. + * + * @param string $networkCode + * @param string $company + * + * @return string The formatted company resource. + */ + public static function companyName(string $networkCode, string $company): string + { + return self::getPathTemplate('company')->render([ + 'network_code' => $networkCode, + 'company' => $company, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a network + * resource. + * + * @param string $networkCode + * + * @return string The formatted network resource. + */ + public static function networkName(string $networkCode): string + { + return self::getPathTemplate('network')->render([ + 'network_code' => $networkCode, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - company: networks/{network_code}/companies/{company} + * - network: networks/{network_code} + * + * 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 'admanager.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. At the moment, supports only + * `rest`. *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 = [ + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\RestTransport::build()} method 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); + } + + /** + * API to retrieve a `Company` object. + * + * The async variant is {@see CompanyServiceClient::getCompanyAsync()} . + * + * @example samples/V1/CompanyServiceClient/get_company.php + * + * @param GetCompanyRequest $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 Company + * + * @throws ApiException Thrown if the API call fails. + */ + public function getCompany(GetCompanyRequest $request, array $callOptions = []): Company + { + return $this->startApiCall('GetCompany', $request, $callOptions)->wait(); + } + + /** + * API to retrieve a list of `Company` objects. + * + * The async variant is {@see CompanyServiceClient::listCompaniesAsync()} . + * + * @example samples/V1/CompanyServiceClient/list_companies.php + * + * @param ListCompaniesRequest $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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listCompanies(ListCompaniesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListCompanies', $request, $callOptions); + } +} diff --git a/AdsAdManager/src/V1/Client/CustomFieldServiceClient.php b/AdsAdManager/src/V1/Client/CustomFieldServiceClient.php new file mode 100644 index 000000000000..930c38b922c3 --- /dev/null +++ b/AdsAdManager/src/V1/Client/CustomFieldServiceClient.php @@ -0,0 +1,289 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/custom_field_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/custom_field_service_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/custom_field_service_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return ['rest']; + } + + /** + * Formats a string containing the fully-qualified path to represent a custom_field + * resource. + * + * @param string $networkCode + * @param string $customField + * + * @return string The formatted custom_field resource. + */ + public static function customFieldName(string $networkCode, string $customField): string + { + return self::getPathTemplate('customField')->render([ + 'network_code' => $networkCode, + 'custom_field' => $customField, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a network + * resource. + * + * @param string $networkCode + * + * @return string The formatted network resource. + */ + public static function networkName(string $networkCode): string + { + return self::getPathTemplate('network')->render([ + 'network_code' => $networkCode, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - customField: networks/{network_code}/customFields/{custom_field} + * - network: networks/{network_code} + * + * 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 'admanager.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. At the moment, supports only + * `rest`. *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 = [ + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\RestTransport::build()} method 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); + } + + /** + * API to retrieve a `CustomField` object. + * + * The async variant is {@see CustomFieldServiceClient::getCustomFieldAsync()} . + * + * @example samples/V1/CustomFieldServiceClient/get_custom_field.php + * + * @param GetCustomFieldRequest $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 CustomField + * + * @throws ApiException Thrown if the API call fails. + */ + public function getCustomField(GetCustomFieldRequest $request, array $callOptions = []): CustomField + { + return $this->startApiCall('GetCustomField', $request, $callOptions)->wait(); + } + + /** + * API to retrieve a list of `CustomField` objects. + * + * The async variant is {@see CustomFieldServiceClient::listCustomFieldsAsync()} . + * + * @example samples/V1/CustomFieldServiceClient/list_custom_fields.php + * + * @param ListCustomFieldsRequest $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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listCustomFields(ListCustomFieldsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListCustomFields', $request, $callOptions); + } +} diff --git a/AdsAdManager/src/V1/Client/CustomTargetingKeyServiceClient.php b/AdsAdManager/src/V1/Client/CustomTargetingKeyServiceClient.php new file mode 100644 index 000000000000..c3b0bc912b1d --- /dev/null +++ b/AdsAdManager/src/V1/Client/CustomTargetingKeyServiceClient.php @@ -0,0 +1,296 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/custom_targeting_key_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/custom_targeting_key_service_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => + __DIR__ . '/../resources/custom_targeting_key_service_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return ['rest']; + } + + /** + * Formats a string containing the fully-qualified path to represent a + * custom_targeting_key resource. + * + * @param string $networkCode + * @param string $customTargetingKey + * + * @return string The formatted custom_targeting_key resource. + */ + public static function customTargetingKeyName(string $networkCode, string $customTargetingKey): string + { + return self::getPathTemplate('customTargetingKey')->render([ + 'network_code' => $networkCode, + 'custom_targeting_key' => $customTargetingKey, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a network + * resource. + * + * @param string $networkCode + * + * @return string The formatted network resource. + */ + public static function networkName(string $networkCode): string + { + return self::getPathTemplate('network')->render([ + 'network_code' => $networkCode, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - customTargetingKey: networks/{network_code}/customTargetingKeys/{custom_targeting_key} + * - network: networks/{network_code} + * + * 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 'admanager.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. At the moment, supports only + * `rest`. *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 = [ + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\RestTransport::build()} method 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); + } + + /** + * API to retrieve a `CustomTargetingKey` object. + * + * The async variant is + * {@see CustomTargetingKeyServiceClient::getCustomTargetingKeyAsync()} . + * + * @example samples/V1/CustomTargetingKeyServiceClient/get_custom_targeting_key.php + * + * @param GetCustomTargetingKeyRequest $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 CustomTargetingKey + * + * @throws ApiException Thrown if the API call fails. + */ + public function getCustomTargetingKey( + GetCustomTargetingKeyRequest $request, + array $callOptions = [] + ): CustomTargetingKey { + return $this->startApiCall('GetCustomTargetingKey', $request, $callOptions)->wait(); + } + + /** + * API to retrieve a list of `CustomTargetingKey` objects. + * + * The async variant is + * {@see CustomTargetingKeyServiceClient::listCustomTargetingKeysAsync()} . + * + * @example samples/V1/CustomTargetingKeyServiceClient/list_custom_targeting_keys.php + * + * @param ListCustomTargetingKeysRequest $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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listCustomTargetingKeys( + ListCustomTargetingKeysRequest $request, + array $callOptions = [] + ): PagedListResponse { + return $this->startApiCall('ListCustomTargetingKeys', $request, $callOptions); + } +} diff --git a/AdsAdManager/src/V1/Client/CustomTargetingValueServiceClient.php b/AdsAdManager/src/V1/Client/CustomTargetingValueServiceClient.php new file mode 100644 index 000000000000..1ce9aabf61d2 --- /dev/null +++ b/AdsAdManager/src/V1/Client/CustomTargetingValueServiceClient.php @@ -0,0 +1,303 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/custom_targeting_value_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/custom_targeting_value_service_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => + __DIR__ . '/../resources/custom_targeting_value_service_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return ['rest']; + } + + /** + * Formats a string containing the fully-qualified path to represent a + * custom_targeting_key resource. + * + * @param string $networkCode + * @param string $customTargetingKey + * + * @return string The formatted custom_targeting_key resource. + */ + public static function customTargetingKeyName(string $networkCode, string $customTargetingKey): string + { + return self::getPathTemplate('customTargetingKey')->render([ + 'network_code' => $networkCode, + 'custom_targeting_key' => $customTargetingKey, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * custom_targeting_value resource. + * + * @param string $networkCode + * @param string $customTargetingKey + * @param string $customTargetingValue + * + * @return string The formatted custom_targeting_value resource. + */ + public static function customTargetingValueName( + string $networkCode, + string $customTargetingKey, + string $customTargetingValue + ): string { + return self::getPathTemplate('customTargetingValue')->render([ + 'network_code' => $networkCode, + 'custom_targeting_key' => $customTargetingKey, + 'custom_targeting_value' => $customTargetingValue, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - customTargetingKey: networks/{network_code}/customTargetingKeys/{custom_targeting_key} + * - customTargetingValue: networks/{network_code}/customTargetingKeys/{custom_targeting_key}/customTargetingValues/{custom_targeting_value} + * + * 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 'admanager.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. At the moment, supports only + * `rest`. *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 = [ + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\RestTransport::build()} method 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); + } + + /** + * API to retrieve a `CustomTargetingValue` object. + * + * The async variant is + * {@see CustomTargetingValueServiceClient::getCustomTargetingValueAsync()} . + * + * @example samples/V1/CustomTargetingValueServiceClient/get_custom_targeting_value.php + * + * @param GetCustomTargetingValueRequest $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 CustomTargetingValue + * + * @throws ApiException Thrown if the API call fails. + */ + public function getCustomTargetingValue( + GetCustomTargetingValueRequest $request, + array $callOptions = [] + ): CustomTargetingValue { + return $this->startApiCall('GetCustomTargetingValue', $request, $callOptions)->wait(); + } + + /** + * API to retrieve a list of `CustomTargetingValue` objects. + * + * The async variant is + * {@see CustomTargetingValueServiceClient::listCustomTargetingValuesAsync()} . + * + * @example samples/V1/CustomTargetingValueServiceClient/list_custom_targeting_values.php + * + * @param ListCustomTargetingValuesRequest $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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listCustomTargetingValues( + ListCustomTargetingValuesRequest $request, + array $callOptions = [] + ): PagedListResponse { + return $this->startApiCall('ListCustomTargetingValues', $request, $callOptions); + } +} diff --git a/AdsAdManager/src/V1/Client/EntitySignalsMappingServiceClient.php b/AdsAdManager/src/V1/Client/EntitySignalsMappingServiceClient.php new file mode 100644 index 000000000000..0c1e933d9a92 --- /dev/null +++ b/AdsAdManager/src/V1/Client/EntitySignalsMappingServiceClient.php @@ -0,0 +1,424 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/entity_signals_mapping_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/entity_signals_mapping_service_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => + __DIR__ . '/../resources/entity_signals_mapping_service_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return ['rest']; + } + + /** + * Formats a string containing the fully-qualified path to represent a + * entity_signals_mapping resource. + * + * @param string $networkCode + * @param string $entitySignalsMapping + * + * @return string The formatted entity_signals_mapping resource. + */ + public static function entitySignalsMappingName(string $networkCode, string $entitySignalsMapping): string + { + return self::getPathTemplate('entitySignalsMapping')->render([ + 'network_code' => $networkCode, + 'entity_signals_mapping' => $entitySignalsMapping, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a network + * resource. + * + * @param string $networkCode + * + * @return string The formatted network resource. + */ + public static function networkName(string $networkCode): string + { + return self::getPathTemplate('network')->render([ + 'network_code' => $networkCode, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - entitySignalsMapping: networks/{network_code}/entitySignalsMappings/{entity_signals_mapping} + * - network: networks/{network_code} + * + * 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 'admanager.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. At the moment, supports only + * `rest`. *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 = [ + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\RestTransport::build()} method 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); + } + + /** + * API to batch create `EntitySignalsMapping` objects. + * + * The async variant is + * {@see EntitySignalsMappingServiceClient::batchCreateEntitySignalsMappingsAsync()} + * . + * + * @example samples/V1/EntitySignalsMappingServiceClient/batch_create_entity_signals_mappings.php + * + * @param BatchCreateEntitySignalsMappingsRequest $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 BatchCreateEntitySignalsMappingsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function batchCreateEntitySignalsMappings( + BatchCreateEntitySignalsMappingsRequest $request, + array $callOptions = [] + ): BatchCreateEntitySignalsMappingsResponse { + return $this->startApiCall('BatchCreateEntitySignalsMappings', $request, $callOptions)->wait(); + } + + /** + * API to batch update `EntitySignalsMapping` objects. + * + * The async variant is + * {@see EntitySignalsMappingServiceClient::batchUpdateEntitySignalsMappingsAsync()} + * . + * + * @example samples/V1/EntitySignalsMappingServiceClient/batch_update_entity_signals_mappings.php + * + * @param BatchUpdateEntitySignalsMappingsRequest $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 BatchUpdateEntitySignalsMappingsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function batchUpdateEntitySignalsMappings( + BatchUpdateEntitySignalsMappingsRequest $request, + array $callOptions = [] + ): BatchUpdateEntitySignalsMappingsResponse { + return $this->startApiCall('BatchUpdateEntitySignalsMappings', $request, $callOptions)->wait(); + } + + /** + * API to create an `EntitySignalsMapping` object. + * + * The async variant is + * {@see EntitySignalsMappingServiceClient::createEntitySignalsMappingAsync()} . + * + * @example samples/V1/EntitySignalsMappingServiceClient/create_entity_signals_mapping.php + * + * @param CreateEntitySignalsMappingRequest $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 EntitySignalsMapping + * + * @throws ApiException Thrown if the API call fails. + */ + public function createEntitySignalsMapping( + CreateEntitySignalsMappingRequest $request, + array $callOptions = [] + ): EntitySignalsMapping { + return $this->startApiCall('CreateEntitySignalsMapping', $request, $callOptions)->wait(); + } + + /** + * API to retrieve a `EntitySignalsMapping` object. + * + * The async variant is + * {@see EntitySignalsMappingServiceClient::getEntitySignalsMappingAsync()} . + * + * @example samples/V1/EntitySignalsMappingServiceClient/get_entity_signals_mapping.php + * + * @param GetEntitySignalsMappingRequest $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 EntitySignalsMapping + * + * @throws ApiException Thrown if the API call fails. + */ + public function getEntitySignalsMapping( + GetEntitySignalsMappingRequest $request, + array $callOptions = [] + ): EntitySignalsMapping { + return $this->startApiCall('GetEntitySignalsMapping', $request, $callOptions)->wait(); + } + + /** + * API to retrieve a list of `EntitySignalsMapping` objects. + * + * The async variant is + * {@see EntitySignalsMappingServiceClient::listEntitySignalsMappingsAsync()} . + * + * @example samples/V1/EntitySignalsMappingServiceClient/list_entity_signals_mappings.php + * + * @param ListEntitySignalsMappingsRequest $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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listEntitySignalsMappings( + ListEntitySignalsMappingsRequest $request, + array $callOptions = [] + ): PagedListResponse { + return $this->startApiCall('ListEntitySignalsMappings', $request, $callOptions); + } + + /** + * API to update an `EntitySignalsMapping` object. + * + * The async variant is + * {@see EntitySignalsMappingServiceClient::updateEntitySignalsMappingAsync()} . + * + * @example samples/V1/EntitySignalsMappingServiceClient/update_entity_signals_mapping.php + * + * @param UpdateEntitySignalsMappingRequest $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 EntitySignalsMapping + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateEntitySignalsMapping( + UpdateEntitySignalsMappingRequest $request, + array $callOptions = [] + ): EntitySignalsMapping { + return $this->startApiCall('UpdateEntitySignalsMapping', $request, $callOptions)->wait(); + } +} diff --git a/AdsAdManager/src/V1/Client/NetworkServiceClient.php b/AdsAdManager/src/V1/Client/NetworkServiceClient.php new file mode 100644 index 000000000000..2e3ae01eb097 --- /dev/null +++ b/AdsAdManager/src/V1/Client/NetworkServiceClient.php @@ -0,0 +1,271 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/network_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/network_service_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/network_service_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return ['rest']; + } + + /** + * Formats a string containing the fully-qualified path to represent a network + * resource. + * + * @param string $networkCode + * + * @return string The formatted network resource. + */ + public static function networkName(string $networkCode): string + { + return self::getPathTemplate('network')->render([ + 'network_code' => $networkCode, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - network: networks/{network_code} + * + * 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 'admanager.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. At the moment, supports only + * `rest`. *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 = [ + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\RestTransport::build()} method 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); + } + + /** + * API to retrieve a Network object. + * + * The async variant is {@see NetworkServiceClient::getNetworkAsync()} . + * + * @example samples/V1/NetworkServiceClient/get_network.php + * + * @param GetNetworkRequest $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 Network + * + * @throws ApiException Thrown if the API call fails. + */ + public function getNetwork(GetNetworkRequest $request, array $callOptions = []): Network + { + return $this->startApiCall('GetNetwork', $request, $callOptions)->wait(); + } + + /** + * API to retrieve all the networks the current user has access to. + * + * The async variant is {@see NetworkServiceClient::listNetworksAsync()} . + * + * @example samples/V1/NetworkServiceClient/list_networks.php + * + * @param ListNetworksRequest $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 ListNetworksResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listNetworks(ListNetworksRequest $request, array $callOptions = []): ListNetworksResponse + { + return $this->startApiCall('ListNetworks', $request, $callOptions)->wait(); + } +} diff --git a/AdsAdManager/src/V1/Client/OrderServiceClient.php b/AdsAdManager/src/V1/Client/OrderServiceClient.php new file mode 100644 index 000000000000..6976c12ade0f --- /dev/null +++ b/AdsAdManager/src/V1/Client/OrderServiceClient.php @@ -0,0 +1,294 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/order_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/order_service_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/order_service_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return ['rest']; + } + + /** + * Formats a string containing the fully-qualified path to represent a network + * resource. + * + * @param string $networkCode + * + * @return string The formatted network resource. + */ + public static function networkName(string $networkCode): string + { + return self::getPathTemplate('network')->render([ + 'network_code' => $networkCode, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a order + * resource. + * + * @param string $networkCode + * @param string $order + * + * @return string The formatted order resource. + */ + public static function orderName(string $networkCode, string $order): string + { + return self::getPathTemplate('order')->render([ + 'network_code' => $networkCode, + 'order' => $order, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - network: networks/{network_code} + * - order: networks/{network_code}/orders/{order} + * + * 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 'admanager.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. At the moment, supports only + * `rest`. *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 = [ + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\RestTransport::build()} method 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); + } + + /** + * API to retrieve an Order object. + * + * The async variant is {@see OrderServiceClient::getOrderAsync()} . + * + * @example samples/V1/OrderServiceClient/get_order.php + * + * @param GetOrderRequest $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 Order + * + * @throws ApiException Thrown if the API call fails. + */ + public function getOrder(GetOrderRequest $request, array $callOptions = []): Order + { + return $this->startApiCall('GetOrder', $request, $callOptions)->wait(); + } + + /** + * API to retrieve a list of `Order` objects. + * + * Fields used for literal matching in filter string: + * * `order_id` + * * `display_name` + * * `external_order_id` + * + * The async variant is {@see OrderServiceClient::listOrdersAsync()} . + * + * @example samples/V1/OrderServiceClient/list_orders.php + * + * @param ListOrdersRequest $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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listOrders(ListOrdersRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListOrders', $request, $callOptions); + } +} diff --git a/AdsAdManager/src/V1/Client/PlacementServiceClient.php b/AdsAdManager/src/V1/Client/PlacementServiceClient.php new file mode 100644 index 000000000000..f81de1283b7a --- /dev/null +++ b/AdsAdManager/src/V1/Client/PlacementServiceClient.php @@ -0,0 +1,289 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/placement_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/placement_service_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/placement_service_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return ['rest']; + } + + /** + * Formats a string containing the fully-qualified path to represent a network + * resource. + * + * @param string $networkCode + * + * @return string The formatted network resource. + */ + public static function networkName(string $networkCode): string + { + return self::getPathTemplate('network')->render([ + 'network_code' => $networkCode, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a placement + * resource. + * + * @param string $networkCode + * @param string $placement + * + * @return string The formatted placement resource. + */ + public static function placementName(string $networkCode, string $placement): string + { + return self::getPathTemplate('placement')->render([ + 'network_code' => $networkCode, + 'placement' => $placement, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - network: networks/{network_code} + * - placement: networks/{network_code}/placements/{placement} + * + * 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 'admanager.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. At the moment, supports only + * `rest`. *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 = [ + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\RestTransport::build()} method 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); + } + + /** + * API to retrieve a `Placement` object. + * + * The async variant is {@see PlacementServiceClient::getPlacementAsync()} . + * + * @example samples/V1/PlacementServiceClient/get_placement.php + * + * @param GetPlacementRequest $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 Placement + * + * @throws ApiException Thrown if the API call fails. + */ + public function getPlacement(GetPlacementRequest $request, array $callOptions = []): Placement + { + return $this->startApiCall('GetPlacement', $request, $callOptions)->wait(); + } + + /** + * API to retrieve a list of `Placement` objects. + * + * The async variant is {@see PlacementServiceClient::listPlacementsAsync()} . + * + * @example samples/V1/PlacementServiceClient/list_placements.php + * + * @param ListPlacementsRequest $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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listPlacements(ListPlacementsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListPlacements', $request, $callOptions); + } +} diff --git a/AdsAdManager/src/V1/Client/ReportServiceClient.php b/AdsAdManager/src/V1/Client/ReportServiceClient.php new file mode 100644 index 000000000000..20addfcadaea --- /dev/null +++ b/AdsAdManager/src/V1/Client/ReportServiceClient.php @@ -0,0 +1,471 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/report_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/report_service_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/report_service_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return ['rest']; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a network + * resource. + * + * @param string $networkCode + * + * @return string The formatted network resource. + */ + public static function networkName(string $networkCode): string + { + return self::getPathTemplate('network')->render([ + 'network_code' => $networkCode, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a report + * resource. + * + * @param string $networkCode + * @param string $report + * + * @return string The formatted report resource. + */ + public static function reportName(string $networkCode, string $report): string + { + return self::getPathTemplate('report')->render([ + 'network_code' => $networkCode, + 'report' => $report, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - network: networks/{network_code} + * - report: networks/{network_code}/reports/{report} + * + * 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 'admanager.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. At the moment, supports only + * `rest`. *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 = [ + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\RestTransport::build()} method 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); + $this->operationsClient = $this->createOperationsClient($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); + } + + /** + * API to create a `Report` object. + * + * The async variant is {@see ReportServiceClient::createReportAsync()} . + * + * @example samples/V1/ReportServiceClient/create_report.php + * + * @param CreateReportRequest $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 Report + * + * @throws ApiException Thrown if the API call fails. + */ + public function createReport(CreateReportRequest $request, array $callOptions = []): Report + { + return $this->startApiCall('CreateReport', $request, $callOptions)->wait(); + } + + /** + * Returns the result rows from a completed report. + * The caller must have previously called `RunReport` and waited for that + * operation to complete. The rows will be returned according to the order + * specified by the `sorts` member of the report definition. + * + * The async variant is {@see ReportServiceClient::fetchReportResultRowsAsync()} . + * + * @example samples/V1/ReportServiceClient/fetch_report_result_rows.php + * + * @param FetchReportResultRowsRequest $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 FetchReportResultRowsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function fetchReportResultRows( + FetchReportResultRowsRequest $request, + array $callOptions = [] + ): FetchReportResultRowsResponse { + return $this->startApiCall('FetchReportResultRows', $request, $callOptions)->wait(); + } + + /** + * API to retrieve a `Report` object. + * + * The async variant is {@see ReportServiceClient::getReportAsync()} . + * + * @example samples/V1/ReportServiceClient/get_report.php + * + * @param GetReportRequest $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 Report + * + * @throws ApiException Thrown if the API call fails. + */ + public function getReport(GetReportRequest $request, array $callOptions = []): Report + { + return $this->startApiCall('GetReport', $request, $callOptions)->wait(); + } + + /** + * API to retrieve a list of `Report` objects. + * + * The async variant is {@see ReportServiceClient::listReportsAsync()} . + * + * @example samples/V1/ReportServiceClient/list_reports.php + * + * @param ListReportsRequest $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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listReports(ListReportsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListReports', $request, $callOptions); + } + + /** + * Initiates the execution of an existing report asynchronously. Users can + * get the report by polling this operation via + * `OperationsService.GetOperation`. + * Poll every 5 seconds initially, with an exponential + * backoff. Once a report is complete, the operation will contain a + * `RunReportResponse` in its response field containing a report_result that + * can be passed to the `FetchReportResultRows` method to retrieve the report + * data. + * + * The async variant is {@see ReportServiceClient::runReportAsync()} . + * + * @example samples/V1/ReportServiceClient/run_report.php + * + * @param RunReportRequest $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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function runReport(RunReportRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('RunReport', $request, $callOptions)->wait(); + } + + /** + * API to update a `Report` object. + * + * The async variant is {@see ReportServiceClient::updateReportAsync()} . + * + * @example samples/V1/ReportServiceClient/update_report.php + * + * @param UpdateReportRequest $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 Report + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateReport(UpdateReportRequest $request, array $callOptions = []): Report + { + return $this->startApiCall('UpdateReport', $request, $callOptions)->wait(); + } +} diff --git a/AdsAdManager/src/V1/Client/RoleServiceClient.php b/AdsAdManager/src/V1/Client/RoleServiceClient.php new file mode 100644 index 000000000000..ed5f846b6849 --- /dev/null +++ b/AdsAdManager/src/V1/Client/RoleServiceClient.php @@ -0,0 +1,289 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/role_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/role_service_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/role_service_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return ['rest']; + } + + /** + * Formats a string containing the fully-qualified path to represent a network + * resource. + * + * @param string $networkCode + * + * @return string The formatted network resource. + */ + public static function networkName(string $networkCode): string + { + return self::getPathTemplate('network')->render([ + 'network_code' => $networkCode, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a role + * resource. + * + * @param string $networkCode + * @param string $role + * + * @return string The formatted role resource. + */ + public static function roleName(string $networkCode, string $role): string + { + return self::getPathTemplate('role')->render([ + 'network_code' => $networkCode, + 'role' => $role, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - network: networks/{network_code} + * - role: networks/{network_code}/roles/{role} + * + * 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 'admanager.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. At the moment, supports only + * `rest`. *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 = [ + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\RestTransport::build()} method 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); + } + + /** + * API to retrieve a `Role` object. + * + * The async variant is {@see RoleServiceClient::getRoleAsync()} . + * + * @example samples/V1/RoleServiceClient/get_role.php + * + * @param GetRoleRequest $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 Role + * + * @throws ApiException Thrown if the API call fails. + */ + public function getRole(GetRoleRequest $request, array $callOptions = []): Role + { + return $this->startApiCall('GetRole', $request, $callOptions)->wait(); + } + + /** + * API to retrieve a list of `Role` objects. + * + * The async variant is {@see RoleServiceClient::listRolesAsync()} . + * + * @example samples/V1/RoleServiceClient/list_roles.php + * + * @param ListRolesRequest $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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listRoles(ListRolesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListRoles', $request, $callOptions); + } +} diff --git a/AdsAdManager/src/V1/Client/TaxonomyCategoryServiceClient.php b/AdsAdManager/src/V1/Client/TaxonomyCategoryServiceClient.php new file mode 100644 index 000000000000..35abfd31fdef --- /dev/null +++ b/AdsAdManager/src/V1/Client/TaxonomyCategoryServiceClient.php @@ -0,0 +1,294 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/taxonomy_category_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/taxonomy_category_service_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => + __DIR__ . '/../resources/taxonomy_category_service_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return ['rest']; + } + + /** + * Formats a string containing the fully-qualified path to represent a network + * resource. + * + * @param string $networkCode + * + * @return string The formatted network resource. + */ + public static function networkName(string $networkCode): string + { + return self::getPathTemplate('network')->render([ + 'network_code' => $networkCode, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * taxonomy_category resource. + * + * @param string $networkCode + * @param string $taxonomyCategory + * + * @return string The formatted taxonomy_category resource. + */ + public static function taxonomyCategoryName(string $networkCode, string $taxonomyCategory): string + { + return self::getPathTemplate('taxonomyCategory')->render([ + 'network_code' => $networkCode, + 'taxonomy_category' => $taxonomyCategory, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - network: networks/{network_code} + * - taxonomyCategory: networks/{network_code}/taxonomyCategories/{taxonomy_category} + * + * 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 'admanager.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. At the moment, supports only + * `rest`. *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 = [ + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\RestTransport::build()} method 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); + } + + /** + * API to retrieve a `TaxonomyCategory` object. + * + * The async variant is + * {@see TaxonomyCategoryServiceClient::getTaxonomyCategoryAsync()} . + * + * @example samples/V1/TaxonomyCategoryServiceClient/get_taxonomy_category.php + * + * @param GetTaxonomyCategoryRequest $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 TaxonomyCategory + * + * @throws ApiException Thrown if the API call fails. + */ + public function getTaxonomyCategory(GetTaxonomyCategoryRequest $request, array $callOptions = []): TaxonomyCategory + { + return $this->startApiCall('GetTaxonomyCategory', $request, $callOptions)->wait(); + } + + /** + * API to retrieve a list of `TaxonomyCategory` objects. + * + * The async variant is + * {@see TaxonomyCategoryServiceClient::listTaxonomyCategoriesAsync()} . + * + * @example samples/V1/TaxonomyCategoryServiceClient/list_taxonomy_categories.php + * + * @param ListTaxonomyCategoriesRequest $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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listTaxonomyCategories( + ListTaxonomyCategoriesRequest $request, + array $callOptions = [] + ): PagedListResponse { + return $this->startApiCall('ListTaxonomyCategories', $request, $callOptions); + } +} diff --git a/AdsAdManager/src/V1/Client/UserServiceClient.php b/AdsAdManager/src/V1/Client/UserServiceClient.php new file mode 100644 index 000000000000..e068fd03184d --- /dev/null +++ b/AdsAdManager/src/V1/Client/UserServiceClient.php @@ -0,0 +1,247 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/user_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/user_service_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/user_service_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return ['rest']; + } + + /** + * Formats a string containing the fully-qualified path to represent a user + * resource. + * + * @param string $networkCode + * @param string $user + * + * @return string The formatted user resource. + */ + public static function userName(string $networkCode, string $user): string + { + return self::getPathTemplate('user')->render([ + 'network_code' => $networkCode, + 'user' => $user, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - user: networks/{network_code}/users/{user} + * + * 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 'admanager.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. At the moment, supports only + * `rest`. *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 = [ + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\RestTransport::build()} method 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); + } + + /** + * API to retrieve a User object. + * + * To get the current user, the resource name + * `networks/{networkCode}/users/me` can be used. + * + * The async variant is {@see UserServiceClient::getUserAsync()} . + * + * @example samples/V1/UserServiceClient/get_user.php + * + * @param GetUserRequest $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 User + * + * @throws ApiException Thrown if the API call fails. + */ + public function getUser(GetUserRequest $request, array $callOptions = []): User + { + return $this->startApiCall('GetUser', $request, $callOptions)->wait(); + } +} diff --git a/AdsAdManager/src/V1/Company.php b/AdsAdManager/src/V1/Company.php new file mode 100644 index 000000000000..18b9fe0df27a --- /dev/null +++ b/AdsAdManager/src/V1/Company.php @@ -0,0 +1,649 @@ +google.ads.admanager.v1.Company + */ +class Company extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The resource name of the `Company`. + * Format: `networks/{network_code}/companies/{company_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. `Company` ID. + * + * Generated from protobuf field int64 company_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $company_id = 0; + /** + * Required. The display name of the `Company`. + * This value has a maximum length of 127 characters. + * + * Generated from protobuf field string display_name = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + /** + * Required. The type of the `Company`. + * + * Generated from protobuf field .google.ads.admanager.v1.CompanyTypeEnum.CompanyType type = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $type = 0; + /** + * Optional. The address for the `Company`. + * This value has a maximum length of 1024 characters. + * + * Generated from protobuf field string address = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $address = ''; + /** + * Optional. The email for the `Company`. + * This value has a maximum length of 128 characters. + * + * Generated from protobuf field string email = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $email = ''; + /** + * Optional. The fax number for the `Company`. + * This value has a maximum length of 63 characters. + * + * Generated from protobuf field string fax = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $fax = ''; + /** + * Optional. The phone number for the `Company`. + * This value has a maximum length of 63 characters. + * + * Generated from protobuf field string phone = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $phone = ''; + /** + * Optional. The external ID for the `Company`. + * This value has a maximum length of 255 characters. + * + * Generated from protobuf field string external_id = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $external_id = ''; + /** + * Optional. Comments about the `Company`. + * This value has a maximum length of 1024 characters. + * + * Generated from protobuf field string comment = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $comment = ''; + /** + * Optional. The credit status of the `Company`. + * This attribute defaults to `ACTIVE` if basic settings are enabled and + * `ON_HOLD` if advance settings are enabled. + * + * Generated from protobuf field .google.ads.admanager.v1.CompanyCreditStatusEnum.CompanyCreditStatus credit_status = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $credit_status = 0; + /** + * Optional. The labels that are directly applied to the `Company`. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.AppliedLabel applied_labels = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $applied_labels; + /** + * Optional. The resource names of primary Contact of the `Company`. + * Format: "networks/{network_code}/contacts/{contact_id}" + * + * Generated from protobuf field optional string primary_contact = 13 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $primary_contact = null; + /** + * Optional. The resource names of Teams that are directly associated with the + * `Company`. Format: "networks/{network_code}/teams/{team_id}" + * + * Generated from protobuf field repeated string applied_teams = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + private $applied_teams; + /** + * Output only. The time the `Company` was last modified. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Optional. The ID of the Google-recognized canonicalized form of the + * `Company`. + * + * Generated from protobuf field int64 third_party_company_id = 16 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $third_party_company_id = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The resource name of the `Company`. + * Format: `networks/{network_code}/companies/{company_id}` + * @type int|string $company_id + * Output only. `Company` ID. + * @type string $display_name + * Required. The display name of the `Company`. + * This value has a maximum length of 127 characters. + * @type int $type + * Required. The type of the `Company`. + * @type string $address + * Optional. The address for the `Company`. + * This value has a maximum length of 1024 characters. + * @type string $email + * Optional. The email for the `Company`. + * This value has a maximum length of 128 characters. + * @type string $fax + * Optional. The fax number for the `Company`. + * This value has a maximum length of 63 characters. + * @type string $phone + * Optional. The phone number for the `Company`. + * This value has a maximum length of 63 characters. + * @type string $external_id + * Optional. The external ID for the `Company`. + * This value has a maximum length of 255 characters. + * @type string $comment + * Optional. Comments about the `Company`. + * This value has a maximum length of 1024 characters. + * @type int $credit_status + * Optional. The credit status of the `Company`. + * This attribute defaults to `ACTIVE` if basic settings are enabled and + * `ON_HOLD` if advance settings are enabled. + * @type array<\Google\Ads\AdManager\V1\AppliedLabel>|\Google\Protobuf\Internal\RepeatedField $applied_labels + * Optional. The labels that are directly applied to the `Company`. + * @type string $primary_contact + * Optional. The resource names of primary Contact of the `Company`. + * Format: "networks/{network_code}/contacts/{contact_id}" + * @type array|\Google\Protobuf\Internal\RepeatedField $applied_teams + * Optional. The resource names of Teams that are directly associated with the + * `Company`. Format: "networks/{network_code}/teams/{team_id}" + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The time the `Company` was last modified. + * @type int|string $third_party_company_id + * Optional. The ID of the Google-recognized canonicalized form of the + * `Company`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\CompanyMessages::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The resource name of the `Company`. + * Format: `networks/{network_code}/companies/{company_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The resource name of the `Company`. + * Format: `networks/{network_code}/companies/{company_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. `Company` ID. + * + * Generated from protobuf field int64 company_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getCompanyId() + { + return $this->company_id; + } + + /** + * Output only. `Company` ID. + * + * Generated from protobuf field int64 company_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setCompanyId($var) + { + GPBUtil::checkInt64($var); + $this->company_id = $var; + + return $this; + } + + /** + * Required. The display name of the `Company`. + * This value has a maximum length of 127 characters. + * + * Generated from protobuf field string display_name = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. The display name of the `Company`. + * This value has a maximum length of 127 characters. + * + * Generated from protobuf field string display_name = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Required. The type of the `Company`. + * + * Generated from protobuf field .google.ads.admanager.v1.CompanyTypeEnum.CompanyType type = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Required. The type of the `Company`. + * + * Generated from protobuf field .google.ads.admanager.v1.CompanyTypeEnum.CompanyType type = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Ads\AdManager\V1\CompanyTypeEnum\CompanyType::class); + $this->type = $var; + + return $this; + } + + /** + * Optional. The address for the `Company`. + * This value has a maximum length of 1024 characters. + * + * Generated from protobuf field string address = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAddress() + { + return $this->address; + } + + /** + * Optional. The address for the `Company`. + * This value has a maximum length of 1024 characters. + * + * Generated from protobuf field string address = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAddress($var) + { + GPBUtil::checkString($var, True); + $this->address = $var; + + return $this; + } + + /** + * Optional. The email for the `Company`. + * This value has a maximum length of 128 characters. + * + * Generated from protobuf field string email = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEmail() + { + return $this->email; + } + + /** + * Optional. The email for the `Company`. + * This value has a maximum length of 128 characters. + * + * Generated from protobuf field string email = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEmail($var) + { + GPBUtil::checkString($var, True); + $this->email = $var; + + return $this; + } + + /** + * Optional. The fax number for the `Company`. + * This value has a maximum length of 63 characters. + * + * Generated from protobuf field string fax = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFax() + { + return $this->fax; + } + + /** + * Optional. The fax number for the `Company`. + * This value has a maximum length of 63 characters. + * + * Generated from protobuf field string fax = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFax($var) + { + GPBUtil::checkString($var, True); + $this->fax = $var; + + return $this; + } + + /** + * Optional. The phone number for the `Company`. + * This value has a maximum length of 63 characters. + * + * Generated from protobuf field string phone = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPhone() + { + return $this->phone; + } + + /** + * Optional. The phone number for the `Company`. + * This value has a maximum length of 63 characters. + * + * Generated from protobuf field string phone = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPhone($var) + { + GPBUtil::checkString($var, True); + $this->phone = $var; + + return $this; + } + + /** + * Optional. The external ID for the `Company`. + * This value has a maximum length of 255 characters. + * + * Generated from protobuf field string external_id = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getExternalId() + { + return $this->external_id; + } + + /** + * Optional. The external ID for the `Company`. + * This value has a maximum length of 255 characters. + * + * Generated from protobuf field string external_id = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setExternalId($var) + { + GPBUtil::checkString($var, True); + $this->external_id = $var; + + return $this; + } + + /** + * Optional. Comments about the `Company`. + * This value has a maximum length of 1024 characters. + * + * Generated from protobuf field string comment = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getComment() + { + return $this->comment; + } + + /** + * Optional. Comments about the `Company`. + * This value has a maximum length of 1024 characters. + * + * Generated from protobuf field string comment = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setComment($var) + { + GPBUtil::checkString($var, True); + $this->comment = $var; + + return $this; + } + + /** + * Optional. The credit status of the `Company`. + * This attribute defaults to `ACTIVE` if basic settings are enabled and + * `ON_HOLD` if advance settings are enabled. + * + * Generated from protobuf field .google.ads.admanager.v1.CompanyCreditStatusEnum.CompanyCreditStatus credit_status = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getCreditStatus() + { + return $this->credit_status; + } + + /** + * Optional. The credit status of the `Company`. + * This attribute defaults to `ACTIVE` if basic settings are enabled and + * `ON_HOLD` if advance settings are enabled. + * + * Generated from protobuf field .google.ads.admanager.v1.CompanyCreditStatusEnum.CompanyCreditStatus credit_status = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setCreditStatus($var) + { + GPBUtil::checkEnum($var, \Google\Ads\AdManager\V1\CompanyCreditStatusEnum\CompanyCreditStatus::class); + $this->credit_status = $var; + + return $this; + } + + /** + * Optional. The labels that are directly applied to the `Company`. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.AppliedLabel applied_labels = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAppliedLabels() + { + return $this->applied_labels; + } + + /** + * Optional. The labels that are directly applied to the `Company`. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.AppliedLabel applied_labels = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Ads\AdManager\V1\AppliedLabel>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAppliedLabels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\AppliedLabel::class); + $this->applied_labels = $arr; + + return $this; + } + + /** + * Optional. The resource names of primary Contact of the `Company`. + * Format: "networks/{network_code}/contacts/{contact_id}" + * + * Generated from protobuf field optional string primary_contact = 13 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getPrimaryContact() + { + return isset($this->primary_contact) ? $this->primary_contact : ''; + } + + public function hasPrimaryContact() + { + return isset($this->primary_contact); + } + + public function clearPrimaryContact() + { + unset($this->primary_contact); + } + + /** + * Optional. The resource names of primary Contact of the `Company`. + * Format: "networks/{network_code}/contacts/{contact_id}" + * + * Generated from protobuf field optional string primary_contact = 13 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setPrimaryContact($var) + { + GPBUtil::checkString($var, True); + $this->primary_contact = $var; + + return $this; + } + + /** + * Optional. The resource names of Teams that are directly associated with the + * `Company`. Format: "networks/{network_code}/teams/{team_id}" + * + * Generated from protobuf field repeated string applied_teams = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAppliedTeams() + { + return $this->applied_teams; + } + + /** + * Optional. The resource names of Teams that are directly associated with the + * `Company`. Format: "networks/{network_code}/teams/{team_id}" + * + * Generated from protobuf field repeated string applied_teams = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAppliedTeams($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->applied_teams = $arr; + + return $this; + } + + /** + * Output only. The time the `Company` was last modified. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The time the `Company` was last modified. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Optional. The ID of the Google-recognized canonicalized form of the + * `Company`. + * + * Generated from protobuf field int64 third_party_company_id = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getThirdPartyCompanyId() + { + return $this->third_party_company_id; + } + + /** + * Optional. The ID of the Google-recognized canonicalized form of the + * `Company`. + * + * Generated from protobuf field int64 third_party_company_id = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setThirdPartyCompanyId($var) + { + GPBUtil::checkInt64($var); + $this->third_party_company_id = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/CompanyCreditStatusEnum.php b/AdsAdManager/src/V1/CompanyCreditStatusEnum.php new file mode 100644 index 000000000000..07995e4a4bcd --- /dev/null +++ b/AdsAdManager/src/V1/CompanyCreditStatusEnum.php @@ -0,0 +1,34 @@ +google.ads.admanager.v1.CompanyCreditStatusEnum + */ +class CompanyCreditStatusEnum extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\CompanyCreditStatusEnum::initOnce(); + parent::__construct($data); + } + +} + diff --git a/AdsAdManager/src/V1/CompanyCreditStatusEnum/CompanyCreditStatus.php b/AdsAdManager/src/V1/CompanyCreditStatusEnum/CompanyCreditStatus.php new file mode 100644 index 000000000000..128dd6e62934 --- /dev/null +++ b/AdsAdManager/src/V1/CompanyCreditStatusEnum/CompanyCreditStatus.php @@ -0,0 +1,117 @@ +google.ads.admanager.v1.CompanyCreditStatusEnum.CompanyCreditStatus + */ +class CompanyCreditStatus +{ + /** + * No value specified + * + * Generated from protobuf enum COMPANY_CREDIT_STATUS_UNSPECIFIED = 0; + */ + const COMPANY_CREDIT_STATUS_UNSPECIFIED = 0; + /** + * The company's credit status is active. + * Line items belonging to the company can serve. + * This credit status is the default for basic settings and is available in + * both basic and advance settings. + * + * Generated from protobuf enum ACTIVE = 1; + */ + const ACTIVE = 1; + /** + * The company's credit status is inactive. + * Line items belonging to the company cannot be activated. However, line + * items that were activated before the credit status changed will remain + * active. New orders or line items belonging to the company cannot be + * created. + * Companies with this credit status will be hidden by default in company + * search results. + * This credit status is available in both basic and advance settings. + * + * Generated from protobuf enum INACTIVE = 2; + */ + const INACTIVE = 2; + /** + * The company's credit status is on hold. + * Line items belonging to the company cannot be activated. However, line + * items that were activated before the credit status changed will remain + * active. New orders or line items belonging to the company can be + * created. + * This credit status is the default in advance settings and is only + * available in advance settings. + * + * Generated from protobuf enum ON_HOLD = 3; + */ + const ON_HOLD = 3; + /** + * The company's credit status is stopped. + * Line items belonging to the company cannot be activated. However, line + * items that were activated before the credit status changed will remain + * active. New orders or line items belonging to the company cannot be + * created. + * This credit status is only available in advance settings. + * + * Generated from protobuf enum STOP = 4; + */ + const STOP = 4; + /** + * The company's credit status is blocked. + * All active line items belonging to the company will stop serving with + * immediate effect. Line items belonging to the company cannot be + * activated, and new orders or line items belonging to the company cannot + * be created. + * This credit status is only available in advance settings. + * + * Generated from protobuf enum BLOCKED = 5; + */ + const BLOCKED = 5; + + private static $valueToName = [ + self::COMPANY_CREDIT_STATUS_UNSPECIFIED => 'COMPANY_CREDIT_STATUS_UNSPECIFIED', + self::ACTIVE => 'ACTIVE', + self::INACTIVE => 'INACTIVE', + self::ON_HOLD => 'ON_HOLD', + self::STOP => 'STOP', + self::BLOCKED => 'BLOCKED', + ]; + + 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/AdsAdManager/src/V1/CompanyTypeEnum.php b/AdsAdManager/src/V1/CompanyTypeEnum.php new file mode 100644 index 000000000000..3b9ae1d004ae --- /dev/null +++ b/AdsAdManager/src/V1/CompanyTypeEnum.php @@ -0,0 +1,34 @@ +google.ads.admanager.v1.CompanyTypeEnum + */ +class CompanyTypeEnum extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\CompanyTypeEnum::initOnce(); + parent::__construct($data); + } + +} + diff --git a/AdsAdManager/src/V1/CompanyTypeEnum/CompanyType.php b/AdsAdManager/src/V1/CompanyTypeEnum/CompanyType.php new file mode 100644 index 000000000000..9b9078808a50 --- /dev/null +++ b/AdsAdManager/src/V1/CompanyTypeEnum/CompanyType.php @@ -0,0 +1,84 @@ +google.ads.admanager.v1.CompanyTypeEnum.CompanyType + */ +class CompanyType +{ + /** + * No value specified + * + * Generated from protobuf enum COMPANY_TYPE_UNSPECIFIED = 0; + */ + const COMPANY_TYPE_UNSPECIFIED = 0; + /** + * A business entity that purchases ad inventory. + * + * Generated from protobuf enum ADVERTISER = 1; + */ + const ADVERTISER = 1; + /** + * A company representing the publisher's own advertiser for house ads. + * + * Generated from protobuf enum HOUSE_ADVERTISER = 2; + */ + const HOUSE_ADVERTISER = 2; + /** + * An organization that manages ad accounts and offers services, such as ad + * creation, placement, and management to advertisers. + * + * Generated from protobuf enum AGENCY = 3; + */ + const AGENCY = 3; + /** + * A company representing the publisher's own agency. + * + * Generated from protobuf enum HOUSE_AGENCY = 4; + */ + const HOUSE_AGENCY = 4; + /** + * A company representing multiple advertisers and agencies. + * + * Generated from protobuf enum AD_NETWORK = 5; + */ + const AD_NETWORK = 5; + + private static $valueToName = [ + self::COMPANY_TYPE_UNSPECIFIED => 'COMPANY_TYPE_UNSPECIFIED', + self::ADVERTISER => 'ADVERTISER', + self::HOUSE_ADVERTISER => 'HOUSE_ADVERTISER', + self::AGENCY => 'AGENCY', + self::HOUSE_AGENCY => 'HOUSE_AGENCY', + self::AD_NETWORK => 'AD_NETWORK', + ]; + + 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/AdsAdManager/src/V1/Contact.php b/AdsAdManager/src/V1/Contact.php new file mode 100644 index 000000000000..39a061730a07 --- /dev/null +++ b/AdsAdManager/src/V1/Contact.php @@ -0,0 +1,112 @@ +google.ads.admanager.v1.Contact + */ +class Contact extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The resource name of the `Contact`. + * Format: `networks/{network_code}/contacts/{contact_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. The unique ID of the contact. This value is readonly and is + * assigned by Google. + * + * Generated from protobuf field int64 contact_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $contact_id = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The resource name of the `Contact`. + * Format: `networks/{network_code}/contacts/{contact_id}` + * @type int|string $contact_id + * Output only. The unique ID of the contact. This value is readonly and is + * assigned by Google. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\ContactMessages::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The resource name of the `Contact`. + * Format: `networks/{network_code}/contacts/{contact_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The resource name of the `Contact`. + * Format: `networks/{network_code}/contacts/{contact_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The unique ID of the contact. This value is readonly and is + * assigned by Google. + * + * Generated from protobuf field int64 contact_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getContactId() + { + return $this->contact_id; + } + + /** + * Output only. The unique ID of the contact. This value is readonly and is + * assigned by Google. + * + * Generated from protobuf field int64 contact_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setContactId($var) + { + GPBUtil::checkInt64($var); + $this->contact_id = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/CreateEntitySignalsMappingRequest.php b/AdsAdManager/src/V1/CreateEntitySignalsMappingRequest.php new file mode 100644 index 000000000000..35f125049dec --- /dev/null +++ b/AdsAdManager/src/V1/CreateEntitySignalsMappingRequest.php @@ -0,0 +1,132 @@ +google.ads.admanager.v1.CreateEntitySignalsMappingRequest + */ +class CreateEntitySignalsMappingRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource where this EntitySignalsMapping will be + * created. Format: `networks/{network_code}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The EntitySignalsMapping object to create. + * + * Generated from protobuf field .google.ads.admanager.v1.EntitySignalsMapping entity_signals_mapping = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $entity_signals_mapping = null; + + /** + * @param string $parent Required. The parent resource where this EntitySignalsMapping will be + * created. Format: `networks/{network_code}` + * Please see {@see EntitySignalsMappingServiceClient::networkName()} for help formatting this field. + * @param \Google\Ads\AdManager\V1\EntitySignalsMapping $entitySignalsMapping Required. The EntitySignalsMapping object to create. + * + * @return \Google\Ads\AdManager\V1\CreateEntitySignalsMappingRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Ads\AdManager\V1\EntitySignalsMapping $entitySignalsMapping): self + { + return (new self()) + ->setParent($parent) + ->setEntitySignalsMapping($entitySignalsMapping); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource where this EntitySignalsMapping will be + * created. Format: `networks/{network_code}` + * @type \Google\Ads\AdManager\V1\EntitySignalsMapping $entity_signals_mapping + * Required. The EntitySignalsMapping object to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\EntitySignalsMappingService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource where this EntitySignalsMapping will be + * created. Format: `networks/{network_code}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource where this EntitySignalsMapping will be + * created. Format: `networks/{network_code}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The EntitySignalsMapping object to create. + * + * Generated from protobuf field .google.ads.admanager.v1.EntitySignalsMapping entity_signals_mapping = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Ads\AdManager\V1\EntitySignalsMapping|null + */ + public function getEntitySignalsMapping() + { + return $this->entity_signals_mapping; + } + + public function hasEntitySignalsMapping() + { + return isset($this->entity_signals_mapping); + } + + public function clearEntitySignalsMapping() + { + unset($this->entity_signals_mapping); + } + + /** + * Required. The EntitySignalsMapping object to create. + * + * Generated from protobuf field .google.ads.admanager.v1.EntitySignalsMapping entity_signals_mapping = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Ads\AdManager\V1\EntitySignalsMapping $var + * @return $this + */ + public function setEntitySignalsMapping($var) + { + GPBUtil::checkMessage($var, \Google\Ads\AdManager\V1\EntitySignalsMapping::class); + $this->entity_signals_mapping = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/CreateReportRequest.php b/AdsAdManager/src/V1/CreateReportRequest.php new file mode 100644 index 000000000000..6d466eb38e48 --- /dev/null +++ b/AdsAdManager/src/V1/CreateReportRequest.php @@ -0,0 +1,132 @@ +google.ads.admanager.v1.CreateReportRequest + */ +class CreateReportRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource where this `Report` will be created. + * Format: `networks/{network_code}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The `Report` to create. + * + * Generated from protobuf field .google.ads.admanager.v1.Report report = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $report = null; + + /** + * @param string $parent Required. The parent resource where this `Report` will be created. + * Format: `networks/{network_code}` + * Please see {@see ReportServiceClient::networkName()} for help formatting this field. + * @param \Google\Ads\AdManager\V1\Report $report Required. The `Report` to create. + * + * @return \Google\Ads\AdManager\V1\CreateReportRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Ads\AdManager\V1\Report $report): self + { + return (new self()) + ->setParent($parent) + ->setReport($report); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource where this `Report` will be created. + * Format: `networks/{network_code}` + * @type \Google\Ads\AdManager\V1\Report $report + * Required. The `Report` to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\ReportService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource where this `Report` will be created. + * Format: `networks/{network_code}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource where this `Report` will be created. + * Format: `networks/{network_code}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The `Report` to create. + * + * Generated from protobuf field .google.ads.admanager.v1.Report report = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Ads\AdManager\V1\Report|null + */ + public function getReport() + { + return $this->report; + } + + public function hasReport() + { + return isset($this->report); + } + + public function clearReport() + { + unset($this->report); + } + + /** + * Required. The `Report` to create. + * + * Generated from protobuf field .google.ads.admanager.v1.Report report = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Ads\AdManager\V1\Report $var + * @return $this + */ + public function setReport($var) + { + GPBUtil::checkMessage($var, \Google\Ads\AdManager\V1\Report::class); + $this->report = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/CustomField.php b/AdsAdManager/src/V1/CustomField.php new file mode 100644 index 000000000000..a309a4d4b326 --- /dev/null +++ b/AdsAdManager/src/V1/CustomField.php @@ -0,0 +1,355 @@ +google.ads.admanager.v1.CustomField + */ +class CustomField extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The resource name of the `CustomField`. + * Format: `networks/{network_code}/customFields/{custom_field_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. Unique ID of the CustomField. This value is readonly and is + * assigned by Google. + * + * Generated from protobuf field int64 custom_field_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $custom_field_id = 0; + /** + * Required. Name of the CustomField. The max length is 127 characters. + * + * Generated from protobuf field string display_name = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + /** + * Optional. A description of the custom field. The maximum length is 511 + * characters. + * + * Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Output only. The status of the `CustomField`. + * + * Generated from protobuf field .google.ads.admanager.v1.CustomFieldStatusEnum.CustomFieldStatus status = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status = 0; + /** + * Required. The type of entity the `CustomField` can be applied to. + * + * Generated from protobuf field .google.ads.admanager.v1.CustomFieldEntityTypeEnum.CustomFieldEntityType entity_type = 7 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $entity_type = 0; + /** + * Required. The data type of the `CustomField`. + * + * Generated from protobuf field .google.ads.admanager.v1.CustomFieldDataTypeEnum.CustomFieldDataType data_type = 8 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $data_type = 0; + /** + * Required. The visibility of the `CustomField`. + * + * Generated from protobuf field .google.ads.admanager.v1.CustomFieldVisibilityEnum.CustomFieldVisibility visibility = 9 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $visibility = 0; + /** + * Optional. The drop-down options for the `CustomField`. + * Only applicable for `CustomField` with the drop-down data type. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.CustomFieldOption options = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $options; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The resource name of the `CustomField`. + * Format: `networks/{network_code}/customFields/{custom_field_id}` + * @type int|string $custom_field_id + * Output only. Unique ID of the CustomField. This value is readonly and is + * assigned by Google. + * @type string $display_name + * Required. Name of the CustomField. The max length is 127 characters. + * @type string $description + * Optional. A description of the custom field. The maximum length is 511 + * characters. + * @type int $status + * Output only. The status of the `CustomField`. + * @type int $entity_type + * Required. The type of entity the `CustomField` can be applied to. + * @type int $data_type + * Required. The data type of the `CustomField`. + * @type int $visibility + * Required. The visibility of the `CustomField`. + * @type array<\Google\Ads\AdManager\V1\CustomFieldOption>|\Google\Protobuf\Internal\RepeatedField $options + * Optional. The drop-down options for the `CustomField`. + * Only applicable for `CustomField` with the drop-down data type. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\CustomFieldMessages::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The resource name of the `CustomField`. + * Format: `networks/{network_code}/customFields/{custom_field_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The resource name of the `CustomField`. + * Format: `networks/{network_code}/customFields/{custom_field_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Unique ID of the CustomField. This value is readonly and is + * assigned by Google. + * + * Generated from protobuf field int64 custom_field_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getCustomFieldId() + { + return $this->custom_field_id; + } + + /** + * Output only. Unique ID of the CustomField. This value is readonly and is + * assigned by Google. + * + * Generated from protobuf field int64 custom_field_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setCustomFieldId($var) + { + GPBUtil::checkInt64($var); + $this->custom_field_id = $var; + + return $this; + } + + /** + * Required. Name of the CustomField. The max length is 127 characters. + * + * Generated from protobuf field string display_name = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. Name of the CustomField. The max length is 127 characters. + * + * Generated from protobuf field string display_name = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Optional. A description of the custom field. The maximum length is 511 + * characters. + * + * Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. A description of the custom field. The maximum length is 511 + * characters. + * + * Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. The status of the `CustomField`. + * + * Generated from protobuf field .google.ads.admanager.v1.CustomFieldStatusEnum.CustomFieldStatus status = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getStatus() + { + return $this->status; + } + + /** + * Output only. The status of the `CustomField`. + * + * Generated from protobuf field .google.ads.admanager.v1.CustomFieldStatusEnum.CustomFieldStatus status = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkEnum($var, \Google\Ads\AdManager\V1\CustomFieldStatusEnum\CustomFieldStatus::class); + $this->status = $var; + + return $this; + } + + /** + * Required. The type of entity the `CustomField` can be applied to. + * + * Generated from protobuf field .google.ads.admanager.v1.CustomFieldEntityTypeEnum.CustomFieldEntityType entity_type = 7 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getEntityType() + { + return $this->entity_type; + } + + /** + * Required. The type of entity the `CustomField` can be applied to. + * + * Generated from protobuf field .google.ads.admanager.v1.CustomFieldEntityTypeEnum.CustomFieldEntityType entity_type = 7 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setEntityType($var) + { + GPBUtil::checkEnum($var, \Google\Ads\AdManager\V1\CustomFieldEntityTypeEnum\CustomFieldEntityType::class); + $this->entity_type = $var; + + return $this; + } + + /** + * Required. The data type of the `CustomField`. + * + * Generated from protobuf field .google.ads.admanager.v1.CustomFieldDataTypeEnum.CustomFieldDataType data_type = 8 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getDataType() + { + return $this->data_type; + } + + /** + * Required. The data type of the `CustomField`. + * + * Generated from protobuf field .google.ads.admanager.v1.CustomFieldDataTypeEnum.CustomFieldDataType data_type = 8 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setDataType($var) + { + GPBUtil::checkEnum($var, \Google\Ads\AdManager\V1\CustomFieldDataTypeEnum\CustomFieldDataType::class); + $this->data_type = $var; + + return $this; + } + + /** + * Required. The visibility of the `CustomField`. + * + * Generated from protobuf field .google.ads.admanager.v1.CustomFieldVisibilityEnum.CustomFieldVisibility visibility = 9 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getVisibility() + { + return $this->visibility; + } + + /** + * Required. The visibility of the `CustomField`. + * + * Generated from protobuf field .google.ads.admanager.v1.CustomFieldVisibilityEnum.CustomFieldVisibility visibility = 9 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setVisibility($var) + { + GPBUtil::checkEnum($var, \Google\Ads\AdManager\V1\CustomFieldVisibilityEnum\CustomFieldVisibility::class); + $this->visibility = $var; + + return $this; + } + + /** + * Optional. The drop-down options for the `CustomField`. + * Only applicable for `CustomField` with the drop-down data type. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.CustomFieldOption options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOptions() + { + return $this->options; + } + + /** + * Optional. The drop-down options for the `CustomField`. + * Only applicable for `CustomField` with the drop-down data type. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.CustomFieldOption options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Ads\AdManager\V1\CustomFieldOption>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOptions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\CustomFieldOption::class); + $this->options = $arr; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/CustomFieldDataTypeEnum.php b/AdsAdManager/src/V1/CustomFieldDataTypeEnum.php new file mode 100644 index 000000000000..a9ef8a168597 --- /dev/null +++ b/AdsAdManager/src/V1/CustomFieldDataTypeEnum.php @@ -0,0 +1,34 @@ +google.ads.admanager.v1.CustomFieldDataTypeEnum + */ +class CustomFieldDataTypeEnum extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\CustomFieldEnums::initOnce(); + parent::__construct($data); + } + +} + diff --git a/AdsAdManager/src/V1/CustomFieldDataTypeEnum/CustomFieldDataType.php b/AdsAdManager/src/V1/CustomFieldDataTypeEnum/CustomFieldDataType.php new file mode 100644 index 000000000000..a3ac30f121bf --- /dev/null +++ b/AdsAdManager/src/V1/CustomFieldDataTypeEnum/CustomFieldDataType.php @@ -0,0 +1,77 @@ +google.ads.admanager.v1.CustomFieldDataTypeEnum.CustomFieldDataType + */ +class CustomFieldDataType +{ + /** + * No value specified + * + * Generated from protobuf enum CUSTOM_FIELD_DATA_TYPE_UNSPECIFIED = 0; + */ + const CUSTOM_FIELD_DATA_TYPE_UNSPECIFIED = 0; + /** + * A string field + * The max length is 255 characters. + * + * Generated from protobuf enum STRING = 1; + */ + const STRING = 1; + /** + * A number field. + * + * Generated from protobuf enum NUMBER = 2; + */ + const NUMBER = 2; + /** + * A "Yes" or "No" toggle field. + * + * Generated from protobuf enum TOGGLE = 3; + */ + const TOGGLE = 3; + /** + * A drop-down field. + * + * Generated from protobuf enum DROP_DOWN = 4; + */ + const DROP_DOWN = 4; + + private static $valueToName = [ + self::CUSTOM_FIELD_DATA_TYPE_UNSPECIFIED => 'CUSTOM_FIELD_DATA_TYPE_UNSPECIFIED', + self::STRING => 'STRING', + self::NUMBER => 'NUMBER', + self::TOGGLE => 'TOGGLE', + self::DROP_DOWN => 'DROP_DOWN', + ]; + + 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/AdsAdManager/src/V1/CustomFieldEntityTypeEnum.php b/AdsAdManager/src/V1/CustomFieldEntityTypeEnum.php new file mode 100644 index 000000000000..c37b1c9f4229 --- /dev/null +++ b/AdsAdManager/src/V1/CustomFieldEntityTypeEnum.php @@ -0,0 +1,34 @@ +google.ads.admanager.v1.CustomFieldEntityTypeEnum + */ +class CustomFieldEntityTypeEnum extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\CustomFieldEnums::initOnce(); + parent::__construct($data); + } + +} + diff --git a/AdsAdManager/src/V1/CustomFieldEntityTypeEnum/CustomFieldEntityType.php b/AdsAdManager/src/V1/CustomFieldEntityTypeEnum/CustomFieldEntityType.php new file mode 100644 index 000000000000..f46d58e9435e --- /dev/null +++ b/AdsAdManager/src/V1/CustomFieldEntityTypeEnum/CustomFieldEntityType.php @@ -0,0 +1,83 @@ +google.ads.admanager.v1.CustomFieldEntityTypeEnum.CustomFieldEntityType + */ +class CustomFieldEntityType +{ + /** + * No value specified + * + * Generated from protobuf enum CUSTOM_FIELD_ENTITY_TYPE_UNSPECIFIED = 0; + */ + const CUSTOM_FIELD_ENTITY_TYPE_UNSPECIFIED = 0; + /** + * The CustomField is applied to LineItems. + * + * Generated from protobuf enum LINE_ITEM = 1; + */ + const LINE_ITEM = 1; + /** + * The CustomField is applied to Orders. + * + * Generated from protobuf enum ORDER = 2; + */ + const ORDER = 2; + /** + * The CustomField is applied to Creatives. + * + * Generated from protobuf enum CREATIVE = 3; + */ + const CREATIVE = 3; + /** + * The CustomField is applied to Proposals. + * + * Generated from protobuf enum PROPOSAL = 4; + */ + const PROPOSAL = 4; + /** + * The CustomField is applied to ProposalLineItems. + * + * Generated from protobuf enum PROPOSAL_LINE_ITEM = 5; + */ + const PROPOSAL_LINE_ITEM = 5; + + private static $valueToName = [ + self::CUSTOM_FIELD_ENTITY_TYPE_UNSPECIFIED => 'CUSTOM_FIELD_ENTITY_TYPE_UNSPECIFIED', + self::LINE_ITEM => 'LINE_ITEM', + self::ORDER => 'ORDER', + self::CREATIVE => 'CREATIVE', + self::PROPOSAL => 'PROPOSAL', + self::PROPOSAL_LINE_ITEM => 'PROPOSAL_LINE_ITEM', + ]; + + 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/AdsAdManager/src/V1/CustomFieldOption.php b/AdsAdManager/src/V1/CustomFieldOption.php new file mode 100644 index 000000000000..bc0f77c34190 --- /dev/null +++ b/AdsAdManager/src/V1/CustomFieldOption.php @@ -0,0 +1,105 @@ +google.ads.admanager.v1.CustomFieldOption + */ +class CustomFieldOption extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. `CustomFieldOption` ID. + * + * Generated from protobuf field int64 custom_field_option_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $custom_field_option_id = 0; + /** + * Required. The display name of the `CustomFieldOption`. + * This value has a maximum length of 127 characters. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $custom_field_option_id + * Output only. `CustomFieldOption` ID. + * @type string $display_name + * Required. The display name of the `CustomFieldOption`. + * This value has a maximum length of 127 characters. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\CustomFieldMessages::initOnce(); + parent::__construct($data); + } + + /** + * Output only. `CustomFieldOption` ID. + * + * Generated from protobuf field int64 custom_field_option_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getCustomFieldOptionId() + { + return $this->custom_field_option_id; + } + + /** + * Output only. `CustomFieldOption` ID. + * + * Generated from protobuf field int64 custom_field_option_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setCustomFieldOptionId($var) + { + GPBUtil::checkInt64($var); + $this->custom_field_option_id = $var; + + return $this; + } + + /** + * Required. The display name of the `CustomFieldOption`. + * This value has a maximum length of 127 characters. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. The display name of the `CustomFieldOption`. + * This value has a maximum length of 127 characters. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/CustomFieldStatusEnum.php b/AdsAdManager/src/V1/CustomFieldStatusEnum.php new file mode 100644 index 000000000000..0ad861f4eb8f --- /dev/null +++ b/AdsAdManager/src/V1/CustomFieldStatusEnum.php @@ -0,0 +1,34 @@ +google.ads.admanager.v1.CustomFieldStatusEnum + */ +class CustomFieldStatusEnum extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\CustomFieldEnums::initOnce(); + parent::__construct($data); + } + +} + diff --git a/AdsAdManager/src/V1/CustomFieldStatusEnum/CustomFieldStatus.php b/AdsAdManager/src/V1/CustomFieldStatusEnum/CustomFieldStatus.php new file mode 100644 index 000000000000..3264bc448427 --- /dev/null +++ b/AdsAdManager/src/V1/CustomFieldStatusEnum/CustomFieldStatus.php @@ -0,0 +1,62 @@ +google.ads.admanager.v1.CustomFieldStatusEnum.CustomFieldStatus + */ +class CustomFieldStatus +{ + /** + * No value specified + * + * Generated from protobuf enum CUSTOM_FIELD_STATUS_UNSPECIFIED = 0; + */ + const CUSTOM_FIELD_STATUS_UNSPECIFIED = 0; + /** + * The CustomField is active. + * + * Generated from protobuf enum ACTIVE = 1; + */ + const ACTIVE = 1; + /** + * The CustomField is inactive. + * + * Generated from protobuf enum INACTIVE = 2; + */ + const INACTIVE = 2; + + private static $valueToName = [ + self::CUSTOM_FIELD_STATUS_UNSPECIFIED => 'CUSTOM_FIELD_STATUS_UNSPECIFIED', + self::ACTIVE => 'ACTIVE', + self::INACTIVE => 'INACTIVE', + ]; + + 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/AdsAdManager/src/V1/CustomFieldValue.php b/AdsAdManager/src/V1/CustomFieldValue.php new file mode 100644 index 000000000000..9a40b22f768f --- /dev/null +++ b/AdsAdManager/src/V1/CustomFieldValue.php @@ -0,0 +1,115 @@ +google.ads.admanager.v1.CustomFieldValue + */ +class CustomFieldValue extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The custom field for which this is a value. + * Format: "networks/{network_code}/customFields/{custom_field_id}" + * + * Generated from protobuf field string custom_field = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $custom_field = ''; + /** + * Required. A typed value representation of the value. + * + * Generated from protobuf field optional .google.ads.admanager.v1.CustomFieldValue.Value value = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $custom_field + * Required. The custom field for which this is a value. + * Format: "networks/{network_code}/customFields/{custom_field_id}" + * @type \Google\Ads\AdManager\V1\CustomFieldValue\Value $value + * Required. A typed value representation of the value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\CustomFieldValue::initOnce(); + parent::__construct($data); + } + + /** + * Required. The custom field for which this is a value. + * Format: "networks/{network_code}/customFields/{custom_field_id}" + * + * Generated from protobuf field string custom_field = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getCustomField() + { + return $this->custom_field; + } + + /** + * Required. The custom field for which this is a value. + * Format: "networks/{network_code}/customFields/{custom_field_id}" + * + * Generated from protobuf field string custom_field = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setCustomField($var) + { + GPBUtil::checkString($var, True); + $this->custom_field = $var; + + return $this; + } + + /** + * Required. A typed value representation of the value. + * + * Generated from protobuf field optional .google.ads.admanager.v1.CustomFieldValue.Value value = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Ads\AdManager\V1\CustomFieldValue\Value|null + */ + public function getValue() + { + return $this->value; + } + + public function hasValue() + { + return isset($this->value); + } + + public function clearValue() + { + unset($this->value); + } + + /** + * Required. A typed value representation of the value. + * + * Generated from protobuf field optional .google.ads.admanager.v1.CustomFieldValue.Value value = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Ads\AdManager\V1\CustomFieldValue\Value $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkMessage($var, \Google\Ads\AdManager\V1\CustomFieldValue\Value::class); + $this->value = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/CustomFieldValue/Value.php b/AdsAdManager/src/V1/CustomFieldValue/Value.php new file mode 100644 index 000000000000..8ef3e954c23d --- /dev/null +++ b/AdsAdManager/src/V1/CustomFieldValue/Value.php @@ -0,0 +1,176 @@ +google.ads.admanager.v1.CustomFieldValue.Value + */ +class Value extends \Google\Protobuf\Internal\Message +{ + protected $value; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $dropdown_value + * The custom_field_option_id, if the CustomFieldDataType is DROPDOWN. + * @type string $string_value + * The value, if the CustomFieldDataType is STRING. + * @type float $number_value + * The value, if the CustomFieldDataType is NUMBER. + * @type bool $toggle_value + * The value, if the CustomFieldDataType is TOGGLE. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\CustomFieldValue::initOnce(); + parent::__construct($data); + } + + /** + * The custom_field_option_id, if the CustomFieldDataType is DROPDOWN. + * + * Generated from protobuf field int64 dropdown_value = 1; + * @return int|string + */ + public function getDropdownValue() + { + return $this->readOneof(1); + } + + public function hasDropdownValue() + { + return $this->hasOneof(1); + } + + /** + * The custom_field_option_id, if the CustomFieldDataType is DROPDOWN. + * + * Generated from protobuf field int64 dropdown_value = 1; + * @param int|string $var + * @return $this + */ + public function setDropdownValue($var) + { + GPBUtil::checkInt64($var); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * The value, if the CustomFieldDataType is STRING. + * + * Generated from protobuf field string string_value = 2; + * @return string + */ + public function getStringValue() + { + return $this->readOneof(2); + } + + public function hasStringValue() + { + return $this->hasOneof(2); + } + + /** + * The value, if the CustomFieldDataType is STRING. + * + * Generated from protobuf field string string_value = 2; + * @param string $var + * @return $this + */ + public function setStringValue($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The value, if the CustomFieldDataType is NUMBER. + * + * Generated from protobuf field double number_value = 3; + * @return float + */ + public function getNumberValue() + { + return $this->readOneof(3); + } + + public function hasNumberValue() + { + return $this->hasOneof(3); + } + + /** + * The value, if the CustomFieldDataType is NUMBER. + * + * Generated from protobuf field double number_value = 3; + * @param float $var + * @return $this + */ + public function setNumberValue($var) + { + GPBUtil::checkDouble($var); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * The value, if the CustomFieldDataType is TOGGLE. + * + * Generated from protobuf field bool toggle_value = 4; + * @return bool + */ + public function getToggleValue() + { + return $this->readOneof(4); + } + + public function hasToggleValue() + { + return $this->hasOneof(4); + } + + /** + * The value, if the CustomFieldDataType is TOGGLE. + * + * Generated from protobuf field bool toggle_value = 4; + * @param bool $var + * @return $this + */ + public function setToggleValue($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getValue() + { + return $this->whichOneof("value"); + } + +} + + diff --git a/AdsAdManager/src/V1/CustomFieldVisibilityEnum.php b/AdsAdManager/src/V1/CustomFieldVisibilityEnum.php new file mode 100644 index 000000000000..3b68d3b5e3bb --- /dev/null +++ b/AdsAdManager/src/V1/CustomFieldVisibilityEnum.php @@ -0,0 +1,34 @@ +google.ads.admanager.v1.CustomFieldVisibilityEnum + */ +class CustomFieldVisibilityEnum extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\CustomFieldEnums::initOnce(); + parent::__construct($data); + } + +} + diff --git a/AdsAdManager/src/V1/CustomFieldVisibilityEnum/CustomFieldVisibility.php b/AdsAdManager/src/V1/CustomFieldVisibilityEnum/CustomFieldVisibility.php new file mode 100644 index 000000000000..317f315358da --- /dev/null +++ b/AdsAdManager/src/V1/CustomFieldVisibilityEnum/CustomFieldVisibility.php @@ -0,0 +1,70 @@ +google.ads.admanager.v1.CustomFieldVisibilityEnum.CustomFieldVisibility + */ +class CustomFieldVisibility +{ + /** + * No value specified + * + * Generated from protobuf enum CUSTOM_FIELD_VISIBILITY_UNSPECIFIED = 0; + */ + const CUSTOM_FIELD_VISIBILITY_UNSPECIFIED = 0; + /** + * The CustomField is not visible in the UI and only visible through the + * API. + * + * Generated from protobuf enum HIDDEN = 1; + */ + const HIDDEN = 1; + /** + * The CustomField is visible in the UI and only editable through the API. + * + * Generated from protobuf enum READ_ONLY = 2; + */ + const READ_ONLY = 2; + /** + * The CustomField is visible and editable in both the API and UI. + * + * Generated from protobuf enum EDITABLE = 3; + */ + const EDITABLE = 3; + + private static $valueToName = [ + self::CUSTOM_FIELD_VISIBILITY_UNSPECIFIED => 'CUSTOM_FIELD_VISIBILITY_UNSPECIFIED', + self::HIDDEN => 'HIDDEN', + self::READ_ONLY => 'READ_ONLY', + self::EDITABLE => 'EDITABLE', + ]; + + 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/AdsAdManager/src/V1/CustomTargetingKey.php b/AdsAdManager/src/V1/CustomTargetingKey.php new file mode 100644 index 000000000000..c08ea0a5c5f6 --- /dev/null +++ b/AdsAdManager/src/V1/CustomTargetingKey.php @@ -0,0 +1,295 @@ +google.ads.admanager.v1.CustomTargetingKey + */ +class CustomTargetingKey extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The resource name of the `CustomTargetingKey`. + * Format: + * `networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. `CustomTargetingKey` ID. + * + * Generated from protobuf field int64 custom_targeting_key_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $custom_targeting_key_id = 0; + /** + * Immutable. Name of the key. Keys can contain up to 10 characters each. You + * can use alphanumeric characters and symbols other than the following: + * ", ', =, !, +, #, *, ~, ;, ^, (, ), <, >, [, ], the white space character. + * + * Generated from protobuf field string ad_tag_name = 3 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $ad_tag_name = ''; + /** + * Optional. Descriptive name for the `CustomTargetingKey`. + * + * Generated from protobuf field string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_name = ''; + /** + * Required. Indicates whether users will select from predefined values or + * create new targeting values, while specifying targeting criteria for a line + * item. + * + * Generated from protobuf field .google.ads.admanager.v1.CustomTargetingKeyTypeEnum.CustomTargetingKeyType type = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $type = 0; + /** + * Output only. Status of the `CustomTargetingKey`. + * + * Generated from protobuf field .google.ads.admanager.v1.CustomTargetingKeyStatusEnum.CustomTargetingKeyStatus status = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status = 0; + /** + * Required. Reportable state of the `CustomTargetingKey`. + * + * Generated from protobuf field .google.ads.admanager.v1.CustomTargetingKeyReportableTypeEnum.CustomTargetingKeyReportableType reportable_type = 7 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $reportable_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The resource name of the `CustomTargetingKey`. + * Format: + * `networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}` + * @type int|string $custom_targeting_key_id + * Output only. `CustomTargetingKey` ID. + * @type string $ad_tag_name + * Immutable. Name of the key. Keys can contain up to 10 characters each. You + * can use alphanumeric characters and symbols other than the following: + * ", ', =, !, +, #, *, ~, ;, ^, (, ), <, >, [, ], the white space character. + * @type string $display_name + * Optional. Descriptive name for the `CustomTargetingKey`. + * @type int $type + * Required. Indicates whether users will select from predefined values or + * create new targeting values, while specifying targeting criteria for a line + * item. + * @type int $status + * Output only. Status of the `CustomTargetingKey`. + * @type int $reportable_type + * Required. Reportable state of the `CustomTargetingKey`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\CustomTargetingKeyMessages::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The resource name of the `CustomTargetingKey`. + * Format: + * `networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The resource name of the `CustomTargetingKey`. + * Format: + * `networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. `CustomTargetingKey` ID. + * + * Generated from protobuf field int64 custom_targeting_key_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getCustomTargetingKeyId() + { + return $this->custom_targeting_key_id; + } + + /** + * Output only. `CustomTargetingKey` ID. + * + * Generated from protobuf field int64 custom_targeting_key_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setCustomTargetingKeyId($var) + { + GPBUtil::checkInt64($var); + $this->custom_targeting_key_id = $var; + + return $this; + } + + /** + * Immutable. Name of the key. Keys can contain up to 10 characters each. You + * can use alphanumeric characters and symbols other than the following: + * ", ', =, !, +, #, *, ~, ;, ^, (, ), <, >, [, ], the white space character. + * + * Generated from protobuf field string ad_tag_name = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getAdTagName() + { + return $this->ad_tag_name; + } + + /** + * Immutable. Name of the key. Keys can contain up to 10 characters each. You + * can use alphanumeric characters and symbols other than the following: + * ", ', =, !, +, #, *, ~, ;, ^, (, ), <, >, [, ], the white space character. + * + * Generated from protobuf field string ad_tag_name = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setAdTagName($var) + { + GPBUtil::checkString($var, True); + $this->ad_tag_name = $var; + + return $this; + } + + /** + * Optional. Descriptive name for the `CustomTargetingKey`. + * + * Generated from protobuf field string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Optional. Descriptive name for the `CustomTargetingKey`. + * + * Generated from protobuf field string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Required. Indicates whether users will select from predefined values or + * create new targeting values, while specifying targeting criteria for a line + * item. + * + * Generated from protobuf field .google.ads.admanager.v1.CustomTargetingKeyTypeEnum.CustomTargetingKeyType type = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Required. Indicates whether users will select from predefined values or + * create new targeting values, while specifying targeting criteria for a line + * item. + * + * Generated from protobuf field .google.ads.admanager.v1.CustomTargetingKeyTypeEnum.CustomTargetingKeyType type = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Ads\AdManager\V1\CustomTargetingKeyTypeEnum\CustomTargetingKeyType::class); + $this->type = $var; + + return $this; + } + + /** + * Output only. Status of the `CustomTargetingKey`. + * + * Generated from protobuf field .google.ads.admanager.v1.CustomTargetingKeyStatusEnum.CustomTargetingKeyStatus status = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getStatus() + { + return $this->status; + } + + /** + * Output only. Status of the `CustomTargetingKey`. + * + * Generated from protobuf field .google.ads.admanager.v1.CustomTargetingKeyStatusEnum.CustomTargetingKeyStatus status = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkEnum($var, \Google\Ads\AdManager\V1\CustomTargetingKeyStatusEnum\CustomTargetingKeyStatus::class); + $this->status = $var; + + return $this; + } + + /** + * Required. Reportable state of the `CustomTargetingKey`. + * + * Generated from protobuf field .google.ads.admanager.v1.CustomTargetingKeyReportableTypeEnum.CustomTargetingKeyReportableType reportable_type = 7 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getReportableType() + { + return $this->reportable_type; + } + + /** + * Required. Reportable state of the `CustomTargetingKey`. + * + * Generated from protobuf field .google.ads.admanager.v1.CustomTargetingKeyReportableTypeEnum.CustomTargetingKeyReportableType reportable_type = 7 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setReportableType($var) + { + GPBUtil::checkEnum($var, \Google\Ads\AdManager\V1\CustomTargetingKeyReportableTypeEnum\CustomTargetingKeyReportableType::class); + $this->reportable_type = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/CustomTargetingKeyReportableTypeEnum.php b/AdsAdManager/src/V1/CustomTargetingKeyReportableTypeEnum.php new file mode 100644 index 000000000000..b2162fa94cad --- /dev/null +++ b/AdsAdManager/src/V1/CustomTargetingKeyReportableTypeEnum.php @@ -0,0 +1,34 @@ +google.ads.admanager.v1.CustomTargetingKeyReportableTypeEnum + */ +class CustomTargetingKeyReportableTypeEnum extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\CustomTargetingKeyEnums::initOnce(); + parent::__construct($data); + } + +} + diff --git a/AdsAdManager/src/V1/CustomTargetingKeyReportableTypeEnum/CustomTargetingKeyReportableType.php b/AdsAdManager/src/V1/CustomTargetingKeyReportableTypeEnum/CustomTargetingKeyReportableType.php new file mode 100644 index 000000000000..870ea4304b23 --- /dev/null +++ b/AdsAdManager/src/V1/CustomTargetingKeyReportableTypeEnum/CustomTargetingKeyReportableType.php @@ -0,0 +1,69 @@ +google.ads.admanager.v1.CustomTargetingKeyReportableTypeEnum.CustomTargetingKeyReportableType + */ +class CustomTargetingKeyReportableType +{ + /** + * Not specified value. + * + * Generated from protobuf enum CUSTOM_TARGETING_KEY_REPORTABLE_TYPE_UNSPECIFIED = 0; + */ + const CUSTOM_TARGETING_KEY_REPORTABLE_TYPE_UNSPECIFIED = 0; + /** + * Not available for reporting in the Ad Manager query tool. + * + * Generated from protobuf enum OFF = 1; + */ + const OFF = 1; + /** + * Available for reporting in the Ad Manager query tool. + * + * Generated from protobuf enum ON = 2; + */ + const ON = 2; + /** + * Custom dimension available for reporting in the AdManager query tool. + * + * Generated from protobuf enum CUSTOM_DIMENSION = 3; + */ + const CUSTOM_DIMENSION = 3; + + private static $valueToName = [ + self::CUSTOM_TARGETING_KEY_REPORTABLE_TYPE_UNSPECIFIED => 'CUSTOM_TARGETING_KEY_REPORTABLE_TYPE_UNSPECIFIED', + self::OFF => 'OFF', + self::ON => 'ON', + self::CUSTOM_DIMENSION => 'CUSTOM_DIMENSION', + ]; + + 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/AdsAdManager/src/V1/CustomTargetingKeyStatusEnum.php b/AdsAdManager/src/V1/CustomTargetingKeyStatusEnum.php new file mode 100644 index 000000000000..fa3d998db1df --- /dev/null +++ b/AdsAdManager/src/V1/CustomTargetingKeyStatusEnum.php @@ -0,0 +1,34 @@ +google.ads.admanager.v1.CustomTargetingKeyStatusEnum + */ +class CustomTargetingKeyStatusEnum extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\CustomTargetingKeyEnums::initOnce(); + parent::__construct($data); + } + +} + diff --git a/AdsAdManager/src/V1/CustomTargetingKeyStatusEnum/CustomTargetingKeyStatus.php b/AdsAdManager/src/V1/CustomTargetingKeyStatusEnum/CustomTargetingKeyStatus.php new file mode 100644 index 000000000000..431028afa6fb --- /dev/null +++ b/AdsAdManager/src/V1/CustomTargetingKeyStatusEnum/CustomTargetingKeyStatus.php @@ -0,0 +1,62 @@ +google.ads.admanager.v1.CustomTargetingKeyStatusEnum.CustomTargetingKeyStatus + */ +class CustomTargetingKeyStatus +{ + /** + * Not specified value. + * + * Generated from protobuf enum CUSTOM_TARGETING_KEY_STATUS_UNSPECIFIED = 0; + */ + const CUSTOM_TARGETING_KEY_STATUS_UNSPECIFIED = 0; + /** + * Custom targeting key is active. + * + * Generated from protobuf enum ACTIVE = 1; + */ + const ACTIVE = 1; + /** + * Custom targeting key is inactive. + * + * Generated from protobuf enum INACTIVE = 2; + */ + const INACTIVE = 2; + + private static $valueToName = [ + self::CUSTOM_TARGETING_KEY_STATUS_UNSPECIFIED => 'CUSTOM_TARGETING_KEY_STATUS_UNSPECIFIED', + self::ACTIVE => 'ACTIVE', + self::INACTIVE => 'INACTIVE', + ]; + + 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/AdsAdManager/src/V1/CustomTargetingKeyTypeEnum.php b/AdsAdManager/src/V1/CustomTargetingKeyTypeEnum.php new file mode 100644 index 000000000000..5fa9dc725a74 --- /dev/null +++ b/AdsAdManager/src/V1/CustomTargetingKeyTypeEnum.php @@ -0,0 +1,34 @@ +google.ads.admanager.v1.CustomTargetingKeyTypeEnum + */ +class CustomTargetingKeyTypeEnum extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\CustomTargetingKeyEnums::initOnce(); + parent::__construct($data); + } + +} + diff --git a/AdsAdManager/src/V1/CustomTargetingKeyTypeEnum/CustomTargetingKeyType.php b/AdsAdManager/src/V1/CustomTargetingKeyTypeEnum/CustomTargetingKeyType.php new file mode 100644 index 000000000000..bbfd1ededc18 --- /dev/null +++ b/AdsAdManager/src/V1/CustomTargetingKeyTypeEnum/CustomTargetingKeyType.php @@ -0,0 +1,62 @@ +google.ads.admanager.v1.CustomTargetingKeyTypeEnum.CustomTargetingKeyType + */ +class CustomTargetingKeyType +{ + /** + * Not specified value. + * + * Generated from protobuf enum CUSTOM_TARGETING_KEY_TYPE_UNSPECIFIED = 0; + */ + const CUSTOM_TARGETING_KEY_TYPE_UNSPECIFIED = 0; + /** + * Key with a fixed set of values. + * + * Generated from protobuf enum PREDEFINED = 1; + */ + const PREDEFINED = 1; + /** + * Key without a fixed set of values + * + * Generated from protobuf enum FREEFORM = 2; + */ + const FREEFORM = 2; + + private static $valueToName = [ + self::CUSTOM_TARGETING_KEY_TYPE_UNSPECIFIED => 'CUSTOM_TARGETING_KEY_TYPE_UNSPECIFIED', + self::PREDEFINED => 'PREDEFINED', + self::FREEFORM => 'FREEFORM', + ]; + + 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/AdsAdManager/src/V1/CustomTargetingValue.php b/AdsAdManager/src/V1/CustomTargetingValue.php new file mode 100644 index 000000000000..1e88282d880d --- /dev/null +++ b/AdsAdManager/src/V1/CustomTargetingValue.php @@ -0,0 +1,231 @@ +google.ads.admanager.v1.CustomTargetingValue + */ +class CustomTargetingValue extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The resource name of the `CustomTargetingValue`. + * Format: + * `networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}/customTargetingValues/{custom_targeting_value_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Immutable. Name of the `CustomTargetingValue`. Values can contain up to 40 + * characters each. You can use alphanumeric characters and symbols other than + * the following: ", ', =, !, +, #, *, ~, ;, ^, (, ), <, >, [, ]. Values are + * not data-specific; all values are treated as strings. For example, instead + * of using "age>=18 AND <=34", try "18-34" + * + * Generated from protobuf field string ad_tag_name = 4 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $ad_tag_name = ''; + /** + * Optional. Descriptive name for the `CustomTargetingValue`. + * + * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_name = ''; + /** + * Required. Immutable. The way in which the CustomTargetingValue.name strings + * will be matched. + * + * Generated from protobuf field .google.ads.admanager.v1.CustomTargetingValueMatchTypeEnum.CustomTargetingValueMatchType match_type = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + */ + protected $match_type = 0; + /** + * Output only. Status of the `CustomTargetingValue`. + * + * Generated from protobuf field .google.ads.admanager.v1.CustomTargetingValueStatusEnum.CustomTargetingValueStatus status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The resource name of the `CustomTargetingValue`. + * Format: + * `networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}/customTargetingValues/{custom_targeting_value_id}` + * @type string $ad_tag_name + * Immutable. Name of the `CustomTargetingValue`. Values can contain up to 40 + * characters each. You can use alphanumeric characters and symbols other than + * the following: ", ', =, !, +, #, *, ~, ;, ^, (, ), <, >, [, ]. Values are + * not data-specific; all values are treated as strings. For example, instead + * of using "age>=18 AND <=34", try "18-34" + * @type string $display_name + * Optional. Descriptive name for the `CustomTargetingValue`. + * @type int $match_type + * Required. Immutable. The way in which the CustomTargetingValue.name strings + * will be matched. + * @type int $status + * Output only. Status of the `CustomTargetingValue`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\CustomTargetingValueMessages::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The resource name of the `CustomTargetingValue`. + * Format: + * `networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}/customTargetingValues/{custom_targeting_value_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The resource name of the `CustomTargetingValue`. + * Format: + * `networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}/customTargetingValues/{custom_targeting_value_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Immutable. Name of the `CustomTargetingValue`. Values can contain up to 40 + * characters each. You can use alphanumeric characters and symbols other than + * the following: ", ', =, !, +, #, *, ~, ;, ^, (, ), <, >, [, ]. Values are + * not data-specific; all values are treated as strings. For example, instead + * of using "age>=18 AND <=34", try "18-34" + * + * Generated from protobuf field string ad_tag_name = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getAdTagName() + { + return $this->ad_tag_name; + } + + /** + * Immutable. Name of the `CustomTargetingValue`. Values can contain up to 40 + * characters each. You can use alphanumeric characters and symbols other than + * the following: ", ', =, !, +, #, *, ~, ;, ^, (, ), <, >, [, ]. Values are + * not data-specific; all values are treated as strings. For example, instead + * of using "age>=18 AND <=34", try "18-34" + * + * Generated from protobuf field string ad_tag_name = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setAdTagName($var) + { + GPBUtil::checkString($var, True); + $this->ad_tag_name = $var; + + return $this; + } + + /** + * Optional. Descriptive name for the `CustomTargetingValue`. + * + * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Optional. Descriptive name for the `CustomTargetingValue`. + * + * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Required. Immutable. The way in which the CustomTargetingValue.name strings + * will be matched. + * + * Generated from protobuf field .google.ads.admanager.v1.CustomTargetingValueMatchTypeEnum.CustomTargetingValueMatchType match_type = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getMatchType() + { + return $this->match_type; + } + + /** + * Required. Immutable. The way in which the CustomTargetingValue.name strings + * will be matched. + * + * Generated from protobuf field .google.ads.admanager.v1.CustomTargetingValueMatchTypeEnum.CustomTargetingValueMatchType match_type = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setMatchType($var) + { + GPBUtil::checkEnum($var, \Google\Ads\AdManager\V1\CustomTargetingValueMatchTypeEnum\CustomTargetingValueMatchType::class); + $this->match_type = $var; + + return $this; + } + + /** + * Output only. Status of the `CustomTargetingValue`. + * + * Generated from protobuf field .google.ads.admanager.v1.CustomTargetingValueStatusEnum.CustomTargetingValueStatus status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getStatus() + { + return $this->status; + } + + /** + * Output only. Status of the `CustomTargetingValue`. + * + * Generated from protobuf field .google.ads.admanager.v1.CustomTargetingValueStatusEnum.CustomTargetingValueStatus status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkEnum($var, \Google\Ads\AdManager\V1\CustomTargetingValueStatusEnum\CustomTargetingValueStatus::class); + $this->status = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/CustomTargetingValueMatchTypeEnum.php b/AdsAdManager/src/V1/CustomTargetingValueMatchTypeEnum.php new file mode 100644 index 000000000000..8889014cf2ac --- /dev/null +++ b/AdsAdManager/src/V1/CustomTargetingValueMatchTypeEnum.php @@ -0,0 +1,34 @@ +google.ads.admanager.v1.CustomTargetingValueMatchTypeEnum + */ +class CustomTargetingValueMatchTypeEnum extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\CustomTargetingValueEnums::initOnce(); + parent::__construct($data); + } + +} + diff --git a/AdsAdManager/src/V1/CustomTargetingValueMatchTypeEnum/CustomTargetingValueMatchType.php b/AdsAdManager/src/V1/CustomTargetingValueMatchTypeEnum/CustomTargetingValueMatchType.php new file mode 100644 index 000000000000..63aa5d3325e2 --- /dev/null +++ b/AdsAdManager/src/V1/CustomTargetingValueMatchTypeEnum/CustomTargetingValueMatchType.php @@ -0,0 +1,111 @@ +google.ads.admanager.v1.CustomTargetingValueMatchTypeEnum.CustomTargetingValueMatchType + */ +class CustomTargetingValueMatchType +{ + /** + * Not specified value. + * + * Generated from protobuf enum CUSTOM_TARGETING_VALUE_MATCH_TYPE_UNSPECIFIED = 0; + */ + const CUSTOM_TARGETING_VALUE_MATCH_TYPE_UNSPECIFIED = 0; + /** + * Used for exact matching. For example, the targeting value car=honda will + * only match to the ad request car=honda. + * + * Generated from protobuf enum EXACT = 1; + */ + const EXACT = 1; + /** + * Used for lenient matching when at least one of the words in the ad + * request matches the targeted value. The targeting value car=honda will + * match to ad requests containing the word honda. So ad requests car=honda + * or car=honda civic or car=buy honda or car=how much does a honda cost + * will all have the line item delivered. + * This match type can not be used within an audience segment rule. + * + * Generated from protobuf enum BROAD = 2; + */ + const BROAD = 2; + /** + * Used for 'starts with' matching when the first few characters in the ad + * request match all of the characters in the targeted value. The targeting + * value car=honda will match to ad requests car=honda or car=hondas for + * sale but not to car=I want a honda. + * + * Generated from protobuf enum PREFIX = 3; + */ + const PREFIX = 3; + /** + * This is a combination of MatchType#BROAD and MatchType#PREFIX matching. + * The targeting value car=honda will match to ad requests that contain + * words that start with the characters in the targeted value, for example + * with car=civic hondas. + * This match type can not be used within an audience segment rule. + * + * Generated from protobuf enum BROAD_PREFIX = 4; + */ + const BROAD_PREFIX = 4; + /** + * Used for 'ends with' matching when the last characters in the ad request + * match all of the characters in the targeted value. The targeting value + * car=honda will match with ad requests car=honda or car=I want a honda but + * not to car=hondas for sale. + * This match type can not be used within line item targeting. + * + * Generated from protobuf enum SUFFIX = 5; + */ + const SUFFIX = 5; + /** + * Used for 'within' matching when the string in the ad request contains the + * string in the targeted value. The targeting value car=honda will match + * with ad requests car=honda, car=I want a honda, and also with car=hondas + * for sale, but not with car=misspelled hond a. This match type can not be + * used within line item targeting. + * + * Generated from protobuf enum CONTAINS = 6; + */ + const CONTAINS = 6; + + private static $valueToName = [ + self::CUSTOM_TARGETING_VALUE_MATCH_TYPE_UNSPECIFIED => 'CUSTOM_TARGETING_VALUE_MATCH_TYPE_UNSPECIFIED', + self::EXACT => 'EXACT', + self::BROAD => 'BROAD', + self::PREFIX => 'PREFIX', + self::BROAD_PREFIX => 'BROAD_PREFIX', + self::SUFFIX => 'SUFFIX', + self::CONTAINS => 'CONTAINS', + ]; + + 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/AdsAdManager/src/V1/CustomTargetingValueStatusEnum.php b/AdsAdManager/src/V1/CustomTargetingValueStatusEnum.php new file mode 100644 index 000000000000..43c17351d951 --- /dev/null +++ b/AdsAdManager/src/V1/CustomTargetingValueStatusEnum.php @@ -0,0 +1,34 @@ +google.ads.admanager.v1.CustomTargetingValueStatusEnum + */ +class CustomTargetingValueStatusEnum extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\CustomTargetingValueEnums::initOnce(); + parent::__construct($data); + } + +} + diff --git a/AdsAdManager/src/V1/CustomTargetingValueStatusEnum/CustomTargetingValueStatus.php b/AdsAdManager/src/V1/CustomTargetingValueStatusEnum/CustomTargetingValueStatus.php new file mode 100644 index 000000000000..fe193b6b1dea --- /dev/null +++ b/AdsAdManager/src/V1/CustomTargetingValueStatusEnum/CustomTargetingValueStatus.php @@ -0,0 +1,62 @@ +google.ads.admanager.v1.CustomTargetingValueStatusEnum.CustomTargetingValueStatus + */ +class CustomTargetingValueStatus +{ + /** + * Not specified value. + * + * Generated from protobuf enum CUSTOM_TARGETING_VALUE_STATUS_UNSPECIFIED = 0; + */ + const CUSTOM_TARGETING_VALUE_STATUS_UNSPECIFIED = 0; + /** + * Custom targeting value is active. + * + * Generated from protobuf enum ACTIVE = 1; + */ + const ACTIVE = 1; + /** + * Custom targeting value is inactive. + * + * Generated from protobuf enum INACTIVE = 2; + */ + const INACTIVE = 2; + + private static $valueToName = [ + self::CUSTOM_TARGETING_VALUE_STATUS_UNSPECIFIED => 'CUSTOM_TARGETING_VALUE_STATUS_UNSPECIFIED', + self::ACTIVE => 'ACTIVE', + self::INACTIVE => 'INACTIVE', + ]; + + 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/AdsAdManager/src/V1/EntitySignalsMapping.php b/AdsAdManager/src/V1/EntitySignalsMapping.php new file mode 100644 index 000000000000..19526df8672e --- /dev/null +++ b/AdsAdManager/src/V1/EntitySignalsMapping.php @@ -0,0 +1,255 @@ +google.ads.admanager.v1.EntitySignalsMapping + */ +class EntitySignalsMapping extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The resource name of the `EntitySignalsMapping`. + * Format: + * `networks/{network_code}/entitySignalsMappings/{entity_signals_mapping_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. `EntitySignalsMapping` ID. + * + * Generated from protobuf field int64 entity_signals_mapping_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $entity_signals_mapping_id = 0; + /** + * Required. The IDs of the categories that are associated with the + * referencing entity. + * + * Generated from protobuf field repeated int64 taxonomy_category_ids = 6 [(.google.api.field_behavior) = REQUIRED]; + */ + private $taxonomy_category_ids; + protected $entity; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $audience_segment_id + * ID of an AudienceSegment that this mapping belongs to. + * @type int|string $content_bundle_id + * ID of a ContentBundle that this mapping belongs to. + * @type int|string $custom_targeting_value_id + * ID of a CustomValue that this mapping belongs to. + * @type string $name + * Identifier. The resource name of the `EntitySignalsMapping`. + * Format: + * `networks/{network_code}/entitySignalsMappings/{entity_signals_mapping_id}` + * @type int|string $entity_signals_mapping_id + * Output only. `EntitySignalsMapping` ID. + * @type array|array|\Google\Protobuf\Internal\RepeatedField $taxonomy_category_ids + * Required. The IDs of the categories that are associated with the + * referencing entity. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\EntitySignalsMappingMessages::initOnce(); + parent::__construct($data); + } + + /** + * ID of an AudienceSegment that this mapping belongs to. + * + * Generated from protobuf field int64 audience_segment_id = 3; + * @return int|string + */ + public function getAudienceSegmentId() + { + return $this->readOneof(3); + } + + public function hasAudienceSegmentId() + { + return $this->hasOneof(3); + } + + /** + * ID of an AudienceSegment that this mapping belongs to. + * + * Generated from protobuf field int64 audience_segment_id = 3; + * @param int|string $var + * @return $this + */ + public function setAudienceSegmentId($var) + { + GPBUtil::checkInt64($var); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * ID of a ContentBundle that this mapping belongs to. + * + * Generated from protobuf field int64 content_bundle_id = 4; + * @return int|string + */ + public function getContentBundleId() + { + return $this->readOneof(4); + } + + public function hasContentBundleId() + { + return $this->hasOneof(4); + } + + /** + * ID of a ContentBundle that this mapping belongs to. + * + * Generated from protobuf field int64 content_bundle_id = 4; + * @param int|string $var + * @return $this + */ + public function setContentBundleId($var) + { + GPBUtil::checkInt64($var); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * ID of a CustomValue that this mapping belongs to. + * + * Generated from protobuf field int64 custom_targeting_value_id = 5; + * @return int|string + */ + public function getCustomTargetingValueId() + { + return $this->readOneof(5); + } + + public function hasCustomTargetingValueId() + { + return $this->hasOneof(5); + } + + /** + * ID of a CustomValue that this mapping belongs to. + * + * Generated from protobuf field int64 custom_targeting_value_id = 5; + * @param int|string $var + * @return $this + */ + public function setCustomTargetingValueId($var) + { + GPBUtil::checkInt64($var); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Identifier. The resource name of the `EntitySignalsMapping`. + * Format: + * `networks/{network_code}/entitySignalsMappings/{entity_signals_mapping_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The resource name of the `EntitySignalsMapping`. + * Format: + * `networks/{network_code}/entitySignalsMappings/{entity_signals_mapping_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. `EntitySignalsMapping` ID. + * + * Generated from protobuf field int64 entity_signals_mapping_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getEntitySignalsMappingId() + { + return $this->entity_signals_mapping_id; + } + + /** + * Output only. `EntitySignalsMapping` ID. + * + * Generated from protobuf field int64 entity_signals_mapping_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setEntitySignalsMappingId($var) + { + GPBUtil::checkInt64($var); + $this->entity_signals_mapping_id = $var; + + return $this; + } + + /** + * Required. The IDs of the categories that are associated with the + * referencing entity. + * + * Generated from protobuf field repeated int64 taxonomy_category_ids = 6 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTaxonomyCategoryIds() + { + return $this->taxonomy_category_ids; + } + + /** + * Required. The IDs of the categories that are associated with the + * referencing entity. + * + * Generated from protobuf field repeated int64 taxonomy_category_ids = 6 [(.google.api.field_behavior) = REQUIRED]; + * @param array|array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTaxonomyCategoryIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT64); + $this->taxonomy_category_ids = $arr; + + return $this; + } + + /** + * @return string + */ + public function getEntity() + { + return $this->whichOneof("entity"); + } + +} + diff --git a/AdsAdManager/src/V1/EnvironmentTypeEnum.php b/AdsAdManager/src/V1/EnvironmentTypeEnum.php new file mode 100644 index 000000000000..eb19e59df821 --- /dev/null +++ b/AdsAdManager/src/V1/EnvironmentTypeEnum.php @@ -0,0 +1,34 @@ +google.ads.admanager.v1.EnvironmentTypeEnum + */ +class EnvironmentTypeEnum extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\EnvironmentTypeEnum::initOnce(); + parent::__construct($data); + } + +} + diff --git a/AdsAdManager/src/V1/EnvironmentTypeEnum/EnvironmentType.php b/AdsAdManager/src/V1/EnvironmentTypeEnum/EnvironmentType.php new file mode 100644 index 000000000000..44b2d8a85159 --- /dev/null +++ b/AdsAdManager/src/V1/EnvironmentTypeEnum/EnvironmentType.php @@ -0,0 +1,62 @@ +google.ads.admanager.v1.EnvironmentTypeEnum.EnvironmentType + */ +class EnvironmentType +{ + /** + * No value specified + * + * Generated from protobuf enum ENVIRONMENT_TYPE_UNSPECIFIED = 0; + */ + const ENVIRONMENT_TYPE_UNSPECIFIED = 0; + /** + * A regular web browser. + * + * Generated from protobuf enum BROWSER = 1; + */ + const BROWSER = 1; + /** + * Video players. + * + * Generated from protobuf enum VIDEO_PLAYER = 2; + */ + const VIDEO_PLAYER = 2; + + private static $valueToName = [ + self::ENVIRONMENT_TYPE_UNSPECIFIED => 'ENVIRONMENT_TYPE_UNSPECIFIED', + self::BROWSER => 'BROWSER', + self::VIDEO_PLAYER => 'VIDEO_PLAYER', + ]; + + 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/AdsAdManager/src/V1/FetchReportResultRowsRequest.php b/AdsAdManager/src/V1/FetchReportResultRowsRequest.php new file mode 100644 index 000000000000..c12d3c16d43d --- /dev/null +++ b/AdsAdManager/src/V1/FetchReportResultRowsRequest.php @@ -0,0 +1,170 @@ +google.ads.admanager.v1.FetchReportResultRowsRequest + */ +class FetchReportResultRowsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The report result being fetched. + * Format: + * `networks/{network_code}/reports/{report_id}/results/{report_result_id}` + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Optional. The maximum number of rows to return. The service may return + * fewer than this value. If unspecified, at most 1,000 rows will be returned. + * The maximum value is 10,000; values above 10,000 will be reduced to 10,000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous `FetchReportResultRows` + * call. Provide this to retrieve the second and subsequent batches of rows. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $name The report result being fetched. + * Format: + * `networks/{network_code}/reports/{report_id}/results/{report_result_id}` + * + * @return \Google\Ads\AdManager\V1\FetchReportResultRowsRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The report result being fetched. + * Format: + * `networks/{network_code}/reports/{report_id}/results/{report_result_id}` + * @type int $page_size + * Optional. The maximum number of rows to return. The service may return + * fewer than this value. If unspecified, at most 1,000 rows will be returned. + * The maximum value is 10,000; values above 10,000 will be reduced to 10,000. + * @type string $page_token + * Optional. A page token, received from a previous `FetchReportResultRows` + * call. Provide this to retrieve the second and subsequent batches of rows. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\ReportService::initOnce(); + parent::__construct($data); + } + + /** + * The report result being fetched. + * Format: + * `networks/{network_code}/reports/{report_id}/results/{report_result_id}` + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The report result being fetched. + * Format: + * `networks/{network_code}/reports/{report_id}/results/{report_result_id}` + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The maximum number of rows to return. The service may return + * fewer than this value. If unspecified, at most 1,000 rows will be returned. + * The maximum value is 10,000; values above 10,000 will be reduced to 10,000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of rows to return. The service may return + * fewer than this value. If unspecified, at most 1,000 rows will be returned. + * The maximum value is 10,000; values above 10,000 will be reduced to 10,000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from a previous `FetchReportResultRows` + * call. Provide this to retrieve the second and subsequent batches of rows. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous `FetchReportResultRows` + * call. Provide this to retrieve the second and subsequent batches of rows. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/FetchReportResultRowsResponse.php b/AdsAdManager/src/V1/FetchReportResultRowsResponse.php new file mode 100644 index 000000000000..74a9f55c6b63 --- /dev/null +++ b/AdsAdManager/src/V1/FetchReportResultRowsResponse.php @@ -0,0 +1,283 @@ +google.ads.admanager.v1.FetchReportResultRowsResponse + */ +class FetchReportResultRowsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Up to `page_size` rows of report data. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.DataTable.Row rows = 1; + */ + private $rows; + /** + * The time at which the report was scheduled to run. For non-scheduled + * reports, this is the time at which the report was requested to be run. + * + * Generated from protobuf field .google.protobuf.Timestamp run_time = 2; + */ + protected $run_time = null; + /** + * The computed fixed date ranges this report includes. + * Only returned with the first page of results (when page_token is not + * included in the request). + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.DateRange.FixedDateRange date_ranges = 3; + */ + private $date_ranges; + /** + * The computed comparison fixed date ranges this report includes. + * Only returned with the first page of results (when page_token is not + * included in the request). + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.DateRange.FixedDateRange comparison_date_ranges = 4; + */ + private $comparison_date_ranges; + /** + * The total number of rows available from this report. Useful for + * pagination. + * Only returned with the first page of results (when page_token is not + * included in the request). + * + * Generated from protobuf field int32 total_row_count = 5; + */ + protected $total_row_count = 0; + /** + * A token that can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 6; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Ads\AdManager\V1\Report\DataTable\Row>|\Google\Protobuf\Internal\RepeatedField $rows + * Up to `page_size` rows of report data. + * @type \Google\Protobuf\Timestamp $run_time + * The time at which the report was scheduled to run. For non-scheduled + * reports, this is the time at which the report was requested to be run. + * @type array<\Google\Ads\AdManager\V1\Report\DateRange\FixedDateRange>|\Google\Protobuf\Internal\RepeatedField $date_ranges + * The computed fixed date ranges this report includes. + * Only returned with the first page of results (when page_token is not + * included in the request). + * @type array<\Google\Ads\AdManager\V1\Report\DateRange\FixedDateRange>|\Google\Protobuf\Internal\RepeatedField $comparison_date_ranges + * The computed comparison fixed date ranges this report includes. + * Only returned with the first page of results (when page_token is not + * included in the request). + * @type int $total_row_count + * The total number of rows available from this report. Useful for + * pagination. + * Only returned with the first page of results (when page_token is not + * included in the request). + * @type string $next_page_token + * A token that can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\ReportService::initOnce(); + parent::__construct($data); + } + + /** + * Up to `page_size` rows of report data. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.DataTable.Row rows = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRows() + { + return $this->rows; + } + + /** + * Up to `page_size` rows of report data. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.DataTable.Row rows = 1; + * @param array<\Google\Ads\AdManager\V1\Report\DataTable\Row>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRows($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\Report\DataTable\Row::class); + $this->rows = $arr; + + return $this; + } + + /** + * The time at which the report was scheduled to run. For non-scheduled + * reports, this is the time at which the report was requested to be run. + * + * Generated from protobuf field .google.protobuf.Timestamp run_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getRunTime() + { + return $this->run_time; + } + + public function hasRunTime() + { + return isset($this->run_time); + } + + public function clearRunTime() + { + unset($this->run_time); + } + + /** + * The time at which the report was scheduled to run. For non-scheduled + * reports, this is the time at which the report was requested to be run. + * + * Generated from protobuf field .google.protobuf.Timestamp run_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setRunTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->run_time = $var; + + return $this; + } + + /** + * The computed fixed date ranges this report includes. + * Only returned with the first page of results (when page_token is not + * included in the request). + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.DateRange.FixedDateRange date_ranges = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDateRanges() + { + return $this->date_ranges; + } + + /** + * The computed fixed date ranges this report includes. + * Only returned with the first page of results (when page_token is not + * included in the request). + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.DateRange.FixedDateRange date_ranges = 3; + * @param array<\Google\Ads\AdManager\V1\Report\DateRange\FixedDateRange>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDateRanges($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\Report\DateRange\FixedDateRange::class); + $this->date_ranges = $arr; + + return $this; + } + + /** + * The computed comparison fixed date ranges this report includes. + * Only returned with the first page of results (when page_token is not + * included in the request). + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.DateRange.FixedDateRange comparison_date_ranges = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getComparisonDateRanges() + { + return $this->comparison_date_ranges; + } + + /** + * The computed comparison fixed date ranges this report includes. + * Only returned with the first page of results (when page_token is not + * included in the request). + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.DateRange.FixedDateRange comparison_date_ranges = 4; + * @param array<\Google\Ads\AdManager\V1\Report\DateRange\FixedDateRange>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setComparisonDateRanges($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\Report\DateRange\FixedDateRange::class); + $this->comparison_date_ranges = $arr; + + return $this; + } + + /** + * The total number of rows available from this report. Useful for + * pagination. + * Only returned with the first page of results (when page_token is not + * included in the request). + * + * Generated from protobuf field int32 total_row_count = 5; + * @return int + */ + public function getTotalRowCount() + { + return $this->total_row_count; + } + + /** + * The total number of rows available from this report. Useful for + * pagination. + * Only returned with the first page of results (when page_token is not + * included in the request). + * + * Generated from protobuf field int32 total_row_count = 5; + * @param int $var + * @return $this + */ + public function setTotalRowCount($var) + { + GPBUtil::checkInt32($var); + $this->total_row_count = $var; + + return $this; + } + + /** + * A token that can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 6; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token that can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 6; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/FrequencyCap.php b/AdsAdManager/src/V1/FrequencyCap.php new file mode 100644 index 000000000000..168ab1cb5f0c --- /dev/null +++ b/AdsAdManager/src/V1/FrequencyCap.php @@ -0,0 +1,165 @@ +google.ads.admanager.v1.FrequencyCap + */ +class FrequencyCap extends \Google\Protobuf\Internal\Message +{ + /** + * The maximum number of impressions for this frequency cap. + * + * Generated from protobuf field optional int64 max_impressions = 1; + */ + protected $max_impressions = null; + /** + * The number of time units over which the frequency cap is effective. + * + * Generated from protobuf field optional int64 time_amount = 2; + */ + protected $time_amount = null; + /** + * The units of time of this frequency cap. + * + * Generated from protobuf field optional .google.ads.admanager.v1.TimeUnitEnum.TimeUnit time_unit = 3; + */ + protected $time_unit = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $max_impressions + * The maximum number of impressions for this frequency cap. + * @type int|string $time_amount + * The number of time units over which the frequency cap is effective. + * @type int $time_unit + * The units of time of this frequency cap. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\FrequencyCap::initOnce(); + parent::__construct($data); + } + + /** + * The maximum number of impressions for this frequency cap. + * + * Generated from protobuf field optional int64 max_impressions = 1; + * @return int|string + */ + public function getMaxImpressions() + { + return isset($this->max_impressions) ? $this->max_impressions : 0; + } + + public function hasMaxImpressions() + { + return isset($this->max_impressions); + } + + public function clearMaxImpressions() + { + unset($this->max_impressions); + } + + /** + * The maximum number of impressions for this frequency cap. + * + * Generated from protobuf field optional int64 max_impressions = 1; + * @param int|string $var + * @return $this + */ + public function setMaxImpressions($var) + { + GPBUtil::checkInt64($var); + $this->max_impressions = $var; + + return $this; + } + + /** + * The number of time units over which the frequency cap is effective. + * + * Generated from protobuf field optional int64 time_amount = 2; + * @return int|string + */ + public function getTimeAmount() + { + return isset($this->time_amount) ? $this->time_amount : 0; + } + + public function hasTimeAmount() + { + return isset($this->time_amount); + } + + public function clearTimeAmount() + { + unset($this->time_amount); + } + + /** + * The number of time units over which the frequency cap is effective. + * + * Generated from protobuf field optional int64 time_amount = 2; + * @param int|string $var + * @return $this + */ + public function setTimeAmount($var) + { + GPBUtil::checkInt64($var); + $this->time_amount = $var; + + return $this; + } + + /** + * The units of time of this frequency cap. + * + * Generated from protobuf field optional .google.ads.admanager.v1.TimeUnitEnum.TimeUnit time_unit = 3; + * @return int + */ + public function getTimeUnit() + { + return isset($this->time_unit) ? $this->time_unit : 0; + } + + public function hasTimeUnit() + { + return isset($this->time_unit); + } + + public function clearTimeUnit() + { + unset($this->time_unit); + } + + /** + * The units of time of this frequency cap. + * + * Generated from protobuf field optional .google.ads.admanager.v1.TimeUnitEnum.TimeUnit time_unit = 3; + * @param int $var + * @return $this + */ + public function setTimeUnit($var) + { + GPBUtil::checkEnum($var, \Google\Ads\AdManager\V1\TimeUnitEnum\TimeUnit::class); + $this->time_unit = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/GetAdUnitRequest.php b/AdsAdManager/src/V1/GetAdUnitRequest.php new file mode 100644 index 000000000000..a359f1d3acaf --- /dev/null +++ b/AdsAdManager/src/V1/GetAdUnitRequest.php @@ -0,0 +1,86 @@ +google.ads.admanager.v1.GetAdUnitRequest + */ +class GetAdUnitRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the AdUnit. + * Format: `networks/{network_code}/adUnits/{ad_unit_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the AdUnit. + * Format: `networks/{network_code}/adUnits/{ad_unit_id}` + * Please see {@see AdUnitServiceClient::adUnitName()} for help formatting this field. + * + * @return \Google\Ads\AdManager\V1\GetAdUnitRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the AdUnit. + * Format: `networks/{network_code}/adUnits/{ad_unit_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\AdUnitService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the AdUnit. + * Format: `networks/{network_code}/adUnits/{ad_unit_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the AdUnit. + * Format: `networks/{network_code}/adUnits/{ad_unit_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/GetCompanyRequest.php b/AdsAdManager/src/V1/GetCompanyRequest.php new file mode 100644 index 000000000000..6fe5c202376a --- /dev/null +++ b/AdsAdManager/src/V1/GetCompanyRequest.php @@ -0,0 +1,86 @@ +google.ads.admanager.v1.GetCompanyRequest + */ +class GetCompanyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the Company. + * Format: `networks/{network_code}/companies/{company_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the Company. + * Format: `networks/{network_code}/companies/{company_id}` + * Please see {@see CompanyServiceClient::companyName()} for help formatting this field. + * + * @return \Google\Ads\AdManager\V1\GetCompanyRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the Company. + * Format: `networks/{network_code}/companies/{company_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\CompanyService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the Company. + * Format: `networks/{network_code}/companies/{company_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the Company. + * Format: `networks/{network_code}/companies/{company_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/GetCustomFieldRequest.php b/AdsAdManager/src/V1/GetCustomFieldRequest.php new file mode 100644 index 000000000000..493ec5fcc0d9 --- /dev/null +++ b/AdsAdManager/src/V1/GetCustomFieldRequest.php @@ -0,0 +1,86 @@ +google.ads.admanager.v1.GetCustomFieldRequest + */ +class GetCustomFieldRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the CustomField. + * Format: `networks/{network_code}/customFields/{custom_field_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the CustomField. + * Format: `networks/{network_code}/customFields/{custom_field_id}` + * Please see {@see CustomFieldServiceClient::customFieldName()} for help formatting this field. + * + * @return \Google\Ads\AdManager\V1\GetCustomFieldRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the CustomField. + * Format: `networks/{network_code}/customFields/{custom_field_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\CustomFieldService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the CustomField. + * Format: `networks/{network_code}/customFields/{custom_field_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the CustomField. + * Format: `networks/{network_code}/customFields/{custom_field_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/GetCustomTargetingKeyRequest.php b/AdsAdManager/src/V1/GetCustomTargetingKeyRequest.php new file mode 100644 index 000000000000..9499837ddb77 --- /dev/null +++ b/AdsAdManager/src/V1/GetCustomTargetingKeyRequest.php @@ -0,0 +1,91 @@ +google.ads.admanager.v1.GetCustomTargetingKeyRequest + */ +class GetCustomTargetingKeyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the CustomTargetingKey. + * Format: + * `networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the CustomTargetingKey. + * Format: + * `networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}` + * Please see {@see CustomTargetingKeyServiceClient::customTargetingKeyName()} for help formatting this field. + * + * @return \Google\Ads\AdManager\V1\GetCustomTargetingKeyRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the CustomTargetingKey. + * Format: + * `networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\CustomTargetingKeyService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the CustomTargetingKey. + * Format: + * `networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the CustomTargetingKey. + * Format: + * `networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/GetCustomTargetingValueRequest.php b/AdsAdManager/src/V1/GetCustomTargetingValueRequest.php new file mode 100644 index 000000000000..e87b9ad62c0e --- /dev/null +++ b/AdsAdManager/src/V1/GetCustomTargetingValueRequest.php @@ -0,0 +1,91 @@ +google.ads.admanager.v1.GetCustomTargetingValueRequest + */ +class GetCustomTargetingValueRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the CustomTargetingValue. + * Format: + * `networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}/customTargetingValues/{custom_targeting_value_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the CustomTargetingValue. + * Format: + * `networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}/customTargetingValues/{custom_targeting_value_id}` + * Please see {@see CustomTargetingValueServiceClient::customTargetingValueName()} for help formatting this field. + * + * @return \Google\Ads\AdManager\V1\GetCustomTargetingValueRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the CustomTargetingValue. + * Format: + * `networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}/customTargetingValues/{custom_targeting_value_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\CustomTargetingValueService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the CustomTargetingValue. + * Format: + * `networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}/customTargetingValues/{custom_targeting_value_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the CustomTargetingValue. + * Format: + * `networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}/customTargetingValues/{custom_targeting_value_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/GetEntitySignalsMappingRequest.php b/AdsAdManager/src/V1/GetEntitySignalsMappingRequest.php new file mode 100644 index 000000000000..f0b13fadda72 --- /dev/null +++ b/AdsAdManager/src/V1/GetEntitySignalsMappingRequest.php @@ -0,0 +1,91 @@ +google.ads.admanager.v1.GetEntitySignalsMappingRequest + */ +class GetEntitySignalsMappingRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the EntitySignalsMapping. + * Format: + * `networks/{network_code}/entitySignalsMappings/{entity_signals_mapping_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the EntitySignalsMapping. + * Format: + * `networks/{network_code}/entitySignalsMappings/{entity_signals_mapping_id}` + * Please see {@see EntitySignalsMappingServiceClient::entitySignalsMappingName()} for help formatting this field. + * + * @return \Google\Ads\AdManager\V1\GetEntitySignalsMappingRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the EntitySignalsMapping. + * Format: + * `networks/{network_code}/entitySignalsMappings/{entity_signals_mapping_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\EntitySignalsMappingService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the EntitySignalsMapping. + * Format: + * `networks/{network_code}/entitySignalsMappings/{entity_signals_mapping_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the EntitySignalsMapping. + * Format: + * `networks/{network_code}/entitySignalsMappings/{entity_signals_mapping_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/GetNetworkRequest.php b/AdsAdManager/src/V1/GetNetworkRequest.php new file mode 100644 index 000000000000..f091d5459079 --- /dev/null +++ b/AdsAdManager/src/V1/GetNetworkRequest.php @@ -0,0 +1,86 @@ +google.ads.admanager.v1.GetNetworkRequest + */ +class GetNetworkRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of Network. + * Format: networks/{network_code} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Resource name of Network. + * Format: networks/{network_code} + * Please see {@see NetworkServiceClient::networkName()} for help formatting this field. + * + * @return \Google\Ads\AdManager\V1\GetNetworkRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Resource name of Network. + * Format: networks/{network_code} + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\NetworkService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of Network. + * Format: networks/{network_code} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Resource name of Network. + * Format: networks/{network_code} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/GetOrderRequest.php b/AdsAdManager/src/V1/GetOrderRequest.php new file mode 100644 index 000000000000..b2ad956f8023 --- /dev/null +++ b/AdsAdManager/src/V1/GetOrderRequest.php @@ -0,0 +1,86 @@ +google.ads.admanager.v1.GetOrderRequest + */ +class GetOrderRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the Order. + * Format: `networks/{network_code}/orders/{order_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the Order. + * Format: `networks/{network_code}/orders/{order_id}` + * Please see {@see OrderServiceClient::orderName()} for help formatting this field. + * + * @return \Google\Ads\AdManager\V1\GetOrderRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the Order. + * Format: `networks/{network_code}/orders/{order_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\OrderService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the Order. + * Format: `networks/{network_code}/orders/{order_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the Order. + * Format: `networks/{network_code}/orders/{order_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/GetPlacementRequest.php b/AdsAdManager/src/V1/GetPlacementRequest.php new file mode 100644 index 000000000000..dc0b6f37f542 --- /dev/null +++ b/AdsAdManager/src/V1/GetPlacementRequest.php @@ -0,0 +1,86 @@ +google.ads.admanager.v1.GetPlacementRequest + */ +class GetPlacementRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the Placement. + * Format: `networks/{network_code}/placements/{placement_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the Placement. + * Format: `networks/{network_code}/placements/{placement_id}` + * Please see {@see PlacementServiceClient::placementName()} for help formatting this field. + * + * @return \Google\Ads\AdManager\V1\GetPlacementRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the Placement. + * Format: `networks/{network_code}/placements/{placement_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\PlacementService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the Placement. + * Format: `networks/{network_code}/placements/{placement_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the Placement. + * Format: `networks/{network_code}/placements/{placement_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/GetReportRequest.php b/AdsAdManager/src/V1/GetReportRequest.php new file mode 100644 index 000000000000..796bc7046179 --- /dev/null +++ b/AdsAdManager/src/V1/GetReportRequest.php @@ -0,0 +1,86 @@ +google.ads.admanager.v1.GetReportRequest + */ +class GetReportRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the report. + * Format: `networks/{network_code}/reports/{report_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the report. + * Format: `networks/{network_code}/reports/{report_id}` + * Please see {@see ReportServiceClient::reportName()} for help formatting this field. + * + * @return \Google\Ads\AdManager\V1\GetReportRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the report. + * Format: `networks/{network_code}/reports/{report_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\ReportService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the report. + * Format: `networks/{network_code}/reports/{report_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the report. + * Format: `networks/{network_code}/reports/{report_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/GetRoleRequest.php b/AdsAdManager/src/V1/GetRoleRequest.php new file mode 100644 index 000000000000..5b5ef57b0bc8 --- /dev/null +++ b/AdsAdManager/src/V1/GetRoleRequest.php @@ -0,0 +1,86 @@ +google.ads.admanager.v1.GetRoleRequest + */ +class GetRoleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the Role. + * Format: `networks/{network_code}/roles/{role_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the Role. + * Format: `networks/{network_code}/roles/{role_id}` + * Please see {@see RoleServiceClient::roleName()} for help formatting this field. + * + * @return \Google\Ads\AdManager\V1\GetRoleRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the Role. + * Format: `networks/{network_code}/roles/{role_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\RoleService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the Role. + * Format: `networks/{network_code}/roles/{role_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the Role. + * Format: `networks/{network_code}/roles/{role_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/GetTaxonomyCategoryRequest.php b/AdsAdManager/src/V1/GetTaxonomyCategoryRequest.php new file mode 100644 index 000000000000..b0e943d63698 --- /dev/null +++ b/AdsAdManager/src/V1/GetTaxonomyCategoryRequest.php @@ -0,0 +1,86 @@ +google.ads.admanager.v1.GetTaxonomyCategoryRequest + */ +class GetTaxonomyCategoryRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the TaxonomyCategory. + * Format: `networks/{network_code}/taxonomyCategories/{taxonomy_category_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the TaxonomyCategory. + * Format: `networks/{network_code}/taxonomyCategories/{taxonomy_category_id}` + * Please see {@see TaxonomyCategoryServiceClient::taxonomyCategoryName()} for help formatting this field. + * + * @return \Google\Ads\AdManager\V1\GetTaxonomyCategoryRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the TaxonomyCategory. + * Format: `networks/{network_code}/taxonomyCategories/{taxonomy_category_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\TaxonomyCategoryService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the TaxonomyCategory. + * Format: `networks/{network_code}/taxonomyCategories/{taxonomy_category_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the TaxonomyCategory. + * Format: `networks/{network_code}/taxonomyCategories/{taxonomy_category_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/GetUserRequest.php b/AdsAdManager/src/V1/GetUserRequest.php new file mode 100644 index 000000000000..602f87ff62d3 --- /dev/null +++ b/AdsAdManager/src/V1/GetUserRequest.php @@ -0,0 +1,86 @@ +google.ads.admanager.v1.GetUserRequest + */ +class GetUserRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the User. + * Format: `networks/{network_code}/users/{user_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The resource name of the User. + * Format: `networks/{network_code}/users/{user_id}` + * Please see {@see UserServiceClient::userName()} for help formatting this field. + * + * @return \Google\Ads\AdManager\V1\GetUserRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the User. + * Format: `networks/{network_code}/users/{user_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\UserService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the User. + * Format: `networks/{network_code}/users/{user_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the User. + * Format: `networks/{network_code}/users/{user_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/Label.php b/AdsAdManager/src/V1/Label.php new file mode 100644 index 000000000000..246b02a2b2c7 --- /dev/null +++ b/AdsAdManager/src/V1/Label.php @@ -0,0 +1,71 @@ +google.ads.admanager.v1.Label + */ +class Label extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The resource name of the `Label`. + * Format: `networks/{network_code}/labels/{label_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The resource name of the `Label`. + * Format: `networks/{network_code}/labels/{label_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\LabelMessages::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The resource name of the `Label`. + * Format: `networks/{network_code}/labels/{label_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The resource name of the `Label`. + * Format: `networks/{network_code}/labels/{label_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/LabelFrequencyCap.php b/AdsAdManager/src/V1/LabelFrequencyCap.php new file mode 100644 index 000000000000..114c8b3e3776 --- /dev/null +++ b/AdsAdManager/src/V1/LabelFrequencyCap.php @@ -0,0 +1,115 @@ +google.ads.admanager.v1.LabelFrequencyCap + */ +class LabelFrequencyCap extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The label to used for frequency capping. + * Format: "networks/{network_code}/labels/{label_id}" + * + * Generated from protobuf field string label = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $label = ''; + /** + * The frequency cap. + * + * Generated from protobuf field .google.ads.admanager.v1.FrequencyCap frequency_cap = 2; + */ + protected $frequency_cap = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $label + * Required. The label to used for frequency capping. + * Format: "networks/{network_code}/labels/{label_id}" + * @type \Google\Ads\AdManager\V1\FrequencyCap $frequency_cap + * The frequency cap. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\AdUnitMessages::initOnce(); + parent::__construct($data); + } + + /** + * Required. The label to used for frequency capping. + * Format: "networks/{network_code}/labels/{label_id}" + * + * Generated from protobuf field string label = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getLabel() + { + return $this->label; + } + + /** + * Required. The label to used for frequency capping. + * Format: "networks/{network_code}/labels/{label_id}" + * + * Generated from protobuf field string label = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLabel($var) + { + GPBUtil::checkString($var, True); + $this->label = $var; + + return $this; + } + + /** + * The frequency cap. + * + * Generated from protobuf field .google.ads.admanager.v1.FrequencyCap frequency_cap = 2; + * @return \Google\Ads\AdManager\V1\FrequencyCap|null + */ + public function getFrequencyCap() + { + return $this->frequency_cap; + } + + public function hasFrequencyCap() + { + return isset($this->frequency_cap); + } + + public function clearFrequencyCap() + { + unset($this->frequency_cap); + } + + /** + * The frequency cap. + * + * Generated from protobuf field .google.ads.admanager.v1.FrequencyCap frequency_cap = 2; + * @param \Google\Ads\AdManager\V1\FrequencyCap $var + * @return $this + */ + public function setFrequencyCap($var) + { + GPBUtil::checkMessage($var, \Google\Ads\AdManager\V1\FrequencyCap::class); + $this->frequency_cap = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/ListAdUnitSizesRequest.php b/AdsAdManager/src/V1/ListAdUnitSizesRequest.php new file mode 100644 index 000000000000..14020cd4f7ef --- /dev/null +++ b/AdsAdManager/src/V1/ListAdUnitSizesRequest.php @@ -0,0 +1,296 @@ +google.ads.admanager.v1.ListAdUnitSizesRequest + */ +class ListAdUnitSizesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent, which owns this collection of AdUnitSizes. + * Format: `networks/{network_code}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of AdUnitSizes to return. The service may + * return fewer than this value. If unspecified, at most 50 ad unit sizes will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous `ListAdUnitSizes` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListAdUnitSizes` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + /** + * Optional. Number of individual resources to skip while paginating. + * + * Generated from protobuf field int32 skip = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $skip = 0; + + /** + * @param string $parent Required. The parent, which owns this collection of AdUnitSizes. + * Format: `networks/{network_code}` + * Please see {@see AdUnitServiceClient::networkName()} for help formatting this field. + * + * @return \Google\Ads\AdManager\V1\ListAdUnitSizesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent, which owns this collection of AdUnitSizes. + * Format: `networks/{network_code}` + * @type int $page_size + * Optional. The maximum number of AdUnitSizes to return. The service may + * return fewer than this value. If unspecified, at most 50 ad unit sizes will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * @type string $page_token + * Optional. A page token, received from a previous `ListAdUnitSizes` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListAdUnitSizes` must + * match the call that provided the page token. + * @type string $filter + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * @type string $order_by + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * @type int $skip + * Optional. Number of individual resources to skip while paginating. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\AdUnitService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent, which owns this collection of AdUnitSizes. + * Format: `networks/{network_code}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent, which owns this collection of AdUnitSizes. + * Format: `networks/{network_code}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of AdUnitSizes to return. The service may + * return fewer than this value. If unspecified, at most 50 ad unit sizes will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of AdUnitSizes to return. The service may + * return fewer than this value. If unspecified, at most 50 ad unit sizes will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from a previous `ListAdUnitSizes` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListAdUnitSizes` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous `ListAdUnitSizes` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListAdUnitSizes` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + + /** + * Optional. Number of individual resources to skip while paginating. + * + * Generated from protobuf field int32 skip = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getSkip() + { + return $this->skip; + } + + /** + * Optional. Number of individual resources to skip while paginating. + * + * Generated from protobuf field int32 skip = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setSkip($var) + { + GPBUtil::checkInt32($var); + $this->skip = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/ListAdUnitSizesResponse.php b/AdsAdManager/src/V1/ListAdUnitSizesResponse.php new file mode 100644 index 000000000000..c9b275f95ca0 --- /dev/null +++ b/AdsAdManager/src/V1/ListAdUnitSizesResponse.php @@ -0,0 +1,171 @@ +google.ads.admanager.v1.ListAdUnitSizesResponse + */ +class ListAdUnitSizesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The AdUnitSizes from the specified network. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.AdUnitSize ad_unit_sizes = 1; + */ + private $ad_unit_sizes; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Total number of AdUnitSizes. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * + * Generated from protobuf field int32 total_size = 3; + */ + protected $total_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Ads\AdManager\V1\AdUnitSize>|\Google\Protobuf\Internal\RepeatedField $ad_unit_sizes + * The AdUnitSizes from the specified network. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * @type int $total_size + * Total number of AdUnitSizes. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\AdUnitService::initOnce(); + parent::__construct($data); + } + + /** + * The AdUnitSizes from the specified network. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.AdUnitSize ad_unit_sizes = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAdUnitSizes() + { + return $this->ad_unit_sizes; + } + + /** + * The AdUnitSizes from the specified network. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.AdUnitSize ad_unit_sizes = 1; + * @param array<\Google\Ads\AdManager\V1\AdUnitSize>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAdUnitSizes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\AdUnitSize::class); + $this->ad_unit_sizes = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Total number of AdUnitSizes. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * + * Generated from protobuf field int32 total_size = 3; + * @return int + */ + public function getTotalSize() + { + return $this->total_size; + } + + /** + * Total number of AdUnitSizes. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * + * Generated from protobuf field int32 total_size = 3; + * @param int $var + * @return $this + */ + public function setTotalSize($var) + { + GPBUtil::checkInt32($var); + $this->total_size = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/ListAdUnitsRequest.php b/AdsAdManager/src/V1/ListAdUnitsRequest.php new file mode 100644 index 000000000000..a026663a9637 --- /dev/null +++ b/AdsAdManager/src/V1/ListAdUnitsRequest.php @@ -0,0 +1,296 @@ +google.ads.admanager.v1.ListAdUnitsRequest + */ +class ListAdUnitsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent, which owns this collection of AdUnits. + * Format: `networks/{network_code}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of AdUnits to return. The service may return + * fewer than this value. If unspecified, at most 50 ad units will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous `ListAdUnits` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListAdUnits` must match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + /** + * Optional. Number of individual resources to skip while paginating. + * + * Generated from protobuf field int32 skip = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $skip = 0; + + /** + * @param string $parent Required. The parent, which owns this collection of AdUnits. + * Format: `networks/{network_code}` + * Please see {@see AdUnitServiceClient::networkName()} for help formatting this field. + * + * @return \Google\Ads\AdManager\V1\ListAdUnitsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent, which owns this collection of AdUnits. + * Format: `networks/{network_code}` + * @type int $page_size + * Optional. The maximum number of AdUnits to return. The service may return + * fewer than this value. If unspecified, at most 50 ad units will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @type string $page_token + * Optional. A page token, received from a previous `ListAdUnits` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListAdUnits` must match + * the call that provided the page token. + * @type string $filter + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * @type string $order_by + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * @type int $skip + * Optional. Number of individual resources to skip while paginating. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\AdUnitService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent, which owns this collection of AdUnits. + * Format: `networks/{network_code}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent, which owns this collection of AdUnits. + * Format: `networks/{network_code}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of AdUnits to return. The service may return + * fewer than this value. If unspecified, at most 50 ad units will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of AdUnits to return. The service may return + * fewer than this value. If unspecified, at most 50 ad units will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from a previous `ListAdUnits` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListAdUnits` must match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous `ListAdUnits` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListAdUnits` must match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + + /** + * Optional. Number of individual resources to skip while paginating. + * + * Generated from protobuf field int32 skip = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getSkip() + { + return $this->skip; + } + + /** + * Optional. Number of individual resources to skip while paginating. + * + * Generated from protobuf field int32 skip = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setSkip($var) + { + GPBUtil::checkInt32($var); + $this->skip = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/ListAdUnitsResponse.php b/AdsAdManager/src/V1/ListAdUnitsResponse.php new file mode 100644 index 000000000000..455e35caede7 --- /dev/null +++ b/AdsAdManager/src/V1/ListAdUnitsResponse.php @@ -0,0 +1,171 @@ +google.ads.admanager.v1.ListAdUnitsResponse + */ +class ListAdUnitsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The AdUnit from the specified network. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.AdUnit ad_units = 1; + */ + private $ad_units; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Total number of AdUnits. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * + * Generated from protobuf field int32 total_size = 3; + */ + protected $total_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Ads\AdManager\V1\AdUnit>|\Google\Protobuf\Internal\RepeatedField $ad_units + * The AdUnit from the specified network. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * @type int $total_size + * Total number of AdUnits. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\AdUnitService::initOnce(); + parent::__construct($data); + } + + /** + * The AdUnit from the specified network. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.AdUnit ad_units = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAdUnits() + { + return $this->ad_units; + } + + /** + * The AdUnit from the specified network. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.AdUnit ad_units = 1; + * @param array<\Google\Ads\AdManager\V1\AdUnit>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAdUnits($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\AdUnit::class); + $this->ad_units = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Total number of AdUnits. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * + * Generated from protobuf field int32 total_size = 3; + * @return int + */ + public function getTotalSize() + { + return $this->total_size; + } + + /** + * Total number of AdUnits. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * + * Generated from protobuf field int32 total_size = 3; + * @param int $var + * @return $this + */ + public function setTotalSize($var) + { + GPBUtil::checkInt32($var); + $this->total_size = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/ListCompaniesRequest.php b/AdsAdManager/src/V1/ListCompaniesRequest.php new file mode 100644 index 000000000000..92854e1e909c --- /dev/null +++ b/AdsAdManager/src/V1/ListCompaniesRequest.php @@ -0,0 +1,296 @@ +google.ads.admanager.v1.ListCompaniesRequest + */ +class ListCompaniesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent, which owns this collection of Companies. + * Format: `networks/{network_code}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of `Companies` to return. The service may + * return fewer than this value. If unspecified, at most 50 `Companies` will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous `ListCompanies` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListCompanies` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + /** + * Optional. Number of individual resources to skip while paginating. + * + * Generated from protobuf field int32 skip = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $skip = 0; + + /** + * @param string $parent Required. The parent, which owns this collection of Companies. + * Format: `networks/{network_code}` + * Please see {@see CompanyServiceClient::networkName()} for help formatting this field. + * + * @return \Google\Ads\AdManager\V1\ListCompaniesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent, which owns this collection of Companies. + * Format: `networks/{network_code}` + * @type int $page_size + * Optional. The maximum number of `Companies` to return. The service may + * return fewer than this value. If unspecified, at most 50 `Companies` will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * @type string $page_token + * Optional. A page token, received from a previous `ListCompanies` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListCompanies` must + * match the call that provided the page token. + * @type string $filter + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * @type string $order_by + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * @type int $skip + * Optional. Number of individual resources to skip while paginating. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\CompanyService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent, which owns this collection of Companies. + * Format: `networks/{network_code}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent, which owns this collection of Companies. + * Format: `networks/{network_code}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of `Companies` to return. The service may + * return fewer than this value. If unspecified, at most 50 `Companies` will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of `Companies` to return. The service may + * return fewer than this value. If unspecified, at most 50 `Companies` will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from a previous `ListCompanies` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListCompanies` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous `ListCompanies` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListCompanies` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + + /** + * Optional. Number of individual resources to skip while paginating. + * + * Generated from protobuf field int32 skip = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getSkip() + { + return $this->skip; + } + + /** + * Optional. Number of individual resources to skip while paginating. + * + * Generated from protobuf field int32 skip = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setSkip($var) + { + GPBUtil::checkInt32($var); + $this->skip = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/ListCompaniesResponse.php b/AdsAdManager/src/V1/ListCompaniesResponse.php new file mode 100644 index 000000000000..2dc511fcdc1e --- /dev/null +++ b/AdsAdManager/src/V1/ListCompaniesResponse.php @@ -0,0 +1,172 @@ +google.ads.admanager.v1.ListCompaniesResponse + */ +class ListCompaniesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The `Company` objects from the specified network. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Company companies = 1; + */ + private $companies; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Total number of `Company` objects. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * + * Generated from protobuf field int32 total_size = 3; + */ + protected $total_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Ads\AdManager\V1\Company>|\Google\Protobuf\Internal\RepeatedField $companies + * The `Company` objects from the specified network. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * @type int $total_size + * Total number of `Company` objects. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\CompanyService::initOnce(); + parent::__construct($data); + } + + /** + * The `Company` objects from the specified network. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Company companies = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCompanies() + { + return $this->companies; + } + + /** + * The `Company` objects from the specified network. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Company companies = 1; + * @param array<\Google\Ads\AdManager\V1\Company>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCompanies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\Company::class); + $this->companies = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Total number of `Company` objects. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * + * Generated from protobuf field int32 total_size = 3; + * @return int + */ + public function getTotalSize() + { + return $this->total_size; + } + + /** + * Total number of `Company` objects. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * + * Generated from protobuf field int32 total_size = 3; + * @param int $var + * @return $this + */ + public function setTotalSize($var) + { + GPBUtil::checkInt32($var); + $this->total_size = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/ListCustomFieldsRequest.php b/AdsAdManager/src/V1/ListCustomFieldsRequest.php new file mode 100644 index 000000000000..503b26124a12 --- /dev/null +++ b/AdsAdManager/src/V1/ListCustomFieldsRequest.php @@ -0,0 +1,296 @@ +google.ads.admanager.v1.ListCustomFieldsRequest + */ +class ListCustomFieldsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent, which owns this collection of CustomFields. + * Format: `networks/{network_code}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of `CustomFields` to return. The service may + * return fewer than this value. If unspecified, at most 50 `CustomFields` + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous `ListCustomFields` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListCustomFields` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + /** + * Optional. Number of individual resources to skip while paginating. + * + * Generated from protobuf field int32 skip = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $skip = 0; + + /** + * @param string $parent Required. The parent, which owns this collection of CustomFields. + * Format: `networks/{network_code}` + * Please see {@see CustomFieldServiceClient::networkName()} for help formatting this field. + * + * @return \Google\Ads\AdManager\V1\ListCustomFieldsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent, which owns this collection of CustomFields. + * Format: `networks/{network_code}` + * @type int $page_size + * Optional. The maximum number of `CustomFields` to return. The service may + * return fewer than this value. If unspecified, at most 50 `CustomFields` + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + * @type string $page_token + * Optional. A page token, received from a previous `ListCustomFields` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListCustomFields` must + * match the call that provided the page token. + * @type string $filter + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * @type string $order_by + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * @type int $skip + * Optional. Number of individual resources to skip while paginating. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\CustomFieldService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent, which owns this collection of CustomFields. + * Format: `networks/{network_code}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent, which owns this collection of CustomFields. + * Format: `networks/{network_code}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of `CustomFields` to return. The service may + * return fewer than this value. If unspecified, at most 50 `CustomFields` + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of `CustomFields` to return. The service may + * return fewer than this value. If unspecified, at most 50 `CustomFields` + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from a previous `ListCustomFields` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListCustomFields` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous `ListCustomFields` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListCustomFields` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + + /** + * Optional. Number of individual resources to skip while paginating. + * + * Generated from protobuf field int32 skip = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getSkip() + { + return $this->skip; + } + + /** + * Optional. Number of individual resources to skip while paginating. + * + * Generated from protobuf field int32 skip = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setSkip($var) + { + GPBUtil::checkInt32($var); + $this->skip = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/ListCustomFieldsResponse.php b/AdsAdManager/src/V1/ListCustomFieldsResponse.php new file mode 100644 index 000000000000..0309c4dbb01a --- /dev/null +++ b/AdsAdManager/src/V1/ListCustomFieldsResponse.php @@ -0,0 +1,172 @@ +google.ads.admanager.v1.ListCustomFieldsResponse + */ +class ListCustomFieldsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The `CustomField` objects from the specified network. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.CustomField custom_fields = 1; + */ + private $custom_fields; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Total number of `CustomField` objects. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * + * Generated from protobuf field int32 total_size = 3; + */ + protected $total_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Ads\AdManager\V1\CustomField>|\Google\Protobuf\Internal\RepeatedField $custom_fields + * The `CustomField` objects from the specified network. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * @type int $total_size + * Total number of `CustomField` objects. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\CustomFieldService::initOnce(); + parent::__construct($data); + } + + /** + * The `CustomField` objects from the specified network. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.CustomField custom_fields = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCustomFields() + { + return $this->custom_fields; + } + + /** + * The `CustomField` objects from the specified network. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.CustomField custom_fields = 1; + * @param array<\Google\Ads\AdManager\V1\CustomField>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCustomFields($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\CustomField::class); + $this->custom_fields = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Total number of `CustomField` objects. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * + * Generated from protobuf field int32 total_size = 3; + * @return int + */ + public function getTotalSize() + { + return $this->total_size; + } + + /** + * Total number of `CustomField` objects. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * + * Generated from protobuf field int32 total_size = 3; + * @param int $var + * @return $this + */ + public function setTotalSize($var) + { + GPBUtil::checkInt32($var); + $this->total_size = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/ListCustomTargetingKeysRequest.php b/AdsAdManager/src/V1/ListCustomTargetingKeysRequest.php new file mode 100644 index 000000000000..bf474f6a2a8f --- /dev/null +++ b/AdsAdManager/src/V1/ListCustomTargetingKeysRequest.php @@ -0,0 +1,296 @@ +google.ads.admanager.v1.ListCustomTargetingKeysRequest + */ +class ListCustomTargetingKeysRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent, which owns this collection of CustomTargetingKeys. + * Format: `networks/{network_code}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of `CustomTargetingKeys` to return. The + * service may return fewer than this value. If unspecified, at most 50 + * `CustomTargetingKeys` will be returned. The maximum value is 1000; values + * above 1000 will be coerced to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous `ListCustomTargetingKeys` + * call. Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListCustomTargetingKeys` + * must match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + /** + * Optional. Number of individual resources to skip while paginating. + * + * Generated from protobuf field int32 skip = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $skip = 0; + + /** + * @param string $parent Required. The parent, which owns this collection of CustomTargetingKeys. + * Format: `networks/{network_code}` + * Please see {@see CustomTargetingKeyServiceClient::networkName()} for help formatting this field. + * + * @return \Google\Ads\AdManager\V1\ListCustomTargetingKeysRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent, which owns this collection of CustomTargetingKeys. + * Format: `networks/{network_code}` + * @type int $page_size + * Optional. The maximum number of `CustomTargetingKeys` to return. The + * service may return fewer than this value. If unspecified, at most 50 + * `CustomTargetingKeys` will be returned. The maximum value is 1000; values + * above 1000 will be coerced to 1000. + * @type string $page_token + * Optional. A page token, received from a previous `ListCustomTargetingKeys` + * call. Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListCustomTargetingKeys` + * must match the call that provided the page token. + * @type string $filter + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * @type string $order_by + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * @type int $skip + * Optional. Number of individual resources to skip while paginating. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\CustomTargetingKeyService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent, which owns this collection of CustomTargetingKeys. + * Format: `networks/{network_code}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent, which owns this collection of CustomTargetingKeys. + * Format: `networks/{network_code}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of `CustomTargetingKeys` to return. The + * service may return fewer than this value. If unspecified, at most 50 + * `CustomTargetingKeys` will be returned. The maximum value is 1000; values + * above 1000 will be coerced to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of `CustomTargetingKeys` to return. The + * service may return fewer than this value. If unspecified, at most 50 + * `CustomTargetingKeys` will be returned. The maximum value is 1000; values + * above 1000 will be coerced to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from a previous `ListCustomTargetingKeys` + * call. Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListCustomTargetingKeys` + * must match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous `ListCustomTargetingKeys` + * call. Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListCustomTargetingKeys` + * must match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + + /** + * Optional. Number of individual resources to skip while paginating. + * + * Generated from protobuf field int32 skip = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getSkip() + { + return $this->skip; + } + + /** + * Optional. Number of individual resources to skip while paginating. + * + * Generated from protobuf field int32 skip = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setSkip($var) + { + GPBUtil::checkInt32($var); + $this->skip = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/ListCustomTargetingKeysResponse.php b/AdsAdManager/src/V1/ListCustomTargetingKeysResponse.php new file mode 100644 index 000000000000..891f1e3aff20 --- /dev/null +++ b/AdsAdManager/src/V1/ListCustomTargetingKeysResponse.php @@ -0,0 +1,172 @@ +google.ads.admanager.v1.ListCustomTargetingKeysResponse + */ +class ListCustomTargetingKeysResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The `CustomTargetingKey` objects from the specified network. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.CustomTargetingKey custom_targeting_keys = 1; + */ + private $custom_targeting_keys; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Total number of `CustomTargetingKey` objects. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * + * Generated from protobuf field int32 total_size = 3; + */ + protected $total_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Ads\AdManager\V1\CustomTargetingKey>|\Google\Protobuf\Internal\RepeatedField $custom_targeting_keys + * The `CustomTargetingKey` objects from the specified network. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * @type int $total_size + * Total number of `CustomTargetingKey` objects. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\CustomTargetingKeyService::initOnce(); + parent::__construct($data); + } + + /** + * The `CustomTargetingKey` objects from the specified network. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.CustomTargetingKey custom_targeting_keys = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCustomTargetingKeys() + { + return $this->custom_targeting_keys; + } + + /** + * The `CustomTargetingKey` objects from the specified network. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.CustomTargetingKey custom_targeting_keys = 1; + * @param array<\Google\Ads\AdManager\V1\CustomTargetingKey>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCustomTargetingKeys($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\CustomTargetingKey::class); + $this->custom_targeting_keys = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Total number of `CustomTargetingKey` objects. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * + * Generated from protobuf field int32 total_size = 3; + * @return int + */ + public function getTotalSize() + { + return $this->total_size; + } + + /** + * Total number of `CustomTargetingKey` objects. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * + * Generated from protobuf field int32 total_size = 3; + * @param int $var + * @return $this + */ + public function setTotalSize($var) + { + GPBUtil::checkInt32($var); + $this->total_size = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/ListCustomTargetingValuesRequest.php b/AdsAdManager/src/V1/ListCustomTargetingValuesRequest.php new file mode 100644 index 000000000000..8c2c089c1da0 --- /dev/null +++ b/AdsAdManager/src/V1/ListCustomTargetingValuesRequest.php @@ -0,0 +1,309 @@ +google.ads.admanager.v1.ListCustomTargetingValuesRequest + */ +class ListCustomTargetingValuesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent, which owns this collection of CustomTargetingValues. + * Format: + * `networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of `CustomTargetingValues` to return. The + * service may return fewer than this value. If unspecified, at most 50 + * `CustomTargetingValues` will be returned. The maximum value is 1000; values + * above 1000 will be coerced to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous + * `ListCustomTargetingValues` call. Provide this to retrieve the subsequent + * page. + * When paginating, all other parameters provided to + * `ListCustomTargetingValues` must match the call that provided the page + * token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + /** + * Optional. Number of individual resources to skip while paginating. + * + * Generated from protobuf field int32 skip = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $skip = 0; + + /** + * @param string $parent Required. The parent, which owns this collection of CustomTargetingValues. + * Format: + * `networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}` + * Please see {@see CustomTargetingValueServiceClient::customTargetingKeyName()} for help formatting this field. + * + * @return \Google\Ads\AdManager\V1\ListCustomTargetingValuesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent, which owns this collection of CustomTargetingValues. + * Format: + * `networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}` + * @type int $page_size + * Optional. The maximum number of `CustomTargetingValues` to return. The + * service may return fewer than this value. If unspecified, at most 50 + * `CustomTargetingValues` will be returned. The maximum value is 1000; values + * above 1000 will be coerced to 1000. + * @type string $page_token + * Optional. A page token, received from a previous + * `ListCustomTargetingValues` call. Provide this to retrieve the subsequent + * page. + * When paginating, all other parameters provided to + * `ListCustomTargetingValues` must match the call that provided the page + * token. + * @type string $filter + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * @type string $order_by + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * @type int $skip + * Optional. Number of individual resources to skip while paginating. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\CustomTargetingValueService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent, which owns this collection of CustomTargetingValues. + * Format: + * `networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent, which owns this collection of CustomTargetingValues. + * Format: + * `networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of `CustomTargetingValues` to return. The + * service may return fewer than this value. If unspecified, at most 50 + * `CustomTargetingValues` will be returned. The maximum value is 1000; values + * above 1000 will be coerced to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of `CustomTargetingValues` to return. The + * service may return fewer than this value. If unspecified, at most 50 + * `CustomTargetingValues` will be returned. The maximum value is 1000; values + * above 1000 will be coerced to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from a previous + * `ListCustomTargetingValues` call. Provide this to retrieve the subsequent + * page. + * When paginating, all other parameters provided to + * `ListCustomTargetingValues` must match the call that provided the page + * token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous + * `ListCustomTargetingValues` call. Provide this to retrieve the subsequent + * page. + * When paginating, all other parameters provided to + * `ListCustomTargetingValues` must match the call that provided the page + * token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + + /** + * Optional. Number of individual resources to skip while paginating. + * + * Generated from protobuf field int32 skip = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getSkip() + { + return $this->skip; + } + + /** + * Optional. Number of individual resources to skip while paginating. + * + * Generated from protobuf field int32 skip = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setSkip($var) + { + GPBUtil::checkInt32($var); + $this->skip = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/ListCustomTargetingValuesResponse.php b/AdsAdManager/src/V1/ListCustomTargetingValuesResponse.php new file mode 100644 index 000000000000..e1711c0af28f --- /dev/null +++ b/AdsAdManager/src/V1/ListCustomTargetingValuesResponse.php @@ -0,0 +1,172 @@ +google.ads.admanager.v1.ListCustomTargetingValuesResponse + */ +class ListCustomTargetingValuesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The `CustomTargetingValue` objects from the specified network. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.CustomTargetingValue custom_targeting_values = 1; + */ + private $custom_targeting_values; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Total number of `CustomTargetingValue` objects. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * + * Generated from protobuf field int32 total_size = 3; + */ + protected $total_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Ads\AdManager\V1\CustomTargetingValue>|\Google\Protobuf\Internal\RepeatedField $custom_targeting_values + * The `CustomTargetingValue` objects from the specified network. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * @type int $total_size + * Total number of `CustomTargetingValue` objects. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\CustomTargetingValueService::initOnce(); + parent::__construct($data); + } + + /** + * The `CustomTargetingValue` objects from the specified network. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.CustomTargetingValue custom_targeting_values = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCustomTargetingValues() + { + return $this->custom_targeting_values; + } + + /** + * The `CustomTargetingValue` objects from the specified network. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.CustomTargetingValue custom_targeting_values = 1; + * @param array<\Google\Ads\AdManager\V1\CustomTargetingValue>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCustomTargetingValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\CustomTargetingValue::class); + $this->custom_targeting_values = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Total number of `CustomTargetingValue` objects. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * + * Generated from protobuf field int32 total_size = 3; + * @return int + */ + public function getTotalSize() + { + return $this->total_size; + } + + /** + * Total number of `CustomTargetingValue` objects. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * + * Generated from protobuf field int32 total_size = 3; + * @param int $var + * @return $this + */ + public function setTotalSize($var) + { + GPBUtil::checkInt32($var); + $this->total_size = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/ListEntitySignalsMappingsRequest.php b/AdsAdManager/src/V1/ListEntitySignalsMappingsRequest.php new file mode 100644 index 000000000000..a4a2945b87fe --- /dev/null +++ b/AdsAdManager/src/V1/ListEntitySignalsMappingsRequest.php @@ -0,0 +1,304 @@ +google.ads.admanager.v1.ListEntitySignalsMappingsRequest + */ +class ListEntitySignalsMappingsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent, which owns this collection of EntitySignalsMappings. + * Format: `networks/{network_code}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of `EntitySignalsMappings` to return. The + * service may return fewer than this value. If unspecified, at most 50 + * `EntitySignalsMappings` will be returned. The maximum value is 1000; values + * above 1000 will be coerced to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous + * `ListEntitySignalsMappings` call. Provide this to retrieve the subsequent + * page. + * When paginating, all other parameters provided to + * `ListEntitySignalsMappings` must match the call that provided the page + * token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + /** + * Optional. Number of individual resources to skip while paginating. + * + * Generated from protobuf field int32 skip = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $skip = 0; + + /** + * @param string $parent Required. The parent, which owns this collection of EntitySignalsMappings. + * Format: `networks/{network_code}` + * Please see {@see EntitySignalsMappingServiceClient::networkName()} for help formatting this field. + * + * @return \Google\Ads\AdManager\V1\ListEntitySignalsMappingsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent, which owns this collection of EntitySignalsMappings. + * Format: `networks/{network_code}` + * @type int $page_size + * Optional. The maximum number of `EntitySignalsMappings` to return. The + * service may return fewer than this value. If unspecified, at most 50 + * `EntitySignalsMappings` will be returned. The maximum value is 1000; values + * above 1000 will be coerced to 1000. + * @type string $page_token + * Optional. A page token, received from a previous + * `ListEntitySignalsMappings` call. Provide this to retrieve the subsequent + * page. + * When paginating, all other parameters provided to + * `ListEntitySignalsMappings` must match the call that provided the page + * token. + * @type string $filter + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * @type string $order_by + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * @type int $skip + * Optional. Number of individual resources to skip while paginating. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\EntitySignalsMappingService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent, which owns this collection of EntitySignalsMappings. + * Format: `networks/{network_code}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent, which owns this collection of EntitySignalsMappings. + * Format: `networks/{network_code}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of `EntitySignalsMappings` to return. The + * service may return fewer than this value. If unspecified, at most 50 + * `EntitySignalsMappings` will be returned. The maximum value is 1000; values + * above 1000 will be coerced to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of `EntitySignalsMappings` to return. The + * service may return fewer than this value. If unspecified, at most 50 + * `EntitySignalsMappings` will be returned. The maximum value is 1000; values + * above 1000 will be coerced to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from a previous + * `ListEntitySignalsMappings` call. Provide this to retrieve the subsequent + * page. + * When paginating, all other parameters provided to + * `ListEntitySignalsMappings` must match the call that provided the page + * token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous + * `ListEntitySignalsMappings` call. Provide this to retrieve the subsequent + * page. + * When paginating, all other parameters provided to + * `ListEntitySignalsMappings` must match the call that provided the page + * token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + + /** + * Optional. Number of individual resources to skip while paginating. + * + * Generated from protobuf field int32 skip = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getSkip() + { + return $this->skip; + } + + /** + * Optional. Number of individual resources to skip while paginating. + * + * Generated from protobuf field int32 skip = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setSkip($var) + { + GPBUtil::checkInt32($var); + $this->skip = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/ListEntitySignalsMappingsResponse.php b/AdsAdManager/src/V1/ListEntitySignalsMappingsResponse.php new file mode 100644 index 000000000000..9cd5bb39eea0 --- /dev/null +++ b/AdsAdManager/src/V1/ListEntitySignalsMappingsResponse.php @@ -0,0 +1,172 @@ +google.ads.admanager.v1.ListEntitySignalsMappingsResponse + */ +class ListEntitySignalsMappingsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The `EntitySignalsMapping` from the specified network. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.EntitySignalsMapping entity_signals_mappings = 1; + */ + private $entity_signals_mappings; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Total number of `EntitySignalsMappings`. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * + * Generated from protobuf field int32 total_size = 3; + */ + protected $total_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Ads\AdManager\V1\EntitySignalsMapping>|\Google\Protobuf\Internal\RepeatedField $entity_signals_mappings + * The `EntitySignalsMapping` from the specified network. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * @type int $total_size + * Total number of `EntitySignalsMappings`. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\EntitySignalsMappingService::initOnce(); + parent::__construct($data); + } + + /** + * The `EntitySignalsMapping` from the specified network. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.EntitySignalsMapping entity_signals_mappings = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEntitySignalsMappings() + { + return $this->entity_signals_mappings; + } + + /** + * The `EntitySignalsMapping` from the specified network. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.EntitySignalsMapping entity_signals_mappings = 1; + * @param array<\Google\Ads\AdManager\V1\EntitySignalsMapping>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEntitySignalsMappings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\EntitySignalsMapping::class); + $this->entity_signals_mappings = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Total number of `EntitySignalsMappings`. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * + * Generated from protobuf field int32 total_size = 3; + * @return int + */ + public function getTotalSize() + { + return $this->total_size; + } + + /** + * Total number of `EntitySignalsMappings`. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * + * Generated from protobuf field int32 total_size = 3; + * @param int $var + * @return $this + */ + public function setTotalSize($var) + { + GPBUtil::checkInt32($var); + $this->total_size = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/ListNetworksRequest.php b/AdsAdManager/src/V1/ListNetworksRequest.php new file mode 100644 index 000000000000..533cdfe2486e --- /dev/null +++ b/AdsAdManager/src/V1/ListNetworksRequest.php @@ -0,0 +1,33 @@ +google.ads.admanager.v1.ListNetworksRequest + */ +class ListNetworksRequest extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\NetworkService::initOnce(); + parent::__construct($data); + } + +} + diff --git a/AdsAdManager/src/V1/ListNetworksResponse.php b/AdsAdManager/src/V1/ListNetworksResponse.php new file mode 100644 index 000000000000..0e19406e6bf5 --- /dev/null +++ b/AdsAdManager/src/V1/ListNetworksResponse.php @@ -0,0 +1,67 @@ +google.ads.admanager.v1.ListNetworksResponse + */ +class ListNetworksResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The `Network`s a user has access to. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Network networks = 1; + */ + private $networks; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Ads\AdManager\V1\Network>|\Google\Protobuf\Internal\RepeatedField $networks + * The `Network`s a user has access to. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\NetworkService::initOnce(); + parent::__construct($data); + } + + /** + * The `Network`s a user has access to. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Network networks = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNetworks() + { + return $this->networks; + } + + /** + * The `Network`s a user has access to. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Network networks = 1; + * @param array<\Google\Ads\AdManager\V1\Network>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNetworks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\Network::class); + $this->networks = $arr; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/ListOrdersRequest.php b/AdsAdManager/src/V1/ListOrdersRequest.php new file mode 100644 index 000000000000..3aad5cd01b81 --- /dev/null +++ b/AdsAdManager/src/V1/ListOrdersRequest.php @@ -0,0 +1,296 @@ +google.ads.admanager.v1.ListOrdersRequest + */ +class ListOrdersRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent, which owns this collection of Orders. + * Format: `networks/{network_code}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of `Orders` to return. The service may return + * fewer than this value. If unspecified, at most 50 `Orders` will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous `ListOrders` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListOrders` must match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + /** + * Optional. Number of individual resources to skip while paginating. + * + * Generated from protobuf field int32 skip = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $skip = 0; + + /** + * @param string $parent Required. The parent, which owns this collection of Orders. + * Format: `networks/{network_code}` + * Please see {@see OrderServiceClient::networkName()} for help formatting this field. + * + * @return \Google\Ads\AdManager\V1\ListOrdersRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent, which owns this collection of Orders. + * Format: `networks/{network_code}` + * @type int $page_size + * Optional. The maximum number of `Orders` to return. The service may return + * fewer than this value. If unspecified, at most 50 `Orders` will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @type string $page_token + * Optional. A page token, received from a previous `ListOrders` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListOrders` must match + * the call that provided the page token. + * @type string $filter + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * @type string $order_by + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * @type int $skip + * Optional. Number of individual resources to skip while paginating. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\OrderService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent, which owns this collection of Orders. + * Format: `networks/{network_code}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent, which owns this collection of Orders. + * Format: `networks/{network_code}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of `Orders` to return. The service may return + * fewer than this value. If unspecified, at most 50 `Orders` will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of `Orders` to return. The service may return + * fewer than this value. If unspecified, at most 50 `Orders` will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from a previous `ListOrders` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListOrders` must match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous `ListOrders` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListOrders` must match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + + /** + * Optional. Number of individual resources to skip while paginating. + * + * Generated from protobuf field int32 skip = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getSkip() + { + return $this->skip; + } + + /** + * Optional. Number of individual resources to skip while paginating. + * + * Generated from protobuf field int32 skip = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setSkip($var) + { + GPBUtil::checkInt32($var); + $this->skip = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/ListOrdersResponse.php b/AdsAdManager/src/V1/ListOrdersResponse.php new file mode 100644 index 000000000000..d8f3a73eeeee --- /dev/null +++ b/AdsAdManager/src/V1/ListOrdersResponse.php @@ -0,0 +1,172 @@ +google.ads.admanager.v1.ListOrdersResponse + */ +class ListOrdersResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The `Order` from the specified network. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Order orders = 1; + */ + private $orders; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Total number of `Orders`. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * + * Generated from protobuf field int32 total_size = 3; + */ + protected $total_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Ads\AdManager\V1\Order>|\Google\Protobuf\Internal\RepeatedField $orders + * The `Order` from the specified network. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * @type int $total_size + * Total number of `Orders`. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\OrderService::initOnce(); + parent::__construct($data); + } + + /** + * The `Order` from the specified network. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Order orders = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOrders() + { + return $this->orders; + } + + /** + * The `Order` from the specified network. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Order orders = 1; + * @param array<\Google\Ads\AdManager\V1\Order>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOrders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\Order::class); + $this->orders = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Total number of `Orders`. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * + * Generated from protobuf field int32 total_size = 3; + * @return int + */ + public function getTotalSize() + { + return $this->total_size; + } + + /** + * Total number of `Orders`. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * + * Generated from protobuf field int32 total_size = 3; + * @param int $var + * @return $this + */ + public function setTotalSize($var) + { + GPBUtil::checkInt32($var); + $this->total_size = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/ListPlacementsRequest.php b/AdsAdManager/src/V1/ListPlacementsRequest.php new file mode 100644 index 000000000000..0c728e44c3de --- /dev/null +++ b/AdsAdManager/src/V1/ListPlacementsRequest.php @@ -0,0 +1,296 @@ +google.ads.admanager.v1.ListPlacementsRequest + */ +class ListPlacementsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent, which owns this collection of Placements. + * Format: `networks/{network_code}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of `Placements` to return. The service may + * return fewer than this value. If unspecified, at most 50 `Placements` will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous `ListPlacements` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListPlacements` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + /** + * Optional. Number of individual resources to skip while paginating. + * + * Generated from protobuf field int32 skip = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $skip = 0; + + /** + * @param string $parent Required. The parent, which owns this collection of Placements. + * Format: `networks/{network_code}` + * Please see {@see PlacementServiceClient::networkName()} for help formatting this field. + * + * @return \Google\Ads\AdManager\V1\ListPlacementsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent, which owns this collection of Placements. + * Format: `networks/{network_code}` + * @type int $page_size + * Optional. The maximum number of `Placements` to return. The service may + * return fewer than this value. If unspecified, at most 50 `Placements` will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * @type string $page_token + * Optional. A page token, received from a previous `ListPlacements` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListPlacements` must + * match the call that provided the page token. + * @type string $filter + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * @type string $order_by + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * @type int $skip + * Optional. Number of individual resources to skip while paginating. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\PlacementService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent, which owns this collection of Placements. + * Format: `networks/{network_code}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent, which owns this collection of Placements. + * Format: `networks/{network_code}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of `Placements` to return. The service may + * return fewer than this value. If unspecified, at most 50 `Placements` will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of `Placements` to return. The service may + * return fewer than this value. If unspecified, at most 50 `Placements` will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from a previous `ListPlacements` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListPlacements` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous `ListPlacements` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListPlacements` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + + /** + * Optional. Number of individual resources to skip while paginating. + * + * Generated from protobuf field int32 skip = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getSkip() + { + return $this->skip; + } + + /** + * Optional. Number of individual resources to skip while paginating. + * + * Generated from protobuf field int32 skip = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setSkip($var) + { + GPBUtil::checkInt32($var); + $this->skip = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/ListPlacementsResponse.php b/AdsAdManager/src/V1/ListPlacementsResponse.php new file mode 100644 index 000000000000..0d509198484e --- /dev/null +++ b/AdsAdManager/src/V1/ListPlacementsResponse.php @@ -0,0 +1,172 @@ +google.ads.admanager.v1.ListPlacementsResponse + */ +class ListPlacementsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The `Placement` objects from the specified network. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Placement placements = 1; + */ + private $placements; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Total number of `Placement` objects. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * + * Generated from protobuf field int32 total_size = 3; + */ + protected $total_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Ads\AdManager\V1\Placement>|\Google\Protobuf\Internal\RepeatedField $placements + * The `Placement` objects from the specified network. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * @type int $total_size + * Total number of `Placement` objects. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\PlacementService::initOnce(); + parent::__construct($data); + } + + /** + * The `Placement` objects from the specified network. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Placement placements = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPlacements() + { + return $this->placements; + } + + /** + * The `Placement` objects from the specified network. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Placement placements = 1; + * @param array<\Google\Ads\AdManager\V1\Placement>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPlacements($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\Placement::class); + $this->placements = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Total number of `Placement` objects. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * + * Generated from protobuf field int32 total_size = 3; + * @return int + */ + public function getTotalSize() + { + return $this->total_size; + } + + /** + * Total number of `Placement` objects. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * + * Generated from protobuf field int32 total_size = 3; + * @param int $var + * @return $this + */ + public function setTotalSize($var) + { + GPBUtil::checkInt32($var); + $this->total_size = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/ListReportsRequest.php b/AdsAdManager/src/V1/ListReportsRequest.php new file mode 100644 index 000000000000..4f9ef229c9d0 --- /dev/null +++ b/AdsAdManager/src/V1/ListReportsRequest.php @@ -0,0 +1,296 @@ +google.ads.admanager.v1.ListReportsRequest + */ +class ListReportsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent, which owns this collection of reports. + * Format: `networks/{network_code}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of `Reports` to return. The service may return + * fewer than this value. If unspecified, at most 50 `Reports` will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous `ListReports` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListReports` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + /** + * Optional. Number of individual resources to skip while paginating. + * + * Generated from protobuf field int32 skip = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $skip = 0; + + /** + * @param string $parent Required. The parent, which owns this collection of reports. + * Format: `networks/{network_code}` + * Please see {@see ReportServiceClient::networkName()} for help formatting this field. + * + * @return \Google\Ads\AdManager\V1\ListReportsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent, which owns this collection of reports. + * Format: `networks/{network_code}` + * @type int $page_size + * Optional. The maximum number of `Reports` to return. The service may return + * fewer than this value. If unspecified, at most 50 `Reports` will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @type string $page_token + * Optional. A page token, received from a previous `ListReports` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListReports` must + * match the call that provided the page token. + * @type string $filter + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * @type string $order_by + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * @type int $skip + * Optional. Number of individual resources to skip while paginating. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\ReportService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent, which owns this collection of reports. + * Format: `networks/{network_code}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent, which owns this collection of reports. + * Format: `networks/{network_code}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of `Reports` to return. The service may return + * fewer than this value. If unspecified, at most 50 `Reports` will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of `Reports` to return. The service may return + * fewer than this value. If unspecified, at most 50 `Reports` will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from a previous `ListReports` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListReports` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous `ListReports` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListReports` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + + /** + * Optional. Number of individual resources to skip while paginating. + * + * Generated from protobuf field int32 skip = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getSkip() + { + return $this->skip; + } + + /** + * Optional. Number of individual resources to skip while paginating. + * + * Generated from protobuf field int32 skip = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setSkip($var) + { + GPBUtil::checkInt32($var); + $this->skip = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/ListReportsResponse.php b/AdsAdManager/src/V1/ListReportsResponse.php new file mode 100644 index 000000000000..7acc7238699f --- /dev/null +++ b/AdsAdManager/src/V1/ListReportsResponse.php @@ -0,0 +1,172 @@ +google.ads.admanager.v1.ListReportsResponse + */ +class ListReportsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The `Report` objects from the specified network. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report reports = 1; + */ + private $reports; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Total number of `Report` objects. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * + * Generated from protobuf field int32 total_size = 3; + */ + protected $total_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Ads\AdManager\V1\Report>|\Google\Protobuf\Internal\RepeatedField $reports + * The `Report` objects from the specified network. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * @type int $total_size + * Total number of `Report` objects. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\ReportService::initOnce(); + parent::__construct($data); + } + + /** + * The `Report` objects from the specified network. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report reports = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getReports() + { + return $this->reports; + } + + /** + * The `Report` objects from the specified network. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report reports = 1; + * @param array<\Google\Ads\AdManager\V1\Report>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setReports($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\Report::class); + $this->reports = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Total number of `Report` objects. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * + * Generated from protobuf field int32 total_size = 3; + * @return int + */ + public function getTotalSize() + { + return $this->total_size; + } + + /** + * Total number of `Report` objects. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * + * Generated from protobuf field int32 total_size = 3; + * @param int $var + * @return $this + */ + public function setTotalSize($var) + { + GPBUtil::checkInt32($var); + $this->total_size = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/ListRolesRequest.php b/AdsAdManager/src/V1/ListRolesRequest.php new file mode 100644 index 000000000000..ae086b8ea872 --- /dev/null +++ b/AdsAdManager/src/V1/ListRolesRequest.php @@ -0,0 +1,292 @@ +google.ads.admanager.v1.ListRolesRequest + */ +class ListRolesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent, which owns this collection of Roles. + * Format: `networks/{network_code}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of `Roles` to return. The service may return + * fewer than this value. If unspecified, at most 50 `Roles` will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous `ListRoles` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListRoles` must match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + /** + * Optional. Number of individual resources to skip while paginating. + * + * Generated from protobuf field int32 skip = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $skip = 0; + + /** + * @param string $parent Required. The parent, which owns this collection of Roles. + * Format: `networks/{network_code}` + * Please see {@see RoleServiceClient::networkName()} for help formatting this field. + * + * @return \Google\Ads\AdManager\V1\ListRolesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent, which owns this collection of Roles. + * Format: `networks/{network_code}` + * @type int $page_size + * Optional. The maximum number of `Roles` to return. The service may return + * fewer than this value. If unspecified, at most 50 `Roles` will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @type string $page_token + * Optional. A page token, received from a previous `ListRoles` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListRoles` must match + * the call that provided the page token. + * @type string $filter + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * @type string $order_by + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * @type int $skip + * Optional. Number of individual resources to skip while paginating. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\RoleService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent, which owns this collection of Roles. + * Format: `networks/{network_code}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent, which owns this collection of Roles. + * Format: `networks/{network_code}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of `Roles` to return. The service may return + * fewer than this value. If unspecified, at most 50 `Roles` will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of `Roles` to return. The service may return + * fewer than this value. If unspecified, at most 50 `Roles` will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from a previous `ListRoles` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListRoles` must match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous `ListRoles` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListRoles` must match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + + /** + * Optional. Number of individual resources to skip while paginating. + * + * Generated from protobuf field int32 skip = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getSkip() + { + return $this->skip; + } + + /** + * Optional. Number of individual resources to skip while paginating. + * + * Generated from protobuf field int32 skip = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setSkip($var) + { + GPBUtil::checkInt32($var); + $this->skip = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/ListRolesResponse.php b/AdsAdManager/src/V1/ListRolesResponse.php new file mode 100644 index 000000000000..6eb4ef45ab2c --- /dev/null +++ b/AdsAdManager/src/V1/ListRolesResponse.php @@ -0,0 +1,171 @@ +google.ads.admanager.v1.ListRolesResponse + */ +class ListRolesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The `Role` objects from the specified network. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Role roles = 1; + */ + private $roles; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Total number of `Role` objects. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * + * Generated from protobuf field int32 total_size = 3; + */ + protected $total_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Ads\AdManager\V1\Role>|\Google\Protobuf\Internal\RepeatedField $roles + * The `Role` objects from the specified network. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * @type int $total_size + * Total number of `Role` objects. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\RoleService::initOnce(); + parent::__construct($data); + } + + /** + * The `Role` objects from the specified network. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Role roles = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRoles() + { + return $this->roles; + } + + /** + * The `Role` objects from the specified network. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Role roles = 1; + * @param array<\Google\Ads\AdManager\V1\Role>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRoles($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\Role::class); + $this->roles = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Total number of `Role` objects. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * + * Generated from protobuf field int32 total_size = 3; + * @return int + */ + public function getTotalSize() + { + return $this->total_size; + } + + /** + * Total number of `Role` objects. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * + * Generated from protobuf field int32 total_size = 3; + * @param int $var + * @return $this + */ + public function setTotalSize($var) + { + GPBUtil::checkInt32($var); + $this->total_size = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/ListTaxonomyCategoriesRequest.php b/AdsAdManager/src/V1/ListTaxonomyCategoriesRequest.php new file mode 100644 index 000000000000..fcbb1bb1167d --- /dev/null +++ b/AdsAdManager/src/V1/ListTaxonomyCategoriesRequest.php @@ -0,0 +1,296 @@ +google.ads.admanager.v1.ListTaxonomyCategoriesRequest + */ +class ListTaxonomyCategoriesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent, which owns this collection of TaxonomyCategories. + * Format: `networks/{network_code}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of `TaxonomyCategories` to return. The service + * may return fewer than this value. If unspecified, at most 50 + * `TaxonomyCategories` will be returned. The maximum value is 1000; values + * above 1000 will be coerced to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous `ListTaxonomyCategories` + * call. Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListTaxonomyCategories` + * must match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + /** + * Optional. Number of individual resources to skip while paginating. + * + * Generated from protobuf field int32 skip = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $skip = 0; + + /** + * @param string $parent Required. The parent, which owns this collection of TaxonomyCategories. + * Format: `networks/{network_code}` + * Please see {@see TaxonomyCategoryServiceClient::networkName()} for help formatting this field. + * + * @return \Google\Ads\AdManager\V1\ListTaxonomyCategoriesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent, which owns this collection of TaxonomyCategories. + * Format: `networks/{network_code}` + * @type int $page_size + * Optional. The maximum number of `TaxonomyCategories` to return. The service + * may return fewer than this value. If unspecified, at most 50 + * `TaxonomyCategories` will be returned. The maximum value is 1000; values + * above 1000 will be coerced to 1000. + * @type string $page_token + * Optional. A page token, received from a previous `ListTaxonomyCategories` + * call. Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListTaxonomyCategories` + * must match the call that provided the page token. + * @type string $filter + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * @type string $order_by + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * @type int $skip + * Optional. Number of individual resources to skip while paginating. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\TaxonomyCategoryService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent, which owns this collection of TaxonomyCategories. + * Format: `networks/{network_code}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent, which owns this collection of TaxonomyCategories. + * Format: `networks/{network_code}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of `TaxonomyCategories` to return. The service + * may return fewer than this value. If unspecified, at most 50 + * `TaxonomyCategories` will be returned. The maximum value is 1000; values + * above 1000 will be coerced to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of `TaxonomyCategories` to return. The service + * may return fewer than this value. If unspecified, at most 50 + * `TaxonomyCategories` will be returned. The maximum value is 1000; values + * above 1000 will be coerced to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from a previous `ListTaxonomyCategories` + * call. Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListTaxonomyCategories` + * must match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous `ListTaxonomyCategories` + * call. Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListTaxonomyCategories` + * must match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Expression to filter the response. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Expression to specify sorting order. + * See syntax details at + * https://developers.google.com/ad-manager/api/beta/filters#order + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + + /** + * Optional. Number of individual resources to skip while paginating. + * + * Generated from protobuf field int32 skip = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getSkip() + { + return $this->skip; + } + + /** + * Optional. Number of individual resources to skip while paginating. + * + * Generated from protobuf field int32 skip = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setSkip($var) + { + GPBUtil::checkInt32($var); + $this->skip = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/ListTaxonomyCategoriesResponse.php b/AdsAdManager/src/V1/ListTaxonomyCategoriesResponse.php new file mode 100644 index 000000000000..66c311184902 --- /dev/null +++ b/AdsAdManager/src/V1/ListTaxonomyCategoriesResponse.php @@ -0,0 +1,172 @@ +google.ads.admanager.v1.ListTaxonomyCategoriesResponse + */ +class ListTaxonomyCategoriesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The `TaxonomyCategory` objects. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.TaxonomyCategory taxonomy_categories = 1; + */ + private $taxonomy_categories; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Total number of `TaxonomyCategory` objects. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * + * Generated from protobuf field int32 total_size = 3; + */ + protected $total_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Ads\AdManager\V1\TaxonomyCategory>|\Google\Protobuf\Internal\RepeatedField $taxonomy_categories + * The `TaxonomyCategory` objects. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * @type int $total_size + * Total number of `TaxonomyCategory` objects. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\TaxonomyCategoryService::initOnce(); + parent::__construct($data); + } + + /** + * The `TaxonomyCategory` objects. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.TaxonomyCategory taxonomy_categories = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTaxonomyCategories() + { + return $this->taxonomy_categories; + } + + /** + * The `TaxonomyCategory` objects. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.TaxonomyCategory taxonomy_categories = 1; + * @param array<\Google\Ads\AdManager\V1\TaxonomyCategory>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTaxonomyCategories($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\TaxonomyCategory::class); + $this->taxonomy_categories = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Total number of `TaxonomyCategory` objects. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * + * Generated from protobuf field int32 total_size = 3; + * @return int + */ + public function getTotalSize() + { + return $this->total_size; + } + + /** + * Total number of `TaxonomyCategory` objects. + * If a filter was included in the request, this reflects the total number + * after the filtering is applied. + * `total_size` will not be calculated in the response unless it has been + * included in a response field mask. The response field mask can be provided + * to the method by using the URL parameter `$fields` or `fields`, or by using + * the HTTP/gRPC header `X-Goog-FieldMask`. + * For more information, see + * https://developers.google.com/ad-manager/api/beta/field-masks + * + * Generated from protobuf field int32 total_size = 3; + * @param int $var + * @return $this + */ + public function setTotalSize($var) + { + GPBUtil::checkInt32($var); + $this->total_size = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/Network.php b/AdsAdManager/src/V1/Network.php new file mode 100644 index 000000000000..b4bb7bf928fe --- /dev/null +++ b/AdsAdManager/src/V1/Network.php @@ -0,0 +1,393 @@ +google.ads.admanager.v1.Network + */ +class Network extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The resource name of the Network. + * Format: networks/{network_code} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Optional. Display name for Network. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_name = ''; + /** + * Output only. Network Code. + * + * Generated from protobuf field string network_code = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $network_code = ''; + /** + * Output only. Property code. + * + * Generated from protobuf field string property_code = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $property_code = ''; + /** + * Output only. Time zone associated with the delivery of orders and + * reporting. + * + * Generated from protobuf field string time_zone = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $time_zone = ''; + /** + * Output only. Primary currency code, in ISO-4217 format. + * + * Generated from protobuf field string currency_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $currency_code = ''; + /** + * Optional. Currency codes that can be used as an alternative to the primary + * currency code for trafficking Line Items. + * + * Generated from protobuf field repeated string secondary_currency_codes = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $secondary_currency_codes; + /** + * Output only. Top most [Ad Unit](google.ads.admanager.v1.AdUnit) to which + * descendant Ad Units can be added. + * Format: networks/{network_code}/adUnit/{ad_unit_id} + * + * Generated from protobuf field string effective_root_ad_unit = 8 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $effective_root_ad_unit = ''; + /** + * Output only. Whether this is a test network. + * + * Generated from protobuf field bool test_network = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $test_network = false; + /** + * Output only. Network ID. + * + * Generated from protobuf field int64 network_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $network_id = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The resource name of the Network. + * Format: networks/{network_code} + * @type string $display_name + * Optional. Display name for Network. + * @type string $network_code + * Output only. Network Code. + * @type string $property_code + * Output only. Property code. + * @type string $time_zone + * Output only. Time zone associated with the delivery of orders and + * reporting. + * @type string $currency_code + * Output only. Primary currency code, in ISO-4217 format. + * @type array|\Google\Protobuf\Internal\RepeatedField $secondary_currency_codes + * Optional. Currency codes that can be used as an alternative to the primary + * currency code for trafficking Line Items. + * @type string $effective_root_ad_unit + * Output only. Top most [Ad Unit](google.ads.admanager.v1.AdUnit) to which + * descendant Ad Units can be added. + * Format: networks/{network_code}/adUnit/{ad_unit_id} + * @type bool $test_network + * Output only. Whether this is a test network. + * @type int|string $network_id + * Output only. Network ID. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\NetworkMessages::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The resource name of the Network. + * Format: networks/{network_code} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The resource name of the Network. + * Format: networks/{network_code} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Display name for Network. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Optional. Display name for Network. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. Network Code. + * + * Generated from protobuf field string network_code = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getNetworkCode() + { + return $this->network_code; + } + + /** + * Output only. Network Code. + * + * Generated from protobuf field string network_code = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setNetworkCode($var) + { + GPBUtil::checkString($var, True); + $this->network_code = $var; + + return $this; + } + + /** + * Output only. Property code. + * + * Generated from protobuf field string property_code = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getPropertyCode() + { + return $this->property_code; + } + + /** + * Output only. Property code. + * + * Generated from protobuf field string property_code = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setPropertyCode($var) + { + GPBUtil::checkString($var, True); + $this->property_code = $var; + + return $this; + } + + /** + * Output only. Time zone associated with the delivery of orders and + * reporting. + * + * Generated from protobuf field string time_zone = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTimeZone() + { + return $this->time_zone; + } + + /** + * Output only. Time zone associated with the delivery of orders and + * reporting. + * + * Generated from protobuf field string time_zone = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTimeZone($var) + { + GPBUtil::checkString($var, True); + $this->time_zone = $var; + + return $this; + } + + /** + * Output only. Primary currency code, in ISO-4217 format. + * + * Generated from protobuf field string currency_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getCurrencyCode() + { + return $this->currency_code; + } + + /** + * Output only. Primary currency code, in ISO-4217 format. + * + * Generated from protobuf field string currency_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setCurrencyCode($var) + { + GPBUtil::checkString($var, True); + $this->currency_code = $var; + + return $this; + } + + /** + * Optional. Currency codes that can be used as an alternative to the primary + * currency code for trafficking Line Items. + * + * Generated from protobuf field repeated string secondary_currency_codes = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSecondaryCurrencyCodes() + { + return $this->secondary_currency_codes; + } + + /** + * Optional. Currency codes that can be used as an alternative to the primary + * currency code for trafficking Line Items. + * + * Generated from protobuf field repeated string secondary_currency_codes = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSecondaryCurrencyCodes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->secondary_currency_codes = $arr; + + return $this; + } + + /** + * Output only. Top most [Ad Unit](google.ads.admanager.v1.AdUnit) to which + * descendant Ad Units can be added. + * Format: networks/{network_code}/adUnit/{ad_unit_id} + * + * Generated from protobuf field string effective_root_ad_unit = 8 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getEffectiveRootAdUnit() + { + return $this->effective_root_ad_unit; + } + + /** + * Output only. Top most [Ad Unit](google.ads.admanager.v1.AdUnit) to which + * descendant Ad Units can be added. + * Format: networks/{network_code}/adUnit/{ad_unit_id} + * + * Generated from protobuf field string effective_root_ad_unit = 8 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setEffectiveRootAdUnit($var) + { + GPBUtil::checkString($var, True); + $this->effective_root_ad_unit = $var; + + return $this; + } + + /** + * Output only. Whether this is a test network. + * + * Generated from protobuf field bool test_network = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getTestNetwork() + { + return $this->test_network; + } + + /** + * Output only. Whether this is a test network. + * + * Generated from protobuf field bool test_network = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setTestNetwork($var) + { + GPBUtil::checkBool($var); + $this->test_network = $var; + + return $this; + } + + /** + * Output only. Network ID. + * + * Generated from protobuf field int64 network_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getNetworkId() + { + return $this->network_id; + } + + /** + * Output only. Network ID. + * + * Generated from protobuf field int64 network_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setNetworkId($var) + { + GPBUtil::checkInt64($var); + $this->network_id = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/Order.php b/AdsAdManager/src/V1/Order.php new file mode 100644 index 000000000000..e6925980903c --- /dev/null +++ b/AdsAdManager/src/V1/Order.php @@ -0,0 +1,1169 @@ +google.ads.admanager.v1.Order + */ +class Order extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The resource name of the `Order`. + * Format: `networks/{network_code}/orders/{order_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. Order ID. + * + * Generated from protobuf field int64 order_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $order_id = 0; + /** + * Required. The display name of the Order. This value has a maximum length + * of 255 characters. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + /** + * Optional. Specifies whether or not the Order is a programmatic order. + * + * Generated from protobuf field bool programmatic = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $programmatic = false; + /** + * Required. The resource name of the User responsible for trafficking the + * Order. Format: "networks/{network_code}/users/{user_id}" + * + * Generated from protobuf field string trafficker = 23 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $trafficker = ''; + /** + * Optional. The resource names of Contacts from the advertiser of this Order. + * Format: "networks/{network_code}/contacts/{contact_id}" + * + * Generated from protobuf field repeated string advertiser_contacts = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + private $advertiser_contacts; + /** + * Required. The resource name of the Company, which is of type + * Company.Type.ADVERTISER, to which this order belongs. Format: + * "networks/{network_code}/companies/{company_id}" + * + * Generated from protobuf field string advertiser = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $advertiser = ''; + /** + * Optional. The resource names of Contacts from the advertising Agency of + * this Order. Format: "networks/{network_code}/contacts/{contact_id}" + * + * Generated from protobuf field repeated string agency_contacts = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + private $agency_contacts; + /** + * Optional. The resource name of the Company, which is of type + * Company.Type.AGENCY, with which this order is associated. Format: + * "networks/{network_code}/companies/{company_id}" + * + * Generated from protobuf field string agency = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $agency = ''; + /** + * Optional. The resource names of Teams directly applied to this Order. + * Format: "networks/{network_code}/teams/{team_id}" + * + * Generated from protobuf field repeated string applied_teams = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + private $applied_teams; + /** + * Output only. The resource names of Teams applied to this Order including + * inherited values. Format: "networks/{network_code}/teams/{team_id}" + * + * Generated from protobuf field repeated string effective_teams = 28 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + private $effective_teams; + /** + * Output only. The resource name of the User who created the Order on behalf + * of the advertiser. This value is assigned by Google. Format: + * "networks/{network_code}/users/{user_id}" + * + * Generated from protobuf field string creator = 10 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $creator = ''; + /** + * Output only. The ISO 4217 3-letter currency code for the currency used by + * the Order. This value is the network's currency code. + * + * Generated from protobuf field string currency_code = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $currency_code = ''; + /** + * Output only. The instant at which the Order and its associated line items + * are eligible to begin serving. This attribute is derived from the line item + * of the order that has the earliest LineItem.start_time. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $start_time = null; + /** + * Output only. The instant at which the Order and its associated line items + * stop being served. This attribute is derived from the line item of the + * order that has the latest LineItem.end_time. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. Indicates whether or not this Order has an end time. + * + * Generated from protobuf field bool unlimited_end_time = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $unlimited_end_time = false; + /** + * Optional. An arbitrary ID to associate to the Order, which can be used as a + * key to an external system. + * + * Generated from protobuf field int64 external_order_id = 13 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $external_order_id = 0; + /** + * Output only. The archival status of the Order. + * + * Generated from protobuf field bool archived = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $archived = false; + /** + * Output only. The application which modified this order. This attribute is + * assigned by Google. + * + * Generated from protobuf field string last_modified_by_app = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $last_modified_by_app = ''; + /** + * Output only. The instant this Order was last modified. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Optional. Provides any additional notes that may annotate the Order. This + * attribute has a maximum length of 65,535 characters. + * + * Generated from protobuf field string notes = 17 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $notes = ''; + /** + * Optional. The purchase order number for the Order. This value has a maximum + * length of 63 characters. + * + * Generated from protobuf field string po_number = 18 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $po_number = ''; + /** + * Output only. The status of the Order. + * + * Generated from protobuf field .google.ads.admanager.v1.OrderStatusEnum.OrderStatus status = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status = 0; + /** + * Optional. The resource name of the User responsible for the sales of the + * Order. Format: "networks/{network_code}/users/{user_id}" + * + * Generated from protobuf field string salesperson = 21 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $salesperson = ''; + /** + * Optional. Unordered list. The resource names of the secondary salespeople + * associated with the order. Format: + * "networks/{network_code}/users/{user_id}" + * + * Generated from protobuf field repeated string secondary_salespeople = 22 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = UNORDERED_LIST, (.google.api.resource_reference) = { + */ + private $secondary_salespeople; + /** + * Optional. Unordered list. The resource names of the secondary traffickers + * associated with the order. Format: + * "networks/{network_code}/users/{user_id}" + * + * Generated from protobuf field repeated string secondary_traffickers = 24 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = UNORDERED_LIST, (.google.api.resource_reference) = { + */ + private $secondary_traffickers; + /** + * Optional. The set of labels applied directly to this order. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.AppliedLabel applied_labels = 25 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $applied_labels; + /** + * Output only. Contains the set of labels applied directly to the order as + * well as those inherited from the company that owns the order. If a label + * has been negated, only the negated label is returned. This field is + * assigned by Google. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.AppliedLabel effective_applied_labels = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $effective_applied_labels; + /** + * Optional. The set of custom field values to this order. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.CustomFieldValue custom_field_values = 38 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $custom_field_values; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The resource name of the `Order`. + * Format: `networks/{network_code}/orders/{order_id}` + * @type int|string $order_id + * Output only. Order ID. + * @type string $display_name + * Required. The display name of the Order. This value has a maximum length + * of 255 characters. + * @type bool $programmatic + * Optional. Specifies whether or not the Order is a programmatic order. + * @type string $trafficker + * Required. The resource name of the User responsible for trafficking the + * Order. Format: "networks/{network_code}/users/{user_id}" + * @type array|\Google\Protobuf\Internal\RepeatedField $advertiser_contacts + * Optional. The resource names of Contacts from the advertiser of this Order. + * Format: "networks/{network_code}/contacts/{contact_id}" + * @type string $advertiser + * Required. The resource name of the Company, which is of type + * Company.Type.ADVERTISER, to which this order belongs. Format: + * "networks/{network_code}/companies/{company_id}" + * @type array|\Google\Protobuf\Internal\RepeatedField $agency_contacts + * Optional. The resource names of Contacts from the advertising Agency of + * this Order. Format: "networks/{network_code}/contacts/{contact_id}" + * @type string $agency + * Optional. The resource name of the Company, which is of type + * Company.Type.AGENCY, with which this order is associated. Format: + * "networks/{network_code}/companies/{company_id}" + * @type array|\Google\Protobuf\Internal\RepeatedField $applied_teams + * Optional. The resource names of Teams directly applied to this Order. + * Format: "networks/{network_code}/teams/{team_id}" + * @type array|\Google\Protobuf\Internal\RepeatedField $effective_teams + * Output only. The resource names of Teams applied to this Order including + * inherited values. Format: "networks/{network_code}/teams/{team_id}" + * @type string $creator + * Output only. The resource name of the User who created the Order on behalf + * of the advertiser. This value is assigned by Google. Format: + * "networks/{network_code}/users/{user_id}" + * @type string $currency_code + * Output only. The ISO 4217 3-letter currency code for the currency used by + * the Order. This value is the network's currency code. + * @type \Google\Protobuf\Timestamp $start_time + * Output only. The instant at which the Order and its associated line items + * are eligible to begin serving. This attribute is derived from the line item + * of the order that has the earliest LineItem.start_time. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The instant at which the Order and its associated line items + * stop being served. This attribute is derived from the line item of the + * order that has the latest LineItem.end_time. + * @type bool $unlimited_end_time + * Output only. Indicates whether or not this Order has an end time. + * @type int|string $external_order_id + * Optional. An arbitrary ID to associate to the Order, which can be used as a + * key to an external system. + * @type bool $archived + * Output only. The archival status of the Order. + * @type string $last_modified_by_app + * Output only. The application which modified this order. This attribute is + * assigned by Google. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The instant this Order was last modified. + * @type string $notes + * Optional. Provides any additional notes that may annotate the Order. This + * attribute has a maximum length of 65,535 characters. + * @type string $po_number + * Optional. The purchase order number for the Order. This value has a maximum + * length of 63 characters. + * @type int $status + * Output only. The status of the Order. + * @type string $salesperson + * Optional. The resource name of the User responsible for the sales of the + * Order. Format: "networks/{network_code}/users/{user_id}" + * @type array|\Google\Protobuf\Internal\RepeatedField $secondary_salespeople + * Optional. Unordered list. The resource names of the secondary salespeople + * associated with the order. Format: + * "networks/{network_code}/users/{user_id}" + * @type array|\Google\Protobuf\Internal\RepeatedField $secondary_traffickers + * Optional. Unordered list. The resource names of the secondary traffickers + * associated with the order. Format: + * "networks/{network_code}/users/{user_id}" + * @type array<\Google\Ads\AdManager\V1\AppliedLabel>|\Google\Protobuf\Internal\RepeatedField $applied_labels + * Optional. The set of labels applied directly to this order. + * @type array<\Google\Ads\AdManager\V1\AppliedLabel>|\Google\Protobuf\Internal\RepeatedField $effective_applied_labels + * Output only. Contains the set of labels applied directly to the order as + * well as those inherited from the company that owns the order. If a label + * has been negated, only the negated label is returned. This field is + * assigned by Google. + * @type array<\Google\Ads\AdManager\V1\CustomFieldValue>|\Google\Protobuf\Internal\RepeatedField $custom_field_values + * Optional. The set of custom field values to this order. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\OrderMessages::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The resource name of the `Order`. + * Format: `networks/{network_code}/orders/{order_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The resource name of the `Order`. + * Format: `networks/{network_code}/orders/{order_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Order ID. + * + * Generated from protobuf field int64 order_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getOrderId() + { + return $this->order_id; + } + + /** + * Output only. Order ID. + * + * Generated from protobuf field int64 order_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setOrderId($var) + { + GPBUtil::checkInt64($var); + $this->order_id = $var; + + return $this; + } + + /** + * Required. The display name of the Order. This value has a maximum length + * of 255 characters. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. The display name of the Order. This value has a maximum length + * of 255 characters. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Optional. Specifies whether or not the Order is a programmatic order. + * + * Generated from protobuf field bool programmatic = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getProgrammatic() + { + return $this->programmatic; + } + + /** + * Optional. Specifies whether or not the Order is a programmatic order. + * + * Generated from protobuf field bool programmatic = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setProgrammatic($var) + { + GPBUtil::checkBool($var); + $this->programmatic = $var; + + return $this; + } + + /** + * Required. The resource name of the User responsible for trafficking the + * Order. Format: "networks/{network_code}/users/{user_id}" + * + * Generated from protobuf field string trafficker = 23 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getTrafficker() + { + return $this->trafficker; + } + + /** + * Required. The resource name of the User responsible for trafficking the + * Order. Format: "networks/{network_code}/users/{user_id}" + * + * Generated from protobuf field string trafficker = 23 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setTrafficker($var) + { + GPBUtil::checkString($var, True); + $this->trafficker = $var; + + return $this; + } + + /** + * Optional. The resource names of Contacts from the advertiser of this Order. + * Format: "networks/{network_code}/contacts/{contact_id}" + * + * Generated from protobuf field repeated string advertiser_contacts = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAdvertiserContacts() + { + return $this->advertiser_contacts; + } + + /** + * Optional. The resource names of Contacts from the advertiser of this Order. + * Format: "networks/{network_code}/contacts/{contact_id}" + * + * Generated from protobuf field repeated string advertiser_contacts = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAdvertiserContacts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->advertiser_contacts = $arr; + + return $this; + } + + /** + * Required. The resource name of the Company, which is of type + * Company.Type.ADVERTISER, to which this order belongs. Format: + * "networks/{network_code}/companies/{company_id}" + * + * Generated from protobuf field string advertiser = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getAdvertiser() + { + return $this->advertiser; + } + + /** + * Required. The resource name of the Company, which is of type + * Company.Type.ADVERTISER, to which this order belongs. Format: + * "networks/{network_code}/companies/{company_id}" + * + * Generated from protobuf field string advertiser = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAdvertiser($var) + { + GPBUtil::checkString($var, True); + $this->advertiser = $var; + + return $this; + } + + /** + * Optional. The resource names of Contacts from the advertising Agency of + * this Order. Format: "networks/{network_code}/contacts/{contact_id}" + * + * Generated from protobuf field repeated string agency_contacts = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAgencyContacts() + { + return $this->agency_contacts; + } + + /** + * Optional. The resource names of Contacts from the advertising Agency of + * this Order. Format: "networks/{network_code}/contacts/{contact_id}" + * + * Generated from protobuf field repeated string agency_contacts = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAgencyContacts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->agency_contacts = $arr; + + return $this; + } + + /** + * Optional. The resource name of the Company, which is of type + * Company.Type.AGENCY, with which this order is associated. Format: + * "networks/{network_code}/companies/{company_id}" + * + * Generated from protobuf field string agency = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getAgency() + { + return $this->agency; + } + + /** + * Optional. The resource name of the Company, which is of type + * Company.Type.AGENCY, with which this order is associated. Format: + * "networks/{network_code}/companies/{company_id}" + * + * Generated from protobuf field string agency = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setAgency($var) + { + GPBUtil::checkString($var, True); + $this->agency = $var; + + return $this; + } + + /** + * Optional. The resource names of Teams directly applied to this Order. + * Format: "networks/{network_code}/teams/{team_id}" + * + * Generated from protobuf field repeated string applied_teams = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAppliedTeams() + { + return $this->applied_teams; + } + + /** + * Optional. The resource names of Teams directly applied to this Order. + * Format: "networks/{network_code}/teams/{team_id}" + * + * Generated from protobuf field repeated string applied_teams = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAppliedTeams($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->applied_teams = $arr; + + return $this; + } + + /** + * Output only. The resource names of Teams applied to this Order including + * inherited values. Format: "networks/{network_code}/teams/{team_id}" + * + * Generated from protobuf field repeated string effective_teams = 28 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEffectiveTeams() + { + return $this->effective_teams; + } + + /** + * Output only. The resource names of Teams applied to this Order including + * inherited values. Format: "networks/{network_code}/teams/{team_id}" + * + * Generated from protobuf field repeated string effective_teams = 28 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEffectiveTeams($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->effective_teams = $arr; + + return $this; + } + + /** + * Output only. The resource name of the User who created the Order on behalf + * of the advertiser. This value is assigned by Google. Format: + * "networks/{network_code}/users/{user_id}" + * + * Generated from protobuf field string creator = 10 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getCreator() + { + return $this->creator; + } + + /** + * Output only. The resource name of the User who created the Order on behalf + * of the advertiser. This value is assigned by Google. Format: + * "networks/{network_code}/users/{user_id}" + * + * Generated from protobuf field string creator = 10 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setCreator($var) + { + GPBUtil::checkString($var, True); + $this->creator = $var; + + return $this; + } + + /** + * Output only. The ISO 4217 3-letter currency code for the currency used by + * the Order. This value is the network's currency code. + * + * Generated from protobuf field string currency_code = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getCurrencyCode() + { + return $this->currency_code; + } + + /** + * Output only. The ISO 4217 3-letter currency code for the currency used by + * the Order. This value is the network's currency code. + * + * Generated from protobuf field string currency_code = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setCurrencyCode($var) + { + GPBUtil::checkString($var, True); + $this->currency_code = $var; + + return $this; + } + + /** + * Output only. The instant at which the Order and its associated line items + * are eligible to begin serving. This attribute is derived from the line item + * of the order that has the earliest LineItem.start_time. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Output only. The instant at which the Order and its associated line items + * are eligible to begin serving. This attribute is derived from the line item + * of the order that has the earliest LineItem.start_time. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Output only. The instant at which the Order and its associated line items + * stop being served. This attribute is derived from the line item of the + * order that has the latest LineItem.end_time. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The instant at which the Order and its associated line items + * stop being served. This attribute is derived from the line item of the + * order that has the latest LineItem.end_time. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. Indicates whether or not this Order has an end time. + * + * Generated from protobuf field bool unlimited_end_time = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getUnlimitedEndTime() + { + return $this->unlimited_end_time; + } + + /** + * Output only. Indicates whether or not this Order has an end time. + * + * Generated from protobuf field bool unlimited_end_time = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setUnlimitedEndTime($var) + { + GPBUtil::checkBool($var); + $this->unlimited_end_time = $var; + + return $this; + } + + /** + * Optional. An arbitrary ID to associate to the Order, which can be used as a + * key to an external system. + * + * Generated from protobuf field int64 external_order_id = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getExternalOrderId() + { + return $this->external_order_id; + } + + /** + * Optional. An arbitrary ID to associate to the Order, which can be used as a + * key to an external system. + * + * Generated from protobuf field int64 external_order_id = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setExternalOrderId($var) + { + GPBUtil::checkInt64($var); + $this->external_order_id = $var; + + return $this; + } + + /** + * Output only. The archival status of the Order. + * + * Generated from protobuf field bool archived = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getArchived() + { + return $this->archived; + } + + /** + * Output only. The archival status of the Order. + * + * Generated from protobuf field bool archived = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setArchived($var) + { + GPBUtil::checkBool($var); + $this->archived = $var; + + return $this; + } + + /** + * Output only. The application which modified this order. This attribute is + * assigned by Google. + * + * Generated from protobuf field string last_modified_by_app = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getLastModifiedByApp() + { + return $this->last_modified_by_app; + } + + /** + * Output only. The application which modified this order. This attribute is + * assigned by Google. + * + * Generated from protobuf field string last_modified_by_app = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setLastModifiedByApp($var) + { + GPBUtil::checkString($var, True); + $this->last_modified_by_app = $var; + + return $this; + } + + /** + * Output only. The instant this Order was last modified. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The instant this Order was last modified. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Optional. Provides any additional notes that may annotate the Order. This + * attribute has a maximum length of 65,535 characters. + * + * Generated from protobuf field string notes = 17 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getNotes() + { + return $this->notes; + } + + /** + * Optional. Provides any additional notes that may annotate the Order. This + * attribute has a maximum length of 65,535 characters. + * + * Generated from protobuf field string notes = 17 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setNotes($var) + { + GPBUtil::checkString($var, True); + $this->notes = $var; + + return $this; + } + + /** + * Optional. The purchase order number for the Order. This value has a maximum + * length of 63 characters. + * + * Generated from protobuf field string po_number = 18 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPoNumber() + { + return $this->po_number; + } + + /** + * Optional. The purchase order number for the Order. This value has a maximum + * length of 63 characters. + * + * Generated from protobuf field string po_number = 18 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPoNumber($var) + { + GPBUtil::checkString($var, True); + $this->po_number = $var; + + return $this; + } + + /** + * Output only. The status of the Order. + * + * Generated from protobuf field .google.ads.admanager.v1.OrderStatusEnum.OrderStatus status = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getStatus() + { + return $this->status; + } + + /** + * Output only. The status of the Order. + * + * Generated from protobuf field .google.ads.admanager.v1.OrderStatusEnum.OrderStatus status = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkEnum($var, \Google\Ads\AdManager\V1\OrderStatusEnum\OrderStatus::class); + $this->status = $var; + + return $this; + } + + /** + * Optional. The resource name of the User responsible for the sales of the + * Order. Format: "networks/{network_code}/users/{user_id}" + * + * Generated from protobuf field string salesperson = 21 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getSalesperson() + { + return $this->salesperson; + } + + /** + * Optional. The resource name of the User responsible for the sales of the + * Order. Format: "networks/{network_code}/users/{user_id}" + * + * Generated from protobuf field string salesperson = 21 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSalesperson($var) + { + GPBUtil::checkString($var, True); + $this->salesperson = $var; + + return $this; + } + + /** + * Optional. Unordered list. The resource names of the secondary salespeople + * associated with the order. Format: + * "networks/{network_code}/users/{user_id}" + * + * Generated from protobuf field repeated string secondary_salespeople = 22 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = UNORDERED_LIST, (.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSecondarySalespeople() + { + return $this->secondary_salespeople; + } + + /** + * Optional. Unordered list. The resource names of the secondary salespeople + * associated with the order. Format: + * "networks/{network_code}/users/{user_id}" + * + * Generated from protobuf field repeated string secondary_salespeople = 22 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = UNORDERED_LIST, (.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSecondarySalespeople($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->secondary_salespeople = $arr; + + return $this; + } + + /** + * Optional. Unordered list. The resource names of the secondary traffickers + * associated with the order. Format: + * "networks/{network_code}/users/{user_id}" + * + * Generated from protobuf field repeated string secondary_traffickers = 24 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = UNORDERED_LIST, (.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSecondaryTraffickers() + { + return $this->secondary_traffickers; + } + + /** + * Optional. Unordered list. The resource names of the secondary traffickers + * associated with the order. Format: + * "networks/{network_code}/users/{user_id}" + * + * Generated from protobuf field repeated string secondary_traffickers = 24 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = UNORDERED_LIST, (.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSecondaryTraffickers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->secondary_traffickers = $arr; + + return $this; + } + + /** + * Optional. The set of labels applied directly to this order. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.AppliedLabel applied_labels = 25 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAppliedLabels() + { + return $this->applied_labels; + } + + /** + * Optional. The set of labels applied directly to this order. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.AppliedLabel applied_labels = 25 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Ads\AdManager\V1\AppliedLabel>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAppliedLabels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\AppliedLabel::class); + $this->applied_labels = $arr; + + return $this; + } + + /** + * Output only. Contains the set of labels applied directly to the order as + * well as those inherited from the company that owns the order. If a label + * has been negated, only the negated label is returned. This field is + * assigned by Google. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.AppliedLabel effective_applied_labels = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEffectiveAppliedLabels() + { + return $this->effective_applied_labels; + } + + /** + * Output only. Contains the set of labels applied directly to the order as + * well as those inherited from the company that owns the order. If a label + * has been negated, only the negated label is returned. This field is + * assigned by Google. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.AppliedLabel effective_applied_labels = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Ads\AdManager\V1\AppliedLabel>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEffectiveAppliedLabels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\AppliedLabel::class); + $this->effective_applied_labels = $arr; + + return $this; + } + + /** + * Optional. The set of custom field values to this order. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.CustomFieldValue custom_field_values = 38 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCustomFieldValues() + { + return $this->custom_field_values; + } + + /** + * Optional. The set of custom field values to this order. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.CustomFieldValue custom_field_values = 38 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Ads\AdManager\V1\CustomFieldValue>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCustomFieldValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\CustomFieldValue::class); + $this->custom_field_values = $arr; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/OrderStatusEnum.php b/AdsAdManager/src/V1/OrderStatusEnum.php new file mode 100644 index 000000000000..4ba75691537a --- /dev/null +++ b/AdsAdManager/src/V1/OrderStatusEnum.php @@ -0,0 +1,34 @@ +google.ads.admanager.v1.OrderStatusEnum + */ +class OrderStatusEnum extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\OrderEnums::initOnce(); + parent::__construct($data); + } + +} + diff --git a/AdsAdManager/src/V1/OrderStatusEnum/OrderStatus.php b/AdsAdManager/src/V1/OrderStatusEnum/OrderStatus.php new file mode 100644 index 000000000000..fa1c3dbeca5f --- /dev/null +++ b/AdsAdManager/src/V1/OrderStatusEnum/OrderStatus.php @@ -0,0 +1,100 @@ +google.ads.admanager.v1.OrderStatusEnum.OrderStatus + */ +class OrderStatus +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum ORDER_STATUS_UNSPECIFIED = 0; + */ + const ORDER_STATUS_UNSPECIFIED = 0; + /** + * Indicates that the Order has just been created but no approval has been + * requested yet. + * + * Generated from protobuf enum DRAFT = 2; + */ + const DRAFT = 2; + /** + * Indicates that a request for approval for the Order has been made. + * + * Generated from protobuf enum PENDING_APPROVAL = 3; + */ + const PENDING_APPROVAL = 3; + /** + * Indicates that the Order has been approved and is ready to serve. + * + * Generated from protobuf enum APPROVED = 4; + */ + const APPROVED = 4; + /** + * Indicates that the Order has been disapproved and is not eligible to + * serve. + * + * Generated from protobuf enum DISAPPROVED = 5; + */ + const DISAPPROVED = 5; + /** + * This is a legacy state. Paused status should be checked on LineItems + * within the order. + * + * Generated from protobuf enum PAUSED = 6; + */ + const PAUSED = 6; + /** + * Indicates that the Order has been canceled and cannot serve. + * + * Generated from protobuf enum CANCELED = 7; + */ + const CANCELED = 7; + /** + * Indicates that the Order has been deleted. + * + * Generated from protobuf enum DELETED = 8; + */ + const DELETED = 8; + + private static $valueToName = [ + self::ORDER_STATUS_UNSPECIFIED => 'ORDER_STATUS_UNSPECIFIED', + self::DRAFT => 'DRAFT', + self::PENDING_APPROVAL => 'PENDING_APPROVAL', + self::APPROVED => 'APPROVED', + self::DISAPPROVED => 'DISAPPROVED', + self::PAUSED => 'PAUSED', + self::CANCELED => 'CANCELED', + self::DELETED => 'DELETED', + ]; + + 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/AdsAdManager/src/V1/Placement.php b/AdsAdManager/src/V1/Placement.php new file mode 100644 index 000000000000..fe7d0b835a1b --- /dev/null +++ b/AdsAdManager/src/V1/Placement.php @@ -0,0 +1,339 @@ +google.ads.admanager.v1.Placement + */ +class Placement extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The resource name of the `Placement`. + * Format: `networks/{network_code}/placements/{placement_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. `Placement` ID. + * + * Generated from protobuf field int64 placement_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $placement_id = 0; + /** + * Required. The display name of the placement. Its maximum length is 255 + * characters. + * + * Generated from protobuf field string display_name = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + /** + * Optional. A description of the Placement. This value is optional and its + * maximum length is 65,535 characters. + * + * Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Output only. A string used to uniquely identify the Placement for purposes + * of serving the ad. This attribute is read-only and is assigned by Google + * when a placement is created. + * + * Generated from protobuf field string placement_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $placement_code = ''; + /** + * Output only. The status of the Placement. This attribute is read-only. + * + * Generated from protobuf field .google.ads.admanager.v1.PlacementStatusEnum.PlacementStatus status = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status = 0; + /** + * Optional. The resource names of AdUnits that constitute the Placement. + * Format: "networks/{network_code}/adUnits/{ad_unit_id}" + * + * Generated from protobuf field repeated string targeted_ad_units = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + private $targeted_ad_units; + /** + * Output only. The instant this Placement was last modified. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The resource name of the `Placement`. + * Format: `networks/{network_code}/placements/{placement_id}` + * @type int|string $placement_id + * Output only. `Placement` ID. + * @type string $display_name + * Required. The display name of the placement. Its maximum length is 255 + * characters. + * @type string $description + * Optional. A description of the Placement. This value is optional and its + * maximum length is 65,535 characters. + * @type string $placement_code + * Output only. A string used to uniquely identify the Placement for purposes + * of serving the ad. This attribute is read-only and is assigned by Google + * when a placement is created. + * @type int $status + * Output only. The status of the Placement. This attribute is read-only. + * @type array|\Google\Protobuf\Internal\RepeatedField $targeted_ad_units + * Optional. The resource names of AdUnits that constitute the Placement. + * Format: "networks/{network_code}/adUnits/{ad_unit_id}" + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The instant this Placement was last modified. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\PlacementMessages::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The resource name of the `Placement`. + * Format: `networks/{network_code}/placements/{placement_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The resource name of the `Placement`. + * Format: `networks/{network_code}/placements/{placement_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. `Placement` ID. + * + * Generated from protobuf field int64 placement_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getPlacementId() + { + return $this->placement_id; + } + + /** + * Output only. `Placement` ID. + * + * Generated from protobuf field int64 placement_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setPlacementId($var) + { + GPBUtil::checkInt64($var); + $this->placement_id = $var; + + return $this; + } + + /** + * Required. The display name of the placement. Its maximum length is 255 + * characters. + * + * Generated from protobuf field string display_name = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. The display name of the placement. Its maximum length is 255 + * characters. + * + * Generated from protobuf field string display_name = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Optional. A description of the Placement. This value is optional and its + * maximum length is 65,535 characters. + * + * Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. A description of the Placement. This value is optional and its + * maximum length is 65,535 characters. + * + * Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. A string used to uniquely identify the Placement for purposes + * of serving the ad. This attribute is read-only and is assigned by Google + * when a placement is created. + * + * Generated from protobuf field string placement_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getPlacementCode() + { + return $this->placement_code; + } + + /** + * Output only. A string used to uniquely identify the Placement for purposes + * of serving the ad. This attribute is read-only and is assigned by Google + * when a placement is created. + * + * Generated from protobuf field string placement_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setPlacementCode($var) + { + GPBUtil::checkString($var, True); + $this->placement_code = $var; + + return $this; + } + + /** + * Output only. The status of the Placement. This attribute is read-only. + * + * Generated from protobuf field .google.ads.admanager.v1.PlacementStatusEnum.PlacementStatus status = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getStatus() + { + return $this->status; + } + + /** + * Output only. The status of the Placement. This attribute is read-only. + * + * Generated from protobuf field .google.ads.admanager.v1.PlacementStatusEnum.PlacementStatus status = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkEnum($var, \Google\Ads\AdManager\V1\PlacementStatusEnum\PlacementStatus::class); + $this->status = $var; + + return $this; + } + + /** + * Optional. The resource names of AdUnits that constitute the Placement. + * Format: "networks/{network_code}/adUnits/{ad_unit_id}" + * + * Generated from protobuf field repeated string targeted_ad_units = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTargetedAdUnits() + { + return $this->targeted_ad_units; + } + + /** + * Optional. The resource names of AdUnits that constitute the Placement. + * Format: "networks/{network_code}/adUnits/{ad_unit_id}" + * + * Generated from protobuf field repeated string targeted_ad_units = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTargetedAdUnits($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->targeted_ad_units = $arr; + + return $this; + } + + /** + * Output only. The instant this Placement was last modified. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The instant this Placement was last modified. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/PlacementStatusEnum.php b/AdsAdManager/src/V1/PlacementStatusEnum.php new file mode 100644 index 000000000000..08bc6de84382 --- /dev/null +++ b/AdsAdManager/src/V1/PlacementStatusEnum.php @@ -0,0 +1,34 @@ +google.ads.admanager.v1.PlacementStatusEnum + */ +class PlacementStatusEnum extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\PlacementEnums::initOnce(); + parent::__construct($data); + } + +} + diff --git a/AdsAdManager/src/V1/PlacementStatusEnum/PlacementStatus.php b/AdsAdManager/src/V1/PlacementStatusEnum/PlacementStatus.php new file mode 100644 index 000000000000..2d158e2c81e5 --- /dev/null +++ b/AdsAdManager/src/V1/PlacementStatusEnum/PlacementStatus.php @@ -0,0 +1,69 @@ +google.ads.admanager.v1.PlacementStatusEnum.PlacementStatus + */ +class PlacementStatus +{ + /** + * Not specified value. + * + * Generated from protobuf enum PLACEMENT_STATUS_UNSPECIFIED = 0; + */ + const PLACEMENT_STATUS_UNSPECIFIED = 0; + /** + * Stats are collected, user-visible. + * + * Generated from protobuf enum ACTIVE = 1; + */ + const ACTIVE = 1; + /** + * No stats collected, not user-visible. + * + * Generated from protobuf enum INACTIVE = 2; + */ + const INACTIVE = 2; + /** + * No stats collected, user-visible. + * + * Generated from protobuf enum ARCHIVED = 3; + */ + const ARCHIVED = 3; + + private static $valueToName = [ + self::PLACEMENT_STATUS_UNSPECIFIED => 'PLACEMENT_STATUS_UNSPECIFIED', + self::ACTIVE => 'ACTIVE', + self::INACTIVE => 'INACTIVE', + self::ARCHIVED => 'ARCHIVED', + ]; + + 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/AdsAdManager/src/V1/Report.php b/AdsAdManager/src/V1/Report.php new file mode 100644 index 000000000000..b8cd8e12c83b --- /dev/null +++ b/AdsAdManager/src/V1/Report.php @@ -0,0 +1,391 @@ +google.ads.admanager.v1.Report + */ +class Report extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The resource name of the report. + * Report resource name have the form: + * `networks/{network_code}/reports/{report_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. Report ID. + * + * Generated from protobuf field int64 report_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $report_id = 0; + /** + * Optional. The visibility of a report. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.Visibility visibility = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $visibility = 0; + /** + * Required. The report definition of the report. + * + * Generated from protobuf field .google.ads.admanager.v1.ReportDefinition report_definition = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $report_definition = null; + /** + * Optional. Display name for the report. + * + * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_name = ''; + /** + * Output only. The instant this report was last modified. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. The instant this report was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The locale of this report. Locale is set from the user's + * locale at the time of the request. Locale can not be modified. + * + * Generated from protobuf field string locale = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $locale = ''; + /** + * Optional. The schedule options of this report. + * + * Generated from protobuf field .google.ads.admanager.v1.ScheduleOptions schedule_options = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $schedule_options = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The resource name of the report. + * Report resource name have the form: + * `networks/{network_code}/reports/{report_id}` + * @type int|string $report_id + * Output only. Report ID. + * @type int $visibility + * Optional. The visibility of a report. + * @type \Google\Ads\AdManager\V1\ReportDefinition $report_definition + * Required. The report definition of the report. + * @type string $display_name + * Optional. Display name for the report. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The instant this report was last modified. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The instant this report was created. + * @type string $locale + * Output only. The locale of this report. Locale is set from the user's + * locale at the time of the request. Locale can not be modified. + * @type \Google\Ads\AdManager\V1\ScheduleOptions $schedule_options + * Optional. The schedule options of this report. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\ReportService::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The resource name of the report. + * Report resource name have the form: + * `networks/{network_code}/reports/{report_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The resource name of the report. + * Report resource name have the form: + * `networks/{network_code}/reports/{report_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Report ID. + * + * Generated from protobuf field int64 report_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getReportId() + { + return $this->report_id; + } + + /** + * Output only. Report ID. + * + * Generated from protobuf field int64 report_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setReportId($var) + { + GPBUtil::checkInt64($var); + $this->report_id = $var; + + return $this; + } + + /** + * Optional. The visibility of a report. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.Visibility visibility = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getVisibility() + { + return $this->visibility; + } + + /** + * Optional. The visibility of a report. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.Visibility visibility = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setVisibility($var) + { + GPBUtil::checkEnum($var, \Google\Ads\AdManager\V1\Report\Visibility::class); + $this->visibility = $var; + + return $this; + } + + /** + * Required. The report definition of the report. + * + * Generated from protobuf field .google.ads.admanager.v1.ReportDefinition report_definition = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Ads\AdManager\V1\ReportDefinition|null + */ + public function getReportDefinition() + { + return $this->report_definition; + } + + public function hasReportDefinition() + { + return isset($this->report_definition); + } + + public function clearReportDefinition() + { + unset($this->report_definition); + } + + /** + * Required. The report definition of the report. + * + * Generated from protobuf field .google.ads.admanager.v1.ReportDefinition report_definition = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Ads\AdManager\V1\ReportDefinition $var + * @return $this + */ + public function setReportDefinition($var) + { + GPBUtil::checkMessage($var, \Google\Ads\AdManager\V1\ReportDefinition::class); + $this->report_definition = $var; + + return $this; + } + + /** + * Optional. Display name for the report. + * + * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Optional. Display name for the report. + * + * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. The instant this report was last modified. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The instant this report was last modified. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. The instant this report was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The instant this report was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The locale of this report. Locale is set from the user's + * locale at the time of the request. Locale can not be modified. + * + * Generated from protobuf field string locale = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getLocale() + { + return $this->locale; + } + + /** + * Output only. The locale of this report. Locale is set from the user's + * locale at the time of the request. Locale can not be modified. + * + * Generated from protobuf field string locale = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setLocale($var) + { + GPBUtil::checkString($var, True); + $this->locale = $var; + + return $this; + } + + /** + * Optional. The schedule options of this report. + * + * Generated from protobuf field .google.ads.admanager.v1.ScheduleOptions schedule_options = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Ads\AdManager\V1\ScheduleOptions|null + */ + public function getScheduleOptions() + { + return $this->schedule_options; + } + + public function hasScheduleOptions() + { + return isset($this->schedule_options); + } + + public function clearScheduleOptions() + { + unset($this->schedule_options); + } + + /** + * Optional. The schedule options of this report. + * + * Generated from protobuf field .google.ads.admanager.v1.ScheduleOptions schedule_options = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Ads\AdManager\V1\ScheduleOptions $var + * @return $this + */ + public function setScheduleOptions($var) + { + GPBUtil::checkMessage($var, \Google\Ads\AdManager\V1\ScheduleOptions::class); + $this->schedule_options = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/Report/DataTable.php b/AdsAdManager/src/V1/Report/DataTable.php new file mode 100644 index 000000000000..753d6b5fecc3 --- /dev/null +++ b/AdsAdManager/src/V1/Report/DataTable.php @@ -0,0 +1,34 @@ +google.ads.admanager.v1.Report.DataTable + */ +class DataTable extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\ReportService::initOnce(); + parent::__construct($data); + } + +} + + diff --git a/AdsAdManager/src/V1/Report/DataTable/MetricValueGroup.php b/AdsAdManager/src/V1/Report/DataTable/MetricValueGroup.php new file mode 100644 index 000000000000..2188d6ab1d43 --- /dev/null +++ b/AdsAdManager/src/V1/Report/DataTable/MetricValueGroup.php @@ -0,0 +1,287 @@ +google.ads.admanager.v1.Report.DataTable.MetricValueGroup + */ +class MetricValueGroup extends \Google\Protobuf\Internal\Message +{ + /** + * Data for the PRIMARY MetricValueType. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Value primary_values = 1; + */ + private $primary_values; + /** + * Data for the PRIMARY_PERCENT_OF_TOTAL MetricValueType. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Value primary_percent_of_total_values = 2; + */ + private $primary_percent_of_total_values; + /** + * Data for the COMPARISON MetricValueType. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Value comparison_values = 3; + */ + private $comparison_values; + /** + * Data for the COMPARISON_PERCENT_OF_TOTAL MetricValueType. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Value comparison_percent_of_total_values = 4; + */ + private $comparison_percent_of_total_values; + /** + * Data for the ABSOLUTE_CHANGE MetricValueType. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Value absolute_change_values = 5; + */ + private $absolute_change_values; + /** + * Data for the RELATIVE_CHANGE MetricValueType. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Value relative_change_values = 6; + */ + private $relative_change_values; + /** + * If true, the flag's conditions are met. If false, the flag's + * conditions are not met. flag_values has the same length as + * flags and index i of flag_values represents the flag at index i + * of flags. + * + * Generated from protobuf field repeated bool flag_values = 7; + */ + private $flag_values; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Ads\AdManager\V1\Report\Value>|\Google\Protobuf\Internal\RepeatedField $primary_values + * Data for the PRIMARY MetricValueType. + * @type array<\Google\Ads\AdManager\V1\Report\Value>|\Google\Protobuf\Internal\RepeatedField $primary_percent_of_total_values + * Data for the PRIMARY_PERCENT_OF_TOTAL MetricValueType. + * @type array<\Google\Ads\AdManager\V1\Report\Value>|\Google\Protobuf\Internal\RepeatedField $comparison_values + * Data for the COMPARISON MetricValueType. + * @type array<\Google\Ads\AdManager\V1\Report\Value>|\Google\Protobuf\Internal\RepeatedField $comparison_percent_of_total_values + * Data for the COMPARISON_PERCENT_OF_TOTAL MetricValueType. + * @type array<\Google\Ads\AdManager\V1\Report\Value>|\Google\Protobuf\Internal\RepeatedField $absolute_change_values + * Data for the ABSOLUTE_CHANGE MetricValueType. + * @type array<\Google\Ads\AdManager\V1\Report\Value>|\Google\Protobuf\Internal\RepeatedField $relative_change_values + * Data for the RELATIVE_CHANGE MetricValueType. + * @type array|\Google\Protobuf\Internal\RepeatedField $flag_values + * If true, the flag's conditions are met. If false, the flag's + * conditions are not met. flag_values has the same length as + * flags and index i of flag_values represents the flag at index i + * of flags. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\ReportService::initOnce(); + parent::__construct($data); + } + + /** + * Data for the PRIMARY MetricValueType. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Value primary_values = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPrimaryValues() + { + return $this->primary_values; + } + + /** + * Data for the PRIMARY MetricValueType. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Value primary_values = 1; + * @param array<\Google\Ads\AdManager\V1\Report\Value>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPrimaryValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\Report\Value::class); + $this->primary_values = $arr; + + return $this; + } + + /** + * Data for the PRIMARY_PERCENT_OF_TOTAL MetricValueType. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Value primary_percent_of_total_values = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPrimaryPercentOfTotalValues() + { + return $this->primary_percent_of_total_values; + } + + /** + * Data for the PRIMARY_PERCENT_OF_TOTAL MetricValueType. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Value primary_percent_of_total_values = 2; + * @param array<\Google\Ads\AdManager\V1\Report\Value>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPrimaryPercentOfTotalValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\Report\Value::class); + $this->primary_percent_of_total_values = $arr; + + return $this; + } + + /** + * Data for the COMPARISON MetricValueType. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Value comparison_values = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getComparisonValues() + { + return $this->comparison_values; + } + + /** + * Data for the COMPARISON MetricValueType. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Value comparison_values = 3; + * @param array<\Google\Ads\AdManager\V1\Report\Value>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setComparisonValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\Report\Value::class); + $this->comparison_values = $arr; + + return $this; + } + + /** + * Data for the COMPARISON_PERCENT_OF_TOTAL MetricValueType. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Value comparison_percent_of_total_values = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getComparisonPercentOfTotalValues() + { + return $this->comparison_percent_of_total_values; + } + + /** + * Data for the COMPARISON_PERCENT_OF_TOTAL MetricValueType. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Value comparison_percent_of_total_values = 4; + * @param array<\Google\Ads\AdManager\V1\Report\Value>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setComparisonPercentOfTotalValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\Report\Value::class); + $this->comparison_percent_of_total_values = $arr; + + return $this; + } + + /** + * Data for the ABSOLUTE_CHANGE MetricValueType. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Value absolute_change_values = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAbsoluteChangeValues() + { + return $this->absolute_change_values; + } + + /** + * Data for the ABSOLUTE_CHANGE MetricValueType. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Value absolute_change_values = 5; + * @param array<\Google\Ads\AdManager\V1\Report\Value>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAbsoluteChangeValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\Report\Value::class); + $this->absolute_change_values = $arr; + + return $this; + } + + /** + * Data for the RELATIVE_CHANGE MetricValueType. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Value relative_change_values = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRelativeChangeValues() + { + return $this->relative_change_values; + } + + /** + * Data for the RELATIVE_CHANGE MetricValueType. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Value relative_change_values = 6; + * @param array<\Google\Ads\AdManager\V1\Report\Value>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRelativeChangeValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\Report\Value::class); + $this->relative_change_values = $arr; + + return $this; + } + + /** + * If true, the flag's conditions are met. If false, the flag's + * conditions are not met. flag_values has the same length as + * flags and index i of flag_values represents the flag at index i + * of flags. + * + * Generated from protobuf field repeated bool flag_values = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFlagValues() + { + return $this->flag_values; + } + + /** + * If true, the flag's conditions are met. If false, the flag's + * conditions are not met. flag_values has the same length as + * flags and index i of flag_values represents the flag at index i + * of flags. + * + * Generated from protobuf field repeated bool flag_values = 7; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFlagValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::BOOL); + $this->flag_values = $arr; + + return $this; + } + +} + + diff --git a/AdsAdManager/src/V1/Report/DataTable/Row.php b/AdsAdManager/src/V1/Report/DataTable/Row.php new file mode 100644 index 000000000000..1894770a3f50 --- /dev/null +++ b/AdsAdManager/src/V1/Report/DataTable/Row.php @@ -0,0 +1,134 @@ +google.ads.admanager.v1.Report.DataTable.Row + */ +class Row extends \Google\Protobuf\Internal\Message +{ + /** + * The order of the dimension values is the same as the order of the + * dimensions specified in the request. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Value dimension_values = 1; + */ + private $dimension_values; + /** + * The length of the metric_value_groups + * field will be equal to the length of the date_ranges field in the + * fetch response. The metric_value_groups field is + * ordered such that each index corresponds to the date_range at the same + * index. For example, given date_ranges [x, y], metric_value_groups will + * have a length of two. The first entry in metric_value_groups represents + * the metrics for date x and the second entry in metric_value_groups + * represents the metrics for date y. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.DataTable.MetricValueGroup metric_value_groups = 2; + */ + private $metric_value_groups; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Ads\AdManager\V1\Report\Value>|\Google\Protobuf\Internal\RepeatedField $dimension_values + * The order of the dimension values is the same as the order of the + * dimensions specified in the request. + * @type array<\Google\Ads\AdManager\V1\Report\DataTable\MetricValueGroup>|\Google\Protobuf\Internal\RepeatedField $metric_value_groups + * The length of the metric_value_groups + * field will be equal to the length of the date_ranges field in the + * fetch response. The metric_value_groups field is + * ordered such that each index corresponds to the date_range at the same + * index. For example, given date_ranges [x, y], metric_value_groups will + * have a length of two. The first entry in metric_value_groups represents + * the metrics for date x and the second entry in metric_value_groups + * represents the metrics for date y. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\ReportService::initOnce(); + parent::__construct($data); + } + + /** + * The order of the dimension values is the same as the order of the + * dimensions specified in the request. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Value dimension_values = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDimensionValues() + { + return $this->dimension_values; + } + + /** + * The order of the dimension values is the same as the order of the + * dimensions specified in the request. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Value dimension_values = 1; + * @param array<\Google\Ads\AdManager\V1\Report\Value>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDimensionValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\Report\Value::class); + $this->dimension_values = $arr; + + return $this; + } + + /** + * The length of the metric_value_groups + * field will be equal to the length of the date_ranges field in the + * fetch response. The metric_value_groups field is + * ordered such that each index corresponds to the date_range at the same + * index. For example, given date_ranges [x, y], metric_value_groups will + * have a length of two. The first entry in metric_value_groups represents + * the metrics for date x and the second entry in metric_value_groups + * represents the metrics for date y. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.DataTable.MetricValueGroup metric_value_groups = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMetricValueGroups() + { + return $this->metric_value_groups; + } + + /** + * The length of the metric_value_groups + * field will be equal to the length of the date_ranges field in the + * fetch response. The metric_value_groups field is + * ordered such that each index corresponds to the date_range at the same + * index. For example, given date_ranges [x, y], metric_value_groups will + * have a length of two. The first entry in metric_value_groups represents + * the metrics for date x and the second entry in metric_value_groups + * represents the metrics for date y. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.DataTable.MetricValueGroup metric_value_groups = 2; + * @param array<\Google\Ads\AdManager\V1\Report\DataTable\MetricValueGroup>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMetricValueGroups($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\Report\DataTable\MetricValueGroup::class); + $this->metric_value_groups = $arr; + + return $this; + } + +} + + diff --git a/AdsAdManager/src/V1/Report/DateRange.php b/AdsAdManager/src/V1/Report/DateRange.php new file mode 100644 index 000000000000..87e60b4346a9 --- /dev/null +++ b/AdsAdManager/src/V1/Report/DateRange.php @@ -0,0 +1,109 @@ +google.ads.admanager.v1.Report.DateRange + */ +class DateRange extends \Google\Protobuf\Internal\Message +{ + protected $date_range_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Ads\AdManager\V1\Report\DateRange\FixedDateRange $fixed + * A fixed date range. + * @type int $relative + * A relative date range. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\ReportService::initOnce(); + parent::__construct($data); + } + + /** + * A fixed date range. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.DateRange.FixedDateRange fixed = 1; + * @return \Google\Ads\AdManager\V1\Report\DateRange\FixedDateRange|null + */ + public function getFixed() + { + return $this->readOneof(1); + } + + public function hasFixed() + { + return $this->hasOneof(1); + } + + /** + * A fixed date range. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.DateRange.FixedDateRange fixed = 1; + * @param \Google\Ads\AdManager\V1\Report\DateRange\FixedDateRange $var + * @return $this + */ + public function setFixed($var) + { + GPBUtil::checkMessage($var, \Google\Ads\AdManager\V1\Report\DateRange\FixedDateRange::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * A relative date range. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.DateRange.RelativeDateRange relative = 2; + * @return int + */ + public function getRelative() + { + return $this->readOneof(2); + } + + public function hasRelative() + { + return $this->hasOneof(2); + } + + /** + * A relative date range. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.DateRange.RelativeDateRange relative = 2; + * @param int $var + * @return $this + */ + public function setRelative($var) + { + GPBUtil::checkEnum($var, \Google\Ads\AdManager\V1\Report\DateRange\RelativeDateRange::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getDateRangeType() + { + return $this->whichOneof("date_range_type"); + } + +} + + diff --git a/AdsAdManager/src/V1/Report/DateRange/FixedDateRange.php b/AdsAdManager/src/V1/Report/DateRange/FixedDateRange.php new file mode 100644 index 000000000000..9cdfe0f4ab53 --- /dev/null +++ b/AdsAdManager/src/V1/Report/DateRange/FixedDateRange.php @@ -0,0 +1,122 @@ +google.ads.admanager.v1.Report.DateRange.FixedDateRange + */ +class FixedDateRange extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The start date of this date range. + * + * Generated from protobuf field .google.type.Date start_date = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $start_date = null; + /** + * Required. The end date (inclusive) of this date range. + * + * Generated from protobuf field .google.type.Date end_date = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $end_date = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Type\Date $start_date + * Required. The start date of this date range. + * @type \Google\Type\Date $end_date + * Required. The end date (inclusive) of this date range. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\ReportService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The start date of this date range. + * + * Generated from protobuf field .google.type.Date start_date = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Type\Date|null + */ + public function getStartDate() + { + return $this->start_date; + } + + public function hasStartDate() + { + return isset($this->start_date); + } + + public function clearStartDate() + { + unset($this->start_date); + } + + /** + * Required. The start date of this date range. + * + * Generated from protobuf field .google.type.Date start_date = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Type\Date $var + * @return $this + */ + public function setStartDate($var) + { + GPBUtil::checkMessage($var, \Google\Type\Date::class); + $this->start_date = $var; + + return $this; + } + + /** + * Required. The end date (inclusive) of this date range. + * + * Generated from protobuf field .google.type.Date end_date = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Type\Date|null + */ + public function getEndDate() + { + return $this->end_date; + } + + public function hasEndDate() + { + return isset($this->end_date); + } + + public function clearEndDate() + { + unset($this->end_date); + } + + /** + * Required. The end date (inclusive) of this date range. + * + * Generated from protobuf field .google.type.Date end_date = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Type\Date $var + * @return $this + */ + public function setEndDate($var) + { + GPBUtil::checkMessage($var, \Google\Type\Date::class); + $this->end_date = $var; + + return $this; + } + +} + + diff --git a/AdsAdManager/src/V1/Report/DateRange/RelativeDateRange.php b/AdsAdManager/src/V1/Report/DateRange/RelativeDateRange.php new file mode 100644 index 000000000000..c896e0fd85c9 --- /dev/null +++ b/AdsAdManager/src/V1/Report/DateRange/RelativeDateRange.php @@ -0,0 +1,276 @@ +google.ads.admanager.v1.Report.DateRange.RelativeDateRange + */ +class RelativeDateRange +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum RELATIVE_DATE_RANGE_UNSPECIFIED = 0; + */ + const RELATIVE_DATE_RANGE_UNSPECIFIED = 0; + /** + * The date the report is run. + * + * Generated from protobuf enum TODAY = 1; + */ + const TODAY = 1; + /** + * The date a day before the date that the report is run. + * + * Generated from protobuf enum YESTERDAY = 2; + */ + const YESTERDAY = 2; + /** + * The full week in which this report is run. Could include dates in + * the future. + * + * Generated from protobuf enum THIS_WEEK = 3; + */ + const THIS_WEEK = 3; + /** + * From the beginning of the calendar week (Monday to Sunday) in which the + * up to and including the day the report is run. + * + * Generated from protobuf enum THIS_WEEK_TO_DATE = 29; + */ + const THIS_WEEK_TO_DATE = 29; + /** + * The full month in which this report is run. Could include dates in + * the future. + * + * Generated from protobuf enum THIS_MONTH = 4; + */ + const THIS_MONTH = 4; + /** + * From the beginning of the calendar month in which the report is run, to + * up to and including the day the report is run. + * + * Generated from protobuf enum THIS_MONTH_TO_DATE = 26; + */ + const THIS_MONTH_TO_DATE = 26; + /** + * The full quarter in which this report is run. Could include dates + * in the future. + * + * Generated from protobuf enum THIS_QUARTER = 5; + */ + const THIS_QUARTER = 5; + /** + * From the beginning of the calendar quarter in which the report is run, + * up to and including the day the report is run. + * + * Generated from protobuf enum THIS_QUARTER_TO_DATE = 27; + */ + const THIS_QUARTER_TO_DATE = 27; + /** + * The full year in which this report is run. Could include dates in + * the future. + * + * Generated from protobuf enum THIS_YEAR = 6; + */ + const THIS_YEAR = 6; + /** + * From the beginning of the calendar year in which the report is run, to + * up to and including the day the report is run. + * + * Generated from protobuf enum THIS_YEAR_TO_DATE = 28; + */ + const THIS_YEAR_TO_DATE = 28; + /** + * The entire previous calendar week, Monday to Sunday (inclusive), + * preceding the calendar week the report is run. + * + * Generated from protobuf enum LAST_WEEK = 7; + */ + const LAST_WEEK = 7; + /** + * The entire previous calendar month preceding the calendar month the + * report is run. + * + * Generated from protobuf enum LAST_MONTH = 8; + */ + const LAST_MONTH = 8; + /** + * The entire previous calendar quarter preceding the calendar quarter the + * report is run. + * + * Generated from protobuf enum LAST_QUARTER = 9; + */ + const LAST_QUARTER = 9; + /** + * The entire previous calendar year preceding the calendar year the + * report is run. + * + * Generated from protobuf enum LAST_YEAR = 10; + */ + const LAST_YEAR = 10; + /** + * The 7 days preceding the day the report is run. + * + * Generated from protobuf enum LAST_7_DAYS = 11; + */ + const LAST_7_DAYS = 11; + /** + * The 30 days preceding the day the report is run. + * + * Generated from protobuf enum LAST_30_DAYS = 12; + */ + const LAST_30_DAYS = 12; + /** + * The 60 days preceding the day the report is run. + * + * Generated from protobuf enum LAST_60_DAYS = 13; + */ + const LAST_60_DAYS = 13; + /** + * The 90 days preceding the day the report is run. + * + * Generated from protobuf enum LAST_90_DAYS = 14; + */ + const LAST_90_DAYS = 14; + /** + * The 180 days preceding the day the report is run. + * + * Generated from protobuf enum LAST_180_DAYS = 15; + */ + const LAST_180_DAYS = 15; + /** + * The 360 days preceding the day the report is run. + * + * Generated from protobuf enum LAST_360_DAYS = 16; + */ + const LAST_360_DAYS = 16; + /** + * The 365 days preceding the day the report is run. + * + * Generated from protobuf enum LAST_365_DAYS = 17; + */ + const LAST_365_DAYS = 17; + /** + * The entire previous 3 calendar months preceding the calendar month the + * report is run. + * + * Generated from protobuf enum LAST_3_MONTHS = 18; + */ + const LAST_3_MONTHS = 18; + /** + * The entire previous 6 calendar months preceding the calendar month the + * report is run. + * + * Generated from protobuf enum LAST_6_MONTHS = 19; + */ + const LAST_6_MONTHS = 19; + /** + * The entire previous 6 calendar months preceding the calendar month the + * report is run. + * + * Generated from protobuf enum LAST_12_MONTHS = 20; + */ + const LAST_12_MONTHS = 20; + /** + * From 3 years before the report is run, to the day before the report is + * run, inclusive. + * + * Generated from protobuf enum ALL_AVAILABLE = 21; + */ + const ALL_AVAILABLE = 21; + /** + * Only valid when used in the comparison_date_range field. The complete + * period preceding the date period provided in date_range. + * In the case where date_range is a FixedDateRange of N days, this will + * be a period of N days where the end date is the date preceding the + * start date of the date_range. + * In the case where date_range is a RelativeDateRange, this will be a + * period of the same time frame preceding the date_range. In the case + * where the date_range does not capture the full period because a report + * is run in the middle of that period, this will still be the full + * preceding period. For example, if date_range is THIS_WEEK, but the + * report is run on a Wednesday, THIS_WEEK will be Monday - Wednesday, but + * PREVIOUS_PERIOD will be Monday - Sunday. + * + * Generated from protobuf enum PREVIOUS_PERIOD = 22; + */ + const PREVIOUS_PERIOD = 22; + /** + * Only valid when used in the comparison_date_range field. The period + * starting 1 year prior to the date period provided in date_range. + * In the case where date_range is a FixedDateRange, this will be a date + * range starting 1 year prior to the date_range start date and ending 1 + * year prior to the date_range end date. + * In the case where date_range is a RelativeDateRange, this will be a + * period of the same time frame exactly 1 year prior to the date_range. + * In the case where the date_range does not capture the full period + * because a report is run in the middle of that period, this will still + * be the full period 1 year prior. For example, if date range is + * THIS_WEEK, but the report is run on a Wednesday, THIS_WEEK will be + * Monday - Wednesday, but SAME_PERIOD_PREVIOUS_YEAR will be Monday - + * Sunday. + * + * Generated from protobuf enum SAME_PERIOD_PREVIOUS_YEAR = 24; + */ + const SAME_PERIOD_PREVIOUS_YEAR = 24; + + private static $valueToName = [ + self::RELATIVE_DATE_RANGE_UNSPECIFIED => 'RELATIVE_DATE_RANGE_UNSPECIFIED', + self::TODAY => 'TODAY', + self::YESTERDAY => 'YESTERDAY', + self::THIS_WEEK => 'THIS_WEEK', + self::THIS_WEEK_TO_DATE => 'THIS_WEEK_TO_DATE', + self::THIS_MONTH => 'THIS_MONTH', + self::THIS_MONTH_TO_DATE => 'THIS_MONTH_TO_DATE', + self::THIS_QUARTER => 'THIS_QUARTER', + self::THIS_QUARTER_TO_DATE => 'THIS_QUARTER_TO_DATE', + self::THIS_YEAR => 'THIS_YEAR', + self::THIS_YEAR_TO_DATE => 'THIS_YEAR_TO_DATE', + self::LAST_WEEK => 'LAST_WEEK', + self::LAST_MONTH => 'LAST_MONTH', + self::LAST_QUARTER => 'LAST_QUARTER', + self::LAST_YEAR => 'LAST_YEAR', + self::LAST_7_DAYS => 'LAST_7_DAYS', + self::LAST_30_DAYS => 'LAST_30_DAYS', + self::LAST_60_DAYS => 'LAST_60_DAYS', + self::LAST_90_DAYS => 'LAST_90_DAYS', + self::LAST_180_DAYS => 'LAST_180_DAYS', + self::LAST_360_DAYS => 'LAST_360_DAYS', + self::LAST_365_DAYS => 'LAST_365_DAYS', + self::LAST_3_MONTHS => 'LAST_3_MONTHS', + self::LAST_6_MONTHS => 'LAST_6_MONTHS', + self::LAST_12_MONTHS => 'LAST_12_MONTHS', + self::ALL_AVAILABLE => 'ALL_AVAILABLE', + self::PREVIOUS_PERIOD => 'PREVIOUS_PERIOD', + self::SAME_PERIOD_PREVIOUS_YEAR => 'SAME_PERIOD_PREVIOUS_YEAR', + ]; + + 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/AdsAdManager/src/V1/Report/Dimension.php b/AdsAdManager/src/V1/Report/Dimension.php new file mode 100644 index 000000000000..c9d11ec8cb70 --- /dev/null +++ b/AdsAdManager/src/V1/Report/Dimension.php @@ -0,0 +1,4169 @@ +google.ads.admanager.v1.Report.Dimension + */ +class Dimension +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum DIMENSION_UNSPECIFIED = 0; + */ + const DIMENSION_UNSPECIFIED = 0; + /** + * The domain name of the advertiser. + * + * Generated from protobuf enum ADVERTISER_DOMAIN_NAME = 242; + */ + const ADVERTISER_DOMAIN_NAME = 242; + /** + * The ID used in an external system for advertiser identification + * + * Generated from protobuf enum ADVERTISER_EXTERNAL_ID = 228; + */ + const ADVERTISER_EXTERNAL_ID = 228; + /** + * The ID of an advertiser company assigned to an order + * + * Generated from protobuf enum ADVERTISER_ID = 131; + */ + const ADVERTISER_ID = 131; + /** + * Labels applied to the advertiser + * can be used for either competitive exclusion or ad exclusion + * + * Generated from protobuf enum ADVERTISER_LABELS = 230; + */ + const ADVERTISER_LABELS = 230; + /** + * Label ids applied to the advertiser + * can be used for either competitive exclusion or ad exclusion + * + * Generated from protobuf enum ADVERTISER_LABEL_IDS = 229; + */ + const ADVERTISER_LABEL_IDS = 229; + /** + * The name of an advertiser company assigned to an order + * + * Generated from protobuf enum ADVERTISER_NAME = 132; + */ + const ADVERTISER_NAME = 132; + /** + * The name of the contact associated with an advertiser company + * + * Generated from protobuf enum ADVERTISER_PRIMARY_CONTACT = 227; + */ + const ADVERTISER_PRIMARY_CONTACT = 227; + /** + * Shows an ENUM value describing whether a given piece of publisher + * inventory was above (ATF) or below the fold (BTF) of a page. + * + * Generated from protobuf enum AD_LOCATION = 390; + */ + const AD_LOCATION = 390; + /** + * Shows a localized string describing whether a given piece of publisher + * inventory was above (ATF) or below the fold (BTF) of a page. + * + * Generated from protobuf enum AD_LOCATION_NAME = 391; + */ + const AD_LOCATION_NAME = 391; + /** + * The code of the ad unit where the ad was requested. + * + * Generated from protobuf enum AD_UNIT_CODE = 64; + */ + const AD_UNIT_CODE = 64; + /** + * The code of the first level ad unit of the ad unit where the ad was + * requested. + * + * Generated from protobuf enum AD_UNIT_CODE_LEVEL_1 = 65; + */ + const AD_UNIT_CODE_LEVEL_1 = 65; + /** + * The code of the tenth level ad unit of the ad unit where the ad was + * requested. + * + * Generated from protobuf enum AD_UNIT_CODE_LEVEL_10 = 74; + */ + const AD_UNIT_CODE_LEVEL_10 = 74; + /** + * The code of the eleventh level ad unit of the ad unit where the ad was + * requested. + * + * Generated from protobuf enum AD_UNIT_CODE_LEVEL_11 = 75; + */ + const AD_UNIT_CODE_LEVEL_11 = 75; + /** + * The code of the twelfth level ad unit of the ad unit where the ad was + * requested. + * + * Generated from protobuf enum AD_UNIT_CODE_LEVEL_12 = 76; + */ + const AD_UNIT_CODE_LEVEL_12 = 76; + /** + * The code of the thirteenth level ad unit of the ad unit where the ad was + * requested. + * + * Generated from protobuf enum AD_UNIT_CODE_LEVEL_13 = 77; + */ + const AD_UNIT_CODE_LEVEL_13 = 77; + /** + * The code of the fourteenth level ad unit of the ad unit where the ad was + * requested. + * + * Generated from protobuf enum AD_UNIT_CODE_LEVEL_14 = 78; + */ + const AD_UNIT_CODE_LEVEL_14 = 78; + /** + * The code of the fifteenth level ad unit of the ad unit where the ad was + * requested. + * + * Generated from protobuf enum AD_UNIT_CODE_LEVEL_15 = 79; + */ + const AD_UNIT_CODE_LEVEL_15 = 79; + /** + * The code of the sixteenth level ad unit of the ad unit where the ad was + * requested. + * + * Generated from protobuf enum AD_UNIT_CODE_LEVEL_16 = 80; + */ + const AD_UNIT_CODE_LEVEL_16 = 80; + /** + * The code of the second level ad unit of the ad unit where the ad was + * requested. + * + * Generated from protobuf enum AD_UNIT_CODE_LEVEL_2 = 66; + */ + const AD_UNIT_CODE_LEVEL_2 = 66; + /** + * The code of the third level ad unit of the ad unit where the ad was + * requested. + * + * Generated from protobuf enum AD_UNIT_CODE_LEVEL_3 = 67; + */ + const AD_UNIT_CODE_LEVEL_3 = 67; + /** + * The code of the fourth level ad unit of the ad unit where the ad was + * requested. + * + * Generated from protobuf enum AD_UNIT_CODE_LEVEL_4 = 68; + */ + const AD_UNIT_CODE_LEVEL_4 = 68; + /** + * The code of the fifth level ad unit of the ad unit where the ad was + * requested. + * + * Generated from protobuf enum AD_UNIT_CODE_LEVEL_5 = 69; + */ + const AD_UNIT_CODE_LEVEL_5 = 69; + /** + * The code of the sixth level ad unit of the ad unit where the ad was + * requested. + * + * Generated from protobuf enum AD_UNIT_CODE_LEVEL_6 = 70; + */ + const AD_UNIT_CODE_LEVEL_6 = 70; + /** + * The code of the seventh level ad unit of the ad unit where the ad was + * requested. + * + * Generated from protobuf enum AD_UNIT_CODE_LEVEL_7 = 71; + */ + const AD_UNIT_CODE_LEVEL_7 = 71; + /** + * The code of the eighth level ad unit of the ad unit where the ad was + * requested. + * + * Generated from protobuf enum AD_UNIT_CODE_LEVEL_8 = 72; + */ + const AD_UNIT_CODE_LEVEL_8 = 72; + /** + * The code of the ninth level ad unit of the ad unit where the ad was + * requested. + * + * Generated from protobuf enum AD_UNIT_CODE_LEVEL_9 = 73; + */ + const AD_UNIT_CODE_LEVEL_9 = 73; + /** + * The depth of the ad unit's hierarchy + * + * Generated from protobuf enum AD_UNIT_DEPTH = 101; + */ + const AD_UNIT_DEPTH = 101; + /** + * The ID of the ad unit where the ad was requested. + * + * Generated from protobuf enum AD_UNIT_ID = 25; + */ + const AD_UNIT_ID = 25; + /** + * The full hierarchy of ad unit IDs where the ad was requested, from + * root to leaf, excluding the root ad unit ID. + * + * Generated from protobuf enum AD_UNIT_ID_ALL_LEVEL = 27; + */ + const AD_UNIT_ID_ALL_LEVEL = 27; + /** + * The first level ad unit ID of the ad unit where the ad was requested. + * + * Generated from protobuf enum AD_UNIT_ID_LEVEL_1 = 30; + */ + const AD_UNIT_ID_LEVEL_1 = 30; + /** + * The tenth level ad unit ID of the ad unit where the ad was requested. + * + * Generated from protobuf enum AD_UNIT_ID_LEVEL_10 = 48; + */ + const AD_UNIT_ID_LEVEL_10 = 48; + /** + * The eleventh level ad unit ID of the ad unit where the ad was requested. + * + * Generated from protobuf enum AD_UNIT_ID_LEVEL_11 = 50; + */ + const AD_UNIT_ID_LEVEL_11 = 50; + /** + * The twelfth level ad unit ID of the ad unit where the ad was requested. + * + * Generated from protobuf enum AD_UNIT_ID_LEVEL_12 = 52; + */ + const AD_UNIT_ID_LEVEL_12 = 52; + /** + * The thirteenth level ad unit ID of the ad unit where the ad was + * requested. + * + * Generated from protobuf enum AD_UNIT_ID_LEVEL_13 = 54; + */ + const AD_UNIT_ID_LEVEL_13 = 54; + /** + * The fourteenth level ad unit ID of the ad unit where the ad was + * requested. + * + * Generated from protobuf enum AD_UNIT_ID_LEVEL_14 = 56; + */ + const AD_UNIT_ID_LEVEL_14 = 56; + /** + * The fifteenth level ad unit ID of the ad unit where the ad was requested. + * + * Generated from protobuf enum AD_UNIT_ID_LEVEL_15 = 58; + */ + const AD_UNIT_ID_LEVEL_15 = 58; + /** + * The sixteenth level ad unit ID of the ad unit where the ad was requested. + * + * Generated from protobuf enum AD_UNIT_ID_LEVEL_16 = 60; + */ + const AD_UNIT_ID_LEVEL_16 = 60; + /** + * The second level ad unit ID of the ad unit where the ad was requested. + * + * Generated from protobuf enum AD_UNIT_ID_LEVEL_2 = 32; + */ + const AD_UNIT_ID_LEVEL_2 = 32; + /** + * The third level ad unit ID of the ad unit where the ad was requested. + * + * Generated from protobuf enum AD_UNIT_ID_LEVEL_3 = 34; + */ + const AD_UNIT_ID_LEVEL_3 = 34; + /** + * The fourth level ad unit ID of the ad unit where the ad was requested. + * + * Generated from protobuf enum AD_UNIT_ID_LEVEL_4 = 36; + */ + const AD_UNIT_ID_LEVEL_4 = 36; + /** + * The fifth level ad unit ID of the ad unit where the ad was requested. + * + * Generated from protobuf enum AD_UNIT_ID_LEVEL_5 = 38; + */ + const AD_UNIT_ID_LEVEL_5 = 38; + /** + * The sixth level ad unit ID of the ad unit where the ad was requested. + * + * Generated from protobuf enum AD_UNIT_ID_LEVEL_6 = 40; + */ + const AD_UNIT_ID_LEVEL_6 = 40; + /** + * The seventh level ad unit ID of the ad unit where the ad was requested. + * + * Generated from protobuf enum AD_UNIT_ID_LEVEL_7 = 42; + */ + const AD_UNIT_ID_LEVEL_7 = 42; + /** + * The eighth level ad unit ID of the ad unit where the ad was requested. + * + * Generated from protobuf enum AD_UNIT_ID_LEVEL_8 = 44; + */ + const AD_UNIT_ID_LEVEL_8 = 44; + /** + * The ninth level ad unit ID of the ad unit where the ad was requested. + * + * Generated from protobuf enum AD_UNIT_ID_LEVEL_9 = 46; + */ + const AD_UNIT_ID_LEVEL_9 = 46; + /** + * The top-level ad unit ID of the ad unit where the ad was requested. + * + * Generated from protobuf enum AD_UNIT_ID_TOP_LEVEL = 142; + */ + const AD_UNIT_ID_TOP_LEVEL = 142; + /** + * The name of the ad unit where the ad was requested. + * + * Generated from protobuf enum AD_UNIT_NAME = 26; + */ + const AD_UNIT_NAME = 26; + /** + * The full hierarchy of ad unit names where the ad was requested, from + * root to leaf, excluding the root ad unit name. + * + * Generated from protobuf enum AD_UNIT_NAME_ALL_LEVEL = 29; + */ + const AD_UNIT_NAME_ALL_LEVEL = 29; + /** + * The first level ad unit name of the ad unit where the ad was requested. + * + * Generated from protobuf enum AD_UNIT_NAME_LEVEL_1 = 31; + */ + const AD_UNIT_NAME_LEVEL_1 = 31; + /** + * The tenth level ad unit name of the ad unit where the ad was requested. + * + * Generated from protobuf enum AD_UNIT_NAME_LEVEL_10 = 49; + */ + const AD_UNIT_NAME_LEVEL_10 = 49; + /** + * The eleventh level ad unit name of the ad unit where the ad was + * requested. + * + * Generated from protobuf enum AD_UNIT_NAME_LEVEL_11 = 51; + */ + const AD_UNIT_NAME_LEVEL_11 = 51; + /** + * The twelfth level ad unit name of the ad unit where the ad was requested. + * + * Generated from protobuf enum AD_UNIT_NAME_LEVEL_12 = 53; + */ + const AD_UNIT_NAME_LEVEL_12 = 53; + /** + * The thirteenth level ad unit name of the ad unit where the ad was + * requested. + * + * Generated from protobuf enum AD_UNIT_NAME_LEVEL_13 = 55; + */ + const AD_UNIT_NAME_LEVEL_13 = 55; + /** + * The fourteenth level ad unit name of the ad unit where the ad was + * requested. + * + * Generated from protobuf enum AD_UNIT_NAME_LEVEL_14 = 57; + */ + const AD_UNIT_NAME_LEVEL_14 = 57; + /** + * The fifteenth level ad unit name of the ad unit where the ad was + * requested. + * + * Generated from protobuf enum AD_UNIT_NAME_LEVEL_15 = 59; + */ + const AD_UNIT_NAME_LEVEL_15 = 59; + /** + * The sixteenth level ad unit name of the ad unit where the ad was + * requested. + * + * Generated from protobuf enum AD_UNIT_NAME_LEVEL_16 = 61; + */ + const AD_UNIT_NAME_LEVEL_16 = 61; + /** + * The second level ad unit name of the ad unit where the ad was requested. + * + * Generated from protobuf enum AD_UNIT_NAME_LEVEL_2 = 33; + */ + const AD_UNIT_NAME_LEVEL_2 = 33; + /** + * The third level ad unit name of the ad unit where the ad was requested. + * + * Generated from protobuf enum AD_UNIT_NAME_LEVEL_3 = 35; + */ + const AD_UNIT_NAME_LEVEL_3 = 35; + /** + * The fourth level ad unit name of the ad unit where the ad was requested. + * + * Generated from protobuf enum AD_UNIT_NAME_LEVEL_4 = 37; + */ + const AD_UNIT_NAME_LEVEL_4 = 37; + /** + * The fifth level ad unit name of the ad unit where the ad was requested. + * + * Generated from protobuf enum AD_UNIT_NAME_LEVEL_5 = 39; + */ + const AD_UNIT_NAME_LEVEL_5 = 39; + /** + * The sixth level ad unit name of the ad unit where the ad was requested. + * + * Generated from protobuf enum AD_UNIT_NAME_LEVEL_6 = 41; + */ + const AD_UNIT_NAME_LEVEL_6 = 41; + /** + * The seventh level ad unit name of the ad unit where the ad was requested. + * + * Generated from protobuf enum AD_UNIT_NAME_LEVEL_7 = 43; + */ + const AD_UNIT_NAME_LEVEL_7 = 43; + /** + * The eighth level ad unit name of the ad unit where the ad was requested. + * + * Generated from protobuf enum AD_UNIT_NAME_LEVEL_8 = 45; + */ + const AD_UNIT_NAME_LEVEL_8 = 45; + /** + * The ninth level ad unit name of the ad unit where the ad was requested. + * + * Generated from protobuf enum AD_UNIT_NAME_LEVEL_9 = 47; + */ + const AD_UNIT_NAME_LEVEL_9 = 47; + /** + * The top-level ad unit name of the ad unit where the ad was requested. + * + * Generated from protobuf enum AD_UNIT_NAME_TOP_LEVEL = 143; + */ + const AD_UNIT_NAME_TOP_LEVEL = 143; + /** + * The reward amount of the ad unit where the ad was requested. + * + * Generated from protobuf enum AD_UNIT_REWARD_AMOUNT = 63; + */ + const AD_UNIT_REWARD_AMOUNT = 63; + /** + * The reward type of the ad unit where the ad was requested. + * + * Generated from protobuf enum AD_UNIT_REWARD_TYPE = 62; + */ + const AD_UNIT_REWARD_TYPE = 62; + /** + * The status of the ad unit + * + * Generated from protobuf enum AD_UNIT_STATUS = 206; + */ + const AD_UNIT_STATUS = 206; + /** + * The name of the status of the ad unit + * + * Generated from protobuf enum AD_UNIT_STATUS_NAME = 207; + */ + const AD_UNIT_STATUS_NAME = 207; + /** + * The app version. + * + * Generated from protobuf enum APP_VERSION = 392; + */ + const APP_VERSION = 392; + /** + * The ID used in an external system for advertiser identification + * + * Generated from protobuf enum BACKFILL_ADVERTISER_EXTERNAL_ID = 349; + */ + const BACKFILL_ADVERTISER_EXTERNAL_ID = 349; + /** + * The ID of an advertiser company assigned to a backfill order + * + * Generated from protobuf enum BACKFILL_ADVERTISER_ID = 346; + */ + const BACKFILL_ADVERTISER_ID = 346; + /** + * Labels applied to the advertiser + * can be used for either competitive exclusion or ad exclusion + * + * Generated from protobuf enum BACKFILL_ADVERTISER_LABELS = 351; + */ + const BACKFILL_ADVERTISER_LABELS = 351; + /** + * Label ids applied to the advertiser + * can be used for either competitive exclusion or ad exclusion + * + * Generated from protobuf enum BACKFILL_ADVERTISER_LABEL_IDS = 350; + */ + const BACKFILL_ADVERTISER_LABEL_IDS = 350; + /** + * The name of an advertiser company assigned to a backfill order + * + * Generated from protobuf enum BACKFILL_ADVERTISER_NAME = 347; + */ + const BACKFILL_ADVERTISER_NAME = 347; + /** + * The name of the contact associated with an advertiser company + * + * Generated from protobuf enum BACKFILL_ADVERTISER_PRIMARY_CONTACT = 348; + */ + const BACKFILL_ADVERTISER_PRIMARY_CONTACT = 348; + /** + * Enum value of Backfill creative billing type + * + * Generated from protobuf enum BACKFILL_CREATIVE_BILLING_TYPE = 378; + */ + const BACKFILL_CREATIVE_BILLING_TYPE = 378; + /** + * Localized string value of Backfill creative billing type + * + * Generated from protobuf enum BACKFILL_CREATIVE_BILLING_TYPE_NAME = 379; + */ + const BACKFILL_CREATIVE_BILLING_TYPE_NAME = 379; + /** + * Represents the click-through URL of a Backfill creative + * + * Generated from protobuf enum BACKFILL_CREATIVE_CLICK_THROUGH_URL = 376; + */ + const BACKFILL_CREATIVE_CLICK_THROUGH_URL = 376; + /** + * The ID of a Backfill creative + * + * Generated from protobuf enum BACKFILL_CREATIVE_ID = 370; + */ + const BACKFILL_CREATIVE_ID = 370; + /** + * Backfill creative name + * + * Generated from protobuf enum BACKFILL_CREATIVE_NAME = 371; + */ + const BACKFILL_CREATIVE_NAME = 371; + /** + * Third party vendor name of a Backfill creative + * + * Generated from protobuf enum BACKFILL_CREATIVE_THIRD_PARTY_VENDOR = 377; + */ + const BACKFILL_CREATIVE_THIRD_PARTY_VENDOR = 377; + /** + * Enum value of Backfill creative type + * + * Generated from protobuf enum BACKFILL_CREATIVE_TYPE = 374; + */ + const BACKFILL_CREATIVE_TYPE = 374; + /** + * Localized string name of Backfill creative type + * + * Generated from protobuf enum BACKFILL_CREATIVE_TYPE_NAME = 375; + */ + const BACKFILL_CREATIVE_TYPE_NAME = 375; + /** + * Whether a Backfill line item is archived. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_ARCHIVED = 278; + */ + const BACKFILL_LINE_ITEM_ARCHIVED = 278; + /** + * Backfill line item comanion delivery option ENUM value. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_COMPANION_DELIVERY_OPTION = 258; + */ + const BACKFILL_LINE_ITEM_COMPANION_DELIVERY_OPTION = 258; + /** + * Localized Backfill line item comanion delivery option name. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_COMPANION_DELIVERY_OPTION_NAME = 259; + */ + const BACKFILL_LINE_ITEM_COMPANION_DELIVERY_OPTION_NAME = 259; + /** + * The computed status of the BackfillLineItem. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_COMPUTED_STATUS = 296; + */ + const BACKFILL_LINE_ITEM_COMPUTED_STATUS = 296; + /** + * The localized name of the computed status of the BackfillLineItem. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_COMPUTED_STATUS_NAME = 297; + */ + const BACKFILL_LINE_ITEM_COMPUTED_STATUS_NAME = 297; + /** + * The contracted units bought for the Backfill line item. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_CONTRACTED_QUANTITY = 280; + */ + const BACKFILL_LINE_ITEM_CONTRACTED_QUANTITY = 280; + /** + * The cost per unit of the Backfill line item. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_COST_PER_UNIT = 272; + */ + const BACKFILL_LINE_ITEM_COST_PER_UNIT = 272; + /** + * Backfill line item cost type ENUM value. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_COST_TYPE = 264; + */ + const BACKFILL_LINE_ITEM_COST_TYPE = 264; + /** + * Localized Backfill line item cost type name. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_COST_TYPE_NAME = 265; + */ + const BACKFILL_LINE_ITEM_COST_TYPE_NAME = 265; + /** + * Represent the end date of a Backfill creative associated with a Backfill + * line item + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_CREATIVE_END_DATE = 381; + */ + const BACKFILL_LINE_ITEM_CREATIVE_END_DATE = 381; + /** + * The creative rotation type of the BackfillLineItem. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_CREATIVE_ROTATION_TYPE = 290; + */ + const BACKFILL_LINE_ITEM_CREATIVE_ROTATION_TYPE = 290; + /** + * The localized name of the creative rotation type of the BackfillLineItem. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_CREATIVE_ROTATION_TYPE_NAME = 291; + */ + const BACKFILL_LINE_ITEM_CREATIVE_ROTATION_TYPE_NAME = 291; + /** + * Represent the start date of a Backfill creative associated with a + * Backfill line item + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_CREATIVE_START_DATE = 380; + */ + const BACKFILL_LINE_ITEM_CREATIVE_START_DATE = 380; + /** + * The 3 letter currency code of the Backfill line item + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_CURRENCY_CODE = 288; + */ + const BACKFILL_LINE_ITEM_CURRENCY_CODE = 288; + /** + * The progress made for the delivery of the Backfill line item. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_DELIVERY_INDICATOR = 274; + */ + const BACKFILL_LINE_ITEM_DELIVERY_INDICATOR = 274; + /** + * The delivery rate type of the BackfillLineItem. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_DELIVERY_RATE_TYPE = 292; + */ + const BACKFILL_LINE_ITEM_DELIVERY_RATE_TYPE = 292; + /** + * The localized name of the delivery rate type of the BackfillLineItem. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_DELIVERY_RATE_TYPE_NAME = 293; + */ + const BACKFILL_LINE_ITEM_DELIVERY_RATE_TYPE_NAME = 293; + /** + * The discount of the BackfillLineItem in whole units in the + * BackfillLineItem's currency code, or if unspecified the Network's + * currency code. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_DISCOUNT_ABSOLUTE = 294; + */ + const BACKFILL_LINE_ITEM_DISCOUNT_ABSOLUTE = 294; + /** + * The discount of the BackfillLineItem in percentage. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_DISCOUNT_PERCENTAGE = 295; + */ + const BACKFILL_LINE_ITEM_DISCOUNT_PERCENTAGE = 295; + /** + * The end date of the Backfill line item. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_END_DATE = 267; + */ + const BACKFILL_LINE_ITEM_END_DATE = 267; + /** + * The end date and time of the Backfill line item. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_END_DATE_TIME = 269; + */ + const BACKFILL_LINE_ITEM_END_DATE_TIME = 269; + /** + * The ENUM value of the environment a Backfill line item is targeting. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_ENVIRONMENT_TYPE = 302; + */ + const BACKFILL_LINE_ITEM_ENVIRONMENT_TYPE = 302; + /** + * The localized name of the environment a Backfill line item is targeting. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_ENVIRONMENT_TYPE_NAME = 257; + */ + const BACKFILL_LINE_ITEM_ENVIRONMENT_TYPE_NAME = 257; + /** + * The deal ID of the Backfill line item. Set for Programmatic Direct + * campaigns. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_EXTERNAL_DEAL_ID = 285; + */ + const BACKFILL_LINE_ITEM_EXTERNAL_DEAL_ID = 285; + /** + * The external ID of the Backfill line item. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_EXTERNAL_ID = 273; + */ + const BACKFILL_LINE_ITEM_EXTERNAL_ID = 273; + /** + * The frequency cap of the Backfill line item (descriptive string). + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_FREQUENCY_CAP = 303; + */ + const BACKFILL_LINE_ITEM_FREQUENCY_CAP = 303; + /** + * Backfill line item ID. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_ID = 298; + */ + const BACKFILL_LINE_ITEM_ID = 298; + /** + * The application that last modified the Backfill line item. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_LAST_MODIFIED_BY_APP = 289; + */ + const BACKFILL_LINE_ITEM_LAST_MODIFIED_BY_APP = 289; + /** + * The total number of clicks delivered of the lifetime of the Backfill line + * item. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_LIFETIME_CLICKS = 283; + */ + const BACKFILL_LINE_ITEM_LIFETIME_CLICKS = 283; + /** + * The total number of impressions delivered over the lifetime of the + * Backfill line item. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_LIFETIME_IMPRESSIONS = 282; + */ + const BACKFILL_LINE_ITEM_LIFETIME_IMPRESSIONS = 282; + /** + * The total number of viewable impressions delivered over the lifetime of + * the Backfill line item. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_LIFETIME_VIEWABLE_IMPRESSIONS = 284; + */ + const BACKFILL_LINE_ITEM_LIFETIME_VIEWABLE_IMPRESSIONS = 284; + /** + * Whether or not the Backfill line item is Makegood. Makegood refers to + * free inventory offered to buyers to compensate for mistakes or + * under-delivery in the original campaigns. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_MAKEGOOD = 276; + */ + const BACKFILL_LINE_ITEM_MAKEGOOD = 276; + /** + * Backfill line item name. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_NAME = 299; + */ + const BACKFILL_LINE_ITEM_NAME = 299; + /** + * The cost of booking for the Backfill line item (non-CPD). + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_NON_CPD_BOOKED_REVENUE = 286; + */ + const BACKFILL_LINE_ITEM_NON_CPD_BOOKED_REVENUE = 286; + /** + * Whether a Backfill line item is eligible for opitimization. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_OPTIMIZABLE = 277; + */ + const BACKFILL_LINE_ITEM_OPTIMIZABLE = 277; + /** + * Goal type ENUM value of the primary goal of the Backfill line item. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_PRIMARY_GOAL_TYPE = 262; + */ + const BACKFILL_LINE_ITEM_PRIMARY_GOAL_TYPE = 262; + /** + * Localized goal type name of the primary goal of the Backfill line item. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_PRIMARY_GOAL_TYPE_NAME = 263; + */ + const BACKFILL_LINE_ITEM_PRIMARY_GOAL_TYPE_NAME = 263; + /** + * Unit type ENUM value of the primary goal of the Backfill line item. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_PRIMARY_GOAL_UNIT_TYPE = 260; + */ + const BACKFILL_LINE_ITEM_PRIMARY_GOAL_UNIT_TYPE = 260; + /** + * Localized unit type name of the primary goal of the Backfill line item. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_PRIMARY_GOAL_UNIT_TYPE_NAME = 261; + */ + const BACKFILL_LINE_ITEM_PRIMARY_GOAL_UNIT_TYPE_NAME = 261; + /** + * The priority of this Backfill line item as a value between 1 and 16. + * In general, a lower priority means more serving priority for the + * Backfill line item. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_PRIORITY = 266; + */ + const BACKFILL_LINE_ITEM_PRIORITY = 266; + /** + * ENUM value describing the state of inventory reservation for the + * BackfillLineItem. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_RESERVATION_STATUS = 306; + */ + const BACKFILL_LINE_ITEM_RESERVATION_STATUS = 306; + /** + * Localized string describing the state of inventory reservation for the + * BackfillLineItem. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_RESERVATION_STATUS_NAME = 307; + */ + const BACKFILL_LINE_ITEM_RESERVATION_STATUS_NAME = 307; + /** + * The start date of the Backfill line item. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_START_DATE = 268; + */ + const BACKFILL_LINE_ITEM_START_DATE = 268; + /** + * The start date and time of the Backfill line item. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_START_DATE_TIME = 270; + */ + const BACKFILL_LINE_ITEM_START_DATE_TIME = 270; + /** + * Backfill line item type ENUM value. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_TYPE = 300; + */ + const BACKFILL_LINE_ITEM_TYPE = 300; + /** + * Localized Backfill line item type name. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_TYPE_NAME = 301; + */ + const BACKFILL_LINE_ITEM_TYPE_NAME = 301; + /** + * Whether the Backfill line item end time and end date is set to + * effectively never end. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_UNLIMITED_END = 271; + */ + const BACKFILL_LINE_ITEM_UNLIMITED_END = 271; + /** + * The artificial cost per unit used by the Ad server to help rank + * inventory. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_VALUE_COST_PER_UNIT = 275; + */ + const BACKFILL_LINE_ITEM_VALUE_COST_PER_UNIT = 275; + /** + * The web property code used for dynamic allocation Backfill line items. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_WEB_PROPERTY_CODE = 287; + */ + const BACKFILL_LINE_ITEM_WEB_PROPERTY_CODE = 287; + /** + * The ID of Backfill creative, includes regular creatives, and master and + * companions in case of creative sets + * + * Generated from protobuf enum BACKFILL_MASTER_COMPANION_CREATIVE_ID = 372; + */ + const BACKFILL_MASTER_COMPANION_CREATIVE_ID = 372; + /** + * Name of Backfill creative, includes regular creatives, and master and + * companions in case of creative sets + * + * Generated from protobuf enum BACKFILL_MASTER_COMPANION_CREATIVE_NAME = 373; + */ + const BACKFILL_MASTER_COMPANION_CREATIVE_NAME = 373; + /** + * Backfill order agency. + * + * Generated from protobuf enum BACKFILL_ORDER_AGENCY = 313; + */ + const BACKFILL_ORDER_AGENCY = 313; + /** + * Backfill order agency ID. + * + * Generated from protobuf enum BACKFILL_ORDER_AGENCY_ID = 314; + */ + const BACKFILL_ORDER_AGENCY_ID = 314; + /** + * Backfill order booked CPC. + * + * Generated from protobuf enum BACKFILL_ORDER_BOOKED_CPC = 315; + */ + const BACKFILL_ORDER_BOOKED_CPC = 315; + /** + * Backfill order booked CPM. + * + * Generated from protobuf enum BACKFILL_ORDER_BOOKED_CPM = 316; + */ + const BACKFILL_ORDER_BOOKED_CPM = 316; + /** + * Backfill order delivery status ENUM value. + * + * Generated from protobuf enum BACKFILL_ORDER_DELIVERY_STATUS = 340; + */ + const BACKFILL_ORDER_DELIVERY_STATUS = 340; + /** + * Backfill order delivery status localized name. + * + * Generated from protobuf enum BACKFILL_ORDER_DELIVERY_STATUS_NAME = 341; + */ + const BACKFILL_ORDER_DELIVERY_STATUS_NAME = 341; + /** + * Backfill order end date. + * + * Generated from protobuf enum BACKFILL_ORDER_END_DATE = 317; + */ + const BACKFILL_ORDER_END_DATE = 317; + /** + * Backfill order end date and time. + * + * Generated from protobuf enum BACKFILL_ORDER_END_DATE_TIME = 319; + */ + const BACKFILL_ORDER_END_DATE_TIME = 319; + /** + * Backfill order external ID. + * + * Generated from protobuf enum BACKFILL_ORDER_EXTERNAL_ID = 320; + */ + const BACKFILL_ORDER_EXTERNAL_ID = 320; + /** + * Backfill order id. + * + * Generated from protobuf enum BACKFILL_ORDER_ID = 338; + */ + const BACKFILL_ORDER_ID = 338; + /** + * Backfill order labels. + * + * Generated from protobuf enum BACKFILL_ORDER_LABELS = 334; + */ + const BACKFILL_ORDER_LABELS = 334; + /** + * Backfill order labels IDs. + * + * Generated from protobuf enum BACKFILL_ORDER_LABEL_IDS = 335; + */ + const BACKFILL_ORDER_LABEL_IDS = 335; + /** + * Backfill order lifetime clicks. + * + * Generated from protobuf enum BACKFILL_ORDER_LIFETIME_CLICKS = 322; + */ + const BACKFILL_ORDER_LIFETIME_CLICKS = 322; + /** + * Backfill order lifetime impressions. + * + * Generated from protobuf enum BACKFILL_ORDER_LIFETIME_IMPRESSIONS = 323; + */ + const BACKFILL_ORDER_LIFETIME_IMPRESSIONS = 323; + /** + * Backfill order name. + * + * Generated from protobuf enum BACKFILL_ORDER_NAME = 339; + */ + const BACKFILL_ORDER_NAME = 339; + /** + * Backfill order PO number. + * + * Generated from protobuf enum BACKFILL_ORDER_PO_NUMBER = 324; + */ + const BACKFILL_ORDER_PO_NUMBER = 324; + /** + * Whether the Backfill order is programmatic. + * + * Generated from protobuf enum BACKFILL_ORDER_PROGRAMMATIC = 321; + */ + const BACKFILL_ORDER_PROGRAMMATIC = 321; + /** + * Backfill order sales person. + * + * Generated from protobuf enum BACKFILL_ORDER_SALESPERSON = 325; + */ + const BACKFILL_ORDER_SALESPERSON = 325; + /** + * Backfill order secondary sales people. + * + * Generated from protobuf enum BACKFILL_ORDER_SECONDARY_SALESPEOPLE = 329; + */ + const BACKFILL_ORDER_SECONDARY_SALESPEOPLE = 329; + /** + * Backfill order secondary sales people ID. + * + * Generated from protobuf enum BACKFILL_ORDER_SECONDARY_SALESPEOPLE_ID = 328; + */ + const BACKFILL_ORDER_SECONDARY_SALESPEOPLE_ID = 328; + /** + * Backfill order secondary traffickers. + * + * Generated from protobuf enum BACKFILL_ORDER_SECONDARY_TRAFFICKERS = 331; + */ + const BACKFILL_ORDER_SECONDARY_TRAFFICKERS = 331; + /** + * Backfill order secondary traffickers ID. + * + * Generated from protobuf enum BACKFILL_ORDER_SECONDARY_TRAFFICKERS_ID = 330; + */ + const BACKFILL_ORDER_SECONDARY_TRAFFICKERS_ID = 330; + /** + * Backfill order start date. + * + * Generated from protobuf enum BACKFILL_ORDER_START_DATE = 332; + */ + const BACKFILL_ORDER_START_DATE = 332; + /** + * Backfill order start date and time. + * + * Generated from protobuf enum BACKFILL_ORDER_START_DATE_TIME = 333; + */ + const BACKFILL_ORDER_START_DATE_TIME = 333; + /** + * Backfill order trafficker. + * + * Generated from protobuf enum BACKFILL_ORDER_TRAFFICKER = 326; + */ + const BACKFILL_ORDER_TRAFFICKER = 326; + /** + * Backfill order trafficker ID. + * + * Generated from protobuf enum BACKFILL_ORDER_TRAFFICKER_ID = 327; + */ + const BACKFILL_ORDER_TRAFFICKER_ID = 327; + /** + * Whether the Backfill order end time and end date is set to effectively + * never end. + * + * Generated from protobuf enum BACKFILL_ORDER_UNLIMITED_END = 318; + */ + const BACKFILL_ORDER_UNLIMITED_END = 318; + /** + * The ID of the buyer on a backfill programmatic proposal. + * + * Generated from protobuf enum BACKFILL_PROGRAMMATIC_BUYER_ID = 336; + */ + const BACKFILL_PROGRAMMATIC_BUYER_ID = 336; + /** + * The name of the buyer on a backfill programmatic proposal. + * + * Generated from protobuf enum BACKFILL_PROGRAMMATIC_BUYER_NAME = 337; + */ + const BACKFILL_PROGRAMMATIC_BUYER_NAME = 337; + /** + * The amount of information about the Publisher's page sent to the buyer + * who purchased the impressions. + * + * Generated from protobuf enum BRANDING_TYPE = 383; + */ + const BRANDING_TYPE = 383; + /** + * The localized version of branding type, the amount of information about + * the Publisher's page sent to the buyer who purchased the impressions. + * + * Generated from protobuf enum BRANDING_TYPE_NAME = 384; + */ + const BRANDING_TYPE_NAME = 384; + /** + * Browser category. + * + * Generated from protobuf enum BROWSER_CATEGORY = 119; + */ + const BROWSER_CATEGORY = 119; + /** + * Browser category name. + * + * Generated from protobuf enum BROWSER_CATEGORY_NAME = 120; + */ + const BROWSER_CATEGORY_NAME = 120; + /** + * The ID of the browser. + * + * Generated from protobuf enum BROWSER_ID = 235; + */ + const BROWSER_ID = 235; + /** + * The name of the browser. + * + * Generated from protobuf enum BROWSER_NAME = 236; + */ + const BROWSER_NAME = 236; + /** + * Mobile carrier ID. + * + * Generated from protobuf enum CARRIER_ID = 369; + */ + const CARRIER_ID = 369; + /** + * Name of the mobile carrier. + * + * Generated from protobuf enum CARRIER_NAME = 368; + */ + const CARRIER_NAME = 368; + /** + * The ID of an advertiser, classified by Google, associated with a creative + * transacted + * + * Generated from protobuf enum CLASSIFIED_ADVERTISER_ID = 133; + */ + const CLASSIFIED_ADVERTISER_ID = 133; + /** + * The name of an advertiser, classified by Google, associated with a + * creative transacted + * + * Generated from protobuf enum CLASSIFIED_ADVERTISER_NAME = 134; + */ + const CLASSIFIED_ADVERTISER_NAME = 134; + /** + * ID of the brand, as classified by Google, + * + * Generated from protobuf enum CLASSIFIED_BRAND_ID = 243; + */ + const CLASSIFIED_BRAND_ID = 243; + /** + * Name of the brand, as classified by Google, + * + * Generated from protobuf enum CLASSIFIED_BRAND_NAME = 244; + */ + const CLASSIFIED_BRAND_NAME = 244; + /** + * ID of the video content served. + * + * Generated from protobuf enum CONTENT_ID = 246; + */ + const CONTENT_ID = 246; + /** + * Name of the video content served. + * + * Generated from protobuf enum CONTENT_NAME = 247; + */ + const CONTENT_NAME = 247; + /** + * The criteria ID of the country in which the ad served. + * + * Generated from protobuf enum COUNTRY_ID = 11; + */ + const COUNTRY_ID = 11; + /** + * The name of the country in which the ad served. + * + * Generated from protobuf enum COUNTRY_NAME = 12; + */ + const COUNTRY_NAME = 12; + /** + * Enum value of creative billing type + * + * Generated from protobuf enum CREATIVE_BILLING_TYPE = 366; + */ + const CREATIVE_BILLING_TYPE = 366; + /** + * Localized string value of creative billing type + * + * Generated from protobuf enum CREATIVE_BILLING_TYPE_NAME = 367; + */ + const CREATIVE_BILLING_TYPE_NAME = 367; + /** + * Represents the click-through URL of a creative + * + * Generated from protobuf enum CREATIVE_CLICK_THROUGH_URL = 174; + */ + const CREATIVE_CLICK_THROUGH_URL = 174; + /** + * The ID of a creative + * + * Generated from protobuf enum CREATIVE_ID = 138; + */ + const CREATIVE_ID = 138; + /** + * Creative name + * + * Generated from protobuf enum CREATIVE_NAME = 139; + */ + const CREATIVE_NAME = 139; + /** + * Creative technology ENUM + * + * Generated from protobuf enum CREATIVE_TECHNOLOGY = 148; + */ + const CREATIVE_TECHNOLOGY = 148; + /** + * Creative technology locallized name + * + * Generated from protobuf enum CREATIVE_TECHNOLOGY_NAME = 149; + */ + const CREATIVE_TECHNOLOGY_NAME = 149; + /** + * Third party vendor name of a creative + * + * Generated from protobuf enum CREATIVE_THIRD_PARTY_VENDOR = 361; + */ + const CREATIVE_THIRD_PARTY_VENDOR = 361; + /** + * Enum value of creative type + * + * Generated from protobuf enum CREATIVE_TYPE = 344; + */ + const CREATIVE_TYPE = 344; + /** + * Localized string name of creative type + * + * Generated from protobuf enum CREATIVE_TYPE_NAME = 345; + */ + const CREATIVE_TYPE_NAME = 345; + /** + * Breaks down reporting data by date. + * + * Generated from protobuf enum DATE = 3; + */ + const DATE = 3; + /** + * Breaks down reporting data by day of the week. Monday is 1 and 7 is + * Sunday. + * + * Generated from protobuf enum DAY_OF_WEEK = 4; + */ + const DAY_OF_WEEK = 4; + /** + * Demand channel. + * + * Generated from protobuf enum DEMAND_CHANNEL = 9; + */ + const DEMAND_CHANNEL = 9; + /** + * Demand channel name. + * + * Generated from protobuf enum DEMAND_CHANNEL_NAME = 10; + */ + const DEMAND_CHANNEL_NAME = 10; + /** + * Demand subchannel. + * + * Generated from protobuf enum DEMAND_SUBCHANNEL = 22; + */ + const DEMAND_SUBCHANNEL = 22; + /** + * Demand subchannel name. + * + * Generated from protobuf enum DEMAND_SUBCHANNEL_NAME = 23; + */ + const DEMAND_SUBCHANNEL_NAME = 23; + /** + * The device on which an ad was served. + * + * Generated from protobuf enum DEVICE = 226; + */ + const DEVICE = 226; + /** + * The device category to which an ad is being targeted. + * + * Generated from protobuf enum DEVICE_CATEGORY = 15; + */ + const DEVICE_CATEGORY = 15; + /** + * The name of the category of device (smartphone, feature phone, tablet, or + * desktop) to which an ad is being targeted. + * + * Generated from protobuf enum DEVICE_CATEGORY_NAME = 16; + */ + const DEVICE_CATEGORY_NAME = 16; + /** + * The localized name of the device on which an ad was served. + * + * Generated from protobuf enum DEVICE_NAME = 225; + */ + const DEVICE_NAME = 225; + /** + * ID of the yield partner as classified by Google + * + * Generated from protobuf enum EXCHANGE_THIRD_PARTY_COMPANY_ID = 185; + */ + const EXCHANGE_THIRD_PARTY_COMPANY_ID = 185; + /** + * Name of the yield partner as classified by Google + * + * Generated from protobuf enum EXCHANGE_THIRD_PARTY_COMPANY_NAME = 186; + */ + const EXCHANGE_THIRD_PARTY_COMPANY_NAME = 186; + /** + * The ID of the first look pricing rule. + * + * Generated from protobuf enum FIRST_LOOK_PRICING_RULE_ID = 248; + */ + const FIRST_LOOK_PRICING_RULE_ID = 248; + /** + * The name of the first look pricing rule. + * + * Generated from protobuf enum FIRST_LOOK_PRICING_RULE_NAME = 249; + */ + const FIRST_LOOK_PRICING_RULE_NAME = 249; + /** + * Breaks down reporting data by hour in one day. + * + * Generated from protobuf enum HOUR = 100; + */ + const HOUR = 100; + /** + * The interaction type of an ad. + * + * Generated from protobuf enum INTERACTION_TYPE = 223; + */ + const INTERACTION_TYPE = 223; + /** + * The localized name of the interaction type of an ad. + * + * Generated from protobuf enum INTERACTION_TYPE_NAME = 224; + */ + const INTERACTION_TYPE_NAME = 224; + /** + * Inventory format. + * The format of the ad unit (e.g, banner) where the ad was requested. + * + * Generated from protobuf enum INVENTORY_FORMAT = 17; + */ + const INVENTORY_FORMAT = 17; + /** + * Inventory format name. + * The format of the ad unit (e.g, banner) where the ad was requested. + * + * Generated from protobuf enum INVENTORY_FORMAT_NAME = 18; + */ + const INVENTORY_FORMAT_NAME = 18; + /** + * Inventory type. + * The kind of web page or device where the ad was requested. + * + * Generated from protobuf enum INVENTORY_TYPE = 19; + */ + const INVENTORY_TYPE = 19; + /** + * Inventory type name. + * The kind of web page or device where the ad was requested. + * + * Generated from protobuf enum INVENTORY_TYPE_NAME = 20; + */ + const INVENTORY_TYPE_NAME = 20; + /** + * Whether traffic is Adx Direct. + * + * Generated from protobuf enum IS_ADX_DIRECT = 382; + */ + const IS_ADX_DIRECT = 382; + /** + * Whether traffic is First Look. + * + * Generated from protobuf enum IS_FIRST_LOOK_DEAL = 401; + */ + const IS_FIRST_LOOK_DEAL = 401; + /** + * The Custom Targeting Value ID + * + * Generated from protobuf enum KEY_VALUES_ID = 214; + */ + const KEY_VALUES_ID = 214; + /** + * The Custom Targeting Value formatted like = + * + * Generated from protobuf enum KEY_VALUES_NAME = 215; + */ + const KEY_VALUES_NAME = 215; + /** + * Whether a Line item is archived. + * + * Generated from protobuf enum LINE_ITEM_ARCHIVED = 188; + */ + const LINE_ITEM_ARCHIVED = 188; + /** + * Line item comanion delivery option ENUM value. + * + * Generated from protobuf enum LINE_ITEM_COMPANION_DELIVERY_OPTION = 204; + */ + const LINE_ITEM_COMPANION_DELIVERY_OPTION = 204; + /** + * Localized line item comanion delivery option name. + * + * Generated from protobuf enum LINE_ITEM_COMPANION_DELIVERY_OPTION_NAME = 205; + */ + const LINE_ITEM_COMPANION_DELIVERY_OPTION_NAME = 205; + /** + * The computed status of the LineItem. + * + * Generated from protobuf enum LINE_ITEM_COMPUTED_STATUS = 250; + */ + const LINE_ITEM_COMPUTED_STATUS = 250; + /** + * The localized name of the computed status of the LineItem. + * + * Generated from protobuf enum LINE_ITEM_COMPUTED_STATUS_NAME = 251; + */ + const LINE_ITEM_COMPUTED_STATUS_NAME = 251; + /** + * The contracted units bought for the Line item. + * + * Generated from protobuf enum LINE_ITEM_CONTRACTED_QUANTITY = 92; + */ + const LINE_ITEM_CONTRACTED_QUANTITY = 92; + /** + * The cost per unit of the Line item. + * + * Generated from protobuf enum LINE_ITEM_COST_PER_UNIT = 85; + */ + const LINE_ITEM_COST_PER_UNIT = 85; + /** + * Line item cost type ENUM value. + * + * Generated from protobuf enum LINE_ITEM_COST_TYPE = 212; + */ + const LINE_ITEM_COST_TYPE = 212; + /** + * Localized line item cost type name. + * + * Generated from protobuf enum LINE_ITEM_COST_TYPE_NAME = 213; + */ + const LINE_ITEM_COST_TYPE_NAME = 213; + /** + * Represent the end date of a creative associated with line item + * + * Generated from protobuf enum LINE_ITEM_CREATIVE_END_DATE = 176; + */ + const LINE_ITEM_CREATIVE_END_DATE = 176; + /** + * The creative rotation type of the LineItem. + * + * Generated from protobuf enum LINE_ITEM_CREATIVE_ROTATION_TYPE = 189; + */ + const LINE_ITEM_CREATIVE_ROTATION_TYPE = 189; + /** + * The localized name of the creative rotation type of the LineItem. + * + * Generated from protobuf enum LINE_ITEM_CREATIVE_ROTATION_TYPE_NAME = 190; + */ + const LINE_ITEM_CREATIVE_ROTATION_TYPE_NAME = 190; + /** + * Represent the start date of a creative associated with line item + * + * Generated from protobuf enum LINE_ITEM_CREATIVE_START_DATE = 175; + */ + const LINE_ITEM_CREATIVE_START_DATE = 175; + /** + * The 3 letter currency code of the Line Item + * + * Generated from protobuf enum LINE_ITEM_CURRENCY_CODE = 180; + */ + const LINE_ITEM_CURRENCY_CODE = 180; + /** + * The progress made for the delivery of the Line item. + * + * Generated from protobuf enum LINE_ITEM_DELIVERY_INDICATOR = 87; + */ + const LINE_ITEM_DELIVERY_INDICATOR = 87; + /** + * The delivery rate type of the LineItem. + * + * Generated from protobuf enum LINE_ITEM_DELIVERY_RATE_TYPE = 191; + */ + const LINE_ITEM_DELIVERY_RATE_TYPE = 191; + /** + * The localized name of the delivery rate type of the LineItem. + * + * Generated from protobuf enum LINE_ITEM_DELIVERY_RATE_TYPE_NAME = 192; + */ + const LINE_ITEM_DELIVERY_RATE_TYPE_NAME = 192; + /** + * The discount of the LineItem in whole units in the LineItem's currency + * code, or if unspecified the Network's currency code. + * + * Generated from protobuf enum LINE_ITEM_DISCOUNT_ABSOLUTE = 195; + */ + const LINE_ITEM_DISCOUNT_ABSOLUTE = 195; + /** + * The discount of the LineItem in percentage. + * + * Generated from protobuf enum LINE_ITEM_DISCOUNT_PERCENTAGE = 196; + */ + const LINE_ITEM_DISCOUNT_PERCENTAGE = 196; + /** + * The end date of the Line item. + * + * Generated from protobuf enum LINE_ITEM_END_DATE = 81; + */ + const LINE_ITEM_END_DATE = 81; + /** + * The end date and time of the Line item. + * + * Generated from protobuf enum LINE_ITEM_END_DATE_TIME = 83; + */ + const LINE_ITEM_END_DATE_TIME = 83; + /** + * The ENUM value of the environment a LineItem is targeting. + * + * Generated from protobuf enum LINE_ITEM_ENVIRONMENT_TYPE = 201; + */ + const LINE_ITEM_ENVIRONMENT_TYPE = 201; + /** + * The localized name of the environment a LineItem is targeting. + * + * Generated from protobuf enum LINE_ITEM_ENVIRONMENT_TYPE_NAME = 202; + */ + const LINE_ITEM_ENVIRONMENT_TYPE_NAME = 202; + /** + * The deal ID of the Line item. Set for Programmatic Direct campaigns. + * + * Generated from protobuf enum LINE_ITEM_EXTERNAL_DEAL_ID = 97; + */ + const LINE_ITEM_EXTERNAL_DEAL_ID = 97; + /** + * The external ID of the Line item. + * + * Generated from protobuf enum LINE_ITEM_EXTERNAL_ID = 86; + */ + const LINE_ITEM_EXTERNAL_ID = 86; + /** + * The frequency cap of the Line item (descriptive string). + * + * Generated from protobuf enum LINE_ITEM_FREQUENCY_CAP = 256; + */ + const LINE_ITEM_FREQUENCY_CAP = 256; + /** + * Line item ID. + * + * Generated from protobuf enum LINE_ITEM_ID = 1; + */ + const LINE_ITEM_ID = 1; + /** + * The application that last modified the Line Item. + * + * Generated from protobuf enum LINE_ITEM_LAST_MODIFIED_BY_APP = 181; + */ + const LINE_ITEM_LAST_MODIFIED_BY_APP = 181; + /** + * The total number of clicks delivered of the lifetime of the Line item. + * + * Generated from protobuf enum LINE_ITEM_LIFETIME_CLICKS = 95; + */ + const LINE_ITEM_LIFETIME_CLICKS = 95; + /** + * The total number of impressions delivered over the lifetime of the + * Line item. + * + * Generated from protobuf enum LINE_ITEM_LIFETIME_IMPRESSIONS = 94; + */ + const LINE_ITEM_LIFETIME_IMPRESSIONS = 94; + /** + * The total number of viewable impressions delivered over the lifetime of + * the Line item. + * + * Generated from protobuf enum LINE_ITEM_LIFETIME_VIEWABLE_IMPRESSIONS = 96; + */ + const LINE_ITEM_LIFETIME_VIEWABLE_IMPRESSIONS = 96; + /** + * Whether or not the Line item is Makegood. Makegood refers to free + * inventory offered to buyers to compensate for mistakes or under-delivery + * in the original campaigns. + * + * Generated from protobuf enum LINE_ITEM_MAKEGOOD = 89; + */ + const LINE_ITEM_MAKEGOOD = 89; + /** + * Line item Name. + * + * Generated from protobuf enum LINE_ITEM_NAME = 2; + */ + const LINE_ITEM_NAME = 2; + /** + * The cost of booking for the Line item (non-CPD). + * + * Generated from protobuf enum LINE_ITEM_NON_CPD_BOOKED_REVENUE = 98; + */ + const LINE_ITEM_NON_CPD_BOOKED_REVENUE = 98; + /** + * Whether a Line item is eligible for opitimization. + * + * Generated from protobuf enum LINE_ITEM_OPTIMIZABLE = 90; + */ + const LINE_ITEM_OPTIMIZABLE = 90; + /** + * Goal type ENUM value of the primary goal of the line item. + * + * Generated from protobuf enum LINE_ITEM_PRIMARY_GOAL_TYPE = 210; + */ + const LINE_ITEM_PRIMARY_GOAL_TYPE = 210; + /** + * Localized goal type name of the primary goal of the line item. + * + * Generated from protobuf enum LINE_ITEM_PRIMARY_GOAL_TYPE_NAME = 211; + */ + const LINE_ITEM_PRIMARY_GOAL_TYPE_NAME = 211; + /** + * The total number of impressions or clicks that are reserved for a + * line item. For line items of type BULK or PRICE_PRIORITY, this represents + * the number of remaining impressions reserved. If the line item has an + * impression cap goal, this represents the number of impressions or + * conversions that the line item will stop serving at if reached. + * + * Generated from protobuf enum LINE_ITEM_PRIMARY_GOAL_UNITS_ABSOLUTE = 93; + */ + const LINE_ITEM_PRIMARY_GOAL_UNITS_ABSOLUTE = 93; + /** + * The percentage of impressions or clicks that are reserved for a + * line item. For line items of type SPONSORSHIP, this represents the + * percentage of available impressions reserved. For line items of type + * NETWORK or HOUSE, this represents the percentage of remaining impressions + * reserved. + * + * Generated from protobuf enum LINE_ITEM_PRIMARY_GOAL_UNITS_PERCENTAGE = 396; + */ + const LINE_ITEM_PRIMARY_GOAL_UNITS_PERCENTAGE = 396; + /** + * Unit type ENUM value of the primary goal of the line item. + * + * Generated from protobuf enum LINE_ITEM_PRIMARY_GOAL_UNIT_TYPE = 208; + */ + const LINE_ITEM_PRIMARY_GOAL_UNIT_TYPE = 208; + /** + * Localized unit type name of the primary goal of the line item. + * + * Generated from protobuf enum LINE_ITEM_PRIMARY_GOAL_UNIT_TYPE_NAME = 209; + */ + const LINE_ITEM_PRIMARY_GOAL_UNIT_TYPE_NAME = 209; + /** + * The priority of this Line item as a value between 1 and 16. + * In general, a lower priority means more serving priority for the + * Line item. + * + * Generated from protobuf enum LINE_ITEM_PRIORITY = 24; + */ + const LINE_ITEM_PRIORITY = 24; + /** + * ENUM value describing the state of inventory reservation for the + * LineItem. + * + * Generated from protobuf enum LINE_ITEM_RESERVATION_STATUS = 304; + */ + const LINE_ITEM_RESERVATION_STATUS = 304; + /** + * Localized string describing the state of inventory reservation for the + * LineItem. + * + * Generated from protobuf enum LINE_ITEM_RESERVATION_STATUS_NAME = 305; + */ + const LINE_ITEM_RESERVATION_STATUS_NAME = 305; + /** + * The start date of the Line item. + * + * Generated from protobuf enum LINE_ITEM_START_DATE = 82; + */ + const LINE_ITEM_START_DATE = 82; + /** + * The start date and time of the Line item. + * + * Generated from protobuf enum LINE_ITEM_START_DATE_TIME = 84; + */ + const LINE_ITEM_START_DATE_TIME = 84; + /** + * Line item type ENUM value. + * + * Generated from protobuf enum LINE_ITEM_TYPE = 193; + */ + const LINE_ITEM_TYPE = 193; + /** + * Localized line item type name. + * + * Generated from protobuf enum LINE_ITEM_TYPE_NAME = 194; + */ + const LINE_ITEM_TYPE_NAME = 194; + /** + * Whether the Line item end time and end date is set to effectively never + * end. + * + * Generated from protobuf enum LINE_ITEM_UNLIMITED_END = 187; + */ + const LINE_ITEM_UNLIMITED_END = 187; + /** + * The artificial cost per unit used by the Ad server to help rank + * inventory. + * + * Generated from protobuf enum LINE_ITEM_VALUE_COST_PER_UNIT = 88; + */ + const LINE_ITEM_VALUE_COST_PER_UNIT = 88; + /** + * The web property code used for dynamic allocation Line Items. + * + * Generated from protobuf enum LINE_ITEM_WEB_PROPERTY_CODE = 179; + */ + const LINE_ITEM_WEB_PROPERTY_CODE = 179; + /** + * The ID of creative, includes regular creatives, and master and companions + * in case of creative sets + * + * Generated from protobuf enum MASTER_COMPANION_CREATIVE_ID = 140; + */ + const MASTER_COMPANION_CREATIVE_ID = 140; + /** + * Name of creative, includes regular creatives, and master and companions + * in case of creative sets + * + * Generated from protobuf enum MASTER_COMPANION_CREATIVE_NAME = 141; + */ + const MASTER_COMPANION_CREATIVE_NAME = 141; + /** + * Whether the mobile app is free. + * + * Generated from protobuf enum MOBILE_APP_FREE = 128; + */ + const MOBILE_APP_FREE = 128; + /** + * URL of app icon for the mobile app. + * + * Generated from protobuf enum MOBILE_APP_ICON_URL = 129; + */ + const MOBILE_APP_ICON_URL = 129; + /** + * The ID of the Mobile App. + * + * Generated from protobuf enum MOBILE_APP_ID = 123; + */ + const MOBILE_APP_ID = 123; + /** + * The name of the mobile app. + * + * Generated from protobuf enum MOBILE_APP_NAME = 127; + */ + const MOBILE_APP_NAME = 127; + /** + * Ownership status of the mobile app. + * + * Generated from protobuf enum MOBILE_APP_OWNERSHIP_STATUS = 311; + */ + const MOBILE_APP_OWNERSHIP_STATUS = 311; + /** + * Ownership status of the mobile app. + * + * Generated from protobuf enum MOBILE_APP_OWNERSHIP_STATUS_NAME = 312; + */ + const MOBILE_APP_OWNERSHIP_STATUS_NAME = 312; + /** + * The App Store of the mobile app. + * + * Generated from protobuf enum MOBILE_APP_STORE = 125; + */ + const MOBILE_APP_STORE = 125; + /** + * The localized name of the mobile app store. + * + * Generated from protobuf enum MOBILE_APP_STORE_NAME = 245; + */ + const MOBILE_APP_STORE_NAME = 245; + /** + * Mobile inventory type. + * Identifies whether a mobile ad came from a regular web page, an AMP web + * page, or a mobile app. + * Values match the Inventory type dimension available in the Overview Home + * dashboard. Note: Video takes precedence over any other value, for + * example, if there is an in-stream video impression on a desktop device, + * it will be attributed to in-stream video and not desktop web. + * + * Generated from protobuf enum MOBILE_INVENTORY_TYPE = 99; + */ + const MOBILE_INVENTORY_TYPE = 99; + /** + * Mobile inventory type name. + * Identifies whether a mobile ad came from a regular web page, an AMP web + * page, or a mobile app. + * + * Generated from protobuf enum MOBILE_INVENTORY_TYPE_NAME = 21; + */ + const MOBILE_INVENTORY_TYPE_NAME = 21; + /** + * SDK version of the mobile device. + * + * Generated from protobuf enum MOBILE_SDK_VERSION_NAME = 130; + */ + const MOBILE_SDK_VERSION_NAME = 130; + /** + * Breaks down reporting data by month and year. + * + * Generated from protobuf enum MONTH_YEAR = 6; + */ + const MONTH_YEAR = 6; + /** + * Native ad format ID. + * + * Generated from protobuf enum NATIVE_AD_FORMAT_ID = 255; + */ + const NATIVE_AD_FORMAT_ID = 255; + /** + * Native ad format name. + * + * Generated from protobuf enum NATIVE_AD_FORMAT_NAME = 254; + */ + const NATIVE_AD_FORMAT_NAME = 254; + /** + * Native style ID. + * + * Generated from protobuf enum NATIVE_STYLE_ID = 253; + */ + const NATIVE_STYLE_ID = 253; + /** + * Native style name. + * + * Generated from protobuf enum NATIVE_STYLE_NAME = 252; + */ + const NATIVE_STYLE_NAME = 252; + /** + * Operating system category. + * + * Generated from protobuf enum OPERATING_SYSTEM_CATEGORY = 117; + */ + const OPERATING_SYSTEM_CATEGORY = 117; + /** + * Operating system category name. + * + * Generated from protobuf enum OPERATING_SYSTEM_CATEGORY_NAME = 118; + */ + const OPERATING_SYSTEM_CATEGORY_NAME = 118; + /** + * ID of the operating system version. + * + * Generated from protobuf enum OPERATING_SYSTEM_VERSION_ID = 238; + */ + const OPERATING_SYSTEM_VERSION_ID = 238; + /** + * Details of the operating system, including version. + * + * Generated from protobuf enum OPERATING_SYSTEM_VERSION_NAME = 237; + */ + const OPERATING_SYSTEM_VERSION_NAME = 237; + /** + * Order agency. + * + * Generated from protobuf enum ORDER_AGENCY = 150; + */ + const ORDER_AGENCY = 150; + /** + * Order agency ID. + * + * Generated from protobuf enum ORDER_AGENCY_ID = 151; + */ + const ORDER_AGENCY_ID = 151; + /** + * Order booked CPC. + * + * Generated from protobuf enum ORDER_BOOKED_CPC = 152; + */ + const ORDER_BOOKED_CPC = 152; + /** + * Order booked CPM. + * + * Generated from protobuf enum ORDER_BOOKED_CPM = 153; + */ + const ORDER_BOOKED_CPM = 153; + /** + * Order delivery status ENUM value. + * + * Generated from protobuf enum ORDER_DELIVERY_STATUS = 231; + */ + const ORDER_DELIVERY_STATUS = 231; + /** + * Order delivery status localized name. + * + * Generated from protobuf enum ORDER_DELIVERY_STATUS_NAME = 239; + */ + const ORDER_DELIVERY_STATUS_NAME = 239; + /** + * Order end date. + * + * Generated from protobuf enum ORDER_END_DATE = 154; + */ + const ORDER_END_DATE = 154; + /** + * Order end date and time. + * + * Generated from protobuf enum ORDER_END_DATE_TIME = 155; + */ + const ORDER_END_DATE_TIME = 155; + /** + * Order external ID. + * + * Generated from protobuf enum ORDER_EXTERNAL_ID = 156; + */ + const ORDER_EXTERNAL_ID = 156; + /** + * Order id. + * + * Generated from protobuf enum ORDER_ID = 7; + */ + const ORDER_ID = 7; + /** + * Order labels. + * + * Generated from protobuf enum ORDER_LABELS = 170; + */ + const ORDER_LABELS = 170; + /** + * Order labels IDs. + * + * Generated from protobuf enum ORDER_LABEL_IDS = 171; + */ + const ORDER_LABEL_IDS = 171; + /** + * Order lifetime clicks. + * + * Generated from protobuf enum ORDER_LIFETIME_CLICKS = 158; + */ + const ORDER_LIFETIME_CLICKS = 158; + /** + * Order lifetime impressions. + * + * Generated from protobuf enum ORDER_LIFETIME_IMPRESSIONS = 159; + */ + const ORDER_LIFETIME_IMPRESSIONS = 159; + /** + * Order name. + * + * Generated from protobuf enum ORDER_NAME = 8; + */ + const ORDER_NAME = 8; + /** + * Order PO number. + * + * Generated from protobuf enum ORDER_PO_NUMBER = 160; + */ + const ORDER_PO_NUMBER = 160; + /** + * Whether the Order is programmatic. + * + * Generated from protobuf enum ORDER_PROGRAMMATIC = 157; + */ + const ORDER_PROGRAMMATIC = 157; + /** + * Order sales person. + * + * Generated from protobuf enum ORDER_SALESPERSON = 161; + */ + const ORDER_SALESPERSON = 161; + /** + * Order secondary sales people. + * + * Generated from protobuf enum ORDER_SECONDARY_SALESPEOPLE = 164; + */ + const ORDER_SECONDARY_SALESPEOPLE = 164; + /** + * Order secondary sales people ID. + * + * Generated from protobuf enum ORDER_SECONDARY_SALESPEOPLE_ID = 165; + */ + const ORDER_SECONDARY_SALESPEOPLE_ID = 165; + /** + * Order secondary traffickers. + * + * Generated from protobuf enum ORDER_SECONDARY_TRAFFICKERS = 166; + */ + const ORDER_SECONDARY_TRAFFICKERS = 166; + /** + * Order secondary traffickers ID. + * + * Generated from protobuf enum ORDER_SECONDARY_TRAFFICKERS_ID = 167; + */ + const ORDER_SECONDARY_TRAFFICKERS_ID = 167; + /** + * Order start date. + * + * Generated from protobuf enum ORDER_START_DATE = 168; + */ + const ORDER_START_DATE = 168; + /** + * Order start date and time. + * + * Generated from protobuf enum ORDER_START_DATE_TIME = 169; + */ + const ORDER_START_DATE_TIME = 169; + /** + * Order trafficker. + * + * Generated from protobuf enum ORDER_TRAFFICKER = 162; + */ + const ORDER_TRAFFICKER = 162; + /** + * Order trafficker ID. + * + * Generated from protobuf enum ORDER_TRAFFICKER_ID = 163; + */ + const ORDER_TRAFFICKER_ID = 163; + /** + * Whether the Order end time and end date is set to effectively never + * end. + * + * Generated from protobuf enum ORDER_UNLIMITED_END = 203; + */ + const ORDER_UNLIMITED_END = 203; + /** + * Placement ID + * + * Generated from protobuf enum PLACEMENT_ID = 113; + */ + const PLACEMENT_ID = 113; + /** + * The full list of placement IDs associated with the ad unit. + * + * Generated from protobuf enum PLACEMENT_ID_ALL = 144; + */ + const PLACEMENT_ID_ALL = 144; + /** + * Placement name + * + * Generated from protobuf enum PLACEMENT_NAME = 114; + */ + const PLACEMENT_NAME = 114; + /** + * The full list of placement names associated with the ad unit. + * + * Generated from protobuf enum PLACEMENT_NAME_ALL = 145; + */ + const PLACEMENT_NAME_ALL = 145; + /** + * Placement status ENUM value + * + * Generated from protobuf enum PLACEMENT_STATUS = 362; + */ + const PLACEMENT_STATUS = 362; + /** + * The full list of placement status ENUM values associated with the ad + * unit. + * + * Generated from protobuf enum PLACEMENT_STATUS_ALL = 363; + */ + const PLACEMENT_STATUS_ALL = 363; + /** + * Localized placement status name. + * + * Generated from protobuf enum PLACEMENT_STATUS_NAME = 364; + */ + const PLACEMENT_STATUS_NAME = 364; + /** + * The full list of localized placement status names associated with the ad + * unit. + * + * Generated from protobuf enum PLACEMENT_STATUS_NAME_ALL = 365; + */ + const PLACEMENT_STATUS_NAME_ALL = 365; + /** + * The ID of the buyer on a programmatic proposal. + * + * Generated from protobuf enum PROGRAMMATIC_BUYER_ID = 240; + */ + const PROGRAMMATIC_BUYER_ID = 240; + /** + * The name of the buyer on a programmatic proposal. + * + * Generated from protobuf enum PROGRAMMATIC_BUYER_NAME = 241; + */ + const PROGRAMMATIC_BUYER_NAME = 241; + /** + * Programmatic channel. + * The type of transaction that occurred in Ad Exchange. + * + * Generated from protobuf enum PROGRAMMATIC_CHANNEL = 13; + */ + const PROGRAMMATIC_CHANNEL = 13; + /** + * Programmatic channel name. + * The type of transaction that occurred in Ad Exchange. + * + * Generated from protobuf enum PROGRAMMATIC_CHANNEL_NAME = 14; + */ + const PROGRAMMATIC_CHANNEL_NAME = 14; + /** + * The size of a rendered creative, It can differ with the creative's size + * if a creative is shown in an ad slot of a different size. + * + * Generated from protobuf enum RENDERED_CREATIVE_SIZE = 343; + */ + const RENDERED_CREATIVE_SIZE = 343; + /** + * Inventory Requested Ad Sizes dimension + * + * Generated from protobuf enum REQUESTED_AD_SIZES = 352; + */ + const REQUESTED_AD_SIZES = 352; + /** + * Request type ENUM + * + * Generated from protobuf enum REQUEST_TYPE = 146; + */ + const REQUEST_TYPE = 146; + /** + * Request type locallized name + * + * Generated from protobuf enum REQUEST_TYPE_NAME = 147; + */ + const REQUEST_TYPE_NAME = 147; + /** + * Information about domain or subdomains. + * + * Generated from protobuf enum SITE = 387; + */ + const SITE = 387; + /** + * The ID of the browser, device or other environment into which a line item + * or creative was served. + * + * Generated from protobuf enum TARGETING_ID = 232; + */ + const TARGETING_ID = 232; + /** + * Information about the browser, device and other environments into which + * a line item or creative was served. + * + * Generated from protobuf enum TARGETING_NAME = 233; + */ + const TARGETING_NAME = 233; + /** + * The way in which advertisers targeted their ads. + * + * Generated from protobuf enum TARGETING_TYPE = 385; + */ + const TARGETING_TYPE = 385; + /** + * The localized name of the way in which advertisers targeted their ads. + * + * Generated from protobuf enum TARGETING_TYPE_NAME = 386; + */ + const TARGETING_TYPE_NAME = 386; + /** + * Inventory Traffic source dimension + * + * Generated from protobuf enum TRAFFIC_SOURCE = 388; + */ + const TRAFFIC_SOURCE = 388; + /** + * Inventory Traffic source dimension name + * + * Generated from protobuf enum TRAFFIC_SOURCE_NAME = 389; + */ + const TRAFFIC_SOURCE_NAME = 389; + /** + * Unified pricing rule ID dimension + * + * Generated from protobuf enum UNIFIED_PRICING_RULE_ID = 393; + */ + const UNIFIED_PRICING_RULE_ID = 393; + /** + * Unified pricing rule name dimension + * + * Generated from protobuf enum UNIFIED_PRICING_RULE_NAME = 394; + */ + const UNIFIED_PRICING_RULE_NAME = 394; + /** + * The video placement enum as defined by ADCOM 1.0-202303. + * + * Generated from protobuf enum VIDEO_PLCMT = 172; + */ + const VIDEO_PLCMT = 172; + /** + * The localized name of the video placement as defined by ADCOM 1.0-202303. + * + * Generated from protobuf enum VIDEO_PLCMT_NAME = 173; + */ + const VIDEO_PLCMT_NAME = 173; + /** + * Breaks down reporting data by week of the year. + * + * Generated from protobuf enum WEEK = 5; + */ + const WEEK = 5; + /** + * Name of the company within a yield group + * + * Generated from protobuf enum YIELD_GROUP_BUYER_NAME = 184; + */ + const YIELD_GROUP_BUYER_NAME = 184; + /** + * ID of the group of ad networks or exchanges used for Mediation and Open + * Bidding + * + * Generated from protobuf enum YIELD_GROUP_ID = 182; + */ + const YIELD_GROUP_ID = 182; + /** + * Name of the group of ad networks or exchanges used for Mediation and Open + * Bidding + * + * Generated from protobuf enum YIELD_GROUP_NAME = 183; + */ + const YIELD_GROUP_NAME = 183; + /** + * Custom field option ID for Line Item with custom field ID equal to the ID + * in index 0 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum LINE_ITEM_CUSTOM_FIELD_0_OPTION_ID = 10000; + */ + const LINE_ITEM_CUSTOM_FIELD_0_OPTION_ID = 10000; + /** + * Custom field option ID for Line Item with custom field ID equal to the ID + * in index 1 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum LINE_ITEM_CUSTOM_FIELD_1_OPTION_ID = 10001; + */ + const LINE_ITEM_CUSTOM_FIELD_1_OPTION_ID = 10001; + /** + * Custom field option ID for Line Item with custom field ID equal to the ID + * in index 2 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum LINE_ITEM_CUSTOM_FIELD_2_OPTION_ID = 10002; + */ + const LINE_ITEM_CUSTOM_FIELD_2_OPTION_ID = 10002; + /** + * Custom field option ID for Line Item with custom field ID equal to the ID + * in index 3 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum LINE_ITEM_CUSTOM_FIELD_3_OPTION_ID = 10003; + */ + const LINE_ITEM_CUSTOM_FIELD_3_OPTION_ID = 10003; + /** + * Custom field option ID for Line Item with custom field ID equal to the ID + * in index 4 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum LINE_ITEM_CUSTOM_FIELD_4_OPTION_ID = 10004; + */ + const LINE_ITEM_CUSTOM_FIELD_4_OPTION_ID = 10004; + /** + * Custom field option ID for Line Item with custom field ID equal to the ID + * in index 5 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum LINE_ITEM_CUSTOM_FIELD_5_OPTION_ID = 10005; + */ + const LINE_ITEM_CUSTOM_FIELD_5_OPTION_ID = 10005; + /** + * Custom field option ID for Line Item with custom field ID equal to the ID + * in index 6 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum LINE_ITEM_CUSTOM_FIELD_6_OPTION_ID = 10006; + */ + const LINE_ITEM_CUSTOM_FIELD_6_OPTION_ID = 10006; + /** + * Custom field option ID for Line Item with custom field ID equal to the ID + * in index 7 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum LINE_ITEM_CUSTOM_FIELD_7_OPTION_ID = 10007; + */ + const LINE_ITEM_CUSTOM_FIELD_7_OPTION_ID = 10007; + /** + * Custom field option ID for Line Item with custom field ID equal to the ID + * in index 8 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum LINE_ITEM_CUSTOM_FIELD_8_OPTION_ID = 10008; + */ + const LINE_ITEM_CUSTOM_FIELD_8_OPTION_ID = 10008; + /** + * Custom field option ID for Line Item with custom field ID equal to the ID + * in index 9 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum LINE_ITEM_CUSTOM_FIELD_9_OPTION_ID = 10009; + */ + const LINE_ITEM_CUSTOM_FIELD_9_OPTION_ID = 10009; + /** + * Custom field option ID for Line Item with custom field ID equal to the ID + * in index 10 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum LINE_ITEM_CUSTOM_FIELD_10_OPTION_ID = 10010; + */ + const LINE_ITEM_CUSTOM_FIELD_10_OPTION_ID = 10010; + /** + * Custom field option ID for Line Item with custom field ID equal to the ID + * in index 11 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum LINE_ITEM_CUSTOM_FIELD_11_OPTION_ID = 10011; + */ + const LINE_ITEM_CUSTOM_FIELD_11_OPTION_ID = 10011; + /** + * Custom field option ID for Line Item with custom field ID equal to the ID + * in index 12 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum LINE_ITEM_CUSTOM_FIELD_12_OPTION_ID = 10012; + */ + const LINE_ITEM_CUSTOM_FIELD_12_OPTION_ID = 10012; + /** + * Custom field option ID for Line Item with custom field ID equal to the ID + * in index 13 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum LINE_ITEM_CUSTOM_FIELD_13_OPTION_ID = 10013; + */ + const LINE_ITEM_CUSTOM_FIELD_13_OPTION_ID = 10013; + /** + * Custom field option ID for Line Item with custom field ID equal to the ID + * in index 14 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum LINE_ITEM_CUSTOM_FIELD_14_OPTION_ID = 10014; + */ + const LINE_ITEM_CUSTOM_FIELD_14_OPTION_ID = 10014; + /** + * Custom field value for Line Item with custom field ID equal to the ID + * in index 0 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum LINE_ITEM_CUSTOM_FIELD_0_VALUE = 11000; + */ + const LINE_ITEM_CUSTOM_FIELD_0_VALUE = 11000; + /** + * Custom field value for Line Item with custom field ID equal to the ID + * in index 1 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum LINE_ITEM_CUSTOM_FIELD_1_VALUE = 11001; + */ + const LINE_ITEM_CUSTOM_FIELD_1_VALUE = 11001; + /** + * Custom field value for Line Item with custom field ID equal to the ID + * in index 2 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum LINE_ITEM_CUSTOM_FIELD_2_VALUE = 11002; + */ + const LINE_ITEM_CUSTOM_FIELD_2_VALUE = 11002; + /** + * Custom field value for Line Item with custom field ID equal to the ID + * in index 3 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum LINE_ITEM_CUSTOM_FIELD_3_VALUE = 11003; + */ + const LINE_ITEM_CUSTOM_FIELD_3_VALUE = 11003; + /** + * Custom field value for Line Item with custom field ID equal to the ID + * in index 4 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum LINE_ITEM_CUSTOM_FIELD_4_VALUE = 11004; + */ + const LINE_ITEM_CUSTOM_FIELD_4_VALUE = 11004; + /** + * Custom field value for Line Item with custom field ID equal to the ID + * in index 5 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum LINE_ITEM_CUSTOM_FIELD_5_VALUE = 11005; + */ + const LINE_ITEM_CUSTOM_FIELD_5_VALUE = 11005; + /** + * Custom field value for Line Item with custom field ID equal to the ID + * in index 6 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum LINE_ITEM_CUSTOM_FIELD_6_VALUE = 11006; + */ + const LINE_ITEM_CUSTOM_FIELD_6_VALUE = 11006; + /** + * Custom field value for Line Item with custom field ID equal to the ID + * in index 7 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum LINE_ITEM_CUSTOM_FIELD_7_VALUE = 11007; + */ + const LINE_ITEM_CUSTOM_FIELD_7_VALUE = 11007; + /** + * Custom field value for Line Item with custom field ID equal to the ID + * in index 8 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum LINE_ITEM_CUSTOM_FIELD_8_VALUE = 11008; + */ + const LINE_ITEM_CUSTOM_FIELD_8_VALUE = 11008; + /** + * Custom field value for Line Item with custom field ID equal to the ID + * in index 9 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum LINE_ITEM_CUSTOM_FIELD_9_VALUE = 11009; + */ + const LINE_ITEM_CUSTOM_FIELD_9_VALUE = 11009; + /** + * Custom field value for Line Item with custom field ID equal to the ID + * in index 10 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum LINE_ITEM_CUSTOM_FIELD_10_VALUE = 11010; + */ + const LINE_ITEM_CUSTOM_FIELD_10_VALUE = 11010; + /** + * Custom field value for Line Item with custom field ID equal to the ID + * in index 11 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum LINE_ITEM_CUSTOM_FIELD_11_VALUE = 11011; + */ + const LINE_ITEM_CUSTOM_FIELD_11_VALUE = 11011; + /** + * Custom field value for Line Item with custom field ID equal to the ID + * in index 12 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum LINE_ITEM_CUSTOM_FIELD_12_VALUE = 11012; + */ + const LINE_ITEM_CUSTOM_FIELD_12_VALUE = 11012; + /** + * Custom field value for Line Item with custom field ID equal to the ID + * in index 13 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum LINE_ITEM_CUSTOM_FIELD_13_VALUE = 11013; + */ + const LINE_ITEM_CUSTOM_FIELD_13_VALUE = 11013; + /** + * Custom field value for Line Item with custom field ID equal to the ID + * in index 14 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum LINE_ITEM_CUSTOM_FIELD_14_VALUE = 11014; + */ + const LINE_ITEM_CUSTOM_FIELD_14_VALUE = 11014; + /** + * Custom field option ID for Order with custom field ID equal to the ID + * in index 0 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum ORDER_CUSTOM_FIELD_0_OPTION_ID = 12000; + */ + const ORDER_CUSTOM_FIELD_0_OPTION_ID = 12000; + /** + * Custom field option ID for Order with custom field ID equal to the ID + * in index 1 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum ORDER_CUSTOM_FIELD_1_OPTION_ID = 12001; + */ + const ORDER_CUSTOM_FIELD_1_OPTION_ID = 12001; + /** + * Custom field option ID for Order with custom field ID equal to the ID + * in index 2 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum ORDER_CUSTOM_FIELD_2_OPTION_ID = 12002; + */ + const ORDER_CUSTOM_FIELD_2_OPTION_ID = 12002; + /** + * Custom field option ID for Order with custom field ID equal to the ID + * in index 3 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum ORDER_CUSTOM_FIELD_3_OPTION_ID = 12003; + */ + const ORDER_CUSTOM_FIELD_3_OPTION_ID = 12003; + /** + * Custom field option ID for Order with custom field ID equal to the ID + * in index 4 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum ORDER_CUSTOM_FIELD_4_OPTION_ID = 12004; + */ + const ORDER_CUSTOM_FIELD_4_OPTION_ID = 12004; + /** + * Custom field option ID for Order with custom field ID equal to the ID + * in index 5 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum ORDER_CUSTOM_FIELD_5_OPTION_ID = 12005; + */ + const ORDER_CUSTOM_FIELD_5_OPTION_ID = 12005; + /** + * Custom field option ID for Order with custom field ID equal to the ID + * in index 6 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum ORDER_CUSTOM_FIELD_6_OPTION_ID = 12006; + */ + const ORDER_CUSTOM_FIELD_6_OPTION_ID = 12006; + /** + * Custom field option ID for Order with custom field ID equal to the ID + * in index 7 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum ORDER_CUSTOM_FIELD_7_OPTION_ID = 12007; + */ + const ORDER_CUSTOM_FIELD_7_OPTION_ID = 12007; + /** + * Custom field option ID for Order with custom field ID equal to the ID + * in index 8 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum ORDER_CUSTOM_FIELD_8_OPTION_ID = 12008; + */ + const ORDER_CUSTOM_FIELD_8_OPTION_ID = 12008; + /** + * Custom field option ID for Order with custom field ID equal to the ID + * in index 9 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum ORDER_CUSTOM_FIELD_9_OPTION_ID = 12009; + */ + const ORDER_CUSTOM_FIELD_9_OPTION_ID = 12009; + /** + * Custom field option ID for Order with custom field ID equal to the ID + * in index 10 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum ORDER_CUSTOM_FIELD_10_OPTION_ID = 12010; + */ + const ORDER_CUSTOM_FIELD_10_OPTION_ID = 12010; + /** + * Custom field option ID for Order with custom field ID equal to the ID + * in index 11 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum ORDER_CUSTOM_FIELD_11_OPTION_ID = 12011; + */ + const ORDER_CUSTOM_FIELD_11_OPTION_ID = 12011; + /** + * Custom field option ID for Order with custom field ID equal to the ID + * in index 12 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum ORDER_CUSTOM_FIELD_12_OPTION_ID = 12012; + */ + const ORDER_CUSTOM_FIELD_12_OPTION_ID = 12012; + /** + * Custom field option ID for Order with custom field ID equal to the ID + * in index 13 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum ORDER_CUSTOM_FIELD_13_OPTION_ID = 12013; + */ + const ORDER_CUSTOM_FIELD_13_OPTION_ID = 12013; + /** + * Custom field option ID for Order with custom field ID equal to the ID + * in index 14 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum ORDER_CUSTOM_FIELD_14_OPTION_ID = 12014; + */ + const ORDER_CUSTOM_FIELD_14_OPTION_ID = 12014; + /** + * Custom field value for Order with custom field ID equal to the ID + * in index 0 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum ORDER_CUSTOM_FIELD_0_VALUE = 13000; + */ + const ORDER_CUSTOM_FIELD_0_VALUE = 13000; + /** + * Custom field value for Order with custom field ID equal to the ID + * in index 1 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum ORDER_CUSTOM_FIELD_1_VALUE = 13001; + */ + const ORDER_CUSTOM_FIELD_1_VALUE = 13001; + /** + * Custom field value for Order with custom field ID equal to the ID + * in index 2 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum ORDER_CUSTOM_FIELD_2_VALUE = 13002; + */ + const ORDER_CUSTOM_FIELD_2_VALUE = 13002; + /** + * Custom field value for Order with custom field ID equal to the ID + * in index 3 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum ORDER_CUSTOM_FIELD_3_VALUE = 13003; + */ + const ORDER_CUSTOM_FIELD_3_VALUE = 13003; + /** + * Custom field value for Order with custom field ID equal to the ID + * in index 4 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum ORDER_CUSTOM_FIELD_4_VALUE = 13004; + */ + const ORDER_CUSTOM_FIELD_4_VALUE = 13004; + /** + * Custom field value for Order with custom field ID equal to the ID + * in index 5 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum ORDER_CUSTOM_FIELD_5_VALUE = 13005; + */ + const ORDER_CUSTOM_FIELD_5_VALUE = 13005; + /** + * Custom field value for Order with custom field ID equal to the ID + * in index 6 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum ORDER_CUSTOM_FIELD_6_VALUE = 13006; + */ + const ORDER_CUSTOM_FIELD_6_VALUE = 13006; + /** + * Custom field value for Order with custom field ID equal to the ID + * in index 7 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum ORDER_CUSTOM_FIELD_7_VALUE = 13007; + */ + const ORDER_CUSTOM_FIELD_7_VALUE = 13007; + /** + * Custom field value for Order with custom field ID equal to the ID + * in index 8 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum ORDER_CUSTOM_FIELD_8_VALUE = 13008; + */ + const ORDER_CUSTOM_FIELD_8_VALUE = 13008; + /** + * Custom field value for Order with custom field ID equal to the ID + * in index 9 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum ORDER_CUSTOM_FIELD_9_VALUE = 13009; + */ + const ORDER_CUSTOM_FIELD_9_VALUE = 13009; + /** + * Custom field value for Order with custom field ID equal to the ID + * in index 10 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum ORDER_CUSTOM_FIELD_10_VALUE = 13010; + */ + const ORDER_CUSTOM_FIELD_10_VALUE = 13010; + /** + * Custom field value for Order with custom field ID equal to the ID + * in index 11 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum ORDER_CUSTOM_FIELD_11_VALUE = 13011; + */ + const ORDER_CUSTOM_FIELD_11_VALUE = 13011; + /** + * Custom field value for Order with custom field ID equal to the ID + * in index 12 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum ORDER_CUSTOM_FIELD_12_VALUE = 13012; + */ + const ORDER_CUSTOM_FIELD_12_VALUE = 13012; + /** + * Custom field value for Order with custom field ID equal to the ID + * in index 13 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum ORDER_CUSTOM_FIELD_13_VALUE = 13013; + */ + const ORDER_CUSTOM_FIELD_13_VALUE = 13013; + /** + * Custom field value for Order with custom field ID equal to the ID + * in index 14 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum ORDER_CUSTOM_FIELD_14_VALUE = 13014; + */ + const ORDER_CUSTOM_FIELD_14_VALUE = 13014; + /** + * Custom field option ID for Creative with custom field ID equal to the ID + * in index 0 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum CREATIVE_CUSTOM_FIELD_0_OPTION_ID = 14000; + */ + const CREATIVE_CUSTOM_FIELD_0_OPTION_ID = 14000; + /** + * Custom field option ID for Creative with custom field ID equal to the ID + * in index 1 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum CREATIVE_CUSTOM_FIELD_1_OPTION_ID = 14001; + */ + const CREATIVE_CUSTOM_FIELD_1_OPTION_ID = 14001; + /** + * Custom field option ID for Creative with custom field ID equal to the ID + * in index 2 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum CREATIVE_CUSTOM_FIELD_2_OPTION_ID = 14002; + */ + const CREATIVE_CUSTOM_FIELD_2_OPTION_ID = 14002; + /** + * Custom field option ID for Creative with custom field ID equal to the ID + * in index 3 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum CREATIVE_CUSTOM_FIELD_3_OPTION_ID = 14003; + */ + const CREATIVE_CUSTOM_FIELD_3_OPTION_ID = 14003; + /** + * Custom field option ID for Creative with custom field ID equal to the ID + * in index 4 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum CREATIVE_CUSTOM_FIELD_4_OPTION_ID = 14004; + */ + const CREATIVE_CUSTOM_FIELD_4_OPTION_ID = 14004; + /** + * Custom field option ID for Creative with custom field ID equal to the ID + * in index 5 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum CREATIVE_CUSTOM_FIELD_5_OPTION_ID = 14005; + */ + const CREATIVE_CUSTOM_FIELD_5_OPTION_ID = 14005; + /** + * Custom field option ID for Creative with custom field ID equal to the ID + * in index 6 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum CREATIVE_CUSTOM_FIELD_6_OPTION_ID = 14006; + */ + const CREATIVE_CUSTOM_FIELD_6_OPTION_ID = 14006; + /** + * Custom field option ID for Creative with custom field ID equal to the ID + * in index 7 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum CREATIVE_CUSTOM_FIELD_7_OPTION_ID = 14007; + */ + const CREATIVE_CUSTOM_FIELD_7_OPTION_ID = 14007; + /** + * Custom field option ID for Creative with custom field ID equal to the ID + * in index 8 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum CREATIVE_CUSTOM_FIELD_8_OPTION_ID = 14008; + */ + const CREATIVE_CUSTOM_FIELD_8_OPTION_ID = 14008; + /** + * Custom field option ID for Creative with custom field ID equal to the ID + * in index 9 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum CREATIVE_CUSTOM_FIELD_9_OPTION_ID = 14009; + */ + const CREATIVE_CUSTOM_FIELD_9_OPTION_ID = 14009; + /** + * Custom field option ID for Creative with custom field ID equal to the ID + * in index 10 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum CREATIVE_CUSTOM_FIELD_10_OPTION_ID = 14010; + */ + const CREATIVE_CUSTOM_FIELD_10_OPTION_ID = 14010; + /** + * Custom field option ID for Creative with custom field ID equal to the ID + * in index 11 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum CREATIVE_CUSTOM_FIELD_11_OPTION_ID = 14011; + */ + const CREATIVE_CUSTOM_FIELD_11_OPTION_ID = 14011; + /** + * Custom field option ID for Creative with custom field ID equal to the ID + * in index 12 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum CREATIVE_CUSTOM_FIELD_12_OPTION_ID = 14012; + */ + const CREATIVE_CUSTOM_FIELD_12_OPTION_ID = 14012; + /** + * Custom field option ID for Creative with custom field ID equal to the ID + * in index 13 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum CREATIVE_CUSTOM_FIELD_13_OPTION_ID = 14013; + */ + const CREATIVE_CUSTOM_FIELD_13_OPTION_ID = 14013; + /** + * Custom field option ID for Creative with custom field ID equal to the ID + * in index 14 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum CREATIVE_CUSTOM_FIELD_14_OPTION_ID = 14014; + */ + const CREATIVE_CUSTOM_FIELD_14_OPTION_ID = 14014; + /** + * Custom field value for Creative with custom field ID equal to the ID + * in index 0 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum CREATIVE_CUSTOM_FIELD_0_VALUE = 15000; + */ + const CREATIVE_CUSTOM_FIELD_0_VALUE = 15000; + /** + * Custom field value for Creative with custom field ID equal to the ID + * in index 1 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum CREATIVE_CUSTOM_FIELD_1_VALUE = 15001; + */ + const CREATIVE_CUSTOM_FIELD_1_VALUE = 15001; + /** + * Custom field value for Creative with custom field ID equal to the ID + * in index 2 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum CREATIVE_CUSTOM_FIELD_2_VALUE = 15002; + */ + const CREATIVE_CUSTOM_FIELD_2_VALUE = 15002; + /** + * Custom field value for Creative with custom field ID equal to the ID + * in index 3 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum CREATIVE_CUSTOM_FIELD_3_VALUE = 15003; + */ + const CREATIVE_CUSTOM_FIELD_3_VALUE = 15003; + /** + * Custom field value for Creative with custom field ID equal to the ID + * in index 4 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum CREATIVE_CUSTOM_FIELD_4_VALUE = 15004; + */ + const CREATIVE_CUSTOM_FIELD_4_VALUE = 15004; + /** + * Custom field value for Creative with custom field ID equal to the ID + * in index 5 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum CREATIVE_CUSTOM_FIELD_5_VALUE = 15005; + */ + const CREATIVE_CUSTOM_FIELD_5_VALUE = 15005; + /** + * Custom field value for Creative with custom field ID equal to the ID + * in index 6 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum CREATIVE_CUSTOM_FIELD_6_VALUE = 15006; + */ + const CREATIVE_CUSTOM_FIELD_6_VALUE = 15006; + /** + * Custom field value for Creative with custom field ID equal to the ID + * in index 7 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum CREATIVE_CUSTOM_FIELD_7_VALUE = 15007; + */ + const CREATIVE_CUSTOM_FIELD_7_VALUE = 15007; + /** + * Custom field value for Creative with custom field ID equal to the ID + * in index 8 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum CREATIVE_CUSTOM_FIELD_8_VALUE = 15008; + */ + const CREATIVE_CUSTOM_FIELD_8_VALUE = 15008; + /** + * Custom field value for Creative with custom field ID equal to the ID + * in index 9 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum CREATIVE_CUSTOM_FIELD_9_VALUE = 15009; + */ + const CREATIVE_CUSTOM_FIELD_9_VALUE = 15009; + /** + * Custom field value for Creative with custom field ID equal to the ID + * in index 10 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum CREATIVE_CUSTOM_FIELD_10_VALUE = 15010; + */ + const CREATIVE_CUSTOM_FIELD_10_VALUE = 15010; + /** + * Custom field value for Creative with custom field ID equal to the ID + * in index 11 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum CREATIVE_CUSTOM_FIELD_11_VALUE = 15011; + */ + const CREATIVE_CUSTOM_FIELD_11_VALUE = 15011; + /** + * Custom field value for Creative with custom field ID equal to the ID + * in index 12 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum CREATIVE_CUSTOM_FIELD_12_VALUE = 15012; + */ + const CREATIVE_CUSTOM_FIELD_12_VALUE = 15012; + /** + * Custom field value for Creative with custom field ID equal to the ID + * in index 13 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum CREATIVE_CUSTOM_FIELD_13_VALUE = 15013; + */ + const CREATIVE_CUSTOM_FIELD_13_VALUE = 15013; + /** + * Custom field value for Creative with custom field ID equal to the ID + * in index 14 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum CREATIVE_CUSTOM_FIELD_14_VALUE = 15014; + */ + const CREATIVE_CUSTOM_FIELD_14_VALUE = 15014; + /** + * Custom field option ID for Backfill line item with custom field ID equal + * to the ID in index 0 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_CUSTOM_FIELD_0_OPTION_ID = 16000; + */ + const BACKFILL_LINE_ITEM_CUSTOM_FIELD_0_OPTION_ID = 16000; + /** + * Custom field option ID for Backfill line item with custom field ID equal + * to the ID in index 1 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_CUSTOM_FIELD_1_OPTION_ID = 16001; + */ + const BACKFILL_LINE_ITEM_CUSTOM_FIELD_1_OPTION_ID = 16001; + /** + * Custom field option ID for Backfill line item with custom field ID equal + * to the ID in index 2 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_CUSTOM_FIELD_2_OPTION_ID = 16002; + */ + const BACKFILL_LINE_ITEM_CUSTOM_FIELD_2_OPTION_ID = 16002; + /** + * Custom field option ID for Backfill line item with custom field ID equal + * to the ID in index 3 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_CUSTOM_FIELD_3_OPTION_ID = 16003; + */ + const BACKFILL_LINE_ITEM_CUSTOM_FIELD_3_OPTION_ID = 16003; + /** + * Custom field option ID for Backfill line item with custom field ID equal + * to the ID in index 4 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_CUSTOM_FIELD_4_OPTION_ID = 16004; + */ + const BACKFILL_LINE_ITEM_CUSTOM_FIELD_4_OPTION_ID = 16004; + /** + * Custom field option ID for Backfill line item with custom field ID equal + * to the ID in index 5 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_CUSTOM_FIELD_5_OPTION_ID = 16005; + */ + const BACKFILL_LINE_ITEM_CUSTOM_FIELD_5_OPTION_ID = 16005; + /** + * Custom field option ID for Backfill line item with custom field ID equal + * to the ID in index 6 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_CUSTOM_FIELD_6_OPTION_ID = 16006; + */ + const BACKFILL_LINE_ITEM_CUSTOM_FIELD_6_OPTION_ID = 16006; + /** + * Custom field option ID for Backfill line item with custom field ID equal + * to the ID in index 7 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_CUSTOM_FIELD_7_OPTION_ID = 16007; + */ + const BACKFILL_LINE_ITEM_CUSTOM_FIELD_7_OPTION_ID = 16007; + /** + * Custom field option ID for Backfill line item with custom field ID equal + * to the ID in index 8 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_CUSTOM_FIELD_8_OPTION_ID = 16008; + */ + const BACKFILL_LINE_ITEM_CUSTOM_FIELD_8_OPTION_ID = 16008; + /** + * Custom field option ID for Backfill line item with custom field ID equal + * to the ID in index 9 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_CUSTOM_FIELD_9_OPTION_ID = 16009; + */ + const BACKFILL_LINE_ITEM_CUSTOM_FIELD_9_OPTION_ID = 16009; + /** + * Custom field option ID for Backfill line item with custom field ID equal + * to the ID in index 10 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_CUSTOM_FIELD_10_OPTION_ID = 16010; + */ + const BACKFILL_LINE_ITEM_CUSTOM_FIELD_10_OPTION_ID = 16010; + /** + * Custom field option ID for Backfill line item with custom field ID equal + * to the ID in index 11 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_CUSTOM_FIELD_11_OPTION_ID = 16011; + */ + const BACKFILL_LINE_ITEM_CUSTOM_FIELD_11_OPTION_ID = 16011; + /** + * Custom field option ID for Backfill line item with custom field ID equal + * to the ID in index 12 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_CUSTOM_FIELD_12_OPTION_ID = 16012; + */ + const BACKFILL_LINE_ITEM_CUSTOM_FIELD_12_OPTION_ID = 16012; + /** + * Custom field option ID for Backfill line item with custom field ID equal + * to the ID in index 13 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_CUSTOM_FIELD_13_OPTION_ID = 16013; + */ + const BACKFILL_LINE_ITEM_CUSTOM_FIELD_13_OPTION_ID = 16013; + /** + * Custom field option ID for Backfill line item with custom field ID equal + * to the ID in index 14 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_CUSTOM_FIELD_14_OPTION_ID = 16014; + */ + const BACKFILL_LINE_ITEM_CUSTOM_FIELD_14_OPTION_ID = 16014; + /** + * Custom field value for Backfill line item with custom field ID equal to + * the ID in index 0 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_CUSTOM_FIELD_0_VALUE = 17000; + */ + const BACKFILL_LINE_ITEM_CUSTOM_FIELD_0_VALUE = 17000; + /** + * Custom field value for Backfill line item with custom field ID equal to + * the ID in index 1 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_CUSTOM_FIELD_1_VALUE = 17001; + */ + const BACKFILL_LINE_ITEM_CUSTOM_FIELD_1_VALUE = 17001; + /** + * Custom field value for Backfill line item with custom field ID equal to + * the ID in index 2 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_CUSTOM_FIELD_2_VALUE = 17002; + */ + const BACKFILL_LINE_ITEM_CUSTOM_FIELD_2_VALUE = 17002; + /** + * Custom field value for Backfill line item with custom field ID equal to + * the ID in index 3 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_CUSTOM_FIELD_3_VALUE = 17003; + */ + const BACKFILL_LINE_ITEM_CUSTOM_FIELD_3_VALUE = 17003; + /** + * Custom field value for Backfill line item with custom field ID equal to + * the ID in index 4 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_CUSTOM_FIELD_4_VALUE = 17004; + */ + const BACKFILL_LINE_ITEM_CUSTOM_FIELD_4_VALUE = 17004; + /** + * Custom field value for Backfill line item with custom field ID equal to + * the ID in index 5 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_CUSTOM_FIELD_5_VALUE = 17005; + */ + const BACKFILL_LINE_ITEM_CUSTOM_FIELD_5_VALUE = 17005; + /** + * Custom field value for Backfill line item with custom field ID equal to + * the ID in index 6 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_CUSTOM_FIELD_6_VALUE = 17006; + */ + const BACKFILL_LINE_ITEM_CUSTOM_FIELD_6_VALUE = 17006; + /** + * Custom field value for Backfill line item with custom field ID equal to + * the ID in index 7 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_CUSTOM_FIELD_7_VALUE = 17007; + */ + const BACKFILL_LINE_ITEM_CUSTOM_FIELD_7_VALUE = 17007; + /** + * Custom field value for Backfill line item with custom field ID equal to + * the ID in index 8 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_CUSTOM_FIELD_8_VALUE = 17008; + */ + const BACKFILL_LINE_ITEM_CUSTOM_FIELD_8_VALUE = 17008; + /** + * Custom field value for Backfill line item with custom field ID equal to + * the ID in index 9 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_CUSTOM_FIELD_9_VALUE = 17009; + */ + const BACKFILL_LINE_ITEM_CUSTOM_FIELD_9_VALUE = 17009; + /** + * Custom field value for Backfill line item with custom field ID equal to + * the ID in index 10 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_CUSTOM_FIELD_10_VALUE = 17010; + */ + const BACKFILL_LINE_ITEM_CUSTOM_FIELD_10_VALUE = 17010; + /** + * Custom field value for Backfill line item with custom field ID equal to + * the ID in index 11 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_CUSTOM_FIELD_11_VALUE = 17011; + */ + const BACKFILL_LINE_ITEM_CUSTOM_FIELD_11_VALUE = 17011; + /** + * Custom field value for Backfill line item with custom field ID equal to + * the ID in index 12 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_CUSTOM_FIELD_12_VALUE = 17012; + */ + const BACKFILL_LINE_ITEM_CUSTOM_FIELD_12_VALUE = 17012; + /** + * Custom field value for Backfill line item with custom field ID equal to + * the ID in index 13 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_CUSTOM_FIELD_13_VALUE = 17013; + */ + const BACKFILL_LINE_ITEM_CUSTOM_FIELD_13_VALUE = 17013; + /** + * Custom field value for Backfill line item with custom field ID equal to + * the ID in index 14 of `ReportDefinition.line_item_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_LINE_ITEM_CUSTOM_FIELD_14_VALUE = 17014; + */ + const BACKFILL_LINE_ITEM_CUSTOM_FIELD_14_VALUE = 17014; + /** + * Custom field option ID for Backfill order with custom field ID equal to + * the ID in index 0 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_ORDER_CUSTOM_FIELD_0_OPTION_ID = 18000; + */ + const BACKFILL_ORDER_CUSTOM_FIELD_0_OPTION_ID = 18000; + /** + * Custom field option ID for Backfill order with custom field ID equal to + * the ID in index 1 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_ORDER_CUSTOM_FIELD_1_OPTION_ID = 18001; + */ + const BACKFILL_ORDER_CUSTOM_FIELD_1_OPTION_ID = 18001; + /** + * Custom field option ID for Backfill order with custom field ID equal to + * the ID in index 2 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_ORDER_CUSTOM_FIELD_2_OPTION_ID = 18002; + */ + const BACKFILL_ORDER_CUSTOM_FIELD_2_OPTION_ID = 18002; + /** + * Custom field option ID for Backfill order with custom field ID equal to + * the ID in index 3 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_ORDER_CUSTOM_FIELD_3_OPTION_ID = 18003; + */ + const BACKFILL_ORDER_CUSTOM_FIELD_3_OPTION_ID = 18003; + /** + * Custom field option ID for Backfill order with custom field ID equal to + * the ID in index 4 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_ORDER_CUSTOM_FIELD_4_OPTION_ID = 18004; + */ + const BACKFILL_ORDER_CUSTOM_FIELD_4_OPTION_ID = 18004; + /** + * Custom field option ID for Backfill order with custom field ID equal to + * the ID in index 5 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_ORDER_CUSTOM_FIELD_5_OPTION_ID = 18005; + */ + const BACKFILL_ORDER_CUSTOM_FIELD_5_OPTION_ID = 18005; + /** + * Custom field option ID for Backfill order with custom field ID equal to + * the ID in index 6 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_ORDER_CUSTOM_FIELD_6_OPTION_ID = 18006; + */ + const BACKFILL_ORDER_CUSTOM_FIELD_6_OPTION_ID = 18006; + /** + * Custom field option ID for Backfill order with custom field ID equal to + * the ID in index 7 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_ORDER_CUSTOM_FIELD_7_OPTION_ID = 18007; + */ + const BACKFILL_ORDER_CUSTOM_FIELD_7_OPTION_ID = 18007; + /** + * Custom field option ID for Backfill order with custom field ID equal to + * the ID in index 8 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_ORDER_CUSTOM_FIELD_8_OPTION_ID = 18008; + */ + const BACKFILL_ORDER_CUSTOM_FIELD_8_OPTION_ID = 18008; + /** + * Custom field option ID for Backfill order with custom field ID equal to + * the ID in index 9 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_ORDER_CUSTOM_FIELD_9_OPTION_ID = 18009; + */ + const BACKFILL_ORDER_CUSTOM_FIELD_9_OPTION_ID = 18009; + /** + * Custom field option ID for Backfill order with custom field ID equal to + * the ID in index 10 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_ORDER_CUSTOM_FIELD_10_OPTION_ID = 18010; + */ + const BACKFILL_ORDER_CUSTOM_FIELD_10_OPTION_ID = 18010; + /** + * Custom field option ID for Backfill order with custom field ID equal to + * the ID in index 11 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_ORDER_CUSTOM_FIELD_11_OPTION_ID = 18011; + */ + const BACKFILL_ORDER_CUSTOM_FIELD_11_OPTION_ID = 18011; + /** + * Custom field option ID for Backfill order with custom field ID equal to + * the ID in index 12 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_ORDER_CUSTOM_FIELD_12_OPTION_ID = 18012; + */ + const BACKFILL_ORDER_CUSTOM_FIELD_12_OPTION_ID = 18012; + /** + * Custom field option ID for Backfill order with custom field ID equal to + * the ID in index 13 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_ORDER_CUSTOM_FIELD_13_OPTION_ID = 18013; + */ + const BACKFILL_ORDER_CUSTOM_FIELD_13_OPTION_ID = 18013; + /** + * Custom field option ID for Backfill order with custom field ID equal to + * the ID in index 14 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_ORDER_CUSTOM_FIELD_14_OPTION_ID = 18014; + */ + const BACKFILL_ORDER_CUSTOM_FIELD_14_OPTION_ID = 18014; + /** + * Custom field value for Backfill order with custom field ID equal to the + * ID in index 0 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_ORDER_CUSTOM_FIELD_0_VALUE = 19000; + */ + const BACKFILL_ORDER_CUSTOM_FIELD_0_VALUE = 19000; + /** + * Custom field value for Backfill order with custom field ID equal to the + * ID in index 1 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_ORDER_CUSTOM_FIELD_1_VALUE = 19001; + */ + const BACKFILL_ORDER_CUSTOM_FIELD_1_VALUE = 19001; + /** + * Custom field value for Backfill order with custom field ID equal to the + * ID in index 2 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_ORDER_CUSTOM_FIELD_2_VALUE = 19002; + */ + const BACKFILL_ORDER_CUSTOM_FIELD_2_VALUE = 19002; + /** + * Custom field value for Backfill order with custom field ID equal to the + * ID in index 3 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_ORDER_CUSTOM_FIELD_3_VALUE = 19003; + */ + const BACKFILL_ORDER_CUSTOM_FIELD_3_VALUE = 19003; + /** + * Custom field value for Backfill order with custom field ID equal to the + * ID in index 4 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_ORDER_CUSTOM_FIELD_4_VALUE = 19004; + */ + const BACKFILL_ORDER_CUSTOM_FIELD_4_VALUE = 19004; + /** + * Custom field value for Backfill order with custom field ID equal to the + * ID in index 5 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_ORDER_CUSTOM_FIELD_5_VALUE = 19005; + */ + const BACKFILL_ORDER_CUSTOM_FIELD_5_VALUE = 19005; + /** + * Custom field value for Backfill order with custom field ID equal to the + * ID in index 6 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_ORDER_CUSTOM_FIELD_6_VALUE = 19006; + */ + const BACKFILL_ORDER_CUSTOM_FIELD_6_VALUE = 19006; + /** + * Custom field value for Backfill order with custom field ID equal to the + * ID in index 7 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_ORDER_CUSTOM_FIELD_7_VALUE = 19007; + */ + const BACKFILL_ORDER_CUSTOM_FIELD_7_VALUE = 19007; + /** + * Custom field value for Backfill order with custom field ID equal to the + * ID in index 8 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_ORDER_CUSTOM_FIELD_8_VALUE = 19008; + */ + const BACKFILL_ORDER_CUSTOM_FIELD_8_VALUE = 19008; + /** + * Custom field value for Backfill order with custom field ID equal to the + * ID in index 9 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_ORDER_CUSTOM_FIELD_9_VALUE = 19009; + */ + const BACKFILL_ORDER_CUSTOM_FIELD_9_VALUE = 19009; + /** + * Custom field value for Backfill order with custom field ID equal to the + * ID in index 10 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_ORDER_CUSTOM_FIELD_10_VALUE = 19010; + */ + const BACKFILL_ORDER_CUSTOM_FIELD_10_VALUE = 19010; + /** + * Custom field value for Backfill order with custom field ID equal to the + * ID in index 11 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_ORDER_CUSTOM_FIELD_11_VALUE = 19011; + */ + const BACKFILL_ORDER_CUSTOM_FIELD_11_VALUE = 19011; + /** + * Custom field value for Backfill order with custom field ID equal to the + * ID in index 12 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_ORDER_CUSTOM_FIELD_12_VALUE = 19012; + */ + const BACKFILL_ORDER_CUSTOM_FIELD_12_VALUE = 19012; + /** + * Custom field value for Backfill order with custom field ID equal to the + * ID in index 13 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_ORDER_CUSTOM_FIELD_13_VALUE = 19013; + */ + const BACKFILL_ORDER_CUSTOM_FIELD_13_VALUE = 19013; + /** + * Custom field value for Backfill order with custom field ID equal to the + * ID in index 14 of `ReportDefinition.order_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_ORDER_CUSTOM_FIELD_14_VALUE = 19014; + */ + const BACKFILL_ORDER_CUSTOM_FIELD_14_VALUE = 19014; + /** + * Custom field option ID for Backfill creative with custom field ID equal + * to the ID in index 0 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_CREATIVE_CUSTOM_FIELD_0_OPTION_ID = 20000; + */ + const BACKFILL_CREATIVE_CUSTOM_FIELD_0_OPTION_ID = 20000; + /** + * Custom field option ID for Backfill creative with custom field ID equal + * to the ID in index 1 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_CREATIVE_CUSTOM_FIELD_1_OPTION_ID = 20001; + */ + const BACKFILL_CREATIVE_CUSTOM_FIELD_1_OPTION_ID = 20001; + /** + * Custom field option ID for Backfill creative with custom field ID equal + * to the ID in index 2 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_CREATIVE_CUSTOM_FIELD_2_OPTION_ID = 20002; + */ + const BACKFILL_CREATIVE_CUSTOM_FIELD_2_OPTION_ID = 20002; + /** + * Custom field option ID for Backfill creative with custom field ID equal + * to the ID in index 3 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_CREATIVE_CUSTOM_FIELD_3_OPTION_ID = 20003; + */ + const BACKFILL_CREATIVE_CUSTOM_FIELD_3_OPTION_ID = 20003; + /** + * Custom field option ID for Backfill creative with custom field ID equal + * to the ID in index 4 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_CREATIVE_CUSTOM_FIELD_4_OPTION_ID = 20004; + */ + const BACKFILL_CREATIVE_CUSTOM_FIELD_4_OPTION_ID = 20004; + /** + * Custom field option ID for Backfill creative with custom field ID equal + * to the ID in index 5 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_CREATIVE_CUSTOM_FIELD_5_OPTION_ID = 20005; + */ + const BACKFILL_CREATIVE_CUSTOM_FIELD_5_OPTION_ID = 20005; + /** + * Custom field option ID for Backfill creative with custom field ID equal + * to the ID in index 6 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_CREATIVE_CUSTOM_FIELD_6_OPTION_ID = 20006; + */ + const BACKFILL_CREATIVE_CUSTOM_FIELD_6_OPTION_ID = 20006; + /** + * Custom field option ID for Backfill creative with custom field ID equal + * to the ID in index 7 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_CREATIVE_CUSTOM_FIELD_7_OPTION_ID = 20007; + */ + const BACKFILL_CREATIVE_CUSTOM_FIELD_7_OPTION_ID = 20007; + /** + * Custom field option ID for Backfill creative with custom field ID equal + * to the ID in index 8 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_CREATIVE_CUSTOM_FIELD_8_OPTION_ID = 20008; + */ + const BACKFILL_CREATIVE_CUSTOM_FIELD_8_OPTION_ID = 20008; + /** + * Custom field option ID for Backfill creative with custom field ID equal + * to the ID in index 9 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_CREATIVE_CUSTOM_FIELD_9_OPTION_ID = 20009; + */ + const BACKFILL_CREATIVE_CUSTOM_FIELD_9_OPTION_ID = 20009; + /** + * Custom field option ID for Backfill creative with custom field ID equal + * to the ID in index 10 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_CREATIVE_CUSTOM_FIELD_10_OPTION_ID = 20010; + */ + const BACKFILL_CREATIVE_CUSTOM_FIELD_10_OPTION_ID = 20010; + /** + * Custom field option ID for Backfill creative with custom field ID equal + * to the ID in index 11 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_CREATIVE_CUSTOM_FIELD_11_OPTION_ID = 20011; + */ + const BACKFILL_CREATIVE_CUSTOM_FIELD_11_OPTION_ID = 20011; + /** + * Custom field option ID for Backfill creative with custom field ID equal + * to the ID in index 12 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_CREATIVE_CUSTOM_FIELD_12_OPTION_ID = 20012; + */ + const BACKFILL_CREATIVE_CUSTOM_FIELD_12_OPTION_ID = 20012; + /** + * Custom field option ID for Backfill creative with custom field ID equal + * to the ID in index 13 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_CREATIVE_CUSTOM_FIELD_13_OPTION_ID = 20013; + */ + const BACKFILL_CREATIVE_CUSTOM_FIELD_13_OPTION_ID = 20013; + /** + * Custom field option ID for Backfill creative with custom field ID equal + * to the ID in index 14 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_CREATIVE_CUSTOM_FIELD_14_OPTION_ID = 20014; + */ + const BACKFILL_CREATIVE_CUSTOM_FIELD_14_OPTION_ID = 20014; + /** + * Custom field value for Backfill creative with custom field ID equal to + * the ID in index 0 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_CREATIVE_CUSTOM_FIELD_0_VALUE = 21000; + */ + const BACKFILL_CREATIVE_CUSTOM_FIELD_0_VALUE = 21000; + /** + * Custom field value for Backfill creative with custom field ID equal to + * the ID in index 1 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_CREATIVE_CUSTOM_FIELD_1_VALUE = 21001; + */ + const BACKFILL_CREATIVE_CUSTOM_FIELD_1_VALUE = 21001; + /** + * Custom field value for Backfill creative with custom field ID equal to + * the ID in index 2 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_CREATIVE_CUSTOM_FIELD_2_VALUE = 21002; + */ + const BACKFILL_CREATIVE_CUSTOM_FIELD_2_VALUE = 21002; + /** + * Custom field value for Backfill creative with custom field ID equal to + * the ID in index 3 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_CREATIVE_CUSTOM_FIELD_3_VALUE = 21003; + */ + const BACKFILL_CREATIVE_CUSTOM_FIELD_3_VALUE = 21003; + /** + * Custom field value for Backfill creative with custom field ID equal to + * the ID in index 4 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_CREATIVE_CUSTOM_FIELD_4_VALUE = 21004; + */ + const BACKFILL_CREATIVE_CUSTOM_FIELD_4_VALUE = 21004; + /** + * Custom field value for Backfill creative with custom field ID equal to + * the ID in index 5 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_CREATIVE_CUSTOM_FIELD_5_VALUE = 21005; + */ + const BACKFILL_CREATIVE_CUSTOM_FIELD_5_VALUE = 21005; + /** + * Custom field value for Backfill creative with custom field ID equal to + * the ID in index 6 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_CREATIVE_CUSTOM_FIELD_6_VALUE = 21006; + */ + const BACKFILL_CREATIVE_CUSTOM_FIELD_6_VALUE = 21006; + /** + * Custom field value for Backfill creative with custom field ID equal to + * the ID in index 7 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_CREATIVE_CUSTOM_FIELD_7_VALUE = 21007; + */ + const BACKFILL_CREATIVE_CUSTOM_FIELD_7_VALUE = 21007; + /** + * Custom field value for Backfill creative with custom field ID equal to + * the ID in index 8 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_CREATIVE_CUSTOM_FIELD_8_VALUE = 21008; + */ + const BACKFILL_CREATIVE_CUSTOM_FIELD_8_VALUE = 21008; + /** + * Custom field value for Backfill creative with custom field ID equal to + * the ID in index 9 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_CREATIVE_CUSTOM_FIELD_9_VALUE = 21009; + */ + const BACKFILL_CREATIVE_CUSTOM_FIELD_9_VALUE = 21009; + /** + * Custom field value for Backfill creative with custom field ID equal to + * the ID in index 10 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_CREATIVE_CUSTOM_FIELD_10_VALUE = 21010; + */ + const BACKFILL_CREATIVE_CUSTOM_FIELD_10_VALUE = 21010; + /** + * Custom field value for Backfill creative with custom field ID equal to + * the ID in index 11 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_CREATIVE_CUSTOM_FIELD_11_VALUE = 21011; + */ + const BACKFILL_CREATIVE_CUSTOM_FIELD_11_VALUE = 21011; + /** + * Custom field value for Backfill creative with custom field ID equal to + * the ID in index 12 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_CREATIVE_CUSTOM_FIELD_12_VALUE = 21012; + */ + const BACKFILL_CREATIVE_CUSTOM_FIELD_12_VALUE = 21012; + /** + * Custom field value for Backfill creative with custom field ID equal to + * the ID in index 13 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_CREATIVE_CUSTOM_FIELD_13_VALUE = 21013; + */ + const BACKFILL_CREATIVE_CUSTOM_FIELD_13_VALUE = 21013; + /** + * Custom field value for Backfill creative with custom field ID equal to + * the ID in index 14 of `ReportDefinition.creative_custom_field_ids`. + * + * Generated from protobuf enum BACKFILL_CREATIVE_CUSTOM_FIELD_14_VALUE = 21014; + */ + const BACKFILL_CREATIVE_CUSTOM_FIELD_14_VALUE = 21014; + /** + * Custom Dimension Value ID for Custom Dimension with key equal to the key + * in index 0 of `ReportDefinition.custom_dimension_key_ids`. + * + * Generated from protobuf enum CUSTOM_DIMENSION_0_VALUE_ID = 100000; + */ + const CUSTOM_DIMENSION_0_VALUE_ID = 100000; + /** + * Custom Dimension Value ID for Custom Dimension with key equal to the key + * in index 1 of `ReportDefinition.custom_dimension_key_ids`. + * + * Generated from protobuf enum CUSTOM_DIMENSION_1_VALUE_ID = 100001; + */ + const CUSTOM_DIMENSION_1_VALUE_ID = 100001; + /** + * Custom Dimension Value ID for Custom Dimension with key equal to the key + * in index 2 of `ReportDefinition.custom_dimension_key_ids`. + * + * Generated from protobuf enum CUSTOM_DIMENSION_2_VALUE_ID = 100002; + */ + const CUSTOM_DIMENSION_2_VALUE_ID = 100002; + /** + * Custom Dimension Value ID for Custom Dimension with key equal to the key + * in index 3 of `ReportDefinition.custom_dimension_key_ids`. + * + * Generated from protobuf enum CUSTOM_DIMENSION_3_VALUE_ID = 100003; + */ + const CUSTOM_DIMENSION_3_VALUE_ID = 100003; + /** + * Custom Dimension Value ID for Custom Dimension with key equal to the key + * in index 4 of `ReportDefinition.custom_dimension_key_ids`. + * + * Generated from protobuf enum CUSTOM_DIMENSION_4_VALUE_ID = 100004; + */ + const CUSTOM_DIMENSION_4_VALUE_ID = 100004; + /** + * Custom Dimension Value ID for Custom Dimension with key equal to the key + * in index 5 of `ReportDefinition.custom_dimension_key_ids`. + * + * Generated from protobuf enum CUSTOM_DIMENSION_5_VALUE_ID = 100005; + */ + const CUSTOM_DIMENSION_5_VALUE_ID = 100005; + /** + * Custom Dimension Value ID for Custom Dimension with key equal to the key + * in index 6 of `ReportDefinition.custom_dimension_key_ids`. + * + * Generated from protobuf enum CUSTOM_DIMENSION_6_VALUE_ID = 100006; + */ + const CUSTOM_DIMENSION_6_VALUE_ID = 100006; + /** + * Custom Dimension Value ID for Custom Dimension with key equal to the key + * in index 9 of `ReportDefinition.custom_dimension_key_ids`. + * + * Generated from protobuf enum CUSTOM_DIMENSION_7_VALUE_ID = 100007; + */ + const CUSTOM_DIMENSION_7_VALUE_ID = 100007; + /** + * Custom Dimension Value ID for Custom Dimension with key equal to the key + * in index 8 of `ReportDefinition.custom_dimension_key_ids`. + * + * Generated from protobuf enum CUSTOM_DIMENSION_8_VALUE_ID = 100008; + */ + const CUSTOM_DIMENSION_8_VALUE_ID = 100008; + /** + * Custom Dimension Value ID for Custom Dimension with key equal to the key + * in index 9 of `ReportDefinition.custom_dimension_key_ids`. + * + * Generated from protobuf enum CUSTOM_DIMENSION_9_VALUE_ID = 100009; + */ + const CUSTOM_DIMENSION_9_VALUE_ID = 100009; + /** + * Custom Dimension Value name for Custom Dimension with key equal to the + * id in index 0 of `ReportDefinition.custom_dimension_key_ids`. + * + * Generated from protobuf enum CUSTOM_DIMENSION_0_VALUE = 101000; + */ + const CUSTOM_DIMENSION_0_VALUE = 101000; + /** + * Custom Dimension Value name for Custom Dimension with key equal to the + * id in index 1 of `ReportDefinition.custom_dimension_key_ids`. + * + * Generated from protobuf enum CUSTOM_DIMENSION_1_VALUE = 101001; + */ + const CUSTOM_DIMENSION_1_VALUE = 101001; + /** + * Custom Dimension Value name for Custom Dimension with key equal to the + * id in index 2 of `ReportDefinition.custom_dimension_key_ids`. + * + * Generated from protobuf enum CUSTOM_DIMENSION_2_VALUE = 101002; + */ + const CUSTOM_DIMENSION_2_VALUE = 101002; + /** + * Custom Dimension Value name for Custom Dimension with key equal to the + * id in index 3 of `ReportDefinition.custom_dimension_key_ids`. + * + * Generated from protobuf enum CUSTOM_DIMENSION_3_VALUE = 101003; + */ + const CUSTOM_DIMENSION_3_VALUE = 101003; + /** + * Custom Dimension Value name for Custom Dimension with key equal to the + * id in index 4 of `ReportDefinition.custom_dimension_key_ids`. + * + * Generated from protobuf enum CUSTOM_DIMENSION_4_VALUE = 101004; + */ + const CUSTOM_DIMENSION_4_VALUE = 101004; + /** + * Custom Dimension Value name for Custom Dimension with key equal to the + * id in index 5 of `ReportDefinition.custom_dimension_key_ids`. + * + * Generated from protobuf enum CUSTOM_DIMENSION_5_VALUE = 101005; + */ + const CUSTOM_DIMENSION_5_VALUE = 101005; + /** + * Custom Dimension Value name for Custom Dimension with key equal to the + * id in index 6 of `ReportDefinition.custom_dimension_key_ids`. + * + * Generated from protobuf enum CUSTOM_DIMENSION_6_VALUE = 101006; + */ + const CUSTOM_DIMENSION_6_VALUE = 101006; + /** + * Custom Dimension Value name for Custom Dimension with key equal to the + * id in index 7 of `ReportDefinition.custom_dimension_key_ids`. + * + * Generated from protobuf enum CUSTOM_DIMENSION_7_VALUE = 101007; + */ + const CUSTOM_DIMENSION_7_VALUE = 101007; + /** + * Custom Dimension Value name for Custom Dimension with key equal to the + * id in index 8 of `ReportDefinition.custom_dimension_key_ids`. + * + * Generated from protobuf enum CUSTOM_DIMENSION_8_VALUE = 101008; + */ + const CUSTOM_DIMENSION_8_VALUE = 101008; + /** + * Custom Dimension Value name for Custom Dimension with key equal to the + * id in index 9 of `ReportDefinition.custom_dimension_key_ids`. + * + * Generated from protobuf enum CUSTOM_DIMENSION_9_VALUE = 101009; + */ + const CUSTOM_DIMENSION_9_VALUE = 101009; + + private static $valueToName = [ + self::DIMENSION_UNSPECIFIED => 'DIMENSION_UNSPECIFIED', + self::ADVERTISER_DOMAIN_NAME => 'ADVERTISER_DOMAIN_NAME', + self::ADVERTISER_EXTERNAL_ID => 'ADVERTISER_EXTERNAL_ID', + self::ADVERTISER_ID => 'ADVERTISER_ID', + self::ADVERTISER_LABELS => 'ADVERTISER_LABELS', + self::ADVERTISER_LABEL_IDS => 'ADVERTISER_LABEL_IDS', + self::ADVERTISER_NAME => 'ADVERTISER_NAME', + self::ADVERTISER_PRIMARY_CONTACT => 'ADVERTISER_PRIMARY_CONTACT', + self::AD_LOCATION => 'AD_LOCATION', + self::AD_LOCATION_NAME => 'AD_LOCATION_NAME', + self::AD_UNIT_CODE => 'AD_UNIT_CODE', + self::AD_UNIT_CODE_LEVEL_1 => 'AD_UNIT_CODE_LEVEL_1', + self::AD_UNIT_CODE_LEVEL_10 => 'AD_UNIT_CODE_LEVEL_10', + self::AD_UNIT_CODE_LEVEL_11 => 'AD_UNIT_CODE_LEVEL_11', + self::AD_UNIT_CODE_LEVEL_12 => 'AD_UNIT_CODE_LEVEL_12', + self::AD_UNIT_CODE_LEVEL_13 => 'AD_UNIT_CODE_LEVEL_13', + self::AD_UNIT_CODE_LEVEL_14 => 'AD_UNIT_CODE_LEVEL_14', + self::AD_UNIT_CODE_LEVEL_15 => 'AD_UNIT_CODE_LEVEL_15', + self::AD_UNIT_CODE_LEVEL_16 => 'AD_UNIT_CODE_LEVEL_16', + self::AD_UNIT_CODE_LEVEL_2 => 'AD_UNIT_CODE_LEVEL_2', + self::AD_UNIT_CODE_LEVEL_3 => 'AD_UNIT_CODE_LEVEL_3', + self::AD_UNIT_CODE_LEVEL_4 => 'AD_UNIT_CODE_LEVEL_4', + self::AD_UNIT_CODE_LEVEL_5 => 'AD_UNIT_CODE_LEVEL_5', + self::AD_UNIT_CODE_LEVEL_6 => 'AD_UNIT_CODE_LEVEL_6', + self::AD_UNIT_CODE_LEVEL_7 => 'AD_UNIT_CODE_LEVEL_7', + self::AD_UNIT_CODE_LEVEL_8 => 'AD_UNIT_CODE_LEVEL_8', + self::AD_UNIT_CODE_LEVEL_9 => 'AD_UNIT_CODE_LEVEL_9', + self::AD_UNIT_DEPTH => 'AD_UNIT_DEPTH', + self::AD_UNIT_ID => 'AD_UNIT_ID', + self::AD_UNIT_ID_ALL_LEVEL => 'AD_UNIT_ID_ALL_LEVEL', + self::AD_UNIT_ID_LEVEL_1 => 'AD_UNIT_ID_LEVEL_1', + self::AD_UNIT_ID_LEVEL_10 => 'AD_UNIT_ID_LEVEL_10', + self::AD_UNIT_ID_LEVEL_11 => 'AD_UNIT_ID_LEVEL_11', + self::AD_UNIT_ID_LEVEL_12 => 'AD_UNIT_ID_LEVEL_12', + self::AD_UNIT_ID_LEVEL_13 => 'AD_UNIT_ID_LEVEL_13', + self::AD_UNIT_ID_LEVEL_14 => 'AD_UNIT_ID_LEVEL_14', + self::AD_UNIT_ID_LEVEL_15 => 'AD_UNIT_ID_LEVEL_15', + self::AD_UNIT_ID_LEVEL_16 => 'AD_UNIT_ID_LEVEL_16', + self::AD_UNIT_ID_LEVEL_2 => 'AD_UNIT_ID_LEVEL_2', + self::AD_UNIT_ID_LEVEL_3 => 'AD_UNIT_ID_LEVEL_3', + self::AD_UNIT_ID_LEVEL_4 => 'AD_UNIT_ID_LEVEL_4', + self::AD_UNIT_ID_LEVEL_5 => 'AD_UNIT_ID_LEVEL_5', + self::AD_UNIT_ID_LEVEL_6 => 'AD_UNIT_ID_LEVEL_6', + self::AD_UNIT_ID_LEVEL_7 => 'AD_UNIT_ID_LEVEL_7', + self::AD_UNIT_ID_LEVEL_8 => 'AD_UNIT_ID_LEVEL_8', + self::AD_UNIT_ID_LEVEL_9 => 'AD_UNIT_ID_LEVEL_9', + self::AD_UNIT_ID_TOP_LEVEL => 'AD_UNIT_ID_TOP_LEVEL', + self::AD_UNIT_NAME => 'AD_UNIT_NAME', + self::AD_UNIT_NAME_ALL_LEVEL => 'AD_UNIT_NAME_ALL_LEVEL', + self::AD_UNIT_NAME_LEVEL_1 => 'AD_UNIT_NAME_LEVEL_1', + self::AD_UNIT_NAME_LEVEL_10 => 'AD_UNIT_NAME_LEVEL_10', + self::AD_UNIT_NAME_LEVEL_11 => 'AD_UNIT_NAME_LEVEL_11', + self::AD_UNIT_NAME_LEVEL_12 => 'AD_UNIT_NAME_LEVEL_12', + self::AD_UNIT_NAME_LEVEL_13 => 'AD_UNIT_NAME_LEVEL_13', + self::AD_UNIT_NAME_LEVEL_14 => 'AD_UNIT_NAME_LEVEL_14', + self::AD_UNIT_NAME_LEVEL_15 => 'AD_UNIT_NAME_LEVEL_15', + self::AD_UNIT_NAME_LEVEL_16 => 'AD_UNIT_NAME_LEVEL_16', + self::AD_UNIT_NAME_LEVEL_2 => 'AD_UNIT_NAME_LEVEL_2', + self::AD_UNIT_NAME_LEVEL_3 => 'AD_UNIT_NAME_LEVEL_3', + self::AD_UNIT_NAME_LEVEL_4 => 'AD_UNIT_NAME_LEVEL_4', + self::AD_UNIT_NAME_LEVEL_5 => 'AD_UNIT_NAME_LEVEL_5', + self::AD_UNIT_NAME_LEVEL_6 => 'AD_UNIT_NAME_LEVEL_6', + self::AD_UNIT_NAME_LEVEL_7 => 'AD_UNIT_NAME_LEVEL_7', + self::AD_UNIT_NAME_LEVEL_8 => 'AD_UNIT_NAME_LEVEL_8', + self::AD_UNIT_NAME_LEVEL_9 => 'AD_UNIT_NAME_LEVEL_9', + self::AD_UNIT_NAME_TOP_LEVEL => 'AD_UNIT_NAME_TOP_LEVEL', + self::AD_UNIT_REWARD_AMOUNT => 'AD_UNIT_REWARD_AMOUNT', + self::AD_UNIT_REWARD_TYPE => 'AD_UNIT_REWARD_TYPE', + self::AD_UNIT_STATUS => 'AD_UNIT_STATUS', + self::AD_UNIT_STATUS_NAME => 'AD_UNIT_STATUS_NAME', + self::APP_VERSION => 'APP_VERSION', + self::BACKFILL_ADVERTISER_EXTERNAL_ID => 'BACKFILL_ADVERTISER_EXTERNAL_ID', + self::BACKFILL_ADVERTISER_ID => 'BACKFILL_ADVERTISER_ID', + self::BACKFILL_ADVERTISER_LABELS => 'BACKFILL_ADVERTISER_LABELS', + self::BACKFILL_ADVERTISER_LABEL_IDS => 'BACKFILL_ADVERTISER_LABEL_IDS', + self::BACKFILL_ADVERTISER_NAME => 'BACKFILL_ADVERTISER_NAME', + self::BACKFILL_ADVERTISER_PRIMARY_CONTACT => 'BACKFILL_ADVERTISER_PRIMARY_CONTACT', + self::BACKFILL_CREATIVE_BILLING_TYPE => 'BACKFILL_CREATIVE_BILLING_TYPE', + self::BACKFILL_CREATIVE_BILLING_TYPE_NAME => 'BACKFILL_CREATIVE_BILLING_TYPE_NAME', + self::BACKFILL_CREATIVE_CLICK_THROUGH_URL => 'BACKFILL_CREATIVE_CLICK_THROUGH_URL', + self::BACKFILL_CREATIVE_ID => 'BACKFILL_CREATIVE_ID', + self::BACKFILL_CREATIVE_NAME => 'BACKFILL_CREATIVE_NAME', + self::BACKFILL_CREATIVE_THIRD_PARTY_VENDOR => 'BACKFILL_CREATIVE_THIRD_PARTY_VENDOR', + self::BACKFILL_CREATIVE_TYPE => 'BACKFILL_CREATIVE_TYPE', + self::BACKFILL_CREATIVE_TYPE_NAME => 'BACKFILL_CREATIVE_TYPE_NAME', + self::BACKFILL_LINE_ITEM_ARCHIVED => 'BACKFILL_LINE_ITEM_ARCHIVED', + self::BACKFILL_LINE_ITEM_COMPANION_DELIVERY_OPTION => 'BACKFILL_LINE_ITEM_COMPANION_DELIVERY_OPTION', + self::BACKFILL_LINE_ITEM_COMPANION_DELIVERY_OPTION_NAME => 'BACKFILL_LINE_ITEM_COMPANION_DELIVERY_OPTION_NAME', + self::BACKFILL_LINE_ITEM_COMPUTED_STATUS => 'BACKFILL_LINE_ITEM_COMPUTED_STATUS', + self::BACKFILL_LINE_ITEM_COMPUTED_STATUS_NAME => 'BACKFILL_LINE_ITEM_COMPUTED_STATUS_NAME', + self::BACKFILL_LINE_ITEM_CONTRACTED_QUANTITY => 'BACKFILL_LINE_ITEM_CONTRACTED_QUANTITY', + self::BACKFILL_LINE_ITEM_COST_PER_UNIT => 'BACKFILL_LINE_ITEM_COST_PER_UNIT', + self::BACKFILL_LINE_ITEM_COST_TYPE => 'BACKFILL_LINE_ITEM_COST_TYPE', + self::BACKFILL_LINE_ITEM_COST_TYPE_NAME => 'BACKFILL_LINE_ITEM_COST_TYPE_NAME', + self::BACKFILL_LINE_ITEM_CREATIVE_END_DATE => 'BACKFILL_LINE_ITEM_CREATIVE_END_DATE', + self::BACKFILL_LINE_ITEM_CREATIVE_ROTATION_TYPE => 'BACKFILL_LINE_ITEM_CREATIVE_ROTATION_TYPE', + self::BACKFILL_LINE_ITEM_CREATIVE_ROTATION_TYPE_NAME => 'BACKFILL_LINE_ITEM_CREATIVE_ROTATION_TYPE_NAME', + self::BACKFILL_LINE_ITEM_CREATIVE_START_DATE => 'BACKFILL_LINE_ITEM_CREATIVE_START_DATE', + self::BACKFILL_LINE_ITEM_CURRENCY_CODE => 'BACKFILL_LINE_ITEM_CURRENCY_CODE', + self::BACKFILL_LINE_ITEM_DELIVERY_INDICATOR => 'BACKFILL_LINE_ITEM_DELIVERY_INDICATOR', + self::BACKFILL_LINE_ITEM_DELIVERY_RATE_TYPE => 'BACKFILL_LINE_ITEM_DELIVERY_RATE_TYPE', + self::BACKFILL_LINE_ITEM_DELIVERY_RATE_TYPE_NAME => 'BACKFILL_LINE_ITEM_DELIVERY_RATE_TYPE_NAME', + self::BACKFILL_LINE_ITEM_DISCOUNT_ABSOLUTE => 'BACKFILL_LINE_ITEM_DISCOUNT_ABSOLUTE', + self::BACKFILL_LINE_ITEM_DISCOUNT_PERCENTAGE => 'BACKFILL_LINE_ITEM_DISCOUNT_PERCENTAGE', + self::BACKFILL_LINE_ITEM_END_DATE => 'BACKFILL_LINE_ITEM_END_DATE', + self::BACKFILL_LINE_ITEM_END_DATE_TIME => 'BACKFILL_LINE_ITEM_END_DATE_TIME', + self::BACKFILL_LINE_ITEM_ENVIRONMENT_TYPE => 'BACKFILL_LINE_ITEM_ENVIRONMENT_TYPE', + self::BACKFILL_LINE_ITEM_ENVIRONMENT_TYPE_NAME => 'BACKFILL_LINE_ITEM_ENVIRONMENT_TYPE_NAME', + self::BACKFILL_LINE_ITEM_EXTERNAL_DEAL_ID => 'BACKFILL_LINE_ITEM_EXTERNAL_DEAL_ID', + self::BACKFILL_LINE_ITEM_EXTERNAL_ID => 'BACKFILL_LINE_ITEM_EXTERNAL_ID', + self::BACKFILL_LINE_ITEM_FREQUENCY_CAP => 'BACKFILL_LINE_ITEM_FREQUENCY_CAP', + self::BACKFILL_LINE_ITEM_ID => 'BACKFILL_LINE_ITEM_ID', + self::BACKFILL_LINE_ITEM_LAST_MODIFIED_BY_APP => 'BACKFILL_LINE_ITEM_LAST_MODIFIED_BY_APP', + self::BACKFILL_LINE_ITEM_LIFETIME_CLICKS => 'BACKFILL_LINE_ITEM_LIFETIME_CLICKS', + self::BACKFILL_LINE_ITEM_LIFETIME_IMPRESSIONS => 'BACKFILL_LINE_ITEM_LIFETIME_IMPRESSIONS', + self::BACKFILL_LINE_ITEM_LIFETIME_VIEWABLE_IMPRESSIONS => 'BACKFILL_LINE_ITEM_LIFETIME_VIEWABLE_IMPRESSIONS', + self::BACKFILL_LINE_ITEM_MAKEGOOD => 'BACKFILL_LINE_ITEM_MAKEGOOD', + self::BACKFILL_LINE_ITEM_NAME => 'BACKFILL_LINE_ITEM_NAME', + self::BACKFILL_LINE_ITEM_NON_CPD_BOOKED_REVENUE => 'BACKFILL_LINE_ITEM_NON_CPD_BOOKED_REVENUE', + self::BACKFILL_LINE_ITEM_OPTIMIZABLE => 'BACKFILL_LINE_ITEM_OPTIMIZABLE', + self::BACKFILL_LINE_ITEM_PRIMARY_GOAL_TYPE => 'BACKFILL_LINE_ITEM_PRIMARY_GOAL_TYPE', + self::BACKFILL_LINE_ITEM_PRIMARY_GOAL_TYPE_NAME => 'BACKFILL_LINE_ITEM_PRIMARY_GOAL_TYPE_NAME', + self::BACKFILL_LINE_ITEM_PRIMARY_GOAL_UNIT_TYPE => 'BACKFILL_LINE_ITEM_PRIMARY_GOAL_UNIT_TYPE', + self::BACKFILL_LINE_ITEM_PRIMARY_GOAL_UNIT_TYPE_NAME => 'BACKFILL_LINE_ITEM_PRIMARY_GOAL_UNIT_TYPE_NAME', + self::BACKFILL_LINE_ITEM_PRIORITY => 'BACKFILL_LINE_ITEM_PRIORITY', + self::BACKFILL_LINE_ITEM_RESERVATION_STATUS => 'BACKFILL_LINE_ITEM_RESERVATION_STATUS', + self::BACKFILL_LINE_ITEM_RESERVATION_STATUS_NAME => 'BACKFILL_LINE_ITEM_RESERVATION_STATUS_NAME', + self::BACKFILL_LINE_ITEM_START_DATE => 'BACKFILL_LINE_ITEM_START_DATE', + self::BACKFILL_LINE_ITEM_START_DATE_TIME => 'BACKFILL_LINE_ITEM_START_DATE_TIME', + self::BACKFILL_LINE_ITEM_TYPE => 'BACKFILL_LINE_ITEM_TYPE', + self::BACKFILL_LINE_ITEM_TYPE_NAME => 'BACKFILL_LINE_ITEM_TYPE_NAME', + self::BACKFILL_LINE_ITEM_UNLIMITED_END => 'BACKFILL_LINE_ITEM_UNLIMITED_END', + self::BACKFILL_LINE_ITEM_VALUE_COST_PER_UNIT => 'BACKFILL_LINE_ITEM_VALUE_COST_PER_UNIT', + self::BACKFILL_LINE_ITEM_WEB_PROPERTY_CODE => 'BACKFILL_LINE_ITEM_WEB_PROPERTY_CODE', + self::BACKFILL_MASTER_COMPANION_CREATIVE_ID => 'BACKFILL_MASTER_COMPANION_CREATIVE_ID', + self::BACKFILL_MASTER_COMPANION_CREATIVE_NAME => 'BACKFILL_MASTER_COMPANION_CREATIVE_NAME', + self::BACKFILL_ORDER_AGENCY => 'BACKFILL_ORDER_AGENCY', + self::BACKFILL_ORDER_AGENCY_ID => 'BACKFILL_ORDER_AGENCY_ID', + self::BACKFILL_ORDER_BOOKED_CPC => 'BACKFILL_ORDER_BOOKED_CPC', + self::BACKFILL_ORDER_BOOKED_CPM => 'BACKFILL_ORDER_BOOKED_CPM', + self::BACKFILL_ORDER_DELIVERY_STATUS => 'BACKFILL_ORDER_DELIVERY_STATUS', + self::BACKFILL_ORDER_DELIVERY_STATUS_NAME => 'BACKFILL_ORDER_DELIVERY_STATUS_NAME', + self::BACKFILL_ORDER_END_DATE => 'BACKFILL_ORDER_END_DATE', + self::BACKFILL_ORDER_END_DATE_TIME => 'BACKFILL_ORDER_END_DATE_TIME', + self::BACKFILL_ORDER_EXTERNAL_ID => 'BACKFILL_ORDER_EXTERNAL_ID', + self::BACKFILL_ORDER_ID => 'BACKFILL_ORDER_ID', + self::BACKFILL_ORDER_LABELS => 'BACKFILL_ORDER_LABELS', + self::BACKFILL_ORDER_LABEL_IDS => 'BACKFILL_ORDER_LABEL_IDS', + self::BACKFILL_ORDER_LIFETIME_CLICKS => 'BACKFILL_ORDER_LIFETIME_CLICKS', + self::BACKFILL_ORDER_LIFETIME_IMPRESSIONS => 'BACKFILL_ORDER_LIFETIME_IMPRESSIONS', + self::BACKFILL_ORDER_NAME => 'BACKFILL_ORDER_NAME', + self::BACKFILL_ORDER_PO_NUMBER => 'BACKFILL_ORDER_PO_NUMBER', + self::BACKFILL_ORDER_PROGRAMMATIC => 'BACKFILL_ORDER_PROGRAMMATIC', + self::BACKFILL_ORDER_SALESPERSON => 'BACKFILL_ORDER_SALESPERSON', + self::BACKFILL_ORDER_SECONDARY_SALESPEOPLE => 'BACKFILL_ORDER_SECONDARY_SALESPEOPLE', + self::BACKFILL_ORDER_SECONDARY_SALESPEOPLE_ID => 'BACKFILL_ORDER_SECONDARY_SALESPEOPLE_ID', + self::BACKFILL_ORDER_SECONDARY_TRAFFICKERS => 'BACKFILL_ORDER_SECONDARY_TRAFFICKERS', + self::BACKFILL_ORDER_SECONDARY_TRAFFICKERS_ID => 'BACKFILL_ORDER_SECONDARY_TRAFFICKERS_ID', + self::BACKFILL_ORDER_START_DATE => 'BACKFILL_ORDER_START_DATE', + self::BACKFILL_ORDER_START_DATE_TIME => 'BACKFILL_ORDER_START_DATE_TIME', + self::BACKFILL_ORDER_TRAFFICKER => 'BACKFILL_ORDER_TRAFFICKER', + self::BACKFILL_ORDER_TRAFFICKER_ID => 'BACKFILL_ORDER_TRAFFICKER_ID', + self::BACKFILL_ORDER_UNLIMITED_END => 'BACKFILL_ORDER_UNLIMITED_END', + self::BACKFILL_PROGRAMMATIC_BUYER_ID => 'BACKFILL_PROGRAMMATIC_BUYER_ID', + self::BACKFILL_PROGRAMMATIC_BUYER_NAME => 'BACKFILL_PROGRAMMATIC_BUYER_NAME', + self::BRANDING_TYPE => 'BRANDING_TYPE', + self::BRANDING_TYPE_NAME => 'BRANDING_TYPE_NAME', + self::BROWSER_CATEGORY => 'BROWSER_CATEGORY', + self::BROWSER_CATEGORY_NAME => 'BROWSER_CATEGORY_NAME', + self::BROWSER_ID => 'BROWSER_ID', + self::BROWSER_NAME => 'BROWSER_NAME', + self::CARRIER_ID => 'CARRIER_ID', + self::CARRIER_NAME => 'CARRIER_NAME', + self::CLASSIFIED_ADVERTISER_ID => 'CLASSIFIED_ADVERTISER_ID', + self::CLASSIFIED_ADVERTISER_NAME => 'CLASSIFIED_ADVERTISER_NAME', + self::CLASSIFIED_BRAND_ID => 'CLASSIFIED_BRAND_ID', + self::CLASSIFIED_BRAND_NAME => 'CLASSIFIED_BRAND_NAME', + self::CONTENT_ID => 'CONTENT_ID', + self::CONTENT_NAME => 'CONTENT_NAME', + self::COUNTRY_ID => 'COUNTRY_ID', + self::COUNTRY_NAME => 'COUNTRY_NAME', + self::CREATIVE_BILLING_TYPE => 'CREATIVE_BILLING_TYPE', + self::CREATIVE_BILLING_TYPE_NAME => 'CREATIVE_BILLING_TYPE_NAME', + self::CREATIVE_CLICK_THROUGH_URL => 'CREATIVE_CLICK_THROUGH_URL', + self::CREATIVE_ID => 'CREATIVE_ID', + self::CREATIVE_NAME => 'CREATIVE_NAME', + self::CREATIVE_TECHNOLOGY => 'CREATIVE_TECHNOLOGY', + self::CREATIVE_TECHNOLOGY_NAME => 'CREATIVE_TECHNOLOGY_NAME', + self::CREATIVE_THIRD_PARTY_VENDOR => 'CREATIVE_THIRD_PARTY_VENDOR', + self::CREATIVE_TYPE => 'CREATIVE_TYPE', + self::CREATIVE_TYPE_NAME => 'CREATIVE_TYPE_NAME', + self::DATE => 'DATE', + self::DAY_OF_WEEK => 'DAY_OF_WEEK', + self::DEMAND_CHANNEL => 'DEMAND_CHANNEL', + self::DEMAND_CHANNEL_NAME => 'DEMAND_CHANNEL_NAME', + self::DEMAND_SUBCHANNEL => 'DEMAND_SUBCHANNEL', + self::DEMAND_SUBCHANNEL_NAME => 'DEMAND_SUBCHANNEL_NAME', + self::DEVICE => 'DEVICE', + self::DEVICE_CATEGORY => 'DEVICE_CATEGORY', + self::DEVICE_CATEGORY_NAME => 'DEVICE_CATEGORY_NAME', + self::DEVICE_NAME => 'DEVICE_NAME', + self::EXCHANGE_THIRD_PARTY_COMPANY_ID => 'EXCHANGE_THIRD_PARTY_COMPANY_ID', + self::EXCHANGE_THIRD_PARTY_COMPANY_NAME => 'EXCHANGE_THIRD_PARTY_COMPANY_NAME', + self::FIRST_LOOK_PRICING_RULE_ID => 'FIRST_LOOK_PRICING_RULE_ID', + self::FIRST_LOOK_PRICING_RULE_NAME => 'FIRST_LOOK_PRICING_RULE_NAME', + self::HOUR => 'HOUR', + self::INTERACTION_TYPE => 'INTERACTION_TYPE', + self::INTERACTION_TYPE_NAME => 'INTERACTION_TYPE_NAME', + self::INVENTORY_FORMAT => 'INVENTORY_FORMAT', + self::INVENTORY_FORMAT_NAME => 'INVENTORY_FORMAT_NAME', + self::INVENTORY_TYPE => 'INVENTORY_TYPE', + self::INVENTORY_TYPE_NAME => 'INVENTORY_TYPE_NAME', + self::IS_ADX_DIRECT => 'IS_ADX_DIRECT', + self::IS_FIRST_LOOK_DEAL => 'IS_FIRST_LOOK_DEAL', + self::KEY_VALUES_ID => 'KEY_VALUES_ID', + self::KEY_VALUES_NAME => 'KEY_VALUES_NAME', + self::LINE_ITEM_ARCHIVED => 'LINE_ITEM_ARCHIVED', + self::LINE_ITEM_COMPANION_DELIVERY_OPTION => 'LINE_ITEM_COMPANION_DELIVERY_OPTION', + self::LINE_ITEM_COMPANION_DELIVERY_OPTION_NAME => 'LINE_ITEM_COMPANION_DELIVERY_OPTION_NAME', + self::LINE_ITEM_COMPUTED_STATUS => 'LINE_ITEM_COMPUTED_STATUS', + self::LINE_ITEM_COMPUTED_STATUS_NAME => 'LINE_ITEM_COMPUTED_STATUS_NAME', + self::LINE_ITEM_CONTRACTED_QUANTITY => 'LINE_ITEM_CONTRACTED_QUANTITY', + self::LINE_ITEM_COST_PER_UNIT => 'LINE_ITEM_COST_PER_UNIT', + self::LINE_ITEM_COST_TYPE => 'LINE_ITEM_COST_TYPE', + self::LINE_ITEM_COST_TYPE_NAME => 'LINE_ITEM_COST_TYPE_NAME', + self::LINE_ITEM_CREATIVE_END_DATE => 'LINE_ITEM_CREATIVE_END_DATE', + self::LINE_ITEM_CREATIVE_ROTATION_TYPE => 'LINE_ITEM_CREATIVE_ROTATION_TYPE', + self::LINE_ITEM_CREATIVE_ROTATION_TYPE_NAME => 'LINE_ITEM_CREATIVE_ROTATION_TYPE_NAME', + self::LINE_ITEM_CREATIVE_START_DATE => 'LINE_ITEM_CREATIVE_START_DATE', + self::LINE_ITEM_CURRENCY_CODE => 'LINE_ITEM_CURRENCY_CODE', + self::LINE_ITEM_DELIVERY_INDICATOR => 'LINE_ITEM_DELIVERY_INDICATOR', + self::LINE_ITEM_DELIVERY_RATE_TYPE => 'LINE_ITEM_DELIVERY_RATE_TYPE', + self::LINE_ITEM_DELIVERY_RATE_TYPE_NAME => 'LINE_ITEM_DELIVERY_RATE_TYPE_NAME', + self::LINE_ITEM_DISCOUNT_ABSOLUTE => 'LINE_ITEM_DISCOUNT_ABSOLUTE', + self::LINE_ITEM_DISCOUNT_PERCENTAGE => 'LINE_ITEM_DISCOUNT_PERCENTAGE', + self::LINE_ITEM_END_DATE => 'LINE_ITEM_END_DATE', + self::LINE_ITEM_END_DATE_TIME => 'LINE_ITEM_END_DATE_TIME', + self::LINE_ITEM_ENVIRONMENT_TYPE => 'LINE_ITEM_ENVIRONMENT_TYPE', + self::LINE_ITEM_ENVIRONMENT_TYPE_NAME => 'LINE_ITEM_ENVIRONMENT_TYPE_NAME', + self::LINE_ITEM_EXTERNAL_DEAL_ID => 'LINE_ITEM_EXTERNAL_DEAL_ID', + self::LINE_ITEM_EXTERNAL_ID => 'LINE_ITEM_EXTERNAL_ID', + self::LINE_ITEM_FREQUENCY_CAP => 'LINE_ITEM_FREQUENCY_CAP', + self::LINE_ITEM_ID => 'LINE_ITEM_ID', + self::LINE_ITEM_LAST_MODIFIED_BY_APP => 'LINE_ITEM_LAST_MODIFIED_BY_APP', + self::LINE_ITEM_LIFETIME_CLICKS => 'LINE_ITEM_LIFETIME_CLICKS', + self::LINE_ITEM_LIFETIME_IMPRESSIONS => 'LINE_ITEM_LIFETIME_IMPRESSIONS', + self::LINE_ITEM_LIFETIME_VIEWABLE_IMPRESSIONS => 'LINE_ITEM_LIFETIME_VIEWABLE_IMPRESSIONS', + self::LINE_ITEM_MAKEGOOD => 'LINE_ITEM_MAKEGOOD', + self::LINE_ITEM_NAME => 'LINE_ITEM_NAME', + self::LINE_ITEM_NON_CPD_BOOKED_REVENUE => 'LINE_ITEM_NON_CPD_BOOKED_REVENUE', + self::LINE_ITEM_OPTIMIZABLE => 'LINE_ITEM_OPTIMIZABLE', + self::LINE_ITEM_PRIMARY_GOAL_TYPE => 'LINE_ITEM_PRIMARY_GOAL_TYPE', + self::LINE_ITEM_PRIMARY_GOAL_TYPE_NAME => 'LINE_ITEM_PRIMARY_GOAL_TYPE_NAME', + self::LINE_ITEM_PRIMARY_GOAL_UNITS_ABSOLUTE => 'LINE_ITEM_PRIMARY_GOAL_UNITS_ABSOLUTE', + self::LINE_ITEM_PRIMARY_GOAL_UNITS_PERCENTAGE => 'LINE_ITEM_PRIMARY_GOAL_UNITS_PERCENTAGE', + self::LINE_ITEM_PRIMARY_GOAL_UNIT_TYPE => 'LINE_ITEM_PRIMARY_GOAL_UNIT_TYPE', + self::LINE_ITEM_PRIMARY_GOAL_UNIT_TYPE_NAME => 'LINE_ITEM_PRIMARY_GOAL_UNIT_TYPE_NAME', + self::LINE_ITEM_PRIORITY => 'LINE_ITEM_PRIORITY', + self::LINE_ITEM_RESERVATION_STATUS => 'LINE_ITEM_RESERVATION_STATUS', + self::LINE_ITEM_RESERVATION_STATUS_NAME => 'LINE_ITEM_RESERVATION_STATUS_NAME', + self::LINE_ITEM_START_DATE => 'LINE_ITEM_START_DATE', + self::LINE_ITEM_START_DATE_TIME => 'LINE_ITEM_START_DATE_TIME', + self::LINE_ITEM_TYPE => 'LINE_ITEM_TYPE', + self::LINE_ITEM_TYPE_NAME => 'LINE_ITEM_TYPE_NAME', + self::LINE_ITEM_UNLIMITED_END => 'LINE_ITEM_UNLIMITED_END', + self::LINE_ITEM_VALUE_COST_PER_UNIT => 'LINE_ITEM_VALUE_COST_PER_UNIT', + self::LINE_ITEM_WEB_PROPERTY_CODE => 'LINE_ITEM_WEB_PROPERTY_CODE', + self::MASTER_COMPANION_CREATIVE_ID => 'MASTER_COMPANION_CREATIVE_ID', + self::MASTER_COMPANION_CREATIVE_NAME => 'MASTER_COMPANION_CREATIVE_NAME', + self::MOBILE_APP_FREE => 'MOBILE_APP_FREE', + self::MOBILE_APP_ICON_URL => 'MOBILE_APP_ICON_URL', + self::MOBILE_APP_ID => 'MOBILE_APP_ID', + self::MOBILE_APP_NAME => 'MOBILE_APP_NAME', + self::MOBILE_APP_OWNERSHIP_STATUS => 'MOBILE_APP_OWNERSHIP_STATUS', + self::MOBILE_APP_OWNERSHIP_STATUS_NAME => 'MOBILE_APP_OWNERSHIP_STATUS_NAME', + self::MOBILE_APP_STORE => 'MOBILE_APP_STORE', + self::MOBILE_APP_STORE_NAME => 'MOBILE_APP_STORE_NAME', + self::MOBILE_INVENTORY_TYPE => 'MOBILE_INVENTORY_TYPE', + self::MOBILE_INVENTORY_TYPE_NAME => 'MOBILE_INVENTORY_TYPE_NAME', + self::MOBILE_SDK_VERSION_NAME => 'MOBILE_SDK_VERSION_NAME', + self::MONTH_YEAR => 'MONTH_YEAR', + self::NATIVE_AD_FORMAT_ID => 'NATIVE_AD_FORMAT_ID', + self::NATIVE_AD_FORMAT_NAME => 'NATIVE_AD_FORMAT_NAME', + self::NATIVE_STYLE_ID => 'NATIVE_STYLE_ID', + self::NATIVE_STYLE_NAME => 'NATIVE_STYLE_NAME', + self::OPERATING_SYSTEM_CATEGORY => 'OPERATING_SYSTEM_CATEGORY', + self::OPERATING_SYSTEM_CATEGORY_NAME => 'OPERATING_SYSTEM_CATEGORY_NAME', + self::OPERATING_SYSTEM_VERSION_ID => 'OPERATING_SYSTEM_VERSION_ID', + self::OPERATING_SYSTEM_VERSION_NAME => 'OPERATING_SYSTEM_VERSION_NAME', + self::ORDER_AGENCY => 'ORDER_AGENCY', + self::ORDER_AGENCY_ID => 'ORDER_AGENCY_ID', + self::ORDER_BOOKED_CPC => 'ORDER_BOOKED_CPC', + self::ORDER_BOOKED_CPM => 'ORDER_BOOKED_CPM', + self::ORDER_DELIVERY_STATUS => 'ORDER_DELIVERY_STATUS', + self::ORDER_DELIVERY_STATUS_NAME => 'ORDER_DELIVERY_STATUS_NAME', + self::ORDER_END_DATE => 'ORDER_END_DATE', + self::ORDER_END_DATE_TIME => 'ORDER_END_DATE_TIME', + self::ORDER_EXTERNAL_ID => 'ORDER_EXTERNAL_ID', + self::ORDER_ID => 'ORDER_ID', + self::ORDER_LABELS => 'ORDER_LABELS', + self::ORDER_LABEL_IDS => 'ORDER_LABEL_IDS', + self::ORDER_LIFETIME_CLICKS => 'ORDER_LIFETIME_CLICKS', + self::ORDER_LIFETIME_IMPRESSIONS => 'ORDER_LIFETIME_IMPRESSIONS', + self::ORDER_NAME => 'ORDER_NAME', + self::ORDER_PO_NUMBER => 'ORDER_PO_NUMBER', + self::ORDER_PROGRAMMATIC => 'ORDER_PROGRAMMATIC', + self::ORDER_SALESPERSON => 'ORDER_SALESPERSON', + self::ORDER_SECONDARY_SALESPEOPLE => 'ORDER_SECONDARY_SALESPEOPLE', + self::ORDER_SECONDARY_SALESPEOPLE_ID => 'ORDER_SECONDARY_SALESPEOPLE_ID', + self::ORDER_SECONDARY_TRAFFICKERS => 'ORDER_SECONDARY_TRAFFICKERS', + self::ORDER_SECONDARY_TRAFFICKERS_ID => 'ORDER_SECONDARY_TRAFFICKERS_ID', + self::ORDER_START_DATE => 'ORDER_START_DATE', + self::ORDER_START_DATE_TIME => 'ORDER_START_DATE_TIME', + self::ORDER_TRAFFICKER => 'ORDER_TRAFFICKER', + self::ORDER_TRAFFICKER_ID => 'ORDER_TRAFFICKER_ID', + self::ORDER_UNLIMITED_END => 'ORDER_UNLIMITED_END', + self::PLACEMENT_ID => 'PLACEMENT_ID', + self::PLACEMENT_ID_ALL => 'PLACEMENT_ID_ALL', + self::PLACEMENT_NAME => 'PLACEMENT_NAME', + self::PLACEMENT_NAME_ALL => 'PLACEMENT_NAME_ALL', + self::PLACEMENT_STATUS => 'PLACEMENT_STATUS', + self::PLACEMENT_STATUS_ALL => 'PLACEMENT_STATUS_ALL', + self::PLACEMENT_STATUS_NAME => 'PLACEMENT_STATUS_NAME', + self::PLACEMENT_STATUS_NAME_ALL => 'PLACEMENT_STATUS_NAME_ALL', + self::PROGRAMMATIC_BUYER_ID => 'PROGRAMMATIC_BUYER_ID', + self::PROGRAMMATIC_BUYER_NAME => 'PROGRAMMATIC_BUYER_NAME', + self::PROGRAMMATIC_CHANNEL => 'PROGRAMMATIC_CHANNEL', + self::PROGRAMMATIC_CHANNEL_NAME => 'PROGRAMMATIC_CHANNEL_NAME', + self::RENDERED_CREATIVE_SIZE => 'RENDERED_CREATIVE_SIZE', + self::REQUESTED_AD_SIZES => 'REQUESTED_AD_SIZES', + self::REQUEST_TYPE => 'REQUEST_TYPE', + self::REQUEST_TYPE_NAME => 'REQUEST_TYPE_NAME', + self::SITE => 'SITE', + self::TARGETING_ID => 'TARGETING_ID', + self::TARGETING_NAME => 'TARGETING_NAME', + self::TARGETING_TYPE => 'TARGETING_TYPE', + self::TARGETING_TYPE_NAME => 'TARGETING_TYPE_NAME', + self::TRAFFIC_SOURCE => 'TRAFFIC_SOURCE', + self::TRAFFIC_SOURCE_NAME => 'TRAFFIC_SOURCE_NAME', + self::UNIFIED_PRICING_RULE_ID => 'UNIFIED_PRICING_RULE_ID', + self::UNIFIED_PRICING_RULE_NAME => 'UNIFIED_PRICING_RULE_NAME', + self::VIDEO_PLCMT => 'VIDEO_PLCMT', + self::VIDEO_PLCMT_NAME => 'VIDEO_PLCMT_NAME', + self::WEEK => 'WEEK', + self::YIELD_GROUP_BUYER_NAME => 'YIELD_GROUP_BUYER_NAME', + self::YIELD_GROUP_ID => 'YIELD_GROUP_ID', + self::YIELD_GROUP_NAME => 'YIELD_GROUP_NAME', + self::LINE_ITEM_CUSTOM_FIELD_0_OPTION_ID => 'LINE_ITEM_CUSTOM_FIELD_0_OPTION_ID', + self::LINE_ITEM_CUSTOM_FIELD_1_OPTION_ID => 'LINE_ITEM_CUSTOM_FIELD_1_OPTION_ID', + self::LINE_ITEM_CUSTOM_FIELD_2_OPTION_ID => 'LINE_ITEM_CUSTOM_FIELD_2_OPTION_ID', + self::LINE_ITEM_CUSTOM_FIELD_3_OPTION_ID => 'LINE_ITEM_CUSTOM_FIELD_3_OPTION_ID', + self::LINE_ITEM_CUSTOM_FIELD_4_OPTION_ID => 'LINE_ITEM_CUSTOM_FIELD_4_OPTION_ID', + self::LINE_ITEM_CUSTOM_FIELD_5_OPTION_ID => 'LINE_ITEM_CUSTOM_FIELD_5_OPTION_ID', + self::LINE_ITEM_CUSTOM_FIELD_6_OPTION_ID => 'LINE_ITEM_CUSTOM_FIELD_6_OPTION_ID', + self::LINE_ITEM_CUSTOM_FIELD_7_OPTION_ID => 'LINE_ITEM_CUSTOM_FIELD_7_OPTION_ID', + self::LINE_ITEM_CUSTOM_FIELD_8_OPTION_ID => 'LINE_ITEM_CUSTOM_FIELD_8_OPTION_ID', + self::LINE_ITEM_CUSTOM_FIELD_9_OPTION_ID => 'LINE_ITEM_CUSTOM_FIELD_9_OPTION_ID', + self::LINE_ITEM_CUSTOM_FIELD_10_OPTION_ID => 'LINE_ITEM_CUSTOM_FIELD_10_OPTION_ID', + self::LINE_ITEM_CUSTOM_FIELD_11_OPTION_ID => 'LINE_ITEM_CUSTOM_FIELD_11_OPTION_ID', + self::LINE_ITEM_CUSTOM_FIELD_12_OPTION_ID => 'LINE_ITEM_CUSTOM_FIELD_12_OPTION_ID', + self::LINE_ITEM_CUSTOM_FIELD_13_OPTION_ID => 'LINE_ITEM_CUSTOM_FIELD_13_OPTION_ID', + self::LINE_ITEM_CUSTOM_FIELD_14_OPTION_ID => 'LINE_ITEM_CUSTOM_FIELD_14_OPTION_ID', + self::LINE_ITEM_CUSTOM_FIELD_0_VALUE => 'LINE_ITEM_CUSTOM_FIELD_0_VALUE', + self::LINE_ITEM_CUSTOM_FIELD_1_VALUE => 'LINE_ITEM_CUSTOM_FIELD_1_VALUE', + self::LINE_ITEM_CUSTOM_FIELD_2_VALUE => 'LINE_ITEM_CUSTOM_FIELD_2_VALUE', + self::LINE_ITEM_CUSTOM_FIELD_3_VALUE => 'LINE_ITEM_CUSTOM_FIELD_3_VALUE', + self::LINE_ITEM_CUSTOM_FIELD_4_VALUE => 'LINE_ITEM_CUSTOM_FIELD_4_VALUE', + self::LINE_ITEM_CUSTOM_FIELD_5_VALUE => 'LINE_ITEM_CUSTOM_FIELD_5_VALUE', + self::LINE_ITEM_CUSTOM_FIELD_6_VALUE => 'LINE_ITEM_CUSTOM_FIELD_6_VALUE', + self::LINE_ITEM_CUSTOM_FIELD_7_VALUE => 'LINE_ITEM_CUSTOM_FIELD_7_VALUE', + self::LINE_ITEM_CUSTOM_FIELD_8_VALUE => 'LINE_ITEM_CUSTOM_FIELD_8_VALUE', + self::LINE_ITEM_CUSTOM_FIELD_9_VALUE => 'LINE_ITEM_CUSTOM_FIELD_9_VALUE', + self::LINE_ITEM_CUSTOM_FIELD_10_VALUE => 'LINE_ITEM_CUSTOM_FIELD_10_VALUE', + self::LINE_ITEM_CUSTOM_FIELD_11_VALUE => 'LINE_ITEM_CUSTOM_FIELD_11_VALUE', + self::LINE_ITEM_CUSTOM_FIELD_12_VALUE => 'LINE_ITEM_CUSTOM_FIELD_12_VALUE', + self::LINE_ITEM_CUSTOM_FIELD_13_VALUE => 'LINE_ITEM_CUSTOM_FIELD_13_VALUE', + self::LINE_ITEM_CUSTOM_FIELD_14_VALUE => 'LINE_ITEM_CUSTOM_FIELD_14_VALUE', + self::ORDER_CUSTOM_FIELD_0_OPTION_ID => 'ORDER_CUSTOM_FIELD_0_OPTION_ID', + self::ORDER_CUSTOM_FIELD_1_OPTION_ID => 'ORDER_CUSTOM_FIELD_1_OPTION_ID', + self::ORDER_CUSTOM_FIELD_2_OPTION_ID => 'ORDER_CUSTOM_FIELD_2_OPTION_ID', + self::ORDER_CUSTOM_FIELD_3_OPTION_ID => 'ORDER_CUSTOM_FIELD_3_OPTION_ID', + self::ORDER_CUSTOM_FIELD_4_OPTION_ID => 'ORDER_CUSTOM_FIELD_4_OPTION_ID', + self::ORDER_CUSTOM_FIELD_5_OPTION_ID => 'ORDER_CUSTOM_FIELD_5_OPTION_ID', + self::ORDER_CUSTOM_FIELD_6_OPTION_ID => 'ORDER_CUSTOM_FIELD_6_OPTION_ID', + self::ORDER_CUSTOM_FIELD_7_OPTION_ID => 'ORDER_CUSTOM_FIELD_7_OPTION_ID', + self::ORDER_CUSTOM_FIELD_8_OPTION_ID => 'ORDER_CUSTOM_FIELD_8_OPTION_ID', + self::ORDER_CUSTOM_FIELD_9_OPTION_ID => 'ORDER_CUSTOM_FIELD_9_OPTION_ID', + self::ORDER_CUSTOM_FIELD_10_OPTION_ID => 'ORDER_CUSTOM_FIELD_10_OPTION_ID', + self::ORDER_CUSTOM_FIELD_11_OPTION_ID => 'ORDER_CUSTOM_FIELD_11_OPTION_ID', + self::ORDER_CUSTOM_FIELD_12_OPTION_ID => 'ORDER_CUSTOM_FIELD_12_OPTION_ID', + self::ORDER_CUSTOM_FIELD_13_OPTION_ID => 'ORDER_CUSTOM_FIELD_13_OPTION_ID', + self::ORDER_CUSTOM_FIELD_14_OPTION_ID => 'ORDER_CUSTOM_FIELD_14_OPTION_ID', + self::ORDER_CUSTOM_FIELD_0_VALUE => 'ORDER_CUSTOM_FIELD_0_VALUE', + self::ORDER_CUSTOM_FIELD_1_VALUE => 'ORDER_CUSTOM_FIELD_1_VALUE', + self::ORDER_CUSTOM_FIELD_2_VALUE => 'ORDER_CUSTOM_FIELD_2_VALUE', + self::ORDER_CUSTOM_FIELD_3_VALUE => 'ORDER_CUSTOM_FIELD_3_VALUE', + self::ORDER_CUSTOM_FIELD_4_VALUE => 'ORDER_CUSTOM_FIELD_4_VALUE', + self::ORDER_CUSTOM_FIELD_5_VALUE => 'ORDER_CUSTOM_FIELD_5_VALUE', + self::ORDER_CUSTOM_FIELD_6_VALUE => 'ORDER_CUSTOM_FIELD_6_VALUE', + self::ORDER_CUSTOM_FIELD_7_VALUE => 'ORDER_CUSTOM_FIELD_7_VALUE', + self::ORDER_CUSTOM_FIELD_8_VALUE => 'ORDER_CUSTOM_FIELD_8_VALUE', + self::ORDER_CUSTOM_FIELD_9_VALUE => 'ORDER_CUSTOM_FIELD_9_VALUE', + self::ORDER_CUSTOM_FIELD_10_VALUE => 'ORDER_CUSTOM_FIELD_10_VALUE', + self::ORDER_CUSTOM_FIELD_11_VALUE => 'ORDER_CUSTOM_FIELD_11_VALUE', + self::ORDER_CUSTOM_FIELD_12_VALUE => 'ORDER_CUSTOM_FIELD_12_VALUE', + self::ORDER_CUSTOM_FIELD_13_VALUE => 'ORDER_CUSTOM_FIELD_13_VALUE', + self::ORDER_CUSTOM_FIELD_14_VALUE => 'ORDER_CUSTOM_FIELD_14_VALUE', + self::CREATIVE_CUSTOM_FIELD_0_OPTION_ID => 'CREATIVE_CUSTOM_FIELD_0_OPTION_ID', + self::CREATIVE_CUSTOM_FIELD_1_OPTION_ID => 'CREATIVE_CUSTOM_FIELD_1_OPTION_ID', + self::CREATIVE_CUSTOM_FIELD_2_OPTION_ID => 'CREATIVE_CUSTOM_FIELD_2_OPTION_ID', + self::CREATIVE_CUSTOM_FIELD_3_OPTION_ID => 'CREATIVE_CUSTOM_FIELD_3_OPTION_ID', + self::CREATIVE_CUSTOM_FIELD_4_OPTION_ID => 'CREATIVE_CUSTOM_FIELD_4_OPTION_ID', + self::CREATIVE_CUSTOM_FIELD_5_OPTION_ID => 'CREATIVE_CUSTOM_FIELD_5_OPTION_ID', + self::CREATIVE_CUSTOM_FIELD_6_OPTION_ID => 'CREATIVE_CUSTOM_FIELD_6_OPTION_ID', + self::CREATIVE_CUSTOM_FIELD_7_OPTION_ID => 'CREATIVE_CUSTOM_FIELD_7_OPTION_ID', + self::CREATIVE_CUSTOM_FIELD_8_OPTION_ID => 'CREATIVE_CUSTOM_FIELD_8_OPTION_ID', + self::CREATIVE_CUSTOM_FIELD_9_OPTION_ID => 'CREATIVE_CUSTOM_FIELD_9_OPTION_ID', + self::CREATIVE_CUSTOM_FIELD_10_OPTION_ID => 'CREATIVE_CUSTOM_FIELD_10_OPTION_ID', + self::CREATIVE_CUSTOM_FIELD_11_OPTION_ID => 'CREATIVE_CUSTOM_FIELD_11_OPTION_ID', + self::CREATIVE_CUSTOM_FIELD_12_OPTION_ID => 'CREATIVE_CUSTOM_FIELD_12_OPTION_ID', + self::CREATIVE_CUSTOM_FIELD_13_OPTION_ID => 'CREATIVE_CUSTOM_FIELD_13_OPTION_ID', + self::CREATIVE_CUSTOM_FIELD_14_OPTION_ID => 'CREATIVE_CUSTOM_FIELD_14_OPTION_ID', + self::CREATIVE_CUSTOM_FIELD_0_VALUE => 'CREATIVE_CUSTOM_FIELD_0_VALUE', + self::CREATIVE_CUSTOM_FIELD_1_VALUE => 'CREATIVE_CUSTOM_FIELD_1_VALUE', + self::CREATIVE_CUSTOM_FIELD_2_VALUE => 'CREATIVE_CUSTOM_FIELD_2_VALUE', + self::CREATIVE_CUSTOM_FIELD_3_VALUE => 'CREATIVE_CUSTOM_FIELD_3_VALUE', + self::CREATIVE_CUSTOM_FIELD_4_VALUE => 'CREATIVE_CUSTOM_FIELD_4_VALUE', + self::CREATIVE_CUSTOM_FIELD_5_VALUE => 'CREATIVE_CUSTOM_FIELD_5_VALUE', + self::CREATIVE_CUSTOM_FIELD_6_VALUE => 'CREATIVE_CUSTOM_FIELD_6_VALUE', + self::CREATIVE_CUSTOM_FIELD_7_VALUE => 'CREATIVE_CUSTOM_FIELD_7_VALUE', + self::CREATIVE_CUSTOM_FIELD_8_VALUE => 'CREATIVE_CUSTOM_FIELD_8_VALUE', + self::CREATIVE_CUSTOM_FIELD_9_VALUE => 'CREATIVE_CUSTOM_FIELD_9_VALUE', + self::CREATIVE_CUSTOM_FIELD_10_VALUE => 'CREATIVE_CUSTOM_FIELD_10_VALUE', + self::CREATIVE_CUSTOM_FIELD_11_VALUE => 'CREATIVE_CUSTOM_FIELD_11_VALUE', + self::CREATIVE_CUSTOM_FIELD_12_VALUE => 'CREATIVE_CUSTOM_FIELD_12_VALUE', + self::CREATIVE_CUSTOM_FIELD_13_VALUE => 'CREATIVE_CUSTOM_FIELD_13_VALUE', + self::CREATIVE_CUSTOM_FIELD_14_VALUE => 'CREATIVE_CUSTOM_FIELD_14_VALUE', + self::BACKFILL_LINE_ITEM_CUSTOM_FIELD_0_OPTION_ID => 'BACKFILL_LINE_ITEM_CUSTOM_FIELD_0_OPTION_ID', + self::BACKFILL_LINE_ITEM_CUSTOM_FIELD_1_OPTION_ID => 'BACKFILL_LINE_ITEM_CUSTOM_FIELD_1_OPTION_ID', + self::BACKFILL_LINE_ITEM_CUSTOM_FIELD_2_OPTION_ID => 'BACKFILL_LINE_ITEM_CUSTOM_FIELD_2_OPTION_ID', + self::BACKFILL_LINE_ITEM_CUSTOM_FIELD_3_OPTION_ID => 'BACKFILL_LINE_ITEM_CUSTOM_FIELD_3_OPTION_ID', + self::BACKFILL_LINE_ITEM_CUSTOM_FIELD_4_OPTION_ID => 'BACKFILL_LINE_ITEM_CUSTOM_FIELD_4_OPTION_ID', + self::BACKFILL_LINE_ITEM_CUSTOM_FIELD_5_OPTION_ID => 'BACKFILL_LINE_ITEM_CUSTOM_FIELD_5_OPTION_ID', + self::BACKFILL_LINE_ITEM_CUSTOM_FIELD_6_OPTION_ID => 'BACKFILL_LINE_ITEM_CUSTOM_FIELD_6_OPTION_ID', + self::BACKFILL_LINE_ITEM_CUSTOM_FIELD_7_OPTION_ID => 'BACKFILL_LINE_ITEM_CUSTOM_FIELD_7_OPTION_ID', + self::BACKFILL_LINE_ITEM_CUSTOM_FIELD_8_OPTION_ID => 'BACKFILL_LINE_ITEM_CUSTOM_FIELD_8_OPTION_ID', + self::BACKFILL_LINE_ITEM_CUSTOM_FIELD_9_OPTION_ID => 'BACKFILL_LINE_ITEM_CUSTOM_FIELD_9_OPTION_ID', + self::BACKFILL_LINE_ITEM_CUSTOM_FIELD_10_OPTION_ID => 'BACKFILL_LINE_ITEM_CUSTOM_FIELD_10_OPTION_ID', + self::BACKFILL_LINE_ITEM_CUSTOM_FIELD_11_OPTION_ID => 'BACKFILL_LINE_ITEM_CUSTOM_FIELD_11_OPTION_ID', + self::BACKFILL_LINE_ITEM_CUSTOM_FIELD_12_OPTION_ID => 'BACKFILL_LINE_ITEM_CUSTOM_FIELD_12_OPTION_ID', + self::BACKFILL_LINE_ITEM_CUSTOM_FIELD_13_OPTION_ID => 'BACKFILL_LINE_ITEM_CUSTOM_FIELD_13_OPTION_ID', + self::BACKFILL_LINE_ITEM_CUSTOM_FIELD_14_OPTION_ID => 'BACKFILL_LINE_ITEM_CUSTOM_FIELD_14_OPTION_ID', + self::BACKFILL_LINE_ITEM_CUSTOM_FIELD_0_VALUE => 'BACKFILL_LINE_ITEM_CUSTOM_FIELD_0_VALUE', + self::BACKFILL_LINE_ITEM_CUSTOM_FIELD_1_VALUE => 'BACKFILL_LINE_ITEM_CUSTOM_FIELD_1_VALUE', + self::BACKFILL_LINE_ITEM_CUSTOM_FIELD_2_VALUE => 'BACKFILL_LINE_ITEM_CUSTOM_FIELD_2_VALUE', + self::BACKFILL_LINE_ITEM_CUSTOM_FIELD_3_VALUE => 'BACKFILL_LINE_ITEM_CUSTOM_FIELD_3_VALUE', + self::BACKFILL_LINE_ITEM_CUSTOM_FIELD_4_VALUE => 'BACKFILL_LINE_ITEM_CUSTOM_FIELD_4_VALUE', + self::BACKFILL_LINE_ITEM_CUSTOM_FIELD_5_VALUE => 'BACKFILL_LINE_ITEM_CUSTOM_FIELD_5_VALUE', + self::BACKFILL_LINE_ITEM_CUSTOM_FIELD_6_VALUE => 'BACKFILL_LINE_ITEM_CUSTOM_FIELD_6_VALUE', + self::BACKFILL_LINE_ITEM_CUSTOM_FIELD_7_VALUE => 'BACKFILL_LINE_ITEM_CUSTOM_FIELD_7_VALUE', + self::BACKFILL_LINE_ITEM_CUSTOM_FIELD_8_VALUE => 'BACKFILL_LINE_ITEM_CUSTOM_FIELD_8_VALUE', + self::BACKFILL_LINE_ITEM_CUSTOM_FIELD_9_VALUE => 'BACKFILL_LINE_ITEM_CUSTOM_FIELD_9_VALUE', + self::BACKFILL_LINE_ITEM_CUSTOM_FIELD_10_VALUE => 'BACKFILL_LINE_ITEM_CUSTOM_FIELD_10_VALUE', + self::BACKFILL_LINE_ITEM_CUSTOM_FIELD_11_VALUE => 'BACKFILL_LINE_ITEM_CUSTOM_FIELD_11_VALUE', + self::BACKFILL_LINE_ITEM_CUSTOM_FIELD_12_VALUE => 'BACKFILL_LINE_ITEM_CUSTOM_FIELD_12_VALUE', + self::BACKFILL_LINE_ITEM_CUSTOM_FIELD_13_VALUE => 'BACKFILL_LINE_ITEM_CUSTOM_FIELD_13_VALUE', + self::BACKFILL_LINE_ITEM_CUSTOM_FIELD_14_VALUE => 'BACKFILL_LINE_ITEM_CUSTOM_FIELD_14_VALUE', + self::BACKFILL_ORDER_CUSTOM_FIELD_0_OPTION_ID => 'BACKFILL_ORDER_CUSTOM_FIELD_0_OPTION_ID', + self::BACKFILL_ORDER_CUSTOM_FIELD_1_OPTION_ID => 'BACKFILL_ORDER_CUSTOM_FIELD_1_OPTION_ID', + self::BACKFILL_ORDER_CUSTOM_FIELD_2_OPTION_ID => 'BACKFILL_ORDER_CUSTOM_FIELD_2_OPTION_ID', + self::BACKFILL_ORDER_CUSTOM_FIELD_3_OPTION_ID => 'BACKFILL_ORDER_CUSTOM_FIELD_3_OPTION_ID', + self::BACKFILL_ORDER_CUSTOM_FIELD_4_OPTION_ID => 'BACKFILL_ORDER_CUSTOM_FIELD_4_OPTION_ID', + self::BACKFILL_ORDER_CUSTOM_FIELD_5_OPTION_ID => 'BACKFILL_ORDER_CUSTOM_FIELD_5_OPTION_ID', + self::BACKFILL_ORDER_CUSTOM_FIELD_6_OPTION_ID => 'BACKFILL_ORDER_CUSTOM_FIELD_6_OPTION_ID', + self::BACKFILL_ORDER_CUSTOM_FIELD_7_OPTION_ID => 'BACKFILL_ORDER_CUSTOM_FIELD_7_OPTION_ID', + self::BACKFILL_ORDER_CUSTOM_FIELD_8_OPTION_ID => 'BACKFILL_ORDER_CUSTOM_FIELD_8_OPTION_ID', + self::BACKFILL_ORDER_CUSTOM_FIELD_9_OPTION_ID => 'BACKFILL_ORDER_CUSTOM_FIELD_9_OPTION_ID', + self::BACKFILL_ORDER_CUSTOM_FIELD_10_OPTION_ID => 'BACKFILL_ORDER_CUSTOM_FIELD_10_OPTION_ID', + self::BACKFILL_ORDER_CUSTOM_FIELD_11_OPTION_ID => 'BACKFILL_ORDER_CUSTOM_FIELD_11_OPTION_ID', + self::BACKFILL_ORDER_CUSTOM_FIELD_12_OPTION_ID => 'BACKFILL_ORDER_CUSTOM_FIELD_12_OPTION_ID', + self::BACKFILL_ORDER_CUSTOM_FIELD_13_OPTION_ID => 'BACKFILL_ORDER_CUSTOM_FIELD_13_OPTION_ID', + self::BACKFILL_ORDER_CUSTOM_FIELD_14_OPTION_ID => 'BACKFILL_ORDER_CUSTOM_FIELD_14_OPTION_ID', + self::BACKFILL_ORDER_CUSTOM_FIELD_0_VALUE => 'BACKFILL_ORDER_CUSTOM_FIELD_0_VALUE', + self::BACKFILL_ORDER_CUSTOM_FIELD_1_VALUE => 'BACKFILL_ORDER_CUSTOM_FIELD_1_VALUE', + self::BACKFILL_ORDER_CUSTOM_FIELD_2_VALUE => 'BACKFILL_ORDER_CUSTOM_FIELD_2_VALUE', + self::BACKFILL_ORDER_CUSTOM_FIELD_3_VALUE => 'BACKFILL_ORDER_CUSTOM_FIELD_3_VALUE', + self::BACKFILL_ORDER_CUSTOM_FIELD_4_VALUE => 'BACKFILL_ORDER_CUSTOM_FIELD_4_VALUE', + self::BACKFILL_ORDER_CUSTOM_FIELD_5_VALUE => 'BACKFILL_ORDER_CUSTOM_FIELD_5_VALUE', + self::BACKFILL_ORDER_CUSTOM_FIELD_6_VALUE => 'BACKFILL_ORDER_CUSTOM_FIELD_6_VALUE', + self::BACKFILL_ORDER_CUSTOM_FIELD_7_VALUE => 'BACKFILL_ORDER_CUSTOM_FIELD_7_VALUE', + self::BACKFILL_ORDER_CUSTOM_FIELD_8_VALUE => 'BACKFILL_ORDER_CUSTOM_FIELD_8_VALUE', + self::BACKFILL_ORDER_CUSTOM_FIELD_9_VALUE => 'BACKFILL_ORDER_CUSTOM_FIELD_9_VALUE', + self::BACKFILL_ORDER_CUSTOM_FIELD_10_VALUE => 'BACKFILL_ORDER_CUSTOM_FIELD_10_VALUE', + self::BACKFILL_ORDER_CUSTOM_FIELD_11_VALUE => 'BACKFILL_ORDER_CUSTOM_FIELD_11_VALUE', + self::BACKFILL_ORDER_CUSTOM_FIELD_12_VALUE => 'BACKFILL_ORDER_CUSTOM_FIELD_12_VALUE', + self::BACKFILL_ORDER_CUSTOM_FIELD_13_VALUE => 'BACKFILL_ORDER_CUSTOM_FIELD_13_VALUE', + self::BACKFILL_ORDER_CUSTOM_FIELD_14_VALUE => 'BACKFILL_ORDER_CUSTOM_FIELD_14_VALUE', + self::BACKFILL_CREATIVE_CUSTOM_FIELD_0_OPTION_ID => 'BACKFILL_CREATIVE_CUSTOM_FIELD_0_OPTION_ID', + self::BACKFILL_CREATIVE_CUSTOM_FIELD_1_OPTION_ID => 'BACKFILL_CREATIVE_CUSTOM_FIELD_1_OPTION_ID', + self::BACKFILL_CREATIVE_CUSTOM_FIELD_2_OPTION_ID => 'BACKFILL_CREATIVE_CUSTOM_FIELD_2_OPTION_ID', + self::BACKFILL_CREATIVE_CUSTOM_FIELD_3_OPTION_ID => 'BACKFILL_CREATIVE_CUSTOM_FIELD_3_OPTION_ID', + self::BACKFILL_CREATIVE_CUSTOM_FIELD_4_OPTION_ID => 'BACKFILL_CREATIVE_CUSTOM_FIELD_4_OPTION_ID', + self::BACKFILL_CREATIVE_CUSTOM_FIELD_5_OPTION_ID => 'BACKFILL_CREATIVE_CUSTOM_FIELD_5_OPTION_ID', + self::BACKFILL_CREATIVE_CUSTOM_FIELD_6_OPTION_ID => 'BACKFILL_CREATIVE_CUSTOM_FIELD_6_OPTION_ID', + self::BACKFILL_CREATIVE_CUSTOM_FIELD_7_OPTION_ID => 'BACKFILL_CREATIVE_CUSTOM_FIELD_7_OPTION_ID', + self::BACKFILL_CREATIVE_CUSTOM_FIELD_8_OPTION_ID => 'BACKFILL_CREATIVE_CUSTOM_FIELD_8_OPTION_ID', + self::BACKFILL_CREATIVE_CUSTOM_FIELD_9_OPTION_ID => 'BACKFILL_CREATIVE_CUSTOM_FIELD_9_OPTION_ID', + self::BACKFILL_CREATIVE_CUSTOM_FIELD_10_OPTION_ID => 'BACKFILL_CREATIVE_CUSTOM_FIELD_10_OPTION_ID', + self::BACKFILL_CREATIVE_CUSTOM_FIELD_11_OPTION_ID => 'BACKFILL_CREATIVE_CUSTOM_FIELD_11_OPTION_ID', + self::BACKFILL_CREATIVE_CUSTOM_FIELD_12_OPTION_ID => 'BACKFILL_CREATIVE_CUSTOM_FIELD_12_OPTION_ID', + self::BACKFILL_CREATIVE_CUSTOM_FIELD_13_OPTION_ID => 'BACKFILL_CREATIVE_CUSTOM_FIELD_13_OPTION_ID', + self::BACKFILL_CREATIVE_CUSTOM_FIELD_14_OPTION_ID => 'BACKFILL_CREATIVE_CUSTOM_FIELD_14_OPTION_ID', + self::BACKFILL_CREATIVE_CUSTOM_FIELD_0_VALUE => 'BACKFILL_CREATIVE_CUSTOM_FIELD_0_VALUE', + self::BACKFILL_CREATIVE_CUSTOM_FIELD_1_VALUE => 'BACKFILL_CREATIVE_CUSTOM_FIELD_1_VALUE', + self::BACKFILL_CREATIVE_CUSTOM_FIELD_2_VALUE => 'BACKFILL_CREATIVE_CUSTOM_FIELD_2_VALUE', + self::BACKFILL_CREATIVE_CUSTOM_FIELD_3_VALUE => 'BACKFILL_CREATIVE_CUSTOM_FIELD_3_VALUE', + self::BACKFILL_CREATIVE_CUSTOM_FIELD_4_VALUE => 'BACKFILL_CREATIVE_CUSTOM_FIELD_4_VALUE', + self::BACKFILL_CREATIVE_CUSTOM_FIELD_5_VALUE => 'BACKFILL_CREATIVE_CUSTOM_FIELD_5_VALUE', + self::BACKFILL_CREATIVE_CUSTOM_FIELD_6_VALUE => 'BACKFILL_CREATIVE_CUSTOM_FIELD_6_VALUE', + self::BACKFILL_CREATIVE_CUSTOM_FIELD_7_VALUE => 'BACKFILL_CREATIVE_CUSTOM_FIELD_7_VALUE', + self::BACKFILL_CREATIVE_CUSTOM_FIELD_8_VALUE => 'BACKFILL_CREATIVE_CUSTOM_FIELD_8_VALUE', + self::BACKFILL_CREATIVE_CUSTOM_FIELD_9_VALUE => 'BACKFILL_CREATIVE_CUSTOM_FIELD_9_VALUE', + self::BACKFILL_CREATIVE_CUSTOM_FIELD_10_VALUE => 'BACKFILL_CREATIVE_CUSTOM_FIELD_10_VALUE', + self::BACKFILL_CREATIVE_CUSTOM_FIELD_11_VALUE => 'BACKFILL_CREATIVE_CUSTOM_FIELD_11_VALUE', + self::BACKFILL_CREATIVE_CUSTOM_FIELD_12_VALUE => 'BACKFILL_CREATIVE_CUSTOM_FIELD_12_VALUE', + self::BACKFILL_CREATIVE_CUSTOM_FIELD_13_VALUE => 'BACKFILL_CREATIVE_CUSTOM_FIELD_13_VALUE', + self::BACKFILL_CREATIVE_CUSTOM_FIELD_14_VALUE => 'BACKFILL_CREATIVE_CUSTOM_FIELD_14_VALUE', + self::CUSTOM_DIMENSION_0_VALUE_ID => 'CUSTOM_DIMENSION_0_VALUE_ID', + self::CUSTOM_DIMENSION_1_VALUE_ID => 'CUSTOM_DIMENSION_1_VALUE_ID', + self::CUSTOM_DIMENSION_2_VALUE_ID => 'CUSTOM_DIMENSION_2_VALUE_ID', + self::CUSTOM_DIMENSION_3_VALUE_ID => 'CUSTOM_DIMENSION_3_VALUE_ID', + self::CUSTOM_DIMENSION_4_VALUE_ID => 'CUSTOM_DIMENSION_4_VALUE_ID', + self::CUSTOM_DIMENSION_5_VALUE_ID => 'CUSTOM_DIMENSION_5_VALUE_ID', + self::CUSTOM_DIMENSION_6_VALUE_ID => 'CUSTOM_DIMENSION_6_VALUE_ID', + self::CUSTOM_DIMENSION_7_VALUE_ID => 'CUSTOM_DIMENSION_7_VALUE_ID', + self::CUSTOM_DIMENSION_8_VALUE_ID => 'CUSTOM_DIMENSION_8_VALUE_ID', + self::CUSTOM_DIMENSION_9_VALUE_ID => 'CUSTOM_DIMENSION_9_VALUE_ID', + self::CUSTOM_DIMENSION_0_VALUE => 'CUSTOM_DIMENSION_0_VALUE', + self::CUSTOM_DIMENSION_1_VALUE => 'CUSTOM_DIMENSION_1_VALUE', + self::CUSTOM_DIMENSION_2_VALUE => 'CUSTOM_DIMENSION_2_VALUE', + self::CUSTOM_DIMENSION_3_VALUE => 'CUSTOM_DIMENSION_3_VALUE', + self::CUSTOM_DIMENSION_4_VALUE => 'CUSTOM_DIMENSION_4_VALUE', + self::CUSTOM_DIMENSION_5_VALUE => 'CUSTOM_DIMENSION_5_VALUE', + self::CUSTOM_DIMENSION_6_VALUE => 'CUSTOM_DIMENSION_6_VALUE', + self::CUSTOM_DIMENSION_7_VALUE => 'CUSTOM_DIMENSION_7_VALUE', + self::CUSTOM_DIMENSION_8_VALUE => 'CUSTOM_DIMENSION_8_VALUE', + self::CUSTOM_DIMENSION_9_VALUE => 'CUSTOM_DIMENSION_9_VALUE', + ]; + + 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/AdsAdManager/src/V1/Report/Field.php b/AdsAdManager/src/V1/Report/Field.php new file mode 100644 index 000000000000..18b4a58903b3 --- /dev/null +++ b/AdsAdManager/src/V1/Report/Field.php @@ -0,0 +1,109 @@ +google.ads.admanager.v1.Report.Field + */ +class Field extends \Google\Protobuf\Internal\Message +{ + protected $field; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $dimension + * The dimension this field represents. + * @type int $metric + * The metric this field represents. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\ReportService::initOnce(); + parent::__construct($data); + } + + /** + * The dimension this field represents. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.Dimension dimension = 1; + * @return int + */ + public function getDimension() + { + return $this->readOneof(1); + } + + public function hasDimension() + { + return $this->hasOneof(1); + } + + /** + * The dimension this field represents. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.Dimension dimension = 1; + * @param int $var + * @return $this + */ + public function setDimension($var) + { + GPBUtil::checkEnum($var, \Google\Ads\AdManager\V1\Report\Dimension::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * The metric this field represents. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.Metric metric = 2; + * @return int + */ + public function getMetric() + { + return $this->readOneof(2); + } + + public function hasMetric() + { + return $this->hasOneof(2); + } + + /** + * The metric this field represents. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.Metric metric = 2; + * @param int $var + * @return $this + */ + public function setMetric($var) + { + GPBUtil::checkEnum($var, \Google\Ads\AdManager\V1\Report\Metric::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getField() + { + return $this->whichOneof("field"); + } + +} + + diff --git a/AdsAdManager/src/V1/Report/Filter.php b/AdsAdManager/src/V1/Report/Filter.php new file mode 100644 index 000000000000..15586cbbd0e7 --- /dev/null +++ b/AdsAdManager/src/V1/Report/Filter.php @@ -0,0 +1,175 @@ +google.ads.admanager.v1.Report.Filter + */ +class Filter extends \Google\Protobuf\Internal\Message +{ + protected $type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Ads\AdManager\V1\Report\Filter\FieldFilter $field_filter + * A filter on a single field. + * @type \Google\Ads\AdManager\V1\Report\Filter $not_filter + * A filter whose result is negated. + * @type \Google\Ads\AdManager\V1\Report\Filter\FilterList $and_filter + * A list of filters whose results are AND-ed. + * @type \Google\Ads\AdManager\V1\Report\Filter\FilterList $or_filter + * A list of filters whose results are OR-ed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\ReportService::initOnce(); + parent::__construct($data); + } + + /** + * A filter on a single field. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.Filter.FieldFilter field_filter = 1; + * @return \Google\Ads\AdManager\V1\Report\Filter\FieldFilter|null + */ + public function getFieldFilter() + { + return $this->readOneof(1); + } + + public function hasFieldFilter() + { + return $this->hasOneof(1); + } + + /** + * A filter on a single field. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.Filter.FieldFilter field_filter = 1; + * @param \Google\Ads\AdManager\V1\Report\Filter\FieldFilter $var + * @return $this + */ + public function setFieldFilter($var) + { + GPBUtil::checkMessage($var, \Google\Ads\AdManager\V1\Report\Filter\FieldFilter::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * A filter whose result is negated. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.Filter not_filter = 2; + * @return \Google\Ads\AdManager\V1\Report\Filter|null + */ + public function getNotFilter() + { + return $this->readOneof(2); + } + + public function hasNotFilter() + { + return $this->hasOneof(2); + } + + /** + * A filter whose result is negated. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.Filter not_filter = 2; + * @param \Google\Ads\AdManager\V1\Report\Filter $var + * @return $this + */ + public function setNotFilter($var) + { + GPBUtil::checkMessage($var, \Google\Ads\AdManager\V1\Report\Filter::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * A list of filters whose results are AND-ed. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.Filter.FilterList and_filter = 3; + * @return \Google\Ads\AdManager\V1\Report\Filter\FilterList|null + */ + public function getAndFilter() + { + return $this->readOneof(3); + } + + public function hasAndFilter() + { + return $this->hasOneof(3); + } + + /** + * A list of filters whose results are AND-ed. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.Filter.FilterList and_filter = 3; + * @param \Google\Ads\AdManager\V1\Report\Filter\FilterList $var + * @return $this + */ + public function setAndFilter($var) + { + GPBUtil::checkMessage($var, \Google\Ads\AdManager\V1\Report\Filter\FilterList::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * A list of filters whose results are OR-ed. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.Filter.FilterList or_filter = 4; + * @return \Google\Ads\AdManager\V1\Report\Filter\FilterList|null + */ + public function getOrFilter() + { + return $this->readOneof(4); + } + + public function hasOrFilter() + { + return $this->hasOneof(4); + } + + /** + * A list of filters whose results are OR-ed. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.Filter.FilterList or_filter = 4; + * @param \Google\Ads\AdManager\V1\Report\Filter\FilterList $var + * @return $this + */ + public function setOrFilter($var) + { + GPBUtil::checkMessage($var, \Google\Ads\AdManager\V1\Report\Filter\FilterList::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getType() + { + return $this->whichOneof("type"); + } + +} + + diff --git a/AdsAdManager/src/V1/Report/Filter/FieldFilter.php b/AdsAdManager/src/V1/Report/Filter/FieldFilter.php new file mode 100644 index 000000000000..c4f05e8d1a11 --- /dev/null +++ b/AdsAdManager/src/V1/Report/Filter/FieldFilter.php @@ -0,0 +1,286 @@ +google.ads.admanager.v1.Report.Filter.FieldFilter + */ +class FieldFilter extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The field to filter on. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.Field field = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $field = null; + /** + * Required. The operation of this filter. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.Filter.Operation operation = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $operation = 0; + /** + * Required. Values to filter to. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Value values = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + private $values; + /** + * Optional. Use to filter on a specific slice of data. + * + * Generated from protobuf field optional .google.ads.admanager.v1.Report.Slice slice = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $slice = null; + /** + * Optional. When using time period columns, use this to filter on a + * specific column. + * + * Generated from protobuf field optional int32 time_period_index = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $time_period_index = null; + /** + * Optional. Use to specify which metric value type to filter on. Defaults + * to PRIMARY. + * + * Generated from protobuf field optional .google.ads.admanager.v1.Report.MetricValueType metric_value_type = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $metric_value_type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Ads\AdManager\V1\Report\Field $field + * Required. The field to filter on. + * @type int $operation + * Required. The operation of this filter. + * @type array<\Google\Ads\AdManager\V1\Report\Value>|\Google\Protobuf\Internal\RepeatedField $values + * Required. Values to filter to. + * @type \Google\Ads\AdManager\V1\Report\Slice $slice + * Optional. Use to filter on a specific slice of data. + * @type int $time_period_index + * Optional. When using time period columns, use this to filter on a + * specific column. + * @type int $metric_value_type + * Optional. Use to specify which metric value type to filter on. Defaults + * to PRIMARY. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\ReportService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The field to filter on. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.Field field = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Ads\AdManager\V1\Report\Field|null + */ + public function getField() + { + return $this->field; + } + + public function hasField() + { + return isset($this->field); + } + + public function clearField() + { + unset($this->field); + } + + /** + * Required. The field to filter on. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.Field field = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Ads\AdManager\V1\Report\Field $var + * @return $this + */ + public function setField($var) + { + GPBUtil::checkMessage($var, \Google\Ads\AdManager\V1\Report\Field::class); + $this->field = $var; + + return $this; + } + + /** + * Required. The operation of this filter. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.Filter.Operation operation = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getOperation() + { + return $this->operation; + } + + /** + * Required. The operation of this filter. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.Filter.Operation operation = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setOperation($var) + { + GPBUtil::checkEnum($var, \Google\Ads\AdManager\V1\Report\Filter\Operation::class); + $this->operation = $var; + + return $this; + } + + /** + * Required. Values to filter to. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Value values = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getValues() + { + return $this->values; + } + + /** + * Required. Values to filter to. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Value values = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Ads\AdManager\V1\Report\Value>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\Report\Value::class); + $this->values = $arr; + + return $this; + } + + /** + * Optional. Use to filter on a specific slice of data. + * + * Generated from protobuf field optional .google.ads.admanager.v1.Report.Slice slice = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Ads\AdManager\V1\Report\Slice|null + */ + public function getSlice() + { + return $this->slice; + } + + public function hasSlice() + { + return isset($this->slice); + } + + public function clearSlice() + { + unset($this->slice); + } + + /** + * Optional. Use to filter on a specific slice of data. + * + * Generated from protobuf field optional .google.ads.admanager.v1.Report.Slice slice = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Ads\AdManager\V1\Report\Slice $var + * @return $this + */ + public function setSlice($var) + { + GPBUtil::checkMessage($var, \Google\Ads\AdManager\V1\Report\Slice::class); + $this->slice = $var; + + return $this; + } + + /** + * Optional. When using time period columns, use this to filter on a + * specific column. + * + * Generated from protobuf field optional int32 time_period_index = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getTimePeriodIndex() + { + return isset($this->time_period_index) ? $this->time_period_index : 0; + } + + public function hasTimePeriodIndex() + { + return isset($this->time_period_index); + } + + public function clearTimePeriodIndex() + { + unset($this->time_period_index); + } + + /** + * Optional. When using time period columns, use this to filter on a + * specific column. + * + * Generated from protobuf field optional int32 time_period_index = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setTimePeriodIndex($var) + { + GPBUtil::checkInt32($var); + $this->time_period_index = $var; + + return $this; + } + + /** + * Optional. Use to specify which metric value type to filter on. Defaults + * to PRIMARY. + * + * Generated from protobuf field optional .google.ads.admanager.v1.Report.MetricValueType metric_value_type = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMetricValueType() + { + return isset($this->metric_value_type) ? $this->metric_value_type : 0; + } + + public function hasMetricValueType() + { + return isset($this->metric_value_type); + } + + public function clearMetricValueType() + { + unset($this->metric_value_type); + } + + /** + * Optional. Use to specify which metric value type to filter on. Defaults + * to PRIMARY. + * + * Generated from protobuf field optional .google.ads.admanager.v1.Report.MetricValueType metric_value_type = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMetricValueType($var) + { + GPBUtil::checkEnum($var, \Google\Ads\AdManager\V1\Report\MetricValueType::class); + $this->metric_value_type = $var; + + return $this; + } + +} + + diff --git a/AdsAdManager/src/V1/Report/Filter/FilterList.php b/AdsAdManager/src/V1/Report/Filter/FilterList.php new file mode 100644 index 000000000000..18b3bd6ef52f --- /dev/null +++ b/AdsAdManager/src/V1/Report/Filter/FilterList.php @@ -0,0 +1,68 @@ +google.ads.admanager.v1.Report.Filter.FilterList + */ +class FilterList extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A list of filters. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Filter filters = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $filters; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Ads\AdManager\V1\Report\Filter>|\Google\Protobuf\Internal\RepeatedField $filters + * Required. A list of filters. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\ReportService::initOnce(); + parent::__construct($data); + } + + /** + * Required. A list of filters. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Filter filters = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFilters() + { + return $this->filters; + } + + /** + * Required. A list of filters. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Filter filters = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Ads\AdManager\V1\Report\Filter>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFilters($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\Report\Filter::class); + $this->filters = $arr; + + return $this; + } + +} + + diff --git a/AdsAdManager/src/V1/Report/Filter/Operation.php b/AdsAdManager/src/V1/Report/Filter/Operation.php new file mode 100644 index 000000000000..460971cb6667 --- /dev/null +++ b/AdsAdManager/src/V1/Report/Filter/Operation.php @@ -0,0 +1,132 @@ +google.ads.admanager.v1.Report.Filter.Operation + */ +class Operation +{ + /** + * For scalar operands, checks if the operand is in the set of provided + * filter values. + * For list operands, checks if any element in the operand is in the set + * of provided filter values. + * Default value. + * + * Generated from protobuf enum IN = 0; + */ + const IN = 0; + /** + * For scalar operands, checks that the operand is not in the set of + * provided filter values. + * For list operands, checks that none of the elements in the operand + * is in the set of provided filter values. + * + * Generated from protobuf enum NOT_IN = 1; + */ + const NOT_IN = 1; + /** + * For scalar string operands, checks if the operand contains any of the + * provided filter substrings. + * For string list operands, checks if any string in the operand contains + * any of the provided filter substrings. + * + * Generated from protobuf enum CONTAINS = 2; + */ + const CONTAINS = 2; + /** + * For scalar string operands, checks that the operand contains none of + * the provided filter substrings. + * For string list operands, checks that none of the strings in the + * operand contain none of the provided filter substrings. + * + * Generated from protobuf enum NOT_CONTAINS = 3; + */ + const NOT_CONTAINS = 3; + /** + * Operand is less than the provided filter value. + * + * Generated from protobuf enum LESS_THAN = 4; + */ + const LESS_THAN = 4; + /** + * Operand is less than or equal to provided filter value. + * + * Generated from protobuf enum LESS_THAN_EQUALS = 5; + */ + const LESS_THAN_EQUALS = 5; + /** + * Operand is greater than provided filter value. + * + * Generated from protobuf enum GREATER_THAN = 6; + */ + const GREATER_THAN = 6; + /** + * Operand is greater than or equal to provided filter value. + * + * Generated from protobuf enum GREATER_THAN_EQUALS = 7; + */ + const GREATER_THAN_EQUALS = 7; + /** + * Operand is between provided filter values. + * + * Generated from protobuf enum BETWEEN = 8; + */ + const BETWEEN = 8; + /** + * Operand matches against a regex or set of regexes (one must match) + * + * Generated from protobuf enum MATCHES = 9; + */ + const MATCHES = 9; + /** + * Operand negative matches against a regex or set of regexes (none must + * match) + * + * Generated from protobuf enum NOT_MATCHES = 10; + */ + const NOT_MATCHES = 10; + + private static $valueToName = [ + self::IN => 'IN', + self::NOT_IN => 'NOT_IN', + self::CONTAINS => 'CONTAINS', + self::NOT_CONTAINS => 'NOT_CONTAINS', + self::LESS_THAN => 'LESS_THAN', + self::LESS_THAN_EQUALS => 'LESS_THAN_EQUALS', + self::GREATER_THAN => 'GREATER_THAN', + self::GREATER_THAN_EQUALS => 'GREATER_THAN_EQUALS', + self::BETWEEN => 'BETWEEN', + self::MATCHES => 'MATCHES', + self::NOT_MATCHES => 'NOT_MATCHES', + ]; + + 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/AdsAdManager/src/V1/Report/Flag.php b/AdsAdManager/src/V1/Report/Flag.php new file mode 100644 index 000000000000..25920744cd5a --- /dev/null +++ b/AdsAdManager/src/V1/Report/Flag.php @@ -0,0 +1,118 @@ +google.ads.admanager.v1.Report.Flag + */ +class Flag extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Filters to apply for the flag. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Filter filters = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $filters; + /** + * Optional. Name of the flag. + * The flag names RED, YELLOW, GREEN, BLUE, PURPLE, and GREY correspond to + * the colored flags that appear in the UI. The UI will not display flags + * with other names, but they are available for use by API clients. + * + * Generated from protobuf field string name = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Ads\AdManager\V1\Report\Filter>|\Google\Protobuf\Internal\RepeatedField $filters + * Required. Filters to apply for the flag. + * @type string $name + * Optional. Name of the flag. + * The flag names RED, YELLOW, GREEN, BLUE, PURPLE, and GREY correspond to + * the colored flags that appear in the UI. The UI will not display flags + * with other names, but they are available for use by API clients. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\ReportService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Filters to apply for the flag. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Filter filters = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFilters() + { + return $this->filters; + } + + /** + * Required. Filters to apply for the flag. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Filter filters = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Ads\AdManager\V1\Report\Filter>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFilters($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\Report\Filter::class); + $this->filters = $arr; + + return $this; + } + + /** + * Optional. Name of the flag. + * The flag names RED, YELLOW, GREEN, BLUE, PURPLE, and GREY correspond to + * the colored flags that appear in the UI. The UI will not display flags + * with other names, but they are available for use by API clients. + * + * Generated from protobuf field string name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Optional. Name of the flag. + * The flag names RED, YELLOW, GREEN, BLUE, PURPLE, and GREY correspond to + * the colored flags that appear in the UI. The UI will not display flags + * with other names, but they are available for use by API clients. + * + * Generated from protobuf field string name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + + diff --git a/AdsAdManager/src/V1/Report/Metric.php b/AdsAdManager/src/V1/Report/Metric.php new file mode 100644 index 000000000000..eced4d9adff3 --- /dev/null +++ b/AdsAdManager/src/V1/Report/Metric.php @@ -0,0 +1,1306 @@ +google.ads.admanager.v1.Report.Metric + */ +class Metric +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum METRIC_UNSPECIFIED = 0; + */ + const METRIC_UNSPECIFIED = 0; + /** + * Active View total average time in seconds that specific impressions are + * reported as being viewable. + * + * Generated from protobuf enum ACTIVE_VIEW_AVERAGE_VIEWABLE_TIME = 61; + */ + const ACTIVE_VIEW_AVERAGE_VIEWABLE_TIME = 61; + /** + * Total number of impressions that were eligible to measure viewability. + * + * Generated from protobuf enum ACTIVE_VIEW_ELIGIBLE_IMPRESSIONS = 58; + */ + const ACTIVE_VIEW_ELIGIBLE_IMPRESSIONS = 58; + /** + * The total number of impressions that were sampled and measured by active + * view. + * + * Generated from protobuf enum ACTIVE_VIEW_MEASURABLE_IMPRESSIONS = 57; + */ + const ACTIVE_VIEW_MEASURABLE_IMPRESSIONS = 57; + /** + * The percentage of total impressions that were measurable by active view + * (out of all the total impressions sampled for active view). + * + * Generated from protobuf enum ACTIVE_VIEW_MEASURABLE_IMPRESSIONS_RATE = 60; + */ + const ACTIVE_VIEW_MEASURABLE_IMPRESSIONS_RATE = 60; + /** + * The total number of impressions viewed on the user's screen. + * + * Generated from protobuf enum ACTIVE_VIEW_VIEWABLE_IMPRESSIONS = 56; + */ + const ACTIVE_VIEW_VIEWABLE_IMPRESSIONS = 56; + /** + * The percentage of total impressions viewed on the user's screen (out of + * the total impressions measurable by active view). + * + * Generated from protobuf enum ACTIVE_VIEW_VIEWABLE_IMPRESSIONS_RATE = 59; + */ + const ACTIVE_VIEW_VIEWABLE_IMPRESSIONS_RATE = 59; + /** + * Active View AdSense average time in seconds that specific impressions are + * reported as being viewable. + * + * Generated from protobuf enum ADSENSE_ACTIVE_VIEW_AVERAGE_VIEWABLE_TIME = 73; + */ + const ADSENSE_ACTIVE_VIEW_AVERAGE_VIEWABLE_TIME = 73; + /** + * Total number of impressions delivered by AdSense that were eligible to + * measure viewability. + * + * Generated from protobuf enum ADSENSE_ACTIVE_VIEW_ELIGIBLE_IMPRESSIONS = 70; + */ + const ADSENSE_ACTIVE_VIEW_ELIGIBLE_IMPRESSIONS = 70; + /** + * The number of impressions delivered by AdSense that were sampled, and + * measurable by active view. + * + * Generated from protobuf enum ADSENSE_ACTIVE_VIEW_MEASURABLE_IMPRESSIONS = 69; + */ + const ADSENSE_ACTIVE_VIEW_MEASURABLE_IMPRESSIONS = 69; + /** + * The percentage of impressions delivered by AdSense that were measurable + * by active view (out of all AdSense impressions sampled for active view). + * + * Generated from protobuf enum ADSENSE_ACTIVE_VIEW_MEASURABLE_IMPRESSIONS_RATE = 72; + */ + const ADSENSE_ACTIVE_VIEW_MEASURABLE_IMPRESSIONS_RATE = 72; + /** + * The number of impressions delivered by AdSense viewed on the user's + * screen. + * + * Generated from protobuf enum ADSENSE_ACTIVE_VIEW_VIEWABLE_IMPRESSIONS = 68; + */ + const ADSENSE_ACTIVE_VIEW_VIEWABLE_IMPRESSIONS = 68; + /** + * The percentage of impressions delivered by AdSense viewed on the user's + * screen (out of AdSense impressions measurable by active view). + * + * Generated from protobuf enum ADSENSE_ACTIVE_VIEW_VIEWABLE_IMPRESSIONS_RATE = 71; + */ + const ADSENSE_ACTIVE_VIEW_VIEWABLE_IMPRESSIONS_RATE = 71; + /** + * The average effective cost-per-thousand-impressions earned from the ads + * delivered by AdSense through line item dynamic allocation. + * + * Generated from protobuf enum ADSENSE_AVERAGE_ECPM = 26; + */ + const ADSENSE_AVERAGE_ECPM = 26; + /** + * Number of clicks delivered by AdSense demand channel. + * + * Generated from protobuf enum ADSENSE_CLICKS = 23; + */ + const ADSENSE_CLICKS = 23; + /** + * The ratio of impressions served by AdSense that resulted in users + * clicking on an ad. The clickthrough rate (CTR) is updated nightly. The + * AdSense CTR is calculated as: (AdSense clicks / AdSense impressions). + * + * Generated from protobuf enum ADSENSE_CTR = 24; + */ + const ADSENSE_CTR = 24; + /** + * Total impressions delivered by AdSense. + * + * Generated from protobuf enum ADSENSE_IMPRESSIONS = 22; + */ + const ADSENSE_IMPRESSIONS = 22; + /** + * Ratio of clicks delivered by AdSense through line item dynamic allocation + * in relation to the total clicks delivered. + * + * Generated from protobuf enum ADSENSE_PERCENT_CLICKS = 28; + */ + const ADSENSE_PERCENT_CLICKS = 28; + /** + * Ratio of impressions delivered by AdSense through line item dynamic + * allocation in relation to the total impressions delivered. + * + * Generated from protobuf enum ADSENSE_PERCENT_IMPRESSIONS = 27; + */ + const ADSENSE_PERCENT_IMPRESSIONS = 27; + /** + * Ratio of revenue generated by AdSense through line item dynamic + * allocation in relation to the total revenue. + * + * Generated from protobuf enum ADSENSE_PERCENT_REVENUE = 29; + */ + const ADSENSE_PERCENT_REVENUE = 29; + /** + * Ratio of revenue generated by AdSense through line item dynamic + * allocation in relation to the total revenue (excluding CPD). + * + * Generated from protobuf enum ADSENSE_PERCENT_REVENUE_WITHOUT_CPD = 30; + */ + const ADSENSE_PERCENT_REVENUE_WITHOUT_CPD = 30; + /** + * The total number of times that an AdSense ad is delivered. + * + * Generated from protobuf enum ADSENSE_RESPONSES_SERVED = 41; + */ + const ADSENSE_RESPONSES_SERVED = 41; + /** + * Revenue generated from AdSense through line item dynamic allocation, + * calculated in the network's currency and time zone. + * + * Generated from protobuf enum ADSENSE_REVENUE = 25; + */ + const ADSENSE_REVENUE = 25; + /** + * Active View AdExchange average time in seconds that specific impressions + * are reported as being viewable. + * + * Generated from protobuf enum AD_EXCHANGE_ACTIVE_VIEW_AVERAGE_VIEWABLE_TIME = 79; + */ + const AD_EXCHANGE_ACTIVE_VIEW_AVERAGE_VIEWABLE_TIME = 79; + /** + * Total number of impressions delivered by Ad Exchange that were eligible + * to measure viewability. + * + * Generated from protobuf enum AD_EXCHANGE_ACTIVE_VIEW_ELIGIBLE_IMPRESSIONS = 76; + */ + const AD_EXCHANGE_ACTIVE_VIEW_ELIGIBLE_IMPRESSIONS = 76; + /** + * The number of impressions delivered by Ad Exchange that were sampled, and + * measurable by active view. + * + * Generated from protobuf enum AD_EXCHANGE_ACTIVE_VIEW_MEASURABLE_IMPRESSIONS = 75; + */ + const AD_EXCHANGE_ACTIVE_VIEW_MEASURABLE_IMPRESSIONS = 75; + /** + * The percentage of impressions delivered by Ad Exchange that were + * measurable by active view (out of all Ad Exchange impressions sampled for + * active view). + * + * Generated from protobuf enum AD_EXCHANGE_ACTIVE_VIEW_MEASURABLE_IMPRESSIONS_RATE = 78; + */ + const AD_EXCHANGE_ACTIVE_VIEW_MEASURABLE_IMPRESSIONS_RATE = 78; + /** + * The number of impressions delivered by Ad Exchange viewed on the user's + * screen. + * + * Generated from protobuf enum AD_EXCHANGE_ACTIVE_VIEW_VIEWABLE_IMPRESSIONS = 74; + */ + const AD_EXCHANGE_ACTIVE_VIEW_VIEWABLE_IMPRESSIONS = 74; + /** + * The percentage of impressions delivered by Ad Exchange viewed on the + * user's screen (out of Ad Exchange impressions measurable by active view). + * + * Generated from protobuf enum AD_EXCHANGE_ACTIVE_VIEW_VIEWABLE_IMPRESSIONS_RATE = 77; + */ + const AD_EXCHANGE_ACTIVE_VIEW_VIEWABLE_IMPRESSIONS_RATE = 77; + /** + * The average effective cost-per-thousand-impressions earned from the ads + * delivered by Ad Exchange through line item dynamic allocation. + * + * Generated from protobuf enum AD_EXCHANGE_AVERAGE_ECPM = 18; + */ + const AD_EXCHANGE_AVERAGE_ECPM = 18; + /** + * Number of clicks delivered by the Ad Exchange. + * + * Generated from protobuf enum AD_EXCHANGE_CLICKS = 15; + */ + const AD_EXCHANGE_CLICKS = 15; + /** + * The ratio of impressions served by the Ad Exchange that resulted in users + * clicking on an ad. The clickthrough rate (CTR) is updated nightly. Ad + * Exchange CTR is calculated as: (Ad Exchange clicks / Ad Exchange + * impressions). + * + * Generated from protobuf enum AD_EXCHANGE_CTR = 16; + */ + const AD_EXCHANGE_CTR = 16; + /** + * Total impressions delivered by the Ad Exchange. + * + * Generated from protobuf enum AD_EXCHANGE_IMPRESSIONS = 14; + */ + const AD_EXCHANGE_IMPRESSIONS = 14; + /** + * Ratio of clicks delivered by Ad Exchange through line item dynamic + * allocation in relation to the total clicks delivered. + * + * Generated from protobuf enum AD_EXCHANGE_PERCENT_CLICKS = 20; + */ + const AD_EXCHANGE_PERCENT_CLICKS = 20; + /** + * Ratio of impressions delivered by Ad Exchange through line item dynamic + * allocation in relation to the total impressions delivered. + * + * Generated from protobuf enum AD_EXCHANGE_PERCENT_IMPRESSIONS = 19; + */ + const AD_EXCHANGE_PERCENT_IMPRESSIONS = 19; + /** + * Ratio of revenue generated by Ad Exchange through line item dynamic + * allocation in relation to the total revenue. + * + * Generated from protobuf enum AD_EXCHANGE_PERCENT_REVENUE = 21; + */ + const AD_EXCHANGE_PERCENT_REVENUE = 21; + /** + * Ratio of revenue generated by Ad Exchange through line item dynamic + * allocation in relation to the total revenue (excluding CPD). + * + * Generated from protobuf enum AD_EXCHANGE_PERCENT_REVENUE_WITHOUT_CPD = 31; + */ + const AD_EXCHANGE_PERCENT_REVENUE_WITHOUT_CPD = 31; + /** + * The total number of times that an Ad Exchange ad is delivered. + * + * Generated from protobuf enum AD_EXCHANGE_RESPONSES_SERVED = 42; + */ + const AD_EXCHANGE_RESPONSES_SERVED = 42; + /** + * Revenue generated from the Ad Exchange through line item dynamic + * allocation, calculated in your network's currency and time zone. + * + * Generated from protobuf enum AD_EXCHANGE_REVENUE = 17; + */ + const AD_EXCHANGE_REVENUE = 17; + /** + * The total number of times that an ad request is sent to the ad server + * including dynamic allocation. + * + * Generated from protobuf enum AD_REQUESTS = 38; + */ + const AD_REQUESTS = 38; + /** + * Active View ad server average time in seconds that specific impressions + * are reported as being viewable. + * + * Generated from protobuf enum AD_SERVER_ACTIVE_VIEW_AVERAGE_VIEWABLE_TIME = 67; + */ + const AD_SERVER_ACTIVE_VIEW_AVERAGE_VIEWABLE_TIME = 67; + /** + * Total number of impressions delivered by the ad server that were eligible + * to measure viewability. + * + * Generated from protobuf enum AD_SERVER_ACTIVE_VIEW_ELIGIBLE_IMPRESSIONS = 64; + */ + const AD_SERVER_ACTIVE_VIEW_ELIGIBLE_IMPRESSIONS = 64; + /** + * The number of impressions delivered by the ad server that were sampled, + * and measurable by active view. + * + * Generated from protobuf enum AD_SERVER_ACTIVE_VIEW_MEASURABLE_IMPRESSIONS = 63; + */ + const AD_SERVER_ACTIVE_VIEW_MEASURABLE_IMPRESSIONS = 63; + /** + * The percentage of impressions delivered by the ad server that were + * measurable by active view (out of all the ad server impressions sampled + * for active view). + * + * Generated from protobuf enum AD_SERVER_ACTIVE_VIEW_MEASURABLE_IMPRESSIONS_RATE = 66; + */ + const AD_SERVER_ACTIVE_VIEW_MEASURABLE_IMPRESSIONS_RATE = 66; + /** + * The number of impressions delivered by the ad server viewed on the user's + * screen. + * + * Generated from protobuf enum AD_SERVER_ACTIVE_VIEW_VIEWABLE_IMPRESSIONS = 62; + */ + const AD_SERVER_ACTIVE_VIEW_VIEWABLE_IMPRESSIONS = 62; + /** + * The percentage of impressions delivered by the ad server viewed on the + * user's screen (out of the ad server impressions measurable by active + * view). + * + * Generated from protobuf enum AD_SERVER_ACTIVE_VIEW_VIEWABLE_IMPRESSIONS_RATE = 65; + */ + const AD_SERVER_ACTIVE_VIEW_VIEWABLE_IMPRESSIONS_RATE = 65; + /** + * Average effective cost-per-thousand-impressions earned from the ads + * delivered by the Google Ad Manager server. + * + * Generated from protobuf enum AD_SERVER_AVERAGE_ECPM = 34; + */ + const AD_SERVER_AVERAGE_ECPM = 34; + /** + * Average effective cost-per-thousand-impressions earned from the ads + * delivered by the Google Ad Manager server, excluding CPD value. + * + * Generated from protobuf enum AD_SERVER_AVERAGE_ECPM_WITHOUT_CPD = 10; + */ + const AD_SERVER_AVERAGE_ECPM_WITHOUT_CPD = 10; + /** + * Total clicks served by the Google Ad Manager server. It usually takes + * about 30 minutes for new clicks to be recorded and added to the total + * displayed in reporting. + * + * Generated from protobuf enum AD_SERVER_CLICKS = 7; + */ + const AD_SERVER_CLICKS = 7; + /** + * CPD revenue earned, calculated in your network's currency, for + * the ads delivered by the Google Ad Manager server. Sum of all booked + * revenue. + * + * Generated from protobuf enum AD_SERVER_CPD_REVENUE = 32; + */ + const AD_SERVER_CPD_REVENUE = 32; + /** + * Ratio of impressions served by the Google Ad Manager server that resulted + * in users clicking on an ad. The clickthrough rate (CTR) is updated + * nightly. The ad server CTR is calculated as: (Ad server clicks / Ad + * server impressions). + * + * Generated from protobuf enum AD_SERVER_CTR = 8; + */ + const AD_SERVER_CTR = 8; + /** + * Total impressions delivered by the Ad Server. + * + * Generated from protobuf enum AD_SERVER_IMPRESSIONS = 6; + */ + const AD_SERVER_IMPRESSIONS = 6; + /** + * Ratio of clicks delivered by the Google Ad Manager server in relation to + * the total clicks delivered. + * + * Generated from protobuf enum AD_SERVER_PERCENT_CLICKS = 12; + */ + const AD_SERVER_PERCENT_CLICKS = 12; + /** + * Ratio of impressions delivered by the Google Ad Manager server in + * relation to the total impressions delivered. + * + * Generated from protobuf enum AD_SERVER_PERCENT_IMPRESSIONS = 11; + */ + const AD_SERVER_PERCENT_IMPRESSIONS = 11; + /** + * Ratio of revenue generated by the Google Ad Manager server in relation + * to the total revenue. + * + * Generated from protobuf enum AD_SERVER_PERCENT_REVENUE = 35; + */ + const AD_SERVER_PERCENT_REVENUE = 35; + /** + * Ratio of revenue generated by the Google Ad Manager server (excluding + * CPD) in relation to the total revenue. + * + * Generated from protobuf enum AD_SERVER_PERCENT_REVENUE_WITHOUT_CPD = 13; + */ + const AD_SERVER_PERCENT_REVENUE_WITHOUT_CPD = 13; + /** + * The total number of times that an ad is served by the ad server. + * + * Generated from protobuf enum AD_SERVER_RESPONSES_SERVED = 40; + */ + const AD_SERVER_RESPONSES_SERVED = 40; + /** + * All CPM, CPC, and CPD revenue earned, calculated in your network's + * currency, for the ads delivered by the Google Ad Manager server. + * Sum of all booked revenue. + * + * Generated from protobuf enum AD_SERVER_REVENUE = 33; + */ + const AD_SERVER_REVENUE = 33; + /** + * Revenue (excluding CPD) earned, calculated in your network's currency, + * for the ads delivered by the Google Ad Manager server. Sum of all booked + * revenue. + * + * Generated from protobuf enum AD_SERVER_REVENUE_WITHOUT_CPD = 9; + */ + const AD_SERVER_REVENUE_WITHOUT_CPD = 9; + /** + * Number of winning bids received from Open Bidding buyers, even when the + * winning bid is placed at the end of a mediation for mobile apps chain. + * + * Generated from protobuf enum AUCTIONS_WON = 80; + */ + const AUCTIONS_WON = 80; + /** + * eCPM averaged across the Google Ad Manager server, AdSense, + * and Ad Exchange. + * + * Generated from protobuf enum AVERAGE_ECPM = 37; + */ + const AVERAGE_ECPM = 37; + /** + * eCPM averaged across the Google Ad Manager server (excluding CPD), + * AdSense, and Ad Exchange. + * + * Generated from protobuf enum AVERAGE_ECPM_WITHOUT_CPD = 5; + */ + const AVERAGE_ECPM_WITHOUT_CPD = 5; + /** + * Number of bids received from Open Bidding buyers, regardless of whether + * the returned bid competes in an auction. + * + * Generated from protobuf enum BIDS = 81; + */ + const BIDS = 81; + /** + * Number of bids received from Open Bidding buyers that competed in + * the auction. + * + * Generated from protobuf enum BIDS_IN_AUCTION = 82; + */ + const BIDS_IN_AUCTION = 82; + /** + * Number of times a yield partner is asked to return bid to fill + * a yield group request. + * + * Generated from protobuf enum CALLOUTS = 83; + */ + const CALLOUTS = 83; + /** + * The number of times a user clicked on an ad. + * + * Generated from protobuf enum CLICKS = 2; + */ + const CLICKS = 2; + /** + * The total number of times that the code for an ad is served by the ad + * server including dynamic allocation. + * + * Generated from protobuf enum CODE_SERVED_COUNT = 44; + */ + const CODE_SERVED_COUNT = 44; + /** + * For standard ads, your ad clickthrough rate (CTR) is the number of ad + * clicks divided by the number of individual ad impressions expressed as a + * fraction. Ad CTR = Clicks / Ad impressions. + * + * Generated from protobuf enum CTR = 3; + */ + const CTR = 3; + /** + * The number of coviewed impressions sold by Google in partner sales. + * + * Generated from protobuf enum GOOGLE_SOLD_AUCTION_COVIEWED_IMPRESSIONS = 129; + */ + const GOOGLE_SOLD_AUCTION_COVIEWED_IMPRESSIONS = 129; + /** + * The number of auction impressions sold by Google in partner sales. + * + * Generated from protobuf enum GOOGLE_SOLD_AUCTION_IMPRESSIONS = 128; + */ + const GOOGLE_SOLD_AUCTION_IMPRESSIONS = 128; + /** + * The number of coviewed impressions sold by Google in partner sales. + * + * Generated from protobuf enum GOOGLE_SOLD_COVIEWED_IMPRESSIONS = 131; + */ + const GOOGLE_SOLD_COVIEWED_IMPRESSIONS = 131; + /** + * The number of impressions sold by Google in partner sales. + * + * Generated from protobuf enum GOOGLE_SOLD_IMPRESSIONS = 130; + */ + const GOOGLE_SOLD_IMPRESSIONS = 130; + /** + * The number of coviewed impressions sold by Google in partner sales. + * + * Generated from protobuf enum GOOGLE_SOLD_RESERVATION_COVIEWED_IMPRESSIONS = 127; + */ + const GOOGLE_SOLD_RESERVATION_COVIEWED_IMPRESSIONS = 127; + /** + * The number of reservation impressions sold by Google in partner sales. + * + * Generated from protobuf enum GOOGLE_SOLD_RESERVATION_IMPRESSIONS = 126; + */ + const GOOGLE_SOLD_RESERVATION_IMPRESSIONS = 126; + /** + * Total impressions from the Google Ad Manager server, AdSense, + * Ad Exchange, and yield group partners. + * + * Generated from protobuf enum IMPRESSIONS = 1; + */ + const IMPRESSIONS = 1; + /** + * The number of filled pod requests (filled by partner or Google) in + * partner sales. + * + * Generated from protobuf enum PARTNER_SALES_FILLED_POD_REQUESTS = 135; + */ + const PARTNER_SALES_FILLED_POD_REQUESTS = 135; + /** + * The percent of filled requests to total ad requests in + * partner sales. + * + * Generated from protobuf enum PARTNER_SALES_FILL_RATE = 136; + */ + const PARTNER_SALES_FILL_RATE = 136; + /** + * The percent of partner filled requests to total ad requests + * in partner sales. + * + * Generated from protobuf enum PARTNER_SALES_PARTNER_MATCH_RATE = 137; + */ + const PARTNER_SALES_PARTNER_MATCH_RATE = 137; + /** + * The number of queries eligible for partner sales. + * + * Generated from protobuf enum PARTNER_SALES_QUERIES = 132; + */ + const PARTNER_SALES_QUERIES = 132; + /** + * The number of partner unfilled impressions in partner sales. + * If a pod request is not filled by partner but filled by Google, this + * metric will still count 1. + * + * Generated from protobuf enum PARTNER_SALES_UNFILLED_IMPRESSIONS = 133; + */ + const PARTNER_SALES_UNFILLED_IMPRESSIONS = 133; + /** + * The number of partner unmatched queries in partner sales. + * If an ad request is not filled by partner but filled by Google, this + * metric will still count 1. + * + * Generated from protobuf enum PARTNER_SALES_UNMATCHED_QUERIES = 134; + */ + const PARTNER_SALES_UNMATCHED_QUERIES = 134; + /** + * The number of code served sold by partner in partner sales. + * + * Generated from protobuf enum PARTNER_SOLD_CODE_SERVED = 125; + */ + const PARTNER_SOLD_CODE_SERVED = 125; + /** + * The number of coviewed impressions sold by partner in partner sales. + * + * Generated from protobuf enum PARTNER_SOLD_COVIEWED_IMPRESSIONS = 124; + */ + const PARTNER_SOLD_COVIEWED_IMPRESSIONS = 124; + /** + * The number of impressions sold by partner in partner sales. + * + * Generated from protobuf enum PARTNER_SOLD_IMPRESSIONS = 123; + */ + const PARTNER_SOLD_IMPRESSIONS = 123; + /** + * The total number of ad requests eligible for programmatic inventory, + * including Programmatic Guaranteed, Preferred Deals, backfill, and open + * auction. + * + * Generated from protobuf enum PROGRAMMATIC_ELIGIBLE_AD_REQUESTS = 177; + */ + const PROGRAMMATIC_ELIGIBLE_AD_REQUESTS = 177; + /** + * The number of programmatic responses served divided by the number of + * programmatic eligible ad requests. Includes Ad Exchange, Open Bidding, + * and Preferred Deals. + * + * Generated from protobuf enum PROGRAMMATIC_MATCH_RATE = 178; + */ + const PROGRAMMATIC_MATCH_RATE = 178; + /** + * Total number of ad responses served from programmatic demand sources. + * Includes Ad Exchange, Open Bidding, and Preferred Deals. + * Differs from AD_EXCHANGE_RESPONSES_SERVED, which doesn't include Open + * Bidding ad requests. + * + * Generated from protobuf enum PROGRAMMATIC_RESPONSES_SERVED = 176; + */ + const PROGRAMMATIC_RESPONSES_SERVED = 176; + /** + * The total number of times that an ad is served by the ad server including + * dynamic allocation. + * + * Generated from protobuf enum RESPONSES_SERVED = 39; + */ + const RESPONSES_SERVED = 39; + /** + * Total amount of CPM, CPC, and CPD revenue based on the number of units + * served by the Google Ad Manager server, AdSense, Ad Exchange, and + * third-party Mediation networks. + * + * Generated from protobuf enum REVENUE = 36; + */ + const REVENUE = 36; + /** + * Total amount of revenue (excluding CPD) based on the number of units + * served by the Google Ad Manager server, AdSense, Ad Exchange, and + * third-party Mediation networks. + * + * Generated from protobuf enum REVENUE_WITHOUT_CPD = 4; + */ + const REVENUE_WITHOUT_CPD = 4; + /** + * Number of times a yield group buyer successfully returned a bid in + * response to a yield group callout. + * + * Generated from protobuf enum SUCCESSFUL_RESPONSES = 84; + */ + const SUCCESSFUL_RESPONSES = 84; + /** + * The total number of missed impressions due to the ad servers' inability + * to find ads to serve including dynamic allocation. + * + * Generated from protobuf enum UNFILLED_IMPRESSIONS = 45; + */ + const UNFILLED_IMPRESSIONS = 45; + /** + * The total number of times that an ad is not returned by the ad server. + * + * Generated from protobuf enum UNMATCHED_AD_REQUESTS = 43; + */ + const UNMATCHED_AD_REQUESTS = 43; + /** + * Number of times an Offerwall message was shown to users. + * + * Generated from protobuf enum USER_MESSAGES_OFFERWALL_MESSAGES_SHOWN = 121; + */ + const USER_MESSAGES_OFFERWALL_MESSAGES_SHOWN = 121; + /** + * The number of messages where the user gained an entitlement. + * + * Generated from protobuf enum USER_MESSAGES_OFFERWALL_SUCCESSFUL_ENGAGEMENTS = 122; + */ + const USER_MESSAGES_OFFERWALL_SUCCESSFUL_ENGAGEMENTS = 122; + /** + * The number of user interactions with a video, on average, such as pause, + * full screen, mute, etc. + * + * Generated from protobuf enum VIDEO_INTERACTION_AVERAGE_INTERACTION_RATE = 92; + */ + const VIDEO_INTERACTION_AVERAGE_INTERACTION_RATE = 92; + /** + * The number of times a user collapses a video, either to its original size + * or to a different size. + * + * Generated from protobuf enum VIDEO_INTERACTION_COLLAPSES = 93; + */ + const VIDEO_INTERACTION_COLLAPSES = 93; + /** + * The number of times a user expands a video. + * + * Generated from protobuf enum VIDEO_INTERACTION_EXPANDS = 95; + */ + const VIDEO_INTERACTION_EXPANDS = 95; + /** + * The number of times ad clip played in full screen mode. + * + * Generated from protobuf enum VIDEO_INTERACTION_FULL_SCREENS = 96; + */ + const VIDEO_INTERACTION_FULL_SCREENS = 96; + /** + * The number of times video player was in mute state during play of ad + * clip. + * + * Generated from protobuf enum VIDEO_INTERACTION_MUTES = 97; + */ + const VIDEO_INTERACTION_MUTES = 97; + /** + * The number of times user paused ad clip. + * + * Generated from protobuf enum VIDEO_INTERACTION_PAUSES = 98; + */ + const VIDEO_INTERACTION_PAUSES = 98; + /** + * The number of times the user unpaused the video. + * + * Generated from protobuf enum VIDEO_INTERACTION_RESUMES = 99; + */ + const VIDEO_INTERACTION_RESUMES = 99; + /** + * The number of times a user rewinds the video. + * + * Generated from protobuf enum VIDEO_INTERACTION_REWINDS = 100; + */ + const VIDEO_INTERACTION_REWINDS = 100; + /** + * The number of times a user unmutes the video. + * + * Generated from protobuf enum VIDEO_INTERACTION_UNMUTES = 101; + */ + const VIDEO_INTERACTION_UNMUTES = 101; + /** + * The number of times a skippable video is skipped. + * + * Generated from protobuf enum VIDEO_INTERACTION_VIDEO_SKIPS = 102; + */ + const VIDEO_INTERACTION_VIDEO_SKIPS = 102; + /** + * The number of total creative serves in video realtime reporting. + * + * Generated from protobuf enum VIDEO_REAL_TIME_CREATIVE_SERVES = 139; + */ + const VIDEO_REAL_TIME_CREATIVE_SERVES = 139; + /** + * The number of errors of type 100 in video realtime reporting. + * + * Generated from protobuf enum VIDEO_REAL_TIME_ERROR_100_COUNT = 143; + */ + const VIDEO_REAL_TIME_ERROR_100_COUNT = 143; + /** + * The number of errors of type 101 in video realtime reporting. + * + * Generated from protobuf enum VIDEO_REAL_TIME_ERROR_101_COUNT = 144; + */ + const VIDEO_REAL_TIME_ERROR_101_COUNT = 144; + /** + * The number of errors of type 102 in video realtime reporting. + * + * Generated from protobuf enum VIDEO_REAL_TIME_ERROR_102_COUNT = 145; + */ + const VIDEO_REAL_TIME_ERROR_102_COUNT = 145; + /** + * The number of errors of type 200 in video realtime reporting. + * + * Generated from protobuf enum VIDEO_REAL_TIME_ERROR_200_COUNT = 146; + */ + const VIDEO_REAL_TIME_ERROR_200_COUNT = 146; + /** + * The number of errors of type 201 in video realtime reporting. + * + * Generated from protobuf enum VIDEO_REAL_TIME_ERROR_201_COUNT = 147; + */ + const VIDEO_REAL_TIME_ERROR_201_COUNT = 147; + /** + * The number of errors of type 202 in video realtime reporting. + * + * Generated from protobuf enum VIDEO_REAL_TIME_ERROR_202_COUNT = 148; + */ + const VIDEO_REAL_TIME_ERROR_202_COUNT = 148; + /** + * The number of errors of type 203 in video realtime reporting. + * + * Generated from protobuf enum VIDEO_REAL_TIME_ERROR_203_COUNT = 149; + */ + const VIDEO_REAL_TIME_ERROR_203_COUNT = 149; + /** + * The number of errors of type 300 in video realtime reporting. + * + * Generated from protobuf enum VIDEO_REAL_TIME_ERROR_300_COUNT = 150; + */ + const VIDEO_REAL_TIME_ERROR_300_COUNT = 150; + /** + * The number of errors of type 301 in video realtime reporting. + * + * Generated from protobuf enum VIDEO_REAL_TIME_ERROR_301_COUNT = 151; + */ + const VIDEO_REAL_TIME_ERROR_301_COUNT = 151; + /** + * The number of errors of type 302 in video realtime reporting. + * + * Generated from protobuf enum VIDEO_REAL_TIME_ERROR_302_COUNT = 152; + */ + const VIDEO_REAL_TIME_ERROR_302_COUNT = 152; + /** + * The number of errors of type 303 in video realtime reporting. + * + * Generated from protobuf enum VIDEO_REAL_TIME_ERROR_303_COUNT = 153; + */ + const VIDEO_REAL_TIME_ERROR_303_COUNT = 153; + /** + * The number of errors of type 400 in video realtime reporting. + * + * Generated from protobuf enum VIDEO_REAL_TIME_ERROR_400_COUNT = 154; + */ + const VIDEO_REAL_TIME_ERROR_400_COUNT = 154; + /** + * The number of errors of type 401 in video realtime reporting. + * + * Generated from protobuf enum VIDEO_REAL_TIME_ERROR_401_COUNT = 155; + */ + const VIDEO_REAL_TIME_ERROR_401_COUNT = 155; + /** + * The number of errors of type 402 in video realtime reporting. + * + * Generated from protobuf enum VIDEO_REAL_TIME_ERROR_402_COUNT = 156; + */ + const VIDEO_REAL_TIME_ERROR_402_COUNT = 156; + /** + * The number of errors of type 403 in video realtime reporting. + * + * Generated from protobuf enum VIDEO_REAL_TIME_ERROR_403_COUNT = 157; + */ + const VIDEO_REAL_TIME_ERROR_403_COUNT = 157; + /** + * The number of errors of type 405 in video realtime reporting. + * + * Generated from protobuf enum VIDEO_REAL_TIME_ERROR_405_COUNT = 158; + */ + const VIDEO_REAL_TIME_ERROR_405_COUNT = 158; + /** + * The number of errors of type 406 in video realtime reporting. + * + * Generated from protobuf enum VIDEO_REAL_TIME_ERROR_406_COUNT = 159; + */ + const VIDEO_REAL_TIME_ERROR_406_COUNT = 159; + /** + * The number of errors of type 407 in video realtime reporting. + * + * Generated from protobuf enum VIDEO_REAL_TIME_ERROR_407_COUNT = 160; + */ + const VIDEO_REAL_TIME_ERROR_407_COUNT = 160; + /** + * The number of errors of type 408 in video realtime reporting. + * + * Generated from protobuf enum VIDEO_REAL_TIME_ERROR_408_COUNT = 161; + */ + const VIDEO_REAL_TIME_ERROR_408_COUNT = 161; + /** + * The number of errors of type 409 in video realtime reporting. + * + * Generated from protobuf enum VIDEO_REAL_TIME_ERROR_409_COUNT = 162; + */ + const VIDEO_REAL_TIME_ERROR_409_COUNT = 162; + /** + * The number of errors of type 410 in video realtime reporting. + * + * Generated from protobuf enum VIDEO_REAL_TIME_ERROR_410_COUNT = 163; + */ + const VIDEO_REAL_TIME_ERROR_410_COUNT = 163; + /** + * The number of errors of type 500 in video realtime reporting. + * + * Generated from protobuf enum VIDEO_REAL_TIME_ERROR_500_COUNT = 164; + */ + const VIDEO_REAL_TIME_ERROR_500_COUNT = 164; + /** + * The number of errors of type 501 in video realtime reporting. + * + * Generated from protobuf enum VIDEO_REAL_TIME_ERROR_501_COUNT = 165; + */ + const VIDEO_REAL_TIME_ERROR_501_COUNT = 165; + /** + * The number of errors of type 502 in video realtime reporting. + * + * Generated from protobuf enum VIDEO_REAL_TIME_ERROR_502_COUNT = 166; + */ + const VIDEO_REAL_TIME_ERROR_502_COUNT = 166; + /** + * The number of errors of type 503 in video realtime reporting. + * + * Generated from protobuf enum VIDEO_REAL_TIME_ERROR_503_COUNT = 167; + */ + const VIDEO_REAL_TIME_ERROR_503_COUNT = 167; + /** + * The number of errors of type 600 in video realtime reporting. + * + * Generated from protobuf enum VIDEO_REAL_TIME_ERROR_600_COUNT = 168; + */ + const VIDEO_REAL_TIME_ERROR_600_COUNT = 168; + /** + * The number of errors of type 601 in video realtime reporting. + * + * Generated from protobuf enum VIDEO_REAL_TIME_ERROR_601_COUNT = 169; + */ + const VIDEO_REAL_TIME_ERROR_601_COUNT = 169; + /** + * The number of errors of type 602 in video realtime reporting. + * + * Generated from protobuf enum VIDEO_REAL_TIME_ERROR_602_COUNT = 170; + */ + const VIDEO_REAL_TIME_ERROR_602_COUNT = 170; + /** + * The number of errors of type 603 in video realtime reporting. + * + * Generated from protobuf enum VIDEO_REAL_TIME_ERROR_603_COUNT = 171; + */ + const VIDEO_REAL_TIME_ERROR_603_COUNT = 171; + /** + * The number of errors of type 604 in video realtime reporting. + * + * Generated from protobuf enum VIDEO_REAL_TIME_ERROR_604_COUNT = 172; + */ + const VIDEO_REAL_TIME_ERROR_604_COUNT = 172; + /** + * The number of errors of type 900 in video realtime reporting. + * + * Generated from protobuf enum VIDEO_REAL_TIME_ERROR_900_COUNT = 173; + */ + const VIDEO_REAL_TIME_ERROR_900_COUNT = 173; + /** + * The number of errors of type 901 in video realtime reporting. + * + * Generated from protobuf enum VIDEO_REAL_TIME_ERROR_901_COUNT = 174; + */ + const VIDEO_REAL_TIME_ERROR_901_COUNT = 174; + /** + * The number of total impressions in video realtime reporting. + * + * Generated from protobuf enum VIDEO_REAL_TIME_IMPRESSIONS = 138; + */ + const VIDEO_REAL_TIME_IMPRESSIONS = 138; + /** + * The number of matched queries in video realtime reporting. + * + * Generated from protobuf enum VIDEO_REAL_TIME_MATCHED_QUERIES = 140; + */ + const VIDEO_REAL_TIME_MATCHED_QUERIES = 140; + /** + * The number of all errors in video realtime reporting. + * + * Generated from protobuf enum VIDEO_REAL_TIME_TOTAL_ERROR_COUNT = 175; + */ + const VIDEO_REAL_TIME_TOTAL_ERROR_COUNT = 175; + /** + * The number of total queries in video realtime reporting. + * + * Generated from protobuf enum VIDEO_REAL_TIME_TOTAL_QUERIES = 142; + */ + const VIDEO_REAL_TIME_TOTAL_QUERIES = 142; + /** + * The number of unmatched queries in video realtime reporting. + * + * Generated from protobuf enum VIDEO_REAL_TIME_UNMATCHED_QUERIES = 141; + */ + const VIDEO_REAL_TIME_UNMATCHED_QUERIES = 141; + /** + * Number of times that the publisher specified a video ad played + * automatically. + * + * Generated from protobuf enum VIDEO_VIEWERSHIP_AUTO_PLAYS = 103; + */ + const VIDEO_VIEWERSHIP_AUTO_PLAYS = 103; + /** + * Average percentage of the video watched by users. + * + * Generated from protobuf enum VIDEO_VIEWERSHIP_AVERAGE_VIEW_RATE = 104; + */ + const VIDEO_VIEWERSHIP_AVERAGE_VIEW_RATE = 104; + /** + * Average time(seconds) users watched the video. + * + * Generated from protobuf enum VIDEO_VIEWERSHIP_AVERAGE_VIEW_TIME = 105; + */ + const VIDEO_VIEWERSHIP_AVERAGE_VIEW_TIME = 105; + /** + * Number of times that the publisher specified a video ad was clicked to + * play. + * + * Generated from protobuf enum VIDEO_VIEWERSHIP_CLICK_TO_PLAYS = 106; + */ + const VIDEO_VIEWERSHIP_CLICK_TO_PLAYS = 106; + /** + * The number of times the video played to completion. + * + * Generated from protobuf enum VIDEO_VIEWERSHIP_COMPLETES = 107; + */ + const VIDEO_VIEWERSHIP_COMPLETES = 107; + /** + * Percentage of times the video played to the end. + * + * Generated from protobuf enum VIDEO_VIEWERSHIP_COMPLETION_RATE = 108; + */ + const VIDEO_VIEWERSHIP_COMPLETION_RATE = 108; + /** + * The number of engaged views: ad is viewed to completion or for 30s, + * whichever comes first. + * + * Generated from protobuf enum VIDEO_VIEWERSHIP_ENGAGED_VIEWS = 109; + */ + const VIDEO_VIEWERSHIP_ENGAGED_VIEWS = 109; + /** + * The number of times the video played to 25% of its length. + * + * Generated from protobuf enum VIDEO_VIEWERSHIP_FIRST_QUARTILES = 110; + */ + const VIDEO_VIEWERSHIP_FIRST_QUARTILES = 110; + /** + * The number of times the video reached its midpoint during play. + * + * Generated from protobuf enum VIDEO_VIEWERSHIP_MIDPOINTS = 111; + */ + const VIDEO_VIEWERSHIP_MIDPOINTS = 111; + /** + * The number of times a skip button is shown in video. + * + * Generated from protobuf enum VIDEO_VIEWERSHIP_SKIP_BUTTONS_SHOWN = 112; + */ + const VIDEO_VIEWERSHIP_SKIP_BUTTONS_SHOWN = 112; + /** + * The number of impressions where the video was played. + * + * Generated from protobuf enum VIDEO_VIEWERSHIP_STARTS = 113; + */ + const VIDEO_VIEWERSHIP_STARTS = 113; + /** + * The number of times the video played to 75% of its length. + * + * Generated from protobuf enum VIDEO_VIEWERSHIP_THIRD_QUARTILES = 114; + */ + const VIDEO_VIEWERSHIP_THIRD_QUARTILES = 114; + /** + * The number of times an error occurred, such as a VAST redirect error, a + * video playback error, or an invalid response error. + * + * Generated from protobuf enum VIDEO_VIEWERSHIP_TOTAL_ERROR_COUNT = 115; + */ + const VIDEO_VIEWERSHIP_TOTAL_ERROR_COUNT = 115; + /** + * The percentage of video error count. + * + * Generated from protobuf enum VIDEO_VIEWERSHIP_TOTAL_ERROR_RATE = 94; + */ + const VIDEO_VIEWERSHIP_TOTAL_ERROR_RATE = 94; + /** + * Duration of the video creative. + * + * Generated from protobuf enum VIDEO_VIEWERSHIP_VIDEO_LENGTH = 116; + */ + const VIDEO_VIEWERSHIP_VIDEO_LENGTH = 116; + /** + * View-through rate represented as a percentage. + * + * Generated from protobuf enum VIDEO_VIEWERSHIP_VIEW_THROUGH_RATE = 117; + */ + const VIDEO_VIEWERSHIP_VIEW_THROUGH_RATE = 117; + /** + * The estimated net rate for yield groups or individual + * yield group partners. + * + * Generated from protobuf enum YIELD_GROUP_ESTIMATED_CPM = 88; + */ + const YIELD_GROUP_ESTIMATED_CPM = 88; + /** + * Total net revenue earned by a yield group, based upon the yield group + * estimated CPM and yield group impressions recorded. + * + * Generated from protobuf enum YIELD_GROUP_ESTIMATED_REVENUE = 87; + */ + const YIELD_GROUP_ESTIMATED_REVENUE = 87; + /** + * Number of matched yield group requests where a yield partner delivered + * their ad to publisher inventory. + * + * Generated from protobuf enum YIELD_GROUP_IMPRESSIONS = 85; + */ + const YIELD_GROUP_IMPRESSIONS = 85; + /** + * Yield group Mediation fill rate indicating how often a network + * fills an ad request. + * + * Generated from protobuf enum YIELD_GROUP_MEDIATION_FILL_RATE = 89; + */ + const YIELD_GROUP_MEDIATION_FILL_RATE = 89; + /** + * Total requests where a Mediation chain was served. + * + * Generated from protobuf enum YIELD_GROUP_MEDIATION_MATCHED_QUERIES = 86; + */ + const YIELD_GROUP_MEDIATION_MATCHED_QUERIES = 86; + /** + * The number of mediation chain passback across all channels. + * + * Generated from protobuf enum YIELD_GROUP_MEDIATION_PASSBACKS = 118; + */ + const YIELD_GROUP_MEDIATION_PASSBACKS = 118; + /** + * Revenue per thousand impressions based on data collected by Ad Manager + * from third-party ad network reports. + * + * Generated from protobuf enum YIELD_GROUP_MEDIATION_THIRD_PARTY_ECPM = 90; + */ + const YIELD_GROUP_MEDIATION_THIRD_PARTY_ECPM = 90; + + private static $valueToName = [ + self::METRIC_UNSPECIFIED => 'METRIC_UNSPECIFIED', + self::ACTIVE_VIEW_AVERAGE_VIEWABLE_TIME => 'ACTIVE_VIEW_AVERAGE_VIEWABLE_TIME', + self::ACTIVE_VIEW_ELIGIBLE_IMPRESSIONS => 'ACTIVE_VIEW_ELIGIBLE_IMPRESSIONS', + self::ACTIVE_VIEW_MEASURABLE_IMPRESSIONS => 'ACTIVE_VIEW_MEASURABLE_IMPRESSIONS', + self::ACTIVE_VIEW_MEASURABLE_IMPRESSIONS_RATE => 'ACTIVE_VIEW_MEASURABLE_IMPRESSIONS_RATE', + self::ACTIVE_VIEW_VIEWABLE_IMPRESSIONS => 'ACTIVE_VIEW_VIEWABLE_IMPRESSIONS', + self::ACTIVE_VIEW_VIEWABLE_IMPRESSIONS_RATE => 'ACTIVE_VIEW_VIEWABLE_IMPRESSIONS_RATE', + self::ADSENSE_ACTIVE_VIEW_AVERAGE_VIEWABLE_TIME => 'ADSENSE_ACTIVE_VIEW_AVERAGE_VIEWABLE_TIME', + self::ADSENSE_ACTIVE_VIEW_ELIGIBLE_IMPRESSIONS => 'ADSENSE_ACTIVE_VIEW_ELIGIBLE_IMPRESSIONS', + self::ADSENSE_ACTIVE_VIEW_MEASURABLE_IMPRESSIONS => 'ADSENSE_ACTIVE_VIEW_MEASURABLE_IMPRESSIONS', + self::ADSENSE_ACTIVE_VIEW_MEASURABLE_IMPRESSIONS_RATE => 'ADSENSE_ACTIVE_VIEW_MEASURABLE_IMPRESSIONS_RATE', + self::ADSENSE_ACTIVE_VIEW_VIEWABLE_IMPRESSIONS => 'ADSENSE_ACTIVE_VIEW_VIEWABLE_IMPRESSIONS', + self::ADSENSE_ACTIVE_VIEW_VIEWABLE_IMPRESSIONS_RATE => 'ADSENSE_ACTIVE_VIEW_VIEWABLE_IMPRESSIONS_RATE', + self::ADSENSE_AVERAGE_ECPM => 'ADSENSE_AVERAGE_ECPM', + self::ADSENSE_CLICKS => 'ADSENSE_CLICKS', + self::ADSENSE_CTR => 'ADSENSE_CTR', + self::ADSENSE_IMPRESSIONS => 'ADSENSE_IMPRESSIONS', + self::ADSENSE_PERCENT_CLICKS => 'ADSENSE_PERCENT_CLICKS', + self::ADSENSE_PERCENT_IMPRESSIONS => 'ADSENSE_PERCENT_IMPRESSIONS', + self::ADSENSE_PERCENT_REVENUE => 'ADSENSE_PERCENT_REVENUE', + self::ADSENSE_PERCENT_REVENUE_WITHOUT_CPD => 'ADSENSE_PERCENT_REVENUE_WITHOUT_CPD', + self::ADSENSE_RESPONSES_SERVED => 'ADSENSE_RESPONSES_SERVED', + self::ADSENSE_REVENUE => 'ADSENSE_REVENUE', + self::AD_EXCHANGE_ACTIVE_VIEW_AVERAGE_VIEWABLE_TIME => 'AD_EXCHANGE_ACTIVE_VIEW_AVERAGE_VIEWABLE_TIME', + self::AD_EXCHANGE_ACTIVE_VIEW_ELIGIBLE_IMPRESSIONS => 'AD_EXCHANGE_ACTIVE_VIEW_ELIGIBLE_IMPRESSIONS', + self::AD_EXCHANGE_ACTIVE_VIEW_MEASURABLE_IMPRESSIONS => 'AD_EXCHANGE_ACTIVE_VIEW_MEASURABLE_IMPRESSIONS', + self::AD_EXCHANGE_ACTIVE_VIEW_MEASURABLE_IMPRESSIONS_RATE => 'AD_EXCHANGE_ACTIVE_VIEW_MEASURABLE_IMPRESSIONS_RATE', + self::AD_EXCHANGE_ACTIVE_VIEW_VIEWABLE_IMPRESSIONS => 'AD_EXCHANGE_ACTIVE_VIEW_VIEWABLE_IMPRESSIONS', + self::AD_EXCHANGE_ACTIVE_VIEW_VIEWABLE_IMPRESSIONS_RATE => 'AD_EXCHANGE_ACTIVE_VIEW_VIEWABLE_IMPRESSIONS_RATE', + self::AD_EXCHANGE_AVERAGE_ECPM => 'AD_EXCHANGE_AVERAGE_ECPM', + self::AD_EXCHANGE_CLICKS => 'AD_EXCHANGE_CLICKS', + self::AD_EXCHANGE_CTR => 'AD_EXCHANGE_CTR', + self::AD_EXCHANGE_IMPRESSIONS => 'AD_EXCHANGE_IMPRESSIONS', + self::AD_EXCHANGE_PERCENT_CLICKS => 'AD_EXCHANGE_PERCENT_CLICKS', + self::AD_EXCHANGE_PERCENT_IMPRESSIONS => 'AD_EXCHANGE_PERCENT_IMPRESSIONS', + self::AD_EXCHANGE_PERCENT_REVENUE => 'AD_EXCHANGE_PERCENT_REVENUE', + self::AD_EXCHANGE_PERCENT_REVENUE_WITHOUT_CPD => 'AD_EXCHANGE_PERCENT_REVENUE_WITHOUT_CPD', + self::AD_EXCHANGE_RESPONSES_SERVED => 'AD_EXCHANGE_RESPONSES_SERVED', + self::AD_EXCHANGE_REVENUE => 'AD_EXCHANGE_REVENUE', + self::AD_REQUESTS => 'AD_REQUESTS', + self::AD_SERVER_ACTIVE_VIEW_AVERAGE_VIEWABLE_TIME => 'AD_SERVER_ACTIVE_VIEW_AVERAGE_VIEWABLE_TIME', + self::AD_SERVER_ACTIVE_VIEW_ELIGIBLE_IMPRESSIONS => 'AD_SERVER_ACTIVE_VIEW_ELIGIBLE_IMPRESSIONS', + self::AD_SERVER_ACTIVE_VIEW_MEASURABLE_IMPRESSIONS => 'AD_SERVER_ACTIVE_VIEW_MEASURABLE_IMPRESSIONS', + self::AD_SERVER_ACTIVE_VIEW_MEASURABLE_IMPRESSIONS_RATE => 'AD_SERVER_ACTIVE_VIEW_MEASURABLE_IMPRESSIONS_RATE', + self::AD_SERVER_ACTIVE_VIEW_VIEWABLE_IMPRESSIONS => 'AD_SERVER_ACTIVE_VIEW_VIEWABLE_IMPRESSIONS', + self::AD_SERVER_ACTIVE_VIEW_VIEWABLE_IMPRESSIONS_RATE => 'AD_SERVER_ACTIVE_VIEW_VIEWABLE_IMPRESSIONS_RATE', + self::AD_SERVER_AVERAGE_ECPM => 'AD_SERVER_AVERAGE_ECPM', + self::AD_SERVER_AVERAGE_ECPM_WITHOUT_CPD => 'AD_SERVER_AVERAGE_ECPM_WITHOUT_CPD', + self::AD_SERVER_CLICKS => 'AD_SERVER_CLICKS', + self::AD_SERVER_CPD_REVENUE => 'AD_SERVER_CPD_REVENUE', + self::AD_SERVER_CTR => 'AD_SERVER_CTR', + self::AD_SERVER_IMPRESSIONS => 'AD_SERVER_IMPRESSIONS', + self::AD_SERVER_PERCENT_CLICKS => 'AD_SERVER_PERCENT_CLICKS', + self::AD_SERVER_PERCENT_IMPRESSIONS => 'AD_SERVER_PERCENT_IMPRESSIONS', + self::AD_SERVER_PERCENT_REVENUE => 'AD_SERVER_PERCENT_REVENUE', + self::AD_SERVER_PERCENT_REVENUE_WITHOUT_CPD => 'AD_SERVER_PERCENT_REVENUE_WITHOUT_CPD', + self::AD_SERVER_RESPONSES_SERVED => 'AD_SERVER_RESPONSES_SERVED', + self::AD_SERVER_REVENUE => 'AD_SERVER_REVENUE', + self::AD_SERVER_REVENUE_WITHOUT_CPD => 'AD_SERVER_REVENUE_WITHOUT_CPD', + self::AUCTIONS_WON => 'AUCTIONS_WON', + self::AVERAGE_ECPM => 'AVERAGE_ECPM', + self::AVERAGE_ECPM_WITHOUT_CPD => 'AVERAGE_ECPM_WITHOUT_CPD', + self::BIDS => 'BIDS', + self::BIDS_IN_AUCTION => 'BIDS_IN_AUCTION', + self::CALLOUTS => 'CALLOUTS', + self::CLICKS => 'CLICKS', + self::CODE_SERVED_COUNT => 'CODE_SERVED_COUNT', + self::CTR => 'CTR', + self::GOOGLE_SOLD_AUCTION_COVIEWED_IMPRESSIONS => 'GOOGLE_SOLD_AUCTION_COVIEWED_IMPRESSIONS', + self::GOOGLE_SOLD_AUCTION_IMPRESSIONS => 'GOOGLE_SOLD_AUCTION_IMPRESSIONS', + self::GOOGLE_SOLD_COVIEWED_IMPRESSIONS => 'GOOGLE_SOLD_COVIEWED_IMPRESSIONS', + self::GOOGLE_SOLD_IMPRESSIONS => 'GOOGLE_SOLD_IMPRESSIONS', + self::GOOGLE_SOLD_RESERVATION_COVIEWED_IMPRESSIONS => 'GOOGLE_SOLD_RESERVATION_COVIEWED_IMPRESSIONS', + self::GOOGLE_SOLD_RESERVATION_IMPRESSIONS => 'GOOGLE_SOLD_RESERVATION_IMPRESSIONS', + self::IMPRESSIONS => 'IMPRESSIONS', + self::PARTNER_SALES_FILLED_POD_REQUESTS => 'PARTNER_SALES_FILLED_POD_REQUESTS', + self::PARTNER_SALES_FILL_RATE => 'PARTNER_SALES_FILL_RATE', + self::PARTNER_SALES_PARTNER_MATCH_RATE => 'PARTNER_SALES_PARTNER_MATCH_RATE', + self::PARTNER_SALES_QUERIES => 'PARTNER_SALES_QUERIES', + self::PARTNER_SALES_UNFILLED_IMPRESSIONS => 'PARTNER_SALES_UNFILLED_IMPRESSIONS', + self::PARTNER_SALES_UNMATCHED_QUERIES => 'PARTNER_SALES_UNMATCHED_QUERIES', + self::PARTNER_SOLD_CODE_SERVED => 'PARTNER_SOLD_CODE_SERVED', + self::PARTNER_SOLD_COVIEWED_IMPRESSIONS => 'PARTNER_SOLD_COVIEWED_IMPRESSIONS', + self::PARTNER_SOLD_IMPRESSIONS => 'PARTNER_SOLD_IMPRESSIONS', + self::PROGRAMMATIC_ELIGIBLE_AD_REQUESTS => 'PROGRAMMATIC_ELIGIBLE_AD_REQUESTS', + self::PROGRAMMATIC_MATCH_RATE => 'PROGRAMMATIC_MATCH_RATE', + self::PROGRAMMATIC_RESPONSES_SERVED => 'PROGRAMMATIC_RESPONSES_SERVED', + self::RESPONSES_SERVED => 'RESPONSES_SERVED', + self::REVENUE => 'REVENUE', + self::REVENUE_WITHOUT_CPD => 'REVENUE_WITHOUT_CPD', + self::SUCCESSFUL_RESPONSES => 'SUCCESSFUL_RESPONSES', + self::UNFILLED_IMPRESSIONS => 'UNFILLED_IMPRESSIONS', + self::UNMATCHED_AD_REQUESTS => 'UNMATCHED_AD_REQUESTS', + self::USER_MESSAGES_OFFERWALL_MESSAGES_SHOWN => 'USER_MESSAGES_OFFERWALL_MESSAGES_SHOWN', + self::USER_MESSAGES_OFFERWALL_SUCCESSFUL_ENGAGEMENTS => 'USER_MESSAGES_OFFERWALL_SUCCESSFUL_ENGAGEMENTS', + self::VIDEO_INTERACTION_AVERAGE_INTERACTION_RATE => 'VIDEO_INTERACTION_AVERAGE_INTERACTION_RATE', + self::VIDEO_INTERACTION_COLLAPSES => 'VIDEO_INTERACTION_COLLAPSES', + self::VIDEO_INTERACTION_EXPANDS => 'VIDEO_INTERACTION_EXPANDS', + self::VIDEO_INTERACTION_FULL_SCREENS => 'VIDEO_INTERACTION_FULL_SCREENS', + self::VIDEO_INTERACTION_MUTES => 'VIDEO_INTERACTION_MUTES', + self::VIDEO_INTERACTION_PAUSES => 'VIDEO_INTERACTION_PAUSES', + self::VIDEO_INTERACTION_RESUMES => 'VIDEO_INTERACTION_RESUMES', + self::VIDEO_INTERACTION_REWINDS => 'VIDEO_INTERACTION_REWINDS', + self::VIDEO_INTERACTION_UNMUTES => 'VIDEO_INTERACTION_UNMUTES', + self::VIDEO_INTERACTION_VIDEO_SKIPS => 'VIDEO_INTERACTION_VIDEO_SKIPS', + self::VIDEO_REAL_TIME_CREATIVE_SERVES => 'VIDEO_REAL_TIME_CREATIVE_SERVES', + self::VIDEO_REAL_TIME_ERROR_100_COUNT => 'VIDEO_REAL_TIME_ERROR_100_COUNT', + self::VIDEO_REAL_TIME_ERROR_101_COUNT => 'VIDEO_REAL_TIME_ERROR_101_COUNT', + self::VIDEO_REAL_TIME_ERROR_102_COUNT => 'VIDEO_REAL_TIME_ERROR_102_COUNT', + self::VIDEO_REAL_TIME_ERROR_200_COUNT => 'VIDEO_REAL_TIME_ERROR_200_COUNT', + self::VIDEO_REAL_TIME_ERROR_201_COUNT => 'VIDEO_REAL_TIME_ERROR_201_COUNT', + self::VIDEO_REAL_TIME_ERROR_202_COUNT => 'VIDEO_REAL_TIME_ERROR_202_COUNT', + self::VIDEO_REAL_TIME_ERROR_203_COUNT => 'VIDEO_REAL_TIME_ERROR_203_COUNT', + self::VIDEO_REAL_TIME_ERROR_300_COUNT => 'VIDEO_REAL_TIME_ERROR_300_COUNT', + self::VIDEO_REAL_TIME_ERROR_301_COUNT => 'VIDEO_REAL_TIME_ERROR_301_COUNT', + self::VIDEO_REAL_TIME_ERROR_302_COUNT => 'VIDEO_REAL_TIME_ERROR_302_COUNT', + self::VIDEO_REAL_TIME_ERROR_303_COUNT => 'VIDEO_REAL_TIME_ERROR_303_COUNT', + self::VIDEO_REAL_TIME_ERROR_400_COUNT => 'VIDEO_REAL_TIME_ERROR_400_COUNT', + self::VIDEO_REAL_TIME_ERROR_401_COUNT => 'VIDEO_REAL_TIME_ERROR_401_COUNT', + self::VIDEO_REAL_TIME_ERROR_402_COUNT => 'VIDEO_REAL_TIME_ERROR_402_COUNT', + self::VIDEO_REAL_TIME_ERROR_403_COUNT => 'VIDEO_REAL_TIME_ERROR_403_COUNT', + self::VIDEO_REAL_TIME_ERROR_405_COUNT => 'VIDEO_REAL_TIME_ERROR_405_COUNT', + self::VIDEO_REAL_TIME_ERROR_406_COUNT => 'VIDEO_REAL_TIME_ERROR_406_COUNT', + self::VIDEO_REAL_TIME_ERROR_407_COUNT => 'VIDEO_REAL_TIME_ERROR_407_COUNT', + self::VIDEO_REAL_TIME_ERROR_408_COUNT => 'VIDEO_REAL_TIME_ERROR_408_COUNT', + self::VIDEO_REAL_TIME_ERROR_409_COUNT => 'VIDEO_REAL_TIME_ERROR_409_COUNT', + self::VIDEO_REAL_TIME_ERROR_410_COUNT => 'VIDEO_REAL_TIME_ERROR_410_COUNT', + self::VIDEO_REAL_TIME_ERROR_500_COUNT => 'VIDEO_REAL_TIME_ERROR_500_COUNT', + self::VIDEO_REAL_TIME_ERROR_501_COUNT => 'VIDEO_REAL_TIME_ERROR_501_COUNT', + self::VIDEO_REAL_TIME_ERROR_502_COUNT => 'VIDEO_REAL_TIME_ERROR_502_COUNT', + self::VIDEO_REAL_TIME_ERROR_503_COUNT => 'VIDEO_REAL_TIME_ERROR_503_COUNT', + self::VIDEO_REAL_TIME_ERROR_600_COUNT => 'VIDEO_REAL_TIME_ERROR_600_COUNT', + self::VIDEO_REAL_TIME_ERROR_601_COUNT => 'VIDEO_REAL_TIME_ERROR_601_COUNT', + self::VIDEO_REAL_TIME_ERROR_602_COUNT => 'VIDEO_REAL_TIME_ERROR_602_COUNT', + self::VIDEO_REAL_TIME_ERROR_603_COUNT => 'VIDEO_REAL_TIME_ERROR_603_COUNT', + self::VIDEO_REAL_TIME_ERROR_604_COUNT => 'VIDEO_REAL_TIME_ERROR_604_COUNT', + self::VIDEO_REAL_TIME_ERROR_900_COUNT => 'VIDEO_REAL_TIME_ERROR_900_COUNT', + self::VIDEO_REAL_TIME_ERROR_901_COUNT => 'VIDEO_REAL_TIME_ERROR_901_COUNT', + self::VIDEO_REAL_TIME_IMPRESSIONS => 'VIDEO_REAL_TIME_IMPRESSIONS', + self::VIDEO_REAL_TIME_MATCHED_QUERIES => 'VIDEO_REAL_TIME_MATCHED_QUERIES', + self::VIDEO_REAL_TIME_TOTAL_ERROR_COUNT => 'VIDEO_REAL_TIME_TOTAL_ERROR_COUNT', + self::VIDEO_REAL_TIME_TOTAL_QUERIES => 'VIDEO_REAL_TIME_TOTAL_QUERIES', + self::VIDEO_REAL_TIME_UNMATCHED_QUERIES => 'VIDEO_REAL_TIME_UNMATCHED_QUERIES', + self::VIDEO_VIEWERSHIP_AUTO_PLAYS => 'VIDEO_VIEWERSHIP_AUTO_PLAYS', + self::VIDEO_VIEWERSHIP_AVERAGE_VIEW_RATE => 'VIDEO_VIEWERSHIP_AVERAGE_VIEW_RATE', + self::VIDEO_VIEWERSHIP_AVERAGE_VIEW_TIME => 'VIDEO_VIEWERSHIP_AVERAGE_VIEW_TIME', + self::VIDEO_VIEWERSHIP_CLICK_TO_PLAYS => 'VIDEO_VIEWERSHIP_CLICK_TO_PLAYS', + self::VIDEO_VIEWERSHIP_COMPLETES => 'VIDEO_VIEWERSHIP_COMPLETES', + self::VIDEO_VIEWERSHIP_COMPLETION_RATE => 'VIDEO_VIEWERSHIP_COMPLETION_RATE', + self::VIDEO_VIEWERSHIP_ENGAGED_VIEWS => 'VIDEO_VIEWERSHIP_ENGAGED_VIEWS', + self::VIDEO_VIEWERSHIP_FIRST_QUARTILES => 'VIDEO_VIEWERSHIP_FIRST_QUARTILES', + self::VIDEO_VIEWERSHIP_MIDPOINTS => 'VIDEO_VIEWERSHIP_MIDPOINTS', + self::VIDEO_VIEWERSHIP_SKIP_BUTTONS_SHOWN => 'VIDEO_VIEWERSHIP_SKIP_BUTTONS_SHOWN', + self::VIDEO_VIEWERSHIP_STARTS => 'VIDEO_VIEWERSHIP_STARTS', + self::VIDEO_VIEWERSHIP_THIRD_QUARTILES => 'VIDEO_VIEWERSHIP_THIRD_QUARTILES', + self::VIDEO_VIEWERSHIP_TOTAL_ERROR_COUNT => 'VIDEO_VIEWERSHIP_TOTAL_ERROR_COUNT', + self::VIDEO_VIEWERSHIP_TOTAL_ERROR_RATE => 'VIDEO_VIEWERSHIP_TOTAL_ERROR_RATE', + self::VIDEO_VIEWERSHIP_VIDEO_LENGTH => 'VIDEO_VIEWERSHIP_VIDEO_LENGTH', + self::VIDEO_VIEWERSHIP_VIEW_THROUGH_RATE => 'VIDEO_VIEWERSHIP_VIEW_THROUGH_RATE', + self::YIELD_GROUP_ESTIMATED_CPM => 'YIELD_GROUP_ESTIMATED_CPM', + self::YIELD_GROUP_ESTIMATED_REVENUE => 'YIELD_GROUP_ESTIMATED_REVENUE', + self::YIELD_GROUP_IMPRESSIONS => 'YIELD_GROUP_IMPRESSIONS', + self::YIELD_GROUP_MEDIATION_FILL_RATE => 'YIELD_GROUP_MEDIATION_FILL_RATE', + self::YIELD_GROUP_MEDIATION_MATCHED_QUERIES => 'YIELD_GROUP_MEDIATION_MATCHED_QUERIES', + self::YIELD_GROUP_MEDIATION_PASSBACKS => 'YIELD_GROUP_MEDIATION_PASSBACKS', + self::YIELD_GROUP_MEDIATION_THIRD_PARTY_ECPM => 'YIELD_GROUP_MEDIATION_THIRD_PARTY_ECPM', + ]; + + 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/AdsAdManager/src/V1/Report/MetricValueType.php b/AdsAdManager/src/V1/Report/MetricValueType.php new file mode 100644 index 000000000000..3a8557eab111 --- /dev/null +++ b/AdsAdManager/src/V1/Report/MetricValueType.php @@ -0,0 +1,83 @@ +google.ads.admanager.v1.Report.MetricValueType + */ +class MetricValueType +{ + /** + * The values for the primary date_range. + * + * Generated from protobuf enum PRIMARY = 0; + */ + const PRIMARY = 0; + /** + * Each metrics' percent of the total for the primary date_range. + * + * Generated from protobuf enum PRIMARY_PERCENT_OF_TOTAL = 1; + */ + const PRIMARY_PERCENT_OF_TOTAL = 1; + /** + * The values for the comparison_date_range. + * + * Generated from protobuf enum COMPARISON = 2; + */ + const COMPARISON = 2; + /** + * Each metrics' percent of the total for the comparison_date_range. + * + * Generated from protobuf enum COMPARISON_PERCENT_OF_TOTAL = 3; + */ + const COMPARISON_PERCENT_OF_TOTAL = 3; + /** + * The absolute change between the primary and comparison date ranges. + * + * Generated from protobuf enum ABSOLUTE_CHANGE = 4; + */ + const ABSOLUTE_CHANGE = 4; + /** + * The relative change between the primary and comparison date ranges. + * + * Generated from protobuf enum RELATIVE_CHANGE = 5; + */ + const RELATIVE_CHANGE = 5; + + private static $valueToName = [ + self::PRIMARY => 'PRIMARY', + self::PRIMARY_PERCENT_OF_TOTAL => 'PRIMARY_PERCENT_OF_TOTAL', + self::COMPARISON => 'COMPARISON', + self::COMPARISON_PERCENT_OF_TOTAL => 'COMPARISON_PERCENT_OF_TOTAL', + self::ABSOLUTE_CHANGE => 'ABSOLUTE_CHANGE', + self::RELATIVE_CHANGE => 'RELATIVE_CHANGE', + ]; + + 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/AdsAdManager/src/V1/Report/ReportType.php b/AdsAdManager/src/V1/Report/ReportType.php new file mode 100644 index 000000000000..f00508132276 --- /dev/null +++ b/AdsAdManager/src/V1/Report/ReportType.php @@ -0,0 +1,55 @@ +google.ads.admanager.v1.Report.ReportType + */ +class ReportType +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum REPORT_TYPE_UNSPECIFIED = 0; + */ + const REPORT_TYPE_UNSPECIFIED = 0; + /** + * Historical. + * + * Generated from protobuf enum HISTORICAL = 1; + */ + const HISTORICAL = 1; + + private static $valueToName = [ + self::REPORT_TYPE_UNSPECIFIED => 'REPORT_TYPE_UNSPECIFIED', + self::HISTORICAL => 'HISTORICAL', + ]; + + 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/AdsAdManager/src/V1/Report/Slice.php b/AdsAdManager/src/V1/Report/Slice.php new file mode 100644 index 000000000000..b0af001ed513 --- /dev/null +++ b/AdsAdManager/src/V1/Report/Slice.php @@ -0,0 +1,114 @@ +google.ads.admanager.v1.Report.Slice + */ +class Slice extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The dimension to slice on. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.Dimension dimension = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $dimension = 0; + /** + * Required. The value of the dimension. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.Value value = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $dimension + * Required. The dimension to slice on. + * @type \Google\Ads\AdManager\V1\Report\Value $value + * Required. The value of the dimension. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\ReportService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The dimension to slice on. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.Dimension dimension = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getDimension() + { + return $this->dimension; + } + + /** + * Required. The dimension to slice on. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.Dimension dimension = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setDimension($var) + { + GPBUtil::checkEnum($var, \Google\Ads\AdManager\V1\Report\Dimension::class); + $this->dimension = $var; + + return $this; + } + + /** + * Required. The value of the dimension. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.Value value = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Ads\AdManager\V1\Report\Value|null + */ + public function getValue() + { + return $this->value; + } + + public function hasValue() + { + return isset($this->value); + } + + public function clearValue() + { + unset($this->value); + } + + /** + * Required. The value of the dimension. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.Value value = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Ads\AdManager\V1\Report\Value $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkMessage($var, \Google\Ads\AdManager\V1\Report\Value::class); + $this->value = $var; + + return $this; + } + +} + + diff --git a/AdsAdManager/src/V1/Report/Sort.php b/AdsAdManager/src/V1/Report/Sort.php new file mode 100644 index 000000000000..721e80f89774 --- /dev/null +++ b/AdsAdManager/src/V1/Report/Sort.php @@ -0,0 +1,252 @@ +google.ads.admanager.v1.Report.Sort + */ +class Sort extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A field (dimension or metric) to sort by. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.Field field = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $field = null; + /** + * Optional. The sort order. If true the sort will be descending. + * + * Generated from protobuf field bool descending = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $descending = false; + /** + * Optional. Use to sort on a specific slice of data. + * + * Generated from protobuf field optional .google.ads.admanager.v1.Report.Slice slice = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $slice = null; + /** + * Optional. When using time period columns, use this to sort on a specific + * column. + * + * Generated from protobuf field optional int32 time_period_index = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $time_period_index = null; + /** + * Optional. Use to specify which metric value type to sort on. Defaults to + * PRIMARY. + * + * Generated from protobuf field optional .google.ads.admanager.v1.Report.MetricValueType metric_value_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $metric_value_type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Ads\AdManager\V1\Report\Field $field + * Required. A field (dimension or metric) to sort by. + * @type bool $descending + * Optional. The sort order. If true the sort will be descending. + * @type \Google\Ads\AdManager\V1\Report\Slice $slice + * Optional. Use to sort on a specific slice of data. + * @type int $time_period_index + * Optional. When using time period columns, use this to sort on a specific + * column. + * @type int $metric_value_type + * Optional. Use to specify which metric value type to sort on. Defaults to + * PRIMARY. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\ReportService::initOnce(); + parent::__construct($data); + } + + /** + * Required. A field (dimension or metric) to sort by. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.Field field = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Ads\AdManager\V1\Report\Field|null + */ + public function getField() + { + return $this->field; + } + + public function hasField() + { + return isset($this->field); + } + + public function clearField() + { + unset($this->field); + } + + /** + * Required. A field (dimension or metric) to sort by. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.Field field = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Ads\AdManager\V1\Report\Field $var + * @return $this + */ + public function setField($var) + { + GPBUtil::checkMessage($var, \Google\Ads\AdManager\V1\Report\Field::class); + $this->field = $var; + + return $this; + } + + /** + * Optional. The sort order. If true the sort will be descending. + * + * Generated from protobuf field bool descending = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getDescending() + { + return $this->descending; + } + + /** + * Optional. The sort order. If true the sort will be descending. + * + * Generated from protobuf field bool descending = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setDescending($var) + { + GPBUtil::checkBool($var); + $this->descending = $var; + + return $this; + } + + /** + * Optional. Use to sort on a specific slice of data. + * + * Generated from protobuf field optional .google.ads.admanager.v1.Report.Slice slice = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Ads\AdManager\V1\Report\Slice|null + */ + public function getSlice() + { + return $this->slice; + } + + public function hasSlice() + { + return isset($this->slice); + } + + public function clearSlice() + { + unset($this->slice); + } + + /** + * Optional. Use to sort on a specific slice of data. + * + * Generated from protobuf field optional .google.ads.admanager.v1.Report.Slice slice = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Ads\AdManager\V1\Report\Slice $var + * @return $this + */ + public function setSlice($var) + { + GPBUtil::checkMessage($var, \Google\Ads\AdManager\V1\Report\Slice::class); + $this->slice = $var; + + return $this; + } + + /** + * Optional. When using time period columns, use this to sort on a specific + * column. + * + * Generated from protobuf field optional int32 time_period_index = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getTimePeriodIndex() + { + return isset($this->time_period_index) ? $this->time_period_index : 0; + } + + public function hasTimePeriodIndex() + { + return isset($this->time_period_index); + } + + public function clearTimePeriodIndex() + { + unset($this->time_period_index); + } + + /** + * Optional. When using time period columns, use this to sort on a specific + * column. + * + * Generated from protobuf field optional int32 time_period_index = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setTimePeriodIndex($var) + { + GPBUtil::checkInt32($var); + $this->time_period_index = $var; + + return $this; + } + + /** + * Optional. Use to specify which metric value type to sort on. Defaults to + * PRIMARY. + * + * Generated from protobuf field optional .google.ads.admanager.v1.Report.MetricValueType metric_value_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMetricValueType() + { + return isset($this->metric_value_type) ? $this->metric_value_type : 0; + } + + public function hasMetricValueType() + { + return isset($this->metric_value_type); + } + + public function clearMetricValueType() + { + unset($this->metric_value_type); + } + + /** + * Optional. Use to specify which metric value type to sort on. Defaults to + * PRIMARY. + * + * Generated from protobuf field optional .google.ads.admanager.v1.Report.MetricValueType metric_value_type = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMetricValueType($var) + { + GPBUtil::checkEnum($var, \Google\Ads\AdManager\V1\Report\MetricValueType::class); + $this->metric_value_type = $var; + + return $this; + } + +} + + diff --git a/AdsAdManager/src/V1/Report/TimePeriodColumn.php b/AdsAdManager/src/V1/Report/TimePeriodColumn.php new file mode 100644 index 000000000000..d882d06e6049 --- /dev/null +++ b/AdsAdManager/src/V1/Report/TimePeriodColumn.php @@ -0,0 +1,76 @@ +google.ads.admanager.v1.Report.TimePeriodColumn + */ +class TimePeriodColumn +{ + /** + * Default value. Report will have no time period column. + * + * Generated from protobuf enum TIME_PERIOD_COLUMN_UNSPECIFIED = 0; + */ + const TIME_PERIOD_COLUMN_UNSPECIFIED = 0; + /** + * A column for each date in the report. + * + * Generated from protobuf enum TIME_PERIOD_COLUMN_DATE = 1; + */ + const TIME_PERIOD_COLUMN_DATE = 1; + /** + * A column for each week in the report. + * + * Generated from protobuf enum TIME_PERIOD_COLUMN_WEEK = 2; + */ + const TIME_PERIOD_COLUMN_WEEK = 2; + /** + * A column for each month in the report. + * + * Generated from protobuf enum TIME_PERIOD_COLUMN_MONTH = 3; + */ + const TIME_PERIOD_COLUMN_MONTH = 3; + /** + * A column for each quarter in the report. + * + * Generated from protobuf enum TIME_PERIOD_COLUMN_QUARTER = 4; + */ + const TIME_PERIOD_COLUMN_QUARTER = 4; + + private static $valueToName = [ + self::TIME_PERIOD_COLUMN_UNSPECIFIED => 'TIME_PERIOD_COLUMN_UNSPECIFIED', + self::TIME_PERIOD_COLUMN_DATE => 'TIME_PERIOD_COLUMN_DATE', + self::TIME_PERIOD_COLUMN_WEEK => 'TIME_PERIOD_COLUMN_WEEK', + self::TIME_PERIOD_COLUMN_MONTH => 'TIME_PERIOD_COLUMN_MONTH', + self::TIME_PERIOD_COLUMN_QUARTER => 'TIME_PERIOD_COLUMN_QUARTER', + ]; + + 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/AdsAdManager/src/V1/Report/Value.php b/AdsAdManager/src/V1/Report/Value.php new file mode 100644 index 000000000000..e0f3dfefc0d2 --- /dev/null +++ b/AdsAdManager/src/V1/Report/Value.php @@ -0,0 +1,274 @@ +google.ads.admanager.v1.Report.Value + */ +class Value extends \Google\Protobuf\Internal\Message +{ + protected $value; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $int_value + * For integer values. + * @type float $double_value + * For double values. + * @type string $string_value + * For string values. + * @type bool $bool_value + * For boolean values. + * @type \Google\Ads\AdManager\V1\Report\Value\IntList $int_list_value + * For lists of integer values. + * @type \Google\Ads\AdManager\V1\Report\Value\StringList $string_list_value + * For lists of string values. + * @type string $bytes_value + * For bytes values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\ReportService::initOnce(); + parent::__construct($data); + } + + /** + * For integer values. + * + * Generated from protobuf field int64 int_value = 1; + * @return int|string + */ + public function getIntValue() + { + return $this->readOneof(1); + } + + public function hasIntValue() + { + return $this->hasOneof(1); + } + + /** + * For integer values. + * + * Generated from protobuf field int64 int_value = 1; + * @param int|string $var + * @return $this + */ + public function setIntValue($var) + { + GPBUtil::checkInt64($var); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * For double values. + * + * Generated from protobuf field double double_value = 2; + * @return float + */ + public function getDoubleValue() + { + return $this->readOneof(2); + } + + public function hasDoubleValue() + { + return $this->hasOneof(2); + } + + /** + * For double values. + * + * Generated from protobuf field double double_value = 2; + * @param float $var + * @return $this + */ + public function setDoubleValue($var) + { + GPBUtil::checkDouble($var); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * For string values. + * + * Generated from protobuf field string string_value = 3; + * @return string + */ + public function getStringValue() + { + return $this->readOneof(3); + } + + public function hasStringValue() + { + return $this->hasOneof(3); + } + + /** + * For string values. + * + * Generated from protobuf field string string_value = 3; + * @param string $var + * @return $this + */ + public function setStringValue($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * For boolean values. + * + * Generated from protobuf field bool bool_value = 4; + * @return bool + */ + public function getBoolValue() + { + return $this->readOneof(4); + } + + public function hasBoolValue() + { + return $this->hasOneof(4); + } + + /** + * For boolean values. + * + * Generated from protobuf field bool bool_value = 4; + * @param bool $var + * @return $this + */ + public function setBoolValue($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * For lists of integer values. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.Value.IntList int_list_value = 6; + * @return \Google\Ads\AdManager\V1\Report\Value\IntList|null + */ + public function getIntListValue() + { + return $this->readOneof(6); + } + + public function hasIntListValue() + { + return $this->hasOneof(6); + } + + /** + * For lists of integer values. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.Value.IntList int_list_value = 6; + * @param \Google\Ads\AdManager\V1\Report\Value\IntList $var + * @return $this + */ + public function setIntListValue($var) + { + GPBUtil::checkMessage($var, \Google\Ads\AdManager\V1\Report\Value\IntList::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * For lists of string values. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.Value.StringList string_list_value = 7; + * @return \Google\Ads\AdManager\V1\Report\Value\StringList|null + */ + public function getStringListValue() + { + return $this->readOneof(7); + } + + public function hasStringListValue() + { + return $this->hasOneof(7); + } + + /** + * For lists of string values. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.Value.StringList string_list_value = 7; + * @param \Google\Ads\AdManager\V1\Report\Value\StringList $var + * @return $this + */ + public function setStringListValue($var) + { + GPBUtil::checkMessage($var, \Google\Ads\AdManager\V1\Report\Value\StringList::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * For bytes values. + * + * Generated from protobuf field bytes bytes_value = 8; + * @return string + */ + public function getBytesValue() + { + return $this->readOneof(8); + } + + public function hasBytesValue() + { + return $this->hasOneof(8); + } + + /** + * For bytes values. + * + * Generated from protobuf field bytes bytes_value = 8; + * @param string $var + * @return $this + */ + public function setBytesValue($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * @return string + */ + public function getValue() + { + return $this->whichOneof("value"); + } + +} + + diff --git a/AdsAdManager/src/V1/Report/Value/IntList.php b/AdsAdManager/src/V1/Report/Value/IntList.php new file mode 100644 index 000000000000..f8973692cc7e --- /dev/null +++ b/AdsAdManager/src/V1/Report/Value/IntList.php @@ -0,0 +1,68 @@ +google.ads.admanager.v1.Report.Value.IntList + */ +class IntList extends \Google\Protobuf\Internal\Message +{ + /** + * The values + * + * Generated from protobuf field repeated int64 values = 1; + */ + private $values; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|array|\Google\Protobuf\Internal\RepeatedField $values + * The values + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\ReportService::initOnce(); + parent::__construct($data); + } + + /** + * The values + * + * Generated from protobuf field repeated int64 values = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getValues() + { + return $this->values; + } + + /** + * The values + * + * Generated from protobuf field repeated int64 values = 1; + * @param array|array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT64); + $this->values = $arr; + + return $this; + } + +} + + diff --git a/AdsAdManager/src/V1/Report/Value/StringList.php b/AdsAdManager/src/V1/Report/Value/StringList.php new file mode 100644 index 000000000000..f8c9042f5214 --- /dev/null +++ b/AdsAdManager/src/V1/Report/Value/StringList.php @@ -0,0 +1,68 @@ +google.ads.admanager.v1.Report.Value.StringList + */ +class StringList extends \Google\Protobuf\Internal\Message +{ + /** + * The values + * + * Generated from protobuf field repeated string values = 1; + */ + private $values; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $values + * The values + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\ReportService::initOnce(); + parent::__construct($data); + } + + /** + * The values + * + * Generated from protobuf field repeated string values = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getValues() + { + return $this->values; + } + + /** + * The values + * + * Generated from protobuf field repeated string values = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->values = $arr; + + return $this; + } + +} + + diff --git a/AdsAdManager/src/V1/Report/Visibility.php b/AdsAdManager/src/V1/Report/Visibility.php new file mode 100644 index 000000000000..990e89aa5e71 --- /dev/null +++ b/AdsAdManager/src/V1/Report/Visibility.php @@ -0,0 +1,65 @@ +google.ads.admanager.v1.Report.Visibility + */ +class Visibility +{ + /** + * Default value. Reports with hidden visibility will not appear in the Ad + * Manager UI. + * + * Generated from protobuf enum HIDDEN = 0; + */ + const HIDDEN = 0; + /** + * Reports with draft visibility will appear in the Ad Manager UI only if + * the user has configured the UI to show them. + * + * Generated from protobuf enum DRAFT = 1; + */ + const DRAFT = 1; + /** + * Reports with saved visibility will appear in the Ad Manager UI by + * default. + * + * Generated from protobuf enum SAVED = 2; + */ + const SAVED = 2; + + private static $valueToName = [ + self::HIDDEN => 'HIDDEN', + self::DRAFT => 'DRAFT', + self::SAVED => 'SAVED', + ]; + + 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/AdsAdManager/src/V1/ReportDefinition.php b/AdsAdManager/src/V1/ReportDefinition.php new file mode 100644 index 000000000000..148e84f9f03e --- /dev/null +++ b/AdsAdManager/src/V1/ReportDefinition.php @@ -0,0 +1,667 @@ +google.ads.admanager.v1.ReportDefinition + */ +class ReportDefinition extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The list of dimensions to report on. If empty, the report will + * have no dimensions, and any metrics will be totals. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Dimension dimensions = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $dimensions; + /** + * Required. The list of metrics to report on. If empty, the report will have + * no metrics. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Metric metrics = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $metrics; + /** + * Optional. The filters for this report. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Filter filters = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $filters; + /** + * Optional. The time zone the date range is defined in for this report. + * Defaults to publisher's time zone if not specified. Time zone in IANA + * format. Acceptable values depend on the report type. Publisher time zone is + * always accepted. Use "America/Los_Angeles" for pacific time, or "Etc/UTC" + * for UTC. + * + * Generated from protobuf field string time_zone = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $time_zone = ''; + /** + * Optional. The ISO 4217 currency code for this report. Defaults to publisher + * currency code if not specified. + * + * Generated from protobuf field string currency_code = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $currency_code = ''; + /** + * Required. The primary date range of this report. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.DateRange date_range = 6 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $date_range = null; + /** + * Optional. The comparison date range of this report. If unspecified, the + * report will not have any comparison metrics. + * + * Generated from protobuf field optional .google.ads.admanager.v1.Report.DateRange comparison_date_range = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $comparison_date_range = null; + /** + * Optional. Custom Dimension keys that represent CUSTOM_DIMENSION_* + * dimensions. The index of this repeated field corresponds to the index on + * each dimension. For example, custom_dimension_key_ids[0] describes + * CUSTOM_DIMENSION_0_VALUE_ID and CUSTOM_DIMENSION_0_VALUE. + * + * Generated from protobuf field repeated int64 custom_dimension_key_ids = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $custom_dimension_key_ids; + /** + * Optional. Custom field IDs that represent LINE_ITEM_CUSTOM_FIELD_* + * dimensions. The index of this repeated field corresponds to the index on + * each dimension. For example, line_item_custom_field_ids[0] describes + * LINE_ITEM_CUSTOM_FIELD_0_OPTION_ID and LINE_ITEM_CUSTOM_FIELD_0_VALUE. + * + * Generated from protobuf field repeated int64 line_item_custom_field_ids = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $line_item_custom_field_ids; + /** + * Optional. Custom field IDs that represent ORDER_CUSTOM_FIELD_* + * dimensions. The index of this repeated field corresponds to the index on + * each dimension. For example, order_custom_field_ids[0] describes + * ORDER_CUSTOM_FIELD_0_OPTION_ID and ORDER_CUSTOM_FIELD_0_VALUE. + * + * Generated from protobuf field repeated int64 order_custom_field_ids = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $order_custom_field_ids; + /** + * Optional. Custom field IDs that represent CREATIVE_CUSTOM_FIELD_* + * dimensions. The index of this repeated field corresponds to the index on + * each dimension. For example, creative_custom_field_ids[0] describes + * CREATIVE_CUSTOM_FIELD_0_OPTION_ID and CREATIVE_CUSTOM_FIELD_0_VALUE. + * + * Generated from protobuf field repeated int64 creative_custom_field_ids = 13 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $creative_custom_field_ids; + /** + * Required. The type of this report. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.ReportType report_type = 8 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $report_type = 0; + /** + * Optional. Include a time period column to introduce comparison columns in + * the report for each generated period. For example, set to "QUARTERS" here + * to have a column for each quarter present in the primary date range. If + * "PREVIOUS PERIOD" is specified in comparison_date_range, then each quarter + * column will also include comparison values for its relative previous + * quarter. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.TimePeriodColumn time_period_column = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $time_period_column = 0; + /** + * Optional. List of flags for this report. Used to flag rows in a result set + * based on a set of defined filters. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Flag flags = 14 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $flags; + /** + * Optional. Default sorts to apply to this report. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Sort sorts = 15 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $sorts; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $dimensions + * Required. The list of dimensions to report on. If empty, the report will + * have no dimensions, and any metrics will be totals. + * @type array|\Google\Protobuf\Internal\RepeatedField $metrics + * Required. The list of metrics to report on. If empty, the report will have + * no metrics. + * @type array<\Google\Ads\AdManager\V1\Report\Filter>|\Google\Protobuf\Internal\RepeatedField $filters + * Optional. The filters for this report. + * @type string $time_zone + * Optional. The time zone the date range is defined in for this report. + * Defaults to publisher's time zone if not specified. Time zone in IANA + * format. Acceptable values depend on the report type. Publisher time zone is + * always accepted. Use "America/Los_Angeles" for pacific time, or "Etc/UTC" + * for UTC. + * @type string $currency_code + * Optional. The ISO 4217 currency code for this report. Defaults to publisher + * currency code if not specified. + * @type \Google\Ads\AdManager\V1\Report\DateRange $date_range + * Required. The primary date range of this report. + * @type \Google\Ads\AdManager\V1\Report\DateRange $comparison_date_range + * Optional. The comparison date range of this report. If unspecified, the + * report will not have any comparison metrics. + * @type array|array|\Google\Protobuf\Internal\RepeatedField $custom_dimension_key_ids + * Optional. Custom Dimension keys that represent CUSTOM_DIMENSION_* + * dimensions. The index of this repeated field corresponds to the index on + * each dimension. For example, custom_dimension_key_ids[0] describes + * CUSTOM_DIMENSION_0_VALUE_ID and CUSTOM_DIMENSION_0_VALUE. + * @type array|array|\Google\Protobuf\Internal\RepeatedField $line_item_custom_field_ids + * Optional. Custom field IDs that represent LINE_ITEM_CUSTOM_FIELD_* + * dimensions. The index of this repeated field corresponds to the index on + * each dimension. For example, line_item_custom_field_ids[0] describes + * LINE_ITEM_CUSTOM_FIELD_0_OPTION_ID and LINE_ITEM_CUSTOM_FIELD_0_VALUE. + * @type array|array|\Google\Protobuf\Internal\RepeatedField $order_custom_field_ids + * Optional. Custom field IDs that represent ORDER_CUSTOM_FIELD_* + * dimensions. The index of this repeated field corresponds to the index on + * each dimension. For example, order_custom_field_ids[0] describes + * ORDER_CUSTOM_FIELD_0_OPTION_ID and ORDER_CUSTOM_FIELD_0_VALUE. + * @type array|array|\Google\Protobuf\Internal\RepeatedField $creative_custom_field_ids + * Optional. Custom field IDs that represent CREATIVE_CUSTOM_FIELD_* + * dimensions. The index of this repeated field corresponds to the index on + * each dimension. For example, creative_custom_field_ids[0] describes + * CREATIVE_CUSTOM_FIELD_0_OPTION_ID and CREATIVE_CUSTOM_FIELD_0_VALUE. + * @type int $report_type + * Required. The type of this report. + * @type int $time_period_column + * Optional. Include a time period column to introduce comparison columns in + * the report for each generated period. For example, set to "QUARTERS" here + * to have a column for each quarter present in the primary date range. If + * "PREVIOUS PERIOD" is specified in comparison_date_range, then each quarter + * column will also include comparison values for its relative previous + * quarter. + * @type array<\Google\Ads\AdManager\V1\Report\Flag>|\Google\Protobuf\Internal\RepeatedField $flags + * Optional. List of flags for this report. Used to flag rows in a result set + * based on a set of defined filters. + * @type array<\Google\Ads\AdManager\V1\Report\Sort>|\Google\Protobuf\Internal\RepeatedField $sorts + * Optional. Default sorts to apply to this report. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\ReportService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The list of dimensions to report on. If empty, the report will + * have no dimensions, and any metrics will be totals. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Dimension dimensions = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDimensions() + { + return $this->dimensions; + } + + /** + * Required. The list of dimensions to report on. If empty, the report will + * have no dimensions, and any metrics will be totals. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Dimension dimensions = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDimensions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Ads\AdManager\V1\Report\Dimension::class); + $this->dimensions = $arr; + + return $this; + } + + /** + * Required. The list of metrics to report on. If empty, the report will have + * no metrics. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Metric metrics = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMetrics() + { + return $this->metrics; + } + + /** + * Required. The list of metrics to report on. If empty, the report will have + * no metrics. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Metric metrics = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMetrics($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Ads\AdManager\V1\Report\Metric::class); + $this->metrics = $arr; + + return $this; + } + + /** + * Optional. The filters for this report. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Filter filters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFilters() + { + return $this->filters; + } + + /** + * Optional. The filters for this report. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Filter filters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Ads\AdManager\V1\Report\Filter>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFilters($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\Report\Filter::class); + $this->filters = $arr; + + return $this; + } + + /** + * Optional. The time zone the date range is defined in for this report. + * Defaults to publisher's time zone if not specified. Time zone in IANA + * format. Acceptable values depend on the report type. Publisher time zone is + * always accepted. Use "America/Los_Angeles" for pacific time, or "Etc/UTC" + * for UTC. + * + * Generated from protobuf field string time_zone = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getTimeZone() + { + return $this->time_zone; + } + + /** + * Optional. The time zone the date range is defined in for this report. + * Defaults to publisher's time zone if not specified. Time zone in IANA + * format. Acceptable values depend on the report type. Publisher time zone is + * always accepted. Use "America/Los_Angeles" for pacific time, or "Etc/UTC" + * for UTC. + * + * Generated from protobuf field string time_zone = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setTimeZone($var) + { + GPBUtil::checkString($var, True); + $this->time_zone = $var; + + return $this; + } + + /** + * Optional. The ISO 4217 currency code for this report. Defaults to publisher + * currency code if not specified. + * + * Generated from protobuf field string currency_code = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getCurrencyCode() + { + return $this->currency_code; + } + + /** + * Optional. The ISO 4217 currency code for this report. Defaults to publisher + * currency code if not specified. + * + * Generated from protobuf field string currency_code = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setCurrencyCode($var) + { + GPBUtil::checkString($var, True); + $this->currency_code = $var; + + return $this; + } + + /** + * Required. The primary date range of this report. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.DateRange date_range = 6 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Ads\AdManager\V1\Report\DateRange|null + */ + public function getDateRange() + { + return $this->date_range; + } + + public function hasDateRange() + { + return isset($this->date_range); + } + + public function clearDateRange() + { + unset($this->date_range); + } + + /** + * Required. The primary date range of this report. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.DateRange date_range = 6 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Ads\AdManager\V1\Report\DateRange $var + * @return $this + */ + public function setDateRange($var) + { + GPBUtil::checkMessage($var, \Google\Ads\AdManager\V1\Report\DateRange::class); + $this->date_range = $var; + + return $this; + } + + /** + * Optional. The comparison date range of this report. If unspecified, the + * report will not have any comparison metrics. + * + * Generated from protobuf field optional .google.ads.admanager.v1.Report.DateRange comparison_date_range = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Ads\AdManager\V1\Report\DateRange|null + */ + public function getComparisonDateRange() + { + return $this->comparison_date_range; + } + + public function hasComparisonDateRange() + { + return isset($this->comparison_date_range); + } + + public function clearComparisonDateRange() + { + unset($this->comparison_date_range); + } + + /** + * Optional. The comparison date range of this report. If unspecified, the + * report will not have any comparison metrics. + * + * Generated from protobuf field optional .google.ads.admanager.v1.Report.DateRange comparison_date_range = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Ads\AdManager\V1\Report\DateRange $var + * @return $this + */ + public function setComparisonDateRange($var) + { + GPBUtil::checkMessage($var, \Google\Ads\AdManager\V1\Report\DateRange::class); + $this->comparison_date_range = $var; + + return $this; + } + + /** + * Optional. Custom Dimension keys that represent CUSTOM_DIMENSION_* + * dimensions. The index of this repeated field corresponds to the index on + * each dimension. For example, custom_dimension_key_ids[0] describes + * CUSTOM_DIMENSION_0_VALUE_ID and CUSTOM_DIMENSION_0_VALUE. + * + * Generated from protobuf field repeated int64 custom_dimension_key_ids = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCustomDimensionKeyIds() + { + return $this->custom_dimension_key_ids; + } + + /** + * Optional. Custom Dimension keys that represent CUSTOM_DIMENSION_* + * dimensions. The index of this repeated field corresponds to the index on + * each dimension. For example, custom_dimension_key_ids[0] describes + * CUSTOM_DIMENSION_0_VALUE_ID and CUSTOM_DIMENSION_0_VALUE. + * + * Generated from protobuf field repeated int64 custom_dimension_key_ids = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCustomDimensionKeyIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT64); + $this->custom_dimension_key_ids = $arr; + + return $this; + } + + /** + * Optional. Custom field IDs that represent LINE_ITEM_CUSTOM_FIELD_* + * dimensions. The index of this repeated field corresponds to the index on + * each dimension. For example, line_item_custom_field_ids[0] describes + * LINE_ITEM_CUSTOM_FIELD_0_OPTION_ID and LINE_ITEM_CUSTOM_FIELD_0_VALUE. + * + * Generated from protobuf field repeated int64 line_item_custom_field_ids = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLineItemCustomFieldIds() + { + return $this->line_item_custom_field_ids; + } + + /** + * Optional. Custom field IDs that represent LINE_ITEM_CUSTOM_FIELD_* + * dimensions. The index of this repeated field corresponds to the index on + * each dimension. For example, line_item_custom_field_ids[0] describes + * LINE_ITEM_CUSTOM_FIELD_0_OPTION_ID and LINE_ITEM_CUSTOM_FIELD_0_VALUE. + * + * Generated from protobuf field repeated int64 line_item_custom_field_ids = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLineItemCustomFieldIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT64); + $this->line_item_custom_field_ids = $arr; + + return $this; + } + + /** + * Optional. Custom field IDs that represent ORDER_CUSTOM_FIELD_* + * dimensions. The index of this repeated field corresponds to the index on + * each dimension. For example, order_custom_field_ids[0] describes + * ORDER_CUSTOM_FIELD_0_OPTION_ID and ORDER_CUSTOM_FIELD_0_VALUE. + * + * Generated from protobuf field repeated int64 order_custom_field_ids = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOrderCustomFieldIds() + { + return $this->order_custom_field_ids; + } + + /** + * Optional. Custom field IDs that represent ORDER_CUSTOM_FIELD_* + * dimensions. The index of this repeated field corresponds to the index on + * each dimension. For example, order_custom_field_ids[0] describes + * ORDER_CUSTOM_FIELD_0_OPTION_ID and ORDER_CUSTOM_FIELD_0_VALUE. + * + * Generated from protobuf field repeated int64 order_custom_field_ids = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOrderCustomFieldIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT64); + $this->order_custom_field_ids = $arr; + + return $this; + } + + /** + * Optional. Custom field IDs that represent CREATIVE_CUSTOM_FIELD_* + * dimensions. The index of this repeated field corresponds to the index on + * each dimension. For example, creative_custom_field_ids[0] describes + * CREATIVE_CUSTOM_FIELD_0_OPTION_ID and CREATIVE_CUSTOM_FIELD_0_VALUE. + * + * Generated from protobuf field repeated int64 creative_custom_field_ids = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCreativeCustomFieldIds() + { + return $this->creative_custom_field_ids; + } + + /** + * Optional. Custom field IDs that represent CREATIVE_CUSTOM_FIELD_* + * dimensions. The index of this repeated field corresponds to the index on + * each dimension. For example, creative_custom_field_ids[0] describes + * CREATIVE_CUSTOM_FIELD_0_OPTION_ID and CREATIVE_CUSTOM_FIELD_0_VALUE. + * + * Generated from protobuf field repeated int64 creative_custom_field_ids = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCreativeCustomFieldIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT64); + $this->creative_custom_field_ids = $arr; + + return $this; + } + + /** + * Required. The type of this report. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.ReportType report_type = 8 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getReportType() + { + return $this->report_type; + } + + /** + * Required. The type of this report. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.ReportType report_type = 8 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setReportType($var) + { + GPBUtil::checkEnum($var, \Google\Ads\AdManager\V1\Report\ReportType::class); + $this->report_type = $var; + + return $this; + } + + /** + * Optional. Include a time period column to introduce comparison columns in + * the report for each generated period. For example, set to "QUARTERS" here + * to have a column for each quarter present in the primary date range. If + * "PREVIOUS PERIOD" is specified in comparison_date_range, then each quarter + * column will also include comparison values for its relative previous + * quarter. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.TimePeriodColumn time_period_column = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getTimePeriodColumn() + { + return $this->time_period_column; + } + + /** + * Optional. Include a time period column to introduce comparison columns in + * the report for each generated period. For example, set to "QUARTERS" here + * to have a column for each quarter present in the primary date range. If + * "PREVIOUS PERIOD" is specified in comparison_date_range, then each quarter + * column will also include comparison values for its relative previous + * quarter. + * + * Generated from protobuf field .google.ads.admanager.v1.Report.TimePeriodColumn time_period_column = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setTimePeriodColumn($var) + { + GPBUtil::checkEnum($var, \Google\Ads\AdManager\V1\Report\TimePeriodColumn::class); + $this->time_period_column = $var; + + return $this; + } + + /** + * Optional. List of flags for this report. Used to flag rows in a result set + * based on a set of defined filters. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Flag flags = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFlags() + { + return $this->flags; + } + + /** + * Optional. List of flags for this report. Used to flag rows in a result set + * based on a set of defined filters. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Flag flags = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Ads\AdManager\V1\Report\Flag>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFlags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\Report\Flag::class); + $this->flags = $arr; + + return $this; + } + + /** + * Optional. Default sorts to apply to this report. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Sort sorts = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSorts() + { + return $this->sorts; + } + + /** + * Optional. Default sorts to apply to this report. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Sort sorts = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Ads\AdManager\V1\Report\Sort>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSorts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\Report\Sort::class); + $this->sorts = $arr; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/Role.php b/AdsAdManager/src/V1/Role.php new file mode 100644 index 000000000000..dada96c1f725 --- /dev/null +++ b/AdsAdManager/src/V1/Role.php @@ -0,0 +1,241 @@ +google.ads.admanager.v1.Role + */ +class Role extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The resource name of the `Role`. + * Format: `networks/{network_code}/roles/{role_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. `Role` ID. + * + * Generated from protobuf field int64 role_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $role_id = 0; + /** + * Required. The display name of the `Role`. + * + * Generated from protobuf field string display_name = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + /** + * Optional. The description of the `Role`. + * + * Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Output only. Whether the `Role` is a built-in or custom user role. + * + * Generated from protobuf field bool built_in = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $built_in = false; + /** + * Output only. The status of the `Role`. + * + * Generated from protobuf field .google.ads.admanager.v1.RoleStatusEnum.RoleStatus status = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The resource name of the `Role`. + * Format: `networks/{network_code}/roles/{role_id}` + * @type int|string $role_id + * Output only. `Role` ID. + * @type string $display_name + * Required. The display name of the `Role`. + * @type string $description + * Optional. The description of the `Role`. + * @type bool $built_in + * Output only. Whether the `Role` is a built-in or custom user role. + * @type int $status + * Output only. The status of the `Role`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\RoleMessages::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The resource name of the `Role`. + * Format: `networks/{network_code}/roles/{role_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The resource name of the `Role`. + * Format: `networks/{network_code}/roles/{role_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. `Role` ID. + * + * Generated from protobuf field int64 role_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getRoleId() + { + return $this->role_id; + } + + /** + * Output only. `Role` ID. + * + * Generated from protobuf field int64 role_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setRoleId($var) + { + GPBUtil::checkInt64($var); + $this->role_id = $var; + + return $this; + } + + /** + * Required. The display name of the `Role`. + * + * Generated from protobuf field string display_name = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. The display name of the `Role`. + * + * Generated from protobuf field string display_name = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Optional. The description of the `Role`. + * + * Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. The description of the `Role`. + * + * Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. Whether the `Role` is a built-in or custom user role. + * + * Generated from protobuf field bool built_in = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getBuiltIn() + { + return $this->built_in; + } + + /** + * Output only. Whether the `Role` is a built-in or custom user role. + * + * Generated from protobuf field bool built_in = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setBuiltIn($var) + { + GPBUtil::checkBool($var); + $this->built_in = $var; + + return $this; + } + + /** + * Output only. The status of the `Role`. + * + * Generated from protobuf field .google.ads.admanager.v1.RoleStatusEnum.RoleStatus status = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getStatus() + { + return $this->status; + } + + /** + * Output only. The status of the `Role`. + * + * Generated from protobuf field .google.ads.admanager.v1.RoleStatusEnum.RoleStatus status = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkEnum($var, \Google\Ads\AdManager\V1\RoleStatusEnum\RoleStatus::class); + $this->status = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/RoleStatusEnum.php b/AdsAdManager/src/V1/RoleStatusEnum.php new file mode 100644 index 000000000000..f503830b55c8 --- /dev/null +++ b/AdsAdManager/src/V1/RoleStatusEnum.php @@ -0,0 +1,34 @@ +google.ads.admanager.v1.RoleStatusEnum + */ +class RoleStatusEnum extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\RoleEnums::initOnce(); + parent::__construct($data); + } + +} + diff --git a/AdsAdManager/src/V1/RoleStatusEnum/RoleStatus.php b/AdsAdManager/src/V1/RoleStatusEnum/RoleStatus.php new file mode 100644 index 000000000000..d217869ae173 --- /dev/null +++ b/AdsAdManager/src/V1/RoleStatusEnum/RoleStatus.php @@ -0,0 +1,62 @@ +google.ads.admanager.v1.RoleStatusEnum.RoleStatus + */ +class RoleStatus +{ + /** + * No value specified. + * + * Generated from protobuf enum ROLE_STATUS_UNSPECIFIED = 0; + */ + const ROLE_STATUS_UNSPECIFIED = 0; + /** + * Role is active. + * + * Generated from protobuf enum ACTIVE = 1; + */ + const ACTIVE = 1; + /** + * Role is inactive. + * + * Generated from protobuf enum INACTIVE = 2; + */ + const INACTIVE = 2; + + private static $valueToName = [ + self::ROLE_STATUS_UNSPECIFIED => 'ROLE_STATUS_UNSPECIFIED', + self::ACTIVE => 'ACTIVE', + self::INACTIVE => 'INACTIVE', + ]; + + 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/AdsAdManager/src/V1/RunReportMetadata.php b/AdsAdManager/src/V1/RunReportMetadata.php new file mode 100644 index 000000000000..8ef7b7307ec0 --- /dev/null +++ b/AdsAdManager/src/V1/RunReportMetadata.php @@ -0,0 +1,105 @@ +google.ads.admanager.v1.RunReportMetadata + */ +class RunReportMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * An estimate of how close this report is to being completed. Will always be + * 100 for failed and completed reports. + * + * Generated from protobuf field int32 percent_complete = 2; + */ + protected $percent_complete = 0; + /** + * The result's parent report. + * + * Generated from protobuf field string report = 4 [(.google.api.resource_reference) = { + */ + protected $report = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $percent_complete + * An estimate of how close this report is to being completed. Will always be + * 100 for failed and completed reports. + * @type string $report + * The result's parent report. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\ReportService::initOnce(); + parent::__construct($data); + } + + /** + * An estimate of how close this report is to being completed. Will always be + * 100 for failed and completed reports. + * + * Generated from protobuf field int32 percent_complete = 2; + * @return int + */ + public function getPercentComplete() + { + return $this->percent_complete; + } + + /** + * An estimate of how close this report is to being completed. Will always be + * 100 for failed and completed reports. + * + * Generated from protobuf field int32 percent_complete = 2; + * @param int $var + * @return $this + */ + public function setPercentComplete($var) + { + GPBUtil::checkInt32($var); + $this->percent_complete = $var; + + return $this; + } + + /** + * The result's parent report. + * + * Generated from protobuf field string report = 4 [(.google.api.resource_reference) = { + * @return string + */ + public function getReport() + { + return $this->report; + } + + /** + * The result's parent report. + * + * Generated from protobuf field string report = 4 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setReport($var) + { + GPBUtil::checkString($var, True); + $this->report = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/RunReportRequest.php b/AdsAdManager/src/V1/RunReportRequest.php new file mode 100644 index 000000000000..45effb973cb7 --- /dev/null +++ b/AdsAdManager/src/V1/RunReportRequest.php @@ -0,0 +1,86 @@ +google.ads.admanager.v1.RunReportRequest + */ +class RunReportRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The report to run. + * Format: `networks/{network_code}/reports/{report_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The report to run. + * Format: `networks/{network_code}/reports/{report_id}` + * Please see {@see ReportServiceClient::reportName()} for help formatting this field. + * + * @return \Google\Ads\AdManager\V1\RunReportRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The report to run. + * Format: `networks/{network_code}/reports/{report_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\ReportService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The report to run. + * Format: `networks/{network_code}/reports/{report_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The report to run. + * Format: `networks/{network_code}/reports/{report_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/RunReportResponse.php b/AdsAdManager/src/V1/RunReportResponse.php new file mode 100644 index 000000000000..c19b155b00c9 --- /dev/null +++ b/AdsAdManager/src/V1/RunReportResponse.php @@ -0,0 +1,71 @@ +google.ads.admanager.v1.RunReportResponse + */ +class RunReportResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The unique name of the generated result. Use with `FetchReportResultRows` + * to retrieve data. + * + * Generated from protobuf field string report_result = 1; + */ + protected $report_result = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $report_result + * The unique name of the generated result. Use with `FetchReportResultRows` + * to retrieve data. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\ReportService::initOnce(); + parent::__construct($data); + } + + /** + * The unique name of the generated result. Use with `FetchReportResultRows` + * to retrieve data. + * + * Generated from protobuf field string report_result = 1; + * @return string + */ + public function getReportResult() + { + return $this->report_result; + } + + /** + * The unique name of the generated result. Use with `FetchReportResultRows` + * to retrieve data. + * + * Generated from protobuf field string report_result = 1; + * @param string $var + * @return $this + */ + public function setReportResult($var) + { + GPBUtil::checkString($var, True); + $this->report_result = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/Schedule.php b/AdsAdManager/src/V1/Schedule.php new file mode 100644 index 000000000000..cb71b1409633 --- /dev/null +++ b/AdsAdManager/src/V1/Schedule.php @@ -0,0 +1,306 @@ +google.ads.admanager.v1.Schedule + */ +class Schedule extends \Google\Protobuf\Internal\Message +{ + /** + * Date for the first run of the report. + * + * Generated from protobuf field .google.type.Date start_date = 1; + */ + protected $start_date = null; + /** + * Date for the final run of the report. + * + * Generated from protobuf field .google.type.Date end_date = 2; + */ + protected $end_date = null; + /** + * Frequency to run report. + * + * Generated from protobuf field .google.ads.admanager.v1.Schedule.Frequency frequency = 3; + */ + protected $frequency = 0; + /** + * Indicates start time for schedule to run + * Will use the time_zone from `ReportDefinition`. Defaults + * to the publisher's time zone if not specified. + * For HOURLY, TWO_TIMES_DAILY, THREE_TIMES_DAILY, or FOUR_TIMES_DAILY, this + * will be the time of day that the first report will run on the first day. + * For example, if the start time is 2:00 PM, and the frequency is + * THREE_TIMES_DAILY, the first day will have reports scheduled at 2:00 PM, + * 10:00 PM. Each subsequent day will have reports scheduled at 6:00 AM, + * 2:00 PM, 10:00 PM. + * + * Generated from protobuf field .google.type.TimeOfDay start_time = 4; + */ + protected $start_time = null; + protected $frequency_schedule; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Ads\AdManager\V1\Schedule\WeeklySchedule $weekly_schedule + * Days of week to schedule report run. + * @type \Google\Ads\AdManager\V1\Schedule\MonthlySchedule $monthly_schedule + * Days of month to schedule report run. + * @type \Google\Type\Date $start_date + * Date for the first run of the report. + * @type \Google\Type\Date $end_date + * Date for the final run of the report. + * @type int $frequency + * Frequency to run report. + * @type \Google\Type\TimeOfDay $start_time + * Indicates start time for schedule to run + * Will use the time_zone from `ReportDefinition`. Defaults + * to the publisher's time zone if not specified. + * For HOURLY, TWO_TIMES_DAILY, THREE_TIMES_DAILY, or FOUR_TIMES_DAILY, this + * will be the time of day that the first report will run on the first day. + * For example, if the start time is 2:00 PM, and the frequency is + * THREE_TIMES_DAILY, the first day will have reports scheduled at 2:00 PM, + * 10:00 PM. Each subsequent day will have reports scheduled at 6:00 AM, + * 2:00 PM, 10:00 PM. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\ReportService::initOnce(); + parent::__construct($data); + } + + /** + * Days of week to schedule report run. + * + * Generated from protobuf field .google.ads.admanager.v1.Schedule.WeeklySchedule weekly_schedule = 6; + * @return \Google\Ads\AdManager\V1\Schedule\WeeklySchedule|null + */ + public function getWeeklySchedule() + { + return $this->readOneof(6); + } + + public function hasWeeklySchedule() + { + return $this->hasOneof(6); + } + + /** + * Days of week to schedule report run. + * + * Generated from protobuf field .google.ads.admanager.v1.Schedule.WeeklySchedule weekly_schedule = 6; + * @param \Google\Ads\AdManager\V1\Schedule\WeeklySchedule $var + * @return $this + */ + public function setWeeklySchedule($var) + { + GPBUtil::checkMessage($var, \Google\Ads\AdManager\V1\Schedule\WeeklySchedule::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Days of month to schedule report run. + * + * Generated from protobuf field .google.ads.admanager.v1.Schedule.MonthlySchedule monthly_schedule = 7; + * @return \Google\Ads\AdManager\V1\Schedule\MonthlySchedule|null + */ + public function getMonthlySchedule() + { + return $this->readOneof(7); + } + + public function hasMonthlySchedule() + { + return $this->hasOneof(7); + } + + /** + * Days of month to schedule report run. + * + * Generated from protobuf field .google.ads.admanager.v1.Schedule.MonthlySchedule monthly_schedule = 7; + * @param \Google\Ads\AdManager\V1\Schedule\MonthlySchedule $var + * @return $this + */ + public function setMonthlySchedule($var) + { + GPBUtil::checkMessage($var, \Google\Ads\AdManager\V1\Schedule\MonthlySchedule::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * Date for the first run of the report. + * + * Generated from protobuf field .google.type.Date start_date = 1; + * @return \Google\Type\Date|null + */ + public function getStartDate() + { + return $this->start_date; + } + + public function hasStartDate() + { + return isset($this->start_date); + } + + public function clearStartDate() + { + unset($this->start_date); + } + + /** + * Date for the first run of the report. + * + * Generated from protobuf field .google.type.Date start_date = 1; + * @param \Google\Type\Date $var + * @return $this + */ + public function setStartDate($var) + { + GPBUtil::checkMessage($var, \Google\Type\Date::class); + $this->start_date = $var; + + return $this; + } + + /** + * Date for the final run of the report. + * + * Generated from protobuf field .google.type.Date end_date = 2; + * @return \Google\Type\Date|null + */ + public function getEndDate() + { + return $this->end_date; + } + + public function hasEndDate() + { + return isset($this->end_date); + } + + public function clearEndDate() + { + unset($this->end_date); + } + + /** + * Date for the final run of the report. + * + * Generated from protobuf field .google.type.Date end_date = 2; + * @param \Google\Type\Date $var + * @return $this + */ + public function setEndDate($var) + { + GPBUtil::checkMessage($var, \Google\Type\Date::class); + $this->end_date = $var; + + return $this; + } + + /** + * Frequency to run report. + * + * Generated from protobuf field .google.ads.admanager.v1.Schedule.Frequency frequency = 3; + * @return int + */ + public function getFrequency() + { + return $this->frequency; + } + + /** + * Frequency to run report. + * + * Generated from protobuf field .google.ads.admanager.v1.Schedule.Frequency frequency = 3; + * @param int $var + * @return $this + */ + public function setFrequency($var) + { + GPBUtil::checkEnum($var, \Google\Ads\AdManager\V1\Schedule\Frequency::class); + $this->frequency = $var; + + return $this; + } + + /** + * Indicates start time for schedule to run + * Will use the time_zone from `ReportDefinition`. Defaults + * to the publisher's time zone if not specified. + * For HOURLY, TWO_TIMES_DAILY, THREE_TIMES_DAILY, or FOUR_TIMES_DAILY, this + * will be the time of day that the first report will run on the first day. + * For example, if the start time is 2:00 PM, and the frequency is + * THREE_TIMES_DAILY, the first day will have reports scheduled at 2:00 PM, + * 10:00 PM. Each subsequent day will have reports scheduled at 6:00 AM, + * 2:00 PM, 10:00 PM. + * + * Generated from protobuf field .google.type.TimeOfDay start_time = 4; + * @return \Google\Type\TimeOfDay|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Indicates start time for schedule to run + * Will use the time_zone from `ReportDefinition`. Defaults + * to the publisher's time zone if not specified. + * For HOURLY, TWO_TIMES_DAILY, THREE_TIMES_DAILY, or FOUR_TIMES_DAILY, this + * will be the time of day that the first report will run on the first day. + * For example, if the start time is 2:00 PM, and the frequency is + * THREE_TIMES_DAILY, the first day will have reports scheduled at 2:00 PM, + * 10:00 PM. Each subsequent day will have reports scheduled at 6:00 AM, + * 2:00 PM, 10:00 PM. + * + * Generated from protobuf field .google.type.TimeOfDay start_time = 4; + * @param \Google\Type\TimeOfDay $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Type\TimeOfDay::class); + $this->start_time = $var; + + return $this; + } + + /** + * @return string + */ + public function getFrequencySchedule() + { + return $this->whichOneof("frequency_schedule"); + } + +} + diff --git a/AdsAdManager/src/V1/Schedule/Frequency.php b/AdsAdManager/src/V1/Schedule/Frequency.php new file mode 100644 index 000000000000..079f0f2f6944 --- /dev/null +++ b/AdsAdManager/src/V1/Schedule/Frequency.php @@ -0,0 +1,97 @@ +google.ads.admanager.v1.Schedule.Frequency + */ +class Frequency +{ + /** + * No Frequency specified. + * + * Generated from protobuf enum FREQUENCY_UNSPECIFIED = 0; + */ + const FREQUENCY_UNSPECIFIED = 0; + /** + * Schedule report to run every hour. + * + * Generated from protobuf enum HOURLY = 1; + */ + const HOURLY = 1; + /** + * Schedule report to run twice a day (every 12 hours). + * + * Generated from protobuf enum TWO_TIMES_DAILY = 2; + */ + const TWO_TIMES_DAILY = 2; + /** + * Schedule report to run three times a day (every 8 hours). + * + * Generated from protobuf enum THREE_TIMES_DAILY = 3; + */ + const THREE_TIMES_DAILY = 3; + /** + * Schedule report to run four times a day (every 6 hours). + * + * Generated from protobuf enum FOUR_TIMES_DAILY = 4; + */ + const FOUR_TIMES_DAILY = 4; + /** + * Schedule report to run on a daily basis. + * + * Generated from protobuf enum DAILY = 5; + */ + const DAILY = 5; + /** + * Schedule report to run on a weekly basis. + * + * Generated from protobuf enum WEEKLY = 6; + */ + const WEEKLY = 6; + /** + * Schedule report to run on a monthly basis. + * + * Generated from protobuf enum MONTHLY = 7; + */ + const MONTHLY = 7; + + private static $valueToName = [ + self::FREQUENCY_UNSPECIFIED => 'FREQUENCY_UNSPECIFIED', + self::HOURLY => 'HOURLY', + self::TWO_TIMES_DAILY => 'TWO_TIMES_DAILY', + self::THREE_TIMES_DAILY => 'THREE_TIMES_DAILY', + self::FOUR_TIMES_DAILY => 'FOUR_TIMES_DAILY', + self::DAILY => 'DAILY', + self::WEEKLY => 'WEEKLY', + self::MONTHLY => 'MONTHLY', + ]; + + 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/AdsAdManager/src/V1/Schedule/MonthlySchedule.php b/AdsAdManager/src/V1/Schedule/MonthlySchedule.php new file mode 100644 index 000000000000..9997e91c800e --- /dev/null +++ b/AdsAdManager/src/V1/Schedule/MonthlySchedule.php @@ -0,0 +1,72 @@ +google.ads.admanager.v1.Schedule.MonthlySchedule + */ +class MonthlySchedule extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies days of the month to run report. Range is from 1-31. + * Will ignore days that are not valid for the given month. + * + * Generated from protobuf field repeated int32 monthly_scheduled_days = 1; + */ + private $monthly_scheduled_days; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $monthly_scheduled_days + * Specifies days of the month to run report. Range is from 1-31. + * Will ignore days that are not valid for the given month. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\ReportService::initOnce(); + parent::__construct($data); + } + + /** + * Specifies days of the month to run report. Range is from 1-31. + * Will ignore days that are not valid for the given month. + * + * Generated from protobuf field repeated int32 monthly_scheduled_days = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMonthlyScheduledDays() + { + return $this->monthly_scheduled_days; + } + + /** + * Specifies days of the month to run report. Range is from 1-31. + * Will ignore days that are not valid for the given month. + * + * Generated from protobuf field repeated int32 monthly_scheduled_days = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMonthlyScheduledDays($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); + $this->monthly_scheduled_days = $arr; + + return $this; + } + +} + + diff --git a/AdsAdManager/src/V1/Schedule/WeeklySchedule.php b/AdsAdManager/src/V1/Schedule/WeeklySchedule.php new file mode 100644 index 000000000000..c1b3d359a6f3 --- /dev/null +++ b/AdsAdManager/src/V1/Schedule/WeeklySchedule.php @@ -0,0 +1,68 @@ +google.ads.admanager.v1.Schedule.WeeklySchedule + */ +class WeeklySchedule extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies days of the week on which to run report. + * + * Generated from protobuf field repeated .google.type.DayOfWeek weekly_scheduled_days = 1; + */ + private $weekly_scheduled_days; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $weekly_scheduled_days + * Specifies days of the week on which to run report. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\ReportService::initOnce(); + parent::__construct($data); + } + + /** + * Specifies days of the week on which to run report. + * + * Generated from protobuf field repeated .google.type.DayOfWeek weekly_scheduled_days = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getWeeklyScheduledDays() + { + return $this->weekly_scheduled_days; + } + + /** + * Specifies days of the week on which to run report. + * + * Generated from protobuf field repeated .google.type.DayOfWeek weekly_scheduled_days = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setWeeklyScheduledDays($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Type\DayOfWeek::class); + $this->weekly_scheduled_days = $arr; + + return $this; + } + +} + + diff --git a/AdsAdManager/src/V1/ScheduleOptions.php b/AdsAdManager/src/V1/ScheduleOptions.php new file mode 100644 index 000000000000..fce3aa5c0d3c --- /dev/null +++ b/AdsAdManager/src/V1/ScheduleOptions.php @@ -0,0 +1,149 @@ +google.ads.admanager.v1.ScheduleOptions + */ +class ScheduleOptions extends \Google\Protobuf\Internal\Message +{ + /** + * Information pertaining to schedule itself. + * + * Generated from protobuf field .google.ads.admanager.v1.Schedule schedule = 1; + */ + protected $schedule = null; + /** + * Option for when to deliver the scheduled report. + * + * Generated from protobuf field .google.ads.admanager.v1.ScheduleOptions.DeliveryCondition delivery_condition = 2; + */ + protected $delivery_condition = 0; + /** + * Optional. The flags evaluated when ReportDeliveryOption.WHEN_FLAG_PRESENT + * is specified. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Flag flags = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $flags; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Ads\AdManager\V1\Schedule $schedule + * Information pertaining to schedule itself. + * @type int $delivery_condition + * Option for when to deliver the scheduled report. + * @type array<\Google\Ads\AdManager\V1\Report\Flag>|\Google\Protobuf\Internal\RepeatedField $flags + * Optional. The flags evaluated when ReportDeliveryOption.WHEN_FLAG_PRESENT + * is specified. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\ReportService::initOnce(); + parent::__construct($data); + } + + /** + * Information pertaining to schedule itself. + * + * Generated from protobuf field .google.ads.admanager.v1.Schedule schedule = 1; + * @return \Google\Ads\AdManager\V1\Schedule|null + */ + public function getSchedule() + { + return $this->schedule; + } + + public function hasSchedule() + { + return isset($this->schedule); + } + + public function clearSchedule() + { + unset($this->schedule); + } + + /** + * Information pertaining to schedule itself. + * + * Generated from protobuf field .google.ads.admanager.v1.Schedule schedule = 1; + * @param \Google\Ads\AdManager\V1\Schedule $var + * @return $this + */ + public function setSchedule($var) + { + GPBUtil::checkMessage($var, \Google\Ads\AdManager\V1\Schedule::class); + $this->schedule = $var; + + return $this; + } + + /** + * Option for when to deliver the scheduled report. + * + * Generated from protobuf field .google.ads.admanager.v1.ScheduleOptions.DeliveryCondition delivery_condition = 2; + * @return int + */ + public function getDeliveryCondition() + { + return $this->delivery_condition; + } + + /** + * Option for when to deliver the scheduled report. + * + * Generated from protobuf field .google.ads.admanager.v1.ScheduleOptions.DeliveryCondition delivery_condition = 2; + * @param int $var + * @return $this + */ + public function setDeliveryCondition($var) + { + GPBUtil::checkEnum($var, \Google\Ads\AdManager\V1\ScheduleOptions\DeliveryCondition::class); + $this->delivery_condition = $var; + + return $this; + } + + /** + * Optional. The flags evaluated when ReportDeliveryOption.WHEN_FLAG_PRESENT + * is specified. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Flag flags = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFlags() + { + return $this->flags; + } + + /** + * Optional. The flags evaluated when ReportDeliveryOption.WHEN_FLAG_PRESENT + * is specified. + * + * Generated from protobuf field repeated .google.ads.admanager.v1.Report.Flag flags = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Ads\AdManager\V1\Report\Flag>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFlags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\AdManager\V1\Report\Flag::class); + $this->flags = $arr; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/ScheduleOptions/DeliveryCondition.php b/AdsAdManager/src/V1/ScheduleOptions/DeliveryCondition.php new file mode 100644 index 000000000000..f6c9f5b1b827 --- /dev/null +++ b/AdsAdManager/src/V1/ScheduleOptions/DeliveryCondition.php @@ -0,0 +1,62 @@ +google.ads.admanager.v1.ScheduleOptions.DeliveryCondition + */ +class DeliveryCondition +{ + /** + * Never deliver report. + * + * Generated from protobuf enum NEVER = 0; + */ + const NEVER = 0; + /** + * Always deliver report. + * + * Generated from protobuf enum ALWAYS = 1; + */ + const ALWAYS = 1; + /** + * Deliver report when flag's conditions are met. + * + * Generated from protobuf enum WHEN_FLAG_CONDITIONS_MET = 2; + */ + const WHEN_FLAG_CONDITIONS_MET = 2; + + private static $valueToName = [ + self::NEVER => 'NEVER', + self::ALWAYS => 'ALWAYS', + self::WHEN_FLAG_CONDITIONS_MET => 'WHEN_FLAG_CONDITIONS_MET', + ]; + + 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/AdsAdManager/src/V1/Size.php b/AdsAdManager/src/V1/Size.php new file mode 100644 index 000000000000..927a409b1f5a --- /dev/null +++ b/AdsAdManager/src/V1/Size.php @@ -0,0 +1,163 @@ +google.ads.admanager.v1.Size + */ +class Size extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The width of the [Creative](google.ads.admanager.v1.Creative), + * [AdUnit](google.ads.admanager.v1.AdUnit), or + * [LineItem](google.ads.admanager.v1.LineItem). + * + * Generated from protobuf field int32 width = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $width = 0; + /** + * Required. The height of the [Creative](google.ads.admanager.v1.Creative), + * [AdUnit](google.ads.admanager.v1.AdUnit), or + * [LineItem](google.ads.admanager.v1.LineItem). + * + * Generated from protobuf field int32 height = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $height = 0; + /** + * Required. The SizeType of the + * [Creative](google.ads.admanager.v1.Creative), + * [AdUnit](google.ads.admanager.v1.AdUnit), or + * [LineItem](google.ads.admanager.v1.LineItem). + * + * Generated from protobuf field .google.ads.admanager.v1.SizeTypeEnum.SizeType size_type = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $size_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $width + * Required. The width of the [Creative](google.ads.admanager.v1.Creative), + * [AdUnit](google.ads.admanager.v1.AdUnit), or + * [LineItem](google.ads.admanager.v1.LineItem). + * @type int $height + * Required. The height of the [Creative](google.ads.admanager.v1.Creative), + * [AdUnit](google.ads.admanager.v1.AdUnit), or + * [LineItem](google.ads.admanager.v1.LineItem). + * @type int $size_type + * Required. The SizeType of the + * [Creative](google.ads.admanager.v1.Creative), + * [AdUnit](google.ads.admanager.v1.AdUnit), or + * [LineItem](google.ads.admanager.v1.LineItem). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\Size::initOnce(); + parent::__construct($data); + } + + /** + * Required. The width of the [Creative](google.ads.admanager.v1.Creative), + * [AdUnit](google.ads.admanager.v1.AdUnit), or + * [LineItem](google.ads.admanager.v1.LineItem). + * + * Generated from protobuf field int32 width = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getWidth() + { + return $this->width; + } + + /** + * Required. The width of the [Creative](google.ads.admanager.v1.Creative), + * [AdUnit](google.ads.admanager.v1.AdUnit), or + * [LineItem](google.ads.admanager.v1.LineItem). + * + * Generated from protobuf field int32 width = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setWidth($var) + { + GPBUtil::checkInt32($var); + $this->width = $var; + + return $this; + } + + /** + * Required. The height of the [Creative](google.ads.admanager.v1.Creative), + * [AdUnit](google.ads.admanager.v1.AdUnit), or + * [LineItem](google.ads.admanager.v1.LineItem). + * + * Generated from protobuf field int32 height = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getHeight() + { + return $this->height; + } + + /** + * Required. The height of the [Creative](google.ads.admanager.v1.Creative), + * [AdUnit](google.ads.admanager.v1.AdUnit), or + * [LineItem](google.ads.admanager.v1.LineItem). + * + * Generated from protobuf field int32 height = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setHeight($var) + { + GPBUtil::checkInt32($var); + $this->height = $var; + + return $this; + } + + /** + * Required. The SizeType of the + * [Creative](google.ads.admanager.v1.Creative), + * [AdUnit](google.ads.admanager.v1.AdUnit), or + * [LineItem](google.ads.admanager.v1.LineItem). + * + * Generated from protobuf field .google.ads.admanager.v1.SizeTypeEnum.SizeType size_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getSizeType() + { + return $this->size_type; + } + + /** + * Required. The SizeType of the + * [Creative](google.ads.admanager.v1.Creative), + * [AdUnit](google.ads.admanager.v1.AdUnit), or + * [LineItem](google.ads.admanager.v1.LineItem). + * + * Generated from protobuf field .google.ads.admanager.v1.SizeTypeEnum.SizeType size_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setSizeType($var) + { + GPBUtil::checkEnum($var, \Google\Ads\AdManager\V1\SizeTypeEnum\SizeType::class); + $this->size_type = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/SizeTypeEnum.php b/AdsAdManager/src/V1/SizeTypeEnum.php new file mode 100644 index 000000000000..245c82dc7304 --- /dev/null +++ b/AdsAdManager/src/V1/SizeTypeEnum.php @@ -0,0 +1,34 @@ +google.ads.admanager.v1.SizeTypeEnum + */ +class SizeTypeEnum extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\SizeTypeEnum::initOnce(); + parent::__construct($data); + } + +} + diff --git a/AdsAdManager/src/V1/SizeTypeEnum/SizeType.php b/AdsAdManager/src/V1/SizeTypeEnum/SizeType.php new file mode 100644 index 000000000000..4b3cbd0385b9 --- /dev/null +++ b/AdsAdManager/src/V1/SizeTypeEnum/SizeType.php @@ -0,0 +1,103 @@ +google.ads.admanager.v1.SizeTypeEnum.SizeType + */ +class SizeType +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum SIZE_TYPE_UNSPECIFIED = 0; + */ + const SIZE_TYPE_UNSPECIFIED = 0; + /** + * Dimension based size, an actual height and width in pixels. + * + * Generated from protobuf enum PIXEL = 1; + */ + const PIXEL = 1; + /** + * Size is expressed as a ratio. For example, 4:1 could be + * met by a 100 x 25 sized image. + * + * Generated from protobuf enum ASPECT_RATIO = 2; + */ + const ASPECT_RATIO = 2; + /** + * Out-of-page (Interstitial) size that is not related to the slot it is + * served. This must be used with 1x1 size. + * + * Generated from protobuf enum INTERSTITIAL = 3; + */ + const INTERSTITIAL = 3; + /** + * Size is ignored. This must be used with 1x1 + * size. + * + * Generated from protobuf enum IGNORED = 4; + */ + const IGNORED = 4; + /** + * Native size, which is a function of the how the client renders the + * creative. This must be used with 1x1 size. + * + * Generated from protobuf enum NATIVE = 5; + */ + const NATIVE = 5; + /** + * Fluid size. Automatically sizes the ad by filling the width of the + * enclosing column and adjusting the height as appropriate. This must be + * used with 1x1 size. + * + * Generated from protobuf enum FLUID = 6; + */ + const FLUID = 6; + /** + * Audio size. Used with audio ads. This must be used with 1x1 size. + * + * Generated from protobuf enum AUDIO = 7; + */ + const AUDIO = 7; + + private static $valueToName = [ + self::SIZE_TYPE_UNSPECIFIED => 'SIZE_TYPE_UNSPECIFIED', + self::PIXEL => 'PIXEL', + self::ASPECT_RATIO => 'ASPECT_RATIO', + self::INTERSTITIAL => 'INTERSTITIAL', + self::IGNORED => 'IGNORED', + self::NATIVE => 'NATIVE', + self::FLUID => 'FLUID', + self::AUDIO => 'AUDIO', + ]; + + 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/AdsAdManager/src/V1/SmartSizeModeEnum.php b/AdsAdManager/src/V1/SmartSizeModeEnum.php new file mode 100644 index 000000000000..40e9ca0edd29 --- /dev/null +++ b/AdsAdManager/src/V1/SmartSizeModeEnum.php @@ -0,0 +1,34 @@ +google.ads.admanager.v1.SmartSizeModeEnum + */ +class SmartSizeModeEnum extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\AdUnitEnums::initOnce(); + parent::__construct($data); + } + +} + diff --git a/AdsAdManager/src/V1/SmartSizeModeEnum/SmartSizeMode.php b/AdsAdManager/src/V1/SmartSizeModeEnum/SmartSizeMode.php new file mode 100644 index 000000000000..3b682e0be320 --- /dev/null +++ b/AdsAdManager/src/V1/SmartSizeModeEnum/SmartSizeMode.php @@ -0,0 +1,70 @@ +google.ads.admanager.v1.SmartSizeModeEnum.SmartSizeMode + */ +class SmartSizeMode +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum SMART_SIZE_MODE_UNSPECIFIED = 0; + */ + const SMART_SIZE_MODE_UNSPECIFIED = 0; + /** + * Fixed size mode (default). + * + * Generated from protobuf enum NONE = 1; + */ + const NONE = 1; + /** + * The height is fixed for the request, the width is a range. + * + * Generated from protobuf enum SMART_BANNER = 2; + */ + const SMART_BANNER = 2; + /** + * Height and width are ranges. + * + * Generated from protobuf enum DYNAMIC_SIZE = 3; + */ + const DYNAMIC_SIZE = 3; + + private static $valueToName = [ + self::SMART_SIZE_MODE_UNSPECIFIED => 'SMART_SIZE_MODE_UNSPECIFIED', + self::NONE => 'NONE', + self::SMART_BANNER => 'SMART_BANNER', + self::DYNAMIC_SIZE => 'DYNAMIC_SIZE', + ]; + + 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/AdsAdManager/src/V1/TargetWindowEnum.php b/AdsAdManager/src/V1/TargetWindowEnum.php new file mode 100644 index 000000000000..a8637484ab5b --- /dev/null +++ b/AdsAdManager/src/V1/TargetWindowEnum.php @@ -0,0 +1,34 @@ +google.ads.admanager.v1.TargetWindowEnum + */ +class TargetWindowEnum extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\AdUnitEnums::initOnce(); + parent::__construct($data); + } + +} + diff --git a/AdsAdManager/src/V1/TargetWindowEnum/TargetWindow.php b/AdsAdManager/src/V1/TargetWindowEnum/TargetWindow.php new file mode 100644 index 000000000000..8a8b36b99cf0 --- /dev/null +++ b/AdsAdManager/src/V1/TargetWindowEnum/TargetWindow.php @@ -0,0 +1,63 @@ +google.ads.admanager.v1.TargetWindowEnum.TargetWindow + */ +class TargetWindow +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum TARGET_WINDOW_UNSPECIFIED = 0; + */ + const TARGET_WINDOW_UNSPECIFIED = 0; + /** + * Specifies that the link should open in the full body of the page. + * + * Generated from protobuf enum TOP = 1; + */ + const TOP = 1; + /** + * Specifies that the link should open in a new window. + * + * Generated from protobuf enum BLANK = 2; + */ + const BLANK = 2; + + private static $valueToName = [ + self::TARGET_WINDOW_UNSPECIFIED => 'TARGET_WINDOW_UNSPECIFIED', + self::TOP => 'TOP', + self::BLANK => 'BLANK', + ]; + + 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/AdsAdManager/src/V1/TaxonomyCategory.php b/AdsAdManager/src/V1/TaxonomyCategory.php new file mode 100644 index 000000000000..53d713a41b4d --- /dev/null +++ b/AdsAdManager/src/V1/TaxonomyCategory.php @@ -0,0 +1,317 @@ +google.ads.admanager.v1.TaxonomyCategory + */ +class TaxonomyCategory extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The resource name of the `TaxonomyCategory`. + * Format: `networks/{network_code}/taxonomyCategories/{taxonomy_category_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. `TaxonomyCategory` ID. + * + * Generated from protobuf field int64 taxonomy_category_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $taxonomy_category_id = 0; + /** + * Output only. Display name of the `TaxonomyCategory`. + * + * Generated from protobuf field string display_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $display_name = ''; + /** + * Output only. Whether this `TaxonomyCategory` only serves to group its + * children. + * + * Generated from protobuf field bool grouping_only = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $grouping_only = false; + /** + * Output only. The ID of the parent category this `TaxonomyCategory` descends + * from. + * + * Generated from protobuf field int64 parent_taxonomy_category_id = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $parent_taxonomy_category_id = 0; + /** + * Output only. The taxonomy that this `TaxonomyCategory` belongs to. + * + * Generated from protobuf field .google.ads.admanager.v1.TaxonomyTypeEnum.TaxonomyType taxonomy_type = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $taxonomy_type = 0; + /** + * Output only. The list of names of the ancestors of this `TaxonomyCategory`. + * + * Generated from protobuf field repeated string ancestor_names = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $ancestor_names; + /** + * Output only. The list of IDs of the ancestors of this `TaxonomyCategory`. + * + * Generated from protobuf field repeated int64 ancestor_taxonomy_category_ids = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $ancestor_taxonomy_category_ids; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The resource name of the `TaxonomyCategory`. + * Format: `networks/{network_code}/taxonomyCategories/{taxonomy_category_id}` + * @type int|string $taxonomy_category_id + * Output only. `TaxonomyCategory` ID. + * @type string $display_name + * Output only. Display name of the `TaxonomyCategory`. + * @type bool $grouping_only + * Output only. Whether this `TaxonomyCategory` only serves to group its + * children. + * @type int|string $parent_taxonomy_category_id + * Output only. The ID of the parent category this `TaxonomyCategory` descends + * from. + * @type int $taxonomy_type + * Output only. The taxonomy that this `TaxonomyCategory` belongs to. + * @type array|\Google\Protobuf\Internal\RepeatedField $ancestor_names + * Output only. The list of names of the ancestors of this `TaxonomyCategory`. + * @type array|array|\Google\Protobuf\Internal\RepeatedField $ancestor_taxonomy_category_ids + * Output only. The list of IDs of the ancestors of this `TaxonomyCategory`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\TaxonomyCategoryMessages::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The resource name of the `TaxonomyCategory`. + * Format: `networks/{network_code}/taxonomyCategories/{taxonomy_category_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The resource name of the `TaxonomyCategory`. + * Format: `networks/{network_code}/taxonomyCategories/{taxonomy_category_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. `TaxonomyCategory` ID. + * + * Generated from protobuf field int64 taxonomy_category_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getTaxonomyCategoryId() + { + return $this->taxonomy_category_id; + } + + /** + * Output only. `TaxonomyCategory` ID. + * + * Generated from protobuf field int64 taxonomy_category_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setTaxonomyCategoryId($var) + { + GPBUtil::checkInt64($var); + $this->taxonomy_category_id = $var; + + return $this; + } + + /** + * Output only. Display name of the `TaxonomyCategory`. + * + * Generated from protobuf field string display_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Output only. Display name of the `TaxonomyCategory`. + * + * Generated from protobuf field string display_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. Whether this `TaxonomyCategory` only serves to group its + * children. + * + * Generated from protobuf field bool grouping_only = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getGroupingOnly() + { + return $this->grouping_only; + } + + /** + * Output only. Whether this `TaxonomyCategory` only serves to group its + * children. + * + * Generated from protobuf field bool grouping_only = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setGroupingOnly($var) + { + GPBUtil::checkBool($var); + $this->grouping_only = $var; + + return $this; + } + + /** + * Output only. The ID of the parent category this `TaxonomyCategory` descends + * from. + * + * Generated from protobuf field int64 parent_taxonomy_category_id = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getParentTaxonomyCategoryId() + { + return $this->parent_taxonomy_category_id; + } + + /** + * Output only. The ID of the parent category this `TaxonomyCategory` descends + * from. + * + * Generated from protobuf field int64 parent_taxonomy_category_id = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setParentTaxonomyCategoryId($var) + { + GPBUtil::checkInt64($var); + $this->parent_taxonomy_category_id = $var; + + return $this; + } + + /** + * Output only. The taxonomy that this `TaxonomyCategory` belongs to. + * + * Generated from protobuf field .google.ads.admanager.v1.TaxonomyTypeEnum.TaxonomyType taxonomy_type = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getTaxonomyType() + { + return $this->taxonomy_type; + } + + /** + * Output only. The taxonomy that this `TaxonomyCategory` belongs to. + * + * Generated from protobuf field .google.ads.admanager.v1.TaxonomyTypeEnum.TaxonomyType taxonomy_type = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setTaxonomyType($var) + { + GPBUtil::checkEnum($var, \Google\Ads\AdManager\V1\TaxonomyTypeEnum\TaxonomyType::class); + $this->taxonomy_type = $var; + + return $this; + } + + /** + * Output only. The list of names of the ancestors of this `TaxonomyCategory`. + * + * Generated from protobuf field repeated string ancestor_names = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAncestorNames() + { + return $this->ancestor_names; + } + + /** + * Output only. The list of names of the ancestors of this `TaxonomyCategory`. + * + * Generated from protobuf field repeated string ancestor_names = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAncestorNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->ancestor_names = $arr; + + return $this; + } + + /** + * Output only. The list of IDs of the ancestors of this `TaxonomyCategory`. + * + * Generated from protobuf field repeated int64 ancestor_taxonomy_category_ids = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAncestorTaxonomyCategoryIds() + { + return $this->ancestor_taxonomy_category_ids; + } + + /** + * Output only. The list of IDs of the ancestors of this `TaxonomyCategory`. + * + * Generated from protobuf field repeated int64 ancestor_taxonomy_category_ids = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAncestorTaxonomyCategoryIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT64); + $this->ancestor_taxonomy_category_ids = $arr; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/TaxonomyTypeEnum.php b/AdsAdManager/src/V1/TaxonomyTypeEnum.php new file mode 100644 index 000000000000..0eb538bca072 --- /dev/null +++ b/AdsAdManager/src/V1/TaxonomyTypeEnum.php @@ -0,0 +1,34 @@ +google.ads.admanager.v1.TaxonomyTypeEnum + */ +class TaxonomyTypeEnum extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\TaxonomyTypeEnum::initOnce(); + parent::__construct($data); + } + +} + diff --git a/AdsAdManager/src/V1/TaxonomyTypeEnum/TaxonomyType.php b/AdsAdManager/src/V1/TaxonomyTypeEnum/TaxonomyType.php new file mode 100644 index 000000000000..e3dcd4043d54 --- /dev/null +++ b/AdsAdManager/src/V1/TaxonomyTypeEnum/TaxonomyType.php @@ -0,0 +1,84 @@ +google.ads.admanager.v1.TaxonomyTypeEnum.TaxonomyType + */ +class TaxonomyType +{ + /** + * Unspecified/not present + * + * Generated from protobuf enum TAXONOMY_TYPE_UNSPECIFIED = 0; + */ + const TAXONOMY_TYPE_UNSPECIFIED = 0; + /** + * The IAB Audience Taxonomy v1.1. + * + * Generated from protobuf enum TAXONOMY_IAB_AUDIENCE_1_1 = 3; + */ + const TAXONOMY_IAB_AUDIENCE_1_1 = 3; + /** + * The IAB Content Taxonomy v2.1. + * + * Generated from protobuf enum TAXONOMY_IAB_CONTENT_2_1 = 4; + */ + const TAXONOMY_IAB_CONTENT_2_1 = 4; + /** + * The IAB Content Taxonomy v2.2. + * + * Generated from protobuf enum TAXONOMY_IAB_CONTENT_2_2 = 6; + */ + const TAXONOMY_IAB_CONTENT_2_2 = 6; + /** + * The IAB Content Taxonomy v3.0. + * + * Generated from protobuf enum TAXONOMY_IAB_CONTENT_3_0 = 5; + */ + const TAXONOMY_IAB_CONTENT_3_0 = 5; + /** + * The PPS structured video signals taxonomy. + * + * Generated from protobuf enum TAXONOMY_GOOGLE_STRUCTURED_VIDEO_1_0 = 7; + */ + const TAXONOMY_GOOGLE_STRUCTURED_VIDEO_1_0 = 7; + + private static $valueToName = [ + self::TAXONOMY_TYPE_UNSPECIFIED => 'TAXONOMY_TYPE_UNSPECIFIED', + self::TAXONOMY_IAB_AUDIENCE_1_1 => 'TAXONOMY_IAB_AUDIENCE_1_1', + self::TAXONOMY_IAB_CONTENT_2_1 => 'TAXONOMY_IAB_CONTENT_2_1', + self::TAXONOMY_IAB_CONTENT_2_2 => 'TAXONOMY_IAB_CONTENT_2_2', + self::TAXONOMY_IAB_CONTENT_3_0 => 'TAXONOMY_IAB_CONTENT_3_0', + self::TAXONOMY_GOOGLE_STRUCTURED_VIDEO_1_0 => 'TAXONOMY_GOOGLE_STRUCTURED_VIDEO_1_0', + ]; + + 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/AdsAdManager/src/V1/Team.php b/AdsAdManager/src/V1/Team.php new file mode 100644 index 000000000000..d48d2bf8bc0a --- /dev/null +++ b/AdsAdManager/src/V1/Team.php @@ -0,0 +1,109 @@ +google.ads.admanager.v1.Team + */ +class Team extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The resource name of the `Team`. + * Format: `networks/{network_code}/teams/{team_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. The unique ID of the Team. This value is assigned by Google. + * Teams that are created by Google will have negative IDs. + * + * Generated from protobuf field int64 team_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $team_id = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The resource name of the `Team`. + * Format: `networks/{network_code}/teams/{team_id}` + * @type int|string $team_id + * Output only. The unique ID of the Team. This value is assigned by Google. + * Teams that are created by Google will have negative IDs. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\TeamMessages::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The resource name of the `Team`. + * Format: `networks/{network_code}/teams/{team_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The resource name of the `Team`. + * Format: `networks/{network_code}/teams/{team_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The unique ID of the Team. This value is assigned by Google. + * Teams that are created by Google will have negative IDs. + * + * Generated from protobuf field int64 team_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getTeamId() + { + return $this->team_id; + } + + /** + * Output only. The unique ID of the Team. This value is assigned by Google. + * Teams that are created by Google will have negative IDs. + * + * Generated from protobuf field int64 team_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setTeamId($var) + { + GPBUtil::checkInt64($var); + $this->team_id = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/TimeUnitEnum.php b/AdsAdManager/src/V1/TimeUnitEnum.php new file mode 100644 index 000000000000..22d5fc47f884 --- /dev/null +++ b/AdsAdManager/src/V1/TimeUnitEnum.php @@ -0,0 +1,33 @@ +google.ads.admanager.v1.TimeUnitEnum + */ +class TimeUnitEnum extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\TimeUnitEnum::initOnce(); + parent::__construct($data); + } + +} + diff --git a/AdsAdManager/src/V1/TimeUnitEnum/TimeUnit.php b/AdsAdManager/src/V1/TimeUnitEnum/TimeUnit.php new file mode 100644 index 000000000000..52a1e81c3c1b --- /dev/null +++ b/AdsAdManager/src/V1/TimeUnitEnum/TimeUnit.php @@ -0,0 +1,105 @@ +google.ads.admanager.v1.TimeUnitEnum.TimeUnit + */ +class TimeUnit +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum TIME_UNIT_UNSPECIFIED = 0; + */ + const TIME_UNIT_UNSPECIFIED = 0; + /** + * Minute + * + * Generated from protobuf enum MINUTE = 1; + */ + const MINUTE = 1; + /** + * Hour + * + * Generated from protobuf enum HOUR = 2; + */ + const HOUR = 2; + /** + * Day + * + * Generated from protobuf enum DAY = 3; + */ + const DAY = 3; + /** + * Week + * + * Generated from protobuf enum WEEK = 4; + */ + const WEEK = 4; + /** + * Month + * + * Generated from protobuf enum MONTH = 5; + */ + const MONTH = 5; + /** + * Lifetime + * + * Generated from protobuf enum LIFETIME = 6; + */ + const LIFETIME = 6; + /** + * Per pod of ads in a video stream. Only valid for entities in a + * VIDEO_PLAYER environment. + * + * Generated from protobuf enum POD = 7; + */ + const POD = 7; + /** + * Per video stream. Only valid for entities in a VIDEO_PLAYER environment. + * + * Generated from protobuf enum STREAM = 8; + */ + const STREAM = 8; + + private static $valueToName = [ + self::TIME_UNIT_UNSPECIFIED => 'TIME_UNIT_UNSPECIFIED', + self::MINUTE => 'MINUTE', + self::HOUR => 'HOUR', + self::DAY => 'DAY', + self::WEEK => 'WEEK', + self::MONTH => 'MONTH', + self::LIFETIME => 'LIFETIME', + self::POD => 'POD', + self::STREAM => 'STREAM', + ]; + + 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/AdsAdManager/src/V1/UpdateEntitySignalsMappingRequest.php b/AdsAdManager/src/V1/UpdateEntitySignalsMappingRequest.php new file mode 100644 index 000000000000..0a9d17a8a645 --- /dev/null +++ b/AdsAdManager/src/V1/UpdateEntitySignalsMappingRequest.php @@ -0,0 +1,157 @@ +google.ads.admanager.v1.UpdateEntitySignalsMappingRequest + */ +class UpdateEntitySignalsMappingRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The `EntitySignalsMapping` to update. + * The EntitySignalsMapping's name is used to identify the + * EntitySignalsMapping to update. + * Format: + * `networks/{network_code}/entitySignalsMappings/{entity_signals_mapping}` + * + * Generated from protobuf field .google.ads.admanager.v1.EntitySignalsMapping entity_signals_mapping = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $entity_signals_mapping = null; + /** + * Required. The list of fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Ads\AdManager\V1\EntitySignalsMapping $entitySignalsMapping Required. The `EntitySignalsMapping` to update. + * + * The EntitySignalsMapping's name is used to identify the + * EntitySignalsMapping to update. + * Format: + * `networks/{network_code}/entitySignalsMappings/{entity_signals_mapping}` + * @param \Google\Protobuf\FieldMask $updateMask Required. The list of fields to update. + * + * @return \Google\Ads\AdManager\V1\UpdateEntitySignalsMappingRequest + * + * @experimental + */ + public static function build(\Google\Ads\AdManager\V1\EntitySignalsMapping $entitySignalsMapping, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setEntitySignalsMapping($entitySignalsMapping) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Ads\AdManager\V1\EntitySignalsMapping $entity_signals_mapping + * Required. The `EntitySignalsMapping` to update. + * The EntitySignalsMapping's name is used to identify the + * EntitySignalsMapping to update. + * Format: + * `networks/{network_code}/entitySignalsMappings/{entity_signals_mapping}` + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The list of fields to update. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\EntitySignalsMappingService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The `EntitySignalsMapping` to update. + * The EntitySignalsMapping's name is used to identify the + * EntitySignalsMapping to update. + * Format: + * `networks/{network_code}/entitySignalsMappings/{entity_signals_mapping}` + * + * Generated from protobuf field .google.ads.admanager.v1.EntitySignalsMapping entity_signals_mapping = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Ads\AdManager\V1\EntitySignalsMapping|null + */ + public function getEntitySignalsMapping() + { + return $this->entity_signals_mapping; + } + + public function hasEntitySignalsMapping() + { + return isset($this->entity_signals_mapping); + } + + public function clearEntitySignalsMapping() + { + unset($this->entity_signals_mapping); + } + + /** + * Required. The `EntitySignalsMapping` to update. + * The EntitySignalsMapping's name is used to identify the + * EntitySignalsMapping to update. + * Format: + * `networks/{network_code}/entitySignalsMappings/{entity_signals_mapping}` + * + * Generated from protobuf field .google.ads.admanager.v1.EntitySignalsMapping entity_signals_mapping = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Ads\AdManager\V1\EntitySignalsMapping $var + * @return $this + */ + public function setEntitySignalsMapping($var) + { + GPBUtil::checkMessage($var, \Google\Ads\AdManager\V1\EntitySignalsMapping::class); + $this->entity_signals_mapping = $var; + + return $this; + } + + /** + * Required. The list of fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The list of fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/UpdateReportRequest.php b/AdsAdManager/src/V1/UpdateReportRequest.php new file mode 100644 index 000000000000..e34757d484ce --- /dev/null +++ b/AdsAdManager/src/V1/UpdateReportRequest.php @@ -0,0 +1,136 @@ +google.ads.admanager.v1.UpdateReportRequest + */ +class UpdateReportRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The `Report` to update. + * + * Generated from protobuf field .google.ads.admanager.v1.Report report = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $report = null; + /** + * Required. The list of fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Ads\AdManager\V1\Report $report Required. The `Report` to update. + * @param \Google\Protobuf\FieldMask $updateMask Required. The list of fields to update. + * + * @return \Google\Ads\AdManager\V1\UpdateReportRequest + * + * @experimental + */ + public static function build(\Google\Ads\AdManager\V1\Report $report, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setReport($report) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Ads\AdManager\V1\Report $report + * Required. The `Report` to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The list of fields to update. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\ReportService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The `Report` to update. + * + * Generated from protobuf field .google.ads.admanager.v1.Report report = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Ads\AdManager\V1\Report|null + */ + public function getReport() + { + return $this->report; + } + + public function hasReport() + { + return isset($this->report); + } + + public function clearReport() + { + unset($this->report); + } + + /** + * Required. The `Report` to update. + * + * Generated from protobuf field .google.ads.admanager.v1.Report report = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Ads\AdManager\V1\Report $var + * @return $this + */ + public function setReport($var) + { + GPBUtil::checkMessage($var, \Google\Ads\AdManager\V1\Report::class); + $this->report = $var; + + return $this; + } + + /** + * Required. The list of fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The list of fields to update. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/User.php b/AdsAdManager/src/V1/User.php new file mode 100644 index 000000000000..a09c0c1997a9 --- /dev/null +++ b/AdsAdManager/src/V1/User.php @@ -0,0 +1,379 @@ +google.ads.admanager.v1.User + */ +class User extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The resource name of the User. + * Format: `networks/{network_code}/users/{user_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. `User` ID. + * + * Generated from protobuf field int64 user_id = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $user_id = 0; + /** + * Required. The name of the User. It has a maximum length of 128 characters. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + /** + * Required. The email or login of the User. In order to create a new user, + * you must already have a Google Account. + * + * Generated from protobuf field string email = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $email = ''; + /** + * Required. The unique Role ID of the User. Roles that are created by Google + * will have negative IDs. + * + * Generated from protobuf field string role = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $role = ''; + /** + * Output only. Specifies whether or not the User is active. An inactive user + * cannot log in to the system or perform any operations. + * + * Generated from protobuf field bool active = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $active = false; + /** + * Optional. An identifier for the User that is meaningful to the publisher. + * This attribute has a maximum length of 255 characters. + * + * Generated from protobuf field string external_id = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $external_id = ''; + /** + * Output only. Whether the user is an OAuth2 service account user. + * Service account users can only be added through the UI. + * + * Generated from protobuf field bool service_account = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $service_account = false; + /** + * Optional. The IANA Time Zone Database time zone, e.g. "America/New_York", + * used in the orders and line items UI for this User. If not provided, the UI + * then defaults to using the Network's timezone. This setting only affects + * the UI for this user and does not affect the timezone of any dates and + * times returned in API responses. + * + * Generated from protobuf field string orders_ui_local_time_zone = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $orders_ui_local_time_zone = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. The resource name of the User. + * Format: `networks/{network_code}/users/{user_id}` + * @type int|string $user_id + * Output only. `User` ID. + * @type string $display_name + * Required. The name of the User. It has a maximum length of 128 characters. + * @type string $email + * Required. The email or login of the User. In order to create a new user, + * you must already have a Google Account. + * @type string $role + * Required. The unique Role ID of the User. Roles that are created by Google + * will have negative IDs. + * @type bool $active + * Output only. Specifies whether or not the User is active. An inactive user + * cannot log in to the system or perform any operations. + * @type string $external_id + * Optional. An identifier for the User that is meaningful to the publisher. + * This attribute has a maximum length of 255 characters. + * @type bool $service_account + * Output only. Whether the user is an OAuth2 service account user. + * Service account users can only be added through the UI. + * @type string $orders_ui_local_time_zone + * Optional. The IANA Time Zone Database time zone, e.g. "America/New_York", + * used in the orders and line items UI for this User. If not provided, the UI + * then defaults to using the Network's timezone. This setting only affects + * the UI for this user and does not affect the timezone of any dates and + * times returned in API responses. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Ads\Admanager\V1\UserMessages::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. The resource name of the User. + * Format: `networks/{network_code}/users/{user_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The resource name of the User. + * Format: `networks/{network_code}/users/{user_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. `User` ID. + * + * Generated from protobuf field int64 user_id = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getUserId() + { + return $this->user_id; + } + + /** + * Output only. `User` ID. + * + * Generated from protobuf field int64 user_id = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setUserId($var) + { + GPBUtil::checkInt64($var); + $this->user_id = $var; + + return $this; + } + + /** + * Required. The name of the User. It has a maximum length of 128 characters. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. The name of the User. It has a maximum length of 128 characters. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Required. The email or login of the User. In order to create a new user, + * you must already have a Google Account. + * + * Generated from protobuf field string email = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getEmail() + { + return $this->email; + } + + /** + * Required. The email or login of the User. In order to create a new user, + * you must already have a Google Account. + * + * Generated from protobuf field string email = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setEmail($var) + { + GPBUtil::checkString($var, True); + $this->email = $var; + + return $this; + } + + /** + * Required. The unique Role ID of the User. Roles that are created by Google + * will have negative IDs. + * + * Generated from protobuf field string role = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getRole() + { + return $this->role; + } + + /** + * Required. The unique Role ID of the User. Roles that are created by Google + * will have negative IDs. + * + * Generated from protobuf field string role = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setRole($var) + { + GPBUtil::checkString($var, True); + $this->role = $var; + + return $this; + } + + /** + * Output only. Specifies whether or not the User is active. An inactive user + * cannot log in to the system or perform any operations. + * + * Generated from protobuf field bool active = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getActive() + { + return $this->active; + } + + /** + * Output only. Specifies whether or not the User is active. An inactive user + * cannot log in to the system or perform any operations. + * + * Generated from protobuf field bool active = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setActive($var) + { + GPBUtil::checkBool($var); + $this->active = $var; + + return $this; + } + + /** + * Optional. An identifier for the User that is meaningful to the publisher. + * This attribute has a maximum length of 255 characters. + * + * Generated from protobuf field string external_id = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getExternalId() + { + return $this->external_id; + } + + /** + * Optional. An identifier for the User that is meaningful to the publisher. + * This attribute has a maximum length of 255 characters. + * + * Generated from protobuf field string external_id = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setExternalId($var) + { + GPBUtil::checkString($var, True); + $this->external_id = $var; + + return $this; + } + + /** + * Output only. Whether the user is an OAuth2 service account user. + * Service account users can only be added through the UI. + * + * Generated from protobuf field bool service_account = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getServiceAccount() + { + return $this->service_account; + } + + /** + * Output only. Whether the user is an OAuth2 service account user. + * Service account users can only be added through the UI. + * + * Generated from protobuf field bool service_account = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setServiceAccount($var) + { + GPBUtil::checkBool($var); + $this->service_account = $var; + + return $this; + } + + /** + * Optional. The IANA Time Zone Database time zone, e.g. "America/New_York", + * used in the orders and line items UI for this User. If not provided, the UI + * then defaults to using the Network's timezone. This setting only affects + * the UI for this user and does not affect the timezone of any dates and + * times returned in API responses. + * + * Generated from protobuf field string orders_ui_local_time_zone = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrdersUiLocalTimeZone() + { + return $this->orders_ui_local_time_zone; + } + + /** + * Optional. The IANA Time Zone Database time zone, e.g. "America/New_York", + * used in the orders and line items UI for this User. If not provided, the UI + * then defaults to using the Network's timezone. This setting only affects + * the UI for this user and does not affect the timezone of any dates and + * times returned in API responses. + * + * Generated from protobuf field string orders_ui_local_time_zone = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrdersUiLocalTimeZone($var) + { + GPBUtil::checkString($var, True); + $this->orders_ui_local_time_zone = $var; + + return $this; + } + +} + diff --git a/AdsAdManager/src/V1/gapic_metadata.json b/AdsAdManager/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..b61b94818b7a --- /dev/null +++ b/AdsAdManager/src/V1/gapic_metadata.json @@ -0,0 +1,296 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.ads.admanager.v1", + "libraryPackage": "Google\\Ads\\AdManager\\V1", + "services": { + "AdUnitService": { + "clients": { + "grpc": { + "libraryClient": "AdUnitServiceGapicClient", + "rpcs": { + "GetAdUnit": { + "methods": [ + "getAdUnit" + ] + }, + "ListAdUnitSizes": { + "methods": [ + "listAdUnitSizes" + ] + }, + "ListAdUnits": { + "methods": [ + "listAdUnits" + ] + } + } + } + } + }, + "CompanyService": { + "clients": { + "grpc": { + "libraryClient": "CompanyServiceGapicClient", + "rpcs": { + "GetCompany": { + "methods": [ + "getCompany" + ] + }, + "ListCompanies": { + "methods": [ + "listCompanies" + ] + } + } + } + } + }, + "CustomFieldService": { + "clients": { + "grpc": { + "libraryClient": "CustomFieldServiceGapicClient", + "rpcs": { + "GetCustomField": { + "methods": [ + "getCustomField" + ] + }, + "ListCustomFields": { + "methods": [ + "listCustomFields" + ] + } + } + } + } + }, + "CustomTargetingKeyService": { + "clients": { + "grpc": { + "libraryClient": "CustomTargetingKeyServiceGapicClient", + "rpcs": { + "GetCustomTargetingKey": { + "methods": [ + "getCustomTargetingKey" + ] + }, + "ListCustomTargetingKeys": { + "methods": [ + "listCustomTargetingKeys" + ] + } + } + } + } + }, + "CustomTargetingValueService": { + "clients": { + "grpc": { + "libraryClient": "CustomTargetingValueServiceGapicClient", + "rpcs": { + "GetCustomTargetingValue": { + "methods": [ + "getCustomTargetingValue" + ] + }, + "ListCustomTargetingValues": { + "methods": [ + "listCustomTargetingValues" + ] + } + } + } + } + }, + "EntitySignalsMappingService": { + "clients": { + "grpc": { + "libraryClient": "EntitySignalsMappingServiceGapicClient", + "rpcs": { + "BatchCreateEntitySignalsMappings": { + "methods": [ + "batchCreateEntitySignalsMappings" + ] + }, + "BatchUpdateEntitySignalsMappings": { + "methods": [ + "batchUpdateEntitySignalsMappings" + ] + }, + "CreateEntitySignalsMapping": { + "methods": [ + "createEntitySignalsMapping" + ] + }, + "GetEntitySignalsMapping": { + "methods": [ + "getEntitySignalsMapping" + ] + }, + "ListEntitySignalsMappings": { + "methods": [ + "listEntitySignalsMappings" + ] + }, + "UpdateEntitySignalsMapping": { + "methods": [ + "updateEntitySignalsMapping" + ] + } + } + } + } + }, + "NetworkService": { + "clients": { + "grpc": { + "libraryClient": "NetworkServiceGapicClient", + "rpcs": { + "GetNetwork": { + "methods": [ + "getNetwork" + ] + }, + "ListNetworks": { + "methods": [ + "listNetworks" + ] + } + } + } + } + }, + "OrderService": { + "clients": { + "grpc": { + "libraryClient": "OrderServiceGapicClient", + "rpcs": { + "GetOrder": { + "methods": [ + "getOrder" + ] + }, + "ListOrders": { + "methods": [ + "listOrders" + ] + } + } + } + } + }, + "PlacementService": { + "clients": { + "grpc": { + "libraryClient": "PlacementServiceGapicClient", + "rpcs": { + "GetPlacement": { + "methods": [ + "getPlacement" + ] + }, + "ListPlacements": { + "methods": [ + "listPlacements" + ] + } + } + } + } + }, + "ReportService": { + "clients": { + "grpc": { + "libraryClient": "ReportServiceGapicClient", + "rpcs": { + "CreateReport": { + "methods": [ + "createReport" + ] + }, + "FetchReportResultRows": { + "methods": [ + "fetchReportResultRows" + ] + }, + "GetReport": { + "methods": [ + "getReport" + ] + }, + "ListReports": { + "methods": [ + "listReports" + ] + }, + "RunReport": { + "methods": [ + "runReport" + ] + }, + "UpdateReport": { + "methods": [ + "updateReport" + ] + } + } + } + } + }, + "RoleService": { + "clients": { + "grpc": { + "libraryClient": "RoleServiceGapicClient", + "rpcs": { + "GetRole": { + "methods": [ + "getRole" + ] + }, + "ListRoles": { + "methods": [ + "listRoles" + ] + } + } + } + } + }, + "TaxonomyCategoryService": { + "clients": { + "grpc": { + "libraryClient": "TaxonomyCategoryServiceGapicClient", + "rpcs": { + "GetTaxonomyCategory": { + "methods": [ + "getTaxonomyCategory" + ] + }, + "ListTaxonomyCategories": { + "methods": [ + "listTaxonomyCategories" + ] + } + } + } + } + }, + "UserService": { + "clients": { + "grpc": { + "libraryClient": "UserServiceGapicClient", + "rpcs": { + "GetUser": { + "methods": [ + "getUser" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/AdsAdManager/src/V1/resources/ad_unit_service_client_config.json b/AdsAdManager/src/V1/resources/ad_unit_service_client_config.json new file mode 100644 index 000000000000..5fdf2cea857b --- /dev/null +++ b/AdsAdManager/src/V1/resources/ad_unit_service_client_config.json @@ -0,0 +1,37 @@ +{ + "interfaces": { + "google.ads.admanager.v1.AdUnitService": { + "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": { + "GetAdUnit": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListAdUnitSizes": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListAdUnits": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/AdsAdManager/src/V1/resources/ad_unit_service_descriptor_config.php b/AdsAdManager/src/V1/resources/ad_unit_service_descriptor_config.php new file mode 100644 index 000000000000..50f3f17baaff --- /dev/null +++ b/AdsAdManager/src/V1/resources/ad_unit_service_descriptor_config.php @@ -0,0 +1,84 @@ + [ + 'google.ads.admanager.v1.AdUnitService' => [ + 'GetAdUnit' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Ads\AdManager\V1\AdUnit', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListAdUnitSizes' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getAdUnitSizes', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Ads\AdManager\V1\ListAdUnitSizesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListAdUnits' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getAdUnits', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Ads\AdManager\V1\ListAdUnitsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'templateMap' => [ + 'adUnit' => 'networks/{network_code}/adUnits/{ad_unit}', + 'network' => 'networks/{network_code}', + ], + ], + ], +]; diff --git a/AdsAdManager/src/V1/resources/ad_unit_service_rest_client_config.php b/AdsAdManager/src/V1/resources/ad_unit_service_rest_client_config.php new file mode 100644 index 000000000000..2357e7bb5118 --- /dev/null +++ b/AdsAdManager/src/V1/resources/ad_unit_service_rest_client_config.php @@ -0,0 +1,81 @@ + [ + 'google.ads.admanager.v1.AdUnitService' => [ + 'GetAdUnit' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=networks/*/adUnits/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListAdUnitSizes' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=networks/*}/adUnitSizes', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListAdUnits' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=networks/*}/adUnits', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=networks/*/operations/reports/runs/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=networks/*/operations/reports/exports/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/AdsAdManager/src/V1/resources/company_service_client_config.json b/AdsAdManager/src/V1/resources/company_service_client_config.json new file mode 100644 index 000000000000..00bdee6fd628 --- /dev/null +++ b/AdsAdManager/src/V1/resources/company_service_client_config.json @@ -0,0 +1,32 @@ +{ + "interfaces": { + "google.ads.admanager.v1.CompanyService": { + "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": { + "GetCompany": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListCompanies": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/AdsAdManager/src/V1/resources/company_service_descriptor_config.php b/AdsAdManager/src/V1/resources/company_service_descriptor_config.php new file mode 100644 index 000000000000..702b48d1cefb --- /dev/null +++ b/AdsAdManager/src/V1/resources/company_service_descriptor_config.php @@ -0,0 +1,64 @@ + [ + 'google.ads.admanager.v1.CompanyService' => [ + 'GetCompany' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Ads\AdManager\V1\Company', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListCompanies' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getCompanies', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Ads\AdManager\V1\ListCompaniesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'templateMap' => [ + 'company' => 'networks/{network_code}/companies/{company}', + 'network' => 'networks/{network_code}', + ], + ], + ], +]; diff --git a/AdsAdManager/src/V1/resources/company_service_rest_client_config.php b/AdsAdManager/src/V1/resources/company_service_rest_client_config.php new file mode 100644 index 000000000000..337fb3ce0db9 --- /dev/null +++ b/AdsAdManager/src/V1/resources/company_service_rest_client_config.php @@ -0,0 +1,70 @@ + [ + 'google.ads.admanager.v1.CompanyService' => [ + 'GetCompany' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=networks/*/companies/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListCompanies' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=networks/*}/companies', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=networks/*/operations/reports/runs/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=networks/*/operations/reports/exports/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/AdsAdManager/src/V1/resources/custom_field_service_client_config.json b/AdsAdManager/src/V1/resources/custom_field_service_client_config.json new file mode 100644 index 000000000000..8f8a5a8fc36e --- /dev/null +++ b/AdsAdManager/src/V1/resources/custom_field_service_client_config.json @@ -0,0 +1,32 @@ +{ + "interfaces": { + "google.ads.admanager.v1.CustomFieldService": { + "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": { + "GetCustomField": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListCustomFields": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/AdsAdManager/src/V1/resources/custom_field_service_descriptor_config.php b/AdsAdManager/src/V1/resources/custom_field_service_descriptor_config.php new file mode 100644 index 000000000000..a7ce127626b8 --- /dev/null +++ b/AdsAdManager/src/V1/resources/custom_field_service_descriptor_config.php @@ -0,0 +1,64 @@ + [ + 'google.ads.admanager.v1.CustomFieldService' => [ + 'GetCustomField' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Ads\AdManager\V1\CustomField', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListCustomFields' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getCustomFields', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Ads\AdManager\V1\ListCustomFieldsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'templateMap' => [ + 'customField' => 'networks/{network_code}/customFields/{custom_field}', + 'network' => 'networks/{network_code}', + ], + ], + ], +]; diff --git a/AdsAdManager/src/V1/resources/custom_field_service_rest_client_config.php b/AdsAdManager/src/V1/resources/custom_field_service_rest_client_config.php new file mode 100644 index 000000000000..73fa8d1c16df --- /dev/null +++ b/AdsAdManager/src/V1/resources/custom_field_service_rest_client_config.php @@ -0,0 +1,70 @@ + [ + 'google.ads.admanager.v1.CustomFieldService' => [ + 'GetCustomField' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=networks/*/customFields/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListCustomFields' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=networks/*}/customFields', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=networks/*/operations/reports/runs/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=networks/*/operations/reports/exports/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/AdsAdManager/src/V1/resources/custom_targeting_key_service_client_config.json b/AdsAdManager/src/V1/resources/custom_targeting_key_service_client_config.json new file mode 100644 index 000000000000..031df8f440ba --- /dev/null +++ b/AdsAdManager/src/V1/resources/custom_targeting_key_service_client_config.json @@ -0,0 +1,32 @@ +{ + "interfaces": { + "google.ads.admanager.v1.CustomTargetingKeyService": { + "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": { + "GetCustomTargetingKey": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListCustomTargetingKeys": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/AdsAdManager/src/V1/resources/custom_targeting_key_service_descriptor_config.php b/AdsAdManager/src/V1/resources/custom_targeting_key_service_descriptor_config.php new file mode 100644 index 000000000000..107f89f40f0e --- /dev/null +++ b/AdsAdManager/src/V1/resources/custom_targeting_key_service_descriptor_config.php @@ -0,0 +1,64 @@ + [ + 'google.ads.admanager.v1.CustomTargetingKeyService' => [ + 'GetCustomTargetingKey' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Ads\AdManager\V1\CustomTargetingKey', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListCustomTargetingKeys' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getCustomTargetingKeys', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Ads\AdManager\V1\ListCustomTargetingKeysResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'templateMap' => [ + 'customTargetingKey' => 'networks/{network_code}/customTargetingKeys/{custom_targeting_key}', + 'network' => 'networks/{network_code}', + ], + ], + ], +]; diff --git a/AdsAdManager/src/V1/resources/custom_targeting_key_service_rest_client_config.php b/AdsAdManager/src/V1/resources/custom_targeting_key_service_rest_client_config.php new file mode 100644 index 000000000000..1a35718aa455 --- /dev/null +++ b/AdsAdManager/src/V1/resources/custom_targeting_key_service_rest_client_config.php @@ -0,0 +1,70 @@ + [ + 'google.ads.admanager.v1.CustomTargetingKeyService' => [ + 'GetCustomTargetingKey' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=networks/*/customTargetingKeys/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListCustomTargetingKeys' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=networks/*}/customTargetingKeys', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=networks/*/operations/reports/runs/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=networks/*/operations/reports/exports/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/AdsAdManager/src/V1/resources/custom_targeting_value_service_client_config.json b/AdsAdManager/src/V1/resources/custom_targeting_value_service_client_config.json new file mode 100644 index 000000000000..e2444ae9ce7b --- /dev/null +++ b/AdsAdManager/src/V1/resources/custom_targeting_value_service_client_config.json @@ -0,0 +1,32 @@ +{ + "interfaces": { + "google.ads.admanager.v1.CustomTargetingValueService": { + "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": { + "GetCustomTargetingValue": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListCustomTargetingValues": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/AdsAdManager/src/V1/resources/custom_targeting_value_service_descriptor_config.php b/AdsAdManager/src/V1/resources/custom_targeting_value_service_descriptor_config.php new file mode 100644 index 000000000000..2d1752e01380 --- /dev/null +++ b/AdsAdManager/src/V1/resources/custom_targeting_value_service_descriptor_config.php @@ -0,0 +1,64 @@ + [ + 'google.ads.admanager.v1.CustomTargetingValueService' => [ + 'GetCustomTargetingValue' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Ads\AdManager\V1\CustomTargetingValue', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListCustomTargetingValues' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getCustomTargetingValues', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Ads\AdManager\V1\ListCustomTargetingValuesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'templateMap' => [ + 'customTargetingKey' => 'networks/{network_code}/customTargetingKeys/{custom_targeting_key}', + 'customTargetingValue' => 'networks/{network_code}/customTargetingKeys/{custom_targeting_key}/customTargetingValues/{custom_targeting_value}', + ], + ], + ], +]; diff --git a/AdsAdManager/src/V1/resources/custom_targeting_value_service_rest_client_config.php b/AdsAdManager/src/V1/resources/custom_targeting_value_service_rest_client_config.php new file mode 100644 index 000000000000..b6c9c7456c27 --- /dev/null +++ b/AdsAdManager/src/V1/resources/custom_targeting_value_service_rest_client_config.php @@ -0,0 +1,70 @@ + [ + 'google.ads.admanager.v1.CustomTargetingValueService' => [ + 'GetCustomTargetingValue' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=networks/*/customTargetingKeys/*/customTargetingValues/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListCustomTargetingValues' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=networks/*/customTargetingKeys/*}/customTargetingValues', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=networks/*/operations/reports/runs/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=networks/*/operations/reports/exports/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/AdsAdManager/src/V1/resources/entity_signals_mapping_service_client_config.json b/AdsAdManager/src/V1/resources/entity_signals_mapping_service_client_config.json new file mode 100644 index 000000000000..22fd1b90d729 --- /dev/null +++ b/AdsAdManager/src/V1/resources/entity_signals_mapping_service_client_config.json @@ -0,0 +1,52 @@ +{ + "interfaces": { + "google.ads.admanager.v1.EntitySignalsMappingService": { + "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": { + "BatchCreateEntitySignalsMappings": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "BatchUpdateEntitySignalsMappings": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "CreateEntitySignalsMapping": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetEntitySignalsMapping": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListEntitySignalsMappings": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateEntitySignalsMapping": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/AdsAdManager/src/V1/resources/entity_signals_mapping_service_descriptor_config.php b/AdsAdManager/src/V1/resources/entity_signals_mapping_service_descriptor_config.php new file mode 100644 index 000000000000..ee92c845811d --- /dev/null +++ b/AdsAdManager/src/V1/resources/entity_signals_mapping_service_descriptor_config.php @@ -0,0 +1,113 @@ + [ + 'google.ads.admanager.v1.EntitySignalsMappingService' => [ + 'BatchCreateEntitySignalsMappings' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Ads\AdManager\V1\BatchCreateEntitySignalsMappingsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'BatchUpdateEntitySignalsMappings' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Ads\AdManager\V1\BatchUpdateEntitySignalsMappingsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateEntitySignalsMapping' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Ads\AdManager\V1\EntitySignalsMapping', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetEntitySignalsMapping' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Ads\AdManager\V1\EntitySignalsMapping', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListEntitySignalsMappings' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getEntitySignalsMappings', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Ads\AdManager\V1\ListEntitySignalsMappingsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateEntitySignalsMapping' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Ads\AdManager\V1\EntitySignalsMapping', + 'headerParams' => [ + [ + 'keyName' => 'entity_signals_mapping.name', + 'fieldAccessors' => [ + 'getEntitySignalsMapping', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'entitySignalsMapping' => 'networks/{network_code}/entitySignalsMappings/{entity_signals_mapping}', + 'network' => 'networks/{network_code}', + ], + ], + ], +]; diff --git a/AdsAdManager/src/V1/resources/entity_signals_mapping_service_rest_client_config.php b/AdsAdManager/src/V1/resources/entity_signals_mapping_service_rest_client_config.php new file mode 100644 index 000000000000..9f9aae3f48ea --- /dev/null +++ b/AdsAdManager/src/V1/resources/entity_signals_mapping_service_rest_client_config.php @@ -0,0 +1,122 @@ + [ + 'google.ads.admanager.v1.EntitySignalsMappingService' => [ + 'BatchCreateEntitySignalsMappings' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=networks/*}/entitySignalsMappings:batchCreate', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'BatchUpdateEntitySignalsMappings' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=networks/*}/entitySignalsMappings:batchUpdate', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateEntitySignalsMapping' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=networks/*}/entitySignalsMappings', + 'body' => 'entity_signals_mapping', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'GetEntitySignalsMapping' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=networks/*/entitySignalsMappings/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListEntitySignalsMappings' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=networks/*}/entitySignalsMappings', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateEntitySignalsMapping' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{entity_signals_mapping.name=networks/*/entitySignalsMappings/*}', + 'body' => 'entity_signals_mapping', + 'placeholders' => [ + 'entity_signals_mapping.name' => [ + 'getters' => [ + 'getEntitySignalsMapping', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=networks/*/operations/reports/runs/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=networks/*/operations/reports/exports/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/AdsAdManager/src/V1/resources/network_service_client_config.json b/AdsAdManager/src/V1/resources/network_service_client_config.json new file mode 100644 index 000000000000..aec7ab1f074c --- /dev/null +++ b/AdsAdManager/src/V1/resources/network_service_client_config.json @@ -0,0 +1,32 @@ +{ + "interfaces": { + "google.ads.admanager.v1.NetworkService": { + "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": { + "GetNetwork": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListNetworks": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/AdsAdManager/src/V1/resources/network_service_descriptor_config.php b/AdsAdManager/src/V1/resources/network_service_descriptor_config.php new file mode 100644 index 000000000000..9c9e431d99fa --- /dev/null +++ b/AdsAdManager/src/V1/resources/network_service_descriptor_config.php @@ -0,0 +1,47 @@ + [ + 'google.ads.admanager.v1.NetworkService' => [ + 'GetNetwork' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Ads\AdManager\V1\Network', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListNetworks' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Ads\AdManager\V1\ListNetworksResponse', + ], + 'templateMap' => [ + 'network' => 'networks/{network_code}', + ], + ], + ], +]; diff --git a/AdsAdManager/src/V1/resources/network_service_rest_client_config.php b/AdsAdManager/src/V1/resources/network_service_rest_client_config.php new file mode 100644 index 000000000000..8a718fdee222 --- /dev/null +++ b/AdsAdManager/src/V1/resources/network_service_rest_client_config.php @@ -0,0 +1,63 @@ + [ + 'google.ads.admanager.v1.NetworkService' => [ + 'GetNetwork' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=networks/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListNetworks' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/networks', + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=networks/*/operations/reports/runs/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=networks/*/operations/reports/exports/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/AdsAdManager/src/V1/resources/order_service_client_config.json b/AdsAdManager/src/V1/resources/order_service_client_config.json new file mode 100644 index 000000000000..de7c27588915 --- /dev/null +++ b/AdsAdManager/src/V1/resources/order_service_client_config.json @@ -0,0 +1,44 @@ +{ + "interfaces": { + "google.ads.admanager.v1.OrderService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "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 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "GetOrder": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListOrders": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/AdsAdManager/src/V1/resources/order_service_descriptor_config.php b/AdsAdManager/src/V1/resources/order_service_descriptor_config.php new file mode 100644 index 000000000000..9cf7e3962ede --- /dev/null +++ b/AdsAdManager/src/V1/resources/order_service_descriptor_config.php @@ -0,0 +1,64 @@ + [ + 'google.ads.admanager.v1.OrderService' => [ + 'GetOrder' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Ads\AdManager\V1\Order', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListOrders' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getOrders', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Ads\AdManager\V1\ListOrdersResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'templateMap' => [ + 'network' => 'networks/{network_code}', + 'order' => 'networks/{network_code}/orders/{order}', + ], + ], + ], +]; diff --git a/AdsAdManager/src/V1/resources/order_service_rest_client_config.php b/AdsAdManager/src/V1/resources/order_service_rest_client_config.php new file mode 100644 index 000000000000..67c80d2ce1ed --- /dev/null +++ b/AdsAdManager/src/V1/resources/order_service_rest_client_config.php @@ -0,0 +1,70 @@ + [ + 'google.ads.admanager.v1.OrderService' => [ + 'GetOrder' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=networks/*/orders/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOrders' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=networks/*}/orders', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=networks/*/operations/reports/runs/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=networks/*/operations/reports/exports/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/AdsAdManager/src/V1/resources/placement_service_client_config.json b/AdsAdManager/src/V1/resources/placement_service_client_config.json new file mode 100644 index 000000000000..8d039baaad41 --- /dev/null +++ b/AdsAdManager/src/V1/resources/placement_service_client_config.json @@ -0,0 +1,32 @@ +{ + "interfaces": { + "google.ads.admanager.v1.PlacementService": { + "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": { + "GetPlacement": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListPlacements": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/AdsAdManager/src/V1/resources/placement_service_descriptor_config.php b/AdsAdManager/src/V1/resources/placement_service_descriptor_config.php new file mode 100644 index 000000000000..f7949ce84422 --- /dev/null +++ b/AdsAdManager/src/V1/resources/placement_service_descriptor_config.php @@ -0,0 +1,64 @@ + [ + 'google.ads.admanager.v1.PlacementService' => [ + 'GetPlacement' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Ads\AdManager\V1\Placement', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListPlacements' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getPlacements', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Ads\AdManager\V1\ListPlacementsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'templateMap' => [ + 'network' => 'networks/{network_code}', + 'placement' => 'networks/{network_code}/placements/{placement}', + ], + ], + ], +]; diff --git a/AdsAdManager/src/V1/resources/placement_service_rest_client_config.php b/AdsAdManager/src/V1/resources/placement_service_rest_client_config.php new file mode 100644 index 000000000000..385d27a9a508 --- /dev/null +++ b/AdsAdManager/src/V1/resources/placement_service_rest_client_config.php @@ -0,0 +1,70 @@ + [ + 'google.ads.admanager.v1.PlacementService' => [ + 'GetPlacement' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=networks/*/placements/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListPlacements' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=networks/*}/placements', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=networks/*/operations/reports/runs/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=networks/*/operations/reports/exports/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/AdsAdManager/src/V1/resources/report_service_client_config.json b/AdsAdManager/src/V1/resources/report_service_client_config.json new file mode 100644 index 000000000000..30eac575d3c6 --- /dev/null +++ b/AdsAdManager/src/V1/resources/report_service_client_config.json @@ -0,0 +1,52 @@ +{ + "interfaces": { + "google.ads.admanager.v1.ReportService": { + "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": { + "CreateReport": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "FetchReportResultRows": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetReport": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListReports": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "RunReport": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateReport": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/AdsAdManager/src/V1/resources/report_service_descriptor_config.php b/AdsAdManager/src/V1/resources/report_service_descriptor_config.php new file mode 100644 index 000000000000..6d3268234ca5 --- /dev/null +++ b/AdsAdManager/src/V1/resources/report_service_descriptor_config.php @@ -0,0 +1,120 @@ + [ + 'google.ads.admanager.v1.ReportService' => [ + 'RunReport' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Ads\AdManager\V1\RunReportResponse', + 'metadataReturnType' => '\Google\Ads\AdManager\V1\RunReportMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'CreateReport' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Ads\AdManager\V1\Report', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'FetchReportResultRows' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Ads\AdManager\V1\FetchReportResultRowsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetReport' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Ads\AdManager\V1\Report', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListReports' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getReports', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Ads\AdManager\V1\ListReportsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateReport' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Ads\AdManager\V1\Report', + 'headerParams' => [ + [ + 'keyName' => 'report.name', + 'fieldAccessors' => [ + 'getReport', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'network' => 'networks/{network_code}', + 'report' => 'networks/{network_code}/reports/{report}', + ], + ], + ], +]; diff --git a/AdsAdManager/src/V1/resources/report_service_rest_client_config.php b/AdsAdManager/src/V1/resources/report_service_rest_client_config.php new file mode 100644 index 000000000000..3a942eabf667 --- /dev/null +++ b/AdsAdManager/src/V1/resources/report_service_rest_client_config.php @@ -0,0 +1,121 @@ + [ + 'google.ads.admanager.v1.ReportService' => [ + 'CreateReport' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=networks/*}/reports', + 'body' => 'report', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'FetchReportResultRows' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=networks/*/reports/*/results/*}:fetchRows', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetReport' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=networks/*/reports/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListReports' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=networks/*}/reports', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'RunReport' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=networks/*/reports/*}:run', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UpdateReport' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{report.name=networks/*/reports/*}', + 'body' => 'report', + 'placeholders' => [ + 'report.name' => [ + 'getters' => [ + 'getReport', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=networks/*/operations/reports/runs/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=networks/*/operations/reports/exports/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/AdsAdManager/src/V1/resources/role_service_client_config.json b/AdsAdManager/src/V1/resources/role_service_client_config.json new file mode 100644 index 000000000000..ac76997d5641 --- /dev/null +++ b/AdsAdManager/src/V1/resources/role_service_client_config.json @@ -0,0 +1,32 @@ +{ + "interfaces": { + "google.ads.admanager.v1.RoleService": { + "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": { + "GetRole": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListRoles": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/AdsAdManager/src/V1/resources/role_service_descriptor_config.php b/AdsAdManager/src/V1/resources/role_service_descriptor_config.php new file mode 100644 index 000000000000..03c6d0883075 --- /dev/null +++ b/AdsAdManager/src/V1/resources/role_service_descriptor_config.php @@ -0,0 +1,64 @@ + [ + 'google.ads.admanager.v1.RoleService' => [ + 'GetRole' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Ads\AdManager\V1\Role', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListRoles' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getRoles', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Ads\AdManager\V1\ListRolesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'templateMap' => [ + 'network' => 'networks/{network_code}', + 'role' => 'networks/{network_code}/roles/{role}', + ], + ], + ], +]; diff --git a/AdsAdManager/src/V1/resources/role_service_rest_client_config.php b/AdsAdManager/src/V1/resources/role_service_rest_client_config.php new file mode 100644 index 000000000000..5d49f4fe70cb --- /dev/null +++ b/AdsAdManager/src/V1/resources/role_service_rest_client_config.php @@ -0,0 +1,70 @@ + [ + 'google.ads.admanager.v1.RoleService' => [ + 'GetRole' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=networks/*/roles/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListRoles' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=networks/*}/roles', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=networks/*/operations/reports/runs/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=networks/*/operations/reports/exports/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/AdsAdManager/src/V1/resources/taxonomy_category_service_client_config.json b/AdsAdManager/src/V1/resources/taxonomy_category_service_client_config.json new file mode 100644 index 000000000000..2de30370c2f5 --- /dev/null +++ b/AdsAdManager/src/V1/resources/taxonomy_category_service_client_config.json @@ -0,0 +1,32 @@ +{ + "interfaces": { + "google.ads.admanager.v1.TaxonomyCategoryService": { + "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": { + "GetTaxonomyCategory": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListTaxonomyCategories": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/AdsAdManager/src/V1/resources/taxonomy_category_service_descriptor_config.php b/AdsAdManager/src/V1/resources/taxonomy_category_service_descriptor_config.php new file mode 100644 index 000000000000..6be3b9000cc7 --- /dev/null +++ b/AdsAdManager/src/V1/resources/taxonomy_category_service_descriptor_config.php @@ -0,0 +1,64 @@ + [ + 'google.ads.admanager.v1.TaxonomyCategoryService' => [ + 'GetTaxonomyCategory' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Ads\AdManager\V1\TaxonomyCategory', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListTaxonomyCategories' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getTaxonomyCategories', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Ads\AdManager\V1\ListTaxonomyCategoriesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'templateMap' => [ + 'network' => 'networks/{network_code}', + 'taxonomyCategory' => 'networks/{network_code}/taxonomyCategories/{taxonomy_category}', + ], + ], + ], +]; diff --git a/AdsAdManager/src/V1/resources/taxonomy_category_service_rest_client_config.php b/AdsAdManager/src/V1/resources/taxonomy_category_service_rest_client_config.php new file mode 100644 index 000000000000..5fc884225e03 --- /dev/null +++ b/AdsAdManager/src/V1/resources/taxonomy_category_service_rest_client_config.php @@ -0,0 +1,70 @@ + [ + 'google.ads.admanager.v1.TaxonomyCategoryService' => [ + 'GetTaxonomyCategory' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=networks/*/taxonomyCategories/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListTaxonomyCategories' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=networks/*}/taxonomyCategories', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=networks/*/operations/reports/runs/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=networks/*/operations/reports/exports/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/AdsAdManager/src/V1/resources/user_service_client_config.json b/AdsAdManager/src/V1/resources/user_service_client_config.json new file mode 100644 index 000000000000..34a4b4903db2 --- /dev/null +++ b/AdsAdManager/src/V1/resources/user_service_client_config.json @@ -0,0 +1,27 @@ +{ + "interfaces": { + "google.ads.admanager.v1.UserService": { + "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": { + "GetUser": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/AdsAdManager/src/V1/resources/user_service_descriptor_config.php b/AdsAdManager/src/V1/resources/user_service_descriptor_config.php new file mode 100644 index 000000000000..405ff289c084 --- /dev/null +++ b/AdsAdManager/src/V1/resources/user_service_descriptor_config.php @@ -0,0 +1,43 @@ + [ + 'google.ads.admanager.v1.UserService' => [ + 'GetUser' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Ads\AdManager\V1\User', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'user' => 'networks/{network_code}/users/{user}', + ], + ], + ], +]; diff --git a/AdsAdManager/src/V1/resources/user_service_rest_client_config.php b/AdsAdManager/src/V1/resources/user_service_rest_client_config.php new file mode 100644 index 000000000000..91979f52361a --- /dev/null +++ b/AdsAdManager/src/V1/resources/user_service_rest_client_config.php @@ -0,0 +1,59 @@ + [ + 'google.ads.admanager.v1.UserService' => [ + 'GetUser' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=networks/*/users/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=networks/*/operations/reports/runs/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=networks/*/operations/reports/exports/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/AdsAdManager/tests/Unit/V1/Client/AdUnitServiceClientTest.php b/AdsAdManager/tests/Unit/V1/Client/AdUnitServiceClientTest.php new file mode 100644 index 000000000000..1783a121f27f --- /dev/null +++ b/AdsAdManager/tests/Unit/V1/Client/AdUnitServiceClientTest.php @@ -0,0 +1,348 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return AdUnitServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new AdUnitServiceClient($options); + } + + /** @test */ + public function getAdUnitTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $adUnitId = 167061094; + $parentAdUnit = 'parentAdUnit-898168437'; + $displayName = 'displayName1615086568'; + $adUnitCode = 'adUnitCode-1632086356'; + $description = 'description-1724546052'; + $explicitlyTargeted = true; + $hasChildren = true; + $externalSetTopBoxChannelId = 'externalSetTopBoxChannelId-1727346970'; + $appliedAdsenseEnabled = false; + $effectiveAdsenseEnabled = false; + $expectedResponse = new AdUnit(); + $expectedResponse->setName($name2); + $expectedResponse->setAdUnitId($adUnitId); + $expectedResponse->setParentAdUnit($parentAdUnit); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setAdUnitCode($adUnitCode); + $expectedResponse->setDescription($description); + $expectedResponse->setExplicitlyTargeted($explicitlyTargeted); + $expectedResponse->setHasChildren($hasChildren); + $expectedResponse->setExternalSetTopBoxChannelId($externalSetTopBoxChannelId); + $expectedResponse->setAppliedAdsenseEnabled($appliedAdsenseEnabled); + $expectedResponse->setEffectiveAdsenseEnabled($effectiveAdsenseEnabled); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->adUnitName('[NETWORK_CODE]', '[AD_UNIT]'); + $request = (new GetAdUnitRequest())->setName($formattedName); + $response = $gapicClient->getAdUnit($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.ads.admanager.v1.AdUnitService/GetAdUnit', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAdUnitExceptionTest() + { + $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 + $formattedName = $gapicClient->adUnitName('[NETWORK_CODE]', '[AD_UNIT]'); + $request = (new GetAdUnitRequest())->setName($formattedName); + try { + $gapicClient->getAdUnit($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 listAdUnitSizesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $totalSize = 705419236; + $adUnitSizesElement = new AdUnitSize(); + $adUnitSizes = [$adUnitSizesElement]; + $expectedResponse = new ListAdUnitSizesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTotalSize($totalSize); + $expectedResponse->setAdUnitSizes($adUnitSizes); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->networkName('[NETWORK_CODE]'); + $request = (new ListAdUnitSizesRequest())->setParent($formattedParent); + $response = $gapicClient->listAdUnitSizes($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getAdUnitSizes()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.ads.admanager.v1.AdUnitService/ListAdUnitSizes', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAdUnitSizesExceptionTest() + { + $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 + $formattedParent = $gapicClient->networkName('[NETWORK_CODE]'); + $request = (new ListAdUnitSizesRequest())->setParent($formattedParent); + try { + $gapicClient->listAdUnitSizes($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 listAdUnitsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $totalSize = 705419236; + $adUnitsElement = new AdUnit(); + $adUnits = [$adUnitsElement]; + $expectedResponse = new ListAdUnitsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTotalSize($totalSize); + $expectedResponse->setAdUnits($adUnits); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->networkName('[NETWORK_CODE]'); + $request = (new ListAdUnitsRequest())->setParent($formattedParent); + $response = $gapicClient->listAdUnits($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getAdUnits()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.ads.admanager.v1.AdUnitService/ListAdUnits', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAdUnitsExceptionTest() + { + $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 + $formattedParent = $gapicClient->networkName('[NETWORK_CODE]'); + $request = (new ListAdUnitsRequest())->setParent($formattedParent); + try { + $gapicClient->listAdUnits($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 getAdUnitAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $adUnitId = 167061094; + $parentAdUnit = 'parentAdUnit-898168437'; + $displayName = 'displayName1615086568'; + $adUnitCode = 'adUnitCode-1632086356'; + $description = 'description-1724546052'; + $explicitlyTargeted = true; + $hasChildren = true; + $externalSetTopBoxChannelId = 'externalSetTopBoxChannelId-1727346970'; + $appliedAdsenseEnabled = false; + $effectiveAdsenseEnabled = false; + $expectedResponse = new AdUnit(); + $expectedResponse->setName($name2); + $expectedResponse->setAdUnitId($adUnitId); + $expectedResponse->setParentAdUnit($parentAdUnit); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setAdUnitCode($adUnitCode); + $expectedResponse->setDescription($description); + $expectedResponse->setExplicitlyTargeted($explicitlyTargeted); + $expectedResponse->setHasChildren($hasChildren); + $expectedResponse->setExternalSetTopBoxChannelId($externalSetTopBoxChannelId); + $expectedResponse->setAppliedAdsenseEnabled($appliedAdsenseEnabled); + $expectedResponse->setEffectiveAdsenseEnabled($effectiveAdsenseEnabled); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->adUnitName('[NETWORK_CODE]', '[AD_UNIT]'); + $request = (new GetAdUnitRequest())->setName($formattedName); + $response = $gapicClient->getAdUnitAsync($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.ads.admanager.v1.AdUnitService/GetAdUnit', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/AdsAdManager/tests/Unit/V1/Client/CompanyServiceClientTest.php b/AdsAdManager/tests/Unit/V1/Client/CompanyServiceClientTest.php new file mode 100644 index 000000000000..4e512619f2c3 --- /dev/null +++ b/AdsAdManager/tests/Unit/V1/Client/CompanyServiceClientTest.php @@ -0,0 +1,272 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return CompanyServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new CompanyServiceClient($options); + } + + /** @test */ + public function getCompanyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $companyId = 847673315; + $displayName = 'displayName1615086568'; + $address = 'address-1147692044'; + $email = 'email96619420'; + $fax = 'fax101149'; + $phone = 'phone106642798'; + $externalId = 'externalId-1153075697'; + $comment = 'comment950398559'; + $primaryContact = 'primaryContact203339491'; + $thirdPartyCompanyId = 2003341038; + $expectedResponse = new Company(); + $expectedResponse->setName($name2); + $expectedResponse->setCompanyId($companyId); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setAddress($address); + $expectedResponse->setEmail($email); + $expectedResponse->setFax($fax); + $expectedResponse->setPhone($phone); + $expectedResponse->setExternalId($externalId); + $expectedResponse->setComment($comment); + $expectedResponse->setPrimaryContact($primaryContact); + $expectedResponse->setThirdPartyCompanyId($thirdPartyCompanyId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->companyName('[NETWORK_CODE]', '[COMPANY]'); + $request = (new GetCompanyRequest())->setName($formattedName); + $response = $gapicClient->getCompany($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.ads.admanager.v1.CompanyService/GetCompany', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getCompanyExceptionTest() + { + $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 + $formattedName = $gapicClient->companyName('[NETWORK_CODE]', '[COMPANY]'); + $request = (new GetCompanyRequest())->setName($formattedName); + try { + $gapicClient->getCompany($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 listCompaniesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $totalSize = 705419236; + $companiesElement = new Company(); + $companies = [$companiesElement]; + $expectedResponse = new ListCompaniesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTotalSize($totalSize); + $expectedResponse->setCompanies($companies); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->networkName('[NETWORK_CODE]'); + $request = (new ListCompaniesRequest())->setParent($formattedParent); + $response = $gapicClient->listCompanies($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getCompanies()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.ads.admanager.v1.CompanyService/ListCompanies', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listCompaniesExceptionTest() + { + $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 + $formattedParent = $gapicClient->networkName('[NETWORK_CODE]'); + $request = (new ListCompaniesRequest())->setParent($formattedParent); + try { + $gapicClient->listCompanies($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 getCompanyAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $companyId = 847673315; + $displayName = 'displayName1615086568'; + $address = 'address-1147692044'; + $email = 'email96619420'; + $fax = 'fax101149'; + $phone = 'phone106642798'; + $externalId = 'externalId-1153075697'; + $comment = 'comment950398559'; + $primaryContact = 'primaryContact203339491'; + $thirdPartyCompanyId = 2003341038; + $expectedResponse = new Company(); + $expectedResponse->setName($name2); + $expectedResponse->setCompanyId($companyId); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setAddress($address); + $expectedResponse->setEmail($email); + $expectedResponse->setFax($fax); + $expectedResponse->setPhone($phone); + $expectedResponse->setExternalId($externalId); + $expectedResponse->setComment($comment); + $expectedResponse->setPrimaryContact($primaryContact); + $expectedResponse->setThirdPartyCompanyId($thirdPartyCompanyId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->companyName('[NETWORK_CODE]', '[COMPANY]'); + $request = (new GetCompanyRequest())->setName($formattedName); + $response = $gapicClient->getCompanyAsync($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.ads.admanager.v1.CompanyService/GetCompany', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/AdsAdManager/tests/Unit/V1/Client/CustomFieldServiceClientTest.php b/AdsAdManager/tests/Unit/V1/Client/CustomFieldServiceClientTest.php new file mode 100644 index 000000000000..b5cf6fa12850 --- /dev/null +++ b/AdsAdManager/tests/Unit/V1/Client/CustomFieldServiceClientTest.php @@ -0,0 +1,244 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return CustomFieldServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new CustomFieldServiceClient($options); + } + + /** @test */ + public function getCustomFieldTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $customFieldId = 66688114; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $expectedResponse = new CustomField(); + $expectedResponse->setName($name2); + $expectedResponse->setCustomFieldId($customFieldId); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->customFieldName('[NETWORK_CODE]', '[CUSTOM_FIELD]'); + $request = (new GetCustomFieldRequest())->setName($formattedName); + $response = $gapicClient->getCustomField($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.ads.admanager.v1.CustomFieldService/GetCustomField', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getCustomFieldExceptionTest() + { + $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 + $formattedName = $gapicClient->customFieldName('[NETWORK_CODE]', '[CUSTOM_FIELD]'); + $request = (new GetCustomFieldRequest())->setName($formattedName); + try { + $gapicClient->getCustomField($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 listCustomFieldsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $totalSize = 705419236; + $customFieldsElement = new CustomField(); + $customFields = [$customFieldsElement]; + $expectedResponse = new ListCustomFieldsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTotalSize($totalSize); + $expectedResponse->setCustomFields($customFields); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->networkName('[NETWORK_CODE]'); + $request = (new ListCustomFieldsRequest())->setParent($formattedParent); + $response = $gapicClient->listCustomFields($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getCustomFields()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.ads.admanager.v1.CustomFieldService/ListCustomFields', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listCustomFieldsExceptionTest() + { + $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 + $formattedParent = $gapicClient->networkName('[NETWORK_CODE]'); + $request = (new ListCustomFieldsRequest())->setParent($formattedParent); + try { + $gapicClient->listCustomFields($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 getCustomFieldAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $customFieldId = 66688114; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $expectedResponse = new CustomField(); + $expectedResponse->setName($name2); + $expectedResponse->setCustomFieldId($customFieldId); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->customFieldName('[NETWORK_CODE]', '[CUSTOM_FIELD]'); + $request = (new GetCustomFieldRequest())->setName($formattedName); + $response = $gapicClient->getCustomFieldAsync($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.ads.admanager.v1.CustomFieldService/GetCustomField', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/AdsAdManager/tests/Unit/V1/Client/CustomTargetingKeyServiceClientTest.php b/AdsAdManager/tests/Unit/V1/Client/CustomTargetingKeyServiceClientTest.php new file mode 100644 index 000000000000..819dd2351187 --- /dev/null +++ b/AdsAdManager/tests/Unit/V1/Client/CustomTargetingKeyServiceClientTest.php @@ -0,0 +1,247 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return CustomTargetingKeyServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new CustomTargetingKeyServiceClient($options); + } + + /** @test */ + public function getCustomTargetingKeyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $customTargetingKeyId = 138683049; + $adTagName = 'adTagName-1355595604'; + $displayName = 'displayName1615086568'; + $expectedResponse = new CustomTargetingKey(); + $expectedResponse->setName($name2); + $expectedResponse->setCustomTargetingKeyId($customTargetingKeyId); + $expectedResponse->setAdTagName($adTagName); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->customTargetingKeyName('[NETWORK_CODE]', '[CUSTOM_TARGETING_KEY]'); + $request = (new GetCustomTargetingKeyRequest())->setName($formattedName); + $response = $gapicClient->getCustomTargetingKey($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.ads.admanager.v1.CustomTargetingKeyService/GetCustomTargetingKey', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getCustomTargetingKeyExceptionTest() + { + $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 + $formattedName = $gapicClient->customTargetingKeyName('[NETWORK_CODE]', '[CUSTOM_TARGETING_KEY]'); + $request = (new GetCustomTargetingKeyRequest())->setName($formattedName); + try { + $gapicClient->getCustomTargetingKey($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 listCustomTargetingKeysTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $totalSize = 705419236; + $customTargetingKeysElement = new CustomTargetingKey(); + $customTargetingKeys = [$customTargetingKeysElement]; + $expectedResponse = new ListCustomTargetingKeysResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTotalSize($totalSize); + $expectedResponse->setCustomTargetingKeys($customTargetingKeys); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->networkName('[NETWORK_CODE]'); + $request = (new ListCustomTargetingKeysRequest())->setParent($formattedParent); + $response = $gapicClient->listCustomTargetingKeys($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getCustomTargetingKeys()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.ads.admanager.v1.CustomTargetingKeyService/ListCustomTargetingKeys', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listCustomTargetingKeysExceptionTest() + { + $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 + $formattedParent = $gapicClient->networkName('[NETWORK_CODE]'); + $request = (new ListCustomTargetingKeysRequest())->setParent($formattedParent); + try { + $gapicClient->listCustomTargetingKeys($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 getCustomTargetingKeyAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $customTargetingKeyId = 138683049; + $adTagName = 'adTagName-1355595604'; + $displayName = 'displayName1615086568'; + $expectedResponse = new CustomTargetingKey(); + $expectedResponse->setName($name2); + $expectedResponse->setCustomTargetingKeyId($customTargetingKeyId); + $expectedResponse->setAdTagName($adTagName); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->customTargetingKeyName('[NETWORK_CODE]', '[CUSTOM_TARGETING_KEY]'); + $request = (new GetCustomTargetingKeyRequest())->setName($formattedName); + $response = $gapicClient->getCustomTargetingKeyAsync($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.ads.admanager.v1.CustomTargetingKeyService/GetCustomTargetingKey', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/AdsAdManager/tests/Unit/V1/Client/CustomTargetingValueServiceClientTest.php b/AdsAdManager/tests/Unit/V1/Client/CustomTargetingValueServiceClientTest.php new file mode 100644 index 000000000000..7ca476c1512b --- /dev/null +++ b/AdsAdManager/tests/Unit/V1/Client/CustomTargetingValueServiceClientTest.php @@ -0,0 +1,261 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return CustomTargetingValueServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new CustomTargetingValueServiceClient($options); + } + + /** @test */ + public function getCustomTargetingValueTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $adTagName = 'adTagName-1355595604'; + $displayName = 'displayName1615086568'; + $expectedResponse = new CustomTargetingValue(); + $expectedResponse->setName($name2); + $expectedResponse->setAdTagName($adTagName); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->customTargetingValueName( + '[NETWORK_CODE]', + '[CUSTOM_TARGETING_KEY]', + '[CUSTOM_TARGETING_VALUE]' + ); + $request = (new GetCustomTargetingValueRequest())->setName($formattedName); + $response = $gapicClient->getCustomTargetingValue($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.ads.admanager.v1.CustomTargetingValueService/GetCustomTargetingValue', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getCustomTargetingValueExceptionTest() + { + $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 + $formattedName = $gapicClient->customTargetingValueName( + '[NETWORK_CODE]', + '[CUSTOM_TARGETING_KEY]', + '[CUSTOM_TARGETING_VALUE]' + ); + $request = (new GetCustomTargetingValueRequest())->setName($formattedName); + try { + $gapicClient->getCustomTargetingValue($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 listCustomTargetingValuesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $totalSize = 705419236; + $customTargetingValuesElement = new CustomTargetingValue(); + $customTargetingValues = [$customTargetingValuesElement]; + $expectedResponse = new ListCustomTargetingValuesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTotalSize($totalSize); + $expectedResponse->setCustomTargetingValues($customTargetingValues); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->customTargetingKeyName('[NETWORK_CODE]', '[CUSTOM_TARGETING_KEY]'); + $request = (new ListCustomTargetingValuesRequest())->setParent($formattedParent); + $response = $gapicClient->listCustomTargetingValues($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getCustomTargetingValues()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.ads.admanager.v1.CustomTargetingValueService/ListCustomTargetingValues', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listCustomTargetingValuesExceptionTest() + { + $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 + $formattedParent = $gapicClient->customTargetingKeyName('[NETWORK_CODE]', '[CUSTOM_TARGETING_KEY]'); + $request = (new ListCustomTargetingValuesRequest())->setParent($formattedParent); + try { + $gapicClient->listCustomTargetingValues($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 getCustomTargetingValueAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $adTagName = 'adTagName-1355595604'; + $displayName = 'displayName1615086568'; + $expectedResponse = new CustomTargetingValue(); + $expectedResponse->setName($name2); + $expectedResponse->setAdTagName($adTagName); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->customTargetingValueName( + '[NETWORK_CODE]', + '[CUSTOM_TARGETING_KEY]', + '[CUSTOM_TARGETING_VALUE]' + ); + $request = (new GetCustomTargetingValueRequest())->setName($formattedName); + $response = $gapicClient->getCustomTargetingValueAsync($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.ads.admanager.v1.CustomTargetingValueService/GetCustomTargetingValue', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/AdsAdManager/tests/Unit/V1/Client/EntitySignalsMappingServiceClientTest.php b/AdsAdManager/tests/Unit/V1/Client/EntitySignalsMappingServiceClientTest.php new file mode 100644 index 000000000000..0323897f6558 --- /dev/null +++ b/AdsAdManager/tests/Unit/V1/Client/EntitySignalsMappingServiceClientTest.php @@ -0,0 +1,561 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return EntitySignalsMappingServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new EntitySignalsMappingServiceClient($options); + } + + /** @test */ + public function batchCreateEntitySignalsMappingsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new BatchCreateEntitySignalsMappingsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->networkName('[NETWORK_CODE]'); + $requests = []; + $request = (new BatchCreateEntitySignalsMappingsRequest())->setParent($formattedParent)->setRequests($requests); + $response = $gapicClient->batchCreateEntitySignalsMappings($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.ads.admanager.v1.EntitySignalsMappingService/BatchCreateEntitySignalsMappings', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getRequests(); + $this->assertProtobufEquals($requests, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function batchCreateEntitySignalsMappingsExceptionTest() + { + $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 + $formattedParent = $gapicClient->networkName('[NETWORK_CODE]'); + $requests = []; + $request = (new BatchCreateEntitySignalsMappingsRequest())->setParent($formattedParent)->setRequests($requests); + try { + $gapicClient->batchCreateEntitySignalsMappings($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 batchUpdateEntitySignalsMappingsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new BatchUpdateEntitySignalsMappingsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->networkName('[NETWORK_CODE]'); + $requests = []; + $request = (new BatchUpdateEntitySignalsMappingsRequest())->setParent($formattedParent)->setRequests($requests); + $response = $gapicClient->batchUpdateEntitySignalsMappings($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.ads.admanager.v1.EntitySignalsMappingService/BatchUpdateEntitySignalsMappings', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getRequests(); + $this->assertProtobufEquals($requests, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function batchUpdateEntitySignalsMappingsExceptionTest() + { + $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 + $formattedParent = $gapicClient->networkName('[NETWORK_CODE]'); + $requests = []; + $request = (new BatchUpdateEntitySignalsMappingsRequest())->setParent($formattedParent)->setRequests($requests); + try { + $gapicClient->batchUpdateEntitySignalsMappings($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 createEntitySignalsMappingTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $audienceSegmentId = 321086146; + $name = 'name3373707'; + $entitySignalsMappingId = 350688772; + $expectedResponse = new EntitySignalsMapping(); + $expectedResponse->setAudienceSegmentId($audienceSegmentId); + $expectedResponse->setName($name); + $expectedResponse->setEntitySignalsMappingId($entitySignalsMappingId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->networkName('[NETWORK_CODE]'); + $entitySignalsMapping = new EntitySignalsMapping(); + $entitySignalsMappingTaxonomyCategoryIds = []; + $entitySignalsMapping->setTaxonomyCategoryIds($entitySignalsMappingTaxonomyCategoryIds); + $request = (new CreateEntitySignalsMappingRequest()) + ->setParent($formattedParent) + ->setEntitySignalsMapping($entitySignalsMapping); + $response = $gapicClient->createEntitySignalsMapping($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.ads.admanager.v1.EntitySignalsMappingService/CreateEntitySignalsMapping', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getEntitySignalsMapping(); + $this->assertProtobufEquals($entitySignalsMapping, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createEntitySignalsMappingExceptionTest() + { + $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 + $formattedParent = $gapicClient->networkName('[NETWORK_CODE]'); + $entitySignalsMapping = new EntitySignalsMapping(); + $entitySignalsMappingTaxonomyCategoryIds = []; + $entitySignalsMapping->setTaxonomyCategoryIds($entitySignalsMappingTaxonomyCategoryIds); + $request = (new CreateEntitySignalsMappingRequest()) + ->setParent($formattedParent) + ->setEntitySignalsMapping($entitySignalsMapping); + try { + $gapicClient->createEntitySignalsMapping($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 getEntitySignalsMappingTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $audienceSegmentId = 321086146; + $name2 = 'name2-1052831874'; + $entitySignalsMappingId = 350688772; + $expectedResponse = new EntitySignalsMapping(); + $expectedResponse->setAudienceSegmentId($audienceSegmentId); + $expectedResponse->setName($name2); + $expectedResponse->setEntitySignalsMappingId($entitySignalsMappingId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->entitySignalsMappingName('[NETWORK_CODE]', '[ENTITY_SIGNALS_MAPPING]'); + $request = (new GetEntitySignalsMappingRequest())->setName($formattedName); + $response = $gapicClient->getEntitySignalsMapping($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.ads.admanager.v1.EntitySignalsMappingService/GetEntitySignalsMapping', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEntitySignalsMappingExceptionTest() + { + $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 + $formattedName = $gapicClient->entitySignalsMappingName('[NETWORK_CODE]', '[ENTITY_SIGNALS_MAPPING]'); + $request = (new GetEntitySignalsMappingRequest())->setName($formattedName); + try { + $gapicClient->getEntitySignalsMapping($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 listEntitySignalsMappingsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $totalSize = 705419236; + $entitySignalsMappingsElement = new EntitySignalsMapping(); + $entitySignalsMappings = [$entitySignalsMappingsElement]; + $expectedResponse = new ListEntitySignalsMappingsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTotalSize($totalSize); + $expectedResponse->setEntitySignalsMappings($entitySignalsMappings); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->networkName('[NETWORK_CODE]'); + $request = (new ListEntitySignalsMappingsRequest())->setParent($formattedParent); + $response = $gapicClient->listEntitySignalsMappings($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getEntitySignalsMappings()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.ads.admanager.v1.EntitySignalsMappingService/ListEntitySignalsMappings', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listEntitySignalsMappingsExceptionTest() + { + $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 + $formattedParent = $gapicClient->networkName('[NETWORK_CODE]'); + $request = (new ListEntitySignalsMappingsRequest())->setParent($formattedParent); + try { + $gapicClient->listEntitySignalsMappings($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 updateEntitySignalsMappingTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $audienceSegmentId = 321086146; + $name = 'name3373707'; + $entitySignalsMappingId = 350688772; + $expectedResponse = new EntitySignalsMapping(); + $expectedResponse->setAudienceSegmentId($audienceSegmentId); + $expectedResponse->setName($name); + $expectedResponse->setEntitySignalsMappingId($entitySignalsMappingId); + $transport->addResponse($expectedResponse); + // Mock request + $entitySignalsMapping = new EntitySignalsMapping(); + $entitySignalsMappingTaxonomyCategoryIds = []; + $entitySignalsMapping->setTaxonomyCategoryIds($entitySignalsMappingTaxonomyCategoryIds); + $updateMask = new FieldMask(); + $request = (new UpdateEntitySignalsMappingRequest()) + ->setEntitySignalsMapping($entitySignalsMapping) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateEntitySignalsMapping($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.ads.admanager.v1.EntitySignalsMappingService/UpdateEntitySignalsMapping', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getEntitySignalsMapping(); + $this->assertProtobufEquals($entitySignalsMapping, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateEntitySignalsMappingExceptionTest() + { + $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 + $entitySignalsMapping = new EntitySignalsMapping(); + $entitySignalsMappingTaxonomyCategoryIds = []; + $entitySignalsMapping->setTaxonomyCategoryIds($entitySignalsMappingTaxonomyCategoryIds); + $updateMask = new FieldMask(); + $request = (new UpdateEntitySignalsMappingRequest()) + ->setEntitySignalsMapping($entitySignalsMapping) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateEntitySignalsMapping($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 batchCreateEntitySignalsMappingsAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new BatchCreateEntitySignalsMappingsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->networkName('[NETWORK_CODE]'); + $requests = []; + $request = (new BatchCreateEntitySignalsMappingsRequest())->setParent($formattedParent)->setRequests($requests); + $response = $gapicClient->batchCreateEntitySignalsMappingsAsync($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.ads.admanager.v1.EntitySignalsMappingService/BatchCreateEntitySignalsMappings', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getRequests(); + $this->assertProtobufEquals($requests, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/AdsAdManager/tests/Unit/V1/Client/NetworkServiceClientTest.php b/AdsAdManager/tests/Unit/V1/Client/NetworkServiceClientTest.php new file mode 100644 index 000000000000..011962ae5c7a --- /dev/null +++ b/AdsAdManager/tests/Unit/V1/Client/NetworkServiceClientTest.php @@ -0,0 +1,248 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return NetworkServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new NetworkServiceClient($options); + } + + /** @test */ + public function getNetworkTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $networkCode = 'networkCode-19973794'; + $propertyCode = 'propertyCode-1019877865'; + $timeZone = 'timeZone36848094'; + $currencyCode = 'currencyCode1108728155'; + $effectiveRootAdUnit = 'effectiveRootAdUnit98840923'; + $testNetwork = false; + $networkId = 478232372; + $expectedResponse = new Network(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setNetworkCode($networkCode); + $expectedResponse->setPropertyCode($propertyCode); + $expectedResponse->setTimeZone($timeZone); + $expectedResponse->setCurrencyCode($currencyCode); + $expectedResponse->setEffectiveRootAdUnit($effectiveRootAdUnit); + $expectedResponse->setTestNetwork($testNetwork); + $expectedResponse->setNetworkId($networkId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->networkName('[NETWORK_CODE]'); + $request = (new GetNetworkRequest())->setName($formattedName); + $response = $gapicClient->getNetwork($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.ads.admanager.v1.NetworkService/GetNetwork', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getNetworkExceptionTest() + { + $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 + $formattedName = $gapicClient->networkName('[NETWORK_CODE]'); + $request = (new GetNetworkRequest())->setName($formattedName); + try { + $gapicClient->getNetwork($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 listNetworksTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ListNetworksResponse(); + $transport->addResponse($expectedResponse); + $request = new ListNetworksRequest(); + $response = $gapicClient->listNetworks($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.ads.admanager.v1.NetworkService/ListNetworks', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listNetworksExceptionTest() + { + $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); + $request = new ListNetworksRequest(); + try { + $gapicClient->listNetworks($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 getNetworkAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $networkCode = 'networkCode-19973794'; + $propertyCode = 'propertyCode-1019877865'; + $timeZone = 'timeZone36848094'; + $currencyCode = 'currencyCode1108728155'; + $effectiveRootAdUnit = 'effectiveRootAdUnit98840923'; + $testNetwork = false; + $networkId = 478232372; + $expectedResponse = new Network(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setNetworkCode($networkCode); + $expectedResponse->setPropertyCode($propertyCode); + $expectedResponse->setTimeZone($timeZone); + $expectedResponse->setCurrencyCode($currencyCode); + $expectedResponse->setEffectiveRootAdUnit($effectiveRootAdUnit); + $expectedResponse->setTestNetwork($testNetwork); + $expectedResponse->setNetworkId($networkId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->networkName('[NETWORK_CODE]'); + $request = (new GetNetworkRequest())->setName($formattedName); + $response = $gapicClient->getNetworkAsync($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.ads.admanager.v1.NetworkService/GetNetwork', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/AdsAdManager/tests/Unit/V1/Client/OrderServiceClientTest.php b/AdsAdManager/tests/Unit/V1/Client/OrderServiceClientTest.php new file mode 100644 index 000000000000..e79b907632a0 --- /dev/null +++ b/AdsAdManager/tests/Unit/V1/Client/OrderServiceClientTest.php @@ -0,0 +1,292 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return OrderServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new OrderServiceClient($options); + } + + /** @test */ + public function getOrderTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $orderId = 1234304940; + $displayName = 'displayName1615086568'; + $programmatic = true; + $trafficker = 'trafficker-606937285'; + $advertiser = 'advertiser72080683'; + $agency = 'agency-1419699195'; + $creator = 'creator1028554796'; + $currencyCode = 'currencyCode1108728155'; + $unlimitedEndTime = false; + $externalOrderId = 1332092512; + $archived = true; + $lastModifiedByApp = 'lastModifiedByApp-1580292922'; + $notes = 'notes105008833'; + $poNumber = 'poNumber1281088905'; + $salesperson = 'salesperson-2087326879'; + $expectedResponse = new Order(); + $expectedResponse->setName($name2); + $expectedResponse->setOrderId($orderId); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setProgrammatic($programmatic); + $expectedResponse->setTrafficker($trafficker); + $expectedResponse->setAdvertiser($advertiser); + $expectedResponse->setAgency($agency); + $expectedResponse->setCreator($creator); + $expectedResponse->setCurrencyCode($currencyCode); + $expectedResponse->setUnlimitedEndTime($unlimitedEndTime); + $expectedResponse->setExternalOrderId($externalOrderId); + $expectedResponse->setArchived($archived); + $expectedResponse->setLastModifiedByApp($lastModifiedByApp); + $expectedResponse->setNotes($notes); + $expectedResponse->setPoNumber($poNumber); + $expectedResponse->setSalesperson($salesperson); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->orderName('[NETWORK_CODE]', '[ORDER]'); + $request = (new GetOrderRequest())->setName($formattedName); + $response = $gapicClient->getOrder($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.ads.admanager.v1.OrderService/GetOrder', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getOrderExceptionTest() + { + $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 + $formattedName = $gapicClient->orderName('[NETWORK_CODE]', '[ORDER]'); + $request = (new GetOrderRequest())->setName($formattedName); + try { + $gapicClient->getOrder($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 listOrdersTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $totalSize = 705419236; + $ordersElement = new Order(); + $orders = [$ordersElement]; + $expectedResponse = new ListOrdersResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTotalSize($totalSize); + $expectedResponse->setOrders($orders); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->networkName('[NETWORK_CODE]'); + $request = (new ListOrdersRequest())->setParent($formattedParent); + $response = $gapicClient->listOrders($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getOrders()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.ads.admanager.v1.OrderService/ListOrders', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listOrdersExceptionTest() + { + $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 + $formattedParent = $gapicClient->networkName('[NETWORK_CODE]'); + $request = (new ListOrdersRequest())->setParent($formattedParent); + try { + $gapicClient->listOrders($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 getOrderAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $orderId = 1234304940; + $displayName = 'displayName1615086568'; + $programmatic = true; + $trafficker = 'trafficker-606937285'; + $advertiser = 'advertiser72080683'; + $agency = 'agency-1419699195'; + $creator = 'creator1028554796'; + $currencyCode = 'currencyCode1108728155'; + $unlimitedEndTime = false; + $externalOrderId = 1332092512; + $archived = true; + $lastModifiedByApp = 'lastModifiedByApp-1580292922'; + $notes = 'notes105008833'; + $poNumber = 'poNumber1281088905'; + $salesperson = 'salesperson-2087326879'; + $expectedResponse = new Order(); + $expectedResponse->setName($name2); + $expectedResponse->setOrderId($orderId); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setProgrammatic($programmatic); + $expectedResponse->setTrafficker($trafficker); + $expectedResponse->setAdvertiser($advertiser); + $expectedResponse->setAgency($agency); + $expectedResponse->setCreator($creator); + $expectedResponse->setCurrencyCode($currencyCode); + $expectedResponse->setUnlimitedEndTime($unlimitedEndTime); + $expectedResponse->setExternalOrderId($externalOrderId); + $expectedResponse->setArchived($archived); + $expectedResponse->setLastModifiedByApp($lastModifiedByApp); + $expectedResponse->setNotes($notes); + $expectedResponse->setPoNumber($poNumber); + $expectedResponse->setSalesperson($salesperson); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->orderName('[NETWORK_CODE]', '[ORDER]'); + $request = (new GetOrderRequest())->setName($formattedName); + $response = $gapicClient->getOrderAsync($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.ads.admanager.v1.OrderService/GetOrder', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/AdsAdManager/tests/Unit/V1/Client/PlacementServiceClientTest.php b/AdsAdManager/tests/Unit/V1/Client/PlacementServiceClientTest.php new file mode 100644 index 000000000000..71dbca739c66 --- /dev/null +++ b/AdsAdManager/tests/Unit/V1/Client/PlacementServiceClientTest.php @@ -0,0 +1,248 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return PlacementServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new PlacementServiceClient($options); + } + + /** @test */ + public function getPlacementTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $placementId = 1224358069; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $placementCode = 'placementCode-213099769'; + $expectedResponse = new Placement(); + $expectedResponse->setName($name2); + $expectedResponse->setPlacementId($placementId); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setPlacementCode($placementCode); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->placementName('[NETWORK_CODE]', '[PLACEMENT]'); + $request = (new GetPlacementRequest())->setName($formattedName); + $response = $gapicClient->getPlacement($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.ads.admanager.v1.PlacementService/GetPlacement', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getPlacementExceptionTest() + { + $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 + $formattedName = $gapicClient->placementName('[NETWORK_CODE]', '[PLACEMENT]'); + $request = (new GetPlacementRequest())->setName($formattedName); + try { + $gapicClient->getPlacement($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 listPlacementsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $totalSize = 705419236; + $placementsElement = new Placement(); + $placements = [$placementsElement]; + $expectedResponse = new ListPlacementsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTotalSize($totalSize); + $expectedResponse->setPlacements($placements); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->networkName('[NETWORK_CODE]'); + $request = (new ListPlacementsRequest())->setParent($formattedParent); + $response = $gapicClient->listPlacements($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getPlacements()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.ads.admanager.v1.PlacementService/ListPlacements', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listPlacementsExceptionTest() + { + $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 + $formattedParent = $gapicClient->networkName('[NETWORK_CODE]'); + $request = (new ListPlacementsRequest())->setParent($formattedParent); + try { + $gapicClient->listPlacements($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 getPlacementAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $placementId = 1224358069; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $placementCode = 'placementCode-213099769'; + $expectedResponse = new Placement(); + $expectedResponse->setName($name2); + $expectedResponse->setPlacementId($placementId); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setPlacementCode($placementCode); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->placementName('[NETWORK_CODE]', '[PLACEMENT]'); + $request = (new GetPlacementRequest())->setName($formattedName); + $response = $gapicClient->getPlacementAsync($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.ads.admanager.v1.PlacementService/GetPlacement', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/AdsAdManager/tests/Unit/V1/Client/ReportServiceClientTest.php b/AdsAdManager/tests/Unit/V1/Client/ReportServiceClientTest.php new file mode 100644 index 000000000000..f9078d83360d --- /dev/null +++ b/AdsAdManager/tests/Unit/V1/Client/ReportServiceClientTest.php @@ -0,0 +1,646 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return ReportServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ReportServiceClient($options); + } + + /** @test */ + public function createReportTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $reportId = 353329146; + $displayName = 'displayName1615086568'; + $locale = 'locale-1097462182'; + $expectedResponse = new Report(); + $expectedResponse->setName($name); + $expectedResponse->setReportId($reportId); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setLocale($locale); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->networkName('[NETWORK_CODE]'); + $report = new Report(); + $reportReportDefinition = new ReportDefinition(); + $reportDefinitionDimensions = []; + $reportReportDefinition->setDimensions($reportDefinitionDimensions); + $reportDefinitionMetrics = []; + $reportReportDefinition->setMetrics($reportDefinitionMetrics); + $reportDefinitionDateRange = new DateRange(); + $reportReportDefinition->setDateRange($reportDefinitionDateRange); + $reportDefinitionReportType = ReportType::REPORT_TYPE_UNSPECIFIED; + $reportReportDefinition->setReportType($reportDefinitionReportType); + $report->setReportDefinition($reportReportDefinition); + $request = (new CreateReportRequest())->setParent($formattedParent)->setReport($report); + $response = $gapicClient->createReport($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.ads.admanager.v1.ReportService/CreateReport', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getReport(); + $this->assertProtobufEquals($report, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createReportExceptionTest() + { + $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 + $formattedParent = $gapicClient->networkName('[NETWORK_CODE]'); + $report = new Report(); + $reportReportDefinition = new ReportDefinition(); + $reportDefinitionDimensions = []; + $reportReportDefinition->setDimensions($reportDefinitionDimensions); + $reportDefinitionMetrics = []; + $reportReportDefinition->setMetrics($reportDefinitionMetrics); + $reportDefinitionDateRange = new DateRange(); + $reportReportDefinition->setDateRange($reportDefinitionDateRange); + $reportDefinitionReportType = ReportType::REPORT_TYPE_UNSPECIFIED; + $reportReportDefinition->setReportType($reportDefinitionReportType); + $report->setReportDefinition($reportReportDefinition); + $request = (new CreateReportRequest())->setParent($formattedParent)->setReport($report); + try { + $gapicClient->createReport($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 fetchReportResultRowsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $totalRowCount = 1810281263; + $nextPageToken = 'nextPageToken-1530815211'; + $expectedResponse = new FetchReportResultRowsResponse(); + $expectedResponse->setTotalRowCount($totalRowCount); + $expectedResponse->setNextPageToken($nextPageToken); + $transport->addResponse($expectedResponse); + $request = new FetchReportResultRowsRequest(); + $response = $gapicClient->fetchReportResultRows($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.ads.admanager.v1.ReportService/FetchReportResultRows', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function fetchReportResultRowsExceptionTest() + { + $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); + $request = new FetchReportResultRowsRequest(); + try { + $gapicClient->fetchReportResultRows($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 getReportTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $reportId = 353329146; + $displayName = 'displayName1615086568'; + $locale = 'locale-1097462182'; + $expectedResponse = new Report(); + $expectedResponse->setName($name2); + $expectedResponse->setReportId($reportId); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setLocale($locale); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->reportName('[NETWORK_CODE]', '[REPORT]'); + $request = (new GetReportRequest())->setName($formattedName); + $response = $gapicClient->getReport($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.ads.admanager.v1.ReportService/GetReport', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getReportExceptionTest() + { + $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 + $formattedName = $gapicClient->reportName('[NETWORK_CODE]', '[REPORT]'); + $request = (new GetReportRequest())->setName($formattedName); + try { + $gapicClient->getReport($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 listReportsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $totalSize = 705419236; + $reportsElement = new Report(); + $reports = [$reportsElement]; + $expectedResponse = new ListReportsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTotalSize($totalSize); + $expectedResponse->setReports($reports); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->networkName('[NETWORK_CODE]'); + $request = (new ListReportsRequest())->setParent($formattedParent); + $response = $gapicClient->listReports($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getReports()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.ads.admanager.v1.ReportService/ListReports', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listReportsExceptionTest() + { + $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 + $formattedParent = $gapicClient->networkName('[NETWORK_CODE]'); + $request = (new ListReportsRequest())->setParent($formattedParent); + try { + $gapicClient->listReports($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 runReportTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/runReportTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $reportResult = 'reportResult-778769016'; + $expectedResponse = new RunReportResponse(); + $expectedResponse->setReportResult($reportResult); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/runReportTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->reportName('[NETWORK_CODE]', '[REPORT]'); + $request = (new RunReportRequest())->setName($formattedName); + $response = $gapicClient->runReport($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.ads.admanager.v1.ReportService/RunReport', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/runReportTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function runReportExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/runReportTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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 + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->reportName('[NETWORK_CODE]', '[REPORT]'); + $request = (new RunReportRequest())->setName($formattedName); + $response = $gapicClient->runReport($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/runReportTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateReportTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $reportId = 353329146; + $displayName = 'displayName1615086568'; + $locale = 'locale-1097462182'; + $expectedResponse = new Report(); + $expectedResponse->setName($name); + $expectedResponse->setReportId($reportId); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setLocale($locale); + $transport->addResponse($expectedResponse); + // Mock request + $report = new Report(); + $reportReportDefinition = new ReportDefinition(); + $reportDefinitionDimensions = []; + $reportReportDefinition->setDimensions($reportDefinitionDimensions); + $reportDefinitionMetrics = []; + $reportReportDefinition->setMetrics($reportDefinitionMetrics); + $reportDefinitionDateRange = new DateRange(); + $reportReportDefinition->setDateRange($reportDefinitionDateRange); + $reportDefinitionReportType = ReportType::REPORT_TYPE_UNSPECIFIED; + $reportReportDefinition->setReportType($reportDefinitionReportType); + $report->setReportDefinition($reportReportDefinition); + $updateMask = new FieldMask(); + $request = (new UpdateReportRequest())->setReport($report)->setUpdateMask($updateMask); + $response = $gapicClient->updateReport($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.ads.admanager.v1.ReportService/UpdateReport', $actualFuncCall); + $actualValue = $actualRequestObject->getReport(); + $this->assertProtobufEquals($report, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateReportExceptionTest() + { + $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 + $report = new Report(); + $reportReportDefinition = new ReportDefinition(); + $reportDefinitionDimensions = []; + $reportReportDefinition->setDimensions($reportDefinitionDimensions); + $reportDefinitionMetrics = []; + $reportReportDefinition->setMetrics($reportDefinitionMetrics); + $reportDefinitionDateRange = new DateRange(); + $reportReportDefinition->setDateRange($reportDefinitionDateRange); + $reportDefinitionReportType = ReportType::REPORT_TYPE_UNSPECIFIED; + $reportReportDefinition->setReportType($reportDefinitionReportType); + $report->setReportDefinition($reportReportDefinition); + $updateMask = new FieldMask(); + $request = (new UpdateReportRequest())->setReport($report)->setUpdateMask($updateMask); + try { + $gapicClient->updateReport($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 createReportAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $reportId = 353329146; + $displayName = 'displayName1615086568'; + $locale = 'locale-1097462182'; + $expectedResponse = new Report(); + $expectedResponse->setName($name); + $expectedResponse->setReportId($reportId); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setLocale($locale); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->networkName('[NETWORK_CODE]'); + $report = new Report(); + $reportReportDefinition = new ReportDefinition(); + $reportDefinitionDimensions = []; + $reportReportDefinition->setDimensions($reportDefinitionDimensions); + $reportDefinitionMetrics = []; + $reportReportDefinition->setMetrics($reportDefinitionMetrics); + $reportDefinitionDateRange = new DateRange(); + $reportReportDefinition->setDateRange($reportDefinitionDateRange); + $reportDefinitionReportType = ReportType::REPORT_TYPE_UNSPECIFIED; + $reportReportDefinition->setReportType($reportDefinitionReportType); + $report->setReportDefinition($reportReportDefinition); + $request = (new CreateReportRequest())->setParent($formattedParent)->setReport($report); + $response = $gapicClient->createReportAsync($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.ads.admanager.v1.ReportService/CreateReport', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getReport(); + $this->assertProtobufEquals($report, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/AdsAdManager/tests/Unit/V1/Client/RoleServiceClientTest.php b/AdsAdManager/tests/Unit/V1/Client/RoleServiceClientTest.php new file mode 100644 index 000000000000..d29d5ff785d0 --- /dev/null +++ b/AdsAdManager/tests/Unit/V1/Client/RoleServiceClientTest.php @@ -0,0 +1,248 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return RoleServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RoleServiceClient($options); + } + + /** @test */ + public function getRoleTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $roleId = 1376884100; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $builtIn = true; + $expectedResponse = new Role(); + $expectedResponse->setName($name2); + $expectedResponse->setRoleId($roleId); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setBuiltIn($builtIn); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->roleName('[NETWORK_CODE]', '[ROLE]'); + $request = (new GetRoleRequest())->setName($formattedName); + $response = $gapicClient->getRole($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.ads.admanager.v1.RoleService/GetRole', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getRoleExceptionTest() + { + $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 + $formattedName = $gapicClient->roleName('[NETWORK_CODE]', '[ROLE]'); + $request = (new GetRoleRequest())->setName($formattedName); + try { + $gapicClient->getRole($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 listRolesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $totalSize = 705419236; + $rolesElement = new Role(); + $roles = [$rolesElement]; + $expectedResponse = new ListRolesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTotalSize($totalSize); + $expectedResponse->setRoles($roles); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->networkName('[NETWORK_CODE]'); + $request = (new ListRolesRequest())->setParent($formattedParent); + $response = $gapicClient->listRoles($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getRoles()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.ads.admanager.v1.RoleService/ListRoles', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listRolesExceptionTest() + { + $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 + $formattedParent = $gapicClient->networkName('[NETWORK_CODE]'); + $request = (new ListRolesRequest())->setParent($formattedParent); + try { + $gapicClient->listRoles($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 getRoleAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $roleId = 1376884100; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $builtIn = true; + $expectedResponse = new Role(); + $expectedResponse->setName($name2); + $expectedResponse->setRoleId($roleId); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setBuiltIn($builtIn); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->roleName('[NETWORK_CODE]', '[ROLE]'); + $request = (new GetRoleRequest())->setName($formattedName); + $response = $gapicClient->getRoleAsync($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.ads.admanager.v1.RoleService/GetRole', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/AdsAdManager/tests/Unit/V1/Client/TaxonomyCategoryServiceClientTest.php b/AdsAdManager/tests/Unit/V1/Client/TaxonomyCategoryServiceClientTest.php new file mode 100644 index 000000000000..2ca5022cd603 --- /dev/null +++ b/AdsAdManager/tests/Unit/V1/Client/TaxonomyCategoryServiceClientTest.php @@ -0,0 +1,248 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return TaxonomyCategoryServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new TaxonomyCategoryServiceClient($options); + } + + /** @test */ + public function getTaxonomyCategoryTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $taxonomyCategoryId = 28298254; + $displayName = 'displayName1615086568'; + $groupingOnly = true; + $parentTaxonomyCategoryId = 1790260093; + $expectedResponse = new TaxonomyCategory(); + $expectedResponse->setName($name2); + $expectedResponse->setTaxonomyCategoryId($taxonomyCategoryId); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setGroupingOnly($groupingOnly); + $expectedResponse->setParentTaxonomyCategoryId($parentTaxonomyCategoryId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->taxonomyCategoryName('[NETWORK_CODE]', '[TAXONOMY_CATEGORY]'); + $request = (new GetTaxonomyCategoryRequest())->setName($formattedName); + $response = $gapicClient->getTaxonomyCategory($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.ads.admanager.v1.TaxonomyCategoryService/GetTaxonomyCategory', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTaxonomyCategoryExceptionTest() + { + $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 + $formattedName = $gapicClient->taxonomyCategoryName('[NETWORK_CODE]', '[TAXONOMY_CATEGORY]'); + $request = (new GetTaxonomyCategoryRequest())->setName($formattedName); + try { + $gapicClient->getTaxonomyCategory($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 listTaxonomyCategoriesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $totalSize = 705419236; + $taxonomyCategoriesElement = new TaxonomyCategory(); + $taxonomyCategories = [$taxonomyCategoriesElement]; + $expectedResponse = new ListTaxonomyCategoriesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTotalSize($totalSize); + $expectedResponse->setTaxonomyCategories($taxonomyCategories); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->networkName('[NETWORK_CODE]'); + $request = (new ListTaxonomyCategoriesRequest())->setParent($formattedParent); + $response = $gapicClient->listTaxonomyCategories($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getTaxonomyCategories()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.ads.admanager.v1.TaxonomyCategoryService/ListTaxonomyCategories', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listTaxonomyCategoriesExceptionTest() + { + $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 + $formattedParent = $gapicClient->networkName('[NETWORK_CODE]'); + $request = (new ListTaxonomyCategoriesRequest())->setParent($formattedParent); + try { + $gapicClient->listTaxonomyCategories($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 getTaxonomyCategoryAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $taxonomyCategoryId = 28298254; + $displayName = 'displayName1615086568'; + $groupingOnly = true; + $parentTaxonomyCategoryId = 1790260093; + $expectedResponse = new TaxonomyCategory(); + $expectedResponse->setName($name2); + $expectedResponse->setTaxonomyCategoryId($taxonomyCategoryId); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setGroupingOnly($groupingOnly); + $expectedResponse->setParentTaxonomyCategoryId($parentTaxonomyCategoryId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->taxonomyCategoryName('[NETWORK_CODE]', '[TAXONOMY_CATEGORY]'); + $request = (new GetTaxonomyCategoryRequest())->setName($formattedName); + $response = $gapicClient->getTaxonomyCategoryAsync($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.ads.admanager.v1.TaxonomyCategoryService/GetTaxonomyCategory', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/AdsAdManager/tests/Unit/V1/Client/UserServiceClientTest.php b/AdsAdManager/tests/Unit/V1/Client/UserServiceClientTest.php new file mode 100644 index 000000000000..2410a72d21a7 --- /dev/null +++ b/AdsAdManager/tests/Unit/V1/Client/UserServiceClientTest.php @@ -0,0 +1,189 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return UserServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new UserServiceClient($options); + } + + /** @test */ + public function getUserTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $userId = 147132913; + $displayName = 'displayName1615086568'; + $email = 'email96619420'; + $role = 'role3506294'; + $active = true; + $externalId = 'externalId-1153075697'; + $serviceAccount = false; + $ordersUiLocalTimeZone = 'ordersUiLocalTimeZone-1376832007'; + $expectedResponse = new User(); + $expectedResponse->setName($name2); + $expectedResponse->setUserId($userId); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setEmail($email); + $expectedResponse->setRole($role); + $expectedResponse->setActive($active); + $expectedResponse->setExternalId($externalId); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setOrdersUiLocalTimeZone($ordersUiLocalTimeZone); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->userName('[NETWORK_CODE]', '[USER]'); + $request = (new GetUserRequest())->setName($formattedName); + $response = $gapicClient->getUser($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.ads.admanager.v1.UserService/GetUser', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getUserExceptionTest() + { + $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 + $formattedName = $gapicClient->userName('[NETWORK_CODE]', '[USER]'); + $request = (new GetUserRequest())->setName($formattedName); + try { + $gapicClient->getUser($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 getUserAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $userId = 147132913; + $displayName = 'displayName1615086568'; + $email = 'email96619420'; + $role = 'role3506294'; + $active = true; + $externalId = 'externalId-1153075697'; + $serviceAccount = false; + $ordersUiLocalTimeZone = 'ordersUiLocalTimeZone-1376832007'; + $expectedResponse = new User(); + $expectedResponse->setName($name2); + $expectedResponse->setUserId($userId); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setEmail($email); + $expectedResponse->setRole($role); + $expectedResponse->setActive($active); + $expectedResponse->setExternalId($externalId); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setOrdersUiLocalTimeZone($ordersUiLocalTimeZone); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->userName('[NETWORK_CODE]', '[USER]'); + $request = (new GetUserRequest())->setName($formattedName); + $response = $gapicClient->getUserAsync($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.ads.admanager.v1.UserService/GetUser', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/composer.json b/composer.json index 86d464ebec10..53681abbd817 100644 --- a/composer.json +++ b/composer.json @@ -261,7 +261,8 @@ "google/shopping-merchant-products": "0.1.0", "google/shopping-merchant-promotions": "0.1.0", "google/shopping-merchant-quota": "0.1.3", - "google/shopping-merchant-reports": "0.8.1" + "google/shopping-merchant-reports": "0.8.1", + "googleads/ad-manager": "0.0.0" }, "suggest": { "opis/closure": "May be used to serialize closures to process jobs in the batch daemon. Please require version ^3.", @@ -269,6 +270,7 @@ }, "autoload": { "psr-4": { + "GPBMetadata\\Google\\Ads\\Admanager\\": "AdsAdManager/metadata", "GPBMetadata\\Google\\Analytics\\Admin\\": "AnalyticsAdmin/metadata", "GPBMetadata\\Google\\Analytics\\Data\\": "AnalyticsData/metadata", "GPBMetadata\\Google\\Api\\": "CommonProtos/metadata/Api", @@ -482,6 +484,7 @@ "GPBMetadata\\Google\\Storagetransfer\\": "StorageTransfer/metadata", "GPBMetadata\\Google\\Type\\": "CommonProtos/metadata/Type", "GPBMetadata\\Grafeas\\": "Grafeas/metadata", + "Google\\Ads\\AdManager\\": "AdsAdManager/src", "Google\\Ads\\MarketingPlatform\\Admin\\": "AdsMarketingPlatformAdmin/src", "Google\\Analytics\\Admin\\": "AnalyticsAdmin/src", "Google\\Analytics\\Data\\": "AnalyticsData/src", From 9abf2ba3917cdc6d933a68670b8a9762a4f3eb4d Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2024 17:54:42 -0400 Subject: [PATCH 32/34] chore(main): release 0.265.0 (#7756) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- AdsAdManager/VERSION | 2 +- AiPlatform/VERSION | 2 +- AlloyDb/VERSION | 2 +- CHANGELOG.md | 118 ++++++++++++++++++++++++++++++++++ DocumentAi/VERSION | 2 +- Parallelstore/VERSION | 2 +- SecureSourceManager/VERSION | 2 +- ShoppingCss/VERSION | 2 +- Spanner/VERSION | 2 +- Spanner/src/SpannerClient.php | 2 +- TextToSpeech/VERSION | 2 +- composer.json | 18 +++--- 12 files changed, 137 insertions(+), 19 deletions(-) diff --git a/AdsAdManager/VERSION b/AdsAdManager/VERSION index 77d6f4ca2371..6e8bf73aa550 100644 --- a/AdsAdManager/VERSION +++ b/AdsAdManager/VERSION @@ -1 +1 @@ -0.0.0 +0.1.0 diff --git a/AiPlatform/VERSION b/AiPlatform/VERSION index 27f9cd322bb9..f8e233b27332 100644 --- a/AiPlatform/VERSION +++ b/AiPlatform/VERSION @@ -1 +1 @@ -1.8.0 +1.9.0 diff --git a/AlloyDb/VERSION b/AlloyDb/VERSION index 3eefcb9dd5b3..9084fa2f716a 100644 --- a/AlloyDb/VERSION +++ b/AlloyDb/VERSION @@ -1 +1 @@ -1.0.0 +1.1.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index d2abfc83f13d..d5a24c3cf7e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,123 @@ # Changelog +## 0.265.0 + +

googleads/ad-manager 0.1.0 + + + +### Features + +* Introduce AdManager component ([#7767](https://github.com/googleapis/google-cloud-php/issues/7767)) ([9b4de94](https://github.com/googleapis/google-cloud-php/commit/9b4de9431c6774156ac0a58271fd0355f7d3004f)) + +
+ +
google/cloud-ai-platform 1.9.0 + + + +### Features + +* Add `text` field for Grounding metadata support chunk output ([#7758](https://github.com/googleapis/google-cloud-php/issues/7758)) ([385c1e7](https://github.com/googleapis/google-cloud-php/commit/385c1e763613e3c5683757447a36f133c9787530)) + +
+ +
google/cloud-alloydb 1.1.0 + + + +### Features + +* Add more observability options on the Instance level ([22357f5](https://github.com/googleapis/google-cloud-php/commit/22357f5392c482243dd47d17383d0af6367d3911)) +* Add new API to execute SQL statements ([22357f5](https://github.com/googleapis/google-cloud-php/commit/22357f5392c482243dd47d17383d0af6367d3911)) +* Add new API to list the databases in a project and location ([22357f5](https://github.com/googleapis/google-cloud-php/commit/22357f5392c482243dd47d17383d0af6367d3911)) +* Add new API to perform a promotion or switchover on secondary instances ([22357f5](https://github.com/googleapis/google-cloud-php/commit/22357f5392c482243dd47d17383d0af6367d3911)) +* Add new PSC instance configuration setting and output the PSC DNS name ([#7760](https://github.com/googleapis/google-cloud-php/issues/7760)) ([22357f5](https://github.com/googleapis/google-cloud-php/commit/22357f5392c482243dd47d17383d0af6367d3911)) +* Add optional field to keep extra roles on a user if it already exists ([22357f5](https://github.com/googleapis/google-cloud-php/commit/22357f5392c482243dd47d17383d0af6367d3911)) +* Add support for Free Trials ([22357f5](https://github.com/googleapis/google-cloud-php/commit/22357f5392c482243dd47d17383d0af6367d3911)) +* Add support to schedule maintenance ([22357f5](https://github.com/googleapis/google-cloud-php/commit/22357f5392c482243dd47d17383d0af6367d3911)) +* Additional field to set tags on a backup or cluster ([22357f5](https://github.com/googleapis/google-cloud-php/commit/22357f5392c482243dd47d17383d0af6367d3911)) +* Support for obtaining the public ip addresses of an instance and enabling either inbound or outbound public ip ([22357f5](https://github.com/googleapis/google-cloud-php/commit/22357f5392c482243dd47d17383d0af6367d3911)) + + +### Documentation + +* Various typo fixes, correcting the formatting, and clarifications on the request_id and validate_only fields in API requests and on the page_size when listing the database ([22357f5](https://github.com/googleapis/google-cloud-php/commit/22357f5392c482243dd47d17383d0af6367d3911)) + +
+ +
google/cloud-document-ai 2.1.0 + + + +### Features + +* Add RESOURCE_EXHAUSTED to retryable status codes for ProcessDocument method ([4d427bf](https://github.com/googleapis/google-cloud-php/commit/4d427bf3f9b23c2d790e0d23ad0b9e842ceed691)) +* Added an url for issue reporting and api short name ([4d427bf](https://github.com/googleapis/google-cloud-php/commit/4d427bf3f9b23c2d790e0d23ad0b9e842ceed691)) +* Updated the exponential backoff settings for the Document AI ProcessDocument and BatchProcessDocuments methods ([#7757](https://github.com/googleapis/google-cloud-php/issues/7757)) ([4d427bf](https://github.com/googleapis/google-cloud-php/commit/4d427bf3f9b23c2d790e0d23ad0b9e842ceed691)) + +
+ +
google/cloud-parallelstore 0.7.0 + + + +### Features + +* Add Parallelstore V1 ([#7764](https://github.com/googleapis/google-cloud-php/issues/7764)) ([c8289d5](https://github.com/googleapis/google-cloud-php/commit/c8289d51320fc3367fa1ab837c777288352f4bf3)) + +
+ +
google/cloud-securesourcemanager 1.3.0 + + + +### Features + +* Add branch rule APIs ([#7754](https://github.com/googleapis/google-cloud-php/issues/7754)) ([be3a11c](https://github.com/googleapis/google-cloud-php/commit/be3a11c9f4b18c20264399206e6aa2c7716adb6a)) +* Add field `psc_allowed_projects` to message `.google.cloud.securesourcemanager.v1.Instance` ([be3a11c](https://github.com/googleapis/google-cloud-php/commit/be3a11c9f4b18c20264399206e6aa2c7716adb6a)) + + +### Documentation + +* A comment for field `instance` in message `.google.cloud.securesourcemanager.v1.Repository` is changed ([be3a11c](https://github.com/googleapis/google-cloud-php/commit/be3a11c9f4b18c20264399206e6aa2c7716adb6a)) + +
+ +
google/shopping-css 0.3.0 + + + +### Features + +* A new enum `SubscriptionPeriod` is added ([8afaa8c](https://github.com/googleapis/google-cloud-php/commit/8afaa8c19587006d276ded057c684b9a59836c66)) +* A new field `headline_offer_installment` is added to message `.google.shopping.css.v1.Attributes` ([#7761](https://github.com/googleapis/google-cloud-php/issues/7761)) ([8afaa8c](https://github.com/googleapis/google-cloud-php/commit/8afaa8c19587006d276ded057c684b9a59836c66)) +* A new field `headline_offer_subscription_cost` is added to message `.google.shopping.css.v1.Attributes` ([8afaa8c](https://github.com/googleapis/google-cloud-php/commit/8afaa8c19587006d276ded057c684b9a59836c66)) +* A new message `HeadlineOfferInstallment` is added ([8afaa8c](https://github.com/googleapis/google-cloud-php/commit/8afaa8c19587006d276ded057c684b9a59836c66)) +* A new message `HeadlineOfferSubscriptionCost` is added ([8afaa8c](https://github.com/googleapis/google-cloud-php/commit/8afaa8c19587006d276ded057c684b9a59836c66)) + +
+ +
google/cloud-spanner 1.88.0 + + + +### Features + +* **spanner:** Add support for Cloud Spanner Default Backup Schedules ([#7762](https://github.com/googleapis/google-cloud-php/issues/7762)) ([c134d3d](https://github.com/googleapis/google-cloud-php/commit/c134d3debb4e4afa724c2e769c4adaff113a3477)) + +
+ +
google/cloud-text-to-speech 1.11.0 + + + +### Features + +* Add brand voice lite, which lets you clone a voice with just 10 seconds of audio ([#7759](https://github.com/googleapis/google-cloud-php/issues/7759)) ([3b5afb3](https://github.com/googleapis/google-cloud-php/commit/3b5afb394afe814d2fa2de028e214b528c80a234)) + +
+ ## 0.264.0
google/analytics-data 0.20.0 diff --git a/DocumentAi/VERSION b/DocumentAi/VERSION index 227cea215648..7ec1d6db4087 100644 --- a/DocumentAi/VERSION +++ b/DocumentAi/VERSION @@ -1 +1 @@ -2.0.0 +2.1.0 diff --git a/Parallelstore/VERSION b/Parallelstore/VERSION index ee6cdce3c290..faef31a4357c 100644 --- a/Parallelstore/VERSION +++ b/Parallelstore/VERSION @@ -1 +1 @@ -0.6.1 +0.7.0 diff --git a/SecureSourceManager/VERSION b/SecureSourceManager/VERSION index 26aaba0e8663..f0bb29e76388 100644 --- a/SecureSourceManager/VERSION +++ b/SecureSourceManager/VERSION @@ -1 +1 @@ -1.2.0 +1.3.0 diff --git a/ShoppingCss/VERSION b/ShoppingCss/VERSION index 1866a362b7be..0d91a54c7d43 100644 --- a/ShoppingCss/VERSION +++ b/ShoppingCss/VERSION @@ -1 +1 @@ -0.2.9 +0.3.0 diff --git a/Spanner/VERSION b/Spanner/VERSION index f6342716723f..59be592144c2 100644 --- a/Spanner/VERSION +++ b/Spanner/VERSION @@ -1 +1 @@ -1.87.0 +1.88.0 diff --git a/Spanner/src/SpannerClient.php b/Spanner/src/SpannerClient.php index 7c379c418cfa..a4ef1ddafe28 100644 --- a/Spanner/src/SpannerClient.php +++ b/Spanner/src/SpannerClient.php @@ -120,7 +120,7 @@ class SpannerClient use LROTrait; use ValidateTrait; - const VERSION = '1.87.0'; + const VERSION = '1.88.0'; const FULL_CONTROL_SCOPE = 'https://www.googleapis.com/auth/spanner.data'; const ADMIN_SCOPE = 'https://www.googleapis.com/auth/spanner.admin'; diff --git a/TextToSpeech/VERSION b/TextToSpeech/VERSION index 81c871de46b3..1cac385c6cb8 100644 --- a/TextToSpeech/VERSION +++ b/TextToSpeech/VERSION @@ -1 +1 @@ -1.10.0 +1.11.0 diff --git a/composer.json b/composer.json index 53681abbd817..5f1433d8b8a9 100644 --- a/composer.json +++ b/composer.json @@ -76,8 +76,8 @@ "google/apps-meet": "0.2.3", "google/cloud-access-approval": "2.0.1", "google/cloud-advisorynotifications": "1.0.0", - "google/cloud-ai-platform": "1.8.0", - "google/cloud-alloydb": "1.0.0", + "google/cloud-ai-platform": "1.9.0", + "google/cloud-alloydb": "1.1.0", "google/cloud-api-gateway": "2.0.0", "google/cloud-api-keys": "1.0.0", "google/cloud-apigee-connect": "2.0.1", @@ -143,7 +143,7 @@ "google/cloud-discoveryengine": "1.2.0", "google/cloud-dlp": "2.2.0", "google/cloud-dms": "2.0.1", - "google/cloud-document-ai": "2.0.0", + "google/cloud-document-ai": "2.1.0", "google/cloud-domains": "1.0.0", "google/cloud-edgenetwork": "1.1.1", "google/cloud-error-reporting": "0.22.7", @@ -185,7 +185,7 @@ "google/cloud-org-policy": "1.1.0", "google/cloud-osconfig": "2.0.0", "google/cloud-oslogin": "2.0.1", - "google/cloud-parallelstore": "0.6.1", + "google/cloud-parallelstore": "0.7.0", "google/cloud-policy-troubleshooter": "2.0.1", "google/cloud-policysimulator": "1.0.0", "google/cloud-policytroubleshooter-iam": "0.2.6", @@ -206,7 +206,7 @@ "google/cloud-run": "1.2.0", "google/cloud-scheduler": "2.0.0", "google/cloud-secret-manager": "1.15.2", - "google/cloud-securesourcemanager": "1.2.0", + "google/cloud-securesourcemanager": "1.3.0", "google/cloud-security-center": "2.0.1", "google/cloud-security-private-ca": "2.0.0", "google/cloud-security-public-ca": "1.0.0", @@ -217,7 +217,7 @@ "google/cloud-service-usage": "2.0.0", "google/cloud-servicehealth": "0.1.6", "google/cloud-shell": "2.0.1", - "google/cloud-spanner": "1.87.0", + "google/cloud-spanner": "1.88.0", "google/cloud-speech": "1.19.0", "google/cloud-sql-admin": "1.2.0", "google/cloud-storage": "1.43.1", @@ -228,7 +228,7 @@ "google/cloud-talent": "2.0.0", "google/cloud-tasks": "1.15.0", "google/cloud-telcoautomation": "1.0.0", - "google/cloud-text-to-speech": "1.10.0", + "google/cloud-text-to-speech": "1.11.0", "google/cloud-tpu": "1.4.5", "google/cloud-trace": "1.8.6", "google/cloud-translate": "1.19.0", @@ -251,7 +251,7 @@ "google/maps-fleetengine-delivery": "0.1.5", "google/maps-routeoptimization": "0.3.0", "google/shopping-common-protos": "0.4.0", - "google/shopping-css": "0.2.9", + "google/shopping-css": "0.3.0", "google/shopping-merchant-accounts": "0.3.0", "google/shopping-merchant-conversions": "0.1.2", "google/shopping-merchant-datasources": "0.2.1", @@ -262,7 +262,7 @@ "google/shopping-merchant-promotions": "0.1.0", "google/shopping-merchant-quota": "0.1.3", "google/shopping-merchant-reports": "0.8.1", - "googleads/ad-manager": "0.0.0" + "googleads/ad-manager": "0.1.0" }, "suggest": { "opis/closure": "May be used to serialize closures to process jobs in the batch daemon. Please require version ^3.", From ebac0c878cf9207ea64b8747e5234e629d3ff4c1 Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Mon, 28 Oct 2024 16:49:50 -0700 Subject: [PATCH 33/34] fix(dev): allow for packagist components in googleads/ as well (#7771) --- dev/src/Component.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/src/Component.php b/dev/src/Component.php index c8d8afb8c801..bc9e7514a8ee 100644 --- a/dev/src/Component.php +++ b/dev/src/Component.php @@ -68,7 +68,7 @@ public static function getComponents(array $componentNames = []): array public function getId(): string { - return str_replace('google/', '', $this->getPackageName()); + return str_replace(['google/', 'googleads/'], '', $this->getPackageName()); } public function getName(): string From 3c82c64143c00027bd172a32670cbb9f75202823 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Mendoza?= Date: Wed, 30 Oct 2024 14:56:07 -0400 Subject: [PATCH 34/34] feat: support external links for Guzzle Promise Interface (#7778) --- dev/src/DocFx/Node/XrefTrait.php | 38 +++++++++++++------ dev/tests/Unit/DocFx/NodeTest.php | 36 ++++++++++++++++++ .../V1.Client.SecretManagerServiceClient.yml | 30 +++++++-------- .../Vision/V1.Client.ImageAnnotatorClient.yml | 8 ++-- .../Vision/V1.Client.ProductSearchClient.yml | 38 +++++++++---------- 5 files changed, 100 insertions(+), 50 deletions(-) diff --git a/dev/src/DocFx/Node/XrefTrait.php b/dev/src/DocFx/Node/XrefTrait.php index 30f2ddd90ffe..6b691a398b49 100644 --- a/dev/src/DocFx/Node/XrefTrait.php +++ b/dev/src/DocFx/Node/XrefTrait.php @@ -159,34 +159,48 @@ private function replaceUidWithLink(string $uid, string $name = null): string // Remove preceeding "\" from namespace $name = $name ?: ltrim($uid, '\\'); + // Case for generic types + if (preg_match('/(.*)<(.*)>/', $uid, $matches)) { + return sprintf( + '%s<%s>', + $this->replaceUidWithLink($matches[1]), + $this->replaceUidWithLink($matches[2]) + ); + } + // Check for external package namespaces switch (true) { - case 0 === strpos($uid, '\Google\ApiCore\\'): + case str_starts_with($uid, '\Google\ApiCore\\'): $extLinkRoot = 'https://googleapis.github.io/gax-php#'; break; - case 0 === strpos($uid, '\Google\Auth\\'): + case str_starts_with($uid, '\Google\Auth\\'): $extLinkRoot = 'https://googleapis.github.io/google-auth-library-php/main/'; break; - case 0 === strpos($uid, '\Google\Protobuf\\'): + case str_starts_with($uid, '\Google\Protobuf\\'): $extLinkRoot = 'https://protobuf.dev/reference/php/api-docs/'; break; - case 0 === strpos($uid, '\Google\Api\\'): - case 0 === strpos($uid, '\Google\Cloud\Iam\V1\\'): - case 0 === strpos($uid, '\Google\Cloud\Location\\'): - case 0 === strpos($uid, '\Google\Cloud\Logging\Type\\'): - case 0 === strpos($uid, '\Google\Iam\\'): - case 0 === strpos($uid, '\Google\Rpc\\'): - case 0 === strpos($uid, '\Google\Type\\'): + case str_starts_with($uid, '\Google\Api\\'): + case str_starts_with($uid, '\Google\Cloud\Iam\V1\\'): + case str_starts_with($uid, '\Google\Cloud\Location\\'): + case str_starts_with($uid, '\Google\Cloud\Logging\Type\\'): + case str_starts_with($uid, '\Google\Iam\\'): + case str_starts_with($uid, '\Google\Rpc\\'): + case str_starts_with($uid, '\Google\Type\\'): $extLinkRoot = 'https://googleapis.github.io/common-protos-php#'; break; + case 0 === strpos($uid, '\GuzzleHttp\Promise\PromiseInterface'): + $extLinkRoot = 'https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html'; + break; default: $extLinkRoot = ''; } // Create external link if ($extLinkRoot) { - $path = str_replace(['::', '\\', '()'], ['#method_', '/'], $name); - return sprintf('%s', $extLinkRoot . $path, $name); + if (str_starts_with($uid, '\Google')) { + $extLinkRoot .= str_replace(['::', '\\', '()'], ['#method_', '/'], $name); + } + return sprintf('%s', $extLinkRoot, $name); } return sprintf('%s', $uid, $name); diff --git a/dev/tests/Unit/DocFx/NodeTest.php b/dev/tests/Unit/DocFx/NodeTest.php index 67633fdf418a..310fe7fea7b1 100644 --- a/dev/tests/Unit/DocFx/NodeTest.php +++ b/dev/tests/Unit/DocFx/NodeTest.php @@ -138,6 +138,42 @@ public function testSeeTagsInMethodDescription() ); } + public function testReplaceGuzzleExternalLink() + { + $guzzlePromiseClassName = '\GuzzleHttp\Promise\PromiseInterface'; + $expected = 'GuzzleHttp\Promise\PromiseInterface'; + $xref = new class { + use XrefTrait; + + public function replace(string $uid) { + return $this->replaceUidWithLink($uid); + } + }; + + $result = $xref->replace($guzzlePromiseClassName); + $this->assertEquals($expected, $result); + } + + public function testReplaceGenericPromiseClass() + { + $guzzlePromiseClassName = '\GuzzleHttp\Promise\PromiseInterface'; + $googleReference = '\Google\Cloud\AdvisoryNotifications\V1\Notification'; + $uid = $guzzlePromiseClassName . '<' . $googleReference . '>'; + + $expected = 'GuzzleHttp\Promise\PromiseInterface'; + $expected .= '<Google\Cloud\AdvisoryNotifications\V1\Notification>'; + $xref = new class { + use XrefTrait; + + public function replace(string $uid) { + return $this->replaceUidWithLink($uid); + } + }; + + $result = $xref->replace($uid); + $this->assertEquals($expected, $result); + } + /** * @dataProvider provideReplaceProtoRefWithXref */ diff --git a/dev/tests/fixtures/docfx/NewClient/V1.Client.SecretManagerServiceClient.yml b/dev/tests/fixtures/docfx/NewClient/V1.Client.SecretManagerServiceClient.yml index 192e38fe3899..2d1c121e642c 100644 --- a/dev/tests/fixtures/docfx/NewClient/V1.Client.SecretManagerServiceClient.yml +++ b/dev/tests/fixtures/docfx/NewClient/V1.Client.SecretManagerServiceClient.yml @@ -604,7 +604,7 @@ items: description: '' returns: - - var_type: 'GuzzleHttp\Promise\PromiseInterface' + var_type: 'GuzzleHttp\Promise\PromiseInterface' - uid: '\Google\Cloud\SecretManager\V1\Client\SecretManagerServiceClient::addSecretVersionAsync()' name: addSecretVersionAsync @@ -625,7 +625,7 @@ items: description: '' returns: - - var_type: 'GuzzleHttp\Promise\PromiseInterface' + var_type: 'GuzzleHttp\Promise\PromiseInterface' - uid: '\Google\Cloud\SecretManager\V1\Client\SecretManagerServiceClient::createSecretAsync()' name: createSecretAsync @@ -646,7 +646,7 @@ items: description: '' returns: - - var_type: 'GuzzleHttp\Promise\PromiseInterface' + var_type: 'GuzzleHttp\Promise\PromiseInterface' - uid: '\Google\Cloud\SecretManager\V1\Client\SecretManagerServiceClient::deleteSecretAsync()' name: deleteSecretAsync @@ -667,7 +667,7 @@ items: description: '' returns: - - var_type: 'GuzzleHttp\Promise\PromiseInterface' + var_type: 'GuzzleHttp\Promise\PromiseInterface' - uid: '\Google\Cloud\SecretManager\V1\Client\SecretManagerServiceClient::destroySecretVersionAsync()' name: destroySecretVersionAsync @@ -688,7 +688,7 @@ items: description: '' returns: - - var_type: 'GuzzleHttp\Promise\PromiseInterface' + var_type: 'GuzzleHttp\Promise\PromiseInterface' - uid: '\Google\Cloud\SecretManager\V1\Client\SecretManagerServiceClient::disableSecretVersionAsync()' name: disableSecretVersionAsync @@ -709,7 +709,7 @@ items: description: '' returns: - - var_type: 'GuzzleHttp\Promise\PromiseInterface' + var_type: 'GuzzleHttp\Promise\PromiseInterface' - uid: '\Google\Cloud\SecretManager\V1\Client\SecretManagerServiceClient::enableSecretVersionAsync()' name: enableSecretVersionAsync @@ -730,7 +730,7 @@ items: description: '' returns: - - var_type: 'GuzzleHttp\Promise\PromiseInterface' + var_type: 'GuzzleHttp\Promise\PromiseInterface' - uid: '\Google\Cloud\SecretManager\V1\Client\SecretManagerServiceClient::getIamPolicyAsync()' name: getIamPolicyAsync @@ -751,7 +751,7 @@ items: description: '' returns: - - var_type: 'GuzzleHttp\Promise\PromiseInterface' + var_type: 'GuzzleHttp\Promise\PromiseInterface' - uid: '\Google\Cloud\SecretManager\V1\Client\SecretManagerServiceClient::getSecretAsync()' name: getSecretAsync @@ -772,7 +772,7 @@ items: description: '' returns: - - var_type: 'GuzzleHttp\Promise\PromiseInterface' + var_type: 'GuzzleHttp\Promise\PromiseInterface' - uid: '\Google\Cloud\SecretManager\V1\Client\SecretManagerServiceClient::getSecretVersionAsync()' name: getSecretVersionAsync @@ -793,7 +793,7 @@ items: description: '' returns: - - var_type: 'GuzzleHttp\Promise\PromiseInterface' + var_type: 'GuzzleHttp\Promise\PromiseInterface' - uid: '\Google\Cloud\SecretManager\V1\Client\SecretManagerServiceClient::listSecretVersionsAsync()' name: listSecretVersionsAsync @@ -814,7 +814,7 @@ items: description: '' returns: - - var_type: 'GuzzleHttp\Promise\PromiseInterface' + var_type: 'GuzzleHttp\Promise\PromiseInterface' - uid: '\Google\Cloud\SecretManager\V1\Client\SecretManagerServiceClient::listSecretsAsync()' name: listSecretsAsync @@ -835,7 +835,7 @@ items: description: '' returns: - - var_type: 'GuzzleHttp\Promise\PromiseInterface' + var_type: 'GuzzleHttp\Promise\PromiseInterface' - uid: '\Google\Cloud\SecretManager\V1\Client\SecretManagerServiceClient::setIamPolicyAsync()' name: setIamPolicyAsync @@ -856,7 +856,7 @@ items: description: '' returns: - - var_type: 'GuzzleHttp\Promise\PromiseInterface' + var_type: 'GuzzleHttp\Promise\PromiseInterface' - uid: '\Google\Cloud\SecretManager\V1\Client\SecretManagerServiceClient::testIamPermissionsAsync()' name: testIamPermissionsAsync @@ -877,7 +877,7 @@ items: description: '' returns: - - var_type: 'GuzzleHttp\Promise\PromiseInterface' + var_type: 'GuzzleHttp\Promise\PromiseInterface' - uid: '\Google\Cloud\SecretManager\V1\Client\SecretManagerServiceClient::updateSecretAsync()' name: updateSecretAsync @@ -898,7 +898,7 @@ items: description: '' returns: - - var_type: 'GuzzleHttp\Promise\PromiseInterface' + var_type: 'GuzzleHttp\Promise\PromiseInterface' - uid: '\Google\Cloud\SecretManager\V1\Client\SecretManagerServiceClient::projectName()' name: 'static::projectName' diff --git a/dev/tests/fixtures/docfx/Vision/V1.Client.ImageAnnotatorClient.yml b/dev/tests/fixtures/docfx/Vision/V1.Client.ImageAnnotatorClient.yml index 08aafe34a931..194ad2a2e434 100644 --- a/dev/tests/fixtures/docfx/Vision/V1.Client.ImageAnnotatorClient.yml +++ b/dev/tests/fixtures/docfx/Vision/V1.Client.ImageAnnotatorClient.yml @@ -244,7 +244,7 @@ items: description: '' returns: - - var_type: 'GuzzleHttp\Promise\PromiseInterface' + var_type: 'GuzzleHttp\Promise\PromiseInterface' - uid: '\Google\Cloud\Vision\V1\Client\ImageAnnotatorClient::asyncBatchAnnotateImagesAsync()' name: asyncBatchAnnotateImagesAsync @@ -265,7 +265,7 @@ items: description: '' returns: - - var_type: 'GuzzleHttp\Promise\PromiseInterface' + var_type: 'GuzzleHttp\Promise\PromiseInterface' - uid: '\Google\Cloud\Vision\V1\Client\ImageAnnotatorClient::batchAnnotateFilesAsync()' name: batchAnnotateFilesAsync @@ -286,7 +286,7 @@ items: description: '' returns: - - var_type: 'GuzzleHttp\Promise\PromiseInterface' + var_type: 'GuzzleHttp\Promise\PromiseInterface' - uid: '\Google\Cloud\Vision\V1\Client\ImageAnnotatorClient::batchAnnotateImagesAsync()' name: batchAnnotateImagesAsync @@ -307,7 +307,7 @@ items: description: '' returns: - - var_type: 'GuzzleHttp\Promise\PromiseInterface' + var_type: 'GuzzleHttp\Promise\PromiseInterface' - uid: '\Google\Cloud\Vision\V1\Client\ImageAnnotatorClient::getOperationsClient()' name: getOperationsClient diff --git a/dev/tests/fixtures/docfx/Vision/V1.Client.ProductSearchClient.yml b/dev/tests/fixtures/docfx/Vision/V1.Client.ProductSearchClient.yml index 60651c60739a..4c6a63cd900b 100644 --- a/dev/tests/fixtures/docfx/Vision/V1.Client.ProductSearchClient.yml +++ b/dev/tests/fixtures/docfx/Vision/V1.Client.ProductSearchClient.yml @@ -826,7 +826,7 @@ items: description: '' returns: - - var_type: 'GuzzleHttp\Promise\PromiseInterface' + var_type: 'GuzzleHttp\Promise\PromiseInterface' - uid: '\Google\Cloud\Vision\V1\Client\ProductSearchClient::createProductAsync()' name: createProductAsync @@ -847,7 +847,7 @@ items: description: '' returns: - - var_type: 'GuzzleHttp\Promise\PromiseInterface' + var_type: 'GuzzleHttp\Promise\PromiseInterface' - uid: '\Google\Cloud\Vision\V1\Client\ProductSearchClient::createProductSetAsync()' name: createProductSetAsync @@ -868,7 +868,7 @@ items: description: '' returns: - - var_type: 'GuzzleHttp\Promise\PromiseInterface' + var_type: 'GuzzleHttp\Promise\PromiseInterface' - uid: '\Google\Cloud\Vision\V1\Client\ProductSearchClient::createReferenceImageAsync()' name: createReferenceImageAsync @@ -889,7 +889,7 @@ items: description: '' returns: - - var_type: 'GuzzleHttp\Promise\PromiseInterface' + var_type: 'GuzzleHttp\Promise\PromiseInterface' - uid: '\Google\Cloud\Vision\V1\Client\ProductSearchClient::deleteProductAsync()' name: deleteProductAsync @@ -910,7 +910,7 @@ items: description: '' returns: - - var_type: 'GuzzleHttp\Promise\PromiseInterface' + var_type: 'GuzzleHttp\Promise\PromiseInterface' - uid: '\Google\Cloud\Vision\V1\Client\ProductSearchClient::deleteProductSetAsync()' name: deleteProductSetAsync @@ -931,7 +931,7 @@ items: description: '' returns: - - var_type: 'GuzzleHttp\Promise\PromiseInterface' + var_type: 'GuzzleHttp\Promise\PromiseInterface' - uid: '\Google\Cloud\Vision\V1\Client\ProductSearchClient::deleteReferenceImageAsync()' name: deleteReferenceImageAsync @@ -952,7 +952,7 @@ items: description: '' returns: - - var_type: 'GuzzleHttp\Promise\PromiseInterface' + var_type: 'GuzzleHttp\Promise\PromiseInterface' - uid: '\Google\Cloud\Vision\V1\Client\ProductSearchClient::getProductAsync()' name: getProductAsync @@ -973,7 +973,7 @@ items: description: '' returns: - - var_type: 'GuzzleHttp\Promise\PromiseInterface' + var_type: 'GuzzleHttp\Promise\PromiseInterface' - uid: '\Google\Cloud\Vision\V1\Client\ProductSearchClient::getProductSetAsync()' name: getProductSetAsync @@ -994,7 +994,7 @@ items: description: '' returns: - - var_type: 'GuzzleHttp\Promise\PromiseInterface' + var_type: 'GuzzleHttp\Promise\PromiseInterface' - uid: '\Google\Cloud\Vision\V1\Client\ProductSearchClient::getReferenceImageAsync()' name: getReferenceImageAsync @@ -1015,7 +1015,7 @@ items: description: '' returns: - - var_type: 'GuzzleHttp\Promise\PromiseInterface' + var_type: 'GuzzleHttp\Promise\PromiseInterface' - uid: '\Google\Cloud\Vision\V1\Client\ProductSearchClient::importProductSetsAsync()' name: importProductSetsAsync @@ -1036,7 +1036,7 @@ items: description: '' returns: - - var_type: 'GuzzleHttp\Promise\PromiseInterface' + var_type: 'GuzzleHttp\Promise\PromiseInterface' - uid: '\Google\Cloud\Vision\V1\Client\ProductSearchClient::listProductSetsAsync()' name: listProductSetsAsync @@ -1057,7 +1057,7 @@ items: description: '' returns: - - var_type: 'GuzzleHttp\Promise\PromiseInterface' + var_type: 'GuzzleHttp\Promise\PromiseInterface' - uid: '\Google\Cloud\Vision\V1\Client\ProductSearchClient::listProductsAsync()' name: listProductsAsync @@ -1078,7 +1078,7 @@ items: description: '' returns: - - var_type: 'GuzzleHttp\Promise\PromiseInterface' + var_type: 'GuzzleHttp\Promise\PromiseInterface' - uid: '\Google\Cloud\Vision\V1\Client\ProductSearchClient::listProductsInProductSetAsync()' name: listProductsInProductSetAsync @@ -1099,7 +1099,7 @@ items: description: '' returns: - - var_type: 'GuzzleHttp\Promise\PromiseInterface' + var_type: 'GuzzleHttp\Promise\PromiseInterface' - uid: '\Google\Cloud\Vision\V1\Client\ProductSearchClient::listReferenceImagesAsync()' name: listReferenceImagesAsync @@ -1120,7 +1120,7 @@ items: description: '' returns: - - var_type: 'GuzzleHttp\Promise\PromiseInterface' + var_type: 'GuzzleHttp\Promise\PromiseInterface' - uid: '\Google\Cloud\Vision\V1\Client\ProductSearchClient::purgeProductsAsync()' name: purgeProductsAsync @@ -1141,7 +1141,7 @@ items: description: '' returns: - - var_type: 'GuzzleHttp\Promise\PromiseInterface' + var_type: 'GuzzleHttp\Promise\PromiseInterface' - uid: '\Google\Cloud\Vision\V1\Client\ProductSearchClient::removeProductFromProductSetAsync()' name: removeProductFromProductSetAsync @@ -1162,7 +1162,7 @@ items: description: '' returns: - - var_type: 'GuzzleHttp\Promise\PromiseInterface' + var_type: 'GuzzleHttp\Promise\PromiseInterface' - uid: '\Google\Cloud\Vision\V1\Client\ProductSearchClient::updateProductAsync()' name: updateProductAsync @@ -1183,7 +1183,7 @@ items: description: '' returns: - - var_type: 'GuzzleHttp\Promise\PromiseInterface' + var_type: 'GuzzleHttp\Promise\PromiseInterface' - uid: '\Google\Cloud\Vision\V1\Client\ProductSearchClient::updateProductSetAsync()' name: updateProductSetAsync @@ -1204,7 +1204,7 @@ items: description: '' returns: - - var_type: 'GuzzleHttp\Promise\PromiseInterface' + var_type: 'GuzzleHttp\Promise\PromiseInterface' - uid: '\Google\Cloud\Vision\V1\Client\ProductSearchClient::getOperationsClient()' name: getOperationsClient