diff --git a/GeminiDataAnalytics/.OwlBot.yaml b/GeminiDataAnalytics/.OwlBot.yaml index 73c8f6ec9a10..8a3d4f7f9fb0 100644 --- a/GeminiDataAnalytics/.OwlBot.yaml +++ b/GeminiDataAnalytics/.OwlBot.yaml @@ -1,4 +1,5 @@ deep-copy-regex: - - source: /google/cloud/geminidataanalytics/(v1beta)/.*-php/(.*) - dest: /owl-bot-staging/GeminiDataAnalytics/$1/$2 + - + source: '/google/cloud/geminidataanalytics/(v1beta|v1)/.*-php/(.*)' + dest: /owl-bot-staging/GeminiDataAnalytics/$1/$2 api-name: GeminiDataAnalytics diff --git a/GeminiDataAnalytics/README.md b/GeminiDataAnalytics/README.md index 1a8767c14d7b..3aa110a25ac8 100644 --- a/GeminiDataAnalytics/README.md +++ b/GeminiDataAnalytics/README.md @@ -36,20 +36,21 @@ on authenticating your client. Once authenticated, you'll be ready to start maki ```php use Google\ApiCore\ApiException; -use Google\Cloud\GeminiDataAnalytics\V1beta\Client\ContextRetrievalServiceClient; -use Google\Cloud\Location\GetLocationRequest; -use Google\Cloud\Location\Location; +use Google\Cloud\GeminiDataAnalytics\V1\Client\DataAgentServiceClient; +use Google\Cloud\GeminiDataAnalytics\V1\DataAgent; +use Google\Cloud\GeminiDataAnalytics\V1\GetDataAgentRequest; // Create a client. -$contextRetrievalServiceClient = new ContextRetrievalServiceClient(); +$dataAgentServiceClient = new DataAgentServiceClient(); // Prepare the request message. -$request = new GetLocationRequest(); +$request = (new GetDataAgentRequest()) + ->setName($formattedName); // Call the API and handle any network failures. try { - /** @var Location $response */ - $response = $contextRetrievalServiceClient->getLocation($request); + /** @var DataAgent $response */ + $response = $dataAgentServiceClient->getDataAgent($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/GeminiDataAnalytics/metadata/V1/Context.php b/GeminiDataAnalytics/metadata/V1/Context.php new file mode 100644 index 000000000000..548d84386530 --- /dev/null +++ b/GeminiDataAnalytics/metadata/V1/Context.php @@ -0,0 +1,28 @@ +internalAddGeneratedFile( + "\x0A\xE1!\x0A1google/cloud/geminidataanalytics/v1/context.proto\x12#google.cloud.geminidataanalytics.v1\x1A\x19google/api/resource.proto\x1A4google/cloud/geminidataanalytics/v1/datasource.proto\x1A\x1Egoogle/protobuf/wrappers.proto\"\x90\x09\x0A\x07Context\x12\x1F\x0A\x12system_instruction\x18\x01 \x01(\x09B\x03\xE0A\x01\x12]\x0A\x15datasource_references\x18\x07 \x01(\x0B29.google.cloud.geminidataanalytics.v1.DatasourceReferencesB\x03\xE0A\x02\x12N\x0A\x07options\x18\x03 \x01(\x0B28.google.cloud.geminidataanalytics.v1.ConversationOptionsB\x03\xE0A\x01\x12O\x0A\x0Fexample_queries\x18\x05 \x03(\x0B21.google.cloud.geminidataanalytics.v1.ExampleQueryB\x03\xE0A\x01\x12Z\x0A\x15looker_golden_queries\x18\x0B \x03(\x0B26.google.cloud.geminidataanalytics.v1.LookerGoldenQueryB\x03\xE0A\x01\x12N\x0A\x0Eglossary_terms\x18\x08 \x03(\x0B21.google.cloud.geminidataanalytics.v1.GlossaryTermB\x03\xE0A\x01\x12b\x0A\x14schema_relationships\x18\x09 \x03(\x0B2?.google.cloud.geminidataanalytics.v1.Context.SchemaRelationshipB\x03\xE0A\x01\x12O\x0A\x0Euser_functions\x18\x0A \x01(\x0B22.google.cloud.geminidataanalytics.v1.UserFunctionsB\x03\xE0A\x01\x1A\x82\x04\x0A\x12SchemaRelationship\x12f\x0A\x11left_schema_paths\x18\x01 \x01(\x0B2K.google.cloud.geminidataanalytics.v1.Context.SchemaRelationship.SchemaPaths\x12g\x0A\x12right_schema_paths\x18\x02 \x01(\x0B2K.google.cloud.geminidataanalytics.v1.Context.SchemaRelationship.SchemaPaths\x12\\\x0A\x07sources\x18\x03 \x03(\x0E2F.google.cloud.geminidataanalytics.v1.Context.SchemaRelationship.SourceB\x03\xE0A\x01\x12\x1D\x0A\x10confidence_score\x18\x04 \x01(\x02B\x03\xE0A\x01\x1A/\x0A\x0BSchemaPaths\x12\x11\x0A\x09table_fqn\x18\x01 \x01(\x09\x12\x0D\x0A\x05paths\x18\x02 \x03(\x09\"m\x0A\x06Source\x12\x16\x0A\x12SOURCE_UNSPECIFIED\x10\x00\x12\x18\x0A\x14BIGQUERY_JOB_HISTORY\x10\x01\x12\x11\x0A\x0DLLM_SUGGESTED\x10\x02\x12\x1E\x0A\x1ABIGQUERY_TABLE_CONSTRAINTS\x10\x03\"Z\x0A\x0DUserFunctions\x12I\x0A\x0Bbq_routines\x18\x01 \x03(\x0B24.google.cloud.geminidataanalytics.v1.BigQueryRoutine\"\x80\x01\x0A\x0FBigQueryRoutine\x12X\x0A\x11routine_reference\x18\x01 \x01(\x0B2=.google.cloud.geminidataanalytics.v1.BigQueryRoutineReference\x12\x13\x0A\x0Bdescription\x18\x02 \x01(\x09\"V\x0A\x18BigQueryRoutineReference\x12\x12\x0A\x0Aproject_id\x18\x01 \x01(\x09\x12\x12\x0A\x0Adataset_id\x18\x02 \x01(\x09\x12\x12\x0A\x0Aroutine_id\x18\x03 \x01(\x09\"\xA7\x01\x0A\x0CExampleQuery\x12\x18\x0A\x09sql_query\x18e \x01(\x09B\x03\xE0A\x01H\x00\x12&\x0A\x19natural_language_question\x18\x01 \x01(\x09B\x03\xE0A\x01\x12L\x0A\x0Aparameters\x18\x03 \x03(\x0B23.google.cloud.geminidataanalytics.v1.QueryParameterB\x03\xE0A\x01B\x07\x0A\x05query\"U\x0A\x0EQueryParameter\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x18\x0A\x0Bdescription\x18\x02 \x01(\x09B\x03\xE0A\x01\x12\x16\x0A\x09data_type\x18\x03 \x01(\x09B\x03\xE0A\x02\"\xB3\x01\x0A\x0CMatchedQuery\x12H\x0A\x0Dexample_query\x18\x01 \x01(\x0B21.google.cloud.geminidataanalytics.v1.ExampleQuery\x12Y\x0A\x16query_parameter_values\x18\x02 \x03(\x0B29.google.cloud.geminidataanalytics.v1.QueryParameterValues\"=\x0A\x14QueryParameterValues\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x12\x0A\x05value\x18\x02 \x01(\x09B\x03\xE0A\x02\"\x89\x01\x0A\x11LookerGoldenQuery\x12'\x0A\x1Anatural_language_questions\x18\x04 \x03(\x09B\x03\xE0A\x01\x12K\x0A\x0Clooker_query\x18\x05 \x01(\x0B20.google.cloud.geminidataanalytics.v1.LookerQueryB\x03\xE0A\x01\"\xE7\x02\x0A\x0BLookerQuery\x12\x12\x0A\x05model\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x14\x0A\x07explore\x18\x02 \x01(\x09B\x03\xE0A\x02\x12\x13\x0A\x06fields\x18\x03 \x03(\x09B\x03\xE0A\x01\x12M\x0A\x07filters\x18\x04 \x03(\x0B27.google.cloud.geminidataanalytics.v1.LookerQuery.FilterB\x03\xE0A\x01\x12\x12\x0A\x05sorts\x18\x05 \x03(\x09B\x03\xE0A\x01\x12\x17\x0A\x05limit\x18\x06 \x01(\x09B\x03\xE0A\x01H\x00\x88\x01\x01\x12\x1A\x0A\x08query_id\x18\x0A \x01(\x09B\x03\xE0A\x01H\x01\x88\x01\x01\x12\x1B\x0A\x09client_id\x18\x0B \x01(\x09B\x03\xE0A\x01H\x02\x88\x01\x01\x1A?\x0A\x06Filter\x12\x12\x0A\x05field\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x17\x0A\x05value\x18\x02 \x01(\x09B\x03\xE0A\x01H\x00\x88\x01\x01B\x08\x0A\x06_valueB\x08\x0A\x06_limitB\x0B\x0A\x09_query_idB\x0C\x0A\x0A_client_id\"X\x0A\x0CGlossaryTerm\x12\x19\x0A\x0Cdisplay_name\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x18\x0A\x0Bdescription\x18\x02 \x01(\x09B\x03\xE0A\x02\x12\x13\x0A\x06labels\x18\x03 \x03(\x09B\x03\xE0A\x01\"\xCB\x02\x0A\x13ConversationOptions\x12K\x0A\x08analysis\x18\x02 \x01(\x0B24.google.cloud.geminidataanalytics.v1.AnalysisOptionsB\x03\xE0A\x01\x12O\x0A\x0Adatasource\x18\x03 \x01(\x0B26.google.cloud.geminidataanalytics.v1.DatasourceOptionsB\x03\xE0A\x01\x12W\x0A\x05model\x18\x06 \x01(\x0E2>.google.cloud.geminidataanalytics.v1.ConversationOptions.ModelB\x03\xE0A\x01H\x00\x88\x01\x01\"3\x0A\x05Model\x12\x15\x0A\x11MODEL_UNSPECIFIED\x10\x00\x12\x13\x0A\x0FLATEST_GA_MODEL\x10\x01B\x08\x0A\x06_model\"Y\x0A\x11DatasourceOptions\x12D\x0A\x1Abig_query_max_billed_bytes\x18\x01 \x01(\x0B2\x1B.google.protobuf.Int64ValueB\x03\xE0A\x01\"\x83\x01\x0A\x0FAnalysisOptions\x12P\x0A\x06python\x18\x01 \x01(\x0B2;.google.cloud.geminidataanalytics.v1.AnalysisOptions.PythonB\x03\xE0A\x01\x1A\x1E\x0A\x06Python\x12\x14\x0A\x07enabled\x18\x01 \x01(\x08B\x03\xE0A\x01\"\xA0\x01\x0A\x08Citation\x12I\x0A\x07sources\x18\x01 \x03(\x0B23.google.cloud.geminidataanalytics.v1.CitationSourceB\x03\xE0A\x03\x12I\x0A\x07anchors\x18\x02 \x03(\x0B23.google.cloud.geminidataanalytics.v1.CitationAnchorB\x03\xE0A\x03\"\xFA\x01\x0A\x0ECitationSource\x12\x12\x0A\x03uri\x18\x03 \x01(\x09B\x03\xE0A\x03H\x00\x12O\x0A\x0Dexample_query\x18\x04 \x01(\x0B21.google.cloud.geminidataanalytics.v1.ExampleQueryB\x03\xE0A\x03H\x00\x12O\x0A\x0Dglossary_term\x18\x05 \x01(\x0B21.google.cloud.geminidataanalytics.v1.GlossaryTermB\x03\xE0A\x03H\x00\x12\x0F\x0A\x02id\x18\x01 \x01(\x09B\x03\xE0A\x03\x12\x12\x0A\x05title\x18\x02 \x01(\x09B\x03\xE0A\x03B\x0D\x0A\x0Bsource_type\"\xA2\x02\x0A\x0ECitationAnchor\x12q\x0A\x13text_message_anchor\x18\x01 \x01(\x0B2M.google.cloud.geminidataanalytics.v1.CitationAnchor.TextMessageCitationAnchorB\x03\xE0A\x03H\x00\x1A\x8D\x01\x0A\x19TextMessageCitationAnchor\x12\x17\x0A\x0Apart_index\x18\x01 \x01(\x05B\x03\xE0A\x03\x12\x1F\x0A\x12start_offset_bytes\x18\x02 \x01(\x05B\x03\xE0A\x03\x12\x1D\x0A\x10end_offset_bytes\x18\x03 \x01(\x05B\x03\xE0A\x03\x12\x17\x0A\x0Asource_ids\x18\x04 \x03(\x09B\x03\xE0A\x03B\x0D\x0A\x0Banchor_typeB\x89\x02\x0A'com.google.cloud.geminidataanalytics.v1B\x0CContextProtoP\x01ZYcloud.google.com/go/geminidataanalytics/apiv1/geminidataanalyticspb;geminidataanalyticspb\xAA\x02#Google.Cloud.GeminiDataAnalytics.V1\xCA\x02#Google\\Cloud\\GeminiDataAnalytics\\V1\xEA\x02&Google::Cloud::GeminiDataAnalytics::V1b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/GeminiDataAnalytics/metadata/V1/Conversation.php b/GeminiDataAnalytics/metadata/V1/Conversation.php new file mode 100644 index 000000000000..c7884d60e600 --- /dev/null +++ b/GeminiDataAnalytics/metadata/V1/Conversation.php @@ -0,0 +1,28 @@ +internalAddGeneratedFile( + "\x0A\x90\x0F\x0A6google/cloud/geminidataanalytics/v1/conversation.proto\x12#google.cloud.geminidataanalytics.v1\x1A\x1Bgoogle/api/field_info.proto\x1A\x19google/api/resource.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\"\xC6\x04\x0A\x0CConversation\x12\x14\x0A\x04name\x18\x01 \x01(\x09B\x06\xE0A\x01\xE0A\x08\x12\x13\x0A\x06agents\x18\x02 \x03(\x09B\x03\xE0A\x02\x124\x0A\x0Bcreate_time\x18\x03 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x127\x0A\x0Elast_used_time\x18\x04 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x12R\x0A\x06labels\x18\x09 \x03(\x0B2=.google.cloud.geminidataanalytics.v1.Conversation.LabelsEntryB\x03\xE0A\x01\x12?\x0A\x07kms_key\x18\x0A \x01(\x09B)\xE0A\x01\xFAA#\x0A!cloudkms.googleapis.com/CryptoKeyH\x00\x88\x01\x01\x12\x1F\x0A\x0Dmemory_paused\x18\x0B \x01(\x08B\x03\xE0A\x01H\x01\x88\x01\x01\x1A-\x0A\x0BLabelsEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x12\x0D\x0A\x05value\x18\x02 \x01(\x09:\x028\x01:\x98\x01\xEAA\x94\x01\x0A/geminidataanalytics.googleapis.com/Conversation\x12Dprojects/{project}/locations/{location}/conversations/{conversation}*\x0Dconversations2\x0CconversationB\x0A\x0A\x08_kms_keyB\x10\x0A\x0E_memory_paused\"\xF1\x01\x0A\x19CreateConversationRequest\x12G\x0A\x06parent\x18\x01 \x01(\x09B7\xE0A\x02\xFAA1\x12/geminidataanalytics.googleapis.com/Conversation\x12\x1C\x0A\x0Fconversation_id\x18\x02 \x01(\x09B\x03\xE0A\x01\x12L\x0A\x0Cconversation\x18\x03 \x01(\x0B21.google.cloud.geminidataanalytics.v1.ConversationB\x03\xE0A\x02\x12\x1F\x0A\x0Arequest_id\x18\x04 \x01(\x09B\x0B\xE0A\x01\xE2\x8C\xCF\xD7\x08\x02\x08\x01\"_\x0A\x16GetConversationRequest\x12E\x0A\x04name\x18\x01 \x01(\x09B7\xE0A\x02\xFAA1\x0A/geminidataanalytics.googleapis.com/Conversation\"\xA9\x01\x0A\x18ListConversationsRequest\x12G\x0A\x06parent\x18\x01 \x01(\x09B7\xE0A\x02\xFAA1\x12/geminidataanalytics.googleapis.com/Conversation\x12\x16\x0A\x09page_size\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x17\x0A\x0Apage_token\x18\x03 \x01(\x09B\x03\xE0A\x01\x12\x13\x0A\x06filter\x18\x04 \x01(\x09B\x03\xE0A\x01\"~\x0A\x19ListConversationsResponse\x12H\x0A\x0Dconversations\x18\x01 \x03(\x0B21.google.cloud.geminidataanalytics.v1.Conversation\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\"b\x0A\x19DeleteConversationRequest\x12E\x0A\x04name\x18\x01 \x01(\x09B7\xE0A\x02\xFAA1\x0A/geminidataanalytics.googleapis.com/ConversationB\xA1\x03\x0A'com.google.cloud.geminidataanalytics.v1B\x11ConversationProtoP\x01ZYcloud.google.com/go/geminidataanalytics/apiv1/geminidataanalyticspb;geminidataanalyticspb\xAA\x02#Google.Cloud.GeminiDataAnalytics.V1\xCA\x02#Google\\Cloud\\GeminiDataAnalytics\\V1\xEA\x02&Google::Cloud::GeminiDataAnalytics::V1\xEAA\x8F\x01\x0A!cloudkms.googleapis.com/CryptoKey\x12Sprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}*\x0AcryptoKeys2\x09cryptoKeyb\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/GeminiDataAnalytics/metadata/V1/Credentials.php b/GeminiDataAnalytics/metadata/V1/Credentials.php new file mode 100644 index 000000000000..eb17d512fd0e --- /dev/null +++ b/GeminiDataAnalytics/metadata/V1/Credentials.php @@ -0,0 +1,25 @@ +internalAddGeneratedFile( + "\x0A\x84\x06\x0A5google/cloud/geminidataanalytics/v1/credentials.proto\x12#google.cloud.geminidataanalytics.v1\"]\x0A\x0BCredentials\x12F\x0A\x05oauth\x18\x01 \x01(\x0B25.google.cloud.geminidataanalytics.v1.OAuthCredentialsH\x00B\x06\x0A\x04kind\"\xAE\x02\x0A\x10OAuthCredentials\x12S\x0A\x06secret\x18\x02 \x01(\x0B2A.google.cloud.geminidataanalytics.v1.OAuthCredentials.SecretBasedH\x00\x12Q\x0A\x05token\x18\x03 \x01(\x0B2@.google.cloud.geminidataanalytics.v1.OAuthCredentials.TokenBasedH\x00\x1AA\x0A\x0BSecretBased\x12\x16\x0A\x09client_id\x18\x02 \x01(\x09B\x03\xE0A\x02\x12\x1A\x0A\x0Dclient_secret\x18\x03 \x01(\x09B\x03\xE0A\x02\x1A'\x0A\x0ATokenBased\x12\x19\x0A\x0Caccess_token\x18\x01 \x01(\x09B\x03\xE0A\x02B\x06\x0A\x04kindB\x8D\x02\x0A'com.google.cloud.geminidataanalytics.v1B\x10CredentialsProtoP\x01ZYcloud.google.com/go/geminidataanalytics/apiv1/geminidataanalyticspb;geminidataanalyticspb\xAA\x02#Google.Cloud.GeminiDataAnalytics.V1\xCA\x02#Google\\Cloud\\GeminiDataAnalytics\\V1\xEA\x02&Google::Cloud::GeminiDataAnalytics::V1b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/GeminiDataAnalytics/metadata/V1/DataAgent.php b/GeminiDataAnalytics/metadata/V1/DataAgent.php new file mode 100644 index 000000000000..da6a077cca8f --- /dev/null +++ b/GeminiDataAnalytics/metadata/V1/DataAgent.php @@ -0,0 +1,28 @@ +internalAddGeneratedFile( + "\x0A\xD8\x09\x0A4google/cloud/geminidataanalytics/v1/data_agent.proto\x12#google.cloud.geminidataanalytics.v1\x1A\x19google/api/resource.proto\x1A>google/cloud/geminidataanalytics/v1/data_analytics_agent.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\"\xE8\x05\x0A\x09DataAgent\x12W\x0A\x14data_analytics_agent\x18e \x01(\x0B27.google.cloud.geminidataanalytics.v1.DataAnalyticsAgentH\x00\x12\x14\x0A\x04name\x18\x01 \x01(\x09B\x06\xE0A\x01\xE0A\x08\x12\x19\x0A\x0Cdisplay_name\x18\x03 \x01(\x09B\x03\xE0A\x01\x12\x18\x0A\x0Bdescription\x18\x04 \x01(\x09B\x03\xE0A\x01\x12O\x0A\x06labels\x18\x05 \x03(\x0B2:.google.cloud.geminidataanalytics.v1.DataAgent.LabelsEntryB\x03\xE0A\x01\x124\x0A\x0Bcreate_time\x18\x07 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x124\x0A\x0Bupdate_time\x18\x08 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x124\x0A\x0Bdelete_time\x18\x0C \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x123\x0A\x0Apurge_time\x18\x0D \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x12?\x0A\x07kms_key\x18\x0E \x01(\x09B)\xE0A\x01\xFAA#\x0A!cloudkms.googleapis.com/CryptoKeyH\x01\x88\x01\x01\x1A-\x0A\x0BLabelsEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x12\x0D\x0A\x05value\x18\x02 \x01(\x09:\x028\x01:\x8A\x01\xEAA\x86\x01\x0A,geminidataanalytics.googleapis.com/DataAgent\x12?projects/{project}/locations/{location}/dataAgents/{data_agent}*\x0AdataAgents2\x09dataAgentB\x06\x0A\x04typeB\x0A\x0A\x08_kms_keyB\x8B\x02\x0A'com.google.cloud.geminidataanalytics.v1B\x0EDataAgentProtoP\x01ZYcloud.google.com/go/geminidataanalytics/apiv1/geminidataanalyticspb;geminidataanalyticspb\xAA\x02#Google.Cloud.GeminiDataAnalytics.V1\xCA\x02#Google\\Cloud\\GeminiDataAnalytics\\V1\xEA\x02&Google::Cloud::GeminiDataAnalytics::V1b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/GeminiDataAnalytics/metadata/V1/DataAgentService.php b/GeminiDataAnalytics/metadata/V1/DataAgentService.php new file mode 100644 index 000000000000..f392675a5827 --- /dev/null +++ b/GeminiDataAnalytics/metadata/V1/DataAgentService.php @@ -0,0 +1,36 @@ +internalAddGeneratedFile( + "\x0A\xCD'\x0AinternalAddGeneratedFile( + "\x0A\xBB\x05\x0A>google/cloud/geminidataanalytics/v1/data_analytics_agent.proto\x12#google.cloud.geminidataanalytics.v1\x1A1google/cloud/geminidataanalytics/v1/context.proto\"\x81\x02\x0A\x12DataAnalyticsAgent\x12J\x0A\x0Fstaging_context\x18\x05 \x01(\x0B2,.google.cloud.geminidataanalytics.v1.ContextB\x03\xE0A\x01\x12L\x0A\x11published_context\x18\x06 \x01(\x0B2,.google.cloud.geminidataanalytics.v1.ContextB\x03\xE0A\x01\x12Q\x0A\x16last_published_context\x18\x07 \x01(\x0B2,.google.cloud.geminidataanalytics.v1.ContextB\x03\xE0A\x03B\x94\x02\x0A'com.google.cloud.geminidataanalytics.v1B\x17DataAnalyticsAgentProtoP\x01ZYcloud.google.com/go/geminidataanalytics/apiv1/geminidataanalyticspb;geminidataanalyticspb\xAA\x02#Google.Cloud.GeminiDataAnalytics.V1\xCA\x02#Google\\Cloud\\GeminiDataAnalytics\\V1\xEA\x02&Google::Cloud::GeminiDataAnalytics::V1b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/GeminiDataAnalytics/metadata/V1/DataChatService.php b/GeminiDataAnalytics/metadata/V1/DataChatService.php new file mode 100644 index 000000000000..a066e4867182 --- /dev/null +++ b/GeminiDataAnalytics/metadata/V1/DataChatService.php @@ -0,0 +1,35 @@ +internalAddGeneratedFile( + "\x0A\x91<\x0A;google/cloud/geminidataanalytics/v1/data_chat_service.proto\x12#google.cloud.geminidataanalytics.v1\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\x1A1google/cloud/geminidataanalytics/v1/context.proto\x1A6google/cloud/geminidataanalytics/v1/conversation.proto\x1A5google/cloud/geminidataanalytics/v1/credentials.proto\x1A4google/cloud/geminidataanalytics/v1/datasource.proto\x1A\x1Bgoogle/protobuf/empty.proto\x1A\x1Cgoogle/protobuf/struct.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\"\xA4\x01\x0A\x13ListMessagesRequest\x12G\x0A\x06parent\x18\x01 \x01(\x09B7\xE0A\x02\xFAA1\x0A/geminidataanalytics.googleapis.com/Conversation\x12\x16\x0A\x09page_size\x18\x03 \x01(\x05B\x03\xE0A\x01\x12\x17\x0A\x0Apage_token\x18\x04 \x01(\x09B\x03\xE0A\x01\x12\x13\x0A\x06filter\x18\x05 \x01(\x09B\x03\xE0A\x01\"v\x0A\x14ListMessagesResponse\x12E\x0A\x08messages\x18\x01 \x03(\x0B23.google.cloud.geminidataanalytics.v1.StorageMessage\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\"c\x0A\x0EStorageMessage\x12\x12\x0A\x0Amessage_id\x18\x01 \x01(\x09\x12=\x0A\x07message\x18\x02 \x01(\x0B2,.google.cloud.geminidataanalytics.v1.Message\"\xD3\x07\x0A\x0BChatRequest\x12K\x0A\x0Einline_context\x18e \x01(\x0B2,.google.cloud.geminidataanalytics.v1.ContextB\x03\xE0A\x01H\x00\x12a\x0A\x16conversation_reference\x18g \x01(\x0B2:.google.cloud.geminidataanalytics.v1.ConversationReferenceB\x03\xE0A\x01H\x00\x12X\x0A\x12data_agent_context\x18h \x01(\x0B25.google.cloud.geminidataanalytics.v1.DataAgentContextB\x03\xE0A\x01H\x00\x12q\x0A\x1Fclient_managed_resource_context\x18i \x01(\x0B2A.google.cloud.geminidataanalytics.v1.ClientManagedResourceContextB\x03\xE0A\x01H\x00\x12S\x0A\x0Flooker_settings\x18\x0D \x01(\x0B23.google.cloud.geminidataanalytics.v1.LookerSettingsB\x03\xE0A\x01H\x01\x12\x13\x0A\x06parent\x18\x03 \x01(\x09B\x03\xE0A\x02\x12C\x0A\x08messages\x18\x02 \x03(\x0B2,.google.cloud.geminidataanalytics.v1.MessageB\x03\xE0A\x02\x12J\x0A\x0Bcredentials\x18\x07 \x01(\x0B20.google.cloud.geminidataanalytics.v1.CredentialsB\x03\xE0A\x01\x12Y\x0A\x0Dthinking_mode\x18\x09 \x01(\x0E2=.google.cloud.geminidataanalytics.v1.ChatRequest.ThinkingModeB\x03\xE0A\x01\x12J\x0A\x05model\x18\x0B \x01(\x0E26.google.cloud.geminidataanalytics.v1.ChatRequest.ModelB\x03\xE0A\x01\"E\x0A\x0CThinkingMode\x12\x1D\x0A\x19THINKING_MODE_UNSPECIFIED\x10\x00\x12\x08\x0A\x04FAST\x10\x01\x12\x0C\x0A\x08THINKING\x10\x02\"3\x0A\x05Model\x12\x15\x0A\x11MODEL_UNSPECIFIED\x10\x00\x12\x13\x0A\x0FLATEST_GA_MODEL\x10\x01B\x12\x0A\x10context_providerB\x15\x0A\x13datasource_settings\"\x8F\x02\x0A\x10DataAgentContext\x12H\x0A\x0Adata_agent\x18\x01 \x01(\x09B4\xE0A\x02\xFAA.\x0A,geminidataanalytics.googleapis.com/DataAgent\x12b\x0A\x0Fcontext_version\x18\x03 \x01(\x0E2D.google.cloud.geminidataanalytics.v1.DataAgentContext.ContextVersionB\x03\xE0A\x01\"M\x0A\x0EContextVersion\x12\x1F\x0A\x1BCONTEXT_VERSION_UNSPECIFIED\x10\x00\x12\x0B\x0A\x07STAGING\x10\x01\x12\x0D\x0A\x09PUBLISHED\x10\x02\"\xBE\x01\x0A\x15ConversationReference\x12M\x0A\x0Cconversation\x18\x01 \x01(\x09B7\xE0A\x02\xFAA1\x0A/geminidataanalytics.googleapis.com/Conversation\x12V\x0A\x12data_agent_context\x18\x03 \x01(\x0B25.google.cloud.geminidataanalytics.v1.DataAgentContextB\x03\xE0A\x02\"\x9E\x01\x0A\x1CClientManagedResourceContext\x12I\x0A\x0Einline_context\x18\x01 \x01(\x0B2,.google.cloud.geminidataanalytics.v1.ContextB\x03\xE0A\x02\x12\x1C\x0A\x0Fconversation_id\x18\x02 \x01(\x09B\x03\xE0A\x01\x12\x15\x0A\x08agent_id\x18\x03 \x01(\x09B\x03\xE0A\x01\"\xF6\x01\x0A\x07Message\x12H\x0A\x0Cuser_message\x18\x02 \x01(\x0B20.google.cloud.geminidataanalytics.v1.UserMessageH\x00\x12L\x0A\x0Esystem_message\x18\x03 \x01(\x0B22.google.cloud.geminidataanalytics.v1.SystemMessageH\x00\x122\x0A\x09timestamp\x18\x01 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x12\x17\x0A\x0Amessage_id\x18\x04 \x01(\x09B\x03\xE0A\x01B\x06\x0A\x04kind\".\x0A\x0ELookerSettings\x12\x1C\x0A\x0Fenable_dev_mode\x18\x01 \x01(\x08B\x03\xE0A\x01\"%\x0A\x0BUserMessage\x12\x0E\x0A\x04text\x18\x01 \x01(\x09H\x00B\x06\x0A\x04kind\"\xF2\x04\x0A\x0DSystemMessage\x12@\x0A\x04text\x18\x01 \x01(\x0B20.google.cloud.geminidataanalytics.v1.TextMessageH\x00\x12D\x0A\x06schema\x18\x02 \x01(\x0B22.google.cloud.geminidataanalytics.v1.SchemaMessageH\x00\x12@\x0A\x04data\x18\x03 \x01(\x0B20.google.cloud.geminidataanalytics.v1.DataMessageH\x00\x12H\x0A\x08analysis\x18\x04 \x01(\x0B24.google.cloud.geminidataanalytics.v1.AnalysisMessageH\x00\x12B\x0A\x05chart\x18\x05 \x01(\x0B21.google.cloud.geminidataanalytics.v1.ChartMessageH\x00\x12B\x0A\x05error\x18\x06 \x01(\x0B21.google.cloud.geminidataanalytics.v1.ErrorMessageH\x00\x12S\x0A\x0Fexample_queries\x18\x0D \x01(\x0B23.google.cloud.geminidataanalytics.v1.ExampleQueriesB\x03\xE0A\x01H\x00\x12\x15\x0A\x08group_id\x18\x0C \x01(\x05H\x01\x88\x01\x01\x12D\x0A\x08citation\x18\x0F \x01(\x0B2-.google.cloud.geminidataanalytics.v1.CitationB\x03\xE0A\x03B\x06\x0A\x04kindB\x0B\x0A\x09_group_id\"\x82\x02\x0A\x0BTextMessage\x12\x12\x0A\x05parts\x18\x01 \x03(\x09B\x03\xE0A\x01\x12Q\x0A\x09text_type\x18\x02 \x01(\x0E29.google.cloud.geminidataanalytics.v1.TextMessage.TextTypeB\x03\xE0A\x01\x12\x1E\x0A\x11thought_signature\x18\x03 \x01(\x0CB\x03\xE0A\x01\"l\x0A\x08TextType\x12\x19\x0A\x15TEXT_TYPE_UNSPECIFIED\x10\x00\x12\x12\x0A\x0EFINAL_RESPONSE\x10\x01\x12\x0B\x0A\x07THOUGHT\x10\x02\x12\x0C\x0A\x08PROGRESS\x10\x03\x12\x16\x0A\x12FOLLOWUP_QUESTIONS\x10\x04\"\x9F\x01\x0A\x0DSchemaMessage\x12A\x0A\x05query\x18\x01 \x01(\x0B20.google.cloud.geminidataanalytics.v1.SchemaQueryH\x00\x12C\x0A\x06result\x18\x02 \x01(\x0B21.google.cloud.geminidataanalytics.v1.SchemaResultH\x00B\x06\x0A\x04kind\"\$\x0A\x0BSchemaQuery\x12\x15\x0A\x08question\x18\x01 \x01(\x09B\x03\xE0A\x01\"Y\x0A\x0CSchemaResult\x12I\x0A\x0Bdatasources\x18\x01 \x03(\x0B2/.google.cloud.geminidataanalytics.v1.DatasourceB\x03\xE0A\x01\"\xC9\x02\x0A\x0BDataMessage\x12?\x0A\x05query\x18\x01 \x01(\x0B2..google.cloud.geminidataanalytics.v1.DataQueryH\x00\x12\x17\x0A\x0Dgenerated_sql\x18\x02 \x01(\x09H\x00\x12A\x0A\x06result\x18\x03 \x01(\x0B2/.google.cloud.geminidataanalytics.v1.DataResultH\x00\x12I\x0A\x0Dbig_query_job\x18\x05 \x01(\x0B20.google.cloud.geminidataanalytics.v1.BigQueryJobH\x00\x12J\x0A\x0Dmatched_query\x18\x06 \x01(\x0B21.google.cloud.geminidataanalytics.v1.MatchedQueryH\x00B\x06\x0A\x04kind\"\xD7\x01\x0A\x09DataQuery\x12G\x0A\x06looker\x18\x04 \x01(\x0B20.google.cloud.geminidataanalytics.v1.LookerQueryB\x03\xE0A\x01H\x00\x12\x15\x0A\x08question\x18\x01 \x01(\x09B\x03\xE0A\x01\x12\x11\x0A\x04name\x18\x03 \x01(\x09B\x03\xE0A\x01\x12I\x0A\x0Bdatasources\x18\x02 \x03(\x0B2/.google.cloud.geminidataanalytics.v1.DatasourceB\x03\xE0A\x01B\x0C\x0A\x0Aquery_type\"\xC3\x01\x0A\x0ADataResult\x12\x11\x0A\x04name\x18\x03 \x01(\x09B\x03\xE0A\x01\x12@\x0A\x06schema\x18\x05 \x01(\x0B2+.google.cloud.geminidataanalytics.v1.SchemaB\x03\xE0A\x01\x12*\x0A\x04data\x18\x02 \x03(\x0B2\x17.google.protobuf.StructB\x03\xE0A\x01\x124\x0A\x0Eformatted_data\x18\x06 \x03(\x0B2\x17.google.protobuf.StructB\x03\xE0A\x01\"\xF1\x01\x0A\x0BBigQueryJob\x12\x17\x0A\x0Aproject_id\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x13\x0A\x06job_id\x18\x02 \x01(\x09B\x03\xE0A\x02\x12\x15\x0A\x08location\x18\x05 \x01(\x09B\x03\xE0A\x01\x12[\x0A\x11destination_table\x18\x03 \x01(\x0B2;.google.cloud.geminidataanalytics.v1.BigQueryTableReferenceB\x03\xE0A\x01\x12@\x0A\x06schema\x18\x07 \x01(\x0B2+.google.cloud.geminidataanalytics.v1.SchemaB\x03\xE0A\x01\"\xAC\x01\x0A\x0FAnalysisMessage\x12C\x0A\x05query\x18\x01 \x01(\x0B22.google.cloud.geminidataanalytics.v1.AnalysisQueryH\x00\x12L\x0A\x0Eprogress_event\x18\x02 \x01(\x0B22.google.cloud.geminidataanalytics.v1.AnalysisEventH\x00B\x06\x0A\x04kind\"F\x0A\x0DAnalysisQuery\x12\x15\x0A\x08question\x18\x01 \x01(\x09B\x03\xE0A\x01\x12\x1E\x0A\x11data_result_names\x18\x02 \x03(\x09B\x03\xE0A\x01\"\xAA\x02\x0A\x0DAnalysisEvent\x12\x1B\x0A\x11planner_reasoning\x18\x02 \x01(\x09H\x00\x12\x1B\x0A\x11coder_instruction\x18\x03 \x01(\x09H\x00\x12\x0E\x0A\x04code\x18\x04 \x01(\x09H\x00\x12\x1A\x0A\x10execution_output\x18\x05 \x01(\x09H\x00\x12\x19\x0A\x0Fexecution_error\x18\x06 \x01(\x09H\x00\x12 \x0A\x16result_vega_chart_json\x18\x07 \x01(\x09H\x00\x12!\x0A\x17result_natural_language\x18\x08 \x01(\x09H\x00\x12\x19\x0A\x0Fresult_csv_data\x18\x09 \x01(\x09H\x00\x12\x1F\x0A\x15result_reference_data\x18\x0A \x01(\x09H\x00\x12\x0F\x0A\x05error\x18\x0B \x01(\x09H\x00B\x06\x0A\x04kind\"\x9C\x01\x0A\x0CChartMessage\x12@\x0A\x05query\x18\x01 \x01(\x0B2/.google.cloud.geminidataanalytics.v1.ChartQueryH\x00\x12B\x0A\x06result\x18\x02 \x01(\x0B20.google.cloud.geminidataanalytics.v1.ChartResultH\x00B\x06\x0A\x04kind\"F\x0A\x0AChartQuery\x12\x19\x0A\x0Cinstructions\x18\x01 \x01(\x09B\x03\xE0A\x01\x12\x1D\x0A\x10data_result_name\x18\x02 \x01(\x09B\x03\xE0A\x01\"\x7F\x0A\x0BChartResult\x121\x0A\x0Bvega_config\x18\x02 \x01(\x0B2\x17.google.protobuf.StructB\x03\xE0A\x01\x12=\x0A\x05image\x18\x03 \x01(\x0B2).google.cloud.geminidataanalytics.v1.BlobB\x03\xE0A\x01\"!\x0A\x0CErrorMessage\x12\x11\x0A\x04text\x18\x01 \x01(\x09B\x03\xE0A\x03\"a\x0A\x0EExampleQueries\x12O\x0A\x0Fexample_queries\x18\x01 \x03(\x0B21.google.cloud.geminidataanalytics.v1.ExampleQueryB\x03\xE0A\x01\"1\x0A\x04Blob\x12\x16\x0A\x09mime_type\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x11\x0A\x04data\x18\x02 \x01(\x0CB\x03\xE0A\x022\xA7\x0A\x0A\x0FDataChatService\x12\x9D\x01\x0A\x04Chat\x120.google.cloud.geminidataanalytics.v1.ChatRequest\x1A,.google.cloud.geminidataanalytics.v1.Message\"3\x82\xD3\xE4\x93\x02-\"(/v1/{parent=projects/*/locations/*}:chat:\x01*0\x01\x12\xF6\x01\x0A\x12CreateConversation\x12>.google.cloud.geminidataanalytics.v1.CreateConversationRequest\x1A1.google.cloud.geminidataanalytics.v1.Conversation\"m\xDAA#parent,conversation,conversation_id\x82\xD3\xE4\x93\x02A\"1/v1/{parent=projects/*/locations/*}/conversations:\x0Cconversation\x12\xAE\x01\x0A\x12DeleteConversation\x12>.google.cloud.geminidataanalytics.v1.DeleteConversationRequest\x1A\x16.google.protobuf.Empty\"@\xDAA\x04name\x82\xD3\xE4\x93\x023*1/v1/{name=projects/*/locations/*/conversations/*}\x12\xC3\x01\x0A\x0FGetConversation\x12;.google.cloud.geminidataanalytics.v1.GetConversationRequest\x1A1.google.cloud.geminidataanalytics.v1.Conversation\"@\xDAA\x04name\x82\xD3\xE4\x93\x023\x121/v1/{name=projects/*/locations/*/conversations/*}\x12\xD6\x01\x0A\x11ListConversations\x12=.google.cloud.geminidataanalytics.v1.ListConversationsRequest\x1A>.google.cloud.geminidataanalytics.v1.ListConversationsResponse\"B\xDAA\x06parent\x82\xD3\xE4\x93\x023\x121/v1/{parent=projects/*/locations/*}/conversations\x12\xD2\x01\x0A\x0CListMessages\x128.google.cloud.geminidataanalytics.v1.ListMessagesRequest\x1A9.google.cloud.geminidataanalytics.v1.ListMessagesResponse\"M\xDAA\x06parent\x82\xD3\xE4\x93\x02>\x12internalAddGeneratedFile( + "\x0A\x97\x17\x0A4google/cloud/geminidataanalytics/v1/datasource.proto\x12#google.cloud.geminidataanalytics.v1\x1A\x1Cgoogle/protobuf/struct.proto\"\x93\x02\x0A\x14DatasourceReferences\x12J\x0A\x02bq\x18\x01 \x01(\x0B2<.google.cloud.geminidataanalytics.v1.BigQueryTableReferencesH\x00\x12Q\x0A\x06studio\x18\x02 \x01(\x0B2?.google.cloud.geminidataanalytics.v1.StudioDatasourceReferencesH\x00\x12N\x0A\x06looker\x18\x03 \x01(\x0B2<.google.cloud.geminidataanalytics.v1.LookerExploreReferencesH\x00B\x0C\x0A\x0Areferences\"u\x0A\x17BigQueryTableReferences\x12Z\x0A\x10table_references\x18\x01 \x03(\x0B2;.google.cloud.geminidataanalytics.v1.BigQueryTableReferenceB\x03\xE0A\x01\"\xA3\x01\x0A\x16BigQueryTableReference\x12\x17\x0A\x0Aproject_id\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x17\x0A\x0Adataset_id\x18\x03 \x01(\x09B\x03\xE0A\x02\x12\x15\x0A\x08table_id\x18\x04 \x01(\x09B\x03\xE0A\x02\x12@\x0A\x06schema\x18\x06 \x01(\x0B2+.google.cloud.geminidataanalytics.v1.SchemaB\x03\xE0A\x01\"|\x0A\x1AStudioDatasourceReferences\x12^\x0A\x11studio_references\x18\x02 \x03(\x0B2>.google.cloud.geminidataanalytics.v1.StudioDatasourceReferenceB\x03\xE0A\x01\"7\x0A\x19StudioDatasourceReference\x12\x1A\x0A\x0Ddatasource_id\x18\x01 \x01(\x09B\x03\xE0A\x02\"w\x0A\x17LookerExploreReferences\x12\\\x0A\x12explore_references\x18\x01 \x03(\x0B2;.google.cloud.geminidataanalytics.v1.LookerExploreReferenceB\x03\xE0A\x02\"\x9E\x02\x0A\x16LookerExploreReference\x12\x1D\x0A\x13looker_instance_uri\x18\x09 \x01(\x09H\x00\x12f\x0A\x1Cprivate_looker_instance_info\x18\x0A \x01(\x0B2>.google.cloud.geminidataanalytics.v1.PrivateLookerInstanceInfoH\x00\x12\x19\x0A\x0Clookml_model\x18\x04 \x01(\x09B\x03\xE0A\x02\x12\x14\x0A\x07explore\x18\x05 \x01(\x09B\x03\xE0A\x02\x12@\x0A\x06schema\x18\x08 \x01(\x0B2+.google.cloud.geminidataanalytics.v1.SchemaB\x03\xE0A\x01B\x0A\x0A\x08instance\"r\x0A\x1EBigQueryPropertyGraphReference\x12\x17\x0A\x0Aproject_id\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x17\x0A\x0Adataset_id\x18\x02 \x01(\x09B\x03\xE0A\x02\x12\x1E\x0A\x11property_graph_id\x18\x03 \x01(\x09B\x03\xE0A\x02\"W\x0A\x19PrivateLookerInstanceInfo\x12\x1A\x0A\x12looker_instance_id\x18\x01 \x01(\x09\x12\x1E\x0A\x16service_directory_name\x18\x02 \x01(\x09\"\xE4\x03\x0A\x0ADatasource\x12_\x0A\x18bigquery_table_reference\x18\x01 \x01(\x0B2;.google.cloud.geminidataanalytics.v1.BigQueryTableReferenceH\x00\x12\x1E\x0A\x14studio_datasource_id\x18\x02 \x01(\x09H\x00\x12_\x0A\x18looker_explore_reference\x18\x04 \x01(\x0B2;.google.cloud.geminidataanalytics.v1.LookerExploreReferenceH\x00\x12p\x0A!bigquery_property_graph_reference\x18\x10 \x01(\x0B2C.google.cloud.geminidataanalytics.v1.BigQueryPropertyGraphReferenceH\x00\x12@\x0A\x06schema\x18\x07 \x01(\x0B2+.google.cloud.geminidataanalytics.v1.SchemaB\x03\xE0A\x01\x123\x0A\x0Dstruct_schema\x18\x0A \x01(\x0B2\x17.google.protobuf.StructB\x03\xE0A\x01B\x0B\x0A\x09reference\"\xEF\x01\x0A\x06Schema\x12?\x0A\x06fields\x18\x01 \x03(\x0B2*.google.cloud.geminidataanalytics.v1.FieldB\x03\xE0A\x01\x12\x18\x0A\x0Bdescription\x18\x02 \x01(\x09B\x03\xE0A\x01\x12\x15\x0A\x08synonyms\x18\x03 \x03(\x09B\x03\xE0A\x01\x12\x11\x0A\x04tags\x18\x04 \x03(\x09B\x03\xE0A\x01\x12\x19\x0A\x0Cdisplay_name\x18\x05 \x01(\x09B\x03\xE0A\x01\x12E\x0A\x07filters\x18\x06 \x03(\x0B2/.google.cloud.geminidataanalytics.v1.DataFilterB\x03\xE0A\x01\"\x95\x02\x0A\x05Field\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x01\x12\x11\x0A\x04type\x18\x02 \x01(\x09B\x03\xE0A\x01\x12\x18\x0A\x0Bdescription\x18\x03 \x01(\x09B\x03\xE0A\x01\x12\x11\x0A\x04mode\x18\x04 \x01(\x09B\x03\xE0A\x01\x12\x15\x0A\x08synonyms\x18\x06 \x03(\x09B\x03\xE0A\x01\x12\x11\x0A\x04tags\x18\x07 \x03(\x09B\x03\xE0A\x01\x12\x19\x0A\x0Cdisplay_name\x18\x08 \x01(\x09B\x03\xE0A\x01\x12B\x0A\x09subfields\x18\x09 \x03(\x0B2*.google.cloud.geminidataanalytics.v1.FieldB\x03\xE0A\x01\x12\x15\x0A\x08category\x18\x0A \x01(\x09B\x03\xE0A\x01\x12\x19\x0A\x0Cvalue_format\x18\x0B \x01(\x09B\x03\xE0A\x01\"|\x0A\x0ADataFilter\x12\x12\x0A\x05field\x18\x01 \x01(\x09B\x03\xE0A\x01\x12\x12\x0A\x05value\x18\x02 \x01(\x09B\x03\xE0A\x01\x12F\x0A\x04type\x18\x03 \x01(\x0E23.google.cloud.geminidataanalytics.v1.DataFilterTypeB\x03\xE0A\x01*E\x0A\x0EDataFilterType\x12 \x0A\x1CDATA_FILTER_TYPE_UNSPECIFIED\x10\x00\x12\x11\x0A\x0DALWAYS_FILTER\x10\x01B\x8C\x02\x0A'com.google.cloud.geminidataanalytics.v1B\x0FDatasourceProtoP\x01ZYcloud.google.com/go/geminidataanalytics/apiv1/geminidataanalyticspb;geminidataanalyticspb\xAA\x02#Google.Cloud.GeminiDataAnalytics.V1\xCA\x02#Google\\Cloud\\GeminiDataAnalytics\\V1\xEA\x02&Google::Cloud::GeminiDataAnalytics::V1b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/GeminiDataAnalytics/samples/V1/DataAgentServiceClient/create_data_agent.php b/GeminiDataAnalytics/samples/V1/DataAgentServiceClient/create_data_agent.php new file mode 100644 index 000000000000..1be761c85045 --- /dev/null +++ b/GeminiDataAnalytics/samples/V1/DataAgentServiceClient/create_data_agent.php @@ -0,0 +1,85 @@ +setParent($formattedParent) + ->setDataAgent($dataAgent); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $dataAgentServiceClient->createDataAgent($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var DataAgent $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 = DataAgentServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + create_data_agent_sample($formattedParent); +} +// [END geminidataanalytics_v1_generated_DataAgentService_CreateDataAgent_sync] diff --git a/GeminiDataAnalytics/samples/V1/DataAgentServiceClient/create_data_agent_sync.php b/GeminiDataAnalytics/samples/V1/DataAgentServiceClient/create_data_agent_sync.php new file mode 100644 index 000000000000..667964b7bfd8 --- /dev/null +++ b/GeminiDataAnalytics/samples/V1/DataAgentServiceClient/create_data_agent_sync.php @@ -0,0 +1,73 @@ +setParent($formattedParent) + ->setDataAgent($dataAgent); + + // Call the API and handle any network failures. + try { + /** @var DataAgent $response */ + $response = $dataAgentServiceClient->createDataAgentSync($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 = DataAgentServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + create_data_agent_sync_sample($formattedParent); +} +// [END geminidataanalytics_v1_generated_DataAgentService_CreateDataAgentSync_sync] diff --git a/GeminiDataAnalytics/samples/V1/DataAgentServiceClient/delete_data_agent.php b/GeminiDataAnalytics/samples/V1/DataAgentServiceClient/delete_data_agent.php new file mode 100644 index 000000000000..1c069b0c45ad --- /dev/null +++ b/GeminiDataAnalytics/samples/V1/DataAgentServiceClient/delete_data_agent.php @@ -0,0 +1,80 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $dataAgentServiceClient->deleteDataAgent($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 = DataAgentServiceClient::dataAgentName('[PROJECT]', '[LOCATION]', '[DATA_AGENT]'); + + delete_data_agent_sample($formattedName); +} +// [END geminidataanalytics_v1_generated_DataAgentService_DeleteDataAgent_sync] diff --git a/GeminiDataAnalytics/samples/V1/DataAgentServiceClient/delete_data_agent_sync.php b/GeminiDataAnalytics/samples/V1/DataAgentServiceClient/delete_data_agent_sync.php new file mode 100644 index 000000000000..48c13a051674 --- /dev/null +++ b/GeminiDataAnalytics/samples/V1/DataAgentServiceClient/delete_data_agent_sync.php @@ -0,0 +1,69 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $dataAgentServiceClient->deleteDataAgentSync($request); + printf('Call completed successfully.' . PHP_EOL); + } 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 = DataAgentServiceClient::dataAgentName('[PROJECT]', '[LOCATION]', '[DATA_AGENT]'); + + delete_data_agent_sync_sample($formattedName); +} +// [END geminidataanalytics_v1_generated_DataAgentService_DeleteDataAgentSync_sync] diff --git a/GeminiDataAnalytics/samples/V1/DataAgentServiceClient/get_data_agent.php b/GeminiDataAnalytics/samples/V1/DataAgentServiceClient/get_data_agent.php new file mode 100644 index 000000000000..9f7d6824c304 --- /dev/null +++ b/GeminiDataAnalytics/samples/V1/DataAgentServiceClient/get_data_agent.php @@ -0,0 +1,71 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var DataAgent $response */ + $response = $dataAgentServiceClient->getDataAgent($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 = DataAgentServiceClient::dataAgentName('[PROJECT]', '[LOCATION]', '[DATA_AGENT]'); + + get_data_agent_sample($formattedName); +} +// [END geminidataanalytics_v1_generated_DataAgentService_GetDataAgent_sync] diff --git a/GeminiDataAnalytics/samples/V1/DataAgentServiceClient/get_iam_policy.php b/GeminiDataAnalytics/samples/V1/DataAgentServiceClient/get_iam_policy.php new file mode 100644 index 000000000000..fad4ab3f556e --- /dev/null +++ b/GeminiDataAnalytics/samples/V1/DataAgentServiceClient/get_iam_policy.php @@ -0,0 +1,71 @@ +setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $dataAgentServiceClient->getIamPolicy($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 +{ + $resource = '[RESOURCE]'; + + get_iam_policy_sample($resource); +} +// [END geminidataanalytics_v1_generated_DataAgentService_GetIamPolicy_sync] diff --git a/GeminiDataAnalytics/samples/V1/DataAgentServiceClient/get_location.php b/GeminiDataAnalytics/samples/V1/DataAgentServiceClient/get_location.php new file mode 100644 index 000000000000..0b13e0295afe --- /dev/null +++ b/GeminiDataAnalytics/samples/V1/DataAgentServiceClient/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 geminidataanalytics_v1_generated_DataAgentService_GetLocation_sync] diff --git a/GeminiDataAnalytics/samples/V1/DataAgentServiceClient/list_accessible_data_agents.php b/GeminiDataAnalytics/samples/V1/DataAgentServiceClient/list_accessible_data_agents.php new file mode 100644 index 000000000000..f5ac3bf81886 --- /dev/null +++ b/GeminiDataAnalytics/samples/V1/DataAgentServiceClient/list_accessible_data_agents.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $dataAgentServiceClient->listAccessibleDataAgents($request); + + /** @var DataAgent $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 = DataAgentServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + list_accessible_data_agents_sample($formattedParent); +} +// [END geminidataanalytics_v1_generated_DataAgentService_ListAccessibleDataAgents_sync] diff --git a/GeminiDataAnalytics/samples/V1/DataAgentServiceClient/list_data_agents.php b/GeminiDataAnalytics/samples/V1/DataAgentServiceClient/list_data_agents.php new file mode 100644 index 000000000000..34bea8be06b4 --- /dev/null +++ b/GeminiDataAnalytics/samples/V1/DataAgentServiceClient/list_data_agents.php @@ -0,0 +1,76 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $dataAgentServiceClient->listDataAgents($request); + + /** @var DataAgent $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 = DataAgentServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + list_data_agents_sample($formattedParent); +} +// [END geminidataanalytics_v1_generated_DataAgentService_ListDataAgents_sync] diff --git a/GeminiDataAnalytics/samples/V1/DataAgentServiceClient/list_locations.php b/GeminiDataAnalytics/samples/V1/DataAgentServiceClient/list_locations.php new file mode 100644 index 000000000000..ab795cc141ae --- /dev/null +++ b/GeminiDataAnalytics/samples/V1/DataAgentServiceClient/list_locations.php @@ -0,0 +1,77 @@ +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 geminidataanalytics_v1_generated_DataAgentService_ListLocations_sync] diff --git a/GeminiDataAnalytics/samples/V1/DataAgentServiceClient/set_iam_policy.php b/GeminiDataAnalytics/samples/V1/DataAgentServiceClient/set_iam_policy.php new file mode 100644 index 000000000000..28e848bc4bdc --- /dev/null +++ b/GeminiDataAnalytics/samples/V1/DataAgentServiceClient/set_iam_policy.php @@ -0,0 +1,73 @@ +setResource($resource) + ->setPolicy($policy); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $dataAgentServiceClient->setIamPolicy($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 +{ + $resource = '[RESOURCE]'; + + set_iam_policy_sample($resource); +} +// [END geminidataanalytics_v1_generated_DataAgentService_SetIamPolicy_sync] diff --git a/GeminiDataAnalytics/samples/V1/DataAgentServiceClient/update_data_agent.php b/GeminiDataAnalytics/samples/V1/DataAgentServiceClient/update_data_agent.php new file mode 100644 index 000000000000..49f3c8cae89f --- /dev/null +++ b/GeminiDataAnalytics/samples/V1/DataAgentServiceClient/update_data_agent.php @@ -0,0 +1,71 @@ +setDataAgent($dataAgent); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $dataAgentServiceClient->updateDataAgent($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var DataAgent $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 geminidataanalytics_v1_generated_DataAgentService_UpdateDataAgent_sync] diff --git a/GeminiDataAnalytics/samples/V1/DataAgentServiceClient/update_data_agent_sync.php b/GeminiDataAnalytics/samples/V1/DataAgentServiceClient/update_data_agent_sync.php new file mode 100644 index 000000000000..4cdeec99ef50 --- /dev/null +++ b/GeminiDataAnalytics/samples/V1/DataAgentServiceClient/update_data_agent_sync.php @@ -0,0 +1,59 @@ +setDataAgent($dataAgent); + + // Call the API and handle any network failures. + try { + /** @var DataAgent $response */ + $response = $dataAgentServiceClient->updateDataAgentSync($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END geminidataanalytics_v1_generated_DataAgentService_UpdateDataAgentSync_sync] diff --git a/GeminiDataAnalytics/samples/V1/DataChatServiceClient/chat.php b/GeminiDataAnalytics/samples/V1/DataChatServiceClient/chat.php new file mode 100644 index 000000000000..ad9b5100b22a --- /dev/null +++ b/GeminiDataAnalytics/samples/V1/DataChatServiceClient/chat.php @@ -0,0 +1,79 @@ +setParent($parent) + ->setMessages($messages); + + // Call the API and handle any network failures. + try { + /** @var ServerStream $stream */ + $stream = $dataChatServiceClient->chat($request); + + /** @var Message $element */ + foreach ($stream->readAll() 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]'; + + chat_sample($parent); +} +// [END geminidataanalytics_v1_generated_DataChatService_Chat_sync] diff --git a/GeminiDataAnalytics/samples/V1/DataChatServiceClient/create_conversation.php b/GeminiDataAnalytics/samples/V1/DataChatServiceClient/create_conversation.php new file mode 100644 index 000000000000..93ebefea767e --- /dev/null +++ b/GeminiDataAnalytics/samples/V1/DataChatServiceClient/create_conversation.php @@ -0,0 +1,84 @@ +setAgents($conversationAgents); + $request = (new CreateConversationRequest()) + ->setParent($formattedParent) + ->setConversation($conversation); + + // Call the API and handle any network failures. + try { + /** @var Conversation $response */ + $response = $dataChatServiceClient->createConversation($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 = DataChatServiceClient::locationName('[PROJECT]', '[LOCATION]'); + $conversationAgentsElement = '[AGENTS]'; + + create_conversation_sample($formattedParent, $conversationAgentsElement); +} +// [END geminidataanalytics_v1_generated_DataChatService_CreateConversation_sync] diff --git a/GeminiDataAnalytics/samples/V1/DataChatServiceClient/delete_conversation.php b/GeminiDataAnalytics/samples/V1/DataChatServiceClient/delete_conversation.php new file mode 100644 index 000000000000..e32070e846c5 --- /dev/null +++ b/GeminiDataAnalytics/samples/V1/DataChatServiceClient/delete_conversation.php @@ -0,0 +1,75 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $dataChatServiceClient->deleteConversation($request); + printf('Call completed successfully.' . PHP_EOL); + } 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 = DataChatServiceClient::conversationName( + '[PROJECT]', + '[LOCATION]', + '[CONVERSATION]' + ); + + delete_conversation_sample($formattedName); +} +// [END geminidataanalytics_v1_generated_DataChatService_DeleteConversation_sync] diff --git a/GeminiDataAnalytics/samples/V1/DataChatServiceClient/get_conversation.php b/GeminiDataAnalytics/samples/V1/DataChatServiceClient/get_conversation.php new file mode 100644 index 000000000000..ea90369999bd --- /dev/null +++ b/GeminiDataAnalytics/samples/V1/DataChatServiceClient/get_conversation.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Conversation $response */ + $response = $dataChatServiceClient->getConversation($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 = DataChatServiceClient::conversationName( + '[PROJECT]', + '[LOCATION]', + '[CONVERSATION]' + ); + + get_conversation_sample($formattedName); +} +// [END geminidataanalytics_v1_generated_DataChatService_GetConversation_sync] diff --git a/GeminiDataAnalytics/samples/V1/DataChatServiceClient/get_location.php b/GeminiDataAnalytics/samples/V1/DataChatServiceClient/get_location.php new file mode 100644 index 000000000000..4b455758acdc --- /dev/null +++ b/GeminiDataAnalytics/samples/V1/DataChatServiceClient/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 geminidataanalytics_v1_generated_DataChatService_GetLocation_sync] diff --git a/GeminiDataAnalytics/samples/V1/DataChatServiceClient/list_conversations.php b/GeminiDataAnalytics/samples/V1/DataChatServiceClient/list_conversations.php new file mode 100644 index 000000000000..9bd13df6b851 --- /dev/null +++ b/GeminiDataAnalytics/samples/V1/DataChatServiceClient/list_conversations.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $dataChatServiceClient->listConversations($request); + + /** @var Conversation $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 = DataChatServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + list_conversations_sample($formattedParent); +} +// [END geminidataanalytics_v1_generated_DataChatService_ListConversations_sync] diff --git a/GeminiDataAnalytics/samples/V1/DataChatServiceClient/list_locations.php b/GeminiDataAnalytics/samples/V1/DataChatServiceClient/list_locations.php new file mode 100644 index 000000000000..aab282ee8811 --- /dev/null +++ b/GeminiDataAnalytics/samples/V1/DataChatServiceClient/list_locations.php @@ -0,0 +1,77 @@ +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 geminidataanalytics_v1_generated_DataChatService_ListLocations_sync] diff --git a/GeminiDataAnalytics/samples/V1/DataChatServiceClient/list_messages.php b/GeminiDataAnalytics/samples/V1/DataChatServiceClient/list_messages.php new file mode 100644 index 000000000000..daab8041d7bc --- /dev/null +++ b/GeminiDataAnalytics/samples/V1/DataChatServiceClient/list_messages.php @@ -0,0 +1,82 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $dataChatServiceClient->listMessages($request); + + /** @var StorageMessage $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 = DataChatServiceClient::conversationName( + '[PROJECT]', + '[LOCATION]', + '[CONVERSATION]' + ); + + list_messages_sample($formattedParent); +} +// [END geminidataanalytics_v1_generated_DataChatService_ListMessages_sync] diff --git a/GeminiDataAnalytics/src/V1/AnalysisEvent.php b/GeminiDataAnalytics/src/V1/AnalysisEvent.php new file mode 100644 index 000000000000..d3becd306291 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/AnalysisEvent.php @@ -0,0 +1,372 @@ +google.cloud.geminidataanalytics.v1.AnalysisEvent + */ +class AnalysisEvent extends \Google\Protobuf\Internal\Message +{ + protected $kind; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $planner_reasoning + * Python codegen planner's reasoning. + * @type string $coder_instruction + * Instructions issued for code generation. + * @type string $code + * Generated code. + * @type string $execution_output + * Output from code execution. + * @type string $execution_error + * An error from code execution. + * @type string $result_vega_chart_json + * Result as Vega chart JSON string. + * @type string $result_natural_language + * Result as NL string. + * @type string $result_csv_data + * Result as CSV string. + * @type string $result_reference_data + * Result as a reference to a data source. + * @type string $error + * A generic error message. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\DataChatService::initOnce(); + parent::__construct($data); + } + + /** + * Python codegen planner's reasoning. + * + * Generated from protobuf field string planner_reasoning = 2; + * @return string + */ + public function getPlannerReasoning() + { + return $this->readOneof(2); + } + + public function hasPlannerReasoning() + { + return $this->hasOneof(2); + } + + /** + * Python codegen planner's reasoning. + * + * Generated from protobuf field string planner_reasoning = 2; + * @param string $var + * @return $this + */ + public function setPlannerReasoning($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Instructions issued for code generation. + * + * Generated from protobuf field string coder_instruction = 3; + * @return string + */ + public function getCoderInstruction() + { + return $this->readOneof(3); + } + + public function hasCoderInstruction() + { + return $this->hasOneof(3); + } + + /** + * Instructions issued for code generation. + * + * Generated from protobuf field string coder_instruction = 3; + * @param string $var + * @return $this + */ + public function setCoderInstruction($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Generated code. + * + * Generated from protobuf field string code = 4; + * @return string + */ + public function getCode() + { + return $this->readOneof(4); + } + + public function hasCode() + { + return $this->hasOneof(4); + } + + /** + * Generated code. + * + * Generated from protobuf field string code = 4; + * @param string $var + * @return $this + */ + public function setCode($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Output from code execution. + * + * Generated from protobuf field string execution_output = 5; + * @return string + */ + public function getExecutionOutput() + { + return $this->readOneof(5); + } + + public function hasExecutionOutput() + { + return $this->hasOneof(5); + } + + /** + * Output from code execution. + * + * Generated from protobuf field string execution_output = 5; + * @param string $var + * @return $this + */ + public function setExecutionOutput($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * An error from code execution. + * + * Generated from protobuf field string execution_error = 6; + * @return string + */ + public function getExecutionError() + { + return $this->readOneof(6); + } + + public function hasExecutionError() + { + return $this->hasOneof(6); + } + + /** + * An error from code execution. + * + * Generated from protobuf field string execution_error = 6; + * @param string $var + * @return $this + */ + public function setExecutionError($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Result as Vega chart JSON string. + * + * Generated from protobuf field string result_vega_chart_json = 7; + * @return string + */ + public function getResultVegaChartJson() + { + return $this->readOneof(7); + } + + public function hasResultVegaChartJson() + { + return $this->hasOneof(7); + } + + /** + * Result as Vega chart JSON string. + * + * Generated from protobuf field string result_vega_chart_json = 7; + * @param string $var + * @return $this + */ + public function setResultVegaChartJson($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * Result as NL string. + * + * Generated from protobuf field string result_natural_language = 8; + * @return string + */ + public function getResultNaturalLanguage() + { + return $this->readOneof(8); + } + + public function hasResultNaturalLanguage() + { + return $this->hasOneof(8); + } + + /** + * Result as NL string. + * + * Generated from protobuf field string result_natural_language = 8; + * @param string $var + * @return $this + */ + public function setResultNaturalLanguage($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * Result as CSV string. + * + * Generated from protobuf field string result_csv_data = 9; + * @return string + */ + public function getResultCsvData() + { + return $this->readOneof(9); + } + + public function hasResultCsvData() + { + return $this->hasOneof(9); + } + + /** + * Result as CSV string. + * + * Generated from protobuf field string result_csv_data = 9; + * @param string $var + * @return $this + */ + public function setResultCsvData($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * Result as a reference to a data source. + * + * Generated from protobuf field string result_reference_data = 10; + * @return string + */ + public function getResultReferenceData() + { + return $this->readOneof(10); + } + + public function hasResultReferenceData() + { + return $this->hasOneof(10); + } + + /** + * Result as a reference to a data source. + * + * Generated from protobuf field string result_reference_data = 10; + * @param string $var + * @return $this + */ + public function setResultReferenceData($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(10, $var); + + return $this; + } + + /** + * A generic error message. + * + * Generated from protobuf field string error = 11; + * @return string + */ + public function getError() + { + return $this->readOneof(11); + } + + public function hasError() + { + return $this->hasOneof(11); + } + + /** + * A generic error message. + * + * Generated from protobuf field string error = 11; + * @param string $var + * @return $this + */ + public function setError($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(11, $var); + + return $this; + } + + /** + * @return string + */ + public function getKind() + { + return $this->whichOneof("kind"); + } + +} + diff --git a/GeminiDataAnalytics/src/V1/AnalysisMessage.php b/GeminiDataAnalytics/src/V1/AnalysisMessage.php new file mode 100644 index 000000000000..619f2791054e --- /dev/null +++ b/GeminiDataAnalytics/src/V1/AnalysisMessage.php @@ -0,0 +1,108 @@ +google.cloud.geminidataanalytics.v1.AnalysisMessage + */ +class AnalysisMessage extends \Google\Protobuf\Internal\Message +{ + protected $kind; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\GeminiDataAnalytics\V1\AnalysisQuery $query + * An analysis query. + * @type \Google\Cloud\GeminiDataAnalytics\V1\AnalysisEvent $progress_event + * An event indicating the progress of the analysis. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\DataChatService::initOnce(); + parent::__construct($data); + } + + /** + * An analysis query. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.AnalysisQuery query = 1; + * @return \Google\Cloud\GeminiDataAnalytics\V1\AnalysisQuery|null + */ + public function getQuery() + { + return $this->readOneof(1); + } + + public function hasQuery() + { + return $this->hasOneof(1); + } + + /** + * An analysis query. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.AnalysisQuery query = 1; + * @param \Google\Cloud\GeminiDataAnalytics\V1\AnalysisQuery $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\AnalysisQuery::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * An event indicating the progress of the analysis. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.AnalysisEvent progress_event = 2; + * @return \Google\Cloud\GeminiDataAnalytics\V1\AnalysisEvent|null + */ + public function getProgressEvent() + { + return $this->readOneof(2); + } + + public function hasProgressEvent() + { + return $this->hasOneof(2); + } + + /** + * An event indicating the progress of the analysis. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.AnalysisEvent progress_event = 2; + * @param \Google\Cloud\GeminiDataAnalytics\V1\AnalysisEvent $var + * @return $this + */ + public function setProgressEvent($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\AnalysisEvent::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getKind() + { + return $this->whichOneof("kind"); + } + +} + diff --git a/GeminiDataAnalytics/src/V1/AnalysisOptions.php b/GeminiDataAnalytics/src/V1/AnalysisOptions.php new file mode 100644 index 000000000000..ab128ea7aaaa --- /dev/null +++ b/GeminiDataAnalytics/src/V1/AnalysisOptions.php @@ -0,0 +1,77 @@ +google.cloud.geminidataanalytics.v1.AnalysisOptions + */ +class AnalysisOptions extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Options for Python analysis. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.AnalysisOptions.Python python = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $python = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\GeminiDataAnalytics\V1\AnalysisOptions\Python $python + * Optional. Options for Python analysis. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Context::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Options for Python analysis. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.AnalysisOptions.Python python = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\GeminiDataAnalytics\V1\AnalysisOptions\Python|null + */ + public function getPython() + { + return $this->python; + } + + public function hasPython() + { + return isset($this->python); + } + + public function clearPython() + { + unset($this->python); + } + + /** + * Optional. Options for Python analysis. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.AnalysisOptions.Python python = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\AnalysisOptions\Python $var + * @return $this + */ + public function setPython($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\AnalysisOptions\Python::class); + $this->python = $var; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/AnalysisOptions/Python.php b/GeminiDataAnalytics/src/V1/AnalysisOptions/Python.php new file mode 100644 index 000000000000..43e2c4a9cc40 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/AnalysisOptions/Python.php @@ -0,0 +1,71 @@ +google.cloud.geminidataanalytics.v1.AnalysisOptions.Python + */ +class Python extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Whether to enable Python analysis. + * Defaults to false. + * + * Generated from protobuf field bool enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enabled = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enabled + * Optional. Whether to enable Python analysis. + * Defaults to false. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Context::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Whether to enable Python analysis. + * Defaults to false. + * + * Generated from protobuf field bool enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnabled() + { + return $this->enabled; + } + + /** + * Optional. Whether to enable Python analysis. + * Defaults to false. + * + * Generated from protobuf field bool enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnabled($var) + { + GPBUtil::checkBool($var); + $this->enabled = $var; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/AnalysisQuery.php b/GeminiDataAnalytics/src/V1/AnalysisQuery.php new file mode 100644 index 000000000000..21dfff914053 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/AnalysisQuery.php @@ -0,0 +1,101 @@ +google.cloud.geminidataanalytics.v1.AnalysisQuery + */ +class AnalysisQuery extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. An analysis question to help answer the user's original question. + * + * Generated from protobuf field string question = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $question = ''; + /** + * Optional. The names of previously retrieved data results to analyze. + * + * Generated from protobuf field repeated string data_result_names = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $data_result_names; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $question + * Optional. An analysis question to help answer the user's original question. + * @type string[] $data_result_names + * Optional. The names of previously retrieved data results to analyze. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\DataChatService::initOnce(); + parent::__construct($data); + } + + /** + * Optional. An analysis question to help answer the user's original question. + * + * Generated from protobuf field string question = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getQuestion() + { + return $this->question; + } + + /** + * Optional. An analysis question to help answer the user's original question. + * + * Generated from protobuf field string question = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setQuestion($var) + { + GPBUtil::checkString($var, True); + $this->question = $var; + + return $this; + } + + /** + * Optional. The names of previously retrieved data results to analyze. + * + * Generated from protobuf field repeated string data_result_names = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField + */ + public function getDataResultNames() + { + return $this->data_result_names; + } + + /** + * Optional. The names of previously retrieved data results to analyze. + * + * Generated from protobuf field repeated string data_result_names = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string[] $var + * @return $this + */ + public function setDataResultNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->data_result_names = $arr; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/BigQueryJob.php b/GeminiDataAnalytics/src/V1/BigQueryJob.php new file mode 100644 index 000000000000..3307f3525e36 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/BigQueryJob.php @@ -0,0 +1,263 @@ +google.cloud.geminidataanalytics.v1.BigQueryJob + */ +class BigQueryJob extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project that the job belongs to. + * See + * [JobReference](https://cloud.google.com/bigquery/docs/reference/rest/v2/JobReference). + * + * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project_id = ''; + /** + * Required. The ID of the job. + * See + * [JobReference](https://cloud.google.com/bigquery/docs/reference/rest/v2/JobReference). + * + * Generated from protobuf field string job_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $job_id = ''; + /** + * Optional. The location of the job. + * See + * [JobReference](https://cloud.google.com/bigquery/docs/reference/rest/v2/JobReference). + * + * Generated from protobuf field string location = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $location = ''; + /** + * Optional. A reference to the destination table of the job's query results. + * See + * [JobConfigurationQuery](https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#jobconfigurationquery). + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.BigQueryTableReference destination_table = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $destination_table = null; + /** + * Optional. The schema of the job's query results. + * See + * [JobStatistics2](https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#jobstatistics2). + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Schema schema = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $schema = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project_id + * Required. The project that the job belongs to. + * See + * [JobReference](https://cloud.google.com/bigquery/docs/reference/rest/v2/JobReference). + * @type string $job_id + * Required. The ID of the job. + * See + * [JobReference](https://cloud.google.com/bigquery/docs/reference/rest/v2/JobReference). + * @type string $location + * Optional. The location of the job. + * See + * [JobReference](https://cloud.google.com/bigquery/docs/reference/rest/v2/JobReference). + * @type \Google\Cloud\GeminiDataAnalytics\V1\BigQueryTableReference $destination_table + * Optional. A reference to the destination table of the job's query results. + * See + * [JobConfigurationQuery](https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#jobconfigurationquery). + * @type \Google\Cloud\GeminiDataAnalytics\V1\Schema $schema + * Optional. The schema of the job's query results. + * See + * [JobStatistics2](https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#jobstatistics2). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\DataChatService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project that the job belongs to. + * See + * [JobReference](https://cloud.google.com/bigquery/docs/reference/rest/v2/JobReference). + * + * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getProjectId() + { + return $this->project_id; + } + + /** + * Required. The project that the job belongs to. + * See + * [JobReference](https://cloud.google.com/bigquery/docs/reference/rest/v2/JobReference). + * + * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setProjectId($var) + { + GPBUtil::checkString($var, True); + $this->project_id = $var; + + return $this; + } + + /** + * Required. The ID of the job. + * See + * [JobReference](https://cloud.google.com/bigquery/docs/reference/rest/v2/JobReference). + * + * Generated from protobuf field string job_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getJobId() + { + return $this->job_id; + } + + /** + * Required. The ID of the job. + * See + * [JobReference](https://cloud.google.com/bigquery/docs/reference/rest/v2/JobReference). + * + * Generated from protobuf field string job_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setJobId($var) + { + GPBUtil::checkString($var, True); + $this->job_id = $var; + + return $this; + } + + /** + * Optional. The location of the job. + * See + * [JobReference](https://cloud.google.com/bigquery/docs/reference/rest/v2/JobReference). + * + * Generated from protobuf field string location = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLocation() + { + return $this->location; + } + + /** + * Optional. The location of the job. + * See + * [JobReference](https://cloud.google.com/bigquery/docs/reference/rest/v2/JobReference). + * + * Generated from protobuf field string location = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkString($var, True); + $this->location = $var; + + return $this; + } + + /** + * Optional. A reference to the destination table of the job's query results. + * See + * [JobConfigurationQuery](https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#jobconfigurationquery). + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.BigQueryTableReference destination_table = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\GeminiDataAnalytics\V1\BigQueryTableReference|null + */ + public function getDestinationTable() + { + return $this->destination_table; + } + + public function hasDestinationTable() + { + return isset($this->destination_table); + } + + public function clearDestinationTable() + { + unset($this->destination_table); + } + + /** + * Optional. A reference to the destination table of the job's query results. + * See + * [JobConfigurationQuery](https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#jobconfigurationquery). + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.BigQueryTableReference destination_table = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\BigQueryTableReference $var + * @return $this + */ + public function setDestinationTable($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\BigQueryTableReference::class); + $this->destination_table = $var; + + return $this; + } + + /** + * Optional. The schema of the job's query results. + * See + * [JobStatistics2](https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#jobstatistics2). + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Schema schema = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\GeminiDataAnalytics\V1\Schema|null + */ + public function getSchema() + { + return $this->schema; + } + + public function hasSchema() + { + return isset($this->schema); + } + + public function clearSchema() + { + unset($this->schema); + } + + /** + * Optional. The schema of the job's query results. + * See + * [JobStatistics2](https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#jobstatistics2). + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Schema schema = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\Schema $var + * @return $this + */ + public function setSchema($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\Schema::class); + $this->schema = $var; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/BigQueryPropertyGraphReference.php b/GeminiDataAnalytics/src/V1/BigQueryPropertyGraphReference.php new file mode 100644 index 000000000000..9b1b44c8bd83 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/BigQueryPropertyGraphReference.php @@ -0,0 +1,135 @@ +google.cloud.geminidataanalytics.v1.BigQueryPropertyGraphReference + */ +class BigQueryPropertyGraphReference extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project that the property graph belongs to. + * + * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project_id = ''; + /** + * Required. The dataset that the property graph belongs to. + * + * Generated from protobuf field string dataset_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $dataset_id = ''; + /** + * Required. The property graph id. + * + * Generated from protobuf field string property_graph_id = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $property_graph_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project_id + * Required. The project that the property graph belongs to. + * @type string $dataset_id + * Required. The dataset that the property graph belongs to. + * @type string $property_graph_id + * Required. The property graph id. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Datasource::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project that the property graph belongs to. + * + * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getProjectId() + { + return $this->project_id; + } + + /** + * Required. The project that the property graph belongs to. + * + * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setProjectId($var) + { + GPBUtil::checkString($var, True); + $this->project_id = $var; + + return $this; + } + + /** + * Required. The dataset that the property graph belongs to. + * + * Generated from protobuf field string dataset_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDatasetId() + { + return $this->dataset_id; + } + + /** + * Required. The dataset that the property graph belongs to. + * + * Generated from protobuf field string dataset_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDatasetId($var) + { + GPBUtil::checkString($var, True); + $this->dataset_id = $var; + + return $this; + } + + /** + * Required. The property graph id. + * + * Generated from protobuf field string property_graph_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getPropertyGraphId() + { + return $this->property_graph_id; + } + + /** + * Required. The property graph id. + * + * Generated from protobuf field string property_graph_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setPropertyGraphId($var) + { + GPBUtil::checkString($var, True); + $this->property_graph_id = $var; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/BigQueryRoutine.php b/GeminiDataAnalytics/src/V1/BigQueryRoutine.php new file mode 100644 index 000000000000..ccee90788580 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/BigQueryRoutine.php @@ -0,0 +1,115 @@ +google.cloud.geminidataanalytics.v1.BigQueryRoutine + */ +class BigQueryRoutine extends \Google\Protobuf\Internal\Message +{ + /** + * The reference to the BigQuery routine. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.BigQueryRoutineReference routine_reference = 1; + */ + protected $routine_reference = null; + /** + * User override or addition to description, to tell the agent when to use the + * UDF. + * + * Generated from protobuf field string description = 2; + */ + protected $description = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\GeminiDataAnalytics\V1\BigQueryRoutineReference $routine_reference + * The reference to the BigQuery routine. + * @type string $description + * User override or addition to description, to tell the agent when to use the + * UDF. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Context::initOnce(); + parent::__construct($data); + } + + /** + * The reference to the BigQuery routine. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.BigQueryRoutineReference routine_reference = 1; + * @return \Google\Cloud\GeminiDataAnalytics\V1\BigQueryRoutineReference|null + */ + public function getRoutineReference() + { + return $this->routine_reference; + } + + public function hasRoutineReference() + { + return isset($this->routine_reference); + } + + public function clearRoutineReference() + { + unset($this->routine_reference); + } + + /** + * The reference to the BigQuery routine. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.BigQueryRoutineReference routine_reference = 1; + * @param \Google\Cloud\GeminiDataAnalytics\V1\BigQueryRoutineReference $var + * @return $this + */ + public function setRoutineReference($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\BigQueryRoutineReference::class); + $this->routine_reference = $var; + + return $this; + } + + /** + * User override or addition to description, to tell the agent when to use the + * UDF. + * + * Generated from protobuf field string description = 2; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * User override or addition to description, to tell the agent when to use the + * UDF. + * + * 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; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/BigQueryRoutineReference.php b/GeminiDataAnalytics/src/V1/BigQueryRoutineReference.php new file mode 100644 index 000000000000..312c2aa518a2 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/BigQueryRoutineReference.php @@ -0,0 +1,135 @@ +google.cloud.geminidataanalytics.v1.BigQueryRoutineReference + */ +class BigQueryRoutineReference extends \Google\Protobuf\Internal\Message +{ + /** + * The project ID of the routine. + * + * Generated from protobuf field string project_id = 1; + */ + protected $project_id = ''; + /** + * The dataset ID of the routine. + * + * Generated from protobuf field string dataset_id = 2; + */ + protected $dataset_id = ''; + /** + * The routine ID of the routine. + * + * Generated from protobuf field string routine_id = 3; + */ + protected $routine_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project_id + * The project ID of the routine. + * @type string $dataset_id + * The dataset ID of the routine. + * @type string $routine_id + * The routine ID of the routine. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Context::initOnce(); + parent::__construct($data); + } + + /** + * The project ID of the routine. + * + * Generated from protobuf field string project_id = 1; + * @return string + */ + public function getProjectId() + { + return $this->project_id; + } + + /** + * The project ID of the routine. + * + * Generated from protobuf field string project_id = 1; + * @param string $var + * @return $this + */ + public function setProjectId($var) + { + GPBUtil::checkString($var, True); + $this->project_id = $var; + + return $this; + } + + /** + * The dataset ID of the routine. + * + * Generated from protobuf field string dataset_id = 2; + * @return string + */ + public function getDatasetId() + { + return $this->dataset_id; + } + + /** + * The dataset ID of the routine. + * + * Generated from protobuf field string dataset_id = 2; + * @param string $var + * @return $this + */ + public function setDatasetId($var) + { + GPBUtil::checkString($var, True); + $this->dataset_id = $var; + + return $this; + } + + /** + * The routine ID of the routine. + * + * Generated from protobuf field string routine_id = 3; + * @return string + */ + public function getRoutineId() + { + return $this->routine_id; + } + + /** + * The routine ID of the routine. + * + * Generated from protobuf field string routine_id = 3; + * @param string $var + * @return $this + */ + public function setRoutineId($var) + { + GPBUtil::checkString($var, True); + $this->routine_id = $var; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/BigQueryTableReference.php b/GeminiDataAnalytics/src/V1/BigQueryTableReference.php new file mode 100644 index 000000000000..9cdd26c57ed2 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/BigQueryTableReference.php @@ -0,0 +1,179 @@ +google.cloud.geminidataanalytics.v1.BigQueryTableReference + */ +class BigQueryTableReference extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project that the table belongs to. + * + * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project_id = ''; + /** + * Required. The dataset that the table belongs to. + * + * Generated from protobuf field string dataset_id = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $dataset_id = ''; + /** + * Required. The table id. + * + * Generated from protobuf field string table_id = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $table_id = ''; + /** + * Optional. The schema of the datasource. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Schema schema = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $schema = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project_id + * Required. The project that the table belongs to. + * @type string $dataset_id + * Required. The dataset that the table belongs to. + * @type string $table_id + * Required. The table id. + * @type \Google\Cloud\GeminiDataAnalytics\V1\Schema $schema + * Optional. The schema of the datasource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Datasource::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project that the table belongs to. + * + * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getProjectId() + { + return $this->project_id; + } + + /** + * Required. The project that the table belongs to. + * + * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setProjectId($var) + { + GPBUtil::checkString($var, True); + $this->project_id = $var; + + return $this; + } + + /** + * Required. The dataset that the table belongs to. + * + * Generated from protobuf field string dataset_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDatasetId() + { + return $this->dataset_id; + } + + /** + * Required. The dataset that the table belongs to. + * + * Generated from protobuf field string dataset_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDatasetId($var) + { + GPBUtil::checkString($var, True); + $this->dataset_id = $var; + + return $this; + } + + /** + * Required. The table id. + * + * Generated from protobuf field string table_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTableId() + { + return $this->table_id; + } + + /** + * Required. The table id. + * + * Generated from protobuf field string table_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTableId($var) + { + GPBUtil::checkString($var, True); + $this->table_id = $var; + + return $this; + } + + /** + * Optional. The schema of the datasource. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Schema schema = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\GeminiDataAnalytics\V1\Schema|null + */ + public function getSchema() + { + return $this->schema; + } + + public function hasSchema() + { + return isset($this->schema); + } + + public function clearSchema() + { + unset($this->schema); + } + + /** + * Optional. The schema of the datasource. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Schema schema = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\Schema $var + * @return $this + */ + public function setSchema($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\Schema::class); + $this->schema = $var; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/BigQueryTableReferences.php b/GeminiDataAnalytics/src/V1/BigQueryTableReferences.php new file mode 100644 index 000000000000..ffb0f9a9f64c --- /dev/null +++ b/GeminiDataAnalytics/src/V1/BigQueryTableReferences.php @@ -0,0 +1,69 @@ +google.cloud.geminidataanalytics.v1.BigQueryTableReferences + */ +class BigQueryTableReferences extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. References to BigQuery tables. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.BigQueryTableReference table_references = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $table_references; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\GeminiDataAnalytics\V1\BigQueryTableReference[] $table_references + * Optional. References to BigQuery tables. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Datasource::initOnce(); + parent::__construct($data); + } + + /** + * Optional. References to BigQuery tables. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.BigQueryTableReference table_references = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\GeminiDataAnalytics\V1\BigQueryTableReference> + */ + public function getTableReferences() + { + return $this->table_references; + } + + /** + * Optional. References to BigQuery tables. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.BigQueryTableReference table_references = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\BigQueryTableReference[] $var + * @return $this + */ + public function setTableReferences($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GeminiDataAnalytics\V1\BigQueryTableReference::class); + $this->table_references = $arr; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/Blob.php b/GeminiDataAnalytics/src/V1/Blob.php new file mode 100644 index 000000000000..148be0cc50c3 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/Blob.php @@ -0,0 +1,101 @@ +google.cloud.geminidataanalytics.v1.Blob + */ +class Blob extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The IANA standard MIME type of the message data. + * + * Generated from protobuf field string mime_type = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $mime_type = ''; + /** + * Required. The data represented as bytes. + * + * Generated from protobuf field bytes data = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $data = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $mime_type + * Required. The IANA standard MIME type of the message data. + * @type string $data + * Required. The data represented as bytes. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\DataChatService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The IANA standard MIME type of the message data. + * + * Generated from protobuf field string mime_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getMimeType() + { + return $this->mime_type; + } + + /** + * Required. The IANA standard MIME type of the message data. + * + * Generated from protobuf field string mime_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setMimeType($var) + { + GPBUtil::checkString($var, True); + $this->mime_type = $var; + + return $this; + } + + /** + * Required. The data represented as bytes. + * + * Generated from protobuf field bytes data = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getData() + { + return $this->data; + } + + /** + * Required. The data represented as bytes. + * + * Generated from protobuf field bytes data = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setData($var) + { + GPBUtil::checkString($var, False); + $this->data = $var; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/ChartMessage.php b/GeminiDataAnalytics/src/V1/ChartMessage.php new file mode 100644 index 000000000000..cbe1fc637cf3 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/ChartMessage.php @@ -0,0 +1,108 @@ +google.cloud.geminidataanalytics.v1.ChartMessage + */ +class ChartMessage extends \Google\Protobuf\Internal\Message +{ + protected $kind; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\GeminiDataAnalytics\V1\ChartQuery $query + * A query for generating a chart. + * @type \Google\Cloud\GeminiDataAnalytics\V1\ChartResult $result + * The result of a chart generation query. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\DataChatService::initOnce(); + parent::__construct($data); + } + + /** + * A query for generating a chart. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.ChartQuery query = 1; + * @return \Google\Cloud\GeminiDataAnalytics\V1\ChartQuery|null + */ + public function getQuery() + { + return $this->readOneof(1); + } + + public function hasQuery() + { + return $this->hasOneof(1); + } + + /** + * A query for generating a chart. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.ChartQuery query = 1; + * @param \Google\Cloud\GeminiDataAnalytics\V1\ChartQuery $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\ChartQuery::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * The result of a chart generation query. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.ChartResult result = 2; + * @return \Google\Cloud\GeminiDataAnalytics\V1\ChartResult|null + */ + public function getResult() + { + return $this->readOneof(2); + } + + public function hasResult() + { + return $this->hasOneof(2); + } + + /** + * The result of a chart generation query. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.ChartResult result = 2; + * @param \Google\Cloud\GeminiDataAnalytics\V1\ChartResult $var + * @return $this + */ + public function setResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\ChartResult::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getKind() + { + return $this->whichOneof("kind"); + } + +} + diff --git a/GeminiDataAnalytics/src/V1/ChartQuery.php b/GeminiDataAnalytics/src/V1/ChartQuery.php new file mode 100644 index 000000000000..63e4568c3a98 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/ChartQuery.php @@ -0,0 +1,105 @@ +google.cloud.geminidataanalytics.v1.ChartQuery + */ +class ChartQuery extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Natural language instructions for generating the chart. + * + * Generated from protobuf field string instructions = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $instructions = ''; + /** + * Optional. The name of a previously retrieved data result to use in the + * chart. + * + * Generated from protobuf field string data_result_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $data_result_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instructions + * Optional. Natural language instructions for generating the chart. + * @type string $data_result_name + * Optional. The name of a previously retrieved data result to use in the + * chart. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\DataChatService::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Natural language instructions for generating the chart. + * + * Generated from protobuf field string instructions = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getInstructions() + { + return $this->instructions; + } + + /** + * Optional. Natural language instructions for generating the chart. + * + * Generated from protobuf field string instructions = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setInstructions($var) + { + GPBUtil::checkString($var, True); + $this->instructions = $var; + + return $this; + } + + /** + * Optional. The name of a previously retrieved data result to use in the + * chart. + * + * Generated from protobuf field string data_result_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDataResultName() + { + return $this->data_result_name; + } + + /** + * Optional. The name of a previously retrieved data result to use in the + * chart. + * + * Generated from protobuf field string data_result_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDataResultName($var) + { + GPBUtil::checkString($var, True); + $this->data_result_name = $var; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/ChartResult.php b/GeminiDataAnalytics/src/V1/ChartResult.php new file mode 100644 index 000000000000..a48ccf7d997b --- /dev/null +++ b/GeminiDataAnalytics/src/V1/ChartResult.php @@ -0,0 +1,125 @@ +google.cloud.geminidataanalytics.v1.ChartResult + */ +class ChartResult extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. A generated Vega chart config. + * See https://vega.github.io/vega/docs/config/ + * + * Generated from protobuf field .google.protobuf.Struct vega_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $vega_config = null; + /** + * Optional. A rendering of the chart if this was requested in the context. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Blob image = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $image = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Struct $vega_config + * Optional. A generated Vega chart config. + * See https://vega.github.io/vega/docs/config/ + * @type \Google\Cloud\GeminiDataAnalytics\V1\Blob $image + * Optional. A rendering of the chart if this was requested in the context. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\DataChatService::initOnce(); + parent::__construct($data); + } + + /** + * Optional. A generated Vega chart config. + * See https://vega.github.io/vega/docs/config/ + * + * Generated from protobuf field .google.protobuf.Struct vega_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Struct|null + */ + public function getVegaConfig() + { + return $this->vega_config; + } + + public function hasVegaConfig() + { + return isset($this->vega_config); + } + + public function clearVegaConfig() + { + unset($this->vega_config); + } + + /** + * Optional. A generated Vega chart config. + * See https://vega.github.io/vega/docs/config/ + * + * Generated from protobuf field .google.protobuf.Struct vega_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setVegaConfig($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->vega_config = $var; + + return $this; + } + + /** + * Optional. A rendering of the chart if this was requested in the context. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Blob image = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\GeminiDataAnalytics\V1\Blob|null + */ + public function getImage() + { + return $this->image; + } + + public function hasImage() + { + return isset($this->image); + } + + public function clearImage() + { + unset($this->image); + } + + /** + * Optional. A rendering of the chart if this was requested in the context. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Blob image = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\Blob $var + * @return $this + */ + public function setImage($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\Blob::class); + $this->image = $var; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/ChatRequest.php b/GeminiDataAnalytics/src/V1/ChatRequest.php new file mode 100644 index 000000000000..5b33b358fb23 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/ChatRequest.php @@ -0,0 +1,453 @@ +google.cloud.geminidataanalytics.v1.ChatRequest + */ +class ChatRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent value for chat request. + * Pattern: `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * Required. Content of current conversation. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.Message messages = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $messages; + /** + * Optional. The credentials to use when calling the data source(s) specified + * in the context. + * This field can be used to provide credentials for various data sources. + * For example, when connecting to Looker, it currently supports both OAuth + * token and API key-based credentials, as described in + * [Authentication with an + * SDK](https://cloud.google.com/looker/docs/api-auth#authentication_with_an_sdk). + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Credentials credentials = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $credentials = null; + /** + * Optional. The thinking mode to use for the agent loop. + * Defaults to THINKING_MODE_UNSPECIFIED if not specified. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.ChatRequest.ThinkingMode thinking_mode = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $thinking_mode = 0; + /** + * Optional. The model to use for the agent loop when processing the request. + * This setting only has an effect when context.options.model is not set. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.ChatRequest.Model model = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $model = 0; + protected $context_provider; + protected $datasource_settings; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\GeminiDataAnalytics\V1\Context $inline_context + * Optional. Inline context for the chat request. Use this to chat + * statelessly (without managed conversation persistence and without an + * Agent) by passing all context inline. + * @type \Google\Cloud\GeminiDataAnalytics\V1\ConversationReference $conversation_reference + * Optional. Reference to a persisted conversation and agent context. + * Use this to chat with an Agent using managed conversation persistence. + * @type \Google\Cloud\GeminiDataAnalytics\V1\DataAgentContext $data_agent_context + * Optional. Context for the chat request. Use this to chat with an Agent + * statelessly, without managed conversation persistence. + * @type \Google\Cloud\GeminiDataAnalytics\V1\ClientManagedResourceContext $client_managed_resource_context + * Optional. Context with client managed resources. + * Some clients may not use GDA managed resources including + * conversations and agents, instead they create and manage their own + * conversations and agents resources. + * @type \Google\Cloud\GeminiDataAnalytics\V1\LookerSettings $looker_settings + * Optional. Looker specific settings. + * @type string $parent + * Required. The parent value for chat request. + * Pattern: `projects/{project}/locations/{location}` + * @type \Google\Cloud\GeminiDataAnalytics\V1\Message[] $messages + * Required. Content of current conversation. + * @type \Google\Cloud\GeminiDataAnalytics\V1\Credentials $credentials + * Optional. The credentials to use when calling the data source(s) specified + * in the context. + * This field can be used to provide credentials for various data sources. + * For example, when connecting to Looker, it currently supports both OAuth + * token and API key-based credentials, as described in + * [Authentication with an + * SDK](https://cloud.google.com/looker/docs/api-auth#authentication_with_an_sdk). + * @type int $thinking_mode + * Optional. The thinking mode to use for the agent loop. + * Defaults to THINKING_MODE_UNSPECIFIED if not specified. + * @type int $model + * Optional. The model to use for the agent loop when processing the request. + * This setting only has an effect when context.options.model is not set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\DataChatService::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Inline context for the chat request. Use this to chat + * statelessly (without managed conversation persistence and without an + * Agent) by passing all context inline. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Context inline_context = 101 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\GeminiDataAnalytics\V1\Context|null + */ + public function getInlineContext() + { + return $this->readOneof(101); + } + + public function hasInlineContext() + { + return $this->hasOneof(101); + } + + /** + * Optional. Inline context for the chat request. Use this to chat + * statelessly (without managed conversation persistence and without an + * Agent) by passing all context inline. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Context inline_context = 101 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\Context $var + * @return $this + */ + public function setInlineContext($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\Context::class); + $this->writeOneof(101, $var); + + return $this; + } + + /** + * Optional. Reference to a persisted conversation and agent context. + * Use this to chat with an Agent using managed conversation persistence. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.ConversationReference conversation_reference = 103 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\GeminiDataAnalytics\V1\ConversationReference|null + */ + public function getConversationReference() + { + return $this->readOneof(103); + } + + public function hasConversationReference() + { + return $this->hasOneof(103); + } + + /** + * Optional. Reference to a persisted conversation and agent context. + * Use this to chat with an Agent using managed conversation persistence. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.ConversationReference conversation_reference = 103 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\ConversationReference $var + * @return $this + */ + public function setConversationReference($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\ConversationReference::class); + $this->writeOneof(103, $var); + + return $this; + } + + /** + * Optional. Context for the chat request. Use this to chat with an Agent + * statelessly, without managed conversation persistence. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.DataAgentContext data_agent_context = 104 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\GeminiDataAnalytics\V1\DataAgentContext|null + */ + public function getDataAgentContext() + { + return $this->readOneof(104); + } + + public function hasDataAgentContext() + { + return $this->hasOneof(104); + } + + /** + * Optional. Context for the chat request. Use this to chat with an Agent + * statelessly, without managed conversation persistence. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.DataAgentContext data_agent_context = 104 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\DataAgentContext $var + * @return $this + */ + public function setDataAgentContext($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\DataAgentContext::class); + $this->writeOneof(104, $var); + + return $this; + } + + /** + * Optional. Context with client managed resources. + * Some clients may not use GDA managed resources including + * conversations and agents, instead they create and manage their own + * conversations and agents resources. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.ClientManagedResourceContext client_managed_resource_context = 105 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\GeminiDataAnalytics\V1\ClientManagedResourceContext|null + */ + public function getClientManagedResourceContext() + { + return $this->readOneof(105); + } + + public function hasClientManagedResourceContext() + { + return $this->hasOneof(105); + } + + /** + * Optional. Context with client managed resources. + * Some clients may not use GDA managed resources including + * conversations and agents, instead they create and manage their own + * conversations and agents resources. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.ClientManagedResourceContext client_managed_resource_context = 105 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\ClientManagedResourceContext $var + * @return $this + */ + public function setClientManagedResourceContext($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\ClientManagedResourceContext::class); + $this->writeOneof(105, $var); + + return $this; + } + + /** + * Optional. Looker specific settings. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.LookerSettings looker_settings = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\GeminiDataAnalytics\V1\LookerSettings|null + */ + public function getLookerSettings() + { + return $this->readOneof(13); + } + + public function hasLookerSettings() + { + return $this->hasOneof(13); + } + + /** + * Optional. Looker specific settings. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.LookerSettings looker_settings = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\LookerSettings $var + * @return $this + */ + public function setLookerSettings($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\LookerSettings::class); + $this->writeOneof(13, $var); + + return $this; + } + + /** + * Required. The parent value for chat request. + * Pattern: `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent value for chat request. + * Pattern: `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. Content of current conversation. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.Message messages = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return RepeatedField<\Google\Cloud\GeminiDataAnalytics\V1\Message> + */ + public function getMessages() + { + return $this->messages; + } + + /** + * Required. Content of current conversation. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.Message messages = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\Message[] $var + * @return $this + */ + public function setMessages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GeminiDataAnalytics\V1\Message::class); + $this->messages = $arr; + + return $this; + } + + /** + * Optional. The credentials to use when calling the data source(s) specified + * in the context. + * This field can be used to provide credentials for various data sources. + * For example, when connecting to Looker, it currently supports both OAuth + * token and API key-based credentials, as described in + * [Authentication with an + * SDK](https://cloud.google.com/looker/docs/api-auth#authentication_with_an_sdk). + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Credentials credentials = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\GeminiDataAnalytics\V1\Credentials|null + */ + public function getCredentials() + { + return $this->credentials; + } + + public function hasCredentials() + { + return isset($this->credentials); + } + + public function clearCredentials() + { + unset($this->credentials); + } + + /** + * Optional. The credentials to use when calling the data source(s) specified + * in the context. + * This field can be used to provide credentials for various data sources. + * For example, when connecting to Looker, it currently supports both OAuth + * token and API key-based credentials, as described in + * [Authentication with an + * SDK](https://cloud.google.com/looker/docs/api-auth#authentication_with_an_sdk). + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Credentials credentials = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\Credentials $var + * @return $this + */ + public function setCredentials($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\Credentials::class); + $this->credentials = $var; + + return $this; + } + + /** + * Optional. The thinking mode to use for the agent loop. + * Defaults to THINKING_MODE_UNSPECIFIED if not specified. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.ChatRequest.ThinkingMode thinking_mode = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getThinkingMode() + { + return $this->thinking_mode; + } + + /** + * Optional. The thinking mode to use for the agent loop. + * Defaults to THINKING_MODE_UNSPECIFIED if not specified. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.ChatRequest.ThinkingMode thinking_mode = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setThinkingMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GeminiDataAnalytics\V1\ChatRequest\ThinkingMode::class); + $this->thinking_mode = $var; + + return $this; + } + + /** + * Optional. The model to use for the agent loop when processing the request. + * This setting only has an effect when context.options.model is not set. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.ChatRequest.Model model = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getModel() + { + return $this->model; + } + + /** + * Optional. The model to use for the agent loop when processing the request. + * This setting only has an effect when context.options.model is not set. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.ChatRequest.Model model = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setModel($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GeminiDataAnalytics\V1\ChatRequest\Model::class); + $this->model = $var; + + return $this; + } + + /** + * @return string + */ + public function getContextProvider() + { + return $this->whichOneof("context_provider"); + } + + /** + * @return string + */ + public function getDatasourceSettings() + { + return $this->whichOneof("datasource_settings"); + } + +} + diff --git a/GeminiDataAnalytics/src/V1/ChatRequest/Model.php b/GeminiDataAnalytics/src/V1/ChatRequest/Model.php new file mode 100644 index 000000000000..7e0355bc0b49 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/ChatRequest/Model.php @@ -0,0 +1,58 @@ +google.cloud.geminidataanalytics.v1.ChatRequest.Model + */ +class Model +{ + /** + * No model specified. The default model will be used. Currently, this is + * `gemini-3.0-flash-preview`. + * + * Generated from protobuf enum MODEL_UNSPECIFIED = 0; + */ + const MODEL_UNSPECIFIED = 0; + /** + * Use the most up-to-date non-preview model. Currently, this is + * `gemini-2.5-flash`. This constrains the request level settings. The + * default will change to `gemini-2.5-flash`, and setting `thinking_mode` + * will not be supported. + * + * Generated from protobuf enum LATEST_GA_MODEL = 1; + */ + const LATEST_GA_MODEL = 1; + + private static $valueToName = [ + self::MODEL_UNSPECIFIED => 'MODEL_UNSPECIFIED', + self::LATEST_GA_MODEL => 'LATEST_GA_MODEL', + ]; + + 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/GeminiDataAnalytics/src/V1/ChatRequest/ThinkingMode.php b/GeminiDataAnalytics/src/V1/ChatRequest/ThinkingMode.php new file mode 100644 index 000000000000..8f50ebf43cd1 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/ChatRequest/ThinkingMode.php @@ -0,0 +1,61 @@ +google.cloud.geminidataanalytics.v1.ChatRequest.ThinkingMode + */ +class ThinkingMode +{ + /** + * Unspecified thinking mode, agent will use THINKING mode by default. + * + * Generated from protobuf enum THINKING_MODE_UNSPECIFIED = 0; + */ + const THINKING_MODE_UNSPECIFIED = 0; + /** + * Fast mode, answers quickly. + * + * Generated from protobuf enum FAST = 1; + */ + const FAST = 1; + /** + * Thinking mode, solves complex problems. + * + * Generated from protobuf enum THINKING = 2; + */ + const THINKING = 2; + + private static $valueToName = [ + self::THINKING_MODE_UNSPECIFIED => 'THINKING_MODE_UNSPECIFIED', + self::FAST => 'FAST', + self::THINKING => 'THINKING', + ]; + + 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/GeminiDataAnalytics/src/V1/Citation.php b/GeminiDataAnalytics/src/V1/Citation.php new file mode 100644 index 000000000000..1c5b72301cda --- /dev/null +++ b/GeminiDataAnalytics/src/V1/Citation.php @@ -0,0 +1,101 @@ +google.cloud.geminidataanalytics.v1.Citation + */ +class Citation extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. List of the sources being cited. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.CitationSource sources = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $sources; + /** + * Output only. List of the anchors of the citations. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.CitationAnchor anchors = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $anchors; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\GeminiDataAnalytics\V1\CitationSource[] $sources + * Output only. List of the sources being cited. + * @type \Google\Cloud\GeminiDataAnalytics\V1\CitationAnchor[] $anchors + * Output only. List of the anchors of the citations. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Context::initOnce(); + parent::__construct($data); + } + + /** + * Output only. List of the sources being cited. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.CitationSource sources = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return RepeatedField<\Google\Cloud\GeminiDataAnalytics\V1\CitationSource> + */ + public function getSources() + { + return $this->sources; + } + + /** + * Output only. List of the sources being cited. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.CitationSource sources = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\CitationSource[] $var + * @return $this + */ + public function setSources($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GeminiDataAnalytics\V1\CitationSource::class); + $this->sources = $arr; + + return $this; + } + + /** + * Output only. List of the anchors of the citations. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.CitationAnchor anchors = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return RepeatedField<\Google\Cloud\GeminiDataAnalytics\V1\CitationAnchor> + */ + public function getAnchors() + { + return $this->anchors; + } + + /** + * Output only. List of the anchors of the citations. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.CitationAnchor anchors = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\CitationAnchor[] $var + * @return $this + */ + public function setAnchors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GeminiDataAnalytics\V1\CitationAnchor::class); + $this->anchors = $arr; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/CitationAnchor.php b/GeminiDataAnalytics/src/V1/CitationAnchor.php new file mode 100644 index 000000000000..b62b20cd7a39 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/CitationAnchor.php @@ -0,0 +1,75 @@ +google.cloud.geminidataanalytics.v1.CitationAnchor + */ +class CitationAnchor extends \Google\Protobuf\Internal\Message +{ + protected $anchor_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\GeminiDataAnalytics\V1\CitationAnchor\TextMessageCitationAnchor $text_message_anchor + * Output only. Only set if the citation is for a TextMessage. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Context::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Only set if the citation is for a TextMessage. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.CitationAnchor.TextMessageCitationAnchor text_message_anchor = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\GeminiDataAnalytics\V1\CitationAnchor\TextMessageCitationAnchor|null + */ + public function getTextMessageAnchor() + { + return $this->readOneof(1); + } + + public function hasTextMessageAnchor() + { + return $this->hasOneof(1); + } + + /** + * Output only. Only set if the citation is for a TextMessage. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.CitationAnchor.TextMessageCitationAnchor text_message_anchor = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\CitationAnchor\TextMessageCitationAnchor $var + * @return $this + */ + public function setTextMessageAnchor($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\CitationAnchor\TextMessageCitationAnchor::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getAnchorType() + { + return $this->whichOneof("anchor_type"); + } + +} + diff --git a/GeminiDataAnalytics/src/V1/CitationAnchor/TextMessageCitationAnchor.php b/GeminiDataAnalytics/src/V1/CitationAnchor/TextMessageCitationAnchor.php new file mode 100644 index 000000000000..b3b40a3b811d --- /dev/null +++ b/GeminiDataAnalytics/src/V1/CitationAnchor/TextMessageCitationAnchor.php @@ -0,0 +1,197 @@ +google.cloud.geminidataanalytics.v1.CitationAnchor.TextMessageCitationAnchor + */ +class TextMessageCitationAnchor extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The 0-based index of the part within the TextMessage.parts + * field. + * + * Generated from protobuf field int32 part_index = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $part_index = 0; + /** + * Output only. The offset, measured in UTF-8 bytes, within the part string + * where the citation begins (inclusive). Example: For the text "Hello, + * world" where "world" is cited, the start offset bytes (inclusive) is 7 + * and the end offset bytes (exclusive) is 12. + * + * Generated from protobuf field int32 start_offset_bytes = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $start_offset_bytes = 0; + /** + * Output only. The offset, measured in UTF-8 bytes, within the part string + * where the citation ends (exclusive). Example: For the text "Hello, world" + * where "world" is cited, the start offset bytes (inclusive) is 7 and the + * end offset bytes (exclusive) is 12. + * + * Generated from protobuf field int32 end_offset_bytes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_offset_bytes = 0; + /** + * Output only. The ids of the sources that are cited. + * + * Generated from protobuf field repeated string source_ids = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $source_ids; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $part_index + * Output only. The 0-based index of the part within the TextMessage.parts + * field. + * @type int $start_offset_bytes + * Output only. The offset, measured in UTF-8 bytes, within the part string + * where the citation begins (inclusive). Example: For the text "Hello, + * world" where "world" is cited, the start offset bytes (inclusive) is 7 + * and the end offset bytes (exclusive) is 12. + * @type int $end_offset_bytes + * Output only. The offset, measured in UTF-8 bytes, within the part string + * where the citation ends (exclusive). Example: For the text "Hello, world" + * where "world" is cited, the start offset bytes (inclusive) is 7 and the + * end offset bytes (exclusive) is 12. + * @type string[] $source_ids + * Output only. The ids of the sources that are cited. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Context::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The 0-based index of the part within the TextMessage.parts + * field. + * + * Generated from protobuf field int32 part_index = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getPartIndex() + { + return $this->part_index; + } + + /** + * Output only. The 0-based index of the part within the TextMessage.parts + * field. + * + * Generated from protobuf field int32 part_index = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setPartIndex($var) + { + GPBUtil::checkInt32($var); + $this->part_index = $var; + + return $this; + } + + /** + * Output only. The offset, measured in UTF-8 bytes, within the part string + * where the citation begins (inclusive). Example: For the text "Hello, + * world" where "world" is cited, the start offset bytes (inclusive) is 7 + * and the end offset bytes (exclusive) is 12. + * + * Generated from protobuf field int32 start_offset_bytes = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getStartOffsetBytes() + { + return $this->start_offset_bytes; + } + + /** + * Output only. The offset, measured in UTF-8 bytes, within the part string + * where the citation begins (inclusive). Example: For the text "Hello, + * world" where "world" is cited, the start offset bytes (inclusive) is 7 + * and the end offset bytes (exclusive) is 12. + * + * Generated from protobuf field int32 start_offset_bytes = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setStartOffsetBytes($var) + { + GPBUtil::checkInt32($var); + $this->start_offset_bytes = $var; + + return $this; + } + + /** + * Output only. The offset, measured in UTF-8 bytes, within the part string + * where the citation ends (exclusive). Example: For the text "Hello, world" + * where "world" is cited, the start offset bytes (inclusive) is 7 and the + * end offset bytes (exclusive) is 12. + * + * Generated from protobuf field int32 end_offset_bytes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getEndOffsetBytes() + { + return $this->end_offset_bytes; + } + + /** + * Output only. The offset, measured in UTF-8 bytes, within the part string + * where the citation ends (exclusive). Example: For the text "Hello, world" + * where "world" is cited, the start offset bytes (inclusive) is 7 and the + * end offset bytes (exclusive) is 12. + * + * Generated from protobuf field int32 end_offset_bytes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setEndOffsetBytes($var) + { + GPBUtil::checkInt32($var); + $this->end_offset_bytes = $var; + + return $this; + } + + /** + * Output only. The ids of the sources that are cited. + * + * Generated from protobuf field repeated string source_ids = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return RepeatedField + */ + public function getSourceIds() + { + return $this->source_ids; + } + + /** + * Output only. The ids of the sources that are cited. + * + * Generated from protobuf field repeated string source_ids = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string[] $var + * @return $this + */ + public function setSourceIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->source_ids = $arr; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/CitationSource.php b/GeminiDataAnalytics/src/V1/CitationSource.php new file mode 100644 index 000000000000..46196e350386 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/CitationSource.php @@ -0,0 +1,213 @@ +google.cloud.geminidataanalytics.v1.CitationSource + */ +class CitationSource extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Unique identifier of the source. This ID is service-generated + * and is unique within the scope of a single `Citation` message. + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $id = ''; + /** + * Output only. The title of the source. + * + * Generated from protobuf field string title = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $title = ''; + protected $source_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * Output only. The uri used as the source, such as a web grounding URL. + * @type \Google\Cloud\GeminiDataAnalytics\V1\ExampleQuery $example_query + * Output only. The example query used as the source. + * @type \Google\Cloud\GeminiDataAnalytics\V1\GlossaryTerm $glossary_term + * Output only. The glossary term used as the source. + * @type string $id + * Output only. Unique identifier of the source. This ID is service-generated + * and is unique within the scope of a single `Citation` message. + * @type string $title + * Output only. The title of the source. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Context::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The uri used as the source, such as a web grounding URL. + * + * Generated from protobuf field string uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUri() + { + return $this->readOneof(3); + } + + public function hasUri() + { + return $this->hasOneof(3); + } + + /** + * Output only. The uri used as the source, such as a web grounding URL. + * + * Generated from protobuf field string uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Output only. The example query used as the source. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.ExampleQuery example_query = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\GeminiDataAnalytics\V1\ExampleQuery|null + */ + public function getExampleQuery() + { + return $this->readOneof(4); + } + + public function hasExampleQuery() + { + return $this->hasOneof(4); + } + + /** + * Output only. The example query used as the source. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.ExampleQuery example_query = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\ExampleQuery $var + * @return $this + */ + public function setExampleQuery($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\ExampleQuery::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Output only. The glossary term used as the source. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.GlossaryTerm glossary_term = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\GeminiDataAnalytics\V1\GlossaryTerm|null + */ + public function getGlossaryTerm() + { + return $this->readOneof(5); + } + + public function hasGlossaryTerm() + { + return $this->hasOneof(5); + } + + /** + * Output only. The glossary term used as the source. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.GlossaryTerm glossary_term = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\GlossaryTerm $var + * @return $this + */ + public function setGlossaryTerm($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\GlossaryTerm::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Output only. Unique identifier of the source. This ID is service-generated + * and is unique within the scope of a single `Citation` message. + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * Output only. Unique identifier of the source. This ID is service-generated + * and is unique within the scope of a single `Citation` message. + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * Output only. The title of the source. + * + * Generated from protobuf field string title = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Output only. The title of the source. + * + * Generated from protobuf field string title = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * @return string + */ + public function getSourceType() + { + return $this->whichOneof("source_type"); + } + +} + diff --git a/GeminiDataAnalytics/src/V1/Client/DataAgentServiceClient.php b/GeminiDataAnalytics/src/V1/Client/DataAgentServiceClient.php new file mode 100644 index 000000000000..c92752a702f8 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/Client/DataAgentServiceClient.php @@ -0,0 +1,700 @@ + createDataAgentAsync(CreateDataAgentRequest $request, array $optionalArgs = []) + * @method PromiseInterface createDataAgentSyncAsync(CreateDataAgentRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteDataAgentAsync(DeleteDataAgentRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteDataAgentSyncAsync(DeleteDataAgentRequest $request, array $optionalArgs = []) + * @method PromiseInterface getDataAgentAsync(GetDataAgentRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAccessibleDataAgentsAsync(ListAccessibleDataAgentsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listDataAgentsAsync(ListDataAgentsRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateDataAgentAsync(UpdateDataAgentRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateDataAgentSyncAsync(UpdateDataAgentRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class DataAgentServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.geminidataanalytics.v1.DataAgentService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'geminidataanalytics.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'geminidataanalytics.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = ['https://www.googleapis.com/auth/cloud-platform']; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/data_agent_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/data_agent_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/data_agent_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/data_agent_service_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 = $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 crypto_key + * resource. + * + * @param string $project + * @param string $location + * @param string $keyRing + * @param string $cryptoKey + * + * @return string The formatted crypto_key resource. + */ + public static function cryptoKeyName(string $project, string $location, string $keyRing, string $cryptoKey): string + { + return self::getPathTemplate('cryptoKey')->render([ + 'project' => $project, + 'location' => $location, + 'key_ring' => $keyRing, + 'crypto_key' => $cryptoKey, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a data_agent + * resource. + * + * @param string $project + * @param string $location + * @param string $dataAgent + * + * @return string The formatted data_agent resource. + */ + public static function dataAgentName(string $project, string $location, string $dataAgent): string + { + return self::getPathTemplate('dataAgent')->render([ + 'project' => $project, + 'location' => $location, + 'data_agent' => $dataAgent, + ]); + } + + /** + * 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, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - cryptoKey: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key} + * - dataAgent: projects/{project}/locations/{location}/dataAgents/{data_agent} + * - location: projects/{project}/locations/{location} + * + * 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|ClientOptions $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 'geminidataanalytics.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\GeminiDataAnalytics\V1\DataAgentServiceClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new DataAgentServiceClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $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 new DataAgent in a given project and location. + * + * The async variant is {@see DataAgentServiceClient::createDataAgentAsync()} . + * + * @example samples/V1/DataAgentServiceClient/create_data_agent.php + * + * @param CreateDataAgentRequest $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 createDataAgent(CreateDataAgentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateDataAgent', $request, $callOptions)->wait(); + } + + /** + * Creates a new DataAgent in a given project and location synchronously. + * + * The async variant is {@see DataAgentServiceClient::createDataAgentSyncAsync()} . + * + * @example samples/V1/DataAgentServiceClient/create_data_agent_sync.php + * + * @param CreateDataAgentRequest $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 DataAgent + * + * @throws ApiException Thrown if the API call fails. + */ + public function createDataAgentSync(CreateDataAgentRequest $request, array $callOptions = []): DataAgent + { + return $this->startApiCall('CreateDataAgentSync', $request, $callOptions)->wait(); + } + + /** + * Deletes a single DataAgent. + * + * The async variant is {@see DataAgentServiceClient::deleteDataAgentAsync()} . + * + * @example samples/V1/DataAgentServiceClient/delete_data_agent.php + * + * @param DeleteDataAgentRequest $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 deleteDataAgent(DeleteDataAgentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteDataAgent', $request, $callOptions)->wait(); + } + + /** + * Deletes a single DataAgent synchronously. + * + * The async variant is {@see DataAgentServiceClient::deleteDataAgentSyncAsync()} . + * + * @example samples/V1/DataAgentServiceClient/delete_data_agent_sync.php + * + * @param DeleteDataAgentRequest $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. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteDataAgentSync(DeleteDataAgentRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteDataAgentSync', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single DataAgent. + * + * The async variant is {@see DataAgentServiceClient::getDataAgentAsync()} . + * + * @example samples/V1/DataAgentServiceClient/get_data_agent.php + * + * @param GetDataAgentRequest $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 DataAgent + * + * @throws ApiException Thrown if the API call fails. + */ + public function getDataAgent(GetDataAgentRequest $request, array $callOptions = []): DataAgent + { + return $this->startApiCall('GetDataAgent', $request, $callOptions)->wait(); + } + + /** + * Gets the IAM policy for DataAgent + * + * The async variant is {@see DataAgentServiceClient::getIamPolicyAsync()} . + * + * @example samples/V1/DataAgentServiceClient/get_iam_policy.php + * + * @param GetIamPolicyRequest $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 Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Lists DataAgents that are accessible to the caller in a given project and + * location. + * + * The async variant is + * {@see DataAgentServiceClient::listAccessibleDataAgentsAsync()} . + * + * @example samples/V1/DataAgentServiceClient/list_accessible_data_agents.php + * + * @param ListAccessibleDataAgentsRequest $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 listAccessibleDataAgents( + ListAccessibleDataAgentsRequest $request, + array $callOptions = [] + ): PagedListResponse { + return $this->startApiCall('ListAccessibleDataAgents', $request, $callOptions); + } + + /** + * Lists DataAgents in a given project and location. + * + * The async variant is {@see DataAgentServiceClient::listDataAgentsAsync()} . + * + * @example samples/V1/DataAgentServiceClient/list_data_agents.php + * + * @param ListDataAgentsRequest $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 listDataAgents(ListDataAgentsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListDataAgents', $request, $callOptions); + } + + /** + * Sets the IAM policy for a DataAgent. + * + * The async variant is {@see DataAgentServiceClient::setIamPolicyAsync()} . + * + * @example samples/V1/DataAgentServiceClient/set_iam_policy.php + * + * @param SetIamPolicyRequest $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 Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Updates the parameters of a single DataAgent. + * + * The async variant is {@see DataAgentServiceClient::updateDataAgentAsync()} . + * + * @example samples/V1/DataAgentServiceClient/update_data_agent.php + * + * @param UpdateDataAgentRequest $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 updateDataAgent(UpdateDataAgentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateDataAgent', $request, $callOptions)->wait(); + } + + /** + * Updates the parameters of a single DataAgent synchronously. + * + * The async variant is {@see DataAgentServiceClient::updateDataAgentSyncAsync()} . + * + * @example samples/V1/DataAgentServiceClient/update_data_agent_sync.php + * + * @param UpdateDataAgentRequest $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 DataAgent + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateDataAgentSync(UpdateDataAgentRequest $request, array $callOptions = []): DataAgent + { + return $this->startApiCall('UpdateDataAgentSync', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see DataAgentServiceClient::getLocationAsync()} . + * + * @example samples/V1/DataAgentServiceClient/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. + + This method lists locations based on the resource scope provided in + the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * + **Global locations**: If `name` is empty, the method lists the + public locations available to all projects. * **Project-specific + locations**: If `name` follows the format + `projects/{project}`, the method lists locations visible to that + specific project. This includes public, private, or other + project-specific locations enabled for the project. + + For gRPC and client library implementations, the resource name is + passed as the `name` field. For direct service calls, the resource + name is + incorporated into the request path based on the specific service + implementation and version. + * + * The async variant is {@see DataAgentServiceClient::listLocationsAsync()} . + * + * @example samples/V1/DataAgentServiceClient/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/GeminiDataAnalytics/src/V1/Client/DataChatServiceClient.php b/GeminiDataAnalytics/src/V1/Client/DataChatServiceClient.php new file mode 100644 index 000000000000..2fb286ee02dd --- /dev/null +++ b/GeminiDataAnalytics/src/V1/Client/DataChatServiceClient.php @@ -0,0 +1,525 @@ + createConversationAsync(CreateConversationRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteConversationAsync(DeleteConversationRequest $request, array $optionalArgs = []) + * @method PromiseInterface getConversationAsync(GetConversationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listConversationsAsync(ListConversationsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listMessagesAsync(ListMessagesRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class DataChatServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.geminidataanalytics.v1.DataChatService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'geminidataanalytics.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'geminidataanalytics.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = ['https://www.googleapis.com/auth/cloud-platform']; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/data_chat_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/data_chat_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/data_chat_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/data_chat_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a conversation + * resource. + * + * @param string $project + * @param string $location + * @param string $conversation + * + * @return string The formatted conversation resource. + */ + public static function conversationName(string $project, string $location, string $conversation): string + { + return self::getPathTemplate('conversation')->render([ + 'project' => $project, + 'location' => $location, + 'conversation' => $conversation, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a crypto_key + * resource. + * + * @param string $project + * @param string $location + * @param string $keyRing + * @param string $cryptoKey + * + * @return string The formatted crypto_key resource. + */ + public static function cryptoKeyName(string $project, string $location, string $keyRing, string $cryptoKey): string + { + return self::getPathTemplate('cryptoKey')->render([ + 'project' => $project, + 'location' => $location, + 'key_ring' => $keyRing, + 'crypto_key' => $cryptoKey, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a data_agent + * resource. + * + * @param string $project + * @param string $location + * @param string $dataAgent + * + * @return string The formatted data_agent resource. + */ + public static function dataAgentName(string $project, string $location, string $dataAgent): string + { + return self::getPathTemplate('dataAgent')->render([ + 'project' => $project, + 'location' => $location, + 'data_agent' => $dataAgent, + ]); + } + + /** + * 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, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - conversation: projects/{project}/locations/{location}/conversations/{conversation} + * - cryptoKey: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key} + * - dataAgent: projects/{project}/locations/{location}/dataAgents/{data_agent} + * - location: projects/{project}/locations/{location} + * + * 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|ClientOptions $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 'geminidataanalytics.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\GeminiDataAnalytics\V1\DataChatServiceClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new DataChatServiceClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $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); + } + + /** + * Answers a data question by generating a stream of + * [Message][google.cloud.geminidataanalytics.v1.Message] objects. + * + * @example samples/V1/DataChatServiceClient/chat.php + * + * @param ChatRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type int $timeoutMillis + * Timeout to use for this call. + * } + * + * @return ServerStream + * + * @throws ApiException Thrown if the API call fails. + */ + public function chat(ChatRequest $request, array $callOptions = []): ServerStream + { + return $this->startApiCall('Chat', $request, $callOptions); + } + + /** + * Creates a new conversation to persist the conversation history. Each + * conversation will have multiple messages associated with it. + * + * The async variant is {@see DataChatServiceClient::createConversationAsync()} . + * + * @example samples/V1/DataChatServiceClient/create_conversation.php + * + * @param CreateConversationRequest $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 Conversation + * + * @throws ApiException Thrown if the API call fails. + */ + public function createConversation(CreateConversationRequest $request, array $callOptions = []): Conversation + { + return $this->startApiCall('CreateConversation', $request, $callOptions)->wait(); + } + + /** + * Deletes a conversation. + * + * The async variant is {@see DataChatServiceClient::deleteConversationAsync()} . + * + * @example samples/V1/DataChatServiceClient/delete_conversation.php + * + * @param DeleteConversationRequest $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. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteConversation(DeleteConversationRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteConversation', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single conversation by using conversation id and parent. + * + * The async variant is {@see DataChatServiceClient::getConversationAsync()} . + * + * @example samples/V1/DataChatServiceClient/get_conversation.php + * + * @param GetConversationRequest $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 Conversation + * + * @throws ApiException Thrown if the API call fails. + */ + public function getConversation(GetConversationRequest $request, array $callOptions = []): Conversation + { + return $this->startApiCall('GetConversation', $request, $callOptions)->wait(); + } + + /** + * Lists all conversations for a given parent. + * + * The async variant is {@see DataChatServiceClient::listConversationsAsync()} . + * + * @example samples/V1/DataChatServiceClient/list_conversations.php + * + * @param ListConversationsRequest $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 listConversations(ListConversationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListConversations', $request, $callOptions); + } + + /** + * Lists all messages for a given conversation. + * + * The async variant is {@see DataChatServiceClient::listMessagesAsync()} . + * + * @example samples/V1/DataChatServiceClient/list_messages.php + * + * @param ListMessagesRequest $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 listMessages(ListMessagesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListMessages', $request, $callOptions); + } + + /** + * Gets information about a location. + * + * The async variant is {@see DataChatServiceClient::getLocationAsync()} . + * + * @example samples/V1/DataChatServiceClient/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. + + This method lists locations based on the resource scope provided in + the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * + **Global locations**: If `name` is empty, the method lists the + public locations available to all projects. * **Project-specific + locations**: If `name` follows the format + `projects/{project}`, the method lists locations visible to that + specific project. This includes public, private, or other + project-specific locations enabled for the project. + + For gRPC and client library implementations, the resource name is + passed as the `name` field. For direct service calls, the resource + name is + incorporated into the request path based on the specific service + implementation and version. + * + * The async variant is {@see DataChatServiceClient::listLocationsAsync()} . + * + * @example samples/V1/DataChatServiceClient/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/GeminiDataAnalytics/src/V1/ClientManagedResourceContext.php b/GeminiDataAnalytics/src/V1/ClientManagedResourceContext.php new file mode 100644 index 000000000000..acc25464673c --- /dev/null +++ b/GeminiDataAnalytics/src/V1/ClientManagedResourceContext.php @@ -0,0 +1,152 @@ +google.cloud.geminidataanalytics.v1.ClientManagedResourceContext + */ +class ClientManagedResourceContext extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Context for the chat request. Use this to chat without GDA API + * managed conversation and agent persistence by passing all context inline. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Context inline_context = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $inline_context = null; + /** + * Optional. The client managed conversation id. + * + * Generated from protobuf field string conversation_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $conversation_id = ''; + /** + * Optional. The client managed agent id. + * + * Generated from protobuf field string agent_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $agent_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\GeminiDataAnalytics\V1\Context $inline_context + * Required. Context for the chat request. Use this to chat without GDA API + * managed conversation and agent persistence by passing all context inline. + * @type string $conversation_id + * Optional. The client managed conversation id. + * @type string $agent_id + * Optional. The client managed agent id. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\DataChatService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Context for the chat request. Use this to chat without GDA API + * managed conversation and agent persistence by passing all context inline. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Context inline_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\GeminiDataAnalytics\V1\Context|null + */ + public function getInlineContext() + { + return $this->inline_context; + } + + public function hasInlineContext() + { + return isset($this->inline_context); + } + + public function clearInlineContext() + { + unset($this->inline_context); + } + + /** + * Required. Context for the chat request. Use this to chat without GDA API + * managed conversation and agent persistence by passing all context inline. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Context inline_context = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\Context $var + * @return $this + */ + public function setInlineContext($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\Context::class); + $this->inline_context = $var; + + return $this; + } + + /** + * Optional. The client managed conversation id. + * + * Generated from protobuf field string conversation_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getConversationId() + { + return $this->conversation_id; + } + + /** + * Optional. The client managed conversation id. + * + * Generated from protobuf field string conversation_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setConversationId($var) + { + GPBUtil::checkString($var, True); + $this->conversation_id = $var; + + return $this; + } + + /** + * Optional. The client managed agent id. + * + * Generated from protobuf field string agent_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAgentId() + { + return $this->agent_id; + } + + /** + * Optional. The client managed agent id. + * + * Generated from protobuf field string agent_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAgentId($var) + { + GPBUtil::checkString($var, True); + $this->agent_id = $var; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/Context.php b/GeminiDataAnalytics/src/V1/Context.php new file mode 100644 index 000000000000..a3c7300eadbc --- /dev/null +++ b/GeminiDataAnalytics/src/V1/Context.php @@ -0,0 +1,379 @@ +google.cloud.geminidataanalytics.v1.Context + */ +class Context extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The basic entry point for data owners creating domain knowledge + * for Agent. + * Why: Business jargon (e.g., YTD revenue is calculated as…, Retirement Age + * is 65 in the USA, etc) and system instructions (e.g., answer like a Pirate) + * can help the model understand the business context around a user question. + * + * Generated from protobuf field string system_instruction = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $system_instruction = ''; + /** + * Required. Data sources that are available for answering the question. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.DatasourceReferences datasource_references = 7 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $datasource_references = null; + /** + * Optional. Additional options for the conversation. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.ConversationOptions options = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $options = null; + /** + * Optional. A list of example queries, providing examples of relevant and + * commonly used SQL queries and their corresponding natural language queries + * optionally present. Currently only used for BigQuery data sources and + * databases (alloydb, cloudsql, spanner) data sources. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.ExampleQuery example_queries = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $example_queries; + /** + * Optional. A list of golden queries, providing examples of relevant and + * commonly used Looker queries and their corresponding natural language + * queries optionally present. Only supported for Looker data sources. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.LookerGoldenQuery looker_golden_queries = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $looker_golden_queries; + /** + * Optional. Term definitions (currently, only user authored) + * Not supported for databases (alloydb, cloudsql, spanner) data sources. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.GlossaryTerm glossary_terms = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $glossary_terms; + /** + * Optional. Relationships between table schema, including referencing and + * referenced columns. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.Context.SchemaRelationship schema_relationships = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $schema_relationships; + /** + * Optional. A collection of user functions to be included in context. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.UserFunctions user_functions = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $user_functions = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $system_instruction + * Optional. The basic entry point for data owners creating domain knowledge + * for Agent. + * Why: Business jargon (e.g., YTD revenue is calculated as…, Retirement Age + * is 65 in the USA, etc) and system instructions (e.g., answer like a Pirate) + * can help the model understand the business context around a user question. + * @type \Google\Cloud\GeminiDataAnalytics\V1\DatasourceReferences $datasource_references + * Required. Data sources that are available for answering the question. + * @type \Google\Cloud\GeminiDataAnalytics\V1\ConversationOptions $options + * Optional. Additional options for the conversation. + * @type \Google\Cloud\GeminiDataAnalytics\V1\ExampleQuery[] $example_queries + * Optional. A list of example queries, providing examples of relevant and + * commonly used SQL queries and their corresponding natural language queries + * optionally present. Currently only used for BigQuery data sources and + * databases (alloydb, cloudsql, spanner) data sources. + * @type \Google\Cloud\GeminiDataAnalytics\V1\LookerGoldenQuery[] $looker_golden_queries + * Optional. A list of golden queries, providing examples of relevant and + * commonly used Looker queries and their corresponding natural language + * queries optionally present. Only supported for Looker data sources. + * @type \Google\Cloud\GeminiDataAnalytics\V1\GlossaryTerm[] $glossary_terms + * Optional. Term definitions (currently, only user authored) + * Not supported for databases (alloydb, cloudsql, spanner) data sources. + * @type \Google\Cloud\GeminiDataAnalytics\V1\Context\SchemaRelationship[] $schema_relationships + * Optional. Relationships between table schema, including referencing and + * referenced columns. + * @type \Google\Cloud\GeminiDataAnalytics\V1\UserFunctions $user_functions + * Optional. A collection of user functions to be included in context. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Context::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The basic entry point for data owners creating domain knowledge + * for Agent. + * Why: Business jargon (e.g., YTD revenue is calculated as…, Retirement Age + * is 65 in the USA, etc) and system instructions (e.g., answer like a Pirate) + * can help the model understand the business context around a user question. + * + * Generated from protobuf field string system_instruction = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSystemInstruction() + { + return $this->system_instruction; + } + + /** + * Optional. The basic entry point for data owners creating domain knowledge + * for Agent. + * Why: Business jargon (e.g., YTD revenue is calculated as…, Retirement Age + * is 65 in the USA, etc) and system instructions (e.g., answer like a Pirate) + * can help the model understand the business context around a user question. + * + * Generated from protobuf field string system_instruction = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSystemInstruction($var) + { + GPBUtil::checkString($var, True); + $this->system_instruction = $var; + + return $this; + } + + /** + * Required. Data sources that are available for answering the question. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.DatasourceReferences datasource_references = 7 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\GeminiDataAnalytics\V1\DatasourceReferences|null + */ + public function getDatasourceReferences() + { + return $this->datasource_references; + } + + public function hasDatasourceReferences() + { + return isset($this->datasource_references); + } + + public function clearDatasourceReferences() + { + unset($this->datasource_references); + } + + /** + * Required. Data sources that are available for answering the question. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.DatasourceReferences datasource_references = 7 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\DatasourceReferences $var + * @return $this + */ + public function setDatasourceReferences($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\DatasourceReferences::class); + $this->datasource_references = $var; + + return $this; + } + + /** + * Optional. Additional options for the conversation. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.ConversationOptions options = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\GeminiDataAnalytics\V1\ConversationOptions|null + */ + public function getOptions() + { + return $this->options; + } + + public function hasOptions() + { + return isset($this->options); + } + + public function clearOptions() + { + unset($this->options); + } + + /** + * Optional. Additional options for the conversation. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.ConversationOptions options = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\ConversationOptions $var + * @return $this + */ + public function setOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\ConversationOptions::class); + $this->options = $var; + + return $this; + } + + /** + * Optional. A list of example queries, providing examples of relevant and + * commonly used SQL queries and their corresponding natural language queries + * optionally present. Currently only used for BigQuery data sources and + * databases (alloydb, cloudsql, spanner) data sources. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.ExampleQuery example_queries = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\GeminiDataAnalytics\V1\ExampleQuery> + */ + public function getExampleQueries() + { + return $this->example_queries; + } + + /** + * Optional. A list of example queries, providing examples of relevant and + * commonly used SQL queries and their corresponding natural language queries + * optionally present. Currently only used for BigQuery data sources and + * databases (alloydb, cloudsql, spanner) data sources. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.ExampleQuery example_queries = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\ExampleQuery[] $var + * @return $this + */ + public function setExampleQueries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GeminiDataAnalytics\V1\ExampleQuery::class); + $this->example_queries = $arr; + + return $this; + } + + /** + * Optional. A list of golden queries, providing examples of relevant and + * commonly used Looker queries and their corresponding natural language + * queries optionally present. Only supported for Looker data sources. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.LookerGoldenQuery looker_golden_queries = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\GeminiDataAnalytics\V1\LookerGoldenQuery> + */ + public function getLookerGoldenQueries() + { + return $this->looker_golden_queries; + } + + /** + * Optional. A list of golden queries, providing examples of relevant and + * commonly used Looker queries and their corresponding natural language + * queries optionally present. Only supported for Looker data sources. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.LookerGoldenQuery looker_golden_queries = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\LookerGoldenQuery[] $var + * @return $this + */ + public function setLookerGoldenQueries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GeminiDataAnalytics\V1\LookerGoldenQuery::class); + $this->looker_golden_queries = $arr; + + return $this; + } + + /** + * Optional. Term definitions (currently, only user authored) + * Not supported for databases (alloydb, cloudsql, spanner) data sources. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.GlossaryTerm glossary_terms = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\GeminiDataAnalytics\V1\GlossaryTerm> + */ + public function getGlossaryTerms() + { + return $this->glossary_terms; + } + + /** + * Optional. Term definitions (currently, only user authored) + * Not supported for databases (alloydb, cloudsql, spanner) data sources. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.GlossaryTerm glossary_terms = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\GlossaryTerm[] $var + * @return $this + */ + public function setGlossaryTerms($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GeminiDataAnalytics\V1\GlossaryTerm::class); + $this->glossary_terms = $arr; + + return $this; + } + + /** + * Optional. Relationships between table schema, including referencing and + * referenced columns. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.Context.SchemaRelationship schema_relationships = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\GeminiDataAnalytics\V1\Context\SchemaRelationship> + */ + public function getSchemaRelationships() + { + return $this->schema_relationships; + } + + /** + * Optional. Relationships between table schema, including referencing and + * referenced columns. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.Context.SchemaRelationship schema_relationships = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\Context\SchemaRelationship[] $var + * @return $this + */ + public function setSchemaRelationships($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GeminiDataAnalytics\V1\Context\SchemaRelationship::class); + $this->schema_relationships = $arr; + + return $this; + } + + /** + * Optional. A collection of user functions to be included in context. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.UserFunctions user_functions = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\GeminiDataAnalytics\V1\UserFunctions|null + */ + public function getUserFunctions() + { + return $this->user_functions; + } + + public function hasUserFunctions() + { + return isset($this->user_functions); + } + + public function clearUserFunctions() + { + unset($this->user_functions); + } + + /** + * Optional. A collection of user functions to be included in context. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.UserFunctions user_functions = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\UserFunctions $var + * @return $this + */ + public function setUserFunctions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\UserFunctions::class); + $this->user_functions = $var; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/Context/SchemaRelationship.php b/GeminiDataAnalytics/src/V1/Context/SchemaRelationship.php new file mode 100644 index 000000000000..22e212aad9a3 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/Context/SchemaRelationship.php @@ -0,0 +1,219 @@ +google.cloud.geminidataanalytics.v1.Context.SchemaRelationship + */ +class SchemaRelationship extends \Google\Protobuf\Internal\Message +{ + /** + * An ordered list of fields for the join from the first table. + * The size of this list must be the same as `right_schema_paths`. + * Each field at index i in this list must correspond to a field at the same + * index in the `right_schema_paths` list. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Context.SchemaRelationship.SchemaPaths left_schema_paths = 1; + */ + protected $left_schema_paths = null; + /** + * An ordered list of fields for the join from the second table. + * The size of this list must be the same as `left_schema_paths`. + * Each field at index i in this list must correspond to a field at the same + * index in the `left_schema_paths` list. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Context.SchemaRelationship.SchemaPaths right_schema_paths = 2; + */ + protected $right_schema_paths = null; + /** + * Optional. Sources which generated the schema relation edge. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.Context.SchemaRelationship.Source sources = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $sources; + /** + * Optional. A confidence score for the suggested relationship. + * Manually added edges have the highest confidence score. + * + * Generated from protobuf field float confidence_score = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $confidence_score = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\GeminiDataAnalytics\V1\Context\SchemaRelationship\SchemaPaths $left_schema_paths + * An ordered list of fields for the join from the first table. + * The size of this list must be the same as `right_schema_paths`. + * Each field at index i in this list must correspond to a field at the same + * index in the `right_schema_paths` list. + * @type \Google\Cloud\GeminiDataAnalytics\V1\Context\SchemaRelationship\SchemaPaths $right_schema_paths + * An ordered list of fields for the join from the second table. + * The size of this list must be the same as `left_schema_paths`. + * Each field at index i in this list must correspond to a field at the same + * index in the `left_schema_paths` list. + * @type int[] $sources + * Optional. Sources which generated the schema relation edge. + * @type float $confidence_score + * Optional. A confidence score for the suggested relationship. + * Manually added edges have the highest confidence score. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Context::initOnce(); + parent::__construct($data); + } + + /** + * An ordered list of fields for the join from the first table. + * The size of this list must be the same as `right_schema_paths`. + * Each field at index i in this list must correspond to a field at the same + * index in the `right_schema_paths` list. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Context.SchemaRelationship.SchemaPaths left_schema_paths = 1; + * @return \Google\Cloud\GeminiDataAnalytics\V1\Context\SchemaRelationship\SchemaPaths|null + */ + public function getLeftSchemaPaths() + { + return $this->left_schema_paths; + } + + public function hasLeftSchemaPaths() + { + return isset($this->left_schema_paths); + } + + public function clearLeftSchemaPaths() + { + unset($this->left_schema_paths); + } + + /** + * An ordered list of fields for the join from the first table. + * The size of this list must be the same as `right_schema_paths`. + * Each field at index i in this list must correspond to a field at the same + * index in the `right_schema_paths` list. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Context.SchemaRelationship.SchemaPaths left_schema_paths = 1; + * @param \Google\Cloud\GeminiDataAnalytics\V1\Context\SchemaRelationship\SchemaPaths $var + * @return $this + */ + public function setLeftSchemaPaths($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\Context\SchemaRelationship\SchemaPaths::class); + $this->left_schema_paths = $var; + + return $this; + } + + /** + * An ordered list of fields for the join from the second table. + * The size of this list must be the same as `left_schema_paths`. + * Each field at index i in this list must correspond to a field at the same + * index in the `left_schema_paths` list. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Context.SchemaRelationship.SchemaPaths right_schema_paths = 2; + * @return \Google\Cloud\GeminiDataAnalytics\V1\Context\SchemaRelationship\SchemaPaths|null + */ + public function getRightSchemaPaths() + { + return $this->right_schema_paths; + } + + public function hasRightSchemaPaths() + { + return isset($this->right_schema_paths); + } + + public function clearRightSchemaPaths() + { + unset($this->right_schema_paths); + } + + /** + * An ordered list of fields for the join from the second table. + * The size of this list must be the same as `left_schema_paths`. + * Each field at index i in this list must correspond to a field at the same + * index in the `left_schema_paths` list. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Context.SchemaRelationship.SchemaPaths right_schema_paths = 2; + * @param \Google\Cloud\GeminiDataAnalytics\V1\Context\SchemaRelationship\SchemaPaths $var + * @return $this + */ + public function setRightSchemaPaths($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\Context\SchemaRelationship\SchemaPaths::class); + $this->right_schema_paths = $var; + + return $this; + } + + /** + * Optional. Sources which generated the schema relation edge. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.Context.SchemaRelationship.Source sources = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField + */ + public function getSources() + { + return $this->sources; + } + + /** + * Optional. Sources which generated the schema relation edge. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.Context.SchemaRelationship.Source sources = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int[] $var + * @return $this + */ + public function setSources($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\GeminiDataAnalytics\V1\Context\SchemaRelationship\Source::class); + $this->sources = $arr; + + return $this; + } + + /** + * Optional. A confidence score for the suggested relationship. + * Manually added edges have the highest confidence score. + * + * Generated from protobuf field float confidence_score = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getConfidenceScore() + { + return $this->confidence_score; + } + + /** + * Optional. A confidence score for the suggested relationship. + * Manually added edges have the highest confidence score. + * + * Generated from protobuf field float confidence_score = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setConfidenceScore($var) + { + GPBUtil::checkFloat($var); + $this->confidence_score = $var; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/Context/SchemaRelationship/SchemaPaths.php b/GeminiDataAnalytics/src/V1/Context/SchemaRelationship/SchemaPaths.php new file mode 100644 index 000000000000..9132b7b7362c --- /dev/null +++ b/GeminiDataAnalytics/src/V1/Context/SchemaRelationship/SchemaPaths.php @@ -0,0 +1,109 @@ +google.cloud.geminidataanalytics.v1.Context.SchemaRelationship.SchemaPaths + */ +class SchemaPaths extends \Google\Protobuf\Internal\Message +{ + /** + * The service-qualified full resource name of the table + * Ex: + * bigquery.googleapis.com/projects/PROJECT_ID/datasets/DATASET_ID/tables/TABLE_ID + * + * Generated from protobuf field string table_fqn = 1; + */ + protected $table_fqn = ''; + /** + * The ordered list of paths within the table schema. + * + * Generated from protobuf field repeated string paths = 2; + */ + private $paths; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $table_fqn + * The service-qualified full resource name of the table + * Ex: + * bigquery.googleapis.com/projects/PROJECT_ID/datasets/DATASET_ID/tables/TABLE_ID + * @type string[] $paths + * The ordered list of paths within the table schema. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Context::initOnce(); + parent::__construct($data); + } + + /** + * The service-qualified full resource name of the table + * Ex: + * bigquery.googleapis.com/projects/PROJECT_ID/datasets/DATASET_ID/tables/TABLE_ID + * + * Generated from protobuf field string table_fqn = 1; + * @return string + */ + public function getTableFqn() + { + return $this->table_fqn; + } + + /** + * The service-qualified full resource name of the table + * Ex: + * bigquery.googleapis.com/projects/PROJECT_ID/datasets/DATASET_ID/tables/TABLE_ID + * + * Generated from protobuf field string table_fqn = 1; + * @param string $var + * @return $this + */ + public function setTableFqn($var) + { + GPBUtil::checkString($var, True); + $this->table_fqn = $var; + + return $this; + } + + /** + * The ordered list of paths within the table schema. + * + * Generated from protobuf field repeated string paths = 2; + * @return RepeatedField + */ + public function getPaths() + { + return $this->paths; + } + + /** + * The ordered list of paths within the table schema. + * + * Generated from protobuf field repeated string paths = 2; + * @param string[] $var + * @return $this + */ + public function setPaths($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->paths = $arr; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/Context/SchemaRelationship/Source.php b/GeminiDataAnalytics/src/V1/Context/SchemaRelationship/Source.php new file mode 100644 index 000000000000..7005fc92287b --- /dev/null +++ b/GeminiDataAnalytics/src/V1/Context/SchemaRelationship/Source.php @@ -0,0 +1,68 @@ +google.cloud.geminidataanalytics.v1.Context.SchemaRelationship.Source + */ +class Source +{ + /** + * The source of the schema relationship is unspecified. + * + * Generated from protobuf enum SOURCE_UNSPECIFIED = 0; + */ + const SOURCE_UNSPECIFIED = 0; + /** + * The source of the schema relationship is BigQuery job history. + * + * Generated from protobuf enum BIGQUERY_JOB_HISTORY = 1; + */ + const BIGQUERY_JOB_HISTORY = 1; + /** + * The source of the schema relationship is LLM suggested. + * + * Generated from protobuf enum LLM_SUGGESTED = 2; + */ + const LLM_SUGGESTED = 2; + /** + * The source of the schema relationship is BigQuery table constraints. + * + * Generated from protobuf enum BIGQUERY_TABLE_CONSTRAINTS = 3; + */ + const BIGQUERY_TABLE_CONSTRAINTS = 3; + + private static $valueToName = [ + self::SOURCE_UNSPECIFIED => 'SOURCE_UNSPECIFIED', + self::BIGQUERY_JOB_HISTORY => 'BIGQUERY_JOB_HISTORY', + self::LLM_SUGGESTED => 'LLM_SUGGESTED', + self::BIGQUERY_TABLE_CONSTRAINTS => 'BIGQUERY_TABLE_CONSTRAINTS', + ]; + + 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/GeminiDataAnalytics/src/V1/Conversation.php b/GeminiDataAnalytics/src/V1/Conversation.php new file mode 100644 index 000000000000..3c1e3c3d568a --- /dev/null +++ b/GeminiDataAnalytics/src/V1/Conversation.php @@ -0,0 +1,383 @@ +google.cloud.geminidataanalytics.v1.Conversation + */ +class Conversation extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Identifier. The unique resource name of a conversation. Format: + * `projects/{project}/locations/{location}/conversations/{conversation_id}` + * `{conversation_id}` is the resource id and should be 63 characters or less + * and must match the format described in + * https://google.aip.dev/122#resource-id-segments + * Example: + * `projects/1234567890/locations/global/conversations/my-conversation`. + * It is recommended to skip setting this field during conversation creation + * as it will be inferred automatically and overwritten with the + * {parent}/conversations/{conversation_id}. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Required. Agent(s) in the conversation. + * Currently, only one agent is supported. This field is repeated to allow + * for future support of multiple agents in a conversation. + * Format: `projects/{project}/locations/{location}/dataAgents/{agent}` + * + * Generated from protobuf field repeated string agents = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $agents; + /** + * Output only. Creation timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Timestamp of the last used conversation. + * + * Generated from protobuf field .google.protobuf.Timestamp last_used_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $last_used_time = null; + /** + * Optional. Open-ended and user-defined labels that can be set by the client + * to tag a conversation (e.g. to filter conversations for specific + * surfaces/products). + * + * Generated from protobuf field map labels = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Optional. Customer managed encryption key (CMEK) to use for encrypting the + * Conversation resources. Encryption will happen at Titan layer, we will pass + * the KMS key to Titan. + * Format: + * projects/{project_id}/locations/{location}/keyRings/{key_ring_name}/cryptoKeys/{key_name}. + * + * Generated from protobuf field optional string kms_key = 10 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $kms_key = null; + /** + * Optional. Whether memory is paused for this conversation. + * + * Generated from protobuf field optional bool memory_paused = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $memory_paused = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Optional. Identifier. The unique resource name of a conversation. Format: + * `projects/{project}/locations/{location}/conversations/{conversation_id}` + * `{conversation_id}` is the resource id and should be 63 characters or less + * and must match the format described in + * https://google.aip.dev/122#resource-id-segments + * Example: + * `projects/1234567890/locations/global/conversations/my-conversation`. + * It is recommended to skip setting this field during conversation creation + * as it will be inferred automatically and overwritten with the + * {parent}/conversations/{conversation_id}. + * @type string[] $agents + * Required. Agent(s) in the conversation. + * Currently, only one agent is supported. This field is repeated to allow + * for future support of multiple agents in a conversation. + * Format: `projects/{project}/locations/{location}/dataAgents/{agent}` + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Creation timestamp. + * @type \Google\Protobuf\Timestamp $last_used_time + * Output only. Timestamp of the last used conversation. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Open-ended and user-defined labels that can be set by the client + * to tag a conversation (e.g. to filter conversations for specific + * surfaces/products). + * @type string $kms_key + * Optional. Customer managed encryption key (CMEK) to use for encrypting the + * Conversation resources. Encryption will happen at Titan layer, we will pass + * the KMS key to Titan. + * Format: + * projects/{project_id}/locations/{location}/keyRings/{key_ring_name}/cryptoKeys/{key_name}. + * @type bool $memory_paused + * Optional. Whether memory is paused for this conversation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Identifier. The unique resource name of a conversation. Format: + * `projects/{project}/locations/{location}/conversations/{conversation_id}` + * `{conversation_id}` is the resource id and should be 63 characters or less + * and must match the format described in + * https://google.aip.dev/122#resource-id-segments + * Example: + * `projects/1234567890/locations/global/conversations/my-conversation`. + * It is recommended to skip setting this field during conversation creation + * as it will be inferred automatically and overwritten with the + * {parent}/conversations/{conversation_id}. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Optional. Identifier. The unique resource name of a conversation. Format: + * `projects/{project}/locations/{location}/conversations/{conversation_id}` + * `{conversation_id}` is the resource id and should be 63 characters or less + * and must match the format described in + * https://google.aip.dev/122#resource-id-segments + * Example: + * `projects/1234567890/locations/global/conversations/my-conversation`. + * It is recommended to skip setting this field during conversation creation + * as it will be inferred automatically and overwritten with the + * {parent}/conversations/{conversation_id}. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Agent(s) in the conversation. + * Currently, only one agent is supported. This field is repeated to allow + * for future support of multiple agents in a conversation. + * Format: `projects/{project}/locations/{location}/dataAgents/{agent}` + * + * Generated from protobuf field repeated string agents = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return RepeatedField + */ + public function getAgents() + { + return $this->agents; + } + + /** + * Required. Agent(s) in the conversation. + * Currently, only one agent is supported. This field is repeated to allow + * for future support of multiple agents in a conversation. + * Format: `projects/{project}/locations/{location}/dataAgents/{agent}` + * + * Generated from protobuf field repeated string agents = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string[] $var + * @return $this + */ + public function setAgents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->agents = $arr; + + return $this; + } + + /** + * Output only. Creation 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. Creation 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. Timestamp of the last used conversation. + * + * Generated from protobuf field .google.protobuf.Timestamp last_used_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getLastUsedTime() + { + return $this->last_used_time; + } + + public function hasLastUsedTime() + { + return isset($this->last_used_time); + } + + public function clearLastUsedTime() + { + unset($this->last_used_time); + } + + /** + * Output only. Timestamp of the last used conversation. + * + * Generated from protobuf field .google.protobuf.Timestamp last_used_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setLastUsedTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->last_used_time = $var; + + return $this; + } + + /** + * Optional. Open-ended and user-defined labels that can be set by the client + * to tag a conversation (e.g. to filter conversations for specific + * surfaces/products). + * + * Generated from protobuf field map labels = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Open-ended and user-defined labels that can be set by the client + * to tag a conversation (e.g. to filter conversations for specific + * surfaces/products). + * + * Generated from protobuf field map labels = 9 [(.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. Customer managed encryption key (CMEK) to use for encrypting the + * Conversation resources. Encryption will happen at Titan layer, we will pass + * the KMS key to Titan. + * Format: + * projects/{project_id}/locations/{location}/keyRings/{key_ring_name}/cryptoKeys/{key_name}. + * + * Generated from protobuf field optional string kms_key = 10 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getKmsKey() + { + return isset($this->kms_key) ? $this->kms_key : ''; + } + + public function hasKmsKey() + { + return isset($this->kms_key); + } + + public function clearKmsKey() + { + unset($this->kms_key); + } + + /** + * Optional. Customer managed encryption key (CMEK) to use for encrypting the + * Conversation resources. Encryption will happen at Titan layer, we will pass + * the KMS key to Titan. + * Format: + * projects/{project_id}/locations/{location}/keyRings/{key_ring_name}/cryptoKeys/{key_name}. + * + * Generated from protobuf field optional string kms_key = 10 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setKmsKey($var) + { + GPBUtil::checkString($var, True); + $this->kms_key = $var; + + return $this; + } + + /** + * Optional. Whether memory is paused for this conversation. + * + * Generated from protobuf field optional bool memory_paused = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getMemoryPaused() + { + return isset($this->memory_paused) ? $this->memory_paused : false; + } + + public function hasMemoryPaused() + { + return isset($this->memory_paused); + } + + public function clearMemoryPaused() + { + unset($this->memory_paused); + } + + /** + * Optional. Whether memory is paused for this conversation. + * + * Generated from protobuf field optional bool memory_paused = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setMemoryPaused($var) + { + GPBUtil::checkBool($var); + $this->memory_paused = $var; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/ConversationOptions.php b/GeminiDataAnalytics/src/V1/ConversationOptions.php new file mode 100644 index 000000000000..96481a4a8a8e --- /dev/null +++ b/GeminiDataAnalytics/src/V1/ConversationOptions.php @@ -0,0 +1,165 @@ +google.cloud.geminidataanalytics.v1.ConversationOptions + */ +class ConversationOptions extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Options for analysis. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.AnalysisOptions analysis = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $analysis = null; + /** + * Optional. Options for datasources. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.DatasourceOptions datasource = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $datasource = null; + /** + * Optional. The model to use for the agent loop. + * + * Generated from protobuf field optional .google.cloud.geminidataanalytics.v1.ConversationOptions.Model model = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $model = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\GeminiDataAnalytics\V1\AnalysisOptions $analysis + * Optional. Options for analysis. + * @type \Google\Cloud\GeminiDataAnalytics\V1\DatasourceOptions $datasource + * Optional. Options for datasources. + * @type int $model + * Optional. The model to use for the agent loop. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Context::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Options for analysis. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.AnalysisOptions analysis = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\GeminiDataAnalytics\V1\AnalysisOptions|null + */ + public function getAnalysis() + { + return $this->analysis; + } + + public function hasAnalysis() + { + return isset($this->analysis); + } + + public function clearAnalysis() + { + unset($this->analysis); + } + + /** + * Optional. Options for analysis. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.AnalysisOptions analysis = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\AnalysisOptions $var + * @return $this + */ + public function setAnalysis($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\AnalysisOptions::class); + $this->analysis = $var; + + return $this; + } + + /** + * Optional. Options for datasources. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.DatasourceOptions datasource = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\GeminiDataAnalytics\V1\DatasourceOptions|null + */ + public function getDatasource() + { + return $this->datasource; + } + + public function hasDatasource() + { + return isset($this->datasource); + } + + public function clearDatasource() + { + unset($this->datasource); + } + + /** + * Optional. Options for datasources. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.DatasourceOptions datasource = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\DatasourceOptions $var + * @return $this + */ + public function setDatasource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\DatasourceOptions::class); + $this->datasource = $var; + + return $this; + } + + /** + * Optional. The model to use for the agent loop. + * + * Generated from protobuf field optional .google.cloud.geminidataanalytics.v1.ConversationOptions.Model model = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getModel() + { + return isset($this->model) ? $this->model : 0; + } + + public function hasModel() + { + return isset($this->model); + } + + public function clearModel() + { + unset($this->model); + } + + /** + * Optional. The model to use for the agent loop. + * + * Generated from protobuf field optional .google.cloud.geminidataanalytics.v1.ConversationOptions.Model model = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setModel($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GeminiDataAnalytics\V1\ConversationOptions\Model::class); + $this->model = $var; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/ConversationOptions/Model.php b/GeminiDataAnalytics/src/V1/ConversationOptions/Model.php new file mode 100644 index 000000000000..91e23402bc7c --- /dev/null +++ b/GeminiDataAnalytics/src/V1/ConversationOptions/Model.php @@ -0,0 +1,59 @@ +google.cloud.geminidataanalytics.v1.ConversationOptions.Model + */ +class Model +{ + /** + * No model specified. The model may be set on the chat request, or the + * default model will be used. Currently, this is + * `gemini-3.0-flash-preview`. + * + * Generated from protobuf enum MODEL_UNSPECIFIED = 0; + */ + const MODEL_UNSPECIFIED = 0; + /** + * Use the most up-to-date non-preview model. Currently, this is + * `gemini-2.5-flash`. This constrains the request level settings. The + * default will change to `gemini-2.5-flash`, and setting `thinking_mode` + * will not be supported. + * + * Generated from protobuf enum LATEST_GA_MODEL = 1; + */ + const LATEST_GA_MODEL = 1; + + private static $valueToName = [ + self::MODEL_UNSPECIFIED => 'MODEL_UNSPECIFIED', + self::LATEST_GA_MODEL => 'LATEST_GA_MODEL', + ]; + + 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/GeminiDataAnalytics/src/V1/ConversationReference.php b/GeminiDataAnalytics/src/V1/ConversationReference.php new file mode 100644 index 000000000000..822a53b62b3b --- /dev/null +++ b/GeminiDataAnalytics/src/V1/ConversationReference.php @@ -0,0 +1,119 @@ +google.cloud.geminidataanalytics.v1.ConversationReference + */ +class ConversationReference extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the conversation resource. + * Format: + * `projects/{project}/locations/{location}/conversations/{conversation_id}` + * + * Generated from protobuf field string conversation = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $conversation = ''; + /** + * Required. Context for the chat request using a data agent. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.DataAgentContext data_agent_context = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $data_agent_context = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $conversation + * Required. Name of the conversation resource. + * Format: + * `projects/{project}/locations/{location}/conversations/{conversation_id}` + * @type \Google\Cloud\GeminiDataAnalytics\V1\DataAgentContext $data_agent_context + * Required. Context for the chat request using a data agent. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\DataChatService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the conversation resource. + * Format: + * `projects/{project}/locations/{location}/conversations/{conversation_id}` + * + * Generated from protobuf field string conversation = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getConversation() + { + return $this->conversation; + } + + /** + * Required. Name of the conversation resource. + * Format: + * `projects/{project}/locations/{location}/conversations/{conversation_id}` + * + * Generated from protobuf field string conversation = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setConversation($var) + { + GPBUtil::checkString($var, True); + $this->conversation = $var; + + return $this; + } + + /** + * Required. Context for the chat request using a data agent. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.DataAgentContext data_agent_context = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\GeminiDataAnalytics\V1\DataAgentContext|null + */ + public function getDataAgentContext() + { + return $this->data_agent_context; + } + + public function hasDataAgentContext() + { + return isset($this->data_agent_context); + } + + public function clearDataAgentContext() + { + unset($this->data_agent_context); + } + + /** + * Required. Context for the chat request using a data agent. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.DataAgentContext data_agent_context = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\DataAgentContext $var + * @return $this + */ + public function setDataAgentContext($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\DataAgentContext::class); + $this->data_agent_context = $var; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/CreateConversationRequest.php b/GeminiDataAnalytics/src/V1/CreateConversationRequest.php new file mode 100644 index 000000000000..a015fe6944d3 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/CreateConversationRequest.php @@ -0,0 +1,229 @@ +google.cloud.geminidataanalytics.v1.CreateConversationRequest + */ +class CreateConversationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent value for CreateConversationRequest. + * Format: `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The conversation id of the conversation to create. + * Must be unique within the parent. + * The allowed format is: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`. + * If not provided, the server will auto-generate a value for the id. + * + * Generated from protobuf field string conversation_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $conversation_id = ''; + /** + * Required. The conversation to create. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Conversation conversation = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $conversation = 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. + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + + /** + * @param string $parent Required. Parent value for CreateConversationRequest. + * Format: `projects/{project}/locations/{location}` + * Please see {@see DataChatServiceClient::locationName()} for help formatting this field. + * @param \Google\Cloud\GeminiDataAnalytics\V1\Conversation $conversation Required. The conversation to create. + * @param string $conversationId Optional. The conversation id of the conversation to create. + * Must be unique within the parent. + * The allowed format is: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`. + * If not provided, the server will auto-generate a value for the id. + * + * @return \Google\Cloud\GeminiDataAnalytics\V1\CreateConversationRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\GeminiDataAnalytics\V1\Conversation $conversation, string $conversationId): self + { + return (new self()) + ->setParent($parent) + ->setConversation($conversation) + ->setConversationId($conversationId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Parent value for CreateConversationRequest. + * Format: `projects/{project}/locations/{location}` + * @type string $conversation_id + * Optional. The conversation id of the conversation to create. + * Must be unique within the parent. + * The allowed format is: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`. + * If not provided, the server will auto-generate a value for the id. + * @type \Google\Cloud\GeminiDataAnalytics\V1\Conversation $conversation + * Required. The conversation 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. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent value for CreateConversationRequest. + * Format: `projects/{project}/locations/{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. Parent value for CreateConversationRequest. + * Format: `projects/{project}/locations/{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. The conversation id of the conversation to create. + * Must be unique within the parent. + * The allowed format is: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`. + * If not provided, the server will auto-generate a value for the id. + * + * Generated from protobuf field string conversation_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getConversationId() + { + return $this->conversation_id; + } + + /** + * Optional. The conversation id of the conversation to create. + * Must be unique within the parent. + * The allowed format is: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`. + * If not provided, the server will auto-generate a value for the id. + * + * Generated from protobuf field string conversation_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setConversationId($var) + { + GPBUtil::checkString($var, True); + $this->conversation_id = $var; + + return $this; + } + + /** + * Required. The conversation to create. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Conversation conversation = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\GeminiDataAnalytics\V1\Conversation|null + */ + public function getConversation() + { + return $this->conversation; + } + + public function hasConversation() + { + return isset($this->conversation); + } + + public function clearConversation() + { + unset($this->conversation); + } + + /** + * Required. The conversation to create. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Conversation conversation = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\Conversation $var + * @return $this + */ + public function setConversation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\Conversation::class); + $this->conversation = $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. + * + * 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. + * + * 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/GeminiDataAnalytics/src/V1/CreateDataAgentRequest.php b/GeminiDataAnalytics/src/V1/CreateDataAgentRequest.php new file mode 100644 index 000000000000..cfb9055a539c --- /dev/null +++ b/GeminiDataAnalytics/src/V1/CreateDataAgentRequest.php @@ -0,0 +1,247 @@ +google.cloud.geminidataanalytics.v1.CreateDataAgentRequest + */ +class CreateDataAgentRequest 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 = ''; + /** + * Optional. Id of the requesting object. Must be unique within the parent. + * The allowed format is: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`. + * If not provided, the server will auto-generate a value for the id. + * + * Generated from protobuf field string data_agent_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $data_agent_id = ''; + /** + * Required. The resource being created. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.DataAgent data_agent = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $data_agent = 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 = ''; + + /** + * @param string $parent Required. Value for parent. Please see + * {@see DataAgentServiceClient::locationName()} for help formatting this field. + * @param \Google\Cloud\GeminiDataAnalytics\V1\DataAgent $dataAgent Required. The resource being created. + * @param string $dataAgentId Optional. Id of the requesting object. Must be unique within the parent. + * The allowed format is: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`. + * If not provided, the server will auto-generate a value for the id. + * + * @return \Google\Cloud\GeminiDataAnalytics\V1\CreateDataAgentRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\GeminiDataAnalytics\V1\DataAgent $dataAgent, string $dataAgentId): self + { + return (new self()) + ->setParent($parent) + ->setDataAgent($dataAgent) + ->setDataAgentId($dataAgentId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Value for parent. + * @type string $data_agent_id + * Optional. Id of the requesting object. Must be unique within the parent. + * The allowed format is: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`. + * If not provided, the server will auto-generate a value for the id. + * @type \Google\Cloud\GeminiDataAnalytics\V1\DataAgent $data_agent + * 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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\DataAgentService::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; + } + + /** + * Optional. Id of the requesting object. Must be unique within the parent. + * The allowed format is: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`. + * If not provided, the server will auto-generate a value for the id. + * + * Generated from protobuf field string data_agent_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDataAgentId() + { + return $this->data_agent_id; + } + + /** + * Optional. Id of the requesting object. Must be unique within the parent. + * The allowed format is: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`. + * If not provided, the server will auto-generate a value for the id. + * + * Generated from protobuf field string data_agent_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDataAgentId($var) + { + GPBUtil::checkString($var, True); + $this->data_agent_id = $var; + + return $this; + } + + /** + * Required. The resource being created. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.DataAgent data_agent = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\GeminiDataAnalytics\V1\DataAgent|null + */ + public function getDataAgent() + { + return $this->data_agent; + } + + public function hasDataAgent() + { + return isset($this->data_agent); + } + + public function clearDataAgent() + { + unset($this->data_agent); + } + + /** + * Required. The resource being created. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.DataAgent data_agent = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\DataAgent $var + * @return $this + */ + public function setDataAgent($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\DataAgent::class); + $this->data_agent = $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; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/Credentials.php b/GeminiDataAnalytics/src/V1/Credentials.php new file mode 100644 index 000000000000..549875ac3f47 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/Credentials.php @@ -0,0 +1,75 @@ +google.cloud.geminidataanalytics.v1.Credentials + */ +class Credentials extends \Google\Protobuf\Internal\Message +{ + protected $kind; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\GeminiDataAnalytics\V1\OAuthCredentials $oauth + * OAuth credentials. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Credentials::initOnce(); + parent::__construct($data); + } + + /** + * OAuth credentials. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.OAuthCredentials oauth = 1; + * @return \Google\Cloud\GeminiDataAnalytics\V1\OAuthCredentials|null + */ + public function getOauth() + { + return $this->readOneof(1); + } + + public function hasOauth() + { + return $this->hasOneof(1); + } + + /** + * OAuth credentials. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.OAuthCredentials oauth = 1; + * @param \Google\Cloud\GeminiDataAnalytics\V1\OAuthCredentials $var + * @return $this + */ + public function setOauth($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\OAuthCredentials::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getKind() + { + return $this->whichOneof("kind"); + } + +} + diff --git a/GeminiDataAnalytics/src/V1/DataAgent.php b/GeminiDataAnalytics/src/V1/DataAgent.php new file mode 100644 index 000000000000..62e704033645 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/DataAgent.php @@ -0,0 +1,515 @@ +google.cloud.geminidataanalytics.v1.DataAgent + */ +class DataAgent extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Identifier. The unique resource name of a DataAgent. + * Format: + * `projects/{project}/locations/{location}/dataAgents/{data_agent_id}` + * `{data_agent}` is the resource id and should be 63 characters or less and + * must match the format described in + * https://google.aip.dev/122#resource-id-segments + * Example: `projects/1234567890/locations/global/dataAgents/my-agent`. + * It is recommended to skip setting this field during agent creation as it + * will be inferred automatically and overwritten with the + * {parent}/dataAgents/{data_agent_id}. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Optional. User friendly display name. + * * Must be between 1-256 characters. + * + * Generated from protobuf field string display_name = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_name = ''; + /** + * Optional. Description of the agent. + * * Must be between 1-1024 characters. + * + * Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Optional. Labels to help users filter related agents. + * For example, "sales", "business", "etl", and so on. + * Note labels are used only for filtering and not for policies. + * See the [labels + * documentation](https://cloud.google.com/resource-manager/docs/labels-overview) + * for more details on label usage. + * + * Generated from protobuf field map labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Output only. The time when the data agent 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 time when the data agent was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. [Output only] The time the data agent was soft deleted. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $delete_time = null; + /** + * Output only. Timestamp in UTC of when this data agent is considered + * expired. This is *always* provided on output, regardless of what was sent + * on input. + * + * Generated from protobuf field .google.protobuf.Timestamp purge_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $purge_time = null; + /** + * Optional. Customer managed encryption key (CMEK) to use for encrypting the + * DataAgent resources. Cloud KMS CryptoKeys must reside in the same location + * as the DataAgent. The expected format is + * `projects/{@*}locations/{@*}keyRings/{@*}cryptoKeys/*`. + * + * Generated from protobuf field optional string kms_key = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $kms_key = null; + protected $type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\GeminiDataAnalytics\V1\DataAnalyticsAgent $data_analytics_agent + * Data analytics agent. + * @type string $name + * Optional. Identifier. The unique resource name of a DataAgent. + * Format: + * `projects/{project}/locations/{location}/dataAgents/{data_agent_id}` + * `{data_agent}` is the resource id and should be 63 characters or less and + * must match the format described in + * https://google.aip.dev/122#resource-id-segments + * Example: `projects/1234567890/locations/global/dataAgents/my-agent`. + * It is recommended to skip setting this field during agent creation as it + * will be inferred automatically and overwritten with the + * {parent}/dataAgents/{data_agent_id}. + * @type string $display_name + * Optional. User friendly display name. + * * Must be between 1-256 characters. + * @type string $description + * Optional. Description of the agent. + * * Must be between 1-1024 characters. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Labels to help users filter related agents. + * For example, "sales", "business", "etl", and so on. + * Note labels are used only for filtering and not for policies. + * See the [labels + * documentation](https://cloud.google.com/resource-manager/docs/labels-overview) + * for more details on label usage. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time when the data agent was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The time when the data agent was last updated. + * @type \Google\Protobuf\Timestamp $delete_time + * Output only. [Output only] The time the data agent was soft deleted. + * @type \Google\Protobuf\Timestamp $purge_time + * Output only. Timestamp in UTC of when this data agent is considered + * expired. This is *always* provided on output, regardless of what was sent + * on input. + * @type string $kms_key + * Optional. Customer managed encryption key (CMEK) to use for encrypting the + * DataAgent resources. Cloud KMS CryptoKeys must reside in the same location + * as the DataAgent. The expected format is + * `projects/{@*}locations/{@*}keyRings/{@*}cryptoKeys/*`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\DataAgent::initOnce(); + parent::__construct($data); + } + + /** + * Data analytics agent. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.DataAnalyticsAgent data_analytics_agent = 101; + * @return \Google\Cloud\GeminiDataAnalytics\V1\DataAnalyticsAgent|null + */ + public function getDataAnalyticsAgent() + { + return $this->readOneof(101); + } + + public function hasDataAnalyticsAgent() + { + return $this->hasOneof(101); + } + + /** + * Data analytics agent. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.DataAnalyticsAgent data_analytics_agent = 101; + * @param \Google\Cloud\GeminiDataAnalytics\V1\DataAnalyticsAgent $var + * @return $this + */ + public function setDataAnalyticsAgent($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\DataAnalyticsAgent::class); + $this->writeOneof(101, $var); + + return $this; + } + + /** + * Optional. Identifier. The unique resource name of a DataAgent. + * Format: + * `projects/{project}/locations/{location}/dataAgents/{data_agent_id}` + * `{data_agent}` is the resource id and should be 63 characters or less and + * must match the format described in + * https://google.aip.dev/122#resource-id-segments + * Example: `projects/1234567890/locations/global/dataAgents/my-agent`. + * It is recommended to skip setting this field during agent creation as it + * will be inferred automatically and overwritten with the + * {parent}/dataAgents/{data_agent_id}. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Optional. Identifier. The unique resource name of a DataAgent. + * Format: + * `projects/{project}/locations/{location}/dataAgents/{data_agent_id}` + * `{data_agent}` is the resource id and should be 63 characters or less and + * must match the format described in + * https://google.aip.dev/122#resource-id-segments + * Example: `projects/1234567890/locations/global/dataAgents/my-agent`. + * It is recommended to skip setting this field during agent creation as it + * will be inferred automatically and overwritten with the + * {parent}/dataAgents/{data_agent_id}. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. User friendly display name. + * * Must be between 1-256 characters. + * + * Generated from protobuf field string display_name = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Optional. User friendly display name. + * * Must be between 1-256 characters. + * + * Generated from protobuf field string display_name = 3 [(.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. Description of the agent. + * * Must be between 1-1024 characters. + * + * Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. Description of the agent. + * * Must be between 1-1024 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; + } + + /** + * Optional. Labels to help users filter related agents. + * For example, "sales", "business", "etl", and so on. + * Note labels are used only for filtering and not for policies. + * See the [labels + * documentation](https://cloud.google.com/resource-manager/docs/labels-overview) + * for more details on label usage. + * + * Generated from protobuf field map labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Labels to help users filter related agents. + * For example, "sales", "business", "etl", and so on. + * Note labels are used only for filtering and not for policies. + * See the [labels + * documentation](https://cloud.google.com/resource-manager/docs/labels-overview) + * for more details on label usage. + * + * 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; + } + + /** + * Output only. The time when the data agent 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 time when the data agent 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 time when the data agent was last updated. + * + * 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 when the data agent was last updated. + * + * 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; + } + + /** + * Output only. [Output only] The time the data agent was soft deleted. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeleteTime() + { + return $this->delete_time; + } + + public function hasDeleteTime() + { + return isset($this->delete_time); + } + + public function clearDeleteTime() + { + unset($this->delete_time); + } + + /** + * Output only. [Output only] The time the data agent was soft deleted. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->delete_time = $var; + + return $this; + } + + /** + * Output only. Timestamp in UTC of when this data agent is considered + * expired. This is *always* provided on output, regardless of what was sent + * on input. + * + * Generated from protobuf field .google.protobuf.Timestamp purge_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getPurgeTime() + { + return $this->purge_time; + } + + public function hasPurgeTime() + { + return isset($this->purge_time); + } + + public function clearPurgeTime() + { + unset($this->purge_time); + } + + /** + * Output only. Timestamp in UTC of when this data agent is considered + * expired. This is *always* provided on output, regardless of what was sent + * on input. + * + * Generated from protobuf field .google.protobuf.Timestamp purge_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setPurgeTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->purge_time = $var; + + return $this; + } + + /** + * Optional. Customer managed encryption key (CMEK) to use for encrypting the + * DataAgent resources. Cloud KMS CryptoKeys must reside in the same location + * as the DataAgent. The expected format is + * `projects/{@*}locations/{@*}keyRings/{@*}cryptoKeys/*`. + * + * Generated from protobuf field optional string kms_key = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getKmsKey() + { + return isset($this->kms_key) ? $this->kms_key : ''; + } + + public function hasKmsKey() + { + return isset($this->kms_key); + } + + public function clearKmsKey() + { + unset($this->kms_key); + } + + /** + * Optional. Customer managed encryption key (CMEK) to use for encrypting the + * DataAgent resources. Cloud KMS CryptoKeys must reside in the same location + * as the DataAgent. The expected format is + * `projects/{@*}locations/{@*}keyRings/{@*}cryptoKeys/*`. + * + * Generated from protobuf field optional string kms_key = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setKmsKey($var) + { + GPBUtil::checkString($var, True); + $this->kms_key = $var; + + return $this; + } + + /** + * @return string + */ + public function getType() + { + return $this->whichOneof("type"); + } + +} + diff --git a/GeminiDataAnalytics/src/V1/DataAgentContext.php b/GeminiDataAnalytics/src/V1/DataAgentContext.php new file mode 100644 index 000000000000..f625369ef10f --- /dev/null +++ b/GeminiDataAnalytics/src/V1/DataAgentContext.php @@ -0,0 +1,101 @@ +google.cloud.geminidataanalytics.v1.DataAgentContext + */ +class DataAgentContext extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the data agent resource. + * + * Generated from protobuf field string data_agent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $data_agent = ''; + /** + * Optional. Version of context to be used by DCS (e.g. STAGING, PUBLISHED) + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.DataAgentContext.ContextVersion context_version = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $context_version = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $data_agent + * Required. The name of the data agent resource. + * @type int $context_version + * Optional. Version of context to be used by DCS (e.g. STAGING, PUBLISHED) + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\DataChatService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the data agent resource. + * + * Generated from protobuf field string data_agent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getDataAgent() + { + return $this->data_agent; + } + + /** + * Required. The name of the data agent resource. + * + * Generated from protobuf field string data_agent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setDataAgent($var) + { + GPBUtil::checkString($var, True); + $this->data_agent = $var; + + return $this; + } + + /** + * Optional. Version of context to be used by DCS (e.g. STAGING, PUBLISHED) + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.DataAgentContext.ContextVersion context_version = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getContextVersion() + { + return $this->context_version; + } + + /** + * Optional. Version of context to be used by DCS (e.g. STAGING, PUBLISHED) + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.DataAgentContext.ContextVersion context_version = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setContextVersion($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GeminiDataAnalytics\V1\DataAgentContext\ContextVersion::class); + $this->context_version = $var; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/DataAgentContext/ContextVersion.php b/GeminiDataAnalytics/src/V1/DataAgentContext/ContextVersion.php new file mode 100644 index 000000000000..06792af16f83 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/DataAgentContext/ContextVersion.php @@ -0,0 +1,65 @@ +google.cloud.geminidataanalytics.v1.DataAgentContext.ContextVersion + */ +class ContextVersion +{ + /** + * Unspecified or unrecognized. + * + * Generated from protobuf enum CONTEXT_VERSION_UNSPECIFIED = 0; + */ + const CONTEXT_VERSION_UNSPECIFIED = 0; + /** + * Using this version, DCS will use the latest staging context for the + * data agent. + * + * Generated from protobuf enum STAGING = 1; + */ + const STAGING = 1; + /** + * Using this version, DCS will use the latest published context for the + * data agent. + * + * Generated from protobuf enum PUBLISHED = 2; + */ + const PUBLISHED = 2; + + private static $valueToName = [ + self::CONTEXT_VERSION_UNSPECIFIED => 'CONTEXT_VERSION_UNSPECIFIED', + self::STAGING => 'STAGING', + self::PUBLISHED => 'PUBLISHED', + ]; + + 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/GeminiDataAnalytics/src/V1/DataAnalyticsAgent.php b/GeminiDataAnalytics/src/V1/DataAnalyticsAgent.php new file mode 100644 index 000000000000..cd2e29130aab --- /dev/null +++ b/GeminiDataAnalytics/src/V1/DataAnalyticsAgent.php @@ -0,0 +1,185 @@ +google.cloud.geminidataanalytics.v1.DataAnalyticsAgent + */ +class DataAnalyticsAgent extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The staging context for the agent. + * This context is used to test and validate changes before publishing. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Context staging_context = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $staging_context = null; + /** + * Optional. The published context for the agent. + * This context is used by the Chat API in production. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Context published_context = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $published_context = null; + /** + * Output only. The last published context for the agent. + * This is an output-only field populated by the system when the + * published context is updated. It is used to restore the agent to a + * previous state. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Context last_published_context = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $last_published_context = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\GeminiDataAnalytics\V1\Context $staging_context + * Optional. The staging context for the agent. + * This context is used to test and validate changes before publishing. + * @type \Google\Cloud\GeminiDataAnalytics\V1\Context $published_context + * Optional. The published context for the agent. + * This context is used by the Chat API in production. + * @type \Google\Cloud\GeminiDataAnalytics\V1\Context $last_published_context + * Output only. The last published context for the agent. + * This is an output-only field populated by the system when the + * published context is updated. It is used to restore the agent to a + * previous state. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\DataAnalyticsAgent::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The staging context for the agent. + * This context is used to test and validate changes before publishing. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Context staging_context = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\GeminiDataAnalytics\V1\Context|null + */ + public function getStagingContext() + { + return $this->staging_context; + } + + public function hasStagingContext() + { + return isset($this->staging_context); + } + + public function clearStagingContext() + { + unset($this->staging_context); + } + + /** + * Optional. The staging context for the agent. + * This context is used to test and validate changes before publishing. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Context staging_context = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\Context $var + * @return $this + */ + public function setStagingContext($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\Context::class); + $this->staging_context = $var; + + return $this; + } + + /** + * Optional. The published context for the agent. + * This context is used by the Chat API in production. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Context published_context = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\GeminiDataAnalytics\V1\Context|null + */ + public function getPublishedContext() + { + return $this->published_context; + } + + public function hasPublishedContext() + { + return isset($this->published_context); + } + + public function clearPublishedContext() + { + unset($this->published_context); + } + + /** + * Optional. The published context for the agent. + * This context is used by the Chat API in production. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Context published_context = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\Context $var + * @return $this + */ + public function setPublishedContext($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\Context::class); + $this->published_context = $var; + + return $this; + } + + /** + * Output only. The last published context for the agent. + * This is an output-only field populated by the system when the + * published context is updated. It is used to restore the agent to a + * previous state. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Context last_published_context = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\GeminiDataAnalytics\V1\Context|null + */ + public function getLastPublishedContext() + { + return $this->last_published_context; + } + + public function hasLastPublishedContext() + { + return isset($this->last_published_context); + } + + public function clearLastPublishedContext() + { + unset($this->last_published_context); + } + + /** + * Output only. The last published context for the agent. + * This is an output-only field populated by the system when the + * published context is updated. It is used to restore the agent to a + * previous state. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Context last_published_context = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\Context $var + * @return $this + */ + public function setLastPublishedContext($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\Context::class); + $this->last_published_context = $var; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/DataFilter.php b/GeminiDataAnalytics/src/V1/DataFilter.php new file mode 100644 index 000000000000..5289e914b19c --- /dev/null +++ b/GeminiDataAnalytics/src/V1/DataFilter.php @@ -0,0 +1,148 @@ +google.cloud.geminidataanalytics.v1.DataFilter + */ +class DataFilter extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The field to filter on. For example: ["event_date", + * "customer_id", "product_category"] + * + * Generated from protobuf field string field = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $field = ''; + /** + * Optional. The default value used for this filter if the filter is not + * overridden in a query. For example: ["after 2024-01-01", "123", "-fashion"] + * + * Generated from protobuf field string value = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $value = ''; + /** + * Optional. The type of filter present on a datasource, such as + * ALWAYS_FILTER. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.DataFilterType type = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $field + * Optional. The field to filter on. For example: ["event_date", + * "customer_id", "product_category"] + * @type string $value + * Optional. The default value used for this filter if the filter is not + * overridden in a query. For example: ["after 2024-01-01", "123", "-fashion"] + * @type int $type + * Optional. The type of filter present on a datasource, such as + * ALWAYS_FILTER. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Datasource::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The field to filter on. For example: ["event_date", + * "customer_id", "product_category"] + * + * Generated from protobuf field string field = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getField() + { + return $this->field; + } + + /** + * Optional. The field to filter on. For example: ["event_date", + * "customer_id", "product_category"] + * + * Generated from protobuf field string field = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setField($var) + { + GPBUtil::checkString($var, True); + $this->field = $var; + + return $this; + } + + /** + * Optional. The default value used for this filter if the filter is not + * overridden in a query. For example: ["after 2024-01-01", "123", "-fashion"] + * + * Generated from protobuf field string value = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * Optional. The default value used for this filter if the filter is not + * overridden in a query. For example: ["after 2024-01-01", "123", "-fashion"] + * + * Generated from protobuf field 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; + } + + /** + * Optional. The type of filter present on a datasource, such as + * ALWAYS_FILTER. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.DataFilterType type = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Optional. The type of filter present on a datasource, such as + * ALWAYS_FILTER. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.DataFilterType type = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GeminiDataAnalytics\V1\DataFilterType::class); + $this->type = $var; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/DataFilterType.php b/GeminiDataAnalytics/src/V1/DataFilterType.php new file mode 100644 index 000000000000..11b5ce12beb4 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/DataFilterType.php @@ -0,0 +1,56 @@ +google.cloud.geminidataanalytics.v1.DataFilterType + */ +class DataFilterType +{ + /** + * The filter type was not specified. + * + * Generated from protobuf enum DATA_FILTER_TYPE_UNSPECIFIED = 0; + */ + const DATA_FILTER_TYPE_UNSPECIFIED = 0; + /** + * A filter that the user configures, and any queries to the Explore will + * always apply this filter by default. Currently only used for Looker data + * sources. + * + * Generated from protobuf enum ALWAYS_FILTER = 1; + */ + const ALWAYS_FILTER = 1; + + private static $valueToName = [ + self::DATA_FILTER_TYPE_UNSPECIFIED => 'DATA_FILTER_TYPE_UNSPECIFIED', + self::ALWAYS_FILTER => 'ALWAYS_FILTER', + ]; + + 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/GeminiDataAnalytics/src/V1/DataMessage.php b/GeminiDataAnalytics/src/V1/DataMessage.php new file mode 100644 index 000000000000..2b69ba1e9dc1 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/DataMessage.php @@ -0,0 +1,207 @@ +google.cloud.geminidataanalytics.v1.DataMessage + */ +class DataMessage extends \Google\Protobuf\Internal\Message +{ + protected $kind; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\GeminiDataAnalytics\V1\DataQuery $query + * A data retrieval query. + * @type string $generated_sql + * SQL generated by the system to retrieve data. + * @type \Google\Cloud\GeminiDataAnalytics\V1\DataResult $result + * Retrieved data. + * @type \Google\Cloud\GeminiDataAnalytics\V1\BigQueryJob $big_query_job + * A BigQuery job executed by the system to retrieve data. + * @type \Google\Cloud\GeminiDataAnalytics\V1\MatchedQuery $matched_query + * A pre-existing query that was matched to retrieve data. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\DataChatService::initOnce(); + parent::__construct($data); + } + + /** + * A data retrieval query. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.DataQuery query = 1; + * @return \Google\Cloud\GeminiDataAnalytics\V1\DataQuery|null + */ + public function getQuery() + { + return $this->readOneof(1); + } + + public function hasQuery() + { + return $this->hasOneof(1); + } + + /** + * A data retrieval query. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.DataQuery query = 1; + * @param \Google\Cloud\GeminiDataAnalytics\V1\DataQuery $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\DataQuery::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * SQL generated by the system to retrieve data. + * + * Generated from protobuf field string generated_sql = 2; + * @return string + */ + public function getGeneratedSql() + { + return $this->readOneof(2); + } + + public function hasGeneratedSql() + { + return $this->hasOneof(2); + } + + /** + * SQL generated by the system to retrieve data. + * + * Generated from protobuf field string generated_sql = 2; + * @param string $var + * @return $this + */ + public function setGeneratedSql($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Retrieved data. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.DataResult result = 3; + * @return \Google\Cloud\GeminiDataAnalytics\V1\DataResult|null + */ + public function getResult() + { + return $this->readOneof(3); + } + + public function hasResult() + { + return $this->hasOneof(3); + } + + /** + * Retrieved data. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.DataResult result = 3; + * @param \Google\Cloud\GeminiDataAnalytics\V1\DataResult $var + * @return $this + */ + public function setResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\DataResult::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * A BigQuery job executed by the system to retrieve data. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.BigQueryJob big_query_job = 5; + * @return \Google\Cloud\GeminiDataAnalytics\V1\BigQueryJob|null + */ + public function getBigQueryJob() + { + return $this->readOneof(5); + } + + public function hasBigQueryJob() + { + return $this->hasOneof(5); + } + + /** + * A BigQuery job executed by the system to retrieve data. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.BigQueryJob big_query_job = 5; + * @param \Google\Cloud\GeminiDataAnalytics\V1\BigQueryJob $var + * @return $this + */ + public function setBigQueryJob($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\BigQueryJob::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * A pre-existing query that was matched to retrieve data. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.MatchedQuery matched_query = 6; + * @return \Google\Cloud\GeminiDataAnalytics\V1\MatchedQuery|null + */ + public function getMatchedQuery() + { + return $this->readOneof(6); + } + + public function hasMatchedQuery() + { + return $this->hasOneof(6); + } + + /** + * A pre-existing query that was matched to retrieve data. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.MatchedQuery matched_query = 6; + * @param \Google\Cloud\GeminiDataAnalytics\V1\MatchedQuery $var + * @return $this + */ + public function setMatchedQuery($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\MatchedQuery::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * @return string + */ + public function getKind() + { + return $this->whichOneof("kind"); + } + +} + diff --git a/GeminiDataAnalytics/src/V1/DataQuery.php b/GeminiDataAnalytics/src/V1/DataQuery.php new file mode 100644 index 000000000000..84e9abf81ac7 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/DataQuery.php @@ -0,0 +1,193 @@ +google.cloud.geminidataanalytics.v1.DataQuery + */ +class DataQuery extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. A natural language question to answer. + * + * Generated from protobuf field string question = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $question = ''; + /** + * Optional. A snake-case name for the query that reflects its intent. It is + * used to name the corresponding data result, so that it can be referenced in + * later steps. + * * Example: "total_sales_by_product" + * * Example: "sales_for_product_12345" + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $name = ''; + /** + * Optional. The datasources available to answer the question. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.Datasource datasources = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $datasources; + protected $query_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\GeminiDataAnalytics\V1\LookerQuery $looker + * Optional. A query for retrieving data from a Looker explore. + * @type string $question + * Optional. A natural language question to answer. + * @type string $name + * Optional. A snake-case name for the query that reflects its intent. It is + * used to name the corresponding data result, so that it can be referenced in + * later steps. + * * Example: "total_sales_by_product" + * * Example: "sales_for_product_12345" + * @type \Google\Cloud\GeminiDataAnalytics\V1\Datasource[] $datasources + * Optional. The datasources available to answer the question. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\DataChatService::initOnce(); + parent::__construct($data); + } + + /** + * Optional. A query for retrieving data from a Looker explore. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.LookerQuery looker = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\GeminiDataAnalytics\V1\LookerQuery|null + */ + public function getLooker() + { + return $this->readOneof(4); + } + + public function hasLooker() + { + return $this->hasOneof(4); + } + + /** + * Optional. A query for retrieving data from a Looker explore. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.LookerQuery looker = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\LookerQuery $var + * @return $this + */ + public function setLooker($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\LookerQuery::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Optional. A natural language question to answer. + * + * Generated from protobuf field string question = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getQuestion() + { + return $this->question; + } + + /** + * Optional. A natural language question to answer. + * + * Generated from protobuf field string question = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setQuestion($var) + { + GPBUtil::checkString($var, True); + $this->question = $var; + + return $this; + } + + /** + * Optional. A snake-case name for the query that reflects its intent. It is + * used to name the corresponding data result, so that it can be referenced in + * later steps. + * * Example: "total_sales_by_product" + * * Example: "sales_for_product_12345" + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Optional. A snake-case name for the query that reflects its intent. It is + * used to name the corresponding data result, so that it can be referenced in + * later steps. + * * Example: "total_sales_by_product" + * * Example: "sales_for_product_12345" + * + * Generated from protobuf field string name = 3 [(.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 datasources available to answer the question. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.Datasource datasources = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\GeminiDataAnalytics\V1\Datasource> + */ + public function getDatasources() + { + return $this->datasources; + } + + /** + * Optional. The datasources available to answer the question. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.Datasource datasources = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\Datasource[] $var + * @return $this + */ + public function setDatasources($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GeminiDataAnalytics\V1\Datasource::class); + $this->datasources = $arr; + + return $this; + } + + /** + * @return string + */ + public function getQueryType() + { + return $this->whichOneof("query_type"); + } + +} + diff --git a/GeminiDataAnalytics/src/V1/DataResult.php b/GeminiDataAnalytics/src/V1/DataResult.php new file mode 100644 index 000000000000..f3f946795f8d --- /dev/null +++ b/GeminiDataAnalytics/src/V1/DataResult.php @@ -0,0 +1,227 @@ +google.cloud.geminidataanalytics.v1.DataResult + */ +class DataResult extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. A snake-case name for the data result that reflects its contents. + * The name is used to pass the result around by reference, and serves as a + * signal about its meaning. + * * Example: "total_sales_by_product" + * * Example: "sales_for_product_12345" + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $name = ''; + /** + * Optional. The schema of the data. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Schema schema = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $schema = null; + /** + * Optional. The content of the data. Each row is a struct that matches the + * schema. Simple values are represented as strings, while nested structures + * are represented as lists or structs. + * + * Generated from protobuf field repeated .google.protobuf.Struct data = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $data; + /** + * Optional. Formatted representation of the data, when applicable. + * Each row is a struct that directly corresponds to the row at the same index + * within the `data` field. Its values are string representations of the + * original data, formatted according to data source specifications (e.g., + * "$1,234.56" for currency). Columns without formatting will default to + * their raw value representation. If no columns have formatting rules, this + * field will be empty. + * + * Generated from protobuf field repeated .google.protobuf.Struct formatted_data = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $formatted_data; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Optional. A snake-case name for the data result that reflects its contents. + * The name is used to pass the result around by reference, and serves as a + * signal about its meaning. + * * Example: "total_sales_by_product" + * * Example: "sales_for_product_12345" + * @type \Google\Cloud\GeminiDataAnalytics\V1\Schema $schema + * Optional. The schema of the data. + * @type \Google\Protobuf\Struct[] $data + * Optional. The content of the data. Each row is a struct that matches the + * schema. Simple values are represented as strings, while nested structures + * are represented as lists or structs. + * @type \Google\Protobuf\Struct[] $formatted_data + * Optional. Formatted representation of the data, when applicable. + * Each row is a struct that directly corresponds to the row at the same index + * within the `data` field. Its values are string representations of the + * original data, formatted according to data source specifications (e.g., + * "$1,234.56" for currency). Columns without formatting will default to + * their raw value representation. If no columns have formatting rules, this + * field will be empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\DataChatService::initOnce(); + parent::__construct($data); + } + + /** + * Optional. A snake-case name for the data result that reflects its contents. + * The name is used to pass the result around by reference, and serves as a + * signal about its meaning. + * * Example: "total_sales_by_product" + * * Example: "sales_for_product_12345" + * + * Generated from protobuf field string name = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Optional. A snake-case name for the data result that reflects its contents. + * The name is used to pass the result around by reference, and serves as a + * signal about its meaning. + * * Example: "total_sales_by_product" + * * Example: "sales_for_product_12345" + * + * Generated from protobuf field string name = 3 [(.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 schema of the data. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Schema schema = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\GeminiDataAnalytics\V1\Schema|null + */ + public function getSchema() + { + return $this->schema; + } + + public function hasSchema() + { + return isset($this->schema); + } + + public function clearSchema() + { + unset($this->schema); + } + + /** + * Optional. The schema of the data. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Schema schema = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\Schema $var + * @return $this + */ + public function setSchema($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\Schema::class); + $this->schema = $var; + + return $this; + } + + /** + * Optional. The content of the data. Each row is a struct that matches the + * schema. Simple values are represented as strings, while nested structures + * are represented as lists or structs. + * + * Generated from protobuf field repeated .google.protobuf.Struct data = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Protobuf\Struct> + */ + public function getData() + { + return $this->data; + } + + /** + * Optional. The content of the data. Each row is a struct that matches the + * schema. Simple values are represented as strings, while nested structures + * are represented as lists or structs. + * + * Generated from protobuf field repeated .google.protobuf.Struct data = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Struct[] $var + * @return $this + */ + public function setData($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Struct::class); + $this->data = $arr; + + return $this; + } + + /** + * Optional. Formatted representation of the data, when applicable. + * Each row is a struct that directly corresponds to the row at the same index + * within the `data` field. Its values are string representations of the + * original data, formatted according to data source specifications (e.g., + * "$1,234.56" for currency). Columns without formatting will default to + * their raw value representation. If no columns have formatting rules, this + * field will be empty. + * + * Generated from protobuf field repeated .google.protobuf.Struct formatted_data = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Protobuf\Struct> + */ + public function getFormattedData() + { + return $this->formatted_data; + } + + /** + * Optional. Formatted representation of the data, when applicable. + * Each row is a struct that directly corresponds to the row at the same index + * within the `data` field. Its values are string representations of the + * original data, formatted according to data source specifications (e.g., + * "$1,234.56" for currency). Columns without formatting will default to + * their raw value representation. If no columns have formatting rules, this + * field will be empty. + * + * Generated from protobuf field repeated .google.protobuf.Struct formatted_data = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Struct[] $var + * @return $this + */ + public function setFormattedData($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Struct::class); + $this->formatted_data = $arr; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/Datasource.php b/GeminiDataAnalytics/src/V1/Datasource.php new file mode 100644 index 000000000000..10c910923ebe --- /dev/null +++ b/GeminiDataAnalytics/src/V1/Datasource.php @@ -0,0 +1,278 @@ +google.cloud.geminidataanalytics.v1.Datasource + */ +class Datasource extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The schema of the datasource. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Schema schema = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $schema = null; + /** + * Optional. A struct representation of the schema. + * This is populated for datasources with schemas that cannot be + * fully represented by the strongly-typed `schema` field. + * For Looker datasources, this maps to the LookmlModelExplore type: + * https://cloud.google.com/looker/docs/reference/looker-api/latest/types/LookmlModelExplore + * + * Generated from protobuf field .google.protobuf.Struct struct_schema = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $struct_schema = null; + protected $reference; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\GeminiDataAnalytics\V1\BigQueryTableReference $bigquery_table_reference + * A reference to a BigQuery table. + * @type string $studio_datasource_id + * A reference to a Looker Studio datasource. + * @type \Google\Cloud\GeminiDataAnalytics\V1\LookerExploreReference $looker_explore_reference + * A reference to a Looker explore. + * @type \Google\Cloud\GeminiDataAnalytics\V1\BigQueryPropertyGraphReference $bigquery_property_graph_reference + * A reference to a BigQuery property graph. + * @type \Google\Cloud\GeminiDataAnalytics\V1\Schema $schema + * Optional. The schema of the datasource. + * @type \Google\Protobuf\Struct $struct_schema + * Optional. A struct representation of the schema. + * This is populated for datasources with schemas that cannot be + * fully represented by the strongly-typed `schema` field. + * For Looker datasources, this maps to the LookmlModelExplore type: + * https://cloud.google.com/looker/docs/reference/looker-api/latest/types/LookmlModelExplore + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Datasource::initOnce(); + parent::__construct($data); + } + + /** + * A reference to a BigQuery table. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.BigQueryTableReference bigquery_table_reference = 1; + * @return \Google\Cloud\GeminiDataAnalytics\V1\BigQueryTableReference|null + */ + public function getBigqueryTableReference() + { + return $this->readOneof(1); + } + + public function hasBigqueryTableReference() + { + return $this->hasOneof(1); + } + + /** + * A reference to a BigQuery table. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.BigQueryTableReference bigquery_table_reference = 1; + * @param \Google\Cloud\GeminiDataAnalytics\V1\BigQueryTableReference $var + * @return $this + */ + public function setBigqueryTableReference($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\BigQueryTableReference::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * A reference to a Looker Studio datasource. + * + * Generated from protobuf field string studio_datasource_id = 2; + * @return string + */ + public function getStudioDatasourceId() + { + return $this->readOneof(2); + } + + public function hasStudioDatasourceId() + { + return $this->hasOneof(2); + } + + /** + * A reference to a Looker Studio datasource. + * + * Generated from protobuf field string studio_datasource_id = 2; + * @param string $var + * @return $this + */ + public function setStudioDatasourceId($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * A reference to a Looker explore. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.LookerExploreReference looker_explore_reference = 4; + * @return \Google\Cloud\GeminiDataAnalytics\V1\LookerExploreReference|null + */ + public function getLookerExploreReference() + { + return $this->readOneof(4); + } + + public function hasLookerExploreReference() + { + return $this->hasOneof(4); + } + + /** + * A reference to a Looker explore. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.LookerExploreReference looker_explore_reference = 4; + * @param \Google\Cloud\GeminiDataAnalytics\V1\LookerExploreReference $var + * @return $this + */ + public function setLookerExploreReference($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\LookerExploreReference::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * A reference to a BigQuery property graph. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.BigQueryPropertyGraphReference bigquery_property_graph_reference = 16; + * @return \Google\Cloud\GeminiDataAnalytics\V1\BigQueryPropertyGraphReference|null + */ + public function getBigqueryPropertyGraphReference() + { + return $this->readOneof(16); + } + + public function hasBigqueryPropertyGraphReference() + { + return $this->hasOneof(16); + } + + /** + * A reference to a BigQuery property graph. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.BigQueryPropertyGraphReference bigquery_property_graph_reference = 16; + * @param \Google\Cloud\GeminiDataAnalytics\V1\BigQueryPropertyGraphReference $var + * @return $this + */ + public function setBigqueryPropertyGraphReference($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\BigQueryPropertyGraphReference::class); + $this->writeOneof(16, $var); + + return $this; + } + + /** + * Optional. The schema of the datasource. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Schema schema = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\GeminiDataAnalytics\V1\Schema|null + */ + public function getSchema() + { + return $this->schema; + } + + public function hasSchema() + { + return isset($this->schema); + } + + public function clearSchema() + { + unset($this->schema); + } + + /** + * Optional. The schema of the datasource. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Schema schema = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\Schema $var + * @return $this + */ + public function setSchema($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\Schema::class); + $this->schema = $var; + + return $this; + } + + /** + * Optional. A struct representation of the schema. + * This is populated for datasources with schemas that cannot be + * fully represented by the strongly-typed `schema` field. + * For Looker datasources, this maps to the LookmlModelExplore type: + * https://cloud.google.com/looker/docs/reference/looker-api/latest/types/LookmlModelExplore + * + * Generated from protobuf field .google.protobuf.Struct struct_schema = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Struct|null + */ + public function getStructSchema() + { + return $this->struct_schema; + } + + public function hasStructSchema() + { + return isset($this->struct_schema); + } + + public function clearStructSchema() + { + unset($this->struct_schema); + } + + /** + * Optional. A struct representation of the schema. + * This is populated for datasources with schemas that cannot be + * fully represented by the strongly-typed `schema` field. + * For Looker datasources, this maps to the LookmlModelExplore type: + * https://cloud.google.com/looker/docs/reference/looker-api/latest/types/LookmlModelExplore + * + * Generated from protobuf field .google.protobuf.Struct struct_schema = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setStructSchema($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->struct_schema = $var; + + return $this; + } + + /** + * @return string + */ + public function getReference() + { + return $this->whichOneof("reference"); + } + +} + diff --git a/GeminiDataAnalytics/src/V1/DatasourceOptions.php b/GeminiDataAnalytics/src/V1/DatasourceOptions.php new file mode 100644 index 000000000000..9b7dd51c02a0 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/DatasourceOptions.php @@ -0,0 +1,122 @@ +google.cloud.geminidataanalytics.v1.DatasourceOptions + */ +class DatasourceOptions extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. This option applies to datasources that require BigQuery queries + * only. Limits the bytes billed for each BQ query job. Queries that will have + * bytes billed beyond this limit will fail (without incurring a charge). + * If unspecified, no limit will be applied. + * + * Generated from protobuf field .google.protobuf.Int64Value big_query_max_billed_bytes = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $big_query_max_billed_bytes = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Int64Value $big_query_max_billed_bytes + * Optional. This option applies to datasources that require BigQuery queries + * only. Limits the bytes billed for each BQ query job. Queries that will have + * bytes billed beyond this limit will fail (without incurring a charge). + * If unspecified, no limit will be applied. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Context::initOnce(); + parent::__construct($data); + } + + /** + * Optional. This option applies to datasources that require BigQuery queries + * only. Limits the bytes billed for each BQ query job. Queries that will have + * bytes billed beyond this limit will fail (without incurring a charge). + * If unspecified, no limit will be applied. + * + * Generated from protobuf field .google.protobuf.Int64Value big_query_max_billed_bytes = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Int64Value|null + */ + public function getBigQueryMaxBilledBytes() + { + return $this->big_query_max_billed_bytes; + } + + public function hasBigQueryMaxBilledBytes() + { + return isset($this->big_query_max_billed_bytes); + } + + public function clearBigQueryMaxBilledBytes() + { + unset($this->big_query_max_billed_bytes); + } + + /** + * Returns the unboxed value from getBigQueryMaxBilledBytes() + + * Optional. This option applies to datasources that require BigQuery queries + * only. Limits the bytes billed for each BQ query job. Queries that will have + * bytes billed beyond this limit will fail (without incurring a charge). + * If unspecified, no limit will be applied. + * + * Generated from protobuf field .google.protobuf.Int64Value big_query_max_billed_bytes = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string|null + */ + public function getBigQueryMaxBilledBytesUnwrapped() + { + return $this->readWrapperValue("big_query_max_billed_bytes"); + } + + /** + * Optional. This option applies to datasources that require BigQuery queries + * only. Limits the bytes billed for each BQ query job. Queries that will have + * bytes billed beyond this limit will fail (without incurring a charge). + * If unspecified, no limit will be applied. + * + * Generated from protobuf field .google.protobuf.Int64Value big_query_max_billed_bytes = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Int64Value $var + * @return $this + */ + public function setBigQueryMaxBilledBytes($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); + $this->big_query_max_billed_bytes = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. + + * Optional. This option applies to datasources that require BigQuery queries + * only. Limits the bytes billed for each BQ query job. Queries that will have + * bytes billed beyond this limit will fail (without incurring a charge). + * If unspecified, no limit will be applied. + * + * Generated from protobuf field .google.protobuf.Int64Value big_query_max_billed_bytes = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string|null $var + * @return $this + */ + public function setBigQueryMaxBilledBytesUnwrapped($var) + { + $this->writeWrapperValue("big_query_max_billed_bytes", $var); + return $this;} + +} + diff --git a/GeminiDataAnalytics/src/V1/DatasourceReferences.php b/GeminiDataAnalytics/src/V1/DatasourceReferences.php new file mode 100644 index 000000000000..f38588e2fa7a --- /dev/null +++ b/GeminiDataAnalytics/src/V1/DatasourceReferences.php @@ -0,0 +1,141 @@ +google.cloud.geminidataanalytics.v1.DatasourceReferences + */ +class DatasourceReferences extends \Google\Protobuf\Internal\Message +{ + protected $references; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\GeminiDataAnalytics\V1\BigQueryTableReferences $bq + * References to BigQuery tables. + * @type \Google\Cloud\GeminiDataAnalytics\V1\StudioDatasourceReferences $studio + * References to Looker Studio datasources. + * @type \Google\Cloud\GeminiDataAnalytics\V1\LookerExploreReferences $looker + * References to Looker Explores. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Datasource::initOnce(); + parent::__construct($data); + } + + /** + * References to BigQuery tables. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.BigQueryTableReferences bq = 1; + * @return \Google\Cloud\GeminiDataAnalytics\V1\BigQueryTableReferences|null + */ + public function getBq() + { + return $this->readOneof(1); + } + + public function hasBq() + { + return $this->hasOneof(1); + } + + /** + * References to BigQuery tables. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.BigQueryTableReferences bq = 1; + * @param \Google\Cloud\GeminiDataAnalytics\V1\BigQueryTableReferences $var + * @return $this + */ + public function setBq($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\BigQueryTableReferences::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * References to Looker Studio datasources. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.StudioDatasourceReferences studio = 2; + * @return \Google\Cloud\GeminiDataAnalytics\V1\StudioDatasourceReferences|null + */ + public function getStudio() + { + return $this->readOneof(2); + } + + public function hasStudio() + { + return $this->hasOneof(2); + } + + /** + * References to Looker Studio datasources. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.StudioDatasourceReferences studio = 2; + * @param \Google\Cloud\GeminiDataAnalytics\V1\StudioDatasourceReferences $var + * @return $this + */ + public function setStudio($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\StudioDatasourceReferences::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * References to Looker Explores. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.LookerExploreReferences looker = 3; + * @return \Google\Cloud\GeminiDataAnalytics\V1\LookerExploreReferences|null + */ + public function getLooker() + { + return $this->readOneof(3); + } + + public function hasLooker() + { + return $this->hasOneof(3); + } + + /** + * References to Looker Explores. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.LookerExploreReferences looker = 3; + * @param \Google\Cloud\GeminiDataAnalytics\V1\LookerExploreReferences $var + * @return $this + */ + public function setLooker($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\LookerExploreReferences::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getReferences() + { + return $this->whichOneof("references"); + } + +} + diff --git a/GeminiDataAnalytics/src/V1/DeleteConversationRequest.php b/GeminiDataAnalytics/src/V1/DeleteConversationRequest.php new file mode 100644 index 000000000000..1c406e02c77c --- /dev/null +++ b/GeminiDataAnalytics/src/V1/DeleteConversationRequest.php @@ -0,0 +1,91 @@ +google.cloud.geminidataanalytics.v1.DeleteConversationRequest + */ +class DeleteConversationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource. + * Format: + * `projects/{project}/locations/{location}/conversations/{conversation}` + * + * 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 resource. + * Format: + * `projects/{project}/locations/{location}/conversations/{conversation}` + * Please see {@see DataChatServiceClient::conversationName()} for help formatting this field. + * + * @return \Google\Cloud\GeminiDataAnalytics\V1\DeleteConversationRequest + * + * @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. + * Format: + * `projects/{project}/locations/{location}/conversations/{conversation}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource. + * Format: + * `projects/{project}/locations/{location}/conversations/{conversation}` + * + * 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. + * Format: + * `projects/{project}/locations/{location}/conversations/{conversation}` + * + * 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/GeminiDataAnalytics/src/V1/DeleteDataAgentRequest.php b/GeminiDataAnalytics/src/V1/DeleteDataAgentRequest.php new file mode 100644 index 000000000000..334b89a36a24 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/DeleteDataAgentRequest.php @@ -0,0 +1,155 @@ +google.cloud.geminidataanalytics.v1.DeleteDataAgentRequest + */ +class DeleteDataAgentRequest 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 DataAgentServiceClient::dataAgentName()} for help formatting this field. + * + * @return \Google\Cloud\GeminiDataAnalytics\V1\DeleteDataAgentRequest + * + * @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\Geminidataanalytics\V1\DataAgentService::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/GeminiDataAnalytics/src/V1/ErrorMessage.php b/GeminiDataAnalytics/src/V1/ErrorMessage.php new file mode 100644 index 000000000000..165ac989294d --- /dev/null +++ b/GeminiDataAnalytics/src/V1/ErrorMessage.php @@ -0,0 +1,78 @@ +google.cloud.geminidataanalytics.v1.ErrorMessage + */ +class ErrorMessage extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The text of the error. + * + * Generated from protobuf field string text = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $text = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * Output only. The text of the error. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\DataChatService::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The text of the error. + * + * Generated from protobuf field string text = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * Output only. The text of the error. + * + * Generated from protobuf field string text = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/ExampleQueries.php b/GeminiDataAnalytics/src/V1/ExampleQueries.php new file mode 100644 index 000000000000..3cb18d93eb97 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/ExampleQueries.php @@ -0,0 +1,79 @@ +google.cloud.geminidataanalytics.v1.ExampleQueries + */ +class ExampleQueries extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. A list of derived and authored example queries, providing + * examples of relevant and commonly used SQL queries and their corresponding + * natural language queries optionally present. Currently only used for + * BigQuery data sources. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.ExampleQuery example_queries = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $example_queries; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\GeminiDataAnalytics\V1\ExampleQuery[] $example_queries + * Optional. A list of derived and authored example queries, providing + * examples of relevant and commonly used SQL queries and their corresponding + * natural language queries optionally present. Currently only used for + * BigQuery data sources. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\DataChatService::initOnce(); + parent::__construct($data); + } + + /** + * Optional. A list of derived and authored example queries, providing + * examples of relevant and commonly used SQL queries and their corresponding + * natural language queries optionally present. Currently only used for + * BigQuery data sources. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.ExampleQuery example_queries = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\GeminiDataAnalytics\V1\ExampleQuery> + */ + public function getExampleQueries() + { + return $this->example_queries; + } + + /** + * Optional. A list of derived and authored example queries, providing + * examples of relevant and commonly used SQL queries and their corresponding + * natural language queries optionally present. Currently only used for + * BigQuery data sources. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.ExampleQuery example_queries = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\ExampleQuery[] $var + * @return $this + */ + public function setExampleQueries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GeminiDataAnalytics\V1\ExampleQuery::class); + $this->example_queries = $arr; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/ExampleQuery.php b/GeminiDataAnalytics/src/V1/ExampleQuery.php new file mode 100644 index 000000000000..3e6d8adfa09f --- /dev/null +++ b/GeminiDataAnalytics/src/V1/ExampleQuery.php @@ -0,0 +1,167 @@ +google.cloud.geminidataanalytics.v1.ExampleQuery + */ +class ExampleQuery extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. A natural language question that a user might ask. + * For example: "How many orders were placed last month?" + * + * Generated from protobuf field string natural_language_question = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $natural_language_question = ''; + /** + * Optional. The list of query parameters. + * Example: The parameterized SQL query + * "SELECT * FROM my_table WHERE id = \@id" can be matched with any value of + * id. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.QueryParameter parameters = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $parameters; + protected $query; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $sql_query + * Optional. The SQL query that should be generated to answer the natural + * language question. For example: "SELECT COUNT(*) FROM orders WHERE + * order_date BETWEEN '2024-01-01' AND '2024-01-31'" + * @type string $natural_language_question + * Optional. A natural language question that a user might ask. + * For example: "How many orders were placed last month?" + * @type \Google\Cloud\GeminiDataAnalytics\V1\QueryParameter[] $parameters + * Optional. The list of query parameters. + * Example: The parameterized SQL query + * "SELECT * FROM my_table WHERE id = \@id" can be matched with any value of + * id. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Context::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The SQL query that should be generated to answer the natural + * language question. For example: "SELECT COUNT(*) FROM orders WHERE + * order_date BETWEEN '2024-01-01' AND '2024-01-31'" + * + * Generated from protobuf field string sql_query = 101 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSqlQuery() + { + return $this->readOneof(101); + } + + public function hasSqlQuery() + { + return $this->hasOneof(101); + } + + /** + * Optional. The SQL query that should be generated to answer the natural + * language question. For example: "SELECT COUNT(*) FROM orders WHERE + * order_date BETWEEN '2024-01-01' AND '2024-01-31'" + * + * Generated from protobuf field string sql_query = 101 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSqlQuery($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(101, $var); + + return $this; + } + + /** + * Optional. A natural language question that a user might ask. + * For example: "How many orders were placed last month?" + * + * Generated from protobuf field string natural_language_question = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getNaturalLanguageQuestion() + { + return $this->natural_language_question; + } + + /** + * Optional. A natural language question that a user might ask. + * For example: "How many orders were placed last month?" + * + * Generated from protobuf field string natural_language_question = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setNaturalLanguageQuestion($var) + { + GPBUtil::checkString($var, True); + $this->natural_language_question = $var; + + return $this; + } + + /** + * Optional. The list of query parameters. + * Example: The parameterized SQL query + * "SELECT * FROM my_table WHERE id = \@id" can be matched with any value of + * id. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.QueryParameter parameters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\GeminiDataAnalytics\V1\QueryParameter> + */ + public function getParameters() + { + return $this->parameters; + } + + /** + * Optional. The list of query parameters. + * Example: The parameterized SQL query + * "SELECT * FROM my_table WHERE id = \@id" can be matched with any value of + * id. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.QueryParameter parameters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\QueryParameter[] $var + * @return $this + */ + public function setParameters($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GeminiDataAnalytics\V1\QueryParameter::class); + $this->parameters = $arr; + + return $this; + } + + /** + * @return string + */ + public function getQuery() + { + return $this->whichOneof("query"); + } + +} + diff --git a/GeminiDataAnalytics/src/V1/Field.php b/GeminiDataAnalytics/src/V1/Field.php new file mode 100644 index 000000000000..eff8871bb59a --- /dev/null +++ b/GeminiDataAnalytics/src/V1/Field.php @@ -0,0 +1,397 @@ +google.cloud.geminidataanalytics.v1.Field + */ +class Field extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The name of the field. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $name = ''; + /** + * Optional. The type of the field. + * + * Generated from protobuf field string type = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $type = ''; + /** + * Optional. A brief description of the field. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Optional. The mode of the field (e.g., NULLABLE, REPEATED). + * + * Generated from protobuf field string mode = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $mode = ''; + /** + * Optional. A list of alternative names or synonyms that can be used to refer + * to this field. For example: ["id", "customerid", "cust_id"]. Currently only + * used for BigQuery data sources. + * + * Generated from protobuf field repeated string synonyms = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $synonyms; + /** + * Optional. A list of tags or keywords associated with the field, used for + * categorization. For example: ["identifier", "customer", "pii"]. Currently + * only used for BigQuery data sources. + * + * Generated from protobuf field repeated string tags = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $tags; + /** + * Optional. Field display_name (same as label in + * + * Generated from protobuf field string display_name = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_name = ''; + /** + * Optional. Recursive property for nested schema structures. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.Field subfields = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $subfields; + /** + * Optional. Field category, not required, currently only useful for Looker. + * + * Generated from protobuf field string category = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $category = ''; + /** + * Optional. Looker only. Value format of the field. + * Ref: + * https://cloud.google.com/looker/docs/reference/param-field-value-format + * + * Generated from protobuf field string value_format = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $value_format = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Optional. The name of the field. + * @type string $type + * Optional. The type of the field. + * @type string $description + * Optional. A brief description of the field. + * @type string $mode + * Optional. The mode of the field (e.g., NULLABLE, REPEATED). + * @type string[] $synonyms + * Optional. A list of alternative names or synonyms that can be used to refer + * to this field. For example: ["id", "customerid", "cust_id"]. Currently only + * used for BigQuery data sources. + * @type string[] $tags + * Optional. A list of tags or keywords associated with the field, used for + * categorization. For example: ["identifier", "customer", "pii"]. Currently + * only used for BigQuery data sources. + * @type string $display_name + * Optional. Field display_name (same as label in + * @type \Google\Cloud\GeminiDataAnalytics\V1\Field[] $subfields + * Optional. Recursive property for nested schema structures. + * @type string $category + * Optional. Field category, not required, currently only useful for Looker. + * @type string $value_format + * Optional. Looker only. Value format of the field. + * Ref: + * https://cloud.google.com/looker/docs/reference/param-field-value-format + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Datasource::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The name of the field. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Optional. The name of the field. + * + * 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; + } + + /** + * Optional. The type of the field. + * + * Generated from protobuf field string type = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * Optional. The type of the field. + * + * Generated from protobuf field string type = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * Optional. A brief description of the field. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. A brief description of the field. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. The mode of the field (e.g., NULLABLE, REPEATED). + * + * Generated from protobuf field string mode = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getMode() + { + return $this->mode; + } + + /** + * Optional. The mode of the field (e.g., NULLABLE, REPEATED). + * + * Generated from protobuf field string mode = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setMode($var) + { + GPBUtil::checkString($var, True); + $this->mode = $var; + + return $this; + } + + /** + * Optional. A list of alternative names or synonyms that can be used to refer + * to this field. For example: ["id", "customerid", "cust_id"]. Currently only + * used for BigQuery data sources. + * + * Generated from protobuf field repeated string synonyms = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField + */ + public function getSynonyms() + { + return $this->synonyms; + } + + /** + * Optional. A list of alternative names or synonyms that can be used to refer + * to this field. For example: ["id", "customerid", "cust_id"]. Currently only + * used for BigQuery data sources. + * + * Generated from protobuf field repeated string synonyms = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string[] $var + * @return $this + */ + public function setSynonyms($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->synonyms = $arr; + + return $this; + } + + /** + * Optional. A list of tags or keywords associated with the field, used for + * categorization. For example: ["identifier", "customer", "pii"]. Currently + * only used for BigQuery data sources. + * + * Generated from protobuf field repeated string tags = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField + */ + public function getTags() + { + return $this->tags; + } + + /** + * Optional. A list of tags or keywords associated with the field, used for + * categorization. For example: ["identifier", "customer", "pii"]. Currently + * only used for BigQuery data sources. + * + * Generated from protobuf field repeated string tags = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param string[] $var + * @return $this + */ + public function setTags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->tags = $arr; + + return $this; + } + + /** + * Optional. Field display_name (same as label in + * + * Generated from protobuf field string display_name = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Optional. Field display_name (same as label in + * + * Generated from protobuf field string display_name = 8 [(.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. Recursive property for nested schema structures. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.Field subfields = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\GeminiDataAnalytics\V1\Field> + */ + public function getSubfields() + { + return $this->subfields; + } + + /** + * Optional. Recursive property for nested schema structures. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.Field subfields = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\Field[] $var + * @return $this + */ + public function setSubfields($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GeminiDataAnalytics\V1\Field::class); + $this->subfields = $arr; + + return $this; + } + + /** + * Optional. Field category, not required, currently only useful for Looker. + * + * Generated from protobuf field string category = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getCategory() + { + return $this->category; + } + + /** + * Optional. Field category, not required, currently only useful for Looker. + * + * Generated from protobuf field string category = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setCategory($var) + { + GPBUtil::checkString($var, True); + $this->category = $var; + + return $this; + } + + /** + * Optional. Looker only. Value format of the field. + * Ref: + * https://cloud.google.com/looker/docs/reference/param-field-value-format + * + * Generated from protobuf field string value_format = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getValueFormat() + { + return $this->value_format; + } + + /** + * Optional. Looker only. Value format of the field. + * Ref: + * https://cloud.google.com/looker/docs/reference/param-field-value-format + * + * Generated from protobuf field string value_format = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setValueFormat($var) + { + GPBUtil::checkString($var, True); + $this->value_format = $var; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/GetConversationRequest.php b/GeminiDataAnalytics/src/V1/GetConversationRequest.php new file mode 100644 index 000000000000..cbd890066913 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/GetConversationRequest.php @@ -0,0 +1,91 @@ +google.cloud.geminidataanalytics.v1.GetConversationRequest + */ +class GetConversationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource. + * Format: + * `projects/{project}/locations/{location}/conversations/{conversation}` + * + * 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 resource. + * Format: + * `projects/{project}/locations/{location}/conversations/{conversation}` + * Please see {@see DataChatServiceClient::conversationName()} for help formatting this field. + * + * @return \Google\Cloud\GeminiDataAnalytics\V1\GetConversationRequest + * + * @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. + * Format: + * `projects/{project}/locations/{location}/conversations/{conversation}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource. + * Format: + * `projects/{project}/locations/{location}/conversations/{conversation}` + * + * 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. + * Format: + * `projects/{project}/locations/{location}/conversations/{conversation}` + * + * 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/GeminiDataAnalytics/src/V1/GetDataAgentRequest.php b/GeminiDataAnalytics/src/V1/GetDataAgentRequest.php new file mode 100644 index 000000000000..655764a1fbed --- /dev/null +++ b/GeminiDataAnalytics/src/V1/GetDataAgentRequest.php @@ -0,0 +1,81 @@ +google.cloud.geminidataanalytics.v1.GetDataAgentRequest + */ +class GetDataAgentRequest 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 = ''; + + /** + * @param string $name Required. Name of the resource. Please see + * {@see DataAgentServiceClient::dataAgentName()} for help formatting this field. + * + * @return \Google\Cloud\GeminiDataAnalytics\V1\GetDataAgentRequest + * + * @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. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\DataAgentService::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; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/GlossaryTerm.php b/GeminiDataAnalytics/src/V1/GlossaryTerm.php new file mode 100644 index 000000000000..0709a4848703 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/GlossaryTerm.php @@ -0,0 +1,151 @@ +google.cloud.geminidataanalytics.v1.GlossaryTerm + */ +class GlossaryTerm extends \Google\Protobuf\Internal\Message +{ + /** + * Required. User friendly display name of the glossary term being defined. + * For example: "CTR", "conversion rate", "pending" + * + * Generated from protobuf field string display_name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_name = ''; + /** + * Required. The description or meaning of the term. + * For example: "Click-through rate", "The percentage of users who complete a + * desired action", "An order that is waiting to be processed." + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $description = ''; + /** + * Optional. A list of general purpose labels associated to this term. + * For example: ["click rate", "clickthrough", "waiting"] + * + * Generated from protobuf field repeated string labels = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $display_name + * Required. User friendly display name of the glossary term being defined. + * For example: "CTR", "conversion rate", "pending" + * @type string $description + * Required. The description or meaning of the term. + * For example: "Click-through rate", "The percentage of users who complete a + * desired action", "An order that is waiting to be processed." + * @type string[] $labels + * Optional. A list of general purpose labels associated to this term. + * For example: ["click rate", "clickthrough", "waiting"] + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Context::initOnce(); + parent::__construct($data); + } + + /** + * Required. User friendly display name of the glossary term being defined. + * For example: "CTR", "conversion rate", "pending" + * + * Generated from protobuf field string display_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Required. User friendly display name of the glossary term being defined. + * For example: "CTR", "conversion rate", "pending" + * + * Generated from protobuf field string display_name = 1 [(.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 description or meaning of the term. + * For example: "Click-through rate", "The percentage of users who complete a + * desired action", "An order that is waiting to be processed." + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Required. The description or meaning of the term. + * For example: "Click-through rate", "The percentage of users who complete a + * desired action", "An order that is waiting to be processed." + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. A list of general purpose labels associated to this term. + * For example: ["click rate", "clickthrough", "waiting"] + * + * Generated from protobuf field repeated string labels = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. A list of general purpose labels associated to this term. + * For example: ["click rate", "clickthrough", "waiting"] + * + * Generated from protobuf field repeated string labels = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string[] $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/ListAccessibleDataAgentsRequest.php b/GeminiDataAnalytics/src/V1/ListAccessibleDataAgentsRequest.php new file mode 100644 index 000000000000..5774e176ea65 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/ListAccessibleDataAgentsRequest.php @@ -0,0 +1,313 @@ +google.cloud.geminidataanalytics.v1.ListAccessibleDataAgentsRequest + */ +class ListAccessibleDataAgentsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent value for ListAccessibleDataAgentsRequest. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. 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 page token, received from a previous `ListAccessibleDataAgents` + * call. Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * `ListAccessibleDataAgents` must match the call that provided the page + * token. The service may return fewer than this value. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filtering results. See [AIP-160](https://google.aip.dev/160) for + * syntax. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. User specification for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + /** + * Optional. If true, the list results will include soft-deleted DataAgents. + * Defaults to false. + * + * Generated from protobuf field bool show_deleted = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $show_deleted = false; + /** + * Optional. Filter for the creator of the agent. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.ListAccessibleDataAgentsRequest.CreatorFilter creator_filter = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $creator_filter = 0; + + /** + * @param string $parent Required. Parent value for ListAccessibleDataAgentsRequest. Please see + * {@see DataAgentServiceClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\GeminiDataAnalytics\V1\ListAccessibleDataAgentsRequest + * + * @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 ListAccessibleDataAgentsRequest. + * @type int $page_size + * Optional. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @type string $page_token + * Optional. A page token, received from a previous `ListAccessibleDataAgents` + * call. Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * `ListAccessibleDataAgents` must match the call that provided the page + * token. The service may return fewer than this value. + * @type string $filter + * Optional. Filtering results. See [AIP-160](https://google.aip.dev/160) for + * syntax. + * @type string $order_by + * Optional. User specification for how to order the results. + * @type bool $show_deleted + * Optional. If true, the list results will include soft-deleted DataAgents. + * Defaults to false. + * @type int $creator_filter + * Optional. Filter for the creator of the agent. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\DataAgentService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent value for ListAccessibleDataAgentsRequest. + * + * 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 ListAccessibleDataAgentsRequest. + * + * 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. 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. 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 page token, received from a previous `ListAccessibleDataAgents` + * call. Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * `ListAccessibleDataAgents` must match the call that provided the page + * token. The service may return fewer than this value. + * + * 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 `ListAccessibleDataAgents` + * call. Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * `ListAccessibleDataAgents` must match the call that provided the page + * token. The service may return fewer than this value. + * + * 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. See [AIP-160](https://google.aip.dev/160) for + * syntax. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering results. See [AIP-160](https://google.aip.dev/160) for + * syntax. + * + * 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. User specification 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. User specification 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. If true, the list results will include soft-deleted DataAgents. + * Defaults to false. + * + * Generated from protobuf field bool show_deleted = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getShowDeleted() + { + return $this->show_deleted; + } + + /** + * Optional. If true, the list results will include soft-deleted DataAgents. + * Defaults to false. + * + * Generated from protobuf field bool show_deleted = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setShowDeleted($var) + { + GPBUtil::checkBool($var); + $this->show_deleted = $var; + + return $this; + } + + /** + * Optional. Filter for the creator of the agent. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.ListAccessibleDataAgentsRequest.CreatorFilter creator_filter = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getCreatorFilter() + { + return $this->creator_filter; + } + + /** + * Optional. Filter for the creator of the agent. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.ListAccessibleDataAgentsRequest.CreatorFilter creator_filter = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setCreatorFilter($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GeminiDataAnalytics\V1\ListAccessibleDataAgentsRequest\CreatorFilter::class); + $this->creator_filter = $var; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/ListAccessibleDataAgentsRequest/CreatorFilter.php b/GeminiDataAnalytics/src/V1/ListAccessibleDataAgentsRequest/CreatorFilter.php new file mode 100644 index 000000000000..12cb4152785e --- /dev/null +++ b/GeminiDataAnalytics/src/V1/ListAccessibleDataAgentsRequest/CreatorFilter.php @@ -0,0 +1,68 @@ +google.cloud.geminidataanalytics.v1.ListAccessibleDataAgentsRequest.CreatorFilter + */ +class CreatorFilter +{ + /** + * Default value. + * + * Generated from protobuf enum CREATOR_FILTER_UNSPECIFIED = 0; + */ + const CREATOR_FILTER_UNSPECIFIED = 0; + /** + * No creator-specific filter will be applied. All agents will be returned. + * + * Generated from protobuf enum NONE = 1; + */ + const NONE = 1; + /** + * Only agents created by the user calling the API will be returned. + * + * Generated from protobuf enum CREATOR_ONLY = 2; + */ + const CREATOR_ONLY = 2; + /** + * Only agents not created by the user calling the API will be returned. + * + * Generated from protobuf enum NOT_CREATOR_ONLY = 3; + */ + const NOT_CREATOR_ONLY = 3; + + private static $valueToName = [ + self::CREATOR_FILTER_UNSPECIFIED => 'CREATOR_FILTER_UNSPECIFIED', + self::NONE => 'NONE', + self::CREATOR_ONLY => 'CREATOR_ONLY', + self::NOT_CREATOR_ONLY => 'NOT_CREATOR_ONLY', + ]; + + 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/GeminiDataAnalytics/src/V1/ListAccessibleDataAgentsResponse.php b/GeminiDataAnalytics/src/V1/ListAccessibleDataAgentsResponse.php new file mode 100644 index 000000000000..1830cc47583f --- /dev/null +++ b/GeminiDataAnalytics/src/V1/ListAccessibleDataAgentsResponse.php @@ -0,0 +1,135 @@ +google.cloud.geminidataanalytics.v1.ListAccessibleDataAgentsResponse + */ +class ListAccessibleDataAgentsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of accessible DataAgent. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.DataAgent data_agents = 1; + */ + private $data_agents; + /** + * The next page token or empty if none. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Unordered list. Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\GeminiDataAnalytics\V1\DataAgent[] $data_agents + * The list of accessible DataAgent. + * @type string $next_page_token + * The next page token or empty if none. + * @type string[] $unreachable + * Unordered list. Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\DataAgentService::initOnce(); + parent::__construct($data); + } + + /** + * The list of accessible DataAgent. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.DataAgent data_agents = 1; + * @return RepeatedField<\Google\Cloud\GeminiDataAnalytics\V1\DataAgent> + */ + public function getDataAgents() + { + return $this->data_agents; + } + + /** + * The list of accessible DataAgent. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.DataAgent data_agents = 1; + * @param \Google\Cloud\GeminiDataAnalytics\V1\DataAgent[] $var + * @return $this + */ + public function setDataAgents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GeminiDataAnalytics\V1\DataAgent::class); + $this->data_agents = $arr; + + return $this; + } + + /** + * The next page token or empty if none. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * The next page token or empty if none. + * + * 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; + } + + /** + * Unordered list. Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * @return RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Unordered list. Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * @param string[] $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/ListConversationsRequest.php b/GeminiDataAnalytics/src/V1/ListConversationsRequest.php new file mode 100644 index 000000000000..4377a380d4a3 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/ListConversationsRequest.php @@ -0,0 +1,212 @@ +google.cloud.geminidataanalytics.v1.ListConversationsRequest + */ +class ListConversationsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent value for ListConversationsRequest. + * Format: `projects/{project}/locations/{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. The max page size is `100`. All larger page sizes will be + * coerced to `100`. If unspecified, server will pick `50` as 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. Returned conversations will match criteria specified within the + * filter. ListConversations allows filtering by: + * * agents + * * labels + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + + /** + * @param string $parent Required. Parent value for ListConversationsRequest. + * Format: `projects/{project}/locations/{location}` + * Please see {@see DataChatServiceClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\GeminiDataAnalytics\V1\ListConversationsRequest + * + * @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 ListConversationsRequest. + * Format: `projects/{project}/locations/{location}` + * @type int $page_size + * Optional. Requested page size. Server may return fewer items than + * requested. The max page size is `100`. All larger page sizes will be + * coerced to `100`. If unspecified, server will pick `50` as an appropriate + * default. + * @type string $page_token + * Optional. A token identifying a page of results the server should return. + * @type string $filter + * Optional. Returned conversations will match criteria specified within the + * filter. ListConversations allows filtering by: + * * agents + * * labels + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent value for ListConversationsRequest. + * Format: `projects/{project}/locations/{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. Parent value for ListConversationsRequest. + * Format: `projects/{project}/locations/{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. The max page size is `100`. All larger page sizes will be + * coerced to `100`. If unspecified, server will pick `50` as 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. The max page size is `100`. All larger page sizes will be + * coerced to `100`. If unspecified, server will pick `50` as 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. Returned conversations will match criteria specified within the + * filter. ListConversations allows filtering by: + * * agents + * * labels + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Returned conversations will match criteria specified within the + * filter. ListConversations allows filtering by: + * * agents + * * labels + * + * 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/GeminiDataAnalytics/src/V1/ListConversationsResponse.php b/GeminiDataAnalytics/src/V1/ListConversationsResponse.php new file mode 100644 index 000000000000..9f6c0b6b7898 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/ListConversationsResponse.php @@ -0,0 +1,101 @@ +google.cloud.geminidataanalytics.v1.ListConversationsResponse + */ +class ListConversationsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of conversations. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.Conversation conversations = 1; + */ + private $conversations; + /** + * 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 \Google\Cloud\GeminiDataAnalytics\V1\Conversation[] $conversations + * The list of conversations. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Conversation::initOnce(); + parent::__construct($data); + } + + /** + * The list of conversations. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.Conversation conversations = 1; + * @return RepeatedField<\Google\Cloud\GeminiDataAnalytics\V1\Conversation> + */ + public function getConversations() + { + return $this->conversations; + } + + /** + * The list of conversations. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.Conversation conversations = 1; + * @param \Google\Cloud\GeminiDataAnalytics\V1\Conversation[] $var + * @return $this + */ + public function setConversations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GeminiDataAnalytics\V1\Conversation::class); + $this->conversations = $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/GeminiDataAnalytics/src/V1/ListDataAgentsRequest.php b/GeminiDataAnalytics/src/V1/ListDataAgentsRequest.php new file mode 100644 index 000000000000..452fd81aac0f --- /dev/null +++ b/GeminiDataAnalytics/src/V1/ListDataAgentsRequest.php @@ -0,0 +1,279 @@ +google.cloud.geminidataanalytics.v1.ListDataAgentsRequest + */ +class ListDataAgentsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent value for ListDataAgentsRequest. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. 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 page token, received from a previous `ListDataAgents` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListDataAgents` must + * match the call that provided the page token. The service may return fewer + * than this value. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filtering results. See [AIP-160](https://google.aip.dev/160) for + * syntax. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. User specification for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + /** + * Optional. If true, the list results will include soft-deleted DataAgents. + * Defaults to false. + * + * Generated from protobuf field bool show_deleted = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $show_deleted = false; + + /** + * @param string $parent Required. Parent value for ListDataAgentsRequest. Please see + * {@see DataAgentServiceClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\GeminiDataAnalytics\V1\ListDataAgentsRequest + * + * @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 ListDataAgentsRequest. + * @type int $page_size + * Optional. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @type string $page_token + * Optional. A page token, received from a previous `ListDataAgents` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListDataAgents` must + * match the call that provided the page token. The service may return fewer + * than this value. + * @type string $filter + * Optional. Filtering results. See [AIP-160](https://google.aip.dev/160) for + * syntax. + * @type string $order_by + * Optional. User specification for how to order the results. + * @type bool $show_deleted + * Optional. If true, the list results will include soft-deleted DataAgents. + * Defaults to false. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\DataAgentService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent value for ListDataAgentsRequest. + * + * 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 ListDataAgentsRequest. + * + * 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. 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. 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 page token, received from a previous `ListDataAgents` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListDataAgents` must + * match the call that provided the page token. The service may return fewer + * than this value. + * + * 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 `ListDataAgents` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListDataAgents` must + * match the call that provided the page token. The service may return fewer + * than this value. + * + * 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. See [AIP-160](https://google.aip.dev/160) for + * syntax. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering results. See [AIP-160](https://google.aip.dev/160) for + * syntax. + * + * 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. User specification 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. User specification 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. If true, the list results will include soft-deleted DataAgents. + * Defaults to false. + * + * Generated from protobuf field bool show_deleted = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getShowDeleted() + { + return $this->show_deleted; + } + + /** + * Optional. If true, the list results will include soft-deleted DataAgents. + * Defaults to false. + * + * Generated from protobuf field bool show_deleted = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setShowDeleted($var) + { + GPBUtil::checkBool($var); + $this->show_deleted = $var; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/ListDataAgentsResponse.php b/GeminiDataAnalytics/src/V1/ListDataAgentsResponse.php new file mode 100644 index 000000000000..cefb33b09203 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/ListDataAgentsResponse.php @@ -0,0 +1,135 @@ +google.cloud.geminidataanalytics.v1.ListDataAgentsResponse + */ +class ListDataAgentsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of DataAgent. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.DataAgent data_agents = 1; + */ + private $data_agents; + /** + * The next page token or empty if none. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Unordered list. Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\GeminiDataAnalytics\V1\DataAgent[] $data_agents + * The list of DataAgent. + * @type string $next_page_token + * The next page token or empty if none. + * @type string[] $unreachable + * Unordered list. Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\DataAgentService::initOnce(); + parent::__construct($data); + } + + /** + * The list of DataAgent. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.DataAgent data_agents = 1; + * @return RepeatedField<\Google\Cloud\GeminiDataAnalytics\V1\DataAgent> + */ + public function getDataAgents() + { + return $this->data_agents; + } + + /** + * The list of DataAgent. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.DataAgent data_agents = 1; + * @param \Google\Cloud\GeminiDataAnalytics\V1\DataAgent[] $var + * @return $this + */ + public function setDataAgents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GeminiDataAnalytics\V1\DataAgent::class); + $this->data_agents = $arr; + + return $this; + } + + /** + * The next page token or empty if none. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * The next page token or empty if none. + * + * 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; + } + + /** + * Unordered list. Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * @return RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Unordered list. Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * @param string[] $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/ListMessagesRequest.php b/GeminiDataAnalytics/src/V1/ListMessagesRequest.php new file mode 100644 index 000000000000..7bbeb60bc032 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/ListMessagesRequest.php @@ -0,0 +1,221 @@ +google.cloud.geminidataanalytics.v1.ListMessagesRequest + */ +class ListMessagesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The conversation to list messages under. + * Format: + * `projects/{project}/locations/{location}/conversations/{conversation_id}` + * + * 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. The max page size is `100`. All larger page sizes will be + * coerced to `100`. If unspecified, server will pick `50` as an appropriate + * default. + * + * Generated from protobuf field int32 page_size = 3 [(.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 = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filtering results. See [AIP-160](https://google.aip.dev/160) for + * syntax. + * ListMessages allows filtering by: + * * create_time (e.g., `createTime > "2025-01-28T06:51:56-08:00"`) + * * update_time + * + * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + + /** + * @param string $parent Required. The conversation to list messages under. + * Format: + * `projects/{project}/locations/{location}/conversations/{conversation_id}` + * Please see {@see DataChatServiceClient::conversationName()} for help formatting this field. + * + * @return \Google\Cloud\GeminiDataAnalytics\V1\ListMessagesRequest + * + * @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 conversation to list messages under. + * Format: + * `projects/{project}/locations/{location}/conversations/{conversation_id}` + * @type int $page_size + * Optional. Requested page size. Server may return fewer items than + * requested. The max page size is `100`. All larger page sizes will be + * coerced to `100`. If unspecified, server will pick `50` as 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. See [AIP-160](https://google.aip.dev/160) for + * syntax. + * ListMessages allows filtering by: + * * create_time (e.g., `createTime > "2025-01-28T06:51:56-08:00"`) + * * update_time + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\DataChatService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The conversation to list messages under. + * Format: + * `projects/{project}/locations/{location}/conversations/{conversation_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 conversation to list messages under. + * Format: + * `projects/{project}/locations/{location}/conversations/{conversation_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. Requested page size. Server may return fewer items than + * requested. The max page size is `100`. All larger page sizes will be + * coerced to `100`. If unspecified, server will pick `50` as an appropriate + * default. + * + * Generated from protobuf field int32 page_size = 3 [(.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. The max page size is `100`. All larger page sizes will be + * coerced to `100`. If unspecified, server will pick `50` as an appropriate + * default. + * + * Generated from protobuf field int32 page_size = 3 [(.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 = 4 [(.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 = 4 [(.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. See [AIP-160](https://google.aip.dev/160) for + * syntax. + * ListMessages allows filtering by: + * * create_time (e.g., `createTime > "2025-01-28T06:51:56-08:00"`) + * * update_time + * + * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering results. See [AIP-160](https://google.aip.dev/160) for + * syntax. + * ListMessages allows filtering by: + * * create_time (e.g., `createTime > "2025-01-28T06:51:56-08:00"`) + * * update_time + * + * 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/GeminiDataAnalytics/src/V1/ListMessagesResponse.php b/GeminiDataAnalytics/src/V1/ListMessagesResponse.php new file mode 100644 index 000000000000..f5069ff95ffd --- /dev/null +++ b/GeminiDataAnalytics/src/V1/ListMessagesResponse.php @@ -0,0 +1,101 @@ +google.cloud.geminidataanalytics.v1.ListMessagesResponse + */ +class ListMessagesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of chat messages. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.StorageMessage messages = 1; + */ + private $messages; + /** + * 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 \Google\Cloud\GeminiDataAnalytics\V1\StorageMessage[] $messages + * The list of chat messages. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\DataChatService::initOnce(); + parent::__construct($data); + } + + /** + * The list of chat messages. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.StorageMessage messages = 1; + * @return RepeatedField<\Google\Cloud\GeminiDataAnalytics\V1\StorageMessage> + */ + public function getMessages() + { + return $this->messages; + } + + /** + * The list of chat messages. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.StorageMessage messages = 1; + * @param \Google\Cloud\GeminiDataAnalytics\V1\StorageMessage[] $var + * @return $this + */ + public function setMessages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GeminiDataAnalytics\V1\StorageMessage::class); + $this->messages = $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/GeminiDataAnalytics/src/V1/LookerExploreReference.php b/GeminiDataAnalytics/src/V1/LookerExploreReference.php new file mode 100644 index 000000000000..1a282608232e --- /dev/null +++ b/GeminiDataAnalytics/src/V1/LookerExploreReference.php @@ -0,0 +1,244 @@ +google.cloud.geminidataanalytics.v1.LookerExploreReference + */ +class LookerExploreReference extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Looker model, as outlined in + * [Major LookML + * structures](https://cloud.google.com/looker/docs/lookml-terms-and-concepts#major_lookml_structures). + * Name of the LookML model. + * + * Generated from protobuf field string lookml_model = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $lookml_model = ''; + /** + * Required. Looker Explore, as outlined in + * [Major LookML + * structures](https://cloud.google.com/looker/docs/lookml-terms-and-concepts#major_lookml_structures). + * Name of the LookML Explore. + * + * Generated from protobuf field string explore = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $explore = ''; + /** + * Optional. The schema of the datasource. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Schema schema = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $schema = null; + protected $instance; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $looker_instance_uri + * Required. The base url of the Looker instance. + * @type \Google\Cloud\GeminiDataAnalytics\V1\PrivateLookerInstanceInfo $private_looker_instance_info + * Private Looker instance info. + * @type string $lookml_model + * Required. Looker model, as outlined in + * [Major LookML + * structures](https://cloud.google.com/looker/docs/lookml-terms-and-concepts#major_lookml_structures). + * Name of the LookML model. + * @type string $explore + * Required. Looker Explore, as outlined in + * [Major LookML + * structures](https://cloud.google.com/looker/docs/lookml-terms-and-concepts#major_lookml_structures). + * Name of the LookML Explore. + * @type \Google\Cloud\GeminiDataAnalytics\V1\Schema $schema + * Optional. The schema of the datasource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Datasource::initOnce(); + parent::__construct($data); + } + + /** + * Required. The base url of the Looker instance. + * + * Generated from protobuf field string looker_instance_uri = 9; + * @return string + */ + public function getLookerInstanceUri() + { + return $this->readOneof(9); + } + + public function hasLookerInstanceUri() + { + return $this->hasOneof(9); + } + + /** + * Required. The base url of the Looker instance. + * + * Generated from protobuf field string looker_instance_uri = 9; + * @param string $var + * @return $this + */ + public function setLookerInstanceUri($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * Private Looker instance info. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.PrivateLookerInstanceInfo private_looker_instance_info = 10; + * @return \Google\Cloud\GeminiDataAnalytics\V1\PrivateLookerInstanceInfo|null + */ + public function getPrivateLookerInstanceInfo() + { + return $this->readOneof(10); + } + + public function hasPrivateLookerInstanceInfo() + { + return $this->hasOneof(10); + } + + /** + * Private Looker instance info. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.PrivateLookerInstanceInfo private_looker_instance_info = 10; + * @param \Google\Cloud\GeminiDataAnalytics\V1\PrivateLookerInstanceInfo $var + * @return $this + */ + public function setPrivateLookerInstanceInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\PrivateLookerInstanceInfo::class); + $this->writeOneof(10, $var); + + return $this; + } + + /** + * Required. Looker model, as outlined in + * [Major LookML + * structures](https://cloud.google.com/looker/docs/lookml-terms-and-concepts#major_lookml_structures). + * Name of the LookML model. + * + * Generated from protobuf field string lookml_model = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getLookmlModel() + { + return $this->lookml_model; + } + + /** + * Required. Looker model, as outlined in + * [Major LookML + * structures](https://cloud.google.com/looker/docs/lookml-terms-and-concepts#major_lookml_structures). + * Name of the LookML model. + * + * Generated from protobuf field string lookml_model = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setLookmlModel($var) + { + GPBUtil::checkString($var, True); + $this->lookml_model = $var; + + return $this; + } + + /** + * Required. Looker Explore, as outlined in + * [Major LookML + * structures](https://cloud.google.com/looker/docs/lookml-terms-and-concepts#major_lookml_structures). + * Name of the LookML Explore. + * + * Generated from protobuf field string explore = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getExplore() + { + return $this->explore; + } + + /** + * Required. Looker Explore, as outlined in + * [Major LookML + * structures](https://cloud.google.com/looker/docs/lookml-terms-and-concepts#major_lookml_structures). + * Name of the LookML Explore. + * + * Generated from protobuf field string explore = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setExplore($var) + { + GPBUtil::checkString($var, True); + $this->explore = $var; + + return $this; + } + + /** + * Optional. The schema of the datasource. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Schema schema = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\GeminiDataAnalytics\V1\Schema|null + */ + public function getSchema() + { + return $this->schema; + } + + public function hasSchema() + { + return isset($this->schema); + } + + public function clearSchema() + { + unset($this->schema); + } + + /** + * Optional. The schema of the datasource. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Schema schema = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\Schema $var + * @return $this + */ + public function setSchema($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\Schema::class); + $this->schema = $var; + + return $this; + } + + /** + * @return string + */ + public function getInstance() + { + return $this->whichOneof("instance"); + } + +} + diff --git a/GeminiDataAnalytics/src/V1/LookerExploreReferences.php b/GeminiDataAnalytics/src/V1/LookerExploreReferences.php new file mode 100644 index 000000000000..175ab25850d7 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/LookerExploreReferences.php @@ -0,0 +1,67 @@ +google.cloud.geminidataanalytics.v1.LookerExploreReferences + */ +class LookerExploreReferences extends \Google\Protobuf\Internal\Message +{ + /** + * Required. References to Looker explores. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.LookerExploreReference explore_references = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $explore_references; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\GeminiDataAnalytics\V1\LookerExploreReference[] $explore_references + * Required. References to Looker explores. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Datasource::initOnce(); + parent::__construct($data); + } + + /** + * Required. References to Looker explores. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.LookerExploreReference explore_references = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return RepeatedField<\Google\Cloud\GeminiDataAnalytics\V1\LookerExploreReference> + */ + public function getExploreReferences() + { + return $this->explore_references; + } + + /** + * Required. References to Looker explores. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.LookerExploreReference explore_references = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\LookerExploreReference[] $var + * @return $this + */ + public function setExploreReferences($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GeminiDataAnalytics\V1\LookerExploreReference::class); + $this->explore_references = $arr; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/LookerGoldenQuery.php b/GeminiDataAnalytics/src/V1/LookerGoldenQuery.php new file mode 100644 index 000000000000..a42984aa7e19 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/LookerGoldenQuery.php @@ -0,0 +1,116 @@ +google.cloud.geminidataanalytics.v1.LookerGoldenQuery + */ +class LookerGoldenQuery extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Natural language questions that a user might ask. + * For example: "How many orders were placed last month?" + * + * Generated from protobuf field repeated string natural_language_questions = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $natural_language_questions; + /** + * Optional. The Looker Query corresponding to the natural language questions. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.LookerQuery looker_query = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $looker_query = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string[] $natural_language_questions + * Optional. Natural language questions that a user might ask. + * For example: "How many orders were placed last month?" + * @type \Google\Cloud\GeminiDataAnalytics\V1\LookerQuery $looker_query + * Optional. The Looker Query corresponding to the natural language questions. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Context::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Natural language questions that a user might ask. + * For example: "How many orders were placed last month?" + * + * Generated from protobuf field repeated string natural_language_questions = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField + */ + public function getNaturalLanguageQuestions() + { + return $this->natural_language_questions; + } + + /** + * Optional. Natural language questions that a user might ask. + * For example: "How many orders were placed last month?" + * + * Generated from protobuf field repeated string natural_language_questions = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string[] $var + * @return $this + */ + public function setNaturalLanguageQuestions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->natural_language_questions = $arr; + + return $this; + } + + /** + * Optional. The Looker Query corresponding to the natural language questions. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.LookerQuery looker_query = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\GeminiDataAnalytics\V1\LookerQuery|null + */ + public function getLookerQuery() + { + return $this->looker_query; + } + + public function hasLookerQuery() + { + return isset($this->looker_query); + } + + public function clearLookerQuery() + { + unset($this->looker_query); + } + + /** + * Optional. The Looker Query corresponding to the natural language questions. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.LookerQuery looker_query = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\LookerQuery $var + * @return $this + */ + public function setLookerQuery($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\LookerQuery::class); + $this->looker_query = $var; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/LookerQuery.php b/GeminiDataAnalytics/src/V1/LookerQuery.php new file mode 100644 index 000000000000..50d92db6a6f0 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/LookerQuery.php @@ -0,0 +1,353 @@ +google.cloud.geminidataanalytics.v1.LookerQuery + */ +class LookerQuery extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The LookML model used to generate the query. + * + * Generated from protobuf field string model = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $model = ''; + /** + * Required. The LookML explore used to generate the query. + * + * Generated from protobuf field string explore = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $explore = ''; + /** + * Optional. The fields to retrieve from the explore. + * + * Generated from protobuf field repeated string fields = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $fields; + /** + * Optional. The filters to apply to the explore. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.LookerQuery.Filter filters = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $filters; + /** + * Optional. The sorts to apply to the explore. + * + * Generated from protobuf field repeated string sorts = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $sorts; + /** + * Optional. Limit in the query. + * + * Generated from protobuf field optional string limit = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $limit = null; + /** + * Optional. The primary identifier for the query resource in Looker, used for + * API operations. Maps to `id` (or `slug`) in the Looker API `Query` + * resource. + * + * Generated from protobuf field optional string query_id = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $query_id = null; + /** + * Optional. The short alphanumeric identifier for the query, used for share + * links and Explore URLs (e.g., in the `qid` parameter). Maps to `client_id` + * in the Looker API `Query` resource. + * + * Generated from protobuf field optional string client_id = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $client_id = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $model + * Required. The LookML model used to generate the query. + * @type string $explore + * Required. The LookML explore used to generate the query. + * @type string[] $fields + * Optional. The fields to retrieve from the explore. + * @type \Google\Cloud\GeminiDataAnalytics\V1\LookerQuery\Filter[] $filters + * Optional. The filters to apply to the explore. + * @type string[] $sorts + * Optional. The sorts to apply to the explore. + * @type string $limit + * Optional. Limit in the query. + * @type string $query_id + * Optional. The primary identifier for the query resource in Looker, used for + * API operations. Maps to `id` (or `slug`) in the Looker API `Query` + * resource. + * @type string $client_id + * Optional. The short alphanumeric identifier for the query, used for share + * links and Explore URLs (e.g., in the `qid` parameter). Maps to `client_id` + * in the Looker API `Query` resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Context::initOnce(); + parent::__construct($data); + } + + /** + * Required. The LookML model used to generate the query. + * + * Generated from protobuf field string model = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getModel() + { + return $this->model; + } + + /** + * Required. The LookML model used to generate the query. + * + * Generated from protobuf field string model = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setModel($var) + { + GPBUtil::checkString($var, True); + $this->model = $var; + + return $this; + } + + /** + * Required. The LookML explore used to generate the query. + * + * Generated from protobuf field string explore = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getExplore() + { + return $this->explore; + } + + /** + * Required. The LookML explore used to generate the query. + * + * Generated from protobuf field string explore = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setExplore($var) + { + GPBUtil::checkString($var, True); + $this->explore = $var; + + return $this; + } + + /** + * Optional. The fields to retrieve from the explore. + * + * Generated from protobuf field repeated string fields = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField + */ + public function getFields() + { + return $this->fields; + } + + /** + * Optional. The fields to retrieve from the explore. + * + * Generated from protobuf field repeated string fields = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string[] $var + * @return $this + */ + public function setFields($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->fields = $arr; + + return $this; + } + + /** + * Optional. The filters to apply to the explore. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.LookerQuery.Filter filters = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\GeminiDataAnalytics\V1\LookerQuery\Filter> + */ + public function getFilters() + { + return $this->filters; + } + + /** + * Optional. The filters to apply to the explore. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.LookerQuery.Filter filters = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\LookerQuery\Filter[] $var + * @return $this + */ + public function setFilters($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GeminiDataAnalytics\V1\LookerQuery\Filter::class); + $this->filters = $arr; + + return $this; + } + + /** + * Optional. The sorts to apply to the explore. + * + * Generated from protobuf field repeated string sorts = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField + */ + public function getSorts() + { + return $this->sorts; + } + + /** + * Optional. The sorts to apply to the explore. + * + * Generated from protobuf field repeated string sorts = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string[] $var + * @return $this + */ + public function setSorts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->sorts = $arr; + + return $this; + } + + /** + * Optional. Limit in the query. + * + * Generated from protobuf field optional string limit = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLimit() + { + return isset($this->limit) ? $this->limit : ''; + } + + public function hasLimit() + { + return isset($this->limit); + } + + public function clearLimit() + { + unset($this->limit); + } + + /** + * Optional. Limit in the query. + * + * Generated from protobuf field optional string limit = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLimit($var) + { + GPBUtil::checkString($var, True); + $this->limit = $var; + + return $this; + } + + /** + * Optional. The primary identifier for the query resource in Looker, used for + * API operations. Maps to `id` (or `slug`) in the Looker API `Query` + * resource. + * + * Generated from protobuf field optional string query_id = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getQueryId() + { + return isset($this->query_id) ? $this->query_id : ''; + } + + public function hasQueryId() + { + return isset($this->query_id); + } + + public function clearQueryId() + { + unset($this->query_id); + } + + /** + * Optional. The primary identifier for the query resource in Looker, used for + * API operations. Maps to `id` (or `slug`) in the Looker API `Query` + * resource. + * + * Generated from protobuf field optional string query_id = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setQueryId($var) + { + GPBUtil::checkString($var, True); + $this->query_id = $var; + + return $this; + } + + /** + * Optional. The short alphanumeric identifier for the query, used for share + * links and Explore URLs (e.g., in the `qid` parameter). Maps to `client_id` + * in the Looker API `Query` resource. + * + * Generated from protobuf field optional string client_id = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getClientId() + { + return isset($this->client_id) ? $this->client_id : ''; + } + + public function hasClientId() + { + return isset($this->client_id); + } + + public function clearClientId() + { + unset($this->client_id); + } + + /** + * Optional. The short alphanumeric identifier for the query, used for share + * links and Explore URLs (e.g., in the `qid` parameter). Maps to `client_id` + * in the Looker API `Query` resource. + * + * Generated from protobuf field optional string client_id = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setClientId($var) + { + GPBUtil::checkString($var, True); + $this->client_id = $var; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/LookerQuery/Filter.php b/GeminiDataAnalytics/src/V1/LookerQuery/Filter.php new file mode 100644 index 000000000000..f1a1cf811fa3 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/LookerQuery/Filter.php @@ -0,0 +1,119 @@ +google.cloud.geminidataanalytics.v1.LookerQuery.Filter + */ +class Filter extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The field to filter on. + * + * Generated from protobuf field string field = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $field = ''; + /** + * Optional. The value for the field to filter on. + * Optional so we can preserve the default value as an empty + * string, important to get a valid and working Looker Explore url. + * + * 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 $field + * Required. The field to filter on. + * @type string $value + * Optional. The value for the field to filter on. + * Optional so we can preserve the default value as an empty + * string, important to get a valid and working Looker Explore url. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Context::initOnce(); + parent::__construct($data); + } + + /** + * Required. The field to filter on. + * + * Generated from protobuf field string field = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getField() + { + return $this->field; + } + + /** + * Required. The field to filter on. + * + * Generated from protobuf field string field = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setField($var) + { + GPBUtil::checkString($var, True); + $this->field = $var; + + return $this; + } + + /** + * Optional. The value for the field to filter on. + * Optional so we can preserve the default value as an empty + * string, important to get a valid and working Looker Explore url. + * + * 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. The value for the field to filter on. + * Optional so we can preserve the default value as an empty + * string, important to get a valid and working Looker Explore url. + * + * 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/GeminiDataAnalytics/src/V1/LookerSettings.php b/GeminiDataAnalytics/src/V1/LookerSettings.php new file mode 100644 index 000000000000..1298655f35fd --- /dev/null +++ b/GeminiDataAnalytics/src/V1/LookerSettings.php @@ -0,0 +1,87 @@ +google.cloud.geminidataanalytics.v1.LookerSettings + */ +class LookerSettings extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Whether to operate in Looker's Development Mode. + * If true, the API session will be switched to the "dev" workspace, + * allowing interaction with LookML changes in the user's development branch. + * If false or unset, the session remains in the default state (Production + * Mode). + * See https://cloud.google.com/looker/docs/dev-mode-prod-mode. + * + * Generated from protobuf field bool enable_dev_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_dev_mode = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enable_dev_mode + * Optional. Whether to operate in Looker's Development Mode. + * If true, the API session will be switched to the "dev" workspace, + * allowing interaction with LookML changes in the user's development branch. + * If false or unset, the session remains in the default state (Production + * Mode). + * See https://cloud.google.com/looker/docs/dev-mode-prod-mode. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\DataChatService::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Whether to operate in Looker's Development Mode. + * If true, the API session will be switched to the "dev" workspace, + * allowing interaction with LookML changes in the user's development branch. + * If false or unset, the session remains in the default state (Production + * Mode). + * See https://cloud.google.com/looker/docs/dev-mode-prod-mode. + * + * Generated from protobuf field bool enable_dev_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableDevMode() + { + return $this->enable_dev_mode; + } + + /** + * Optional. Whether to operate in Looker's Development Mode. + * If true, the API session will be switched to the "dev" workspace, + * allowing interaction with LookML changes in the user's development branch. + * If false or unset, the session remains in the default state (Production + * Mode). + * See https://cloud.google.com/looker/docs/dev-mode-prod-mode. + * + * Generated from protobuf field bool enable_dev_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableDevMode($var) + { + GPBUtil::checkBool($var); + $this->enable_dev_mode = $var; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/MatchedQuery.php b/GeminiDataAnalytics/src/V1/MatchedQuery.php new file mode 100644 index 000000000000..efb7fa5162e0 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/MatchedQuery.php @@ -0,0 +1,113 @@ +google.cloud.geminidataanalytics.v1.MatchedQuery + */ +class MatchedQuery extends \Google\Protobuf\Internal\Message +{ + /** + * The query that was matched based on an example query. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.ExampleQuery example_query = 1; + */ + protected $example_query = null; + /** + * The extracted values for the query parameters. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.QueryParameterValues query_parameter_values = 2; + */ + private $query_parameter_values; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\GeminiDataAnalytics\V1\ExampleQuery $example_query + * The query that was matched based on an example query. + * @type \Google\Cloud\GeminiDataAnalytics\V1\QueryParameterValues[] $query_parameter_values + * The extracted values for the query parameters. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Context::initOnce(); + parent::__construct($data); + } + + /** + * The query that was matched based on an example query. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.ExampleQuery example_query = 1; + * @return \Google\Cloud\GeminiDataAnalytics\V1\ExampleQuery|null + */ + public function getExampleQuery() + { + return $this->example_query; + } + + public function hasExampleQuery() + { + return isset($this->example_query); + } + + public function clearExampleQuery() + { + unset($this->example_query); + } + + /** + * The query that was matched based on an example query. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.ExampleQuery example_query = 1; + * @param \Google\Cloud\GeminiDataAnalytics\V1\ExampleQuery $var + * @return $this + */ + public function setExampleQuery($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\ExampleQuery::class); + $this->example_query = $var; + + return $this; + } + + /** + * The extracted values for the query parameters. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.QueryParameterValues query_parameter_values = 2; + * @return RepeatedField<\Google\Cloud\GeminiDataAnalytics\V1\QueryParameterValues> + */ + public function getQueryParameterValues() + { + return $this->query_parameter_values; + } + + /** + * The extracted values for the query parameters. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.QueryParameterValues query_parameter_values = 2; + * @param \Google\Cloud\GeminiDataAnalytics\V1\QueryParameterValues[] $var + * @return $this + */ + public function setQueryParameterValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GeminiDataAnalytics\V1\QueryParameterValues::class); + $this->query_parameter_values = $arr; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/Message.php b/GeminiDataAnalytics/src/V1/Message.php new file mode 100644 index 000000000000..e388f346db19 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/Message.php @@ -0,0 +1,194 @@ +google.cloud.geminidataanalytics.v1.Message + */ +class Message extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. For user messages, this is the time at which the system + * received the message. For system messages, this is the time at which the + * system generated the message. + * + * Generated from protobuf field .google.protobuf.Timestamp timestamp = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $timestamp = null; + /** + * Optional. unique id of the message in the conversation for persistence. + * + * Generated from protobuf field string message_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $message_id = ''; + protected $kind; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\GeminiDataAnalytics\V1\UserMessage $user_message + * A message from the user that is interacting with the system. + * @type \Google\Cloud\GeminiDataAnalytics\V1\SystemMessage $system_message + * A message from the system in response to the user. + * @type \Google\Protobuf\Timestamp $timestamp + * Output only. For user messages, this is the time at which the system + * received the message. For system messages, this is the time at which the + * system generated the message. + * @type string $message_id + * Optional. unique id of the message in the conversation for persistence. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\DataChatService::initOnce(); + parent::__construct($data); + } + + /** + * A message from the user that is interacting with the system. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.UserMessage user_message = 2; + * @return \Google\Cloud\GeminiDataAnalytics\V1\UserMessage|null + */ + public function getUserMessage() + { + return $this->readOneof(2); + } + + public function hasUserMessage() + { + return $this->hasOneof(2); + } + + /** + * A message from the user that is interacting with the system. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.UserMessage user_message = 2; + * @param \Google\Cloud\GeminiDataAnalytics\V1\UserMessage $var + * @return $this + */ + public function setUserMessage($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\UserMessage::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * A message from the system in response to the user. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.SystemMessage system_message = 3; + * @return \Google\Cloud\GeminiDataAnalytics\V1\SystemMessage|null + */ + public function getSystemMessage() + { + return $this->readOneof(3); + } + + public function hasSystemMessage() + { + return $this->hasOneof(3); + } + + /** + * A message from the system in response to the user. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.SystemMessage system_message = 3; + * @param \Google\Cloud\GeminiDataAnalytics\V1\SystemMessage $var + * @return $this + */ + public function setSystemMessage($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\SystemMessage::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Output only. For user messages, this is the time at which the system + * received the message. For system messages, this is the time at which the + * system generated the message. + * + * Generated from protobuf field .google.protobuf.Timestamp timestamp = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getTimestamp() + { + return $this->timestamp; + } + + public function hasTimestamp() + { + return isset($this->timestamp); + } + + public function clearTimestamp() + { + unset($this->timestamp); + } + + /** + * Output only. For user messages, this is the time at which the system + * received the message. For system messages, this is the time at which the + * system generated the message. + * + * Generated from protobuf field .google.protobuf.Timestamp timestamp = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setTimestamp($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->timestamp = $var; + + return $this; + } + + /** + * Optional. unique id of the message in the conversation for persistence. + * + * Generated from protobuf field string message_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getMessageId() + { + return $this->message_id; + } + + /** + * Optional. unique id of the message in the conversation for persistence. + * + * Generated from protobuf field string message_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setMessageId($var) + { + GPBUtil::checkString($var, True); + $this->message_id = $var; + + return $this; + } + + /** + * @return string + */ + public function getKind() + { + return $this->whichOneof("kind"); + } + +} + diff --git a/GeminiDataAnalytics/src/V1/OAuthCredentials.php b/GeminiDataAnalytics/src/V1/OAuthCredentials.php new file mode 100644 index 000000000000..5667494801b1 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/OAuthCredentials.php @@ -0,0 +1,108 @@ +google.cloud.geminidataanalytics.v1.OAuthCredentials + */ +class OAuthCredentials extends \Google\Protobuf\Internal\Message +{ + protected $kind; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\GeminiDataAnalytics\V1\OAuthCredentials\SecretBased $secret + * Secret-based OAuth credentials. + * @type \Google\Cloud\GeminiDataAnalytics\V1\OAuthCredentials\TokenBased $token + * Token-based OAuth credentials. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Credentials::initOnce(); + parent::__construct($data); + } + + /** + * Secret-based OAuth credentials. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.OAuthCredentials.SecretBased secret = 2; + * @return \Google\Cloud\GeminiDataAnalytics\V1\OAuthCredentials\SecretBased|null + */ + public function getSecret() + { + return $this->readOneof(2); + } + + public function hasSecret() + { + return $this->hasOneof(2); + } + + /** + * Secret-based OAuth credentials. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.OAuthCredentials.SecretBased secret = 2; + * @param \Google\Cloud\GeminiDataAnalytics\V1\OAuthCredentials\SecretBased $var + * @return $this + */ + public function setSecret($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\OAuthCredentials\SecretBased::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Token-based OAuth credentials. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.OAuthCredentials.TokenBased token = 3; + * @return \Google\Cloud\GeminiDataAnalytics\V1\OAuthCredentials\TokenBased|null + */ + public function getToken() + { + return $this->readOneof(3); + } + + public function hasToken() + { + return $this->hasOneof(3); + } + + /** + * Token-based OAuth credentials. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.OAuthCredentials.TokenBased token = 3; + * @param \Google\Cloud\GeminiDataAnalytics\V1\OAuthCredentials\TokenBased $var + * @return $this + */ + public function setToken($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\OAuthCredentials\TokenBased::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getKind() + { + return $this->whichOneof("kind"); + } + +} + diff --git a/GeminiDataAnalytics/src/V1/OAuthCredentials/SecretBased.php b/GeminiDataAnalytics/src/V1/OAuthCredentials/SecretBased.php new file mode 100644 index 000000000000..ef834b3a6bb9 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/OAuthCredentials/SecretBased.php @@ -0,0 +1,102 @@ +google.cloud.geminidataanalytics.v1.OAuthCredentials.SecretBased + */ +class SecretBased extends \Google\Protobuf\Internal\Message +{ + /** + * Required. An OAuth client ID. + * + * Generated from protobuf field string client_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $client_id = ''; + /** + * Required. An OAuth client secret. + * + * Generated from protobuf field string client_secret = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $client_secret = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $client_id + * Required. An OAuth client ID. + * @type string $client_secret + * Required. An OAuth client secret. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Credentials::initOnce(); + parent::__construct($data); + } + + /** + * Required. An OAuth client ID. + * + * Generated from protobuf field string client_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getClientId() + { + return $this->client_id; + } + + /** + * Required. An OAuth client ID. + * + * Generated from protobuf field string client_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setClientId($var) + { + GPBUtil::checkString($var, True); + $this->client_id = $var; + + return $this; + } + + /** + * Required. An OAuth client secret. + * + * Generated from protobuf field string client_secret = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getClientSecret() + { + return $this->client_secret; + } + + /** + * Required. An OAuth client secret. + * + * Generated from protobuf field string client_secret = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setClientSecret($var) + { + GPBUtil::checkString($var, True); + $this->client_secret = $var; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/OAuthCredentials/TokenBased.php b/GeminiDataAnalytics/src/V1/OAuthCredentials/TokenBased.php new file mode 100644 index 000000000000..6d089ec3dc72 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/OAuthCredentials/TokenBased.php @@ -0,0 +1,68 @@ +google.cloud.geminidataanalytics.v1.OAuthCredentials.TokenBased + */ +class TokenBased extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the secret containing the access token. + * + * Generated from protobuf field string access_token = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $access_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $access_token + * Required. The name of the secret containing the access token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Credentials::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the secret containing the access token. + * + * Generated from protobuf field string access_token = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getAccessToken() + { + return $this->access_token; + } + + /** + * Required. The name of the secret containing the access token. + * + * Generated from protobuf field string access_token = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setAccessToken($var) + { + GPBUtil::checkString($var, True); + $this->access_token = $var; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/OperationMetadata.php b/GeminiDataAnalytics/src/V1/OperationMetadata.php new file mode 100644 index 000000000000..d06db1a7655a --- /dev/null +++ b/GeminiDataAnalytics/src/V1/OperationMetadata.php @@ -0,0 +1,307 @@ +google.cloud.geminidataanalytics.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\Geminidataanalytics\V1\DataAgentService::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/GeminiDataAnalytics/src/V1/PrivateLookerInstanceInfo.php b/GeminiDataAnalytics/src/V1/PrivateLookerInstanceInfo.php new file mode 100644 index 000000000000..a1e47d7eb812 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/PrivateLookerInstanceInfo.php @@ -0,0 +1,102 @@ +google.cloud.geminidataanalytics.v1.PrivateLookerInstanceInfo + */ +class PrivateLookerInstanceInfo extends \Google\Protobuf\Internal\Message +{ + /** + * The Looker instance id. + * + * Generated from protobuf field string looker_instance_id = 1; + */ + protected $looker_instance_id = ''; + /** + * The service directory name of the Looker instance. + * + * Generated from protobuf field string service_directory_name = 2; + */ + protected $service_directory_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $looker_instance_id + * The Looker instance id. + * @type string $service_directory_name + * The service directory name of the Looker instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Datasource::initOnce(); + parent::__construct($data); + } + + /** + * The Looker instance id. + * + * Generated from protobuf field string looker_instance_id = 1; + * @return string + */ + public function getLookerInstanceId() + { + return $this->looker_instance_id; + } + + /** + * The Looker instance id. + * + * Generated from protobuf field string looker_instance_id = 1; + * @param string $var + * @return $this + */ + public function setLookerInstanceId($var) + { + GPBUtil::checkString($var, True); + $this->looker_instance_id = $var; + + return $this; + } + + /** + * The service directory name of the Looker instance. + * + * Generated from protobuf field string service_directory_name = 2; + * @return string + */ + public function getServiceDirectoryName() + { + return $this->service_directory_name; + } + + /** + * The service directory name of the Looker instance. + * + * Generated from protobuf field string service_directory_name = 2; + * @param string $var + * @return $this + */ + public function setServiceDirectoryName($var) + { + GPBUtil::checkString($var, True); + $this->service_directory_name = $var; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/QueryParameter.php b/GeminiDataAnalytics/src/V1/QueryParameter.php new file mode 100644 index 000000000000..4cb2e150100f --- /dev/null +++ b/GeminiDataAnalytics/src/V1/QueryParameter.php @@ -0,0 +1,156 @@ +google.cloud.geminidataanalytics.v1.QueryParameter + */ +class QueryParameter extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the parameter reference in the SQL query. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Optional. The description of the parameter that can be used by LLM to + * extract the parameter value from the user question. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Required. The data type of the parameter, e.g. "STRING", "INT64", "DATE", + * etc. For valid values, see the [BigQuery + * documentation](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types). + * This will be used to populate + * google.cloud.bigquery.v2.QueryParameterType.type. + * + * Generated from protobuf field string data_type = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $data_type = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the parameter reference in the SQL query. + * @type string $description + * Optional. The description of the parameter that can be used by LLM to + * extract the parameter value from the user question. + * @type string $data_type + * Required. The data type of the parameter, e.g. "STRING", "INT64", "DATE", + * etc. For valid values, see the [BigQuery + * documentation](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types). + * This will be used to populate + * google.cloud.bigquery.v2.QueryParameterType.type. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Context::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the parameter reference in the SQL query. + * + * 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 parameter reference in the SQL query. + * + * 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 description of the parameter that can be used by LLM to + * extract the parameter value from the user question. + * + * 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 parameter that can be used by LLM to + * extract the parameter value from the user question. + * + * 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; + } + + /** + * Required. The data type of the parameter, e.g. "STRING", "INT64", "DATE", + * etc. For valid values, see the [BigQuery + * documentation](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types). + * This will be used to populate + * google.cloud.bigquery.v2.QueryParameterType.type. + * + * Generated from protobuf field string data_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDataType() + { + return $this->data_type; + } + + /** + * Required. The data type of the parameter, e.g. "STRING", "INT64", "DATE", + * etc. For valid values, see the [BigQuery + * documentation](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types). + * This will be used to populate + * google.cloud.bigquery.v2.QueryParameterType.type. + * + * Generated from protobuf field string data_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDataType($var) + { + GPBUtil::checkString($var, True); + $this->data_type = $var; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/QueryParameterValues.php b/GeminiDataAnalytics/src/V1/QueryParameterValues.php new file mode 100644 index 000000000000..f131d4d5da43 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/QueryParameterValues.php @@ -0,0 +1,103 @@ +google.cloud.geminidataanalytics.v1.QueryParameterValues + */ +class QueryParameterValues extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the parameter. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Required. The value of the parameter. + * + * Generated from protobuf field string value = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $value = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the parameter. + * @type string $value + * Required. The value of the parameter. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Context::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the parameter. + * + * 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 parameter. + * + * 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; + } + + /** + * Required. The value of the parameter. + * + * Generated from protobuf field string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * Required. The value of the parameter. + * + * Generated from protobuf field string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/Schema.php b/GeminiDataAnalytics/src/V1/Schema.php new file mode 100644 index 000000000000..45511dc09c91 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/Schema.php @@ -0,0 +1,273 @@ +google.cloud.geminidataanalytics.v1.Schema + */ +class Schema extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The fields in the schema. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.Field fields = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $fields; + /** + * Optional. A textual description of the table's content and purpose. + * For example: "Contains information about customer orders in our e-commerce + * store." Currently only used for BigQuery data sources. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Optional. A list of alternative names or synonyms that can be used to refer + * to the table. For example: ["sales", "orders", "purchases"]. Currently only + * used for BigQuery data sources. + * + * Generated from protobuf field repeated string synonyms = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $synonyms; + /** + * Optional. A list of tags or keywords associated with the table, used for + * categorization. For example: ["transaction", "revenue", "customer_data"]. + * Currently only used for BigQuery data sources. + * + * Generated from protobuf field repeated string tags = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $tags; + /** + * Optional. Table display_name (same as label in + * cloud/data_analytics/anarres/data/looker/proto/model_explore.proto), not + * required, currently only Looker has this field. + * + * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_name = ''; + /** + * Optional. The filters on the datasource's underlying data. Currently only + * used for Looker data sources. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.DataFilter filters = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $filters; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\GeminiDataAnalytics\V1\Field[] $fields + * Optional. The fields in the schema. + * @type string $description + * Optional. A textual description of the table's content and purpose. + * For example: "Contains information about customer orders in our e-commerce + * store." Currently only used for BigQuery data sources. + * @type string[] $synonyms + * Optional. A list of alternative names or synonyms that can be used to refer + * to the table. For example: ["sales", "orders", "purchases"]. Currently only + * used for BigQuery data sources. + * @type string[] $tags + * Optional. A list of tags or keywords associated with the table, used for + * categorization. For example: ["transaction", "revenue", "customer_data"]. + * Currently only used for BigQuery data sources. + * @type string $display_name + * Optional. Table display_name (same as label in + * cloud/data_analytics/anarres/data/looker/proto/model_explore.proto), not + * required, currently only Looker has this field. + * @type \Google\Cloud\GeminiDataAnalytics\V1\DataFilter[] $filters + * Optional. The filters on the datasource's underlying data. Currently only + * used for Looker data sources. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Datasource::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The fields in the schema. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.Field fields = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\GeminiDataAnalytics\V1\Field> + */ + public function getFields() + { + return $this->fields; + } + + /** + * Optional. The fields in the schema. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.Field fields = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\Field[] $var + * @return $this + */ + public function setFields($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GeminiDataAnalytics\V1\Field::class); + $this->fields = $arr; + + return $this; + } + + /** + * Optional. A textual description of the table's content and purpose. + * For example: "Contains information about customer orders in our e-commerce + * store." Currently only used for BigQuery data sources. + * + * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. A textual description of the table's content and purpose. + * For example: "Contains information about customer orders in our e-commerce + * store." Currently only used for BigQuery data sources. + * + * 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. A list of alternative names or synonyms that can be used to refer + * to the table. For example: ["sales", "orders", "purchases"]. Currently only + * used for BigQuery data sources. + * + * Generated from protobuf field repeated string synonyms = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField + */ + public function getSynonyms() + { + return $this->synonyms; + } + + /** + * Optional. A list of alternative names or synonyms that can be used to refer + * to the table. For example: ["sales", "orders", "purchases"]. Currently only + * used for BigQuery data sources. + * + * Generated from protobuf field repeated string synonyms = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string[] $var + * @return $this + */ + public function setSynonyms($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->synonyms = $arr; + + return $this; + } + + /** + * Optional. A list of tags or keywords associated with the table, used for + * categorization. For example: ["transaction", "revenue", "customer_data"]. + * Currently only used for BigQuery data sources. + * + * Generated from protobuf field repeated string tags = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField + */ + public function getTags() + { + return $this->tags; + } + + /** + * Optional. A list of tags or keywords associated with the table, used for + * categorization. For example: ["transaction", "revenue", "customer_data"]. + * Currently only used for BigQuery data sources. + * + * Generated from protobuf field repeated string tags = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string[] $var + * @return $this + */ + public function setTags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->tags = $arr; + + return $this; + } + + /** + * Optional. Table display_name (same as label in + * cloud/data_analytics/anarres/data/looker/proto/model_explore.proto), not + * required, currently only Looker has this field. + * + * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Optional. Table display_name (same as label in + * cloud/data_analytics/anarres/data/looker/proto/model_explore.proto), not + * required, currently only Looker has this field. + * + * 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 filters on the datasource's underlying data. Currently only + * used for Looker data sources. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.DataFilter filters = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\GeminiDataAnalytics\V1\DataFilter> + */ + public function getFilters() + { + return $this->filters; + } + + /** + * Optional. The filters on the datasource's underlying data. Currently only + * used for Looker data sources. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.DataFilter filters = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\DataFilter[] $var + * @return $this + */ + public function setFilters($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GeminiDataAnalytics\V1\DataFilter::class); + $this->filters = $arr; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/SchemaMessage.php b/GeminiDataAnalytics/src/V1/SchemaMessage.php new file mode 100644 index 000000000000..a18a9572a8e4 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/SchemaMessage.php @@ -0,0 +1,108 @@ +google.cloud.geminidataanalytics.v1.SchemaMessage + */ +class SchemaMessage extends \Google\Protobuf\Internal\Message +{ + protected $kind; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\GeminiDataAnalytics\V1\SchemaQuery $query + * A schema resolution query. + * @type \Google\Cloud\GeminiDataAnalytics\V1\SchemaResult $result + * The result of a schema resolution query. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\DataChatService::initOnce(); + parent::__construct($data); + } + + /** + * A schema resolution query. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.SchemaQuery query = 1; + * @return \Google\Cloud\GeminiDataAnalytics\V1\SchemaQuery|null + */ + public function getQuery() + { + return $this->readOneof(1); + } + + public function hasQuery() + { + return $this->hasOneof(1); + } + + /** + * A schema resolution query. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.SchemaQuery query = 1; + * @param \Google\Cloud\GeminiDataAnalytics\V1\SchemaQuery $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\SchemaQuery::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * The result of a schema resolution query. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.SchemaResult result = 2; + * @return \Google\Cloud\GeminiDataAnalytics\V1\SchemaResult|null + */ + public function getResult() + { + return $this->readOneof(2); + } + + public function hasResult() + { + return $this->hasOneof(2); + } + + /** + * The result of a schema resolution query. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.SchemaResult result = 2; + * @param \Google\Cloud\GeminiDataAnalytics\V1\SchemaResult $var + * @return $this + */ + public function setResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\SchemaResult::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getKind() + { + return $this->whichOneof("kind"); + } + +} + diff --git a/GeminiDataAnalytics/src/V1/SchemaQuery.php b/GeminiDataAnalytics/src/V1/SchemaQuery.php new file mode 100644 index 000000000000..5e36360060e8 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/SchemaQuery.php @@ -0,0 +1,67 @@ +google.cloud.geminidataanalytics.v1.SchemaQuery + */ +class SchemaQuery extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The question to send to the system for schema resolution. + * + * Generated from protobuf field string question = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $question = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $question + * Optional. The question to send to the system for schema resolution. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\DataChatService::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The question to send to the system for schema resolution. + * + * Generated from protobuf field string question = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getQuestion() + { + return $this->question; + } + + /** + * Optional. The question to send to the system for schema resolution. + * + * Generated from protobuf field string question = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setQuestion($var) + { + GPBUtil::checkString($var, True); + $this->question = $var; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/SchemaResult.php b/GeminiDataAnalytics/src/V1/SchemaResult.php new file mode 100644 index 000000000000..0732d5fcf9b7 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/SchemaResult.php @@ -0,0 +1,67 @@ +google.cloud.geminidataanalytics.v1.SchemaResult + */ +class SchemaResult extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The datasources used to resolve the schema query. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.Datasource datasources = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $datasources; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\GeminiDataAnalytics\V1\Datasource[] $datasources + * Optional. The datasources used to resolve the schema query. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\DataChatService::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The datasources used to resolve the schema query. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.Datasource datasources = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\GeminiDataAnalytics\V1\Datasource> + */ + public function getDatasources() + { + return $this->datasources; + } + + /** + * Optional. The datasources used to resolve the schema query. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.Datasource datasources = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\Datasource[] $var + * @return $this + */ + public function setDatasources($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GeminiDataAnalytics\V1\Datasource::class); + $this->datasources = $arr; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/StorageMessage.php b/GeminiDataAnalytics/src/V1/StorageMessage.php new file mode 100644 index 000000000000..e83b1fa33d6a --- /dev/null +++ b/GeminiDataAnalytics/src/V1/StorageMessage.php @@ -0,0 +1,111 @@ +google.cloud.geminidataanalytics.v1.StorageMessage + */ +class StorageMessage extends \Google\Protobuf\Internal\Message +{ + /** + * The unique resource name of a chat message. + * + * Generated from protobuf field string message_id = 1; + */ + protected $message_id = ''; + /** + * The message content. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Message message = 2; + */ + protected $message = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $message_id + * The unique resource name of a chat message. + * @type \Google\Cloud\GeminiDataAnalytics\V1\Message $message + * The message content. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\DataChatService::initOnce(); + parent::__construct($data); + } + + /** + * The unique resource name of a chat message. + * + * Generated from protobuf field string message_id = 1; + * @return string + */ + public function getMessageId() + { + return $this->message_id; + } + + /** + * The unique resource name of a chat message. + * + * Generated from protobuf field string message_id = 1; + * @param string $var + * @return $this + */ + public function setMessageId($var) + { + GPBUtil::checkString($var, True); + $this->message_id = $var; + + return $this; + } + + /** + * The message content. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Message message = 2; + * @return \Google\Cloud\GeminiDataAnalytics\V1\Message|null + */ + public function getMessage() + { + return $this->message; + } + + public function hasMessage() + { + return isset($this->message); + } + + public function clearMessage() + { + unset($this->message); + } + + /** + * The message content. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Message message = 2; + * @param \Google\Cloud\GeminiDataAnalytics\V1\Message $var + * @return $this + */ + public function setMessage($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\Message::class); + $this->message = $var; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/StudioDatasourceReference.php b/GeminiDataAnalytics/src/V1/StudioDatasourceReference.php new file mode 100644 index 000000000000..88883718dad7 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/StudioDatasourceReference.php @@ -0,0 +1,67 @@ +google.cloud.geminidataanalytics.v1.StudioDatasourceReference + */ +class StudioDatasourceReference extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The id of the datasource. + * + * Generated from protobuf field string datasource_id = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $datasource_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $datasource_id + * Required. The id of the datasource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Datasource::initOnce(); + parent::__construct($data); + } + + /** + * Required. The id of the datasource. + * + * Generated from protobuf field string datasource_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDatasourceId() + { + return $this->datasource_id; + } + + /** + * Required. The id of the datasource. + * + * Generated from protobuf field string datasource_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDatasourceId($var) + { + GPBUtil::checkString($var, True); + $this->datasource_id = $var; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/StudioDatasourceReferences.php b/GeminiDataAnalytics/src/V1/StudioDatasourceReferences.php new file mode 100644 index 000000000000..16316d0223b0 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/StudioDatasourceReferences.php @@ -0,0 +1,67 @@ +google.cloud.geminidataanalytics.v1.StudioDatasourceReferences + */ +class StudioDatasourceReferences extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The references to the studio datasources. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.StudioDatasourceReference studio_references = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $studio_references; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\GeminiDataAnalytics\V1\StudioDatasourceReference[] $studio_references + * Optional. The references to the studio datasources. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Datasource::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The references to the studio datasources. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.StudioDatasourceReference studio_references = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\GeminiDataAnalytics\V1\StudioDatasourceReference> + */ + public function getStudioReferences() + { + return $this->studio_references; + } + + /** + * Optional. The references to the studio datasources. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.StudioDatasourceReference studio_references = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\StudioDatasourceReference[] $var + * @return $this + */ + public function setStudioReferences($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GeminiDataAnalytics\V1\StudioDatasourceReference::class); + $this->studio_references = $arr; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/SystemMessage.php b/GeminiDataAnalytics/src/V1/SystemMessage.php new file mode 100644 index 000000000000..ceaded633fdc --- /dev/null +++ b/GeminiDataAnalytics/src/V1/SystemMessage.php @@ -0,0 +1,371 @@ +google.cloud.geminidataanalytics.v1.SystemMessage + */ +class SystemMessage extends \Google\Protobuf\Internal\Message +{ + /** + * Identifies the group that the event belongs to. Similar events are deemed + * to be logically relevant to each other and should be shown together in + * the UI. + * + * Generated from protobuf field optional int32 group_id = 12; + */ + protected $group_id = null; + /** + * Output only. Citation information for the system message. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Citation citation = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $citation = null; + protected $kind; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\GeminiDataAnalytics\V1\TextMessage $text + * A direct natural language response to the user message. + * @type \Google\Cloud\GeminiDataAnalytics\V1\SchemaMessage $schema + * A message produced during schema resolution. + * @type \Google\Cloud\GeminiDataAnalytics\V1\DataMessage $data + * A message produced during data retrieval. + * @type \Google\Cloud\GeminiDataAnalytics\V1\AnalysisMessage $analysis + * A message produced during analysis. + * @type \Google\Cloud\GeminiDataAnalytics\V1\ChartMessage $chart + * A message produced during chart generation. + * @type \Google\Cloud\GeminiDataAnalytics\V1\ErrorMessage $error + * An error message. + * @type \Google\Cloud\GeminiDataAnalytics\V1\ExampleQueries $example_queries + * Optional. A message containing example queries. + * @type int $group_id + * Identifies the group that the event belongs to. Similar events are deemed + * to be logically relevant to each other and should be shown together in + * the UI. + * @type \Google\Cloud\GeminiDataAnalytics\V1\Citation $citation + * Output only. Citation information for the system message. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\DataChatService::initOnce(); + parent::__construct($data); + } + + /** + * A direct natural language response to the user message. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.TextMessage text = 1; + * @return \Google\Cloud\GeminiDataAnalytics\V1\TextMessage|null + */ + public function getText() + { + return $this->readOneof(1); + } + + public function hasText() + { + return $this->hasOneof(1); + } + + /** + * A direct natural language response to the user message. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.TextMessage text = 1; + * @param \Google\Cloud\GeminiDataAnalytics\V1\TextMessage $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\TextMessage::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * A message produced during schema resolution. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.SchemaMessage schema = 2; + * @return \Google\Cloud\GeminiDataAnalytics\V1\SchemaMessage|null + */ + public function getSchema() + { + return $this->readOneof(2); + } + + public function hasSchema() + { + return $this->hasOneof(2); + } + + /** + * A message produced during schema resolution. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.SchemaMessage schema = 2; + * @param \Google\Cloud\GeminiDataAnalytics\V1\SchemaMessage $var + * @return $this + */ + public function setSchema($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\SchemaMessage::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * A message produced during data retrieval. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.DataMessage data = 3; + * @return \Google\Cloud\GeminiDataAnalytics\V1\DataMessage|null + */ + public function getData() + { + return $this->readOneof(3); + } + + public function hasData() + { + return $this->hasOneof(3); + } + + /** + * A message produced during data retrieval. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.DataMessage data = 3; + * @param \Google\Cloud\GeminiDataAnalytics\V1\DataMessage $var + * @return $this + */ + public function setData($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\DataMessage::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * A message produced during analysis. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.AnalysisMessage analysis = 4; + * @return \Google\Cloud\GeminiDataAnalytics\V1\AnalysisMessage|null + */ + public function getAnalysis() + { + return $this->readOneof(4); + } + + public function hasAnalysis() + { + return $this->hasOneof(4); + } + + /** + * A message produced during analysis. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.AnalysisMessage analysis = 4; + * @param \Google\Cloud\GeminiDataAnalytics\V1\AnalysisMessage $var + * @return $this + */ + public function setAnalysis($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\AnalysisMessage::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * A message produced during chart generation. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.ChartMessage chart = 5; + * @return \Google\Cloud\GeminiDataAnalytics\V1\ChartMessage|null + */ + public function getChart() + { + return $this->readOneof(5); + } + + public function hasChart() + { + return $this->hasOneof(5); + } + + /** + * A message produced during chart generation. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.ChartMessage chart = 5; + * @param \Google\Cloud\GeminiDataAnalytics\V1\ChartMessage $var + * @return $this + */ + public function setChart($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\ChartMessage::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * An error message. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.ErrorMessage error = 6; + * @return \Google\Cloud\GeminiDataAnalytics\V1\ErrorMessage|null + */ + public function getError() + { + return $this->readOneof(6); + } + + public function hasError() + { + return $this->hasOneof(6); + } + + /** + * An error message. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.ErrorMessage error = 6; + * @param \Google\Cloud\GeminiDataAnalytics\V1\ErrorMessage $var + * @return $this + */ + public function setError($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\ErrorMessage::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Optional. A message containing example queries. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.ExampleQueries example_queries = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\GeminiDataAnalytics\V1\ExampleQueries|null + */ + public function getExampleQueries() + { + return $this->readOneof(13); + } + + public function hasExampleQueries() + { + return $this->hasOneof(13); + } + + /** + * Optional. A message containing example queries. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.ExampleQueries example_queries = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\ExampleQueries $var + * @return $this + */ + public function setExampleQueries($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\ExampleQueries::class); + $this->writeOneof(13, $var); + + return $this; + } + + /** + * Identifies the group that the event belongs to. Similar events are deemed + * to be logically relevant to each other and should be shown together in + * the UI. + * + * Generated from protobuf field optional int32 group_id = 12; + * @return int + */ + public function getGroupId() + { + return isset($this->group_id) ? $this->group_id : 0; + } + + public function hasGroupId() + { + return isset($this->group_id); + } + + public function clearGroupId() + { + unset($this->group_id); + } + + /** + * Identifies the group that the event belongs to. Similar events are deemed + * to be logically relevant to each other and should be shown together in + * the UI. + * + * Generated from protobuf field optional int32 group_id = 12; + * @param int $var + * @return $this + */ + public function setGroupId($var) + { + GPBUtil::checkInt32($var); + $this->group_id = $var; + + return $this; + } + + /** + * Output only. Citation information for the system message. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Citation citation = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\GeminiDataAnalytics\V1\Citation|null + */ + public function getCitation() + { + return $this->citation; + } + + public function hasCitation() + { + return isset($this->citation); + } + + public function clearCitation() + { + unset($this->citation); + } + + /** + * Output only. Citation information for the system message. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.Citation citation = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\Citation $var + * @return $this + */ + public function setCitation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\Citation::class); + $this->citation = $var; + + return $this; + } + + /** + * @return string + */ + public function getKind() + { + return $this->whichOneof("kind"); + } + +} + diff --git a/GeminiDataAnalytics/src/V1/TextMessage.php b/GeminiDataAnalytics/src/V1/TextMessage.php new file mode 100644 index 000000000000..3d3b5c6fa69a --- /dev/null +++ b/GeminiDataAnalytics/src/V1/TextMessage.php @@ -0,0 +1,139 @@ +google.cloud.geminidataanalytics.v1.TextMessage + */ +class TextMessage extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The parts of the message. + * + * Generated from protobuf field repeated string parts = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $parts; + /** + * Optional. The type of the text message. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.TextMessage.TextType text_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $text_type = 0; + /** + * Optional. An opaque signature for a thought so it can be reused in + * subsequent requests. + * + * Generated from protobuf field bytes thought_signature = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $thought_signature = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string[] $parts + * Optional. The parts of the message. + * @type int $text_type + * Optional. The type of the text message. + * @type string $thought_signature + * Optional. An opaque signature for a thought so it can be reused in + * subsequent requests. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\DataChatService::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The parts of the message. + * + * Generated from protobuf field repeated string parts = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField + */ + public function getParts() + { + return $this->parts; + } + + /** + * Optional. The parts of the message. + * + * Generated from protobuf field repeated string parts = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string[] $var + * @return $this + */ + public function setParts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->parts = $arr; + + return $this; + } + + /** + * Optional. The type of the text message. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.TextMessage.TextType text_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getTextType() + { + return $this->text_type; + } + + /** + * Optional. The type of the text message. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.TextMessage.TextType text_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setTextType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GeminiDataAnalytics\V1\TextMessage\TextType::class); + $this->text_type = $var; + + return $this; + } + + /** + * Optional. An opaque signature for a thought so it can be reused in + * subsequent requests. + * + * Generated from protobuf field bytes thought_signature = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getThoughtSignature() + { + return $this->thought_signature; + } + + /** + * Optional. An opaque signature for a thought so it can be reused in + * subsequent requests. + * + * Generated from protobuf field bytes thought_signature = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setThoughtSignature($var) + { + GPBUtil::checkString($var, False); + $this->thought_signature = $var; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/TextMessage/TextType.php b/GeminiDataAnalytics/src/V1/TextMessage/TextType.php new file mode 100644 index 000000000000..e9c0e270331f --- /dev/null +++ b/GeminiDataAnalytics/src/V1/TextMessage/TextType.php @@ -0,0 +1,80 @@ +google.cloud.geminidataanalytics.v1.TextMessage.TextType + */ +class TextType +{ + /** + * The default text type. + * + * Generated from protobuf enum TEXT_TYPE_UNSPECIFIED = 0; + */ + const TEXT_TYPE_UNSPECIFIED = 0; + /** + * The text is a final response to the user question. + * + * Generated from protobuf enum FINAL_RESPONSE = 1; + */ + const FINAL_RESPONSE = 1; + /** + * The text is a thought from the model. + * + * Generated from protobuf enum THOUGHT = 2; + */ + const THOUGHT = 2; + /** + * The text is an informational message about the agent's progress, such as + * a tool being invoked. This is distinct from the agent's internal thought + * process (`THOUGHT`) and the final answer to the user + * (`FINAL_RESPONSE`). These messages provide insight into the agent's + * actions. + * + * Generated from protobuf enum PROGRESS = 3; + */ + const PROGRESS = 3; + /** + * The text is a list of follow-up questions suggested. + * Each item in parts is a follow-up question. + * + * Generated from protobuf enum FOLLOWUP_QUESTIONS = 4; + */ + const FOLLOWUP_QUESTIONS = 4; + + private static $valueToName = [ + self::TEXT_TYPE_UNSPECIFIED => 'TEXT_TYPE_UNSPECIFIED', + self::FINAL_RESPONSE => 'FINAL_RESPONSE', + self::THOUGHT => 'THOUGHT', + self::PROGRESS => 'PROGRESS', + self::FOLLOWUP_QUESTIONS => 'FOLLOWUP_QUESTIONS', + ]; + + 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/GeminiDataAnalytics/src/V1/UpdateDataAgentRequest.php b/GeminiDataAnalytics/src/V1/UpdateDataAgentRequest.php new file mode 100644 index 000000000000..ed1367fcd388 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/UpdateDataAgentRequest.php @@ -0,0 +1,240 @@ +google.cloud.geminidataanalytics.v1.UpdateDataAgentRequest + */ +class UpdateDataAgentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * DataAgent 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 all fields with non-default values + * present in the request will be overwritten. If a wildcard mask is provided, + * all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + /** + * Required. The resource being updated. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.DataAgent data_agent = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $data_agent = 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\GeminiDataAnalytics\V1\DataAgent $dataAgent Required. The resource being updated. + * @param \Google\Protobuf\FieldMask $updateMask Optional. Field mask is used to specify the fields to be overwritten in the + * DataAgent 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 all fields with non-default values + * present in the request will be overwritten. If a wildcard mask is provided, + * all fields will be overwritten. + * + * @return \Google\Cloud\GeminiDataAnalytics\V1\UpdateDataAgentRequest + * + * @experimental + */ + public static function build(\Google\Cloud\GeminiDataAnalytics\V1\DataAgent $dataAgent, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setDataAgent($dataAgent) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Field mask is used to specify the fields to be overwritten in the + * DataAgent 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 all fields with non-default values + * present in the request will be overwritten. If a wildcard mask is provided, + * all fields will be overwritten. + * @type \Google\Cloud\GeminiDataAnalytics\V1\DataAgent $data_agent + * 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\Geminidataanalytics\V1\DataAgentService::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * DataAgent 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 all fields with non-default values + * present in the request will be overwritten. If a wildcard mask is provided, + * all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.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. Field mask is used to specify the fields to be overwritten in the + * DataAgent 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 all fields with non-default values + * present in the request will be overwritten. If a wildcard mask is provided, + * all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.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; + } + + /** + * Required. The resource being updated. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.DataAgent data_agent = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\GeminiDataAnalytics\V1\DataAgent|null + */ + public function getDataAgent() + { + return $this->data_agent; + } + + public function hasDataAgent() + { + return isset($this->data_agent); + } + + public function clearDataAgent() + { + unset($this->data_agent); + } + + /** + * Required. The resource being updated. + * + * Generated from protobuf field .google.cloud.geminidataanalytics.v1.DataAgent data_agent = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GeminiDataAnalytics\V1\DataAgent $var + * @return $this + */ + public function setDataAgent($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1\DataAgent::class); + $this->data_agent = $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/GeminiDataAnalytics/src/V1/UserFunctions.php b/GeminiDataAnalytics/src/V1/UserFunctions.php new file mode 100644 index 000000000000..4ae4521d3a30 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/UserFunctions.php @@ -0,0 +1,67 @@ +google.cloud.geminidataanalytics.v1.UserFunctions + */ +class UserFunctions extends \Google\Protobuf\Internal\Message +{ + /** + * A list of BigQuery routines to include in the context. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.BigQueryRoutine bq_routines = 1; + */ + private $bq_routines; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\GeminiDataAnalytics\V1\BigQueryRoutine[] $bq_routines + * A list of BigQuery routines to include in the context. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\Context::initOnce(); + parent::__construct($data); + } + + /** + * A list of BigQuery routines to include in the context. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.BigQueryRoutine bq_routines = 1; + * @return RepeatedField<\Google\Cloud\GeminiDataAnalytics\V1\BigQueryRoutine> + */ + public function getBqRoutines() + { + return $this->bq_routines; + } + + /** + * A list of BigQuery routines to include in the context. + * + * Generated from protobuf field repeated .google.cloud.geminidataanalytics.v1.BigQueryRoutine bq_routines = 1; + * @param \Google\Cloud\GeminiDataAnalytics\V1\BigQueryRoutine[] $var + * @return $this + */ + public function setBqRoutines($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GeminiDataAnalytics\V1\BigQueryRoutine::class); + $this->bq_routines = $arr; + + return $this; + } + +} + diff --git a/GeminiDataAnalytics/src/V1/UserMessage.php b/GeminiDataAnalytics/src/V1/UserMessage.php new file mode 100644 index 000000000000..1e713b78d623 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/UserMessage.php @@ -0,0 +1,75 @@ +google.cloud.geminidataanalytics.v1.UserMessage + */ +class UserMessage extends \Google\Protobuf\Internal\Message +{ + protected $kind; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * Text should use this field instead of blob. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Geminidataanalytics\V1\DataChatService::initOnce(); + parent::__construct($data); + } + + /** + * Text should use this field instead of blob. + * + * Generated from protobuf field string text = 1; + * @return string + */ + public function getText() + { + return $this->readOneof(1); + } + + public function hasText() + { + return $this->hasOneof(1); + } + + /** + * Text should use this field instead of blob. + * + * 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 getKind() + { + return $this->whichOneof("kind"); + } + +} + diff --git a/GeminiDataAnalytics/src/V1/gapic_metadata.json b/GeminiDataAnalytics/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..d3a9cf7b2de3 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/gapic_metadata.json @@ -0,0 +1,132 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.geminidataanalytics.v1", + "libraryPackage": "Google\\Cloud\\GeminiDataAnalytics\\V1", + "services": { + "DataAgentService": { + "clients": { + "grpc": { + "libraryClient": "DataAgentServiceGapicClient", + "rpcs": { + "CreateDataAgent": { + "methods": [ + "createDataAgent" + ] + }, + "CreateDataAgentSync": { + "methods": [ + "createDataAgentSync" + ] + }, + "DeleteDataAgent": { + "methods": [ + "deleteDataAgent" + ] + }, + "DeleteDataAgentSync": { + "methods": [ + "deleteDataAgentSync" + ] + }, + "GetDataAgent": { + "methods": [ + "getDataAgent" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "ListAccessibleDataAgents": { + "methods": [ + "listAccessibleDataAgents" + ] + }, + "ListDataAgents": { + "methods": [ + "listDataAgents" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "UpdateDataAgent": { + "methods": [ + "updateDataAgent" + ] + }, + "UpdateDataAgentSync": { + "methods": [ + "updateDataAgentSync" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + }, + "DataChatService": { + "clients": { + "grpc": { + "libraryClient": "DataChatServiceGapicClient", + "rpcs": { + "Chat": { + "methods": [ + "chat" + ] + }, + "CreateConversation": { + "methods": [ + "createConversation" + ] + }, + "DeleteConversation": { + "methods": [ + "deleteConversation" + ] + }, + "GetConversation": { + "methods": [ + "getConversation" + ] + }, + "ListConversations": { + "methods": [ + "listConversations" + ] + }, + "ListMessages": { + "methods": [ + "listMessages" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/GeminiDataAnalytics/src/V1/resources/data_agent_service_client_config.json b/GeminiDataAnalytics/src/V1/resources/data_agent_service_client_config.json new file mode 100644 index 000000000000..020c731d9a24 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/resources/data_agent_service_client_config.json @@ -0,0 +1,99 @@ +{ + "interfaces": { + "google.cloud.geminidataanalytics.v1.DataAgentService": { + "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": 600000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 600000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateDataAgent": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "CreateDataAgentSync": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteDataAgent": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteDataAgentSync": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetDataAgent": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetIamPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListAccessibleDataAgents": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListDataAgents": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateDataAgent": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateDataAgentSync": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/GeminiDataAnalytics/src/V1/resources/data_agent_service_descriptor_config.php b/GeminiDataAnalytics/src/V1/resources/data_agent_service_descriptor_config.php new file mode 100644 index 000000000000..4b7b7e294168 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/resources/data_agent_service_descriptor_config.php @@ -0,0 +1,238 @@ + [ + 'google.cloud.geminidataanalytics.v1.DataAgentService' => [ + 'CreateDataAgent' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\GeminiDataAnalytics\V1\DataAgent', + 'metadataReturnType' => '\Google\Cloud\GeminiDataAnalytics\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteDataAgent' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\GeminiDataAnalytics\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateDataAgent' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\GeminiDataAnalytics\V1\DataAgent', + 'metadataReturnType' => '\Google\Cloud\GeminiDataAnalytics\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'data_agent.name', + 'fieldAccessors' => [ + 'getDataAgent', + 'getName', + ], + ], + ], + ], + 'CreateDataAgentSync' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\GeminiDataAnalytics\V1\DataAgent', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteDataAgentSync' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetDataAgent' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\GeminiDataAnalytics\V1\DataAgent', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'ListAccessibleDataAgents' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getDataAgents', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\GeminiDataAnalytics\V1\ListAccessibleDataAgentsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListDataAgents' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getDataAgents', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\GeminiDataAnalytics\V1\ListDataAgentsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'UpdateDataAgentSync' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\GeminiDataAnalytics\V1\DataAgent', + 'headerParams' => [ + [ + 'keyName' => 'data_agent.name', + 'fieldAccessors' => [ + 'getDataAgent', + 'getName', + ], + ], + ], + ], + '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' => [ + 'cryptoKey' => 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}', + 'dataAgent' => 'projects/{project}/locations/{location}/dataAgents/{data_agent}', + 'location' => 'projects/{project}/locations/{location}', + ], + ], + ], +]; diff --git a/GeminiDataAnalytics/src/V1/resources/data_agent_service_rest_client_config.php b/GeminiDataAnalytics/src/V1/resources/data_agent_service_rest_client_config.php new file mode 100644 index 000000000000..fa651cfebbaf --- /dev/null +++ b/GeminiDataAnalytics/src/V1/resources/data_agent_service_rest_client_config.php @@ -0,0 +1,229 @@ + [ + 'google.cloud.geminidataanalytics.v1.DataAgentService' => [ + 'CreateDataAgent' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/dataAgents', + 'body' => 'data_agent', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateDataAgentSync' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/dataAgents:createSync', + 'body' => 'data_agent', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteDataAgent' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataAgents/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteDataAgentSync' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataAgents/*}:deleteSync', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetDataAgent' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataAgents/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/dataAgents/*}:getIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'ListAccessibleDataAgents' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/dataAgents:listAccessible', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListDataAgents' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/dataAgents', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/dataAgents/*}:setIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'UpdateDataAgent' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{data_agent.name=projects/*/locations/*/dataAgents/*}', + 'body' => 'data_agent', + 'placeholders' => [ + 'data_agent.name' => [ + 'getters' => [ + 'getDataAgent', + 'getName', + ], + ], + ], + ], + 'UpdateDataAgentSync' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{data_agent.name=projects/*/locations/*/dataAgents/*}:updateSync', + 'body' => 'data_agent', + 'placeholders' => [ + 'data_agent.name' => [ + 'getters' => [ + 'getDataAgent', + 'getName', + ], + ], + ], + ], + ], + '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.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/GeminiDataAnalytics/src/V1/resources/data_chat_service_client_config.json b/GeminiDataAnalytics/src/V1/resources/data_chat_service_client_config.json new file mode 100644 index 000000000000..7735979369a7 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/resources/data_chat_service_client_config.json @@ -0,0 +1,72 @@ +{ + "interfaces": { + "google.cloud.geminidataanalytics.v1.DataChatService": { + "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": 600000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 600000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "Chat": { + "timeout_millis": 600000 + }, + "CreateConversation": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteConversation": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetConversation": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListConversations": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListMessages": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListLocations": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/GeminiDataAnalytics/src/V1/resources/data_chat_service_descriptor_config.php b/GeminiDataAnalytics/src/V1/resources/data_chat_service_descriptor_config.php new file mode 100644 index 000000000000..495062669f19 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/resources/data_chat_service_descriptor_config.php @@ -0,0 +1,159 @@ + [ + 'google.cloud.geminidataanalytics.v1.DataChatService' => [ + 'Chat' => [ + 'grpcStreaming' => [ + 'grpcStreamingType' => 'ServerStreaming', + ], + 'callType' => \Google\ApiCore\Call::SERVER_STREAMING_CALL, + 'responseType' => 'Google\Cloud\GeminiDataAnalytics\V1\Message', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateConversation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\GeminiDataAnalytics\V1\Conversation', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteConversation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetConversation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\GeminiDataAnalytics\V1\Conversation', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListConversations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getConversations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\GeminiDataAnalytics\V1\ListConversationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListMessages' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getMessages', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\GeminiDataAnalytics\V1\ListMessagesResponse', + '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' => [ + 'conversation' => 'projects/{project}/locations/{location}/conversations/{conversation}', + 'cryptoKey' => 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}', + 'dataAgent' => 'projects/{project}/locations/{location}/dataAgents/{data_agent}', + 'location' => 'projects/{project}/locations/{location}', + ], + ], + ], +]; diff --git a/GeminiDataAnalytics/src/V1/resources/data_chat_service_rest_client_config.php b/GeminiDataAnalytics/src/V1/resources/data_chat_service_rest_client_config.php new file mode 100644 index 000000000000..a846e7505183 --- /dev/null +++ b/GeminiDataAnalytics/src/V1/resources/data_chat_service_rest_client_config.php @@ -0,0 +1,168 @@ + [ + 'google.cloud.geminidataanalytics.v1.DataChatService' => [ + 'Chat' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}:chat', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateConversation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/conversations', + 'body' => 'conversation', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteConversation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/conversations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetConversation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/conversations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListConversations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/conversations', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListMessages' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/conversations/*}/messages', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + '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.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/GeminiDataAnalytics/tests/Unit/V1/Client/DataAgentServiceClientTest.php b/GeminiDataAnalytics/tests/Unit/V1/Client/DataAgentServiceClientTest.php new file mode 100644 index 000000000000..78432e1d25c8 --- /dev/null +++ b/GeminiDataAnalytics/tests/Unit/V1/Client/DataAgentServiceClientTest.php @@ -0,0 +1,1233 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return DataAgentServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new DataAgentServiceClient($options); + } + + /** @test */ + public function createDataAgentTest() + { + $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/createDataAgentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $kmsKey = 'kmsKey-591635343'; + $expectedResponse = new DataAgent(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setKmsKey($kmsKey); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createDataAgentTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $dataAgent = new DataAgent(); + $request = (new CreateDataAgentRequest())->setParent($formattedParent)->setDataAgent($dataAgent); + $response = $gapicClient->createDataAgent($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.geminidataanalytics.v1.DataAgentService/CreateDataAgent', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getDataAgent(); + $this->assertProtobufEquals($dataAgent, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createDataAgentTest'); + $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 createDataAgentExceptionTest() + { + $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/createDataAgentTest'); + $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]'); + $dataAgent = new DataAgent(); + $request = (new CreateDataAgentRequest())->setParent($formattedParent)->setDataAgent($dataAgent); + $response = $gapicClient->createDataAgent($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createDataAgentTest'); + 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 createDataAgentSyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $kmsKey = 'kmsKey-591635343'; + $expectedResponse = new DataAgent(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setKmsKey($kmsKey); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $dataAgent = new DataAgent(); + $request = (new CreateDataAgentRequest())->setParent($formattedParent)->setDataAgent($dataAgent); + $response = $gapicClient->createDataAgentSync($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.geminidataanalytics.v1.DataAgentService/CreateDataAgentSync', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getDataAgent(); + $this->assertProtobufEquals($dataAgent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createDataAgentSyncExceptionTest() + { + $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]'); + $dataAgent = new DataAgent(); + $request = (new CreateDataAgentRequest())->setParent($formattedParent)->setDataAgent($dataAgent); + try { + $gapicClient->createDataAgentSync($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 deleteDataAgentTest() + { + $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/deleteDataAgentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteDataAgentTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->dataAgentName('[PROJECT]', '[LOCATION]', '[DATA_AGENT]'); + $request = (new DeleteDataAgentRequest())->setName($formattedName); + $response = $gapicClient->deleteDataAgent($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.geminidataanalytics.v1.DataAgentService/DeleteDataAgent', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteDataAgentTest'); + $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 deleteDataAgentExceptionTest() + { + $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/deleteDataAgentTest'); + $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->dataAgentName('[PROJECT]', '[LOCATION]', '[DATA_AGENT]'); + $request = (new DeleteDataAgentRequest())->setName($formattedName); + $response = $gapicClient->deleteDataAgent($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteDataAgentTest'); + 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 deleteDataAgentSyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->dataAgentName('[PROJECT]', '[LOCATION]', '[DATA_AGENT]'); + $request = (new DeleteDataAgentRequest())->setName($formattedName); + $gapicClient->deleteDataAgentSync($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.geminidataanalytics.v1.DataAgentService/DeleteDataAgentSync', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteDataAgentSyncExceptionTest() + { + $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->dataAgentName('[PROJECT]', '[LOCATION]', '[DATA_AGENT]'); + $request = (new DeleteDataAgentRequest())->setName($formattedName); + try { + $gapicClient->deleteDataAgentSync($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 getDataAgentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $kmsKey = 'kmsKey-591635343'; + $expectedResponse = new DataAgent(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setKmsKey($kmsKey); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->dataAgentName('[PROJECT]', '[LOCATION]', '[DATA_AGENT]'); + $request = (new GetDataAgentRequest())->setName($formattedName); + $response = $gapicClient->getDataAgent($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.geminidataanalytics.v1.DataAgentService/GetDataAgent', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getDataAgentExceptionTest() + { + $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->dataAgentName('[PROJECT]', '[LOCATION]', '[DATA_AGENT]'); + $request = (new GetDataAgentRequest())->setName($formattedName); + try { + $gapicClient->getDataAgent($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 getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest())->setResource($resource); + $response = $gapicClient->getIamPolicy($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.geminidataanalytics.v1.DataAgentService/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest())->setResource($resource); + try { + $gapicClient->getIamPolicy($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 listAccessibleDataAgentsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $dataAgentsElement = new DataAgent(); + $dataAgents = [$dataAgentsElement]; + $expectedResponse = new ListAccessibleDataAgentsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setDataAgents($dataAgents); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListAccessibleDataAgentsRequest())->setParent($formattedParent); + $response = $gapicClient->listAccessibleDataAgents($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getDataAgents()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.geminidataanalytics.v1.DataAgentService/ListAccessibleDataAgents', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAccessibleDataAgentsExceptionTest() + { + $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 ListAccessibleDataAgentsRequest())->setParent($formattedParent); + try { + $gapicClient->listAccessibleDataAgents($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 listDataAgentsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $dataAgentsElement = new DataAgent(); + $dataAgents = [$dataAgentsElement]; + $expectedResponse = new ListDataAgentsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setDataAgents($dataAgents); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListDataAgentsRequest())->setParent($formattedParent); + $response = $gapicClient->listDataAgents($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getDataAgents()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.geminidataanalytics.v1.DataAgentService/ListDataAgents', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listDataAgentsExceptionTest() + { + $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 ListDataAgentsRequest())->setParent($formattedParent); + try { + $gapicClient->listDataAgents($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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); + $response = $gapicClient->setIamPolicy($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.geminidataanalytics.v1.DataAgentService/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); + try { + $gapicClient->setIamPolicy($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 updateDataAgentTest() + { + $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/updateDataAgentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $kmsKey = 'kmsKey-591635343'; + $expectedResponse = new DataAgent(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setKmsKey($kmsKey); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateDataAgentTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $dataAgent = new DataAgent(); + $request = (new UpdateDataAgentRequest())->setDataAgent($dataAgent); + $response = $gapicClient->updateDataAgent($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.geminidataanalytics.v1.DataAgentService/UpdateDataAgent', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDataAgent(); + $this->assertProtobufEquals($dataAgent, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateDataAgentTest'); + $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 updateDataAgentExceptionTest() + { + $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/updateDataAgentTest'); + $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 + $dataAgent = new DataAgent(); + $request = (new UpdateDataAgentRequest())->setDataAgent($dataAgent); + $response = $gapicClient->updateDataAgent($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateDataAgentTest'); + 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 updateDataAgentSyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $kmsKey = 'kmsKey-591635343'; + $expectedResponse = new DataAgent(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setKmsKey($kmsKey); + $transport->addResponse($expectedResponse); + // Mock request + $dataAgent = new DataAgent(); + $request = (new UpdateDataAgentRequest())->setDataAgent($dataAgent); + $response = $gapicClient->updateDataAgentSync($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.geminidataanalytics.v1.DataAgentService/UpdateDataAgentSync', $actualFuncCall); + $actualValue = $actualRequestObject->getDataAgent(); + $this->assertProtobufEquals($dataAgent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateDataAgentSyncExceptionTest() + { + $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 + $dataAgent = new DataAgent(); + $request = (new UpdateDataAgentRequest())->setDataAgent($dataAgent); + try { + $gapicClient->updateDataAgentSync($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 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 createDataAgentAsyncTest() + { + $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/createDataAgentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $kmsKey = 'kmsKey-591635343'; + $expectedResponse = new DataAgent(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setKmsKey($kmsKey); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createDataAgentTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $dataAgent = new DataAgent(); + $request = (new CreateDataAgentRequest())->setParent($formattedParent)->setDataAgent($dataAgent); + $response = $gapicClient->createDataAgentAsync($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.geminidataanalytics.v1.DataAgentService/CreateDataAgent', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getDataAgent(); + $this->assertProtobufEquals($dataAgent, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createDataAgentTest'); + $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/GeminiDataAnalytics/tests/Unit/V1/Client/DataChatServiceClientTest.php b/GeminiDataAnalytics/tests/Unit/V1/Client/DataChatServiceClientTest.php new file mode 100644 index 000000000000..6d3168bc4c5c --- /dev/null +++ b/GeminiDataAnalytics/tests/Unit/V1/Client/DataChatServiceClientTest.php @@ -0,0 +1,679 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return DataChatServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new DataChatServiceClient($options); + } + + /** @test */ + public function chatTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $messageId = 'messageId-1690722221'; + $expectedResponse = new Message(); + $expectedResponse->setMessageId($messageId); + $transport->addResponse($expectedResponse); + $messageId2 = 'messageId2-1286413498'; + $expectedResponse2 = new Message(); + $expectedResponse2->setMessageId($messageId2); + $transport->addResponse($expectedResponse2); + $messageId3 = 'messageId3-1286413497'; + $expectedResponse3 = new Message(); + $expectedResponse3->setMessageId($messageId3); + $transport->addResponse($expectedResponse3); + // Mock request + $parent = 'parent-995424086'; + $messages = []; + $request = (new ChatRequest())->setParent($parent)->setMessages($messages); + $serverStream = $gapicClient->chat($request); + $this->assertInstanceOf(ServerStream::class, $serverStream); + $responses = iterator_to_array($serverStream->readAll()); + $expectedResponses = []; + $expectedResponses[] = $expectedResponse; + $expectedResponses[] = $expectedResponse2; + $expectedResponses[] = $expectedResponse3; + $this->assertEquals($expectedResponses, $responses); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.geminidataanalytics.v1.DataChatService/Chat', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualRequestObject->getMessages(); + $this->assertProtobufEquals($messages, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function chatExceptionTest() + { + $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()); + // Mock request + $parent = 'parent-995424086'; + $messages = []; + $request = (new ChatRequest())->setParent($parent)->setMessages($messages); + $serverStream = $gapicClient->chat($request); + $results = $serverStream->readAll(); + 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 createConversationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $kmsKey = 'kmsKey-591635343'; + $memoryPaused = true; + $expectedResponse = new Conversation(); + $expectedResponse->setName($name); + $expectedResponse->setKmsKey($kmsKey); + $expectedResponse->setMemoryPaused($memoryPaused); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $conversation = new Conversation(); + $conversationAgents = []; + $conversation->setAgents($conversationAgents); + $request = (new CreateConversationRequest())->setParent($formattedParent)->setConversation($conversation); + $response = $gapicClient->createConversation($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.geminidataanalytics.v1.DataChatService/CreateConversation', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getConversation(); + $this->assertProtobufEquals($conversation, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createConversationExceptionTest() + { + $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]'); + $conversation = new Conversation(); + $conversationAgents = []; + $conversation->setAgents($conversationAgents); + $request = (new CreateConversationRequest())->setParent($formattedParent)->setConversation($conversation); + try { + $gapicClient->createConversation($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 deleteConversationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->conversationName('[PROJECT]', '[LOCATION]', '[CONVERSATION]'); + $request = (new DeleteConversationRequest())->setName($formattedName); + $gapicClient->deleteConversation($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.geminidataanalytics.v1.DataChatService/DeleteConversation', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteConversationExceptionTest() + { + $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->conversationName('[PROJECT]', '[LOCATION]', '[CONVERSATION]'); + $request = (new DeleteConversationRequest())->setName($formattedName); + try { + $gapicClient->deleteConversation($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 getConversationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $kmsKey = 'kmsKey-591635343'; + $memoryPaused = true; + $expectedResponse = new Conversation(); + $expectedResponse->setName($name2); + $expectedResponse->setKmsKey($kmsKey); + $expectedResponse->setMemoryPaused($memoryPaused); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->conversationName('[PROJECT]', '[LOCATION]', '[CONVERSATION]'); + $request = (new GetConversationRequest())->setName($formattedName); + $response = $gapicClient->getConversation($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.geminidataanalytics.v1.DataChatService/GetConversation', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getConversationExceptionTest() + { + $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->conversationName('[PROJECT]', '[LOCATION]', '[CONVERSATION]'); + $request = (new GetConversationRequest())->setName($formattedName); + try { + $gapicClient->getConversation($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 listConversationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $conversationsElement = new Conversation(); + $conversations = [$conversationsElement]; + $expectedResponse = new ListConversationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setConversations($conversations); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListConversationsRequest())->setParent($formattedParent); + $response = $gapicClient->listConversations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getConversations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.geminidataanalytics.v1.DataChatService/ListConversations', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listConversationsExceptionTest() + { + $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 ListConversationsRequest())->setParent($formattedParent); + try { + $gapicClient->listConversations($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 listMessagesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $messagesElement = new StorageMessage(); + $messages = [$messagesElement]; + $expectedResponse = new ListMessagesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setMessages($messages); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->conversationName('[PROJECT]', '[LOCATION]', '[CONVERSATION]'); + $request = (new ListMessagesRequest())->setParent($formattedParent); + $response = $gapicClient->listMessages($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getMessages()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.geminidataanalytics.v1.DataChatService/ListMessages', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listMessagesExceptionTest() + { + $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->conversationName('[PROJECT]', '[LOCATION]', '[CONVERSATION]'); + $request = (new ListMessagesRequest())->setParent($formattedParent); + try { + $gapicClient->listMessages($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 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 createConversationAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $kmsKey = 'kmsKey-591635343'; + $memoryPaused = true; + $expectedResponse = new Conversation(); + $expectedResponse->setName($name); + $expectedResponse->setKmsKey($kmsKey); + $expectedResponse->setMemoryPaused($memoryPaused); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $conversation = new Conversation(); + $conversationAgents = []; + $conversation->setAgents($conversationAgents); + $request = (new CreateConversationRequest())->setParent($formattedParent)->setConversation($conversation); + $response = $gapicClient->createConversationAsync($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.geminidataanalytics.v1.DataChatService/CreateConversation', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getConversation(); + $this->assertProtobufEquals($conversation, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +}