From cd27d6ad468a045bed5c8022c991e40980bd9247 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 14 Mar 2023 09:37:23 -0700 Subject: [PATCH] feat: add support for new ImportEntries() API, including format of the dump (#5964) feat: add support for new ImportEntries() API, including format of the dump feat: add support for entries associated with Looker and CloudSQL feat: add support for a ReconcileTags() API method PiperOrigin-RevId: 516484690 Source-Link: https://github.com/googleapis/googleapis/commit/50eef0f8c88d0e3a5f90256b9f62b34fc95311a9 Source-Link: https://github.com/googleapis/googleapis-gen/commit/09b205819aa6d82393ef865b596571814c5d1840 Copy-Tag: eyJwIjoiRGF0YUNhdGFsb2cvLk93bEJvdC55YW1sIiwiaCI6IjA5YjIwNTgxOWFhNmQ4MjM5M2VmODY1YjU5NjU3MTgxNGM1ZDE4NDAifQ== --- DataCatalog/metadata/V1/Common.php | Bin 1099 -> 1235 bytes DataCatalog/metadata/V1/Datacatalog.php | Bin 18194 -> 21012 bytes DataCatalog/metadata/V1/DumpContent.php | Bin 0 -> 1325 bytes DataCatalog/metadata/V1/Policytagmanager.php | Bin 6519 -> 6804 bytes DataCatalog/metadata/V1/Schema.php | Bin 1130 -> 1812 bytes DataCatalog/metadata/V1/Usage.php | Bin 1403 -> 1739 bytes .../DataCatalogClient/create_entry_group.php | 3 +- .../V1/DataCatalogClient/import_entries.php | 95 +++++++ .../V1/DataCatalogClient/reconcile_tags.php | 102 +++++++ .../rename_tag_template_field.php | 3 +- .../rename_tag_template_field_enum_value.php | 3 +- .../V1/DataCatalogClient/search_catalog.php | 5 +- .../export_taxonomies.php | 3 +- .../import_taxonomies.php | 3 +- .../replace_taxonomy.php | 3 +- .../src/V1/BigQueryDateShardedSpec.php | 16 +- DataCatalog/src/V1/ColumnSchema.php | 210 ++++++++++++++- .../src/V1/ColumnSchema/IndexingType.php | 78 ++++++ .../src/V1/ColumnSchema/LookerColumnSpec.php | 70 +++++ .../LookerColumnSpec/LookerColumnType.php | 85 ++++++ .../src/V1/ColumnSchema_IndexingType.php | 16 ++ .../src/V1/ColumnSchema_LookerColumnSpec.php | 16 ++ ...hema_LookerColumnSpec_LookerColumnType.php | 16 ++ DataCatalog/src/V1/CommonUsageStats.php | 78 ++++++ .../src/V1/CreateEntryGroupRequest.php | 12 +- DataCatalog/src/V1/DataCatalogGrpcClient.php | 59 ++++ DataCatalog/src/V1/DatabaseTableSpec.php | 48 ++++ .../V1/DatabaseTableSpec/DatabaseViewSpec.php | 145 ++++++++++ .../DatabaseViewSpec/ViewType.php | 64 +++++ .../V1/DatabaseTableSpec_DatabaseViewSpec.php | 16 ++ ...aseTableSpec_DatabaseViewSpec_ViewType.php | 16 ++ DataCatalog/src/V1/DumpItem.php | 75 ++++++ DataCatalog/src/V1/Entry.php | 115 ++++++-- DataCatalog/src/V1/EntryType.php | 32 +++ .../src/V1/ExportTaxonomiesRequest.php | 12 +- .../src/V1/FieldType/EnumType/EnumValue.php | 12 +- .../src/V1/Gapic/DataCatalogGapicClient.php | 242 ++++++++++++++++- .../V1/Gapic/PolicyTagManagerGapicClient.php | 7 + ...licyTagManagerSerializationGapicClient.php | 6 +- DataCatalog/src/V1/GcsFileSpec.php | 12 +- DataCatalog/src/V1/ImportEntriesMetadata.php | 115 ++++++++ .../V1/ImportEntriesMetadata/ImportState.php | 78 ++++++ .../V1/ImportEntriesMetadata_ImportState.php | 16 ++ DataCatalog/src/V1/ImportEntriesRequest.php | 111 ++++++++ DataCatalog/src/V1/ImportEntriesResponse.php | 127 +++++++++ .../src/V1/ImportTaxonomiesRequest.php | 12 +- DataCatalog/src/V1/IntegratedSystem.php | 14 + DataCatalog/src/V1/ListTaxonomiesRequest.php | 38 +++ DataCatalog/src/V1/LookerSystemSpec.php | 243 +++++++++++++++++ DataCatalog/src/V1/ManagingSystem.php | 62 +++++ DataCatalog/src/V1/ReconcileTagsMetadata.php | 107 ++++++++ .../ReconciliationState.php | 71 +++++ ...oncileTagsMetadata_ReconciliationState.php | 16 ++ DataCatalog/src/V1/ReconcileTagsRequest.php | 190 +++++++++++++ DataCatalog/src/V1/ReconcileTagsResponse.php | 137 ++++++++++ ...RenameTagTemplateFieldEnumValueRequest.php | 12 +- .../src/V1/RenameTagTemplateFieldRequest.php | 12 +- DataCatalog/src/V1/SearchCatalogRequest.php | 48 ++-- .../src/V1/SearchCatalogRequest/Scope.php | 40 +-- DataCatalog/src/V1/SearchCatalogResult.php | 12 +- DataCatalog/src/V1/SerializedTaxonomy.php | 12 +- DataCatalog/src/V1/SqlDatabaseSystemSpec.php | 197 ++++++++++++++ DataCatalog/src/V1/TableSpec.php | 24 +- DataCatalog/src/V1/Tag.php | 16 +- DataCatalog/src/V1/TagField.php | 20 +- DataCatalog/src/V1/TagTemplate.php | 4 +- DataCatalog/src/V1/TagTemplateField.php | 12 +- DataCatalog/src/V1/TaggedEntry.php | 152 +++++++++++ DataCatalog/src/V1/Taxonomy.php | 68 ++++- DataCatalog/src/V1/Taxonomy/Service.php | 104 +++++++ DataCatalog/src/V1/Taxonomy_Service.php | 16 ++ .../src/V1/UpdateTagTemplateFieldRequest.php | 16 +- DataCatalog/src/V1/UsageSignal.php | 94 ++++++- DataCatalog/src/V1/gapic_metadata.json | 10 + .../resources/data_catalog_client_config.json | 10 + .../data_catalog_descriptor_config.php | 20 ++ .../data_catalog_rest_client_config.php | 70 +++++ .../policy_tag_manager_rest_client_config.php | 46 ++++ ...nager_serialization_rest_client_config.php | 46 ++++ .../tests/Unit/V1/DataCatalogClientTest.php | 254 ++++++++++++++++++ 80 files changed, 4136 insertions(+), 194 deletions(-) create mode 100644 DataCatalog/metadata/V1/DumpContent.php create mode 100644 DataCatalog/samples/V1/DataCatalogClient/import_entries.php create mode 100644 DataCatalog/samples/V1/DataCatalogClient/reconcile_tags.php create mode 100644 DataCatalog/src/V1/ColumnSchema/IndexingType.php create mode 100644 DataCatalog/src/V1/ColumnSchema/LookerColumnSpec.php create mode 100644 DataCatalog/src/V1/ColumnSchema/LookerColumnSpec/LookerColumnType.php create mode 100644 DataCatalog/src/V1/ColumnSchema_IndexingType.php create mode 100644 DataCatalog/src/V1/ColumnSchema_LookerColumnSpec.php create mode 100644 DataCatalog/src/V1/ColumnSchema_LookerColumnSpec_LookerColumnType.php create mode 100644 DataCatalog/src/V1/CommonUsageStats.php create mode 100644 DataCatalog/src/V1/DatabaseTableSpec/DatabaseViewSpec.php create mode 100644 DataCatalog/src/V1/DatabaseTableSpec/DatabaseViewSpec/ViewType.php create mode 100644 DataCatalog/src/V1/DatabaseTableSpec_DatabaseViewSpec.php create mode 100644 DataCatalog/src/V1/DatabaseTableSpec_DatabaseViewSpec_ViewType.php create mode 100644 DataCatalog/src/V1/DumpItem.php create mode 100644 DataCatalog/src/V1/ImportEntriesMetadata.php create mode 100644 DataCatalog/src/V1/ImportEntriesMetadata/ImportState.php create mode 100644 DataCatalog/src/V1/ImportEntriesMetadata_ImportState.php create mode 100644 DataCatalog/src/V1/ImportEntriesRequest.php create mode 100644 DataCatalog/src/V1/ImportEntriesResponse.php create mode 100644 DataCatalog/src/V1/LookerSystemSpec.php create mode 100644 DataCatalog/src/V1/ManagingSystem.php create mode 100644 DataCatalog/src/V1/ReconcileTagsMetadata.php create mode 100644 DataCatalog/src/V1/ReconcileTagsMetadata/ReconciliationState.php create mode 100644 DataCatalog/src/V1/ReconcileTagsMetadata_ReconciliationState.php create mode 100644 DataCatalog/src/V1/ReconcileTagsRequest.php create mode 100644 DataCatalog/src/V1/ReconcileTagsResponse.php create mode 100644 DataCatalog/src/V1/SqlDatabaseSystemSpec.php create mode 100644 DataCatalog/src/V1/TaggedEntry.php create mode 100644 DataCatalog/src/V1/Taxonomy/Service.php create mode 100644 DataCatalog/src/V1/Taxonomy_Service.php diff --git a/DataCatalog/metadata/V1/Common.php b/DataCatalog/metadata/V1/Common.php index e46b482bf01e73be37f8e7302b87761436b6449f..b75a9653b9481493b5c7670e39c3c55629d572ce 100644 GIT binary patch delta 163 zcmX@jahY?2BoosImdVmgvzewbPTtN`T`$DT#p&$hALE|9F92p$q>Kh;G7aZW~?CIv|>LS1( nB*P_vuE51H#4*6fH9~+Kf@~T delta 25 hcmcc2d75K`BoosM=E>4bvl*)=?_jFlyo*_q5dd?G2!Q|q diff --git a/DataCatalog/metadata/V1/Datacatalog.php b/DataCatalog/metadata/V1/Datacatalog.php index 307f850e931456e3d930a03d2f389fae5e4d5ec0..b12e4bfc8748e8117344a200a1e418268f993e62 100644 GIT binary patch delta 2433 zcma)8&u<$=6z;AaH=Z=fdTb|-Nkh8*l@@BZRu3gb4eNM=mpb0m>y!c!+pRNoS8;Zo z-E~l;R;Eal9-s&Yj=cc_386~<2Z|7v00+diQhVr$e*g&%Ftb0>teXRuk^J8G-hA`k z_n!Cjd(0PKF%M40(iPKaS{=jCjpmBnMwaI2rh%D(m+;A017BrR@mjmFqBxqYy+^U{*{Q=#(`>d-zV$3s-V9RN_;y@OX2*Su)o$c%n#}G!jDNhJ zy))9QCKi|@mqEtfXsN53qg~T%q}p4ygVt5MjT)Ji zP0!v>sbATVVKB6d7QQz=#{Lq;-;94d1>XU1hx(?D-t&k@+}r0UZ~R*_aXuF?zf2&M zclLc2aQ#M-EbiuTw%RDekQ^h0a*(6@T#g(~Rwq!H0>G^uDPap`SP~d7?}JGYrjP%R0yl1ecg^D<0> z#G+6aYm!ir-WGj3TTFt4ZFZ~%QdiM+-O#CwdezL8NOxrgr1$I^gaA-#$Y|<@_tH4b z0Pa~Ok!6!K-c!iM!@5DVV~{&;n6~3RhTmoY*WX*11+cAI$Z%A>8^q|VZZYHV2$&3< zfp1l}+bwNNHMDiVa&R1s`lxkt6}40n?p6;T0uv!eC^kw949CET582dD5jBw50oO4N zGCK}p4~51kqWAR++j0IW15!2AFpY-ZLUpZa*AVHS?Z9&&=EdWGkDZ3F1P(Y_Qzer^ z*gJ$demHe@22O(1b<=A_3pq$#*KM23x66MJ=0KDL*_kNLA3fIP*Fd`OD!XkOHlj6b zScs%uRViL=m>t7$OBkWPPMh>8?4y!%eWYIG-cTH^U4+MxzS|}ik)zRu!(}i)7ek=< z1*-V-A!Y$I7g%+7S<&5uU=_rWWto;u)Dj`v;sTBD21vJvJMp3m6b;AP$_ij;*H1VE zB5P>N7s??pu&K2=o+5?{Fy}3?99d#HdTYm?WzRAErwm927wx8W1azls;=Ej)mnxD_ zm*lESrm5aPWMuyOP?wg)Wio#ZoC4WCmsC}kYVzwfQBgRSXf)a9FUeJri}2qu09JIn zw|Vq;=1d2qr1iFGIrPOkdR|Q4bBi-i1om%%htrrlFx`a{V6@q=)oY!`8gkUO=G+K& zN^uaxykY0bKS8=Lxi6o?V64-&kwtYt29aLuONfp_q`dDg!$2OS1FeKHG2I0*1XP>= z4p-|#U2eOtKEqa?AH$!jp#>Z86vE-G?GtczTfzt4ayeyxzje;qrA z?;n56{DW`J{CI(aOF~^J3W}&I^JQ^S;6~vvh?fMVT$IUj=Qtw#{o<9Sid+-91RMm> ziY#B`VBz8Uo^ayBvBaMY7!EY<4imn5;>8Ogi@&3?2ZJ%$^*xZ=`Ly8gFdzK!6tgn_ z2L9m`j~^5!=JRyF%v!<1n`KUJ3%R~UQA572!rLlnRqyAy=>Z5I6Plq`Qkt)ZEdP_{ qO_!y}V`1)$bSv+RYgTs$DPY)_IA9nu2Mn{-Z6Ql0E8B~TBkX@+tMt+U delta 191 zcmbQTgmF?I;|49Z$ysd4lNs6dS^m^>=}tbtAu};uaB~v-Y^KRdTz0HVt;}2^lMir- zY@WoG%g%I(XEURa8{_1+!tRVrlTAf}fn=vh0+4(q;>XB5*-|tPNX`&-1d_KvHJw)vT-JS(e|-zi6_$%;Z!o7n>Rm;iOuIrRVl diff --git a/DataCatalog/metadata/V1/DumpContent.php b/DataCatalog/metadata/V1/DumpContent.php new file mode 100644 index 0000000000000000000000000000000000000000..abfb4d387332559568bd569203399d8fe9d2eed5 GIT binary patch literal 1325 zcmb7E%Wl&^6s^-zs%aM}tBOi+DHU}ka1;jBFX|;iYE5N9m(-n<8h>d z@p$^s6ZZtDZr%wYVEW$}*;i{DB0Ouzunl7PDhP;i>sy;PzF zO_|1?FHra3qTfH5ub(h?+8h3kS!>s

Ee`%P{ezMY9Cu;(kT0b1}5Yv4VvURT%Ih%p5^Xag77xNb*$F)da z$~{YkiT*Of>9BF>*Kf!9TG{E?#CtaJo=N->UU+VJ{rdO$Q-5|K*lnIY_wh*hS$R;v mDYbY?O9Yhm>%(<>+Pv6btl-lkW~EgAHIcTm2+EX93HbxoRJE4? literal 0 HcmV?d00001 diff --git a/DataCatalog/metadata/V1/Policytagmanager.php b/DataCatalog/metadata/V1/Policytagmanager.php index 2711ee344fcff4ca0891c2f68914de81cc74cf03..2f34aef07ddd6870e50523cd5f9da9149c8c776f 100644 GIT binary patch delta 216 zcmexvG{tnoNhUVu{M_99yvg;GOEIIyL~j|sWUv~& zf};GAd?_8E$mC-zJv^^jxHv)*EAsR5b1Nqsu#QW14m}5FfMi|U&xY+B`+~IRf180QG?G&d-6waSq0z3yu|d(y!7D8 z;*!){AptIq%#_r;lFX7y2_~R2&ds@Oy39=7jFV?`R`Uq)aj~Uk=9HusNw91d;!5QQ E0LhL)`Tzg` delta 62 zcmV-E0Kxy1HTN>G$pW(u12+K#tttvKlkWr^k!Kc@djxZn7zL>U&I7Z<1sMUec?T^6 U1A7V;lMxXWlfMdNvoi}}50MoUVgLXD diff --git a/DataCatalog/metadata/V1/Schema.php b/DataCatalog/metadata/V1/Schema.php index 99aba357ee93a6cdeaa45c5a450505c7c0f3a538..44d316d1d10d55a0d7443fa10237b1edda2008f5 100644 GIT binary patch delta 602 zcmZvZzi!$<7{Ftj1o#N)>6%6crKnVgp2|7i|ljIFDckC17>_icSj`#h(Kfmw3zqwy~SGuZR=a*&mr+T}y{G*OPm7zEm zpN9)S=3j^YLg=|S%G-QhyE7F08c;YNd%@7>voP{vFAVg&#M=+}BfL8ICg&oGxfhJZ zH!qm*_+ln>kU4v`cgyeUQSq2QqMjtnoJK3S57-aGFJjI|p}&|0JerA-j%87y_C6_M z$DNcnQrwmF!xr9$>}15}3t#AkC<V1<>pWjms$)d_$9n}dh(WIxi(TSF~H6V z?evI)G+cnJNsO-R5R^%(ZNo84lCbUSZv}Q&|4d$?L|K#cDQo?2_yOQ`%q&Kv#Ubb` y@iQqcffT2wExT($n delta 30 mcmbQj_ljeK1QSyS%Va60KBnc2lUFgNOkT?Dy!kh)BqIQp9SOn! diff --git a/DataCatalog/metadata/V1/Usage.php b/DataCatalog/metadata/V1/Usage.php index f0b67b701fe0b430af3645e7fcfda2ae2797631d..0207a8caefe7ad06496ba913040540765965cf9c 100644 GIT binary patch delta 278 zcmey(b((iW5EJWK4z3vWiQejy>zFRvS#b$C=jZ0;=Y?mS2=vk_xqv1#aWy z-^}S;QUzS{aP{hfHe9S_i8-aI5==m4+(x=!Lk;!NePP99!RRE&#UGDqxYIF4E_tA9 KAx>#y`3eAs7*_)T delta 57 zcmV-90LK5z4f_hPQUV3t1qxgzkxM6&ege}1jsla91E>TVWC|IRkOUf&importEntries($formattedParent); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ImportEntriesResponse $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 = DataCatalogClient::entryGroupName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]'); + + import_entries_sample($formattedParent); +} +// [END datacatalog_v1_generated_DataCatalog_ImportEntries_sync] diff --git a/DataCatalog/samples/V1/DataCatalogClient/reconcile_tags.php b/DataCatalog/samples/V1/DataCatalogClient/reconcile_tags.php new file mode 100644 index 00000000000..0900df2c689 --- /dev/null +++ b/DataCatalog/samples/V1/DataCatalogClient/reconcile_tags.php @@ -0,0 +1,102 @@ +reconcileTags($formattedParent, $formattedTagTemplate); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ReconcileTagsResponse $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 = DataCatalogClient::entryName( + '[PROJECT]', + '[LOCATION]', + '[ENTRY_GROUP]', + '[ENTRY]' + ); + $formattedTagTemplate = DataCatalogClient::tagTemplateName( + '[PROJECT]', + '[LOCATION]', + '[TAG_TEMPLATE]' + ); + + reconcile_tags_sample($formattedParent, $formattedTagTemplate); +} +// [END datacatalog_v1_generated_DataCatalog_ReconcileTags_sync] diff --git a/DataCatalog/samples/V1/DataCatalogClient/rename_tag_template_field.php b/DataCatalog/samples/V1/DataCatalogClient/rename_tag_template_field.php index fc32c3ef739..9a5f9738d63 100644 --- a/DataCatalog/samples/V1/DataCatalogClient/rename_tag_template_field.php +++ b/DataCatalog/samples/V1/DataCatalogClient/rename_tag_template_field.php @@ -36,7 +36,8 @@ * * @param string $formattedName The name of the tag template field. Please see * {@see DataCatalogClient::tagTemplateFieldName()} for help formatting this field. - * @param string $newTagTemplateFieldId The new ID of this tag template field. For example, `my_new_field`. + * @param string $newTagTemplateFieldId The new ID of this tag template field. For example, + * `my_new_field`. */ function rename_tag_template_field_sample( string $formattedName, diff --git a/DataCatalog/samples/V1/DataCatalogClient/rename_tag_template_field_enum_value.php b/DataCatalog/samples/V1/DataCatalogClient/rename_tag_template_field_enum_value.php index 92ed2e8d7ce..d0a3f43bf19 100644 --- a/DataCatalog/samples/V1/DataCatalogClient/rename_tag_template_field_enum_value.php +++ b/DataCatalog/samples/V1/DataCatalogClient/rename_tag_template_field_enum_value.php @@ -34,7 +34,8 @@ * * @param string $formattedName The name of the enum field value. Please see * {@see DataCatalogClient::tagTemplateFieldEnumValueName()} for help formatting this field. - * @param string $newEnumValueDisplayName The new display name of the enum value. For example, `my_new_enum_value`. + * @param string $newEnumValueDisplayName The new display name of the enum value. For example, + * `my_new_enum_value`. */ function rename_tag_template_field_enum_value_sample( string $formattedName, diff --git a/DataCatalog/samples/V1/DataCatalogClient/search_catalog.php b/DataCatalog/samples/V1/DataCatalogClient/search_catalog.php index 65cb96a08bf..0f1571e262f 100644 --- a/DataCatalog/samples/V1/DataCatalogClient/search_catalog.php +++ b/DataCatalog/samples/V1/DataCatalogClient/search_catalog.php @@ -46,9 +46,8 @@ * For more information, see [Data Catalog search syntax] * (https://cloud.google.com/data-catalog/docs/how-to/search-reference). * - * @param string $query Optional. The query string with a minimum of 3 characters and specific syntax. - * For more information, see - * [Data Catalog search + * @param string $query Optional. The query string with a minimum of 3 characters and specific + * syntax. For more information, see [Data Catalog search * syntax](https://cloud.google.com/data-catalog/docs/how-to/search-reference). * * An empty query string returns all data assets (in the specified scope) diff --git a/DataCatalog/samples/V1/PolicyTagManagerSerializationClient/export_taxonomies.php b/DataCatalog/samples/V1/PolicyTagManagerSerializationClient/export_taxonomies.php index 12d9ce96065..1aa9cbdfba8 100644 --- a/DataCatalog/samples/V1/PolicyTagManagerSerializationClient/export_taxonomies.php +++ b/DataCatalog/samples/V1/PolicyTagManagerSerializationClient/export_taxonomies.php @@ -35,7 +35,8 @@ * This method generates `SerializedTaxonomy` protocol buffers with nested * policy tags that can be used as input for `ImportTaxonomies` calls. * - * @param string $formattedParent Resource name of the project that the exported taxonomies belong to. Please see + * @param string $formattedParent Resource name of the project that the exported taxonomies belong + * to. Please see * {@see PolicyTagManagerSerializationClient::locationName()} for help formatting this field. * @param string $formattedTaxonomiesElement Resource names of the taxonomies to export. Please see * {@see PolicyTagManagerSerializationClient::taxonomyName()} for help formatting this field. diff --git a/DataCatalog/samples/V1/PolicyTagManagerSerializationClient/import_taxonomies.php b/DataCatalog/samples/V1/PolicyTagManagerSerializationClient/import_taxonomies.php index 220cc310058..94005fc6f7b 100644 --- a/DataCatalog/samples/V1/PolicyTagManagerSerializationClient/import_taxonomies.php +++ b/DataCatalog/samples/V1/PolicyTagManagerSerializationClient/import_taxonomies.php @@ -37,7 +37,8 @@ * For an inlined source, taxonomies and policy tags are created in bulk using * nested protocol buffer structures. * - * @param string $formattedParent Resource name of project that the imported taxonomies will belong to. Please see + * @param string $formattedParent Resource name of project that the imported taxonomies will belong + * to. Please see * {@see PolicyTagManagerSerializationClient::locationName()} for help formatting this field. */ function import_taxonomies_sample(string $formattedParent): void diff --git a/DataCatalog/samples/V1/PolicyTagManagerSerializationClient/replace_taxonomy.php b/DataCatalog/samples/V1/PolicyTagManagerSerializationClient/replace_taxonomy.php index 4f13bf16729..481b112a79f 100644 --- a/DataCatalog/samples/V1/PolicyTagManagerSerializationClient/replace_taxonomy.php +++ b/DataCatalog/samples/V1/PolicyTagManagerSerializationClient/replace_taxonomy.php @@ -45,7 +45,8 @@ * * @param string $formattedName Resource name of the taxonomy to update. Please see * {@see PolicyTagManagerSerializationClient::taxonomyName()} for help formatting this field. - * @param string $serializedTaxonomyDisplayName Display name of the taxonomy. At most 200 bytes when encoded in UTF-8. + * @param string $serializedTaxonomyDisplayName Display name of the taxonomy. At most 200 bytes when encoded in + * UTF-8. */ function replace_taxonomy_sample( string $formattedName, diff --git a/DataCatalog/src/V1/BigQueryDateShardedSpec.php b/DataCatalog/src/V1/BigQueryDateShardedSpec.php index 9a92116dc42..38f18b0948f 100644 --- a/DataCatalog/src/V1/BigQueryDateShardedSpec.php +++ b/DataCatalog/src/V1/BigQueryDateShardedSpec.php @@ -19,8 +19,8 @@ class BigQueryDateShardedSpec extends \Google\Protobuf\Internal\Message { /** - * Output only. The Data Catalog resource name of the dataset entry the current table - * belongs to. For example: + * Output only. The Data Catalog resource name of the dataset entry the + * current table belongs to. For example: * `projects/{PROJECT_ID}/locations/{LOCATION}/entrygroups/{ENTRY_GROUP_ID}/entries/{ENTRY_ID}`. * * Generated from protobuf field string dataset = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { @@ -55,8 +55,8 @@ class BigQueryDateShardedSpec extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $dataset - * Output only. The Data Catalog resource name of the dataset entry the current table - * belongs to. For example: + * Output only. The Data Catalog resource name of the dataset entry the + * current table belongs to. For example: * `projects/{PROJECT_ID}/locations/{LOCATION}/entrygroups/{ENTRY_GROUP_ID}/entries/{ENTRY_ID}`. * @type string $table_prefix * Output only. The table name prefix of the shards. @@ -75,8 +75,8 @@ public function __construct($data = NULL) { } /** - * Output only. The Data Catalog resource name of the dataset entry the current table - * belongs to. For example: + * Output only. The Data Catalog resource name of the dataset entry the + * current table belongs to. For example: * `projects/{PROJECT_ID}/locations/{LOCATION}/entrygroups/{ENTRY_GROUP_ID}/entries/{ENTRY_ID}`. * * Generated from protobuf field string dataset = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { @@ -88,8 +88,8 @@ public function getDataset() } /** - * Output only. The Data Catalog resource name of the dataset entry the current table - * belongs to. For example: + * Output only. The Data Catalog resource name of the dataset entry the + * current table belongs to. For example: * `projects/{PROJECT_ID}/locations/{LOCATION}/entrygroups/{ENTRY_GROUP_ID}/entries/{ENTRY_ID}`. * * Generated from protobuf field string dataset = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { diff --git a/DataCatalog/src/V1/ColumnSchema.php b/DataCatalog/src/V1/ColumnSchema.php index 87e469719d6..6b63b4378fc 100644 --- a/DataCatalog/src/V1/ColumnSchema.php +++ b/DataCatalog/src/V1/ColumnSchema.php @@ -40,8 +40,8 @@ class ColumnSchema extends \Google\Protobuf\Internal\Message */ private $description = ''; /** - * Optional. A column's mode indicates whether values in this column are required, - * nullable, or repeated. + * Optional. A column's mode indicates whether values in this column are + * required, nullable, or repeated. * Only `NULLABLE`, `REQUIRED`, and `REPEATED` values are supported. * Default mode is `NULLABLE`. * @@ -49,11 +49,38 @@ class ColumnSchema extends \Google\Protobuf\Internal\Message */ private $mode = ''; /** - * Optional. Schema of sub-columns. A column can have zero or more sub-columns. + * Optional. Default value for the column. + * + * Generated from protobuf field string default_value = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $default_value = ''; + /** + * Optional. Ordinal position + * + * Generated from protobuf field int32 ordinal_position = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $ordinal_position = 0; + /** + * Optional. Most important inclusion of this column. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.ColumnSchema.IndexingType highest_indexing_type = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $highest_indexing_type = 0; + /** + * Optional. Schema of sub-columns. A column can have zero or more + * sub-columns. * * Generated from protobuf field repeated .google.cloud.datacatalog.v1.ColumnSchema subcolumns = 7 [(.google.api.field_behavior) = OPTIONAL]; */ private $subcolumns; + /** + * Optional. Garbage collection policy for the column or column family. + * Applies to systems like Cloud Bigtable. + * + * Generated from protobuf field string gc_rule = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $gc_rule = ''; + protected $system_spec; /** * Constructor. @@ -73,12 +100,24 @@ class ColumnSchema extends \Google\Protobuf\Internal\Message * The description must be a UTF-8 string with the maximum size of 2000 * bytes. * @type string $mode - * Optional. A column's mode indicates whether values in this column are required, - * nullable, or repeated. + * Optional. A column's mode indicates whether values in this column are + * required, nullable, or repeated. * Only `NULLABLE`, `REQUIRED`, and `REPEATED` values are supported. * Default mode is `NULLABLE`. + * @type string $default_value + * Optional. Default value for the column. + * @type int $ordinal_position + * Optional. Ordinal position + * @type int $highest_indexing_type + * Optional. Most important inclusion of this column. * @type array<\Google\Cloud\DataCatalog\V1\ColumnSchema>|\Google\Protobuf\Internal\RepeatedField $subcolumns - * Optional. Schema of sub-columns. A column can have zero or more sub-columns. + * Optional. Schema of sub-columns. A column can have zero or more + * sub-columns. + * @type \Google\Cloud\DataCatalog\V1\ColumnSchema\LookerColumnSpec $looker_column_spec + * Looker specific column info of this column. + * @type string $gc_rule + * Optional. Garbage collection policy for the column or column family. + * Applies to systems like Cloud Bigtable. * } */ public function __construct($data = NULL) { @@ -175,8 +214,8 @@ public function setDescription($var) } /** - * Optional. A column's mode indicates whether values in this column are required, - * nullable, or repeated. + * Optional. A column's mode indicates whether values in this column are + * required, nullable, or repeated. * Only `NULLABLE`, `REQUIRED`, and `REPEATED` values are supported. * Default mode is `NULLABLE`. * @@ -189,8 +228,8 @@ public function getMode() } /** - * Optional. A column's mode indicates whether values in this column are required, - * nullable, or repeated. + * Optional. A column's mode indicates whether values in this column are + * required, nullable, or repeated. * Only `NULLABLE`, `REQUIRED`, and `REPEATED` values are supported. * Default mode is `NULLABLE`. * @@ -207,7 +246,86 @@ public function setMode($var) } /** - * Optional. Schema of sub-columns. A column can have zero or more sub-columns. + * Optional. Default value for the column. + * + * Generated from protobuf field string default_value = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDefaultValue() + { + return $this->default_value; + } + + /** + * Optional. Default value for the column. + * + * Generated from protobuf field string default_value = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDefaultValue($var) + { + GPBUtil::checkString($var, True); + $this->default_value = $var; + + return $this; + } + + /** + * Optional. Ordinal position + * + * Generated from protobuf field int32 ordinal_position = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getOrdinalPosition() + { + return $this->ordinal_position; + } + + /** + * Optional. Ordinal position + * + * Generated from protobuf field int32 ordinal_position = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setOrdinalPosition($var) + { + GPBUtil::checkInt32($var); + $this->ordinal_position = $var; + + return $this; + } + + /** + * Optional. Most important inclusion of this column. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.ColumnSchema.IndexingType highest_indexing_type = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getHighestIndexingType() + { + return $this->highest_indexing_type; + } + + /** + * Optional. Most important inclusion of this column. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.ColumnSchema.IndexingType highest_indexing_type = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setHighestIndexingType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DataCatalog\V1\ColumnSchema\IndexingType::class); + $this->highest_indexing_type = $var; + + return $this; + } + + /** + * Optional. Schema of sub-columns. A column can have zero or more + * sub-columns. * * Generated from protobuf field repeated .google.cloud.datacatalog.v1.ColumnSchema subcolumns = 7 [(.google.api.field_behavior) = OPTIONAL]; * @return \Google\Protobuf\Internal\RepeatedField @@ -218,7 +336,8 @@ public function getSubcolumns() } /** - * Optional. Schema of sub-columns. A column can have zero or more sub-columns. + * Optional. Schema of sub-columns. A column can have zero or more + * sub-columns. * * Generated from protobuf field repeated .google.cloud.datacatalog.v1.ColumnSchema subcolumns = 7 [(.google.api.field_behavior) = OPTIONAL]; * @param array<\Google\Cloud\DataCatalog\V1\ColumnSchema>|\Google\Protobuf\Internal\RepeatedField $var @@ -232,5 +351,72 @@ public function setSubcolumns($var) return $this; } + /** + * Looker specific column info of this column. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.ColumnSchema.LookerColumnSpec looker_column_spec = 18; + * @return \Google\Cloud\DataCatalog\V1\ColumnSchema\LookerColumnSpec|null + */ + public function getLookerColumnSpec() + { + return $this->readOneof(18); + } + + public function hasLookerColumnSpec() + { + return $this->hasOneof(18); + } + + /** + * Looker specific column info of this column. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.ColumnSchema.LookerColumnSpec looker_column_spec = 18; + * @param \Google\Cloud\DataCatalog\V1\ColumnSchema\LookerColumnSpec $var + * @return $this + */ + public function setLookerColumnSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\V1\ColumnSchema\LookerColumnSpec::class); + $this->writeOneof(18, $var); + + return $this; + } + + /** + * Optional. Garbage collection policy for the column or column family. + * Applies to systems like Cloud Bigtable. + * + * Generated from protobuf field string gc_rule = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getGcRule() + { + return $this->gc_rule; + } + + /** + * Optional. Garbage collection policy for the column or column family. + * Applies to systems like Cloud Bigtable. + * + * Generated from protobuf field string gc_rule = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setGcRule($var) + { + GPBUtil::checkString($var, True); + $this->gc_rule = $var; + + return $this; + } + + /** + * @return string + */ + public function getSystemSpec() + { + return $this->whichOneof("system_spec"); + } + } diff --git a/DataCatalog/src/V1/ColumnSchema/IndexingType.php b/DataCatalog/src/V1/ColumnSchema/IndexingType.php new file mode 100644 index 00000000000..88e5298ab42 --- /dev/null +++ b/DataCatalog/src/V1/ColumnSchema/IndexingType.php @@ -0,0 +1,78 @@ +google.cloud.datacatalog.v1.ColumnSchema.IndexingType + */ +class IndexingType +{ + /** + * Unspecified. + * + * Generated from protobuf enum INDEXING_TYPE_UNSPECIFIED = 0; + */ + const INDEXING_TYPE_UNSPECIFIED = 0; + /** + * Column not a part of an index. + * + * Generated from protobuf enum INDEXING_TYPE_NONE = 1; + */ + const INDEXING_TYPE_NONE = 1; + /** + * Column Part of non unique index. + * + * Generated from protobuf enum INDEXING_TYPE_NON_UNIQUE = 2; + */ + const INDEXING_TYPE_NON_UNIQUE = 2; + /** + * Column part of unique index. + * + * Generated from protobuf enum INDEXING_TYPE_UNIQUE = 3; + */ + const INDEXING_TYPE_UNIQUE = 3; + /** + * Column part of the primary key. + * + * Generated from protobuf enum INDEXING_TYPE_PRIMARY_KEY = 4; + */ + const INDEXING_TYPE_PRIMARY_KEY = 4; + + private static $valueToName = [ + self::INDEXING_TYPE_UNSPECIFIED => 'INDEXING_TYPE_UNSPECIFIED', + self::INDEXING_TYPE_NONE => 'INDEXING_TYPE_NONE', + self::INDEXING_TYPE_NON_UNIQUE => 'INDEXING_TYPE_NON_UNIQUE', + self::INDEXING_TYPE_UNIQUE => 'INDEXING_TYPE_UNIQUE', + self::INDEXING_TYPE_PRIMARY_KEY => 'INDEXING_TYPE_PRIMARY_KEY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(IndexingType::class, \Google\Cloud\DataCatalog\V1\ColumnSchema_IndexingType::class); + diff --git a/DataCatalog/src/V1/ColumnSchema/LookerColumnSpec.php b/DataCatalog/src/V1/ColumnSchema/LookerColumnSpec.php new file mode 100644 index 00000000000..7a14019ca95 --- /dev/null +++ b/DataCatalog/src/V1/ColumnSchema/LookerColumnSpec.php @@ -0,0 +1,70 @@ +google.cloud.datacatalog.v1.ColumnSchema.LookerColumnSpec + */ +class LookerColumnSpec extends \Google\Protobuf\Internal\Message +{ + /** + * Looker specific column type of this column. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.ColumnSchema.LookerColumnSpec.LookerColumnType type = 1; + */ + private $type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $type + * Looker specific column type of this column. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\V1\Schema::initOnce(); + parent::__construct($data); + } + + /** + * Looker specific column type of this column. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.ColumnSchema.LookerColumnSpec.LookerColumnType type = 1; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Looker specific column type of this column. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.ColumnSchema.LookerColumnSpec.LookerColumnType type = 1; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DataCatalog\V1\ColumnSchema\LookerColumnSpec\LookerColumnType::class); + $this->type = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(LookerColumnSpec::class, \Google\Cloud\DataCatalog\V1\ColumnSchema_LookerColumnSpec::class); + diff --git a/DataCatalog/src/V1/ColumnSchema/LookerColumnSpec/LookerColumnType.php b/DataCatalog/src/V1/ColumnSchema/LookerColumnSpec/LookerColumnType.php new file mode 100644 index 00000000000..b2db79f640d --- /dev/null +++ b/DataCatalog/src/V1/ColumnSchema/LookerColumnSpec/LookerColumnType.php @@ -0,0 +1,85 @@ +google.cloud.datacatalog.v1.ColumnSchema.LookerColumnSpec.LookerColumnType + */ +class LookerColumnType +{ + /** + * Unspecified. + * + * Generated from protobuf enum LOOKER_COLUMN_TYPE_UNSPECIFIED = 0; + */ + const LOOKER_COLUMN_TYPE_UNSPECIFIED = 0; + /** + * Dimension. + * + * Generated from protobuf enum DIMENSION = 1; + */ + const DIMENSION = 1; + /** + * Dimension group - parent for Dimension. + * + * Generated from protobuf enum DIMENSION_GROUP = 2; + */ + const DIMENSION_GROUP = 2; + /** + * Filter. + * + * Generated from protobuf enum FILTER = 3; + */ + const FILTER = 3; + /** + * Measure. + * + * Generated from protobuf enum MEASURE = 4; + */ + const MEASURE = 4; + /** + * Parameter. + * + * Generated from protobuf enum PARAMETER = 5; + */ + const PARAMETER = 5; + + private static $valueToName = [ + self::LOOKER_COLUMN_TYPE_UNSPECIFIED => 'LOOKER_COLUMN_TYPE_UNSPECIFIED', + self::DIMENSION => 'DIMENSION', + self::DIMENSION_GROUP => 'DIMENSION_GROUP', + self::FILTER => 'FILTER', + self::MEASURE => 'MEASURE', + self::PARAMETER => 'PARAMETER', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(LookerColumnType::class, \Google\Cloud\DataCatalog\V1\ColumnSchema_LookerColumnSpec_LookerColumnType::class); + diff --git a/DataCatalog/src/V1/ColumnSchema_IndexingType.php b/DataCatalog/src/V1/ColumnSchema_IndexingType.php new file mode 100644 index 00000000000..695af8a3422 --- /dev/null +++ b/DataCatalog/src/V1/ColumnSchema_IndexingType.php @@ -0,0 +1,16 @@ +google.cloud.datacatalog.v1.CommonUsageStats + */ +class CommonUsageStats extends \Google\Protobuf\Internal\Message +{ + /** + * View count in source system. + * + * Generated from protobuf field optional int64 view_count = 1; + */ + private $view_count = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $view_count + * View count in source system. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\V1\Usage::initOnce(); + parent::__construct($data); + } + + /** + * View count in source system. + * + * Generated from protobuf field optional int64 view_count = 1; + * @return int|string + */ + public function getViewCount() + { + return isset($this->view_count) ? $this->view_count : 0; + } + + public function hasViewCount() + { + return isset($this->view_count); + } + + public function clearViewCount() + { + unset($this->view_count); + } + + /** + * View count in source system. + * + * Generated from protobuf field optional int64 view_count = 1; + * @param int|string $var + * @return $this + */ + public function setViewCount($var) + { + GPBUtil::checkInt64($var); + $this->view_count = $var; + + return $this; + } + +} + diff --git a/DataCatalog/src/V1/CreateEntryGroupRequest.php b/DataCatalog/src/V1/CreateEntryGroupRequest.php index dc20f45f9fe..764f3ac3764 100644 --- a/DataCatalog/src/V1/CreateEntryGroupRequest.php +++ b/DataCatalog/src/V1/CreateEntryGroupRequest.php @@ -17,7 +17,8 @@ class CreateEntryGroupRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The names of the project and location that the new entry group belongs to. + * Required. The names of the project and location that the new entry group + * belongs to. * Note: The entry group itself and its child resources might not be * stored in the location specified in its name. * @@ -47,7 +48,8 @@ class CreateEntryGroupRequest extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $parent - * Required. The names of the project and location that the new entry group belongs to. + * Required. The names of the project and location that the new entry group + * belongs to. * Note: The entry group itself and its child resources might not be * stored in the location specified in its name. * @type string $entry_group_id @@ -65,7 +67,8 @@ public function __construct($data = NULL) { } /** - * Required. The names of the project and location that the new entry group belongs to. + * Required. The names of the project and location that the new entry group + * belongs to. * Note: The entry group itself and its child resources might not be * stored in the location specified in its name. * @@ -78,7 +81,8 @@ public function getParent() } /** - * Required. The names of the project and location that the new entry group belongs to. + * Required. The names of the project and location that the new entry group + * belongs to. * Note: The entry group itself and its child resources might not be * stored in the location specified in its name. * diff --git a/DataCatalog/src/V1/DataCatalogGrpcClient.php b/DataCatalog/src/V1/DataCatalogGrpcClient.php index 500af26f62e..af9e3a64f55 100644 --- a/DataCatalog/src/V1/DataCatalogGrpcClient.php +++ b/DataCatalog/src/V1/DataCatalogGrpcClient.php @@ -578,6 +578,33 @@ public function ListTags(\Google\Cloud\DataCatalog\V1\ListTagsRequest $argument, $metadata, $options); } + /** + * `ReconcileTags` creates or updates a list of tags on the entry. + * If the + * [ReconcileTagsRequest.force_delete_missing][google.cloud.datacatalog.v1.ReconcileTagsRequest.force_delete_missing] + * parameter is set, the operation deletes tags not included in the input tag + * list. + * + * `ReconcileTags` returns a [long-running operation] + * [google.longrunning.Operation] resource that can be queried with + * [Operations.GetOperation][google.longrunning.Operations.GetOperation] + * to return [ReconcileTagsMetadata] + * [google.cloud.datacatalog.v1.ReconcileTagsMetadata] and + * a [ReconcileTagsResponse] + * [google.cloud.datacatalog.v1.ReconcileTagsResponse] message. + * @param \Google\Cloud\DataCatalog\V1\ReconcileTagsRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ReconcileTags(\Google\Cloud\DataCatalog\V1\ReconcileTagsRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.datacatalog.v1.DataCatalog/ReconcileTags', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + /** * Marks an [Entry][google.cloud.datacatalog.v1.Entry] as starred by * the current user. Starring information is private to each user. @@ -704,4 +731,36 @@ public function TestIamPermissions(\Google\Cloud\Iam\V1\TestIamPermissionsReques $metadata, $options); } + /** + * Imports entries from a source, such as data previously dumped into a + * Cloud Storage bucket, into Data Catalog. Import of entries + * is a sync operation that reconciles the state of the third-party system + * with the Data Catalog. + * + * `ImportEntries` accepts source data snapshots of a third-party system. + * Snapshot should be delivered as a .wire or base65-encoded .txt file + * containing a sequence of Protocol Buffer messages of + * [DumpItem][google.cloud.datacatalog.v1.DumpItem] type. + * + * `ImportEntries` returns a [long-running operation] + * [google.longrunning.Operation] resource that can be queried with + * [Operations.GetOperation][google.longrunning.Operations.GetOperation] + * to return + * [ImportEntriesMetadata][google.cloud.datacatalog.v1.ImportEntriesMetadata] + * and an + * [ImportEntriesResponse][google.cloud.datacatalog.v1.ImportEntriesResponse] + * message. + * @param \Google\Cloud\DataCatalog\V1\ImportEntriesRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ImportEntries(\Google\Cloud\DataCatalog\V1\ImportEntriesRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.datacatalog.v1.DataCatalog/ImportEntries', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + } diff --git a/DataCatalog/src/V1/DatabaseTableSpec.php b/DataCatalog/src/V1/DatabaseTableSpec.php index 12303b37573..6ecae00388b 100644 --- a/DataCatalog/src/V1/DatabaseTableSpec.php +++ b/DataCatalog/src/V1/DatabaseTableSpec.php @@ -29,6 +29,13 @@ class DatabaseTableSpec extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.datacatalog.v1.DataplexTableSpec dataplex_table = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ private $dataplex_table = null; + /** + * Spec what aplies to tables that are actually views. + * Not set for "real" tables. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.DatabaseTableSpec.DatabaseViewSpec database_view_spec = 3; + */ + private $database_view_spec = null; /** * Constructor. @@ -41,6 +48,9 @@ class DatabaseTableSpec extends \Google\Protobuf\Internal\Message * @type \Google\Cloud\DataCatalog\V1\DataplexTableSpec $dataplex_table * Output only. Fields specific to a Dataplex table and present only in the * Dataplex table entries. + * @type \Google\Cloud\DataCatalog\V1\DatabaseTableSpec\DatabaseViewSpec $database_view_spec + * Spec what aplies to tables that are actually views. + * Not set for "real" tables. * } */ public function __construct($data = NULL) { @@ -112,5 +122,43 @@ public function setDataplexTable($var) return $this; } + /** + * Spec what aplies to tables that are actually views. + * Not set for "real" tables. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.DatabaseTableSpec.DatabaseViewSpec database_view_spec = 3; + * @return \Google\Cloud\DataCatalog\V1\DatabaseTableSpec\DatabaseViewSpec|null + */ + public function getDatabaseViewSpec() + { + return $this->database_view_spec; + } + + public function hasDatabaseViewSpec() + { + return isset($this->database_view_spec); + } + + public function clearDatabaseViewSpec() + { + unset($this->database_view_spec); + } + + /** + * Spec what aplies to tables that are actually views. + * Not set for "real" tables. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.DatabaseTableSpec.DatabaseViewSpec database_view_spec = 3; + * @param \Google\Cloud\DataCatalog\V1\DatabaseTableSpec\DatabaseViewSpec $var + * @return $this + */ + public function setDatabaseViewSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\V1\DatabaseTableSpec\DatabaseViewSpec::class); + $this->database_view_spec = $var; + + return $this; + } + } diff --git a/DataCatalog/src/V1/DatabaseTableSpec/DatabaseViewSpec.php b/DataCatalog/src/V1/DatabaseTableSpec/DatabaseViewSpec.php new file mode 100644 index 00000000000..cebdd3da1be --- /dev/null +++ b/DataCatalog/src/V1/DatabaseTableSpec/DatabaseViewSpec.php @@ -0,0 +1,145 @@ +google.cloud.datacatalog.v1.DatabaseTableSpec.DatabaseViewSpec + */ +class DatabaseViewSpec extends \Google\Protobuf\Internal\Message +{ + /** + * Type of this view. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.DatabaseTableSpec.DatabaseViewSpec.ViewType view_type = 1; + */ + private $view_type = 0; + protected $source_definition; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $view_type + * Type of this view. + * @type string $base_table + * Name of a singular table this view reflects one to one. + * @type string $sql_query + * SQL query used to generate this view. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\V1\Datacatalog::initOnce(); + parent::__construct($data); + } + + /** + * Type of this view. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.DatabaseTableSpec.DatabaseViewSpec.ViewType view_type = 1; + * @return int + */ + public function getViewType() + { + return $this->view_type; + } + + /** + * Type of this view. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.DatabaseTableSpec.DatabaseViewSpec.ViewType view_type = 1; + * @param int $var + * @return $this + */ + public function setViewType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DataCatalog\V1\DatabaseTableSpec\DatabaseViewSpec\ViewType::class); + $this->view_type = $var; + + return $this; + } + + /** + * Name of a singular table this view reflects one to one. + * + * Generated from protobuf field string base_table = 2; + * @return string + */ + public function getBaseTable() + { + return $this->readOneof(2); + } + + public function hasBaseTable() + { + return $this->hasOneof(2); + } + + /** + * Name of a singular table this view reflects one to one. + * + * Generated from protobuf field string base_table = 2; + * @param string $var + * @return $this + */ + public function setBaseTable($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * SQL query used to generate this view. + * + * Generated from protobuf field string sql_query = 3; + * @return string + */ + public function getSqlQuery() + { + return $this->readOneof(3); + } + + public function hasSqlQuery() + { + return $this->hasOneof(3); + } + + /** + * SQL query used to generate this view. + * + * Generated from protobuf field string sql_query = 3; + * @param string $var + * @return $this + */ + public function setSqlQuery($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getSourceDefinition() + { + return $this->whichOneof("source_definition"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DatabaseViewSpec::class, \Google\Cloud\DataCatalog\V1\DatabaseTableSpec_DatabaseViewSpec::class); + diff --git a/DataCatalog/src/V1/DatabaseTableSpec/DatabaseViewSpec/ViewType.php b/DataCatalog/src/V1/DatabaseTableSpec/DatabaseViewSpec/ViewType.php new file mode 100644 index 00000000000..6e0092c6b21 --- /dev/null +++ b/DataCatalog/src/V1/DatabaseTableSpec/DatabaseViewSpec/ViewType.php @@ -0,0 +1,64 @@ +google.cloud.datacatalog.v1.DatabaseTableSpec.DatabaseViewSpec.ViewType + */ +class ViewType +{ + /** + * Default unknown view type. + * + * Generated from protobuf enum VIEW_TYPE_UNSPECIFIED = 0; + */ + const VIEW_TYPE_UNSPECIFIED = 0; + /** + * Standard view. + * + * Generated from protobuf enum STANDARD_VIEW = 1; + */ + const STANDARD_VIEW = 1; + /** + * Materialized view. + * + * Generated from protobuf enum MATERIALIZED_VIEW = 2; + */ + const MATERIALIZED_VIEW = 2; + + private static $valueToName = [ + self::VIEW_TYPE_UNSPECIFIED => 'VIEW_TYPE_UNSPECIFIED', + self::STANDARD_VIEW => 'STANDARD_VIEW', + self::MATERIALIZED_VIEW => 'MATERIALIZED_VIEW', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ViewType::class, \Google\Cloud\DataCatalog\V1\DatabaseTableSpec_DatabaseViewSpec_ViewType::class); + diff --git a/DataCatalog/src/V1/DatabaseTableSpec_DatabaseViewSpec.php b/DataCatalog/src/V1/DatabaseTableSpec_DatabaseViewSpec.php new file mode 100644 index 00000000000..c43167a2aee --- /dev/null +++ b/DataCatalog/src/V1/DatabaseTableSpec_DatabaseViewSpec.php @@ -0,0 +1,16 @@ +google.cloud.datacatalog.v1.DumpItem + */ +class DumpItem extends \Google\Protobuf\Internal\Message +{ + protected $item; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DataCatalog\V1\TaggedEntry $tagged_entry + * Entry and its tags. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\V1\DumpContent::initOnce(); + parent::__construct($data); + } + + /** + * Entry and its tags. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.TaggedEntry tagged_entry = 1; + * @return \Google\Cloud\DataCatalog\V1\TaggedEntry|null + */ + public function getTaggedEntry() + { + return $this->readOneof(1); + } + + public function hasTaggedEntry() + { + return $this->hasOneof(1); + } + + /** + * Entry and its tags. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.TaggedEntry tagged_entry = 1; + * @param \Google\Cloud\DataCatalog\V1\TaggedEntry $var + * @return $this + */ + public function setTaggedEntry($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\V1\TaggedEntry::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getItem() + { + return $this->whichOneof("item"); + } + +} + diff --git a/DataCatalog/src/V1/Entry.php b/DataCatalog/src/V1/Entry.php index b62debe21f4..738f3ad3d99 100644 --- a/DataCatalog/src/V1/Entry.php +++ b/DataCatalog/src/V1/Entry.php @@ -66,9 +66,7 @@ class Entry extends \Google\Protobuf\Internal\Message private $fully_qualified_name = ''; /** * Display name of an entry. - * The name must contain only Unicode letters, numbers (0-9), underscores (_), - * dashes (-), spaces ( ), and can't start or end with spaces. - * The maximum size is 200 bytes when encoded in UTF-8. + * The maximum size is 500 bytes when encoded in UTF-8. * Default value is an empty string. * * Generated from protobuf field string display_name = 3; @@ -130,13 +128,15 @@ class Entry extends \Google\Protobuf\Internal\Message */ private $data_source = null; /** - * Output only. Additional information related to the entry. Private to the current user. + * Output only. Additional information related to the entry. Private to the + * current user. * * Generated from protobuf field .google.cloud.datacatalog.v1.PersonalDetails personal_details = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ private $personal_details = null; protected $entry_type; protected $system; + protected $system_spec; protected $type_spec; protected $spec; @@ -202,6 +202,12 @@ class Entry extends \Google\Protobuf\Internal\Message * * Must begin with a letter or underscore. * * Can only contain letters, numbers, and underscores. * * Must be at least 1 character and at most 64 characters long. + * @type \Google\Cloud\DataCatalog\V1\SqlDatabaseSystemSpec $sql_database_system_spec + * Specification that applies to a relational database system. Only settable + * when `user_specified_system` is equal to `SQL_DATABASE` + * @type \Google\Cloud\DataCatalog\V1\LookerSystemSpec $looker_system_spec + * Specification that applies to Looker sysstem. Only settable when + * `user_specified_system` is equal to `LOOKER` * @type \Google\Cloud\DataCatalog\V1\GcsFilesetSpec $gcs_fileset_spec * Specification that applies to a Cloud Storage fileset. Valid only * for entries with the `FILESET` type. @@ -215,7 +221,7 @@ class Entry extends \Google\Protobuf\Internal\Message * (https://cloud.google.com/bigquery/docs/partitioned-tables#partitioning_versus_sharding). * @type \Google\Cloud\DataCatalog\V1\DatabaseTableSpec $database_table_spec * Specification that applies to a table resource. Valid only - * for entries with the `TABLE` type. + * for entries with the `TABLE` or `EXPLORE` type. * @type \Google\Cloud\DataCatalog\V1\DataSourceConnectionSpec $data_source_connection_spec * Specification that applies to a data source connection. Valid only * for entries with the `DATA_SOURCE_CONNECTION` type. @@ -227,9 +233,7 @@ class Entry extends \Google\Protobuf\Internal\Message * for entries with the `FILESET` type. * @type string $display_name * Display name of an entry. - * The name must contain only Unicode letters, numbers (0-9), underscores (_), - * dashes (-), spaces ( ), and can't start or end with spaces. - * The maximum size is 200 bytes when encoded in UTF-8. + * The maximum size is 500 bytes when encoded in UTF-8. * Default value is an empty string. * @type string $description * Entry description that can consist of several sentences or paragraphs @@ -259,7 +263,8 @@ class Entry extends \Google\Protobuf\Internal\Message * @type \Google\Cloud\DataCatalog\V1\DataSource $data_source * Output only. Physical location of the entry. * @type \Google\Cloud\DataCatalog\V1\PersonalDetails $personal_details - * Output only. Additional information related to the entry. Private to the current user. + * Output only. Additional information related to the entry. Private to the + * current user. * } */ public function __construct($data = NULL) { @@ -553,6 +558,72 @@ public function setUserSpecifiedSystem($var) return $this; } + /** + * Specification that applies to a relational database system. Only settable + * when `user_specified_system` is equal to `SQL_DATABASE` + * + * Generated from protobuf field .google.cloud.datacatalog.v1.SqlDatabaseSystemSpec sql_database_system_spec = 39; + * @return \Google\Cloud\DataCatalog\V1\SqlDatabaseSystemSpec|null + */ + public function getSqlDatabaseSystemSpec() + { + return $this->readOneof(39); + } + + public function hasSqlDatabaseSystemSpec() + { + return $this->hasOneof(39); + } + + /** + * Specification that applies to a relational database system. Only settable + * when `user_specified_system` is equal to `SQL_DATABASE` + * + * Generated from protobuf field .google.cloud.datacatalog.v1.SqlDatabaseSystemSpec sql_database_system_spec = 39; + * @param \Google\Cloud\DataCatalog\V1\SqlDatabaseSystemSpec $var + * @return $this + */ + public function setSqlDatabaseSystemSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\V1\SqlDatabaseSystemSpec::class); + $this->writeOneof(39, $var); + + return $this; + } + + /** + * Specification that applies to Looker sysstem. Only settable when + * `user_specified_system` is equal to `LOOKER` + * + * Generated from protobuf field .google.cloud.datacatalog.v1.LookerSystemSpec looker_system_spec = 40; + * @return \Google\Cloud\DataCatalog\V1\LookerSystemSpec|null + */ + public function getLookerSystemSpec() + { + return $this->readOneof(40); + } + + public function hasLookerSystemSpec() + { + return $this->hasOneof(40); + } + + /** + * Specification that applies to Looker sysstem. Only settable when + * `user_specified_system` is equal to `LOOKER` + * + * Generated from protobuf field .google.cloud.datacatalog.v1.LookerSystemSpec looker_system_spec = 40; + * @param \Google\Cloud\DataCatalog\V1\LookerSystemSpec $var + * @return $this + */ + public function setLookerSystemSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\V1\LookerSystemSpec::class); + $this->writeOneof(40, $var); + + return $this; + } + /** * Specification that applies to a Cloud Storage fileset. Valid only * for entries with the `FILESET` type. @@ -658,7 +729,7 @@ public function setBigqueryDateShardedSpec($var) /** * Specification that applies to a table resource. Valid only - * for entries with the `TABLE` type. + * for entries with the `TABLE` or `EXPLORE` type. * * Generated from protobuf field .google.cloud.datacatalog.v1.DatabaseTableSpec database_table_spec = 24; * @return \Google\Cloud\DataCatalog\V1\DatabaseTableSpec|null @@ -675,7 +746,7 @@ public function hasDatabaseTableSpec() /** * Specification that applies to a table resource. Valid only - * for entries with the `TABLE` type. + * for entries with the `TABLE` or `EXPLORE` type. * * Generated from protobuf field .google.cloud.datacatalog.v1.DatabaseTableSpec database_table_spec = 24; * @param \Google\Cloud\DataCatalog\V1\DatabaseTableSpec $var @@ -790,9 +861,7 @@ public function setFilesetSpec($var) /** * Display name of an entry. - * The name must contain only Unicode letters, numbers (0-9), underscores (_), - * dashes (-), spaces ( ), and can't start or end with spaces. - * The maximum size is 200 bytes when encoded in UTF-8. + * The maximum size is 500 bytes when encoded in UTF-8. * Default value is an empty string. * * Generated from protobuf field string display_name = 3; @@ -805,9 +874,7 @@ public function getDisplayName() /** * Display name of an entry. - * The name must contain only Unicode letters, numbers (0-9), underscores (_), - * dashes (-), spaces ( ), and can't start or end with spaces. - * The maximum size is 200 bytes when encoded in UTF-8. + * The maximum size is 500 bytes when encoded in UTF-8. * Default value is an empty string. * * Generated from protobuf field string display_name = 3; @@ -1081,7 +1148,8 @@ public function setDataSource($var) } /** - * Output only. Additional information related to the entry. Private to the current user. + * Output only. Additional information related to the entry. Private to the + * current user. * * Generated from protobuf field .google.cloud.datacatalog.v1.PersonalDetails personal_details = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return \Google\Cloud\DataCatalog\V1\PersonalDetails|null @@ -1102,7 +1170,8 @@ public function clearPersonalDetails() } /** - * Output only. Additional information related to the entry. Private to the current user. + * Output only. Additional information related to the entry. Private to the + * current user. * * Generated from protobuf field .google.cloud.datacatalog.v1.PersonalDetails personal_details = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param \Google\Cloud\DataCatalog\V1\PersonalDetails $var @@ -1132,6 +1201,14 @@ public function getSystem() return $this->whichOneof("system"); } + /** + * @return string + */ + public function getSystemSpec() + { + return $this->whichOneof("system_spec"); + } + /** * @return string */ diff --git a/DataCatalog/src/V1/EntryType.php b/DataCatalog/src/V1/EntryType.php index 1e18ccc6e3c..905e712fff9 100644 --- a/DataCatalog/src/V1/EntryType.php +++ b/DataCatalog/src/V1/EntryType.php @@ -91,6 +91,34 @@ class EntryType * Generated from protobuf enum SERVICE = 14; */ const SERVICE = 14; + /** + * Schema within a relational database. + * + * Generated from protobuf enum DATABASE_SCHEMA = 15; + */ + const DATABASE_SCHEMA = 15; + /** + * A Dashboard, for example from Looker. + * + * Generated from protobuf enum DASHBOARD = 16; + */ + const DASHBOARD = 16; + /** + * A Looker Explore. + * For more information, see [Looker Explore API] + * (https://developers.looker.com/api/explorer/4.0/methods/LookmlModel/lookml_model_explore). + * + * Generated from protobuf enum EXPLORE = 17; + */ + const EXPLORE = 17; + /** + * A Looker Look. + * For more information, see [Looker Look API] + * (https://developers.looker.com/api/explorer/4.0/methods/Look). + * + * Generated from protobuf enum LOOK = 18; + */ + const LOOK = 18; private static $valueToName = [ self::ENTRY_TYPE_UNSPECIFIED => 'ENTRY_TYPE_UNSPECIFIED', @@ -105,6 +133,10 @@ class EntryType self::LAKE => 'LAKE', self::ZONE => 'ZONE', self::SERVICE => 'SERVICE', + self::DATABASE_SCHEMA => 'DATABASE_SCHEMA', + self::DASHBOARD => 'DASHBOARD', + self::EXPLORE => 'EXPLORE', + self::LOOK => 'LOOK', ]; public static function name($value) diff --git a/DataCatalog/src/V1/ExportTaxonomiesRequest.php b/DataCatalog/src/V1/ExportTaxonomiesRequest.php index ade75e309e9..6e9d950c6f9 100644 --- a/DataCatalog/src/V1/ExportTaxonomiesRequest.php +++ b/DataCatalog/src/V1/ExportTaxonomiesRequest.php @@ -17,7 +17,8 @@ class ExportTaxonomiesRequest extends \Google\Protobuf\Internal\Message { /** - * Required. Resource name of the project that the exported taxonomies belong to. + * Required. Resource name of the project that the exported taxonomies belong + * to. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -37,7 +38,8 @@ class ExportTaxonomiesRequest extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $parent - * Required. Resource name of the project that the exported taxonomies belong to. + * Required. Resource name of the project that the exported taxonomies belong + * to. * @type array|\Google\Protobuf\Internal\RepeatedField $taxonomies * Required. Resource names of the taxonomies to export. * @type bool $serialized_taxonomies @@ -51,7 +53,8 @@ public function __construct($data = NULL) { } /** - * Required. Resource name of the project that the exported taxonomies belong to. + * Required. Resource name of the project that the exported taxonomies belong + * to. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -62,7 +65,8 @@ public function getParent() } /** - * Required. Resource name of the project that the exported taxonomies belong to. + * Required. Resource name of the project that the exported taxonomies belong + * to. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/DataCatalog/src/V1/FieldType/EnumType/EnumValue.php b/DataCatalog/src/V1/FieldType/EnumType/EnumValue.php index d9e32c55b32..a94ffb849e4 100644 --- a/DataCatalog/src/V1/FieldType/EnumType/EnumValue.php +++ b/DataCatalog/src/V1/FieldType/EnumType/EnumValue.php @@ -14,7 +14,8 @@ class EnumValue extends \Google\Protobuf\Internal\Message { /** - * Required. The display name of the enum value. Must not be an empty string. + * Required. The display name of the enum value. Must not be an empty + * string. * The name must contain only Unicode letters, numbers (0-9), underscores * (_), dashes (-), spaces ( ), and can't start or end with spaces. The * maximum length is 200 characters. @@ -30,7 +31,8 @@ class EnumValue extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $display_name - * Required. The display name of the enum value. Must not be an empty string. + * Required. The display name of the enum value. Must not be an empty + * string. * The name must contain only Unicode letters, numbers (0-9), underscores * (_), dashes (-), spaces ( ), and can't start or end with spaces. The * maximum length is 200 characters. @@ -42,7 +44,8 @@ public function __construct($data = NULL) { } /** - * Required. The display name of the enum value. Must not be an empty string. + * Required. The display name of the enum value. Must not be an empty + * string. * The name must contain only Unicode letters, numbers (0-9), underscores * (_), dashes (-), spaces ( ), and can't start or end with spaces. The * maximum length is 200 characters. @@ -56,7 +59,8 @@ public function getDisplayName() } /** - * Required. The display name of the enum value. Must not be an empty string. + * Required. The display name of the enum value. Must not be an empty + * string. * The name must contain only Unicode letters, numbers (0-9), underscores * (_), dashes (-), spaces ( ), and can't start or end with spaces. The * maximum length is 200 characters. diff --git a/DataCatalog/src/V1/Gapic/DataCatalogGapicClient.php b/DataCatalog/src/V1/Gapic/DataCatalogGapicClient.php index f044b223a97..aad9312215f 100644 --- a/DataCatalog/src/V1/Gapic/DataCatalogGapicClient.php +++ b/DataCatalog/src/V1/Gapic/DataCatalogGapicClient.php @@ -27,6 +27,8 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\GapicClientTrait; +use Google\ApiCore\LongRunning\OperationsClient; +use Google\ApiCore\OperationResponse; use Google\ApiCore\PathTemplate; use Google\ApiCore\RequestParamsHeaderDescriptor; use Google\ApiCore\RetrySettings; @@ -50,6 +52,9 @@ use Google\Cloud\DataCatalog\V1\GetEntryGroupRequest; use Google\Cloud\DataCatalog\V1\GetEntryRequest; use Google\Cloud\DataCatalog\V1\GetTagTemplateRequest; +use Google\Cloud\DataCatalog\V1\ImportEntriesMetadata; +use Google\Cloud\DataCatalog\V1\ImportEntriesRequest; +use Google\Cloud\DataCatalog\V1\ImportEntriesResponse; use Google\Cloud\DataCatalog\V1\ListEntriesRequest; use Google\Cloud\DataCatalog\V1\ListEntriesResponse; use Google\Cloud\DataCatalog\V1\ListEntryGroupsRequest; @@ -59,6 +64,9 @@ use Google\Cloud\DataCatalog\V1\LookupEntryRequest; use Google\Cloud\DataCatalog\V1\ModifyEntryContactsRequest; use Google\Cloud\DataCatalog\V1\ModifyEntryOverviewRequest; +use Google\Cloud\DataCatalog\V1\ReconcileTagsMetadata; +use Google\Cloud\DataCatalog\V1\ReconcileTagsRequest; +use Google\Cloud\DataCatalog\V1\ReconcileTagsResponse; use Google\Cloud\DataCatalog\V1\RenameTagTemplateFieldEnumValueRequest; use Google\Cloud\DataCatalog\V1\RenameTagTemplateFieldRequest; use Google\Cloud\DataCatalog\V1\SearchCatalogRequest; @@ -82,6 +90,7 @@ use Google\Cloud\Iam\V1\SetIamPolicyRequest; use Google\Cloud\Iam\V1\TestIamPermissionsRequest; use Google\Cloud\Iam\V1\TestIamPermissionsResponse; +use Google\LongRunning\Operation; use Google\Protobuf\FieldMask; use Google\Protobuf\GPBEmpty; @@ -146,6 +155,8 @@ class DataCatalogGapicClient private static $pathTemplateMap; + private $operationsClient; + private static function getClientDefaults() { return [ @@ -435,6 +446,35 @@ public static function parseName($formattedName, $template = null) throw new ValidationException("Input did not match any known format. Input: $formattedName"); } + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + /** * Constructor. * @@ -493,6 +533,7 @@ public function __construct(array $options = []) { $clientOptions = $this->buildClientOptions($options); $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); } /** @@ -598,7 +639,8 @@ public function createEntry($parent, $entryId, $entry, array $optionalArgs = []) * } * ``` * - * @param string $parent Required. The names of the project and location that the new entry group belongs to. + * @param string $parent Required. The names of the project and location that the new entry group + * belongs to. * * Note: The entry group itself and its child resources might not be * stored in the location specified in its name. @@ -1223,6 +1265,93 @@ public function getTagTemplate($name, array $optionalArgs = []) return $this->startCall('GetTagTemplate', TagTemplate::class, $optionalArgs, $request)->wait(); } + /** + * Imports entries from a source, such as data previously dumped into a + * Cloud Storage bucket, into Data Catalog. Import of entries + * is a sync operation that reconciles the state of the third-party system + * with the Data Catalog. + * + * `ImportEntries` accepts source data snapshots of a third-party system. + * Snapshot should be delivered as a .wire or base65-encoded .txt file + * containing a sequence of Protocol Buffer messages of + * [DumpItem][google.cloud.datacatalog.v1.DumpItem] type. + * + * `ImportEntries` returns a [long-running operation] + * [google.longrunning.Operation] resource that can be queried with + * [Operations.GetOperation][google.longrunning.Operations.GetOperation] + * to return + * [ImportEntriesMetadata][google.cloud.datacatalog.v1.ImportEntriesMetadata] + * and an + * [ImportEntriesResponse][google.cloud.datacatalog.v1.ImportEntriesResponse] + * message. + * + * Sample code: + * ``` + * $dataCatalogClient = new DataCatalogClient(); + * try { + * $formattedParent = $dataCatalogClient->entryGroupName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]'); + * $operationResponse = $dataCatalogClient->importEntries($formattedParent); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $dataCatalogClient->importEntries($formattedParent); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $dataCatalogClient->resumeOperation($operationName, 'importEntries'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $dataCatalogClient->close(); + * } + * ``` + * + * @param string $parent Required. Target entry group for ingested entries. + * @param array $optionalArgs { + * Optional. + * + * @type string $gcsBucketPath + * Path to a Cloud Storage bucket that contains a dump ready for ingestion. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function importEntries($parent, array $optionalArgs = []) + { + $request = new ImportEntriesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['gcsBucketPath'])) { + $request->setGcsBucketPath($optionalArgs['gcsBucketPath']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('ImportEntries', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + /** * Lists entries. * @@ -1628,6 +1757,102 @@ public function modifyEntryOverview($name, $entryOverview, array $optionalArgs = return $this->startCall('ModifyEntryOverview', EntryOverview::class, $optionalArgs, $request)->wait(); } + /** + * `ReconcileTags` creates or updates a list of tags on the entry. + * If the + * [ReconcileTagsRequest.force_delete_missing][google.cloud.datacatalog.v1.ReconcileTagsRequest.force_delete_missing] + * parameter is set, the operation deletes tags not included in the input tag + * list. + * + * `ReconcileTags` returns a [long-running operation] + * [google.longrunning.Operation] resource that can be queried with + * [Operations.GetOperation][google.longrunning.Operations.GetOperation] + * to return [ReconcileTagsMetadata] + * [google.cloud.datacatalog.v1.ReconcileTagsMetadata] and + * a [ReconcileTagsResponse] + * [google.cloud.datacatalog.v1.ReconcileTagsResponse] message. + * + * Sample code: + * ``` + * $dataCatalogClient = new DataCatalogClient(); + * try { + * $formattedParent = $dataCatalogClient->entryName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]', '[ENTRY]'); + * $formattedTagTemplate = $dataCatalogClient->tagTemplateName('[PROJECT]', '[LOCATION]', '[TAG_TEMPLATE]'); + * $operationResponse = $dataCatalogClient->reconcileTags($formattedParent, $formattedTagTemplate); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $dataCatalogClient->reconcileTags($formattedParent, $formattedTagTemplate); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $dataCatalogClient->resumeOperation($operationName, 'reconcileTags'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $dataCatalogClient->close(); + * } + * ``` + * + * @param string $parent Required. Name of [Entry][google.cloud.datacatalog.v1.Entry] to be tagged. + * @param string $tagTemplate Required. The name of the tag template, which is used for reconciliation. + * @param array $optionalArgs { + * Optional. + * + * @type bool $forceDeleteMissing + * If set to `true`, deletes entry tags related to a tag template + * not listed in the tags source from an entry. If set to `false`, + * unlisted tags are retained. + * @type Tag[] $tags + * A list of tags to apply to an entry. A tag can specify a + * tag template, which must be the template specified in the + * `ReconcileTagsRequest`. + * The sole entry and each of its columns must be mentioned at most once. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function reconcileTags($parent, $tagTemplate, array $optionalArgs = []) + { + $request = new ReconcileTagsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setTagTemplate($tagTemplate); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['forceDeleteMissing'])) { + $request->setForceDeleteMissing($optionalArgs['forceDeleteMissing']); + } + + if (isset($optionalArgs['tags'])) { + $request->setTags($optionalArgs['tags']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('ReconcileTags', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + /** * Renames a field in a tag template. * @@ -1648,7 +1873,8 @@ public function modifyEntryOverview($name, $entryOverview, array $optionalArgs = * ``` * * @param string $name Required. The name of the tag template field. - * @param string $newTagTemplateFieldId Required. The new ID of this tag template field. For example, `my_new_field`. + * @param string $newTagTemplateFieldId Required. The new ID of this tag template field. For example, + * `my_new_field`. * @param array $optionalArgs { * Optional. * @@ -1692,7 +1918,8 @@ public function renameTagTemplateField($name, $newTagTemplateFieldId, array $opt * ``` * * @param string $name Required. The name of the enum field value. - * @param string $newEnumValueDisplayName Required. The new display name of the enum value. For example, `my_new_enum_value`. + * @param string $newEnumValueDisplayName Required. The new display name of the enum value. For example, + * `my_new_enum_value`. * @param array $optionalArgs { * Optional. * @@ -1764,9 +1991,8 @@ public function renameTagTemplateFieldEnumValue($name, $newEnumValueDisplayName, * The `scope` is invalid if `include_org_ids`, `include_project_ids` are * empty AND `include_gcp_public_datasets` is set to `false`. In this case, * the request returns an error. - * @param string $query Optional. The query string with a minimum of 3 characters and specific syntax. - * For more information, see - * [Data Catalog search + * @param string $query Optional. The query string with a minimum of 3 characters and specific + * syntax. For more information, see [Data Catalog search * syntax](https://cloud.google.com/data-catalog/docs/how-to/search-reference). * * An empty query string returns all data assets (in the specified scope) @@ -2311,8 +2537,8 @@ public function updateTagTemplate($tagTemplate, array $optionalArgs = []) * Optional. * * @type FieldMask $updateMask - * Optional. Names of fields whose values to overwrite on an individual field of a tag - * template. The following fields are modifiable: + * Optional. Names of fields whose values to overwrite on an individual field + * of a tag template. The following fields are modifiable: * * * `display_name` * * `type.enum_type` diff --git a/DataCatalog/src/V1/Gapic/PolicyTagManagerGapicClient.php b/DataCatalog/src/V1/Gapic/PolicyTagManagerGapicClient.php index 54a119422ea..5c498e38b13 100644 --- a/DataCatalog/src/V1/Gapic/PolicyTagManagerGapicClient.php +++ b/DataCatalog/src/V1/Gapic/PolicyTagManagerGapicClient.php @@ -740,6 +740,9 @@ public function listPolicyTags($parent, array $optionalArgs = []) * If no page token is specified (the default), the first page * of values will be returned. Any page token used here must have * been generated by a previous call to the API. + * @type string $filter + * Supported field for filter is 'service' and value is 'dataplex'. + * Eg: service=dataplex. * @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 @@ -764,6 +767,10 @@ public function listTaxonomies($parent, array $optionalArgs = []) $request->setPageToken($optionalArgs['pageToken']); } + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); return $this->getPagedListResponse('ListTaxonomies', $optionalArgs, ListTaxonomiesResponse::class, $request); diff --git a/DataCatalog/src/V1/Gapic/PolicyTagManagerSerializationGapicClient.php b/DataCatalog/src/V1/Gapic/PolicyTagManagerSerializationGapicClient.php index 845ec99e7fb..c0f89c9b47a 100644 --- a/DataCatalog/src/V1/Gapic/PolicyTagManagerSerializationGapicClient.php +++ b/DataCatalog/src/V1/Gapic/PolicyTagManagerSerializationGapicClient.php @@ -306,7 +306,8 @@ public function __construct(array $options = []) * } * ``` * - * @param string $parent Required. Resource name of the project that the exported taxonomies belong to. + * @param string $parent Required. Resource name of the project that the exported taxonomies belong + * to. * @param string[] $taxonomies Required. Resource names of the taxonomies to export. * @param array $optionalArgs { * Optional. @@ -361,7 +362,8 @@ public function exportTaxonomies($parent, $taxonomies, array $optionalArgs = []) * } * ``` * - * @param string $parent Required. Resource name of project that the imported taxonomies will belong to. + * @param string $parent Required. Resource name of project that the imported taxonomies will belong + * to. * @param array $optionalArgs { * Optional. * diff --git a/DataCatalog/src/V1/GcsFileSpec.php b/DataCatalog/src/V1/GcsFileSpec.php index 9c823c862d1..00c6e1810c3 100644 --- a/DataCatalog/src/V1/GcsFileSpec.php +++ b/DataCatalog/src/V1/GcsFileSpec.php @@ -22,7 +22,8 @@ class GcsFileSpec extends \Google\Protobuf\Internal\Message */ private $file_path = ''; /** - * Output only. Creation, modification, and expiration timestamps of a Cloud Storage file. + * Output only. Creation, modification, and expiration timestamps of a Cloud + * Storage file. * * Generated from protobuf field .google.cloud.datacatalog.v1.SystemTimestamps gcs_timestamps = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ @@ -43,7 +44,8 @@ class GcsFileSpec extends \Google\Protobuf\Internal\Message * @type string $file_path * Required. Full file path. Example: `gs://bucket_name/a/b.txt`. * @type \Google\Cloud\DataCatalog\V1\SystemTimestamps $gcs_timestamps - * Output only. Creation, modification, and expiration timestamps of a Cloud Storage file. + * Output only. Creation, modification, and expiration timestamps of a Cloud + * Storage file. * @type int|string $size_bytes * Output only. File size in bytes. * } @@ -80,7 +82,8 @@ public function setFilePath($var) } /** - * Output only. Creation, modification, and expiration timestamps of a Cloud Storage file. + * Output only. Creation, modification, and expiration timestamps of a Cloud + * Storage file. * * Generated from protobuf field .google.cloud.datacatalog.v1.SystemTimestamps gcs_timestamps = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return \Google\Cloud\DataCatalog\V1\SystemTimestamps|null @@ -101,7 +104,8 @@ public function clearGcsTimestamps() } /** - * Output only. Creation, modification, and expiration timestamps of a Cloud Storage file. + * Output only. Creation, modification, and expiration timestamps of a Cloud + * Storage file. * * Generated from protobuf field .google.cloud.datacatalog.v1.SystemTimestamps gcs_timestamps = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param \Google\Cloud\DataCatalog\V1\SystemTimestamps $var diff --git a/DataCatalog/src/V1/ImportEntriesMetadata.php b/DataCatalog/src/V1/ImportEntriesMetadata.php new file mode 100644 index 00000000000..1cc567bf3a5 --- /dev/null +++ b/DataCatalog/src/V1/ImportEntriesMetadata.php @@ -0,0 +1,115 @@ +google.cloud.datacatalog.v1.ImportEntriesMetadata + */ +class ImportEntriesMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * State of the import operation. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.ImportEntriesMetadata.ImportState state = 1; + */ + private $state = 0; + /** + * Partial errors that are encountered during the ImportEntries operation. + * There is no guarantee that all the encountered errors are reported. + * However, if no errors are reported, it means that no errors were + * encountered. + * + * Generated from protobuf field repeated .google.rpc.Status errors = 2; + */ + private $errors; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $state + * State of the import operation. + * @type array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $errors + * Partial errors that are encountered during the ImportEntries operation. + * There is no guarantee that all the encountered errors are reported. + * However, if no errors are reported, it means that no errors were + * encountered. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\V1\Datacatalog::initOnce(); + parent::__construct($data); + } + + /** + * State of the import operation. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.ImportEntriesMetadata.ImportState state = 1; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * State of the import operation. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.ImportEntriesMetadata.ImportState state = 1; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DataCatalog\V1\ImportEntriesMetadata\ImportState::class); + $this->state = $var; + + return $this; + } + + /** + * Partial errors that are encountered during the ImportEntries operation. + * There is no guarantee that all the encountered errors are reported. + * However, if no errors are reported, it means that no errors were + * encountered. + * + * Generated from protobuf field repeated .google.rpc.Status errors = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getErrors() + { + return $this->errors; + } + + /** + * Partial errors that are encountered during the ImportEntries operation. + * There is no guarantee that all the encountered errors are reported. + * However, if no errors are reported, it means that no errors were + * encountered. + * + * Generated from protobuf field repeated .google.rpc.Status errors = 2; + * @param array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setErrors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class); + $this->errors = $arr; + + return $this; + } + +} + diff --git a/DataCatalog/src/V1/ImportEntriesMetadata/ImportState.php b/DataCatalog/src/V1/ImportEntriesMetadata/ImportState.php new file mode 100644 index 00000000000..00f1fae63c9 --- /dev/null +++ b/DataCatalog/src/V1/ImportEntriesMetadata/ImportState.php @@ -0,0 +1,78 @@ +google.cloud.datacatalog.v1.ImportEntriesMetadata.ImportState + */ +class ImportState +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum IMPORT_STATE_UNSPECIFIED = 0; + */ + const IMPORT_STATE_UNSPECIFIED = 0; + /** + * The dump with entries has been queued for import. + * + * Generated from protobuf enum IMPORT_QUEUED = 1; + */ + const IMPORT_QUEUED = 1; + /** + * The import of entries is in progress. + * + * Generated from protobuf enum IMPORT_IN_PROGRESS = 2; + */ + const IMPORT_IN_PROGRESS = 2; + /** + * The import of entries has been finished. + * + * Generated from protobuf enum IMPORT_DONE = 3; + */ + const IMPORT_DONE = 3; + /** + * The import of entries has been abandoned in favor of a newer request. + * + * Generated from protobuf enum IMPORT_OBSOLETE = 4; + */ + const IMPORT_OBSOLETE = 4; + + private static $valueToName = [ + self::IMPORT_STATE_UNSPECIFIED => 'IMPORT_STATE_UNSPECIFIED', + self::IMPORT_QUEUED => 'IMPORT_QUEUED', + self::IMPORT_IN_PROGRESS => 'IMPORT_IN_PROGRESS', + self::IMPORT_DONE => 'IMPORT_DONE', + self::IMPORT_OBSOLETE => 'IMPORT_OBSOLETE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ImportState::class, \Google\Cloud\DataCatalog\V1\ImportEntriesMetadata_ImportState::class); + diff --git a/DataCatalog/src/V1/ImportEntriesMetadata_ImportState.php b/DataCatalog/src/V1/ImportEntriesMetadata_ImportState.php new file mode 100644 index 00000000000..152e3adb91c --- /dev/null +++ b/DataCatalog/src/V1/ImportEntriesMetadata_ImportState.php @@ -0,0 +1,16 @@ +google.cloud.datacatalog.v1.ImportEntriesRequest + */ +class ImportEntriesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Target entry group for ingested entries. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $parent = ''; + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Target entry group for ingested entries. + * @type string $gcs_bucket_path + * Path to a Cloud Storage bucket that contains a dump ready for ingestion. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\V1\Datacatalog::initOnce(); + parent::__construct($data); + } + + /** + * Required. Target entry group for ingested entries. + * + * 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. Target entry group for ingested entries. + * + * 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; + } + + /** + * Path to a Cloud Storage bucket that contains a dump ready for ingestion. + * + * Generated from protobuf field string gcs_bucket_path = 2; + * @return string + */ + public function getGcsBucketPath() + { + return $this->readOneof(2); + } + + public function hasGcsBucketPath() + { + return $this->hasOneof(2); + } + + /** + * Path to a Cloud Storage bucket that contains a dump ready for ingestion. + * + * Generated from protobuf field string gcs_bucket_path = 2; + * @param string $var + * @return $this + */ + public function setGcsBucketPath($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/DataCatalog/src/V1/ImportEntriesResponse.php b/DataCatalog/src/V1/ImportEntriesResponse.php new file mode 100644 index 00000000000..60d60730133 --- /dev/null +++ b/DataCatalog/src/V1/ImportEntriesResponse.php @@ -0,0 +1,127 @@ +google.cloud.datacatalog.v1.ImportEntriesResponse + */ +class ImportEntriesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Cumulative number of entries created and entries updated as a result of + * import operation. + * + * Generated from protobuf field optional int64 upserted_entries_count = 5; + */ + private $upserted_entries_count = null; + /** + * Number of entries deleted as a result of import operation. + * + * Generated from protobuf field optional int64 deleted_entries_count = 6; + */ + private $deleted_entries_count = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $upserted_entries_count + * Cumulative number of entries created and entries updated as a result of + * import operation. + * @type int|string $deleted_entries_count + * Number of entries deleted as a result of import operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\V1\Datacatalog::initOnce(); + parent::__construct($data); + } + + /** + * Cumulative number of entries created and entries updated as a result of + * import operation. + * + * Generated from protobuf field optional int64 upserted_entries_count = 5; + * @return int|string + */ + public function getUpsertedEntriesCount() + { + return isset($this->upserted_entries_count) ? $this->upserted_entries_count : 0; + } + + public function hasUpsertedEntriesCount() + { + return isset($this->upserted_entries_count); + } + + public function clearUpsertedEntriesCount() + { + unset($this->upserted_entries_count); + } + + /** + * Cumulative number of entries created and entries updated as a result of + * import operation. + * + * Generated from protobuf field optional int64 upserted_entries_count = 5; + * @param int|string $var + * @return $this + */ + public function setUpsertedEntriesCount($var) + { + GPBUtil::checkInt64($var); + $this->upserted_entries_count = $var; + + return $this; + } + + /** + * Number of entries deleted as a result of import operation. + * + * Generated from protobuf field optional int64 deleted_entries_count = 6; + * @return int|string + */ + public function getDeletedEntriesCount() + { + return isset($this->deleted_entries_count) ? $this->deleted_entries_count : 0; + } + + public function hasDeletedEntriesCount() + { + return isset($this->deleted_entries_count); + } + + public function clearDeletedEntriesCount() + { + unset($this->deleted_entries_count); + } + + /** + * Number of entries deleted as a result of import operation. + * + * Generated from protobuf field optional int64 deleted_entries_count = 6; + * @param int|string $var + * @return $this + */ + public function setDeletedEntriesCount($var) + { + GPBUtil::checkInt64($var); + $this->deleted_entries_count = $var; + + return $this; + } + +} + diff --git a/DataCatalog/src/V1/ImportTaxonomiesRequest.php b/DataCatalog/src/V1/ImportTaxonomiesRequest.php index bf41624a77c..d2934a5416c 100644 --- a/DataCatalog/src/V1/ImportTaxonomiesRequest.php +++ b/DataCatalog/src/V1/ImportTaxonomiesRequest.php @@ -17,7 +17,8 @@ class ImportTaxonomiesRequest extends \Google\Protobuf\Internal\Message { /** - * Required. Resource name of project that the imported taxonomies will belong to. + * Required. Resource name of project that the imported taxonomies will belong + * to. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -31,7 +32,8 @@ class ImportTaxonomiesRequest extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $parent - * Required. Resource name of project that the imported taxonomies will belong to. + * Required. Resource name of project that the imported taxonomies will belong + * to. * @type \Google\Cloud\DataCatalog\V1\InlineSource $inline_source * Inline source taxonomy to import. * @type \Google\Cloud\DataCatalog\V1\CrossRegionalSource $cross_regional_source @@ -44,7 +46,8 @@ public function __construct($data = NULL) { } /** - * Required. Resource name of project that the imported taxonomies will belong to. + * Required. Resource name of project that the imported taxonomies will belong + * to. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -55,7 +58,8 @@ public function getParent() } /** - * Required. Resource name of project that the imported taxonomies will belong to. + * Required. Resource name of project that the imported taxonomies will belong + * to. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/DataCatalog/src/V1/IntegratedSystem.php b/DataCatalog/src/V1/IntegratedSystem.php index 3ad12f69c9b..3dc09f85f94 100644 --- a/DataCatalog/src/V1/IntegratedSystem.php +++ b/DataCatalog/src/V1/IntegratedSystem.php @@ -43,6 +43,18 @@ class IntegratedSystem * Generated from protobuf enum DATAPLEX = 4; */ const DATAPLEX = 4; + /** + * Cloud Sql + * + * Generated from protobuf enum CLOUD_SQL = 8; + */ + const CLOUD_SQL = 8; + /** + * Looker + * + * Generated from protobuf enum LOOKER = 9; + */ + const LOOKER = 9; private static $valueToName = [ self::INTEGRATED_SYSTEM_UNSPECIFIED => 'INTEGRATED_SYSTEM_UNSPECIFIED', @@ -50,6 +62,8 @@ class IntegratedSystem self::CLOUD_PUBSUB => 'CLOUD_PUBSUB', self::DATAPROC_METASTORE => 'DATAPROC_METASTORE', self::DATAPLEX => 'DATAPLEX', + self::CLOUD_SQL => 'CLOUD_SQL', + self::LOOKER => 'LOOKER', ]; public static function name($value) diff --git a/DataCatalog/src/V1/ListTaxonomiesRequest.php b/DataCatalog/src/V1/ListTaxonomiesRequest.php index 5e1973e788c..c4ed5de57de 100644 --- a/DataCatalog/src/V1/ListTaxonomiesRequest.php +++ b/DataCatalog/src/V1/ListTaxonomiesRequest.php @@ -37,6 +37,13 @@ class ListTaxonomiesRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field string page_token = 3; */ private $page_token = ''; + /** + * Supported field for filter is 'service' and value is 'dataplex'. + * Eg: service=dataplex. + * + * Generated from protobuf field string filter = 4; + */ + private $filter = ''; /** * Constructor. @@ -53,6 +60,9 @@ class ListTaxonomiesRequest extends \Google\Protobuf\Internal\Message * The pagination token of the next results page. If not set, * the first page is returned. * The token is returned in the response to a previous list request. + * @type string $filter + * Supported field for filter is 'service' and value is 'dataplex'. + * Eg: service=dataplex. * } */ public function __construct($data = NULL) { @@ -144,5 +154,33 @@ public function setPageToken($var) return $this; } + /** + * Supported field for filter is 'service' and value is 'dataplex'. + * Eg: service=dataplex. + * + * Generated from protobuf field string filter = 4; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Supported field for filter is 'service' and value is 'dataplex'. + * Eg: service=dataplex. + * + * Generated from protobuf field string filter = 4; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + } diff --git a/DataCatalog/src/V1/LookerSystemSpec.php b/DataCatalog/src/V1/LookerSystemSpec.php new file mode 100644 index 00000000000..91ab80e66cf --- /dev/null +++ b/DataCatalog/src/V1/LookerSystemSpec.php @@ -0,0 +1,243 @@ +google.cloud.datacatalog.v1.LookerSystemSpec + */ +class LookerSystemSpec extends \Google\Protobuf\Internal\Message +{ + /** + * ID of the parent Looker Instance. Empty if it does not exist. + * Example value: `someinstance.looker.com` + * + * Generated from protobuf field string parent_instance_id = 1; + */ + private $parent_instance_id = ''; + /** + * Name of the parent Looker Instance. Empty if it does not exist. + * + * Generated from protobuf field string parent_instance_display_name = 2; + */ + private $parent_instance_display_name = ''; + /** + * ID of the parent Model. Empty if it does not exist. + * + * Generated from protobuf field string parent_model_id = 3; + */ + private $parent_model_id = ''; + /** + * Name of the parent Model. Empty if it does not exist. + * + * Generated from protobuf field string parent_model_display_name = 4; + */ + private $parent_model_display_name = ''; + /** + * ID of the parent View. Empty if it does not exist. + * + * Generated from protobuf field string parent_view_id = 5; + */ + private $parent_view_id = ''; + /** + * Name of the parent View. Empty if it does not exist. + * + * Generated from protobuf field string parent_view_display_name = 6; + */ + private $parent_view_display_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent_instance_id + * ID of the parent Looker Instance. Empty if it does not exist. + * Example value: `someinstance.looker.com` + * @type string $parent_instance_display_name + * Name of the parent Looker Instance. Empty if it does not exist. + * @type string $parent_model_id + * ID of the parent Model. Empty if it does not exist. + * @type string $parent_model_display_name + * Name of the parent Model. Empty if it does not exist. + * @type string $parent_view_id + * ID of the parent View. Empty if it does not exist. + * @type string $parent_view_display_name + * Name of the parent View. Empty if it does not exist. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\V1\Datacatalog::initOnce(); + parent::__construct($data); + } + + /** + * ID of the parent Looker Instance. Empty if it does not exist. + * Example value: `someinstance.looker.com` + * + * Generated from protobuf field string parent_instance_id = 1; + * @return string + */ + public function getParentInstanceId() + { + return $this->parent_instance_id; + } + + /** + * ID of the parent Looker Instance. Empty if it does not exist. + * Example value: `someinstance.looker.com` + * + * Generated from protobuf field string parent_instance_id = 1; + * @param string $var + * @return $this + */ + public function setParentInstanceId($var) + { + GPBUtil::checkString($var, True); + $this->parent_instance_id = $var; + + return $this; + } + + /** + * Name of the parent Looker Instance. Empty if it does not exist. + * + * Generated from protobuf field string parent_instance_display_name = 2; + * @return string + */ + public function getParentInstanceDisplayName() + { + return $this->parent_instance_display_name; + } + + /** + * Name of the parent Looker Instance. Empty if it does not exist. + * + * Generated from protobuf field string parent_instance_display_name = 2; + * @param string $var + * @return $this + */ + public function setParentInstanceDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->parent_instance_display_name = $var; + + return $this; + } + + /** + * ID of the parent Model. Empty if it does not exist. + * + * Generated from protobuf field string parent_model_id = 3; + * @return string + */ + public function getParentModelId() + { + return $this->parent_model_id; + } + + /** + * ID of the parent Model. Empty if it does not exist. + * + * Generated from protobuf field string parent_model_id = 3; + * @param string $var + * @return $this + */ + public function setParentModelId($var) + { + GPBUtil::checkString($var, True); + $this->parent_model_id = $var; + + return $this; + } + + /** + * Name of the parent Model. Empty if it does not exist. + * + * Generated from protobuf field string parent_model_display_name = 4; + * @return string + */ + public function getParentModelDisplayName() + { + return $this->parent_model_display_name; + } + + /** + * Name of the parent Model. Empty if it does not exist. + * + * Generated from protobuf field string parent_model_display_name = 4; + * @param string $var + * @return $this + */ + public function setParentModelDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->parent_model_display_name = $var; + + return $this; + } + + /** + * ID of the parent View. Empty if it does not exist. + * + * Generated from protobuf field string parent_view_id = 5; + * @return string + */ + public function getParentViewId() + { + return $this->parent_view_id; + } + + /** + * ID of the parent View. Empty if it does not exist. + * + * Generated from protobuf field string parent_view_id = 5; + * @param string $var + * @return $this + */ + public function setParentViewId($var) + { + GPBUtil::checkString($var, True); + $this->parent_view_id = $var; + + return $this; + } + + /** + * Name of the parent View. Empty if it does not exist. + * + * Generated from protobuf field string parent_view_display_name = 6; + * @return string + */ + public function getParentViewDisplayName() + { + return $this->parent_view_display_name; + } + + /** + * Name of the parent View. Empty if it does not exist. + * + * Generated from protobuf field string parent_view_display_name = 6; + * @param string $var + * @return $this + */ + public function setParentViewDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->parent_view_display_name = $var; + + return $this; + } + +} + diff --git a/DataCatalog/src/V1/ManagingSystem.php b/DataCatalog/src/V1/ManagingSystem.php new file mode 100644 index 00000000000..cb3d83bc4ae --- /dev/null +++ b/DataCatalog/src/V1/ManagingSystem.php @@ -0,0 +1,62 @@ +google.cloud.datacatalog.v1.ManagingSystem + */ +class ManagingSystem +{ + /** + * Default value + * + * Generated from protobuf enum MANAGING_SYSTEM_UNSPECIFIED = 0; + */ + const MANAGING_SYSTEM_UNSPECIFIED = 0; + /** + * Dataplex. + * + * Generated from protobuf enum MANAGING_SYSTEM_DATAPLEX = 1; + */ + const MANAGING_SYSTEM_DATAPLEX = 1; + /** + * Other + * + * Generated from protobuf enum MANAGING_SYSTEM_OTHER = 2; + */ + const MANAGING_SYSTEM_OTHER = 2; + + private static $valueToName = [ + self::MANAGING_SYSTEM_UNSPECIFIED => 'MANAGING_SYSTEM_UNSPECIFIED', + self::MANAGING_SYSTEM_DATAPLEX => 'MANAGING_SYSTEM_DATAPLEX', + self::MANAGING_SYSTEM_OTHER => 'MANAGING_SYSTEM_OTHER', + ]; + + 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/DataCatalog/src/V1/ReconcileTagsMetadata.php b/DataCatalog/src/V1/ReconcileTagsMetadata.php new file mode 100644 index 00000000000..03be4a9ff37 --- /dev/null +++ b/DataCatalog/src/V1/ReconcileTagsMetadata.php @@ -0,0 +1,107 @@ +google.cloud.datacatalog.v1.ReconcileTagsMetadata + */ +class ReconcileTagsMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * State of the reconciliation operation. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.ReconcileTagsMetadata.ReconciliationState state = 1; + */ + private $state = 0; + /** + * Maps the name of each tagged column (or empty string for a + * sole entry) to tagging operation [status][google.rpc.Status]. + * + * Generated from protobuf field map errors = 2; + */ + private $errors; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $state + * State of the reconciliation operation. + * @type array|\Google\Protobuf\Internal\MapField $errors + * Maps the name of each tagged column (or empty string for a + * sole entry) to tagging operation [status][google.rpc.Status]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\V1\Datacatalog::initOnce(); + parent::__construct($data); + } + + /** + * State of the reconciliation operation. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.ReconcileTagsMetadata.ReconciliationState state = 1; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * State of the reconciliation operation. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.ReconcileTagsMetadata.ReconciliationState state = 1; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DataCatalog\V1\ReconcileTagsMetadata\ReconciliationState::class); + $this->state = $var; + + return $this; + } + + /** + * Maps the name of each tagged column (or empty string for a + * sole entry) to tagging operation [status][google.rpc.Status]. + * + * Generated from protobuf field map errors = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getErrors() + { + return $this->errors; + } + + /** + * Maps the name of each tagged column (or empty string for a + * sole entry) to tagging operation [status][google.rpc.Status]. + * + * Generated from protobuf field map errors = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setErrors($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class); + $this->errors = $arr; + + return $this; + } + +} + diff --git a/DataCatalog/src/V1/ReconcileTagsMetadata/ReconciliationState.php b/DataCatalog/src/V1/ReconcileTagsMetadata/ReconciliationState.php new file mode 100644 index 00000000000..2f40d719bcf --- /dev/null +++ b/DataCatalog/src/V1/ReconcileTagsMetadata/ReconciliationState.php @@ -0,0 +1,71 @@ +google.cloud.datacatalog.v1.ReconcileTagsMetadata.ReconciliationState + */ +class ReconciliationState +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum RECONCILIATION_STATE_UNSPECIFIED = 0; + */ + const RECONCILIATION_STATE_UNSPECIFIED = 0; + /** + * The reconciliation has been queued and awaits for execution. + * + * Generated from protobuf enum RECONCILIATION_QUEUED = 1; + */ + const RECONCILIATION_QUEUED = 1; + /** + * The reconciliation is in progress. + * + * Generated from protobuf enum RECONCILIATION_IN_PROGRESS = 2; + */ + const RECONCILIATION_IN_PROGRESS = 2; + /** + * The reconciliation has been finished. + * + * Generated from protobuf enum RECONCILIATION_DONE = 3; + */ + const RECONCILIATION_DONE = 3; + + private static $valueToName = [ + self::RECONCILIATION_STATE_UNSPECIFIED => 'RECONCILIATION_STATE_UNSPECIFIED', + self::RECONCILIATION_QUEUED => 'RECONCILIATION_QUEUED', + self::RECONCILIATION_IN_PROGRESS => 'RECONCILIATION_IN_PROGRESS', + self::RECONCILIATION_DONE => 'RECONCILIATION_DONE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ReconciliationState::class, \Google\Cloud\DataCatalog\V1\ReconcileTagsMetadata_ReconciliationState::class); + diff --git a/DataCatalog/src/V1/ReconcileTagsMetadata_ReconciliationState.php b/DataCatalog/src/V1/ReconcileTagsMetadata_ReconciliationState.php new file mode 100644 index 00000000000..e8c53564091 --- /dev/null +++ b/DataCatalog/src/V1/ReconcileTagsMetadata_ReconciliationState.php @@ -0,0 +1,16 @@ +google.cloud.datacatalog.v1.ReconcileTagsRequest + */ +class ReconcileTagsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of [Entry][google.cloud.datacatalog.v1.Entry] to be tagged. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $parent = ''; + /** + * Required. The name of the tag template, which is used for reconciliation. + * + * Generated from protobuf field string tag_template = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $tag_template = ''; + /** + * If set to `true`, deletes entry tags related to a tag template + * not listed in the tags source from an entry. If set to `false`, + * unlisted tags are retained. + * + * Generated from protobuf field bool force_delete_missing = 3; + */ + private $force_delete_missing = false; + /** + * A list of tags to apply to an entry. A tag can specify a + * tag template, which must be the template specified in the + * `ReconcileTagsRequest`. + * The sole entry and each of its columns must be mentioned at most once. + * + * Generated from protobuf field repeated .google.cloud.datacatalog.v1.Tag tags = 4; + */ + private $tags; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Name of [Entry][google.cloud.datacatalog.v1.Entry] to be tagged. + * @type string $tag_template + * Required. The name of the tag template, which is used for reconciliation. + * @type bool $force_delete_missing + * If set to `true`, deletes entry tags related to a tag template + * not listed in the tags source from an entry. If set to `false`, + * unlisted tags are retained. + * @type array<\Google\Cloud\DataCatalog\V1\Tag>|\Google\Protobuf\Internal\RepeatedField $tags + * A list of tags to apply to an entry. A tag can specify a + * tag template, which must be the template specified in the + * `ReconcileTagsRequest`. + * The sole entry and each of its columns must be mentioned at most once. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\V1\Datacatalog::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of [Entry][google.cloud.datacatalog.v1.Entry] to be tagged. + * + * 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. Name of [Entry][google.cloud.datacatalog.v1.Entry] to be tagged. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The name of the tag template, which is used for reconciliation. + * + * Generated from protobuf field string tag_template = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getTagTemplate() + { + return $this->tag_template; + } + + /** + * Required. The name of the tag template, which is used for reconciliation. + * + * Generated from protobuf field string tag_template = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setTagTemplate($var) + { + GPBUtil::checkString($var, True); + $this->tag_template = $var; + + return $this; + } + + /** + * If set to `true`, deletes entry tags related to a tag template + * not listed in the tags source from an entry. If set to `false`, + * unlisted tags are retained. + * + * Generated from protobuf field bool force_delete_missing = 3; + * @return bool + */ + public function getForceDeleteMissing() + { + return $this->force_delete_missing; + } + + /** + * If set to `true`, deletes entry tags related to a tag template + * not listed in the tags source from an entry. If set to `false`, + * unlisted tags are retained. + * + * Generated from protobuf field bool force_delete_missing = 3; + * @param bool $var + * @return $this + */ + public function setForceDeleteMissing($var) + { + GPBUtil::checkBool($var); + $this->force_delete_missing = $var; + + return $this; + } + + /** + * A list of tags to apply to an entry. A tag can specify a + * tag template, which must be the template specified in the + * `ReconcileTagsRequest`. + * The sole entry and each of its columns must be mentioned at most once. + * + * Generated from protobuf field repeated .google.cloud.datacatalog.v1.Tag tags = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTags() + { + return $this->tags; + } + + /** + * A list of tags to apply to an entry. A tag can specify a + * tag template, which must be the template specified in the + * `ReconcileTagsRequest`. + * The sole entry and each of its columns must be mentioned at most once. + * + * Generated from protobuf field repeated .google.cloud.datacatalog.v1.Tag tags = 4; + * @param array<\Google\Cloud\DataCatalog\V1\Tag>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DataCatalog\V1\Tag::class); + $this->tags = $arr; + + return $this; + } + +} + diff --git a/DataCatalog/src/V1/ReconcileTagsResponse.php b/DataCatalog/src/V1/ReconcileTagsResponse.php new file mode 100644 index 00000000000..30b9fc03357 --- /dev/null +++ b/DataCatalog/src/V1/ReconcileTagsResponse.php @@ -0,0 +1,137 @@ +google.cloud.datacatalog.v1.ReconcileTagsResponse + */ +class ReconcileTagsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Number of tags created in the request. + * + * Generated from protobuf field int64 created_tags_count = 1; + */ + private $created_tags_count = 0; + /** + * Number of tags updated in the request. + * + * Generated from protobuf field int64 updated_tags_count = 2; + */ + private $updated_tags_count = 0; + /** + * Number of tags deleted in the request. + * + * Generated from protobuf field int64 deleted_tags_count = 3; + */ + private $deleted_tags_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $created_tags_count + * Number of tags created in the request. + * @type int|string $updated_tags_count + * Number of tags updated in the request. + * @type int|string $deleted_tags_count + * Number of tags deleted in the request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\V1\Datacatalog::initOnce(); + parent::__construct($data); + } + + /** + * Number of tags created in the request. + * + * Generated from protobuf field int64 created_tags_count = 1; + * @return int|string + */ + public function getCreatedTagsCount() + { + return $this->created_tags_count; + } + + /** + * Number of tags created in the request. + * + * Generated from protobuf field int64 created_tags_count = 1; + * @param int|string $var + * @return $this + */ + public function setCreatedTagsCount($var) + { + GPBUtil::checkInt64($var); + $this->created_tags_count = $var; + + return $this; + } + + /** + * Number of tags updated in the request. + * + * Generated from protobuf field int64 updated_tags_count = 2; + * @return int|string + */ + public function getUpdatedTagsCount() + { + return $this->updated_tags_count; + } + + /** + * Number of tags updated in the request. + * + * Generated from protobuf field int64 updated_tags_count = 2; + * @param int|string $var + * @return $this + */ + public function setUpdatedTagsCount($var) + { + GPBUtil::checkInt64($var); + $this->updated_tags_count = $var; + + return $this; + } + + /** + * Number of tags deleted in the request. + * + * Generated from protobuf field int64 deleted_tags_count = 3; + * @return int|string + */ + public function getDeletedTagsCount() + { + return $this->deleted_tags_count; + } + + /** + * Number of tags deleted in the request. + * + * Generated from protobuf field int64 deleted_tags_count = 3; + * @param int|string $var + * @return $this + */ + public function setDeletedTagsCount($var) + { + GPBUtil::checkInt64($var); + $this->deleted_tags_count = $var; + + return $this; + } + +} + diff --git a/DataCatalog/src/V1/RenameTagTemplateFieldEnumValueRequest.php b/DataCatalog/src/V1/RenameTagTemplateFieldEnumValueRequest.php index 1f2db172d73..5906ad5c4d7 100644 --- a/DataCatalog/src/V1/RenameTagTemplateFieldEnumValueRequest.php +++ b/DataCatalog/src/V1/RenameTagTemplateFieldEnumValueRequest.php @@ -23,7 +23,8 @@ class RenameTagTemplateFieldEnumValueRequest extends \Google\Protobuf\Internal\M */ private $name = ''; /** - * Required. The new display name of the enum value. For example, `my_new_enum_value`. + * Required. The new display name of the enum value. For example, + * `my_new_enum_value`. * * Generated from protobuf field string new_enum_value_display_name = 2 [(.google.api.field_behavior) = REQUIRED]; */ @@ -38,7 +39,8 @@ class RenameTagTemplateFieldEnumValueRequest extends \Google\Protobuf\Internal\M * @type string $name * Required. The name of the enum field value. * @type string $new_enum_value_display_name - * Required. The new display name of the enum value. For example, `my_new_enum_value`. + * Required. The new display name of the enum value. For example, + * `my_new_enum_value`. * } */ public function __construct($data = NULL) { @@ -73,7 +75,8 @@ public function setName($var) } /** - * Required. The new display name of the enum value. For example, `my_new_enum_value`. + * Required. The new display name of the enum value. For example, + * `my_new_enum_value`. * * Generated from protobuf field string new_enum_value_display_name = 2 [(.google.api.field_behavior) = REQUIRED]; * @return string @@ -84,7 +87,8 @@ public function getNewEnumValueDisplayName() } /** - * Required. The new display name of the enum value. For example, `my_new_enum_value`. + * Required. The new display name of the enum value. For example, + * `my_new_enum_value`. * * Generated from protobuf field string new_enum_value_display_name = 2 [(.google.api.field_behavior) = REQUIRED]; * @param string $var diff --git a/DataCatalog/src/V1/RenameTagTemplateFieldRequest.php b/DataCatalog/src/V1/RenameTagTemplateFieldRequest.php index 23ca0056ebe..24ffa6232fa 100644 --- a/DataCatalog/src/V1/RenameTagTemplateFieldRequest.php +++ b/DataCatalog/src/V1/RenameTagTemplateFieldRequest.php @@ -23,7 +23,8 @@ class RenameTagTemplateFieldRequest extends \Google\Protobuf\Internal\Message */ private $name = ''; /** - * Required. The new ID of this tag template field. For example, `my_new_field`. + * Required. The new ID of this tag template field. For example, + * `my_new_field`. * * Generated from protobuf field string new_tag_template_field_id = 2 [(.google.api.field_behavior) = REQUIRED]; */ @@ -38,7 +39,8 @@ class RenameTagTemplateFieldRequest extends \Google\Protobuf\Internal\Message * @type string $name * Required. The name of the tag template field. * @type string $new_tag_template_field_id - * Required. The new ID of this tag template field. For example, `my_new_field`. + * Required. The new ID of this tag template field. For example, + * `my_new_field`. * } */ public function __construct($data = NULL) { @@ -73,7 +75,8 @@ public function setName($var) } /** - * Required. The new ID of this tag template field. For example, `my_new_field`. + * Required. The new ID of this tag template field. For example, + * `my_new_field`. * * Generated from protobuf field string new_tag_template_field_id = 2 [(.google.api.field_behavior) = REQUIRED]; * @return string @@ -84,7 +87,8 @@ public function getNewTagTemplateFieldId() } /** - * Required. The new ID of this tag template field. For example, `my_new_field`. + * Required. The new ID of this tag template field. For example, + * `my_new_field`. * * Generated from protobuf field string new_tag_template_field_id = 2 [(.google.api.field_behavior) = REQUIRED]; * @param string $var diff --git a/DataCatalog/src/V1/SearchCatalogRequest.php b/DataCatalog/src/V1/SearchCatalogRequest.php index bd9353e9878..395e0e9f0d0 100644 --- a/DataCatalog/src/V1/SearchCatalogRequest.php +++ b/DataCatalog/src/V1/SearchCatalogRequest.php @@ -26,9 +26,8 @@ class SearchCatalogRequest extends \Google\Protobuf\Internal\Message */ private $scope = null; /** - * Optional. The query string with a minimum of 3 characters and specific syntax. - * For more information, see - * [Data Catalog search + * Optional. The query string with a minimum of 3 characters and specific + * syntax. For more information, see [Data Catalog search * syntax](https://cloud.google.com/data-catalog/docs/how-to/search-reference). * An empty query string returns all data assets (in the specified scope) * that you have access to. @@ -50,9 +49,10 @@ class SearchCatalogRequest extends \Google\Protobuf\Internal\Message */ private $page_size = 0; /** - * Optional. Pagination token that, if specified, returns the next page of search - * results. If empty, returns the first page. - * This token is returned in the [SearchCatalogResponse.next_page_token][google.cloud.datacatalog.v1.SearchCatalogResponse.next_page_token] + * Optional. Pagination token that, if specified, returns the next page of + * search results. If empty, returns the first page. + * This token is returned in the + * [SearchCatalogResponse.next_page_token][google.cloud.datacatalog.v1.SearchCatalogResponse.next_page_token] * field of the response to a previous * [SearchCatalogRequest][google.cloud.datacatalog.v1.DataCatalog.SearchCatalog] * call. @@ -84,9 +84,8 @@ class SearchCatalogRequest extends \Google\Protobuf\Internal\Message * empty AND `include_gcp_public_datasets` is set to `false`. In this case, * the request returns an error. * @type string $query - * Optional. The query string with a minimum of 3 characters and specific syntax. - * For more information, see - * [Data Catalog search + * Optional. The query string with a minimum of 3 characters and specific + * syntax. For more information, see [Data Catalog search * syntax](https://cloud.google.com/data-catalog/docs/how-to/search-reference). * An empty query string returns all data assets (in the specified scope) * that you have access to. @@ -100,9 +99,10 @@ class SearchCatalogRequest extends \Google\Protobuf\Internal\Message * The maximum number is 1000. If exceeded, throws an "invalid argument" * exception. * @type string $page_token - * Optional. Pagination token that, if specified, returns the next page of search - * results. If empty, returns the first page. - * This token is returned in the [SearchCatalogResponse.next_page_token][google.cloud.datacatalog.v1.SearchCatalogResponse.next_page_token] + * Optional. Pagination token that, if specified, returns the next page of + * search results. If empty, returns the first page. + * This token is returned in the + * [SearchCatalogResponse.next_page_token][google.cloud.datacatalog.v1.SearchCatalogResponse.next_page_token] * field of the response to a previous * [SearchCatalogRequest][google.cloud.datacatalog.v1.DataCatalog.SearchCatalog] * call. @@ -163,9 +163,8 @@ public function setScope($var) } /** - * Optional. The query string with a minimum of 3 characters and specific syntax. - * For more information, see - * [Data Catalog search + * Optional. The query string with a minimum of 3 characters and specific + * syntax. For more information, see [Data Catalog search * syntax](https://cloud.google.com/data-catalog/docs/how-to/search-reference). * An empty query string returns all data assets (in the specified scope) * that you have access to. @@ -183,9 +182,8 @@ public function getQuery() } /** - * Optional. The query string with a minimum of 3 characters and specific syntax. - * For more information, see - * [Data Catalog search + * Optional. The query string with a minimum of 3 characters and specific + * syntax. For more information, see [Data Catalog search * syntax](https://cloud.google.com/data-catalog/docs/how-to/search-reference). * An empty query string returns all data assets (in the specified scope) * that you have access to. @@ -239,9 +237,10 @@ public function setPageSize($var) } /** - * Optional. Pagination token that, if specified, returns the next page of search - * results. If empty, returns the first page. - * This token is returned in the [SearchCatalogResponse.next_page_token][google.cloud.datacatalog.v1.SearchCatalogResponse.next_page_token] + * Optional. Pagination token that, if specified, returns the next page of + * search results. If empty, returns the first page. + * This token is returned in the + * [SearchCatalogResponse.next_page_token][google.cloud.datacatalog.v1.SearchCatalogResponse.next_page_token] * field of the response to a previous * [SearchCatalogRequest][google.cloud.datacatalog.v1.DataCatalog.SearchCatalog] * call. @@ -255,9 +254,10 @@ public function getPageToken() } /** - * Optional. Pagination token that, if specified, returns the next page of search - * results. If empty, returns the first page. - * This token is returned in the [SearchCatalogResponse.next_page_token][google.cloud.datacatalog.v1.SearchCatalogResponse.next_page_token] + * Optional. Pagination token that, if specified, returns the next page of + * search results. If empty, returns the first page. + * This token is returned in the + * [SearchCatalogResponse.next_page_token][google.cloud.datacatalog.v1.SearchCatalogResponse.next_page_token] * field of the response to a previous * [SearchCatalogRequest][google.cloud.datacatalog.v1.DataCatalog.SearchCatalog] * call. diff --git a/DataCatalog/src/V1/SearchCatalogRequest/Scope.php b/DataCatalog/src/V1/SearchCatalogRequest/Scope.php index 8b110b0eda3..c175e1e7bcd 100644 --- a/DataCatalog/src/V1/SearchCatalogRequest/Scope.php +++ b/DataCatalog/src/V1/SearchCatalogRequest/Scope.php @@ -33,7 +33,7 @@ class Scope extends \Google\Protobuf\Internal\Message */ private $include_project_ids; /** - * If `true`, include Google Cloud Platform (GCP) public datasets in + * If `true`, include Google Cloud public datasets in * search results. By default, they are excluded. * See [Google Cloud Public Datasets](https://cloud.google.com/public-datasets) for more * information. @@ -42,8 +42,8 @@ class Scope extends \Google\Protobuf\Internal\Message */ private $include_gcp_public_datasets = false; /** - * Optional. The list of locations to search within. If empty, all locations are - * searched. + * Optional. The list of locations to search within. If empty, all locations + * are searched. * Returns an error if any location in the list isn't one of the [Supported * regions](https://cloud.google.com/data-catalog/docs/concepts/regions#supported_regions). * If a location is unreachable, its name is returned in the @@ -62,8 +62,8 @@ class Scope extends \Google\Protobuf\Internal\Message */ private $starred_only = false; /** - * Optional. This field is deprecated. The search mechanism for public and private tag - * templates is the same. + * Optional. This field is deprecated. The search mechanism for public and + * private tag templates is the same. * * Generated from protobuf field bool include_public_tag_templates = 19 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * @deprecated @@ -86,13 +86,13 @@ class Scope extends \Google\Protobuf\Internal\Message * For more information on the distinction between project names, IDs, and * numbers, see [Projects](https://cloud.google.com/docs/overview/#projects). * @type bool $include_gcp_public_datasets - * If `true`, include Google Cloud Platform (GCP) public datasets in + * If `true`, include Google Cloud public datasets in * search results. By default, they are excluded. * See [Google Cloud Public Datasets](https://cloud.google.com/public-datasets) for more * information. * @type array|\Google\Protobuf\Internal\RepeatedField $restricted_locations - * Optional. The list of locations to search within. If empty, all locations are - * searched. + * Optional. The list of locations to search within. If empty, all locations + * are searched. * Returns an error if any location in the list isn't one of the [Supported * regions](https://cloud.google.com/data-catalog/docs/concepts/regions#supported_regions). * If a location is unreachable, its name is returned in the @@ -103,8 +103,8 @@ class Scope extends \Google\Protobuf\Internal\Message * Optional. If `true`, search only among starred entries. * By default, all results are returned, starred or not. * @type bool $include_public_tag_templates - * Optional. This field is deprecated. The search mechanism for public and private tag - * templates is the same. + * Optional. This field is deprecated. The search mechanism for public and + * private tag templates is the same. * } */ public function __construct($data = NULL) { @@ -175,7 +175,7 @@ public function setIncludeProjectIds($var) } /** - * If `true`, include Google Cloud Platform (GCP) public datasets in + * If `true`, include Google Cloud public datasets in * search results. By default, they are excluded. * See [Google Cloud Public Datasets](https://cloud.google.com/public-datasets) for more * information. @@ -189,7 +189,7 @@ public function getIncludeGcpPublicDatasets() } /** - * If `true`, include Google Cloud Platform (GCP) public datasets in + * If `true`, include Google Cloud public datasets in * search results. By default, they are excluded. * See [Google Cloud Public Datasets](https://cloud.google.com/public-datasets) for more * information. @@ -207,8 +207,8 @@ public function setIncludeGcpPublicDatasets($var) } /** - * Optional. The list of locations to search within. If empty, all locations are - * searched. + * Optional. The list of locations to search within. If empty, all locations + * are searched. * Returns an error if any location in the list isn't one of the [Supported * regions](https://cloud.google.com/data-catalog/docs/concepts/regions#supported_regions). * If a location is unreachable, its name is returned in the @@ -225,8 +225,8 @@ public function getRestrictedLocations() } /** - * Optional. The list of locations to search within. If empty, all locations are - * searched. + * Optional. The list of locations to search within. If empty, all locations + * are searched. * Returns an error if any location in the list isn't one of the [Supported * regions](https://cloud.google.com/data-catalog/docs/concepts/regions#supported_regions). * If a location is unreachable, its name is returned in the @@ -275,8 +275,8 @@ public function setStarredOnly($var) } /** - * Optional. This field is deprecated. The search mechanism for public and private tag - * templates is the same. + * Optional. This field is deprecated. The search mechanism for public and + * private tag templates is the same. * * Generated from protobuf field bool include_public_tag_templates = 19 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * @return bool @@ -289,8 +289,8 @@ public function getIncludePublicTagTemplates() } /** - * Optional. This field is deprecated. The search mechanism for public and private tag - * templates is the same. + * Optional. This field is deprecated. The search mechanism for public and + * private tag templates is the same. * * Generated from protobuf field bool include_public_tag_templates = 19 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; * @param bool $var diff --git a/DataCatalog/src/V1/SearchCatalogResult.php b/DataCatalog/src/V1/SearchCatalogResult.php index a978d7bdba8..d39ae3d5702 100644 --- a/DataCatalog/src/V1/SearchCatalogResult.php +++ b/DataCatalog/src/V1/SearchCatalogResult.php @@ -115,8 +115,8 @@ class SearchCatalogResult extends \Google\Protobuf\Internal\Message * @type \Google\Protobuf\Timestamp $modify_time * The last modification timestamp of the entry in the source system. * @type int $integrated_system - * Output only. The source system that Data Catalog automatically integrates with, such - * as BigQuery, Cloud Pub/Sub, or Dataproc Metastore. + * Output only. The source system that Data Catalog automatically integrates + * with, such as BigQuery, Cloud Pub/Sub, or Dataproc Metastore. * @type string $user_specified_system * Custom source system that you can manually integrate Data Catalog with. * @type string $fully_qualified_name @@ -305,8 +305,8 @@ public function setModifyTime($var) } /** - * Output only. The source system that Data Catalog automatically integrates with, such - * as BigQuery, Cloud Pub/Sub, or Dataproc Metastore. + * Output only. The source system that Data Catalog automatically integrates + * with, such as BigQuery, Cloud Pub/Sub, or Dataproc Metastore. * * Generated from protobuf field .google.cloud.datacatalog.v1.IntegratedSystem integrated_system = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return int @@ -322,8 +322,8 @@ public function hasIntegratedSystem() } /** - * Output only. The source system that Data Catalog automatically integrates with, such - * as BigQuery, Cloud Pub/Sub, or Dataproc Metastore. + * Output only. The source system that Data Catalog automatically integrates + * with, such as BigQuery, Cloud Pub/Sub, or Dataproc Metastore. * * Generated from protobuf field .google.cloud.datacatalog.v1.IntegratedSystem integrated_system = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param int $var diff --git a/DataCatalog/src/V1/SerializedTaxonomy.php b/DataCatalog/src/V1/SerializedTaxonomy.php index 1fecfddb6b9..fca15559a39 100644 --- a/DataCatalog/src/V1/SerializedTaxonomy.php +++ b/DataCatalog/src/V1/SerializedTaxonomy.php @@ -18,7 +18,8 @@ class SerializedTaxonomy extends \Google\Protobuf\Internal\Message { /** - * Required. Display name of the taxonomy. At most 200 bytes when encoded in UTF-8. + * Required. Display name of the taxonomy. At most 200 bytes when encoded in + * UTF-8. * * Generated from protobuf field string display_name = 1 [(.google.api.field_behavior) = REQUIRED]; */ @@ -50,7 +51,8 @@ class SerializedTaxonomy extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $display_name - * Required. Display name of the taxonomy. At most 200 bytes when encoded in UTF-8. + * Required. Display name of the taxonomy. At most 200 bytes when encoded in + * UTF-8. * @type string $description * Description of the serialized taxonomy. At most 2000 bytes when * encoded in UTF-8. If not set, defaults to an empty description. @@ -66,7 +68,8 @@ public function __construct($data = NULL) { } /** - * Required. Display name of the taxonomy. At most 200 bytes when encoded in UTF-8. + * Required. Display name of the taxonomy. At most 200 bytes when encoded in + * UTF-8. * * Generated from protobuf field string display_name = 1 [(.google.api.field_behavior) = REQUIRED]; * @return string @@ -77,7 +80,8 @@ public function getDisplayName() } /** - * Required. Display name of the taxonomy. At most 200 bytes when encoded in UTF-8. + * Required. Display name of the taxonomy. At most 200 bytes when encoded in + * UTF-8. * * Generated from protobuf field string display_name = 1 [(.google.api.field_behavior) = REQUIRED]; * @param string $var diff --git a/DataCatalog/src/V1/SqlDatabaseSystemSpec.php b/DataCatalog/src/V1/SqlDatabaseSystemSpec.php new file mode 100644 index 00000000000..90be347ab81 --- /dev/null +++ b/DataCatalog/src/V1/SqlDatabaseSystemSpec.php @@ -0,0 +1,197 @@ +google.cloud.datacatalog.v1.SqlDatabaseSystemSpec + */ +class SqlDatabaseSystemSpec extends \Google\Protobuf\Internal\Message +{ + /** + * SQL Database Engine. + * enum SqlEngine { + * UNDEFINED = 0; + * MY_SQL = 1; + * POSTGRE_SQL = 2; + * SQL_SERVER = 3; + * } + * Engine of the enclosing database instance. + * + * Generated from protobuf field string sql_engine = 1; + */ + private $sql_engine = ''; + /** + * Version of the database engine. + * + * Generated from protobuf field string database_version = 2; + */ + private $database_version = ''; + /** + * Host of the SQL database + * enum InstanceHost { + * UNDEFINED = 0; + * SELF_HOSTED = 1; + * CLOUD_SQL = 2; + * AMAZON_RDS = 3; + * AZURE_SQL = 4; + * } + * Host of the enclousing database instance. + * + * Generated from protobuf field string instance_host = 3; + */ + private $instance_host = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $sql_engine + * SQL Database Engine. + * enum SqlEngine { + * UNDEFINED = 0; + * MY_SQL = 1; + * POSTGRE_SQL = 2; + * SQL_SERVER = 3; + * } + * Engine of the enclosing database instance. + * @type string $database_version + * Version of the database engine. + * @type string $instance_host + * Host of the SQL database + * enum InstanceHost { + * UNDEFINED = 0; + * SELF_HOSTED = 1; + * CLOUD_SQL = 2; + * AMAZON_RDS = 3; + * AZURE_SQL = 4; + * } + * Host of the enclousing database instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\V1\Datacatalog::initOnce(); + parent::__construct($data); + } + + /** + * SQL Database Engine. + * enum SqlEngine { + * UNDEFINED = 0; + * MY_SQL = 1; + * POSTGRE_SQL = 2; + * SQL_SERVER = 3; + * } + * Engine of the enclosing database instance. + * + * Generated from protobuf field string sql_engine = 1; + * @return string + */ + public function getSqlEngine() + { + return $this->sql_engine; + } + + /** + * SQL Database Engine. + * enum SqlEngine { + * UNDEFINED = 0; + * MY_SQL = 1; + * POSTGRE_SQL = 2; + * SQL_SERVER = 3; + * } + * Engine of the enclosing database instance. + * + * Generated from protobuf field string sql_engine = 1; + * @param string $var + * @return $this + */ + public function setSqlEngine($var) + { + GPBUtil::checkString($var, True); + $this->sql_engine = $var; + + return $this; + } + + /** + * Version of the database engine. + * + * Generated from protobuf field string database_version = 2; + * @return string + */ + public function getDatabaseVersion() + { + return $this->database_version; + } + + /** + * Version of the database engine. + * + * Generated from protobuf field string database_version = 2; + * @param string $var + * @return $this + */ + public function setDatabaseVersion($var) + { + GPBUtil::checkString($var, True); + $this->database_version = $var; + + return $this; + } + + /** + * Host of the SQL database + * enum InstanceHost { + * UNDEFINED = 0; + * SELF_HOSTED = 1; + * CLOUD_SQL = 2; + * AMAZON_RDS = 3; + * AZURE_SQL = 4; + * } + * Host of the enclousing database instance. + * + * Generated from protobuf field string instance_host = 3; + * @return string + */ + public function getInstanceHost() + { + return $this->instance_host; + } + + /** + * Host of the SQL database + * enum InstanceHost { + * UNDEFINED = 0; + * SELF_HOSTED = 1; + * CLOUD_SQL = 2; + * AMAZON_RDS = 3; + * AZURE_SQL = 4; + * } + * Host of the enclousing database instance. + * + * Generated from protobuf field string instance_host = 3; + * @param string $var + * @return $this + */ + public function setInstanceHost($var) + { + GPBUtil::checkString($var, True); + $this->instance_host = $var; + + return $this; + } + +} + diff --git a/DataCatalog/src/V1/TableSpec.php b/DataCatalog/src/V1/TableSpec.php index 247ebf8a767..f4718dd6239 100644 --- a/DataCatalog/src/V1/TableSpec.php +++ b/DataCatalog/src/V1/TableSpec.php @@ -16,9 +16,9 @@ class TableSpec extends \Google\Protobuf\Internal\Message { /** - * Output only. If the table is date-sharded, that is, it matches the `[prefix]YYYYMMDD` - * name pattern, this field is the Data Catalog resource name of the - * date-sharded grouped entry. For example: + * Output only. If the table is date-sharded, that is, it matches the + * `[prefix]YYYYMMDD` name pattern, this field is the Data Catalog resource + * name of the date-sharded grouped entry. For example: * `projects/{PROJECT_ID}/locations/{LOCATION}/entrygroups/{ENTRY_GROUP_ID}/entries/{ENTRY_ID}`. * Otherwise, `grouped_entry` is empty. * @@ -33,9 +33,9 @@ class TableSpec extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $grouped_entry - * Output only. If the table is date-sharded, that is, it matches the `[prefix]YYYYMMDD` - * name pattern, this field is the Data Catalog resource name of the - * date-sharded grouped entry. For example: + * Output only. If the table is date-sharded, that is, it matches the + * `[prefix]YYYYMMDD` name pattern, this field is the Data Catalog resource + * name of the date-sharded grouped entry. For example: * `projects/{PROJECT_ID}/locations/{LOCATION}/entrygroups/{ENTRY_GROUP_ID}/entries/{ENTRY_ID}`. * Otherwise, `grouped_entry` is empty. * } @@ -46,9 +46,9 @@ public function __construct($data = NULL) { } /** - * Output only. If the table is date-sharded, that is, it matches the `[prefix]YYYYMMDD` - * name pattern, this field is the Data Catalog resource name of the - * date-sharded grouped entry. For example: + * Output only. If the table is date-sharded, that is, it matches the + * `[prefix]YYYYMMDD` name pattern, this field is the Data Catalog resource + * name of the date-sharded grouped entry. For example: * `projects/{PROJECT_ID}/locations/{LOCATION}/entrygroups/{ENTRY_GROUP_ID}/entries/{ENTRY_ID}`. * Otherwise, `grouped_entry` is empty. * @@ -61,9 +61,9 @@ public function getGroupedEntry() } /** - * Output only. If the table is date-sharded, that is, it matches the `[prefix]YYYYMMDD` - * name pattern, this field is the Data Catalog resource name of the - * date-sharded grouped entry. For example: + * Output only. If the table is date-sharded, that is, it matches the + * `[prefix]YYYYMMDD` name pattern, this field is the Data Catalog resource + * name of the date-sharded grouped entry. For example: * `projects/{PROJECT_ID}/locations/{LOCATION}/entrygroups/{ENTRY_GROUP_ID}/entries/{ENTRY_ID}`. * Otherwise, `grouped_entry` is empty. * diff --git a/DataCatalog/src/V1/Tag.php b/DataCatalog/src/V1/Tag.php index 6d38f5fae8f..6fdde37aea3 100644 --- a/DataCatalog/src/V1/Tag.php +++ b/DataCatalog/src/V1/Tag.php @@ -43,8 +43,8 @@ class Tag extends \Google\Protobuf\Internal\Message */ private $template_display_name = ''; /** - * Required. Maps the ID of a tag field to its value and additional information - * about that field. + * Required. Maps the ID of a tag field to its value and additional + * information about that field. * Tag template defines valid field IDs. A tag * must have at least 1 field and at most 500 fields. * @@ -76,8 +76,8 @@ class Tag extends \Google\Protobuf\Internal\Message * To attach a tag to a nested column, separate column names with a dot * (`.`). Example: `column.nested_column`. * @type array|\Google\Protobuf\Internal\MapField $fields - * Required. Maps the ID of a tag field to its value and additional information - * about that field. + * Required. Maps the ID of a tag field to its value and additional + * information about that field. * Tag template defines valid field IDs. A tag * must have at least 1 field and at most 500 fields. * } @@ -213,8 +213,8 @@ public function setColumn($var) } /** - * Required. Maps the ID of a tag field to its value and additional information - * about that field. + * Required. Maps the ID of a tag field to its value and additional + * information about that field. * Tag template defines valid field IDs. A tag * must have at least 1 field and at most 500 fields. * @@ -227,8 +227,8 @@ public function getFields() } /** - * Required. Maps the ID of a tag field to its value and additional information - * about that field. + * Required. Maps the ID of a tag field to its value and additional + * information about that field. * Tag template defines valid field IDs. A tag * must have at least 1 field and at most 500 fields. * diff --git a/DataCatalog/src/V1/TagField.php b/DataCatalog/src/V1/TagField.php index 2bb76d4fef6..51c956dd5cd 100644 --- a/DataCatalog/src/V1/TagField.php +++ b/DataCatalog/src/V1/TagField.php @@ -23,8 +23,9 @@ class TagField extends \Google\Protobuf\Internal\Message */ private $display_name = ''; /** - * Output only. The order of this field with respect to other fields in this tag. Can be - * set by [Tag][google.cloud.datacatalog.v1.TagTemplateField.order]. + * Output only. The order of this field with respect to other fields in this + * tag. Can be set by + * [Tag][google.cloud.datacatalog.v1.TagTemplateField.order]. * For example, a higher value can indicate a more important field. * The value can be negative. Multiple fields can have the same order, and * field orders within a tag don't have to be sequential. @@ -60,8 +61,9 @@ class TagField extends \Google\Protobuf\Internal\Message * including encoded images. The maximum length of the text without images * is 100 KiB. * @type int $order - * Output only. The order of this field with respect to other fields in this tag. Can be - * set by [Tag][google.cloud.datacatalog.v1.TagTemplateField.order]. + * Output only. The order of this field with respect to other fields in this + * tag. Can be set by + * [Tag][google.cloud.datacatalog.v1.TagTemplateField.order]. * For example, a higher value can indicate a more important field. * The value can be negative. Multiple fields can have the same order, and * field orders within a tag don't have to be sequential. @@ -295,8 +297,9 @@ public function setRichtextValue($var) } /** - * Output only. The order of this field with respect to other fields in this tag. Can be - * set by [Tag][google.cloud.datacatalog.v1.TagTemplateField.order]. + * Output only. The order of this field with respect to other fields in this + * tag. Can be set by + * [Tag][google.cloud.datacatalog.v1.TagTemplateField.order]. * For example, a higher value can indicate a more important field. * The value can be negative. Multiple fields can have the same order, and * field orders within a tag don't have to be sequential. @@ -310,8 +313,9 @@ public function getOrder() } /** - * Output only. The order of this field with respect to other fields in this tag. Can be - * set by [Tag][google.cloud.datacatalog.v1.TagTemplateField.order]. + * Output only. The order of this field with respect to other fields in this + * tag. Can be set by + * [Tag][google.cloud.datacatalog.v1.TagTemplateField.order]. * For example, a higher value can indicate a more important field. * The value can be negative. Multiple fields can have the same order, and * field orders within a tag don't have to be sequential. diff --git a/DataCatalog/src/V1/TagTemplate.php b/DataCatalog/src/V1/TagTemplate.php index 2dbde57bd4f..3b4812b083d 100644 --- a/DataCatalog/src/V1/TagTemplate.php +++ b/DataCatalog/src/V1/TagTemplate.php @@ -10,8 +10,8 @@ /** * A tag template defines a tag that can have one or more typed fields. - * The template is used to create tags that are attached to GCP resources. - * [Tag template roles] + * The template is used to create tags that are attached to Google Cloud + * resources. [Tag template roles] * (https://cloud.google.com/iam/docs/understanding-roles#data-catalog-roles) * provide permissions to create, edit, and use the template. For example, * see the [TagTemplate User] diff --git a/DataCatalog/src/V1/TagTemplateField.php b/DataCatalog/src/V1/TagTemplateField.php index d1485d1052f..d446925af05 100644 --- a/DataCatalog/src/V1/TagTemplateField.php +++ b/DataCatalog/src/V1/TagTemplateField.php @@ -16,7 +16,8 @@ class TagTemplateField extends \Google\Protobuf\Internal\Message { /** - * Output only. The resource name of the tag template field in URL format. Example: + * Output only. The resource name of the tag template field in URL format. + * Example: * `projects/{PROJECT_ID}/locations/{LOCATION}/tagTemplates/{TAG_TEMPLATE}/fields/{FIELD}` * Note: The tag template field itself might not be stored in the location * specified in its name. @@ -72,7 +73,8 @@ class TagTemplateField extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $name - * Output only. The resource name of the tag template field in URL format. Example: + * Output only. The resource name of the tag template field in URL format. + * Example: * `projects/{PROJECT_ID}/locations/{LOCATION}/tagTemplates/{TAG_TEMPLATE}/fields/{FIELD}` * Note: The tag template field itself might not be stored in the location * specified in its name. @@ -104,7 +106,8 @@ public function __construct($data = NULL) { } /** - * Output only. The resource name of the tag template field in URL format. Example: + * Output only. The resource name of the tag template field in URL format. + * Example: * `projects/{PROJECT_ID}/locations/{LOCATION}/tagTemplates/{TAG_TEMPLATE}/fields/{FIELD}` * Note: The tag template field itself might not be stored in the location * specified in its name. @@ -121,7 +124,8 @@ public function getName() } /** - * Output only. The resource name of the tag template field in URL format. Example: + * Output only. The resource name of the tag template field in URL format. + * Example: * `projects/{PROJECT_ID}/locations/{LOCATION}/tagTemplates/{TAG_TEMPLATE}/fields/{FIELD}` * Note: The tag template field itself might not be stored in the location * specified in its name. diff --git a/DataCatalog/src/V1/TaggedEntry.php b/DataCatalog/src/V1/TaggedEntry.php new file mode 100644 index 00000000000..e5213cc8439 --- /dev/null +++ b/DataCatalog/src/V1/TaggedEntry.php @@ -0,0 +1,152 @@ +google.cloud.datacatalog.v1.TaggedEntry + */ +class TaggedEntry extends \Google\Protobuf\Internal\Message +{ + /** + * Tags that should be ingested into the Data Catalog. + * Caller should populate template name, column and fields. + * + * Generated from protobuf field repeated .google.cloud.datacatalog.v1.Tag present_tags = 2; + */ + private $present_tags; + /** + * Tags that should be deleted from the Data Catalog. + * Caller should populate template name and column only. + * + * Generated from protobuf field repeated .google.cloud.datacatalog.v1.Tag absent_tags = 3; + */ + private $absent_tags; + protected $entry; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DataCatalog\V1\Entry $v1_entry + * Non-encrypted Data Catalog v1 Entry. + * @type array<\Google\Cloud\DataCatalog\V1\Tag>|\Google\Protobuf\Internal\RepeatedField $present_tags + * Tags that should be ingested into the Data Catalog. + * Caller should populate template name, column and fields. + * @type array<\Google\Cloud\DataCatalog\V1\Tag>|\Google\Protobuf\Internal\RepeatedField $absent_tags + * Tags that should be deleted from the Data Catalog. + * Caller should populate template name and column only. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\V1\DumpContent::initOnce(); + parent::__construct($data); + } + + /** + * Non-encrypted Data Catalog v1 Entry. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.Entry v1_entry = 1; + * @return \Google\Cloud\DataCatalog\V1\Entry|null + */ + public function getV1Entry() + { + return $this->readOneof(1); + } + + public function hasV1Entry() + { + return $this->hasOneof(1); + } + + /** + * Non-encrypted Data Catalog v1 Entry. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.Entry v1_entry = 1; + * @param \Google\Cloud\DataCatalog\V1\Entry $var + * @return $this + */ + public function setV1Entry($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\V1\Entry::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Tags that should be ingested into the Data Catalog. + * Caller should populate template name, column and fields. + * + * Generated from protobuf field repeated .google.cloud.datacatalog.v1.Tag present_tags = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPresentTags() + { + return $this->present_tags; + } + + /** + * Tags that should be ingested into the Data Catalog. + * Caller should populate template name, column and fields. + * + * Generated from protobuf field repeated .google.cloud.datacatalog.v1.Tag present_tags = 2; + * @param array<\Google\Cloud\DataCatalog\V1\Tag>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPresentTags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DataCatalog\V1\Tag::class); + $this->present_tags = $arr; + + return $this; + } + + /** + * Tags that should be deleted from the Data Catalog. + * Caller should populate template name and column only. + * + * Generated from protobuf field repeated .google.cloud.datacatalog.v1.Tag absent_tags = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAbsentTags() + { + return $this->absent_tags; + } + + /** + * Tags that should be deleted from the Data Catalog. + * Caller should populate template name and column only. + * + * Generated from protobuf field repeated .google.cloud.datacatalog.v1.Tag absent_tags = 3; + * @param array<\Google\Cloud\DataCatalog\V1\Tag>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAbsentTags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DataCatalog\V1\Tag::class); + $this->absent_tags = $arr; + + return $this; + } + + /** + * @return string + */ + public function getEntry() + { + return $this->whichOneof("entry"); + } + +} + diff --git a/DataCatalog/src/V1/Taxonomy.php b/DataCatalog/src/V1/Taxonomy.php index f593205c535..311081883e8 100644 --- a/DataCatalog/src/V1/Taxonomy.php +++ b/DataCatalog/src/V1/Taxonomy.php @@ -73,12 +73,20 @@ class Taxonomy extends \Google\Protobuf\Internal\Message */ private $taxonomy_timestamps = null; /** - * Optional. A list of policy types that are activated for this taxonomy. If not set, - * defaults to an empty list. + * Optional. A list of policy types that are activated for this taxonomy. If + * not set, defaults to an empty list. * * Generated from protobuf field repeated .google.cloud.datacatalog.v1.Taxonomy.PolicyType activated_policy_types = 6 [(.google.api.field_behavior) = OPTIONAL]; */ private $activated_policy_types; + /** + * Output only. Identity of the service which owns the Taxonomy. This field is + * only populated when the taxonomy is created by a Google Cloud service. + * Currently only 'DATAPLEX' is supported. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.Taxonomy.Service service = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $service = null; /** * Constructor. @@ -105,8 +113,12 @@ class Taxonomy extends \Google\Protobuf\Internal\Message * @type \Google\Cloud\DataCatalog\V1\SystemTimestamps $taxonomy_timestamps * Output only. Creation and modification timestamps of this taxonomy. * @type array|\Google\Protobuf\Internal\RepeatedField $activated_policy_types - * Optional. A list of policy types that are activated for this taxonomy. If not set, - * defaults to an empty list. + * Optional. A list of policy types that are activated for this taxonomy. If + * not set, defaults to an empty list. + * @type \Google\Cloud\DataCatalog\V1\Taxonomy\Service $service + * Output only. Identity of the service which owns the Taxonomy. This field is + * only populated when the taxonomy is created by a Google Cloud service. + * Currently only 'DATAPLEX' is supported. * } */ public function __construct($data = NULL) { @@ -271,8 +283,8 @@ public function setTaxonomyTimestamps($var) } /** - * Optional. A list of policy types that are activated for this taxonomy. If not set, - * defaults to an empty list. + * Optional. A list of policy types that are activated for this taxonomy. If + * not set, defaults to an empty list. * * Generated from protobuf field repeated .google.cloud.datacatalog.v1.Taxonomy.PolicyType activated_policy_types = 6 [(.google.api.field_behavior) = OPTIONAL]; * @return \Google\Protobuf\Internal\RepeatedField @@ -283,8 +295,8 @@ public function getActivatedPolicyTypes() } /** - * Optional. A list of policy types that are activated for this taxonomy. If not set, - * defaults to an empty list. + * Optional. A list of policy types that are activated for this taxonomy. If + * not set, defaults to an empty list. * * Generated from protobuf field repeated .google.cloud.datacatalog.v1.Taxonomy.PolicyType activated_policy_types = 6 [(.google.api.field_behavior) = OPTIONAL]; * @param array|\Google\Protobuf\Internal\RepeatedField $var @@ -298,5 +310,45 @@ public function setActivatedPolicyTypes($var) return $this; } + /** + * Output only. Identity of the service which owns the Taxonomy. This field is + * only populated when the taxonomy is created by a Google Cloud service. + * Currently only 'DATAPLEX' is supported. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.Taxonomy.Service service = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\DataCatalog\V1\Taxonomy\Service|null + */ + public function getService() + { + return $this->service; + } + + public function hasService() + { + return isset($this->service); + } + + public function clearService() + { + unset($this->service); + } + + /** + * Output only. Identity of the service which owns the Taxonomy. This field is + * only populated when the taxonomy is created by a Google Cloud service. + * Currently only 'DATAPLEX' is supported. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.Taxonomy.Service service = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\DataCatalog\V1\Taxonomy\Service $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\V1\Taxonomy\Service::class); + $this->service = $var; + + return $this; + } + } diff --git a/DataCatalog/src/V1/Taxonomy/Service.php b/DataCatalog/src/V1/Taxonomy/Service.php new file mode 100644 index 00000000000..a9afc35abd5 --- /dev/null +++ b/DataCatalog/src/V1/Taxonomy/Service.php @@ -0,0 +1,104 @@ +google.cloud.datacatalog.v1.Taxonomy.Service + */ +class Service extends \Google\Protobuf\Internal\Message +{ + /** + * The Google Cloud service name. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.ManagingSystem name = 1; + */ + private $name = 0; + /** + * P4SA Identity of the service. + * + * Generated from protobuf field string identity = 2; + */ + private $identity = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $name + * The Google Cloud service name. + * @type string $identity + * P4SA Identity of the service. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\V1\Policytagmanager::initOnce(); + parent::__construct($data); + } + + /** + * The Google Cloud service name. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.ManagingSystem name = 1; + * @return int + */ + public function getName() + { + return $this->name; + } + + /** + * The Google Cloud service name. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.ManagingSystem name = 1; + * @param int $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DataCatalog\V1\ManagingSystem::class); + $this->name = $var; + + return $this; + } + + /** + * P4SA Identity of the service. + * + * Generated from protobuf field string identity = 2; + * @return string + */ + public function getIdentity() + { + return $this->identity; + } + + /** + * P4SA Identity of the service. + * + * Generated from protobuf field string identity = 2; + * @param string $var + * @return $this + */ + public function setIdentity($var) + { + GPBUtil::checkString($var, True); + $this->identity = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Service::class, \Google\Cloud\DataCatalog\V1\Taxonomy_Service::class); + diff --git a/DataCatalog/src/V1/Taxonomy_Service.php b/DataCatalog/src/V1/Taxonomy_Service.php new file mode 100644 index 00000000000..634f94fe45f --- /dev/null +++ b/DataCatalog/src/V1/Taxonomy_Service.php @@ -0,0 +1,16 @@ +map usage_within_time_range = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ private $usage_within_time_range; + /** + * Common usage statistics over each of the predefined time ranges. + * Supported time ranges are `{"24H", "7D", "30D", "Lifetime"}`. + * + * Generated from protobuf field map common_usage_within_time_range = 3; + */ + private $common_usage_within_time_range; + /** + * Favorite count in the source system. + * + * Generated from protobuf field optional int64 favorite_count = 4; + */ + private $favorite_count = null; /** * Constructor. @@ -40,8 +54,14 @@ class UsageSignal extends \Google\Protobuf\Internal\Message * @type \Google\Protobuf\Timestamp $update_time * The end timestamp of the duration of usage statistics. * @type array|\Google\Protobuf\Internal\MapField $usage_within_time_range - * Output only. BigQuery usage statistics over each of the predefined time ranges. + * Output only. BigQuery usage statistics over each of the predefined time + * ranges. * Supported time ranges are `{"24H", "7D", "30D"}`. + * @type array|\Google\Protobuf\Internal\MapField $common_usage_within_time_range + * Common usage statistics over each of the predefined time ranges. + * Supported time ranges are `{"24H", "7D", "30D", "Lifetime"}`. + * @type int|string $favorite_count + * Favorite count in the source system. * } */ public function __construct($data = NULL) { @@ -86,7 +106,8 @@ public function setUpdateTime($var) } /** - * Output only. BigQuery usage statistics over each of the predefined time ranges. + * Output only. BigQuery usage statistics over each of the predefined time + * ranges. * Supported time ranges are `{"24H", "7D", "30D"}`. * * Generated from protobuf field map usage_within_time_range = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -98,7 +119,8 @@ public function getUsageWithinTimeRange() } /** - * Output only. BigQuery usage statistics over each of the predefined time ranges. + * Output only. BigQuery usage statistics over each of the predefined time + * ranges. * Supported time ranges are `{"24H", "7D", "30D"}`. * * Generated from protobuf field map usage_within_time_range = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -113,5 +135,69 @@ public function setUsageWithinTimeRange($var) return $this; } + /** + * Common usage statistics over each of the predefined time ranges. + * Supported time ranges are `{"24H", "7D", "30D", "Lifetime"}`. + * + * Generated from protobuf field map common_usage_within_time_range = 3; + * @return \Google\Protobuf\Internal\MapField + */ + public function getCommonUsageWithinTimeRange() + { + return $this->common_usage_within_time_range; + } + + /** + * Common usage statistics over each of the predefined time ranges. + * Supported time ranges are `{"24H", "7D", "30D", "Lifetime"}`. + * + * Generated from protobuf field map common_usage_within_time_range = 3; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setCommonUsageWithinTimeRange($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DataCatalog\V1\CommonUsageStats::class); + $this->common_usage_within_time_range = $arr; + + return $this; + } + + /** + * Favorite count in the source system. + * + * Generated from protobuf field optional int64 favorite_count = 4; + * @return int|string + */ + public function getFavoriteCount() + { + return isset($this->favorite_count) ? $this->favorite_count : 0; + } + + public function hasFavoriteCount() + { + return isset($this->favorite_count); + } + + public function clearFavoriteCount() + { + unset($this->favorite_count); + } + + /** + * Favorite count in the source system. + * + * Generated from protobuf field optional int64 favorite_count = 4; + * @param int|string $var + * @return $this + */ + public function setFavoriteCount($var) + { + GPBUtil::checkInt64($var); + $this->favorite_count = $var; + + return $this; + } + } diff --git a/DataCatalog/src/V1/gapic_metadata.json b/DataCatalog/src/V1/gapic_metadata.json index 7e8c0ae0acb..bf1807d340f 100644 --- a/DataCatalog/src/V1/gapic_metadata.json +++ b/DataCatalog/src/V1/gapic_metadata.json @@ -80,6 +80,11 @@ "getTagTemplate" ] }, + "ImportEntries": { + "methods": [ + "importEntries" + ] + }, "ListEntries": { "methods": [ "listEntries" @@ -110,6 +115,11 @@ "modifyEntryOverview" ] }, + "ReconcileTags": { + "methods": [ + "reconcileTags" + ] + }, "RenameTagTemplateField": { "methods": [ "renameTagTemplateField" diff --git a/DataCatalog/src/V1/resources/data_catalog_client_config.json b/DataCatalog/src/V1/resources/data_catalog_client_config.json index 2cb54c8e0f2..c110ac02f57 100644 --- a/DataCatalog/src/V1/resources/data_catalog_client_config.json +++ b/DataCatalog/src/V1/resources/data_catalog_client_config.json @@ -108,6 +108,11 @@ "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "ImportEntries": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "ListEntries": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", @@ -138,6 +143,11 @@ "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "ReconcileTags": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "RenameTagTemplateField": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", diff --git a/DataCatalog/src/V1/resources/data_catalog_descriptor_config.php b/DataCatalog/src/V1/resources/data_catalog_descriptor_config.php index 6eb7b1851d3..497d23ce552 100644 --- a/DataCatalog/src/V1/resources/data_catalog_descriptor_config.php +++ b/DataCatalog/src/V1/resources/data_catalog_descriptor_config.php @@ -3,6 +3,26 @@ return [ 'interfaces' => [ 'google.cloud.datacatalog.v1.DataCatalog' => [ + 'ImportEntries' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\DataCatalog\V1\ImportEntriesResponse', + 'metadataReturnType' => '\Google\Cloud\DataCatalog\V1\ImportEntriesMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'ReconcileTags' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\DataCatalog\V1\ReconcileTagsResponse', + 'metadataReturnType' => '\Google\Cloud\DataCatalog\V1\ReconcileTagsMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], 'ListEntries' => [ 'pageStreaming' => [ 'requestPageTokenGetMethod' => 'getPageToken', diff --git a/DataCatalog/src/V1/resources/data_catalog_rest_client_config.php b/DataCatalog/src/V1/resources/data_catalog_rest_client_config.php index 30f6e994a3d..e88d57fa1ed 100644 --- a/DataCatalog/src/V1/resources/data_catalog_rest_client_config.php +++ b/DataCatalog/src/V1/resources/data_catalog_rest_client_config.php @@ -206,6 +206,18 @@ ], ], ], + 'ImportEntries' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/entryGroups/*}/entries:import', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'ListEntries' => [ 'method' => 'get', 'uriTemplate' => '/v1/{parent=projects/*/locations/*/entryGroups/*}/entries', @@ -273,6 +285,18 @@ ], ], ], + 'ReconcileTags' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/entryGroups/*/entries/*}/tags:reconcile', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'RenameTagTemplateField' => [ 'method' => 'post', 'uriTemplate' => '/v1/{name=projects/*/locations/*/tagTemplates/*/fields/*}:rename', @@ -441,5 +465,51 @@ ], ], ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', + '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', + ], + ], + ], + ], + ], ], ]; diff --git a/DataCatalog/src/V1/resources/policy_tag_manager_rest_client_config.php b/DataCatalog/src/V1/resources/policy_tag_manager_rest_client_config.php index 10cf0766db4..994ba95e96a 100644 --- a/DataCatalog/src/V1/resources/policy_tag_manager_rest_client_config.php +++ b/DataCatalog/src/V1/resources/policy_tag_manager_rest_client_config.php @@ -177,5 +177,51 @@ ], ], ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', + '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', + ], + ], + ], + ], + ], ], ]; diff --git a/DataCatalog/src/V1/resources/policy_tag_manager_serialization_rest_client_config.php b/DataCatalog/src/V1/resources/policy_tag_manager_serialization_rest_client_config.php index 5883429990d..ec08adc7e22 100644 --- a/DataCatalog/src/V1/resources/policy_tag_manager_serialization_rest_client_config.php +++ b/DataCatalog/src/V1/resources/policy_tag_manager_serialization_rest_client_config.php @@ -39,5 +39,51 @@ ], ], ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', + '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', + ], + ], + ], + ], + ], ], ]; diff --git a/DataCatalog/tests/Unit/V1/DataCatalogClientTest.php b/DataCatalog/tests/Unit/V1/DataCatalogClientTest.php index e0c81e09a96..fbad92dc811 100644 --- a/DataCatalog/tests/Unit/V1/DataCatalogClientTest.php +++ b/DataCatalog/tests/Unit/V1/DataCatalogClientTest.php @@ -24,6 +24,7 @@ use Google\ApiCore\ApiException; use Google\ApiCore\CredentialsWrapper; +use Google\ApiCore\LongRunning\OperationsClient; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; use Google\Cloud\DataCatalog\V1\Contacts; @@ -32,9 +33,11 @@ use Google\Cloud\DataCatalog\V1\EntryGroup; use Google\Cloud\DataCatalog\V1\EntryOverview; use Google\Cloud\DataCatalog\V1\FieldType; +use Google\Cloud\DataCatalog\V1\ImportEntriesResponse; use Google\Cloud\DataCatalog\V1\ListEntriesResponse; use Google\Cloud\DataCatalog\V1\ListEntryGroupsResponse; use Google\Cloud\DataCatalog\V1\ListTagsResponse; +use Google\Cloud\DataCatalog\V1\ReconcileTagsResponse; use Google\Cloud\DataCatalog\V1\SearchCatalogRequest\Scope; use Google\Cloud\DataCatalog\V1\SearchCatalogResponse; use Google\Cloud\DataCatalog\V1\SearchCatalogResult; @@ -46,6 +49,9 @@ use Google\Cloud\DataCatalog\V1\UnstarEntryResponse; use Google\Cloud\Iam\V1\Policy; use Google\Cloud\Iam\V1\TestIamPermissionsResponse; +use Google\LongRunning\GetOperationRequest; +use Google\LongRunning\Operation; +use Google\Protobuf\Any; use Google\Protobuf\GPBEmpty; use Google\Rpc\Code; use stdClass; @@ -1031,6 +1037,127 @@ public function getTagTemplateExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function importEntriesTest() + { + $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/importEntriesTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $upsertedEntriesCount = 250168367; + $deletedEntriesCount = 167383302; + $expectedResponse = new ImportEntriesResponse(); + $expectedResponse->setUpsertedEntriesCount($upsertedEntriesCount); + $expectedResponse->setDeletedEntriesCount($deletedEntriesCount); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/importEntriesTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->entryGroupName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]'); + $response = $gapicClient->importEntries($formattedParent); + $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.datacatalog.v1.DataCatalog/ImportEntries', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importEntriesTest'); + $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 importEntriesExceptionTest() + { + $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/importEntriesTest'); + $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->entryGroupName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]'); + $response = $gapicClient->importEntries($formattedParent); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importEntriesTest'); + 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 listEntriesTest() { @@ -1427,6 +1554,133 @@ public function modifyEntryOverviewExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function reconcileTagsTest() + { + $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/reconcileTagsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $createdTagsCount = 986601696; + $updatedTagsCount = 344847213; + $deletedTagsCount = 59637071; + $expectedResponse = new ReconcileTagsResponse(); + $expectedResponse->setCreatedTagsCount($createdTagsCount); + $expectedResponse->setUpdatedTagsCount($updatedTagsCount); + $expectedResponse->setDeletedTagsCount($deletedTagsCount); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/reconcileTagsTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->entryName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]', '[ENTRY]'); + $formattedTagTemplate = $gapicClient->tagTemplateName('[PROJECT]', '[LOCATION]', '[TAG_TEMPLATE]'); + $response = $gapicClient->reconcileTags($formattedParent, $formattedTagTemplate); + $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.datacatalog.v1.DataCatalog/ReconcileTags', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getTagTemplate(); + $this->assertProtobufEquals($formattedTagTemplate, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/reconcileTagsTest'); + $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 reconcileTagsExceptionTest() + { + $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/reconcileTagsTest'); + $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->entryName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]', '[ENTRY]'); + $formattedTagTemplate = $gapicClient->tagTemplateName('[PROJECT]', '[LOCATION]', '[TAG_TEMPLATE]'); + $response = $gapicClient->reconcileTags($formattedParent, $formattedTagTemplate); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/reconcileTagsTest'); + 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 renameTagTemplateFieldTest() {