From ea6803204a5d8461e17263f0ce7c30336d6571c2 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Mon, 6 Nov 2023 11:56:29 +0000 Subject: [PATCH 1/2] feat: add open lineage support fix: change `start_time` in message `.google.cloud.datacatalog.lineage.v1.LineageEvent` to `required` as intended by api PiperOrigin-RevId: 579762272 Source-Link: https://github.com/googleapis/googleapis/commit/58878bdf14a716bcbe909c6f987a6b7bd42879d9 Source-Link: https://github.com/googleapis/googleapis-gen/commit/96a4d735b92f202fbdd2c62da2e21e63216bfa88 Copy-Tag: eyJwIjoiRGF0YUNhdGFsb2dMaW5lYWdlLy5Pd2xCb3QueWFtbCIsImgiOiI5NmE0ZDczNWI5MmYyMDJmYmRkMmM2MmRhMmUyMWU2MzIxNmJmYTg4In0= --- .../Cloud/Datacatalog/Lineage/V1/Lineage.php | Bin 0 -> 11416 bytes .../V1/BatchSearchLinkProcessesRequest.php | 206 +++ .../V1/BatchSearchLinkProcessesResponse.php | 106 ++ .../Lineage/V1/CreateLineageEventRequest.php | 170 ++ .../Lineage/V1/CreateProcessRequest.php | 175 ++ .../Lineage/V1/CreateRunRequest.php | 170 ++ .../Lineage/V1/DeleteLineageEventRequest.php | 120 ++ .../Lineage/V1/DeleteProcessRequest.php | 120 ++ .../Lineage/V1/DeleteRunRequest.php | 120 ++ .../Lineage/V1/EntityReference.php | 75 + .../DataCatalog/Lineage/V1/EventLink.php | 121 ++ .../Lineage/V1/GetLineageEventRequest.php | 82 + .../Lineage/V1/GetProcessRequest.php | 82 + .../DataCatalog/Lineage/V1/GetRunRequest.php | 82 + .../DataCatalog/Lineage/V1/LineageEvent.php | 226 +++ .../Cloud/DataCatalog/Lineage/V1/Link.php | 250 +++ .../Lineage/V1/ListLineageEventsRequest.php | 178 ++ .../Lineage/V1/ListLineageEventsResponse.php | 106 ++ .../Lineage/V1/ListProcessesRequest.php | 179 ++ .../Lineage/V1/ListProcessesResponse.php | 106 ++ .../Lineage/V1/ListRunsRequest.php | 174 ++ .../Lineage/V1/ListRunsResponse.php | 106 ++ .../Lineage/V1/OperationMetadata.php | 269 +++ .../Lineage/V1/OperationMetadata/State.php | 78 + .../Lineage/V1/OperationMetadata/Type.php | 64 + .../Cloud/DataCatalog/Lineage/V1/Origin.php | 141 ++ .../Lineage/V1/Origin/SourceType.php | 92 ++ .../Cloud/DataCatalog/Lineage/V1/Process.php | 215 +++ .../Lineage/V1/ProcessLinkInfo.php | 159 ++ .../DataCatalog/Lineage/V1/ProcessLinks.php | 121 ++ .../V1/ProcessOpenLineageRunEventRequest.php | 179 ++ .../V1/ProcessOpenLineageRunEventResponse.php | 156 ++ .../Cloud/DataCatalog/Lineage/V1/Run.php | 290 ++++ .../DataCatalog/Lineage/V1/Run/State.php | 79 + .../Lineage/V1/SearchLinksRequest.php | 245 +++ .../Lineage/V1/SearchLinksResponse.php | 110 ++ .../Lineage/V1/UpdateProcessRequest.php | 182 +++ .../Lineage/V1/UpdateRunRequest.php | 193 +++ .../batch_search_link_processes.php | 99 ++ .../V1/LineageClient/create_lineage_event.php | 76 + .../V1/LineageClient/create_process.php | 74 + .../samples/V1/LineageClient/create_run.php | 80 + .../V1/LineageClient/delete_lineage_event.php | 75 + .../V1/LineageClient/delete_process.php | 80 + .../samples/V1/LineageClient/delete_run.php | 80 + .../V1/LineageClient/get_lineage_event.php | 77 + .../samples/V1/LineageClient/get_process.php | 71 + .../v1/samples/V1/LineageClient/get_run.php | 71 + .../V1/LineageClient/list_lineage_events.php | 77 + .../V1/LineageClient/list_processes.php | 78 + .../v1/samples/V1/LineageClient/list_runs.php | 77 + .../process_open_lineage_run_event.php | 77 + .../samples/V1/LineageClient/search_links.php | 84 + .../V1/LineageClient/update_process.php | 59 + .../samples/V1/LineageClient/update_run.php | 76 + .../v1/src/V1/Client/LineageClient.php | 817 ++++++++++ .../v1/src/V1/Gapic/LineageGapicClient.php | 1431 ++++++++++++++++ .../v1/src/V1/LineageClient.php | 34 + .../v1/src/V1/gapic_metadata.json | 103 ++ .../V1/resources/lineage_client_config.json | 119 ++ .../resources/lineage_descriptor_config.php | 274 ++++ .../resources/lineage_rest_client_config.php | 252 +++ .../Unit/V1/Client/LineageClientTest.php | 1440 +++++++++++++++++ .../v1/tests/Unit/V1/LineageClientTest.php | 1304 +++++++++++++++ 64 files changed, 12612 insertions(+) create mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/GPBMetadata/Google/Cloud/Datacatalog/Lineage/V1/Lineage.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/BatchSearchLinkProcessesRequest.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/BatchSearchLinkProcessesResponse.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/CreateLineageEventRequest.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/CreateProcessRequest.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/CreateRunRequest.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/DeleteLineageEventRequest.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/DeleteProcessRequest.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/DeleteRunRequest.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/EntityReference.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/EventLink.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/GetLineageEventRequest.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/GetProcessRequest.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/GetRunRequest.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/LineageEvent.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Link.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListLineageEventsRequest.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListLineageEventsResponse.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListProcessesRequest.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListProcessesResponse.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListRunsRequest.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListRunsResponse.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/OperationMetadata.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/OperationMetadata/State.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/OperationMetadata/Type.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Origin.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Origin/SourceType.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Process.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ProcessLinkInfo.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ProcessLinks.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ProcessOpenLineageRunEventRequest.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ProcessOpenLineageRunEventResponse.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Run.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Run/State.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/SearchLinksRequest.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/SearchLinksResponse.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/UpdateProcessRequest.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/UpdateRunRequest.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/batch_search_link_processes.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/create_lineage_event.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/create_process.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/create_run.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/delete_lineage_event.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/delete_process.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/delete_run.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/get_lineage_event.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/get_process.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/get_run.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/list_lineage_events.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/list_processes.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/list_runs.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/process_open_lineage_run_event.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/search_links.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/update_process.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/update_run.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/src/V1/Client/LineageClient.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/src/V1/Gapic/LineageGapicClient.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/src/V1/LineageClient.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/src/V1/gapic_metadata.json create mode 100644 owl-bot-staging/DataCatalogLineage/v1/src/V1/resources/lineage_client_config.json create mode 100644 owl-bot-staging/DataCatalogLineage/v1/src/V1/resources/lineage_descriptor_config.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/src/V1/resources/lineage_rest_client_config.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/tests/Unit/V1/Client/LineageClientTest.php create mode 100644 owl-bot-staging/DataCatalogLineage/v1/tests/Unit/V1/LineageClientTest.php diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/GPBMetadata/Google/Cloud/Datacatalog/Lineage/V1/Lineage.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/GPBMetadata/Google/Cloud/Datacatalog/Lineage/V1/Lineage.php new file mode 100644 index 0000000000000000000000000000000000000000..155e66baf2bd52923aa15e4c097a5b16ad3f5e50 GIT binary patch literal 11416 zcmb_iO>7%k9pAB&G7 z=l%ch|MB~Oy#KsgcU#*nbXi@s9II`5)`q&ir+V9#+G;nwX1&=^*E^e=R$Hw%cUyMD zYR6SIQ&97TH8q>bt-TDSZnM*_Te`Z{Y;HBIM7`1MY$P^J&#c4WMsq9CupP_XvJ#J$ z#m6}1j*w&ST5ij%Tk2{tb>H$#LRMX+jH+qEsG8|As@`Last=ZLB2;gfuB-B&&=aJ> zpH^qRVb@jHGd=k472B=Zj_uiI!~QmCc3a&v8?FVk{cATnPTjMcj!Fm$PTg9#sxqEr z?JKP&SmL%SL@N^GfMKdR$Ftgw*{EhLx8Al}Ub9_=>FAG=swuGI%sV*=X zb-ho>+p5>@Si#*@wQYHwwsVupO&IL^pQ-~4XSD39;W$lVg{I@`dRM0|i(!Q6hHW|C zXf!Lf)!0Z`+vX#?*&dCwWO4XN3wf{UY_&U%V>?^bLW_WQG$noCf#tHhEpJa=V4svK zeBX3;jzC)m_tr-+u)pb=4Z-4>yRE^SQjETO$L5GMHa2_!u0Y@}_>dt0x`I9}qUDhz z7GGv0aT?_DK#<3IkjEb_&tK$x&6W+>fWV2x`}|9R2b%;lwRH{}zTi?|L7O9kKjJ$l z8eR7%n!fw_q8B)Qi^pfeA`a#cMS}7lG7)ycjeNxyddXetEB;hS@6&t2A#8#6y(l^b z-l|)!i_fAllHBGLRauxyMgMAy<4frDhV8Z*=3b3Hiik%Ft{`N3UfW*pc$PaCRig{B z;5X1jvu$tL&fFO66-$0aie-V4P!97sG}FTw$53>~ z+GC30FQM^AW}{=x5oKb@=fwuXM)3#asUEqZ=o`-r6KMo80xC>DK#3cN>XHzqy9vba zS#{4%JmH`A!Rt^=NSr60h>!aTcuH(-v4!O0zV@3j6fJd}5$*r>0Q=t%x*UY{IP5jp z_OBrX!P@p}1SQ=5^MWNvPU}b9k7;7=2wp~$mb1Y~#;HXQAyIG&jgwMh%}v1iGs(Ev z;!vr}go$5@oH5NI*3Zf0VE}n^w z&Puz6W_q^3FQfCDoknA?_OJul3+l!OOW}TYk7)mhqO*QGB3fBo6wygmo{`MyeQe@> ztVZ!S&>6q%)x5nHOTA~3H>GUX&w3455EDl61vDvYE|ef%wxW0*O^csvosPXha~UmZ zQG5->>TL`1$OtJb8p?7~5fIhNBCT9NXCafUWowmuxtLAoR&tOyXo4wb^O;}3fnGg*?PfFpcPm$IRr!z>?HOE=2Xp=f*2iHTbJ23TcrFIF-8mxuG7K zh%@L+DArjUGnHEU+_);AhP00rbUsZX#T66=)q4!O2=x-Q!7?31s%r?=rz{DRA6O;1 z1jGIC3lO%_f(&c*2piat1b!@egbfoY)}g#>q(kLc=`R&4q>m;?5s2Suv(aciuI<{c z3#TIrmPzeCI=gClJp$ecwWr*cGRV;O(D{3|EBIONN%-e1nrgv-pyt9cohmwx0rvDK zueoD69QF^@`}KQ? zY&5C;OhK~@_mD}1O|SQ0{>v2eDn6_!(!0?cOD;%Z9d;d#^B;q74Cevi_$CbBBW`k1 z*v_J9z;-|=Na=xN7q{18xl3!I83HWeNd(!)8I#g455?q!-bWo(>(0&I!4+sjb z6~T8q1SKx~2$k%812+JohKAj2Ts->du6z7S*>R1a9K{Zl~`Y$^+>BgRH1 z?Cj6R3fHCLlW~Zb>FYXr@C6;ZlW6Vx3POR0FQAL%LZy_>)&?Jr)0OgC;XWLWPov3H zZuRX-w)8HXw`Wi+W2_mql}b5R$iqwz9+Pojp`0zvjsX&tQfd!pz^l;w>aqE-(9qs{|IdH_D3aIi zkXM~g*!ll7gmXQ{x=tv=p2j;7=7a9XcrEuS=;Bq7fDt z>9nL3sG2vlS0&W!4(W9Zu9iVp(F z#y@+51ZjY&FaxBa@c$JQZZ@F6Nhu$&#iMJGrW#zw%mI=iFQgZd|62u3l29zc6avdN z;9|LuSPp4jDjw?DkoX6NdOv=;5&s{6jX&{_gpI#msBlQ6|A7+;Q`Q7<2=t2(0h{>k-b+W4a5wD zPDpjR7h*kB$I!b>^5t7jPpC!=})Xc@VrM%ilCzO)|#Q<_1t(B0b z($PBD!`y>m@V93FrBy4#(S>B=Jh7tAb&4FGUPN|#~eLb2>Ixo|C4sg{OzOGeA}A>$TM zc|QM{F+co{#Gj1#w&%56J&}0)_%RpVzp-R?ylr;h^;Njm5J7u(kei$C9;+_y@T zJ6FxEI1j7%gXPb}sw%%_ORw4TbyfeKEnKvH7O7rg40WAy)b#*MUFSS?{lW731npg4 gyW-z8Tw+&Q12google.cloud.datacatalog.lineage.v1.BatchSearchLinkProcessesRequest + */ +class BatchSearchLinkProcessesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location where you want to search. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. An array of links to check for their associated LineageProcesses. + * The maximum number of items in this array is 100. + * If the request contains more than 100 links, it returns the + * `INVALID_ARGUMENT` error. + * Format: `projects/{project}/locations/{location}/links/{link}`. + * + * Generated from protobuf field repeated string links = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $links; + /** + * The maximum number of processes to return in a single page of the response. + * A page may contain fewer results than this value. + * + * Generated from protobuf field int32 page_size = 3; + */ + protected $page_size = 0; + /** + * The page token received from a previous `BatchSearchLinkProcesses` call. + * Use it to get the next page. + * When requesting subsequent pages of a response, remember that + * all parameters must match the values you provided + * in the original request. + * + * Generated from protobuf field string page_token = 4; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location where you want to search. + * @type array|\Google\Protobuf\Internal\RepeatedField $links + * Required. An array of links to check for their associated LineageProcesses. + * The maximum number of items in this array is 100. + * If the request contains more than 100 links, it returns the + * `INVALID_ARGUMENT` error. + * Format: `projects/{project}/locations/{location}/links/{link}`. + * @type int $page_size + * The maximum number of processes to return in a single page of the response. + * A page may contain fewer results than this value. + * @type string $page_token + * The page token received from a previous `BatchSearchLinkProcesses` call. + * Use it to get the next page. + * When requesting subsequent pages of a response, remember that + * all parameters must match the values you provided + * in the original request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location where you want to search. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location where you want to search. + * + * 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. An array of links to check for their associated LineageProcesses. + * The maximum number of items in this array is 100. + * If the request contains more than 100 links, it returns the + * `INVALID_ARGUMENT` error. + * Format: `projects/{project}/locations/{location}/links/{link}`. + * + * Generated from protobuf field repeated string links = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLinks() + { + return $this->links; + } + + /** + * Required. An array of links to check for their associated LineageProcesses. + * The maximum number of items in this array is 100. + * If the request contains more than 100 links, it returns the + * `INVALID_ARGUMENT` error. + * Format: `projects/{project}/locations/{location}/links/{link}`. + * + * Generated from protobuf field repeated string links = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLinks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->links = $arr; + + return $this; + } + + /** + * The maximum number of processes to return in a single page of the response. + * A page may contain fewer results than this value. + * + * Generated from protobuf field int32 page_size = 3; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of processes to return in a single page of the response. + * A page may contain fewer results than this value. + * + * Generated from protobuf field int32 page_size = 3; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The page token received from a previous `BatchSearchLinkProcesses` call. + * Use it to get the next page. + * When requesting subsequent pages of a response, remember that + * all parameters must match the values you provided + * in the original request. + * + * Generated from protobuf field string page_token = 4; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The page token received from a previous `BatchSearchLinkProcesses` call. + * Use it to get the next page. + * When requesting subsequent pages of a response, remember that + * all parameters must match the values you provided + * in the original request. + * + * Generated from protobuf field string page_token = 4; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/BatchSearchLinkProcessesResponse.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/BatchSearchLinkProcessesResponse.php new file mode 100644 index 000000000000..6dd4e7df55b5 --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/BatchSearchLinkProcessesResponse.php @@ -0,0 +1,106 @@ +google.cloud.datacatalog.lineage.v1.BatchSearchLinkProcessesResponse + */ +class BatchSearchLinkProcessesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * An array of processes associated with the specified links. + * + * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.ProcessLinks process_links = 1; + */ + private $process_links; + /** + * The token to specify as `page_token` in the subsequent call to get the next + * page. Omitted if there are no more pages in the response. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DataCatalog\Lineage\V1\ProcessLinks>|\Google\Protobuf\Internal\RepeatedField $process_links + * An array of processes associated with the specified links. + * @type string $next_page_token + * The token to specify as `page_token` in the subsequent call to get the next + * page. Omitted if there are no more pages in the response. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); + parent::__construct($data); + } + + /** + * An array of processes associated with the specified links. + * + * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.ProcessLinks process_links = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getProcessLinks() + { + return $this->process_links; + } + + /** + * An array of processes associated with the specified links. + * + * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.ProcessLinks process_links = 1; + * @param array<\Google\Cloud\DataCatalog\Lineage\V1\ProcessLinks>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setProcessLinks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DataCatalog\Lineage\V1\ProcessLinks::class); + $this->process_links = $arr; + + return $this; + } + + /** + * The token to specify as `page_token` in the subsequent call to get the next + * page. Omitted if there are no more pages in the response. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * The token to specify as `page_token` in the subsequent call to get the next + * page. Omitted if there are no more pages in the response. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/CreateLineageEventRequest.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/CreateLineageEventRequest.php new file mode 100644 index 000000000000..dbe80ec46995 --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/CreateLineageEventRequest.php @@ -0,0 +1,170 @@ +google.cloud.datacatalog.lineage.v1.CreateLineageEventRequest + */ +class CreateLineageEventRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the run that should own the lineage event. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The lineage event to create. + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.LineageEvent lineage_event = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $lineage_event = null; + /** + * A unique identifier for this request. Restricted to 36 ASCII characters. + * A random UUID is recommended. This request is idempotent only if a + * `request_id` is provided. + * + * Generated from protobuf field string request_id = 3; + */ + protected $request_id = ''; + + /** + * @param string $parent Required. The name of the run that should own the lineage event. Please see + * {@see LineageClient::runName()} for help formatting this field. + * @param \Google\Cloud\DataCatalog\Lineage\V1\LineageEvent $lineageEvent Required. The lineage event to create. + * + * @return \Google\Cloud\DataCatalog\Lineage\V1\CreateLineageEventRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\DataCatalog\Lineage\V1\LineageEvent $lineageEvent): self + { + return (new self()) + ->setParent($parent) + ->setLineageEvent($lineageEvent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the run that should own the lineage event. + * @type \Google\Cloud\DataCatalog\Lineage\V1\LineageEvent $lineage_event + * Required. The lineage event to create. + * @type string $request_id + * A unique identifier for this request. Restricted to 36 ASCII characters. + * A random UUID is recommended. This request is idempotent only if a + * `request_id` is provided. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the run that should own the lineage event. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the run that should own the lineage event. + * + * 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 lineage event to create. + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.LineageEvent lineage_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\DataCatalog\Lineage\V1\LineageEvent|null + */ + public function getLineageEvent() + { + return $this->lineage_event; + } + + public function hasLineageEvent() + { + return isset($this->lineage_event); + } + + public function clearLineageEvent() + { + unset($this->lineage_event); + } + + /** + * Required. The lineage event to create. + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.LineageEvent lineage_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\DataCatalog\Lineage\V1\LineageEvent $var + * @return $this + */ + public function setLineageEvent($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\Lineage\V1\LineageEvent::class); + $this->lineage_event = $var; + + return $this; + } + + /** + * A unique identifier for this request. Restricted to 36 ASCII characters. + * A random UUID is recommended. This request is idempotent only if a + * `request_id` is provided. + * + * Generated from protobuf field string request_id = 3; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * A unique identifier for this request. Restricted to 36 ASCII characters. + * A random UUID is recommended. This request is idempotent only if a + * `request_id` is provided. + * + * Generated from protobuf field string request_id = 3; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/CreateProcessRequest.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/CreateProcessRequest.php new file mode 100644 index 000000000000..aa9d1ebaaee6 --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/CreateProcessRequest.php @@ -0,0 +1,175 @@ +google.cloud.datacatalog.lineage.v1.CreateProcessRequest + */ +class CreateProcessRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the project and its location that should own the + * process. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The process to create. + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Process process = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $process = null; + /** + * A unique identifier for this request. Restricted to 36 ASCII characters. + * A random UUID is recommended. This request is idempotent only if a + * `request_id` is provided. + * + * Generated from protobuf field string request_id = 3; + */ + protected $request_id = ''; + + /** + * @param string $parent Required. The name of the project and its location that should own the + * process. Please see + * {@see LineageClient::locationName()} for help formatting this field. + * @param \Google\Cloud\DataCatalog\Lineage\V1\Process $process Required. The process to create. + * + * @return \Google\Cloud\DataCatalog\Lineage\V1\CreateProcessRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\DataCatalog\Lineage\V1\Process $process): self + { + return (new self()) + ->setParent($parent) + ->setProcess($process); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the project and its location that should own the + * process. + * @type \Google\Cloud\DataCatalog\Lineage\V1\Process $process + * Required. The process to create. + * @type string $request_id + * A unique identifier for this request. Restricted to 36 ASCII characters. + * A random UUID is recommended. This request is idempotent only if a + * `request_id` is provided. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the project and its location that should own the + * process. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the project and its location that should own the + * process. + * + * 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 process to create. + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Process process = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\DataCatalog\Lineage\V1\Process|null + */ + public function getProcess() + { + return $this->process; + } + + public function hasProcess() + { + return isset($this->process); + } + + public function clearProcess() + { + unset($this->process); + } + + /** + * Required. The process to create. + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Process process = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\DataCatalog\Lineage\V1\Process $var + * @return $this + */ + public function setProcess($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\Lineage\V1\Process::class); + $this->process = $var; + + return $this; + } + + /** + * A unique identifier for this request. Restricted to 36 ASCII characters. + * A random UUID is recommended. This request is idempotent only if a + * `request_id` is provided. + * + * Generated from protobuf field string request_id = 3; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * A unique identifier for this request. Restricted to 36 ASCII characters. + * A random UUID is recommended. This request is idempotent only if a + * `request_id` is provided. + * + * Generated from protobuf field string request_id = 3; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/CreateRunRequest.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/CreateRunRequest.php new file mode 100644 index 000000000000..67ac72ae8277 --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/CreateRunRequest.php @@ -0,0 +1,170 @@ +google.cloud.datacatalog.lineage.v1.CreateRunRequest + */ +class CreateRunRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the process that should own the run. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The run to create. + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Run run = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $run = null; + /** + * A unique identifier for this request. Restricted to 36 ASCII characters. + * A random UUID is recommended. This request is idempotent only if a + * `request_id` is provided. + * + * Generated from protobuf field string request_id = 3; + */ + protected $request_id = ''; + + /** + * @param string $parent Required. The name of the process that should own the run. Please see + * {@see LineageClient::processName()} for help formatting this field. + * @param \Google\Cloud\DataCatalog\Lineage\V1\Run $run Required. The run to create. + * + * @return \Google\Cloud\DataCatalog\Lineage\V1\CreateRunRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\DataCatalog\Lineage\V1\Run $run): self + { + return (new self()) + ->setParent($parent) + ->setRun($run); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the process that should own the run. + * @type \Google\Cloud\DataCatalog\Lineage\V1\Run $run + * Required. The run to create. + * @type string $request_id + * A unique identifier for this request. Restricted to 36 ASCII characters. + * A random UUID is recommended. This request is idempotent only if a + * `request_id` is provided. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the process that should own the run. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the process that should own the run. + * + * 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 run to create. + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Run run = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\DataCatalog\Lineage\V1\Run|null + */ + public function getRun() + { + return $this->run; + } + + public function hasRun() + { + return isset($this->run); + } + + public function clearRun() + { + unset($this->run); + } + + /** + * Required. The run to create. + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Run run = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\DataCatalog\Lineage\V1\Run $var + * @return $this + */ + public function setRun($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\Lineage\V1\Run::class); + $this->run = $var; + + return $this; + } + + /** + * A unique identifier for this request. Restricted to 36 ASCII characters. + * A random UUID is recommended. This request is idempotent only if a + * `request_id` is provided. + * + * Generated from protobuf field string request_id = 3; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * A unique identifier for this request. Restricted to 36 ASCII characters. + * A random UUID is recommended. This request is idempotent only if a + * `request_id` is provided. + * + * Generated from protobuf field string request_id = 3; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/DeleteLineageEventRequest.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/DeleteLineageEventRequest.php new file mode 100644 index 000000000000..18b9d21a24a2 --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/DeleteLineageEventRequest.php @@ -0,0 +1,120 @@ +google.cloud.datacatalog.lineage.v1.DeleteLineageEventRequest + */ +class DeleteLineageEventRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the lineage event to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * If set to true and the lineage event is not found, the request + * succeeds but the server doesn't perform any actions. + * + * Generated from protobuf field bool allow_missing = 2; + */ + protected $allow_missing = false; + + /** + * @param string $name Required. The name of the lineage event to delete. Please see + * {@see LineageClient::lineageEventName()} for help formatting this field. + * + * @return \Google\Cloud\DataCatalog\Lineage\V1\DeleteLineageEventRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the lineage event to delete. + * @type bool $allow_missing + * If set to true and the lineage event is not found, the request + * succeeds but the server doesn't perform any actions. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the lineage event to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the lineage event to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * If set to true and the lineage event is not found, the request + * succeeds but the server doesn't perform any actions. + * + * Generated from protobuf field bool allow_missing = 2; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * If set to true and the lineage event is not found, the request + * succeeds but the server doesn't perform any actions. + * + * Generated from protobuf field bool allow_missing = 2; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/DeleteProcessRequest.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/DeleteProcessRequest.php new file mode 100644 index 000000000000..088e68cffa5b --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/DeleteProcessRequest.php @@ -0,0 +1,120 @@ +google.cloud.datacatalog.lineage.v1.DeleteProcessRequest + */ +class DeleteProcessRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the process to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * If set to true and the process is not found, the request + * succeeds but the server doesn't perform any actions. + * + * Generated from protobuf field bool allow_missing = 2; + */ + protected $allow_missing = false; + + /** + * @param string $name Required. The name of the process to delete. Please see + * {@see LineageClient::processName()} for help formatting this field. + * + * @return \Google\Cloud\DataCatalog\Lineage\V1\DeleteProcessRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the process to delete. + * @type bool $allow_missing + * If set to true and the process is not found, the request + * succeeds but the server doesn't perform any actions. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the process to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the process to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * If set to true and the process is not found, the request + * succeeds but the server doesn't perform any actions. + * + * Generated from protobuf field bool allow_missing = 2; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * If set to true and the process is not found, the request + * succeeds but the server doesn't perform any actions. + * + * Generated from protobuf field bool allow_missing = 2; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/DeleteRunRequest.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/DeleteRunRequest.php new file mode 100644 index 000000000000..bcc506513f22 --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/DeleteRunRequest.php @@ -0,0 +1,120 @@ +google.cloud.datacatalog.lineage.v1.DeleteRunRequest + */ +class DeleteRunRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the run to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * If set to true and the run is not found, the request + * succeeds but the server doesn't perform any actions. + * + * Generated from protobuf field bool allow_missing = 2; + */ + protected $allow_missing = false; + + /** + * @param string $name Required. The name of the run to delete. Please see + * {@see LineageClient::runName()} for help formatting this field. + * + * @return \Google\Cloud\DataCatalog\Lineage\V1\DeleteRunRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the run to delete. + * @type bool $allow_missing + * If set to true and the run is not found, the request + * succeeds but the server doesn't perform any actions. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the run to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the run to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * If set to true and the run is not found, the request + * succeeds but the server doesn't perform any actions. + * + * Generated from protobuf field bool allow_missing = 2; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * If set to true and the run is not found, the request + * succeeds but the server doesn't perform any actions. + * + * Generated from protobuf field bool allow_missing = 2; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/EntityReference.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/EntityReference.php new file mode 100644 index 000000000000..9925e0dce8a7 --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/EntityReference.php @@ -0,0 +1,75 @@ +google.cloud.datacatalog.lineage.v1.EntityReference + */ +class EntityReference extends \Google\Protobuf\Internal\Message +{ + /** + * Required. [Fully Qualified Name + * (FQN)](https://cloud.google.com/data-catalog/docs/fully-qualified-names) + * of the entity. + * + * Generated from protobuf field string fully_qualified_name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $fully_qualified_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $fully_qualified_name + * Required. [Fully Qualified Name + * (FQN)](https://cloud.google.com/data-catalog/docs/fully-qualified-names) + * of the entity. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); + parent::__construct($data); + } + + /** + * Required. [Fully Qualified Name + * (FQN)](https://cloud.google.com/data-catalog/docs/fully-qualified-names) + * of the entity. + * + * Generated from protobuf field string fully_qualified_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFullyQualifiedName() + { + return $this->fully_qualified_name; + } + + /** + * Required. [Fully Qualified Name + * (FQN)](https://cloud.google.com/data-catalog/docs/fully-qualified-names) + * of the entity. + * + * Generated from protobuf field string fully_qualified_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFullyQualifiedName($var) + { + GPBUtil::checkString($var, True); + $this->fully_qualified_name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/EventLink.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/EventLink.php new file mode 100644 index 000000000000..8d1247a25be5 --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/EventLink.php @@ -0,0 +1,121 @@ +google.cloud.datacatalog.lineage.v1.EventLink + */ +class EventLink extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Reference to the source entity + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.EntityReference source = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $source = null; + /** + * Required. Reference to the target entity + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.EntityReference target = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DataCatalog\Lineage\V1\EntityReference $source + * Required. Reference to the source entity + * @type \Google\Cloud\DataCatalog\Lineage\V1\EntityReference $target + * Required. Reference to the target entity + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); + parent::__construct($data); + } + + /** + * Required. Reference to the source entity + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.EntityReference source = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\DataCatalog\Lineage\V1\EntityReference|null + */ + public function getSource() + { + return $this->source; + } + + public function hasSource() + { + return isset($this->source); + } + + public function clearSource() + { + unset($this->source); + } + + /** + * Required. Reference to the source entity + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.EntityReference source = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\DataCatalog\Lineage\V1\EntityReference $var + * @return $this + */ + public function setSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\Lineage\V1\EntityReference::class); + $this->source = $var; + + return $this; + } + + /** + * Required. Reference to the target entity + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.EntityReference target = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\DataCatalog\Lineage\V1\EntityReference|null + */ + public function getTarget() + { + return $this->target; + } + + public function hasTarget() + { + return isset($this->target); + } + + public function clearTarget() + { + unset($this->target); + } + + /** + * Required. Reference to the target entity + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.EntityReference target = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\DataCatalog\Lineage\V1\EntityReference $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\Lineage\V1\EntityReference::class); + $this->target = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/GetLineageEventRequest.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/GetLineageEventRequest.php new file mode 100644 index 000000000000..bcfbb6140411 --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/GetLineageEventRequest.php @@ -0,0 +1,82 @@ +google.cloud.datacatalog.lineage.v1.GetLineageEventRequest + */ +class GetLineageEventRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the lineage event to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the lineage event to get. Please see + * {@see LineageClient::lineageEventName()} for help formatting this field. + * + * @return \Google\Cloud\DataCatalog\Lineage\V1\GetLineageEventRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the lineage event to get. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the lineage event to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the lineage event to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/GetProcessRequest.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/GetProcessRequest.php new file mode 100644 index 000000000000..7f23ce58f182 --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/GetProcessRequest.php @@ -0,0 +1,82 @@ +google.cloud.datacatalog.lineage.v1.GetProcessRequest + */ +class GetProcessRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the process to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the process to get. Please see + * {@see LineageClient::processName()} for help formatting this field. + * + * @return \Google\Cloud\DataCatalog\Lineage\V1\GetProcessRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the process to get. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the process to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the process to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/GetRunRequest.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/GetRunRequest.php new file mode 100644 index 000000000000..b0f0b84a2848 --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/GetRunRequest.php @@ -0,0 +1,82 @@ +google.cloud.datacatalog.lineage.v1.GetRunRequest + */ +class GetRunRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the run to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the run to get. Please see + * {@see LineageClient::runName()} for help formatting this field. + * + * @return \Google\Cloud\DataCatalog\Lineage\V1\GetRunRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the run to get. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the run to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the run to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/LineageEvent.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/LineageEvent.php new file mode 100644 index 000000000000..2f6da93d3340 --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/LineageEvent.php @@ -0,0 +1,226 @@ +google.cloud.datacatalog.lineage.v1.LineageEvent + */ +class LineageEvent extends \Google\Protobuf\Internal\Message +{ + /** + * Immutable. The resource name of the lineage event. + * Format: + * `projects/{project}/locations/{location}/processes/{process}/runs/{run}/lineageEvents/{lineage_event}`. + * Can be specified or auto-assigned. + * {lineage_event} must be not longer than 200 characters and only + * contain characters in a set: `a-zA-Z0-9_-:.` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $name = ''; + /** + * Optional. List of source-target pairs. Can't contain more than 100 tuples. + * + * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.EventLink links = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $links; + /** + * Required. The beginning of the transformation which resulted in this + * lineage event. For streaming scenarios, it should be the beginning of the + * period from which the lineage is being reported. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 6 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $start_time = null; + /** + * Optional. The end of the transformation which resulted in this lineage + * event. For streaming scenarios, it should be the end of the period from + * which the lineage is being reported. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $end_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Immutable. The resource name of the lineage event. + * Format: + * `projects/{project}/locations/{location}/processes/{process}/runs/{run}/lineageEvents/{lineage_event}`. + * Can be specified or auto-assigned. + * {lineage_event} must be not longer than 200 characters and only + * contain characters in a set: `a-zA-Z0-9_-:.` + * @type array<\Google\Cloud\DataCatalog\Lineage\V1\EventLink>|\Google\Protobuf\Internal\RepeatedField $links + * Optional. List of source-target pairs. Can't contain more than 100 tuples. + * @type \Google\Protobuf\Timestamp $start_time + * Required. The beginning of the transformation which resulted in this + * lineage event. For streaming scenarios, it should be the beginning of the + * period from which the lineage is being reported. + * @type \Google\Protobuf\Timestamp $end_time + * Optional. The end of the transformation which resulted in this lineage + * event. For streaming scenarios, it should be the end of the period from + * which the lineage is being reported. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); + parent::__construct($data); + } + + /** + * Immutable. The resource name of the lineage event. + * Format: + * `projects/{project}/locations/{location}/processes/{process}/runs/{run}/lineageEvents/{lineage_event}`. + * Can be specified or auto-assigned. + * {lineage_event} must be not longer than 200 characters and only + * contain characters in a set: `a-zA-Z0-9_-:.` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Immutable. The resource name of the lineage event. + * Format: + * `projects/{project}/locations/{location}/processes/{process}/runs/{run}/lineageEvents/{lineage_event}`. + * Can be specified or auto-assigned. + * {lineage_event} must be not longer than 200 characters and only + * contain characters in a set: `a-zA-Z0-9_-:.` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. List of source-target pairs. Can't contain more than 100 tuples. + * + * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.EventLink links = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLinks() + { + return $this->links; + } + + /** + * Optional. List of source-target pairs. Can't contain more than 100 tuples. + * + * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.EventLink links = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\DataCatalog\Lineage\V1\EventLink>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLinks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DataCatalog\Lineage\V1\EventLink::class); + $this->links = $arr; + + return $this; + } + + /** + * Required. The beginning of the transformation which resulted in this + * lineage event. For streaming scenarios, it should be the beginning of the + * period from which the lineage is being reported. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 6 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Required. The beginning of the transformation which resulted in this + * lineage event. For streaming scenarios, it should be the beginning of the + * period from which the lineage is being reported. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 6 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Optional. The end of the transformation which resulted in this lineage + * event. For streaming scenarios, it should be the end of the period from + * which the lineage is being reported. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Optional. The end of the transformation which resulted in this lineage + * event. For streaming scenarios, it should be the end of the period from + * which the lineage is being reported. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Link.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Link.php new file mode 100644 index 000000000000..bc87e154dbeb --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Link.php @@ -0,0 +1,250 @@ +google.cloud.datacatalog.lineage.v1.Link + */ +class Link extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Immutable. The name of the link. Format: + * `projects/{project}/locations/{location}/links/{link}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $name = ''; + /** + * The pointer to the entity that is the **source** of this link. + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.EntityReference source = 2; + */ + protected $source = null; + /** + * The pointer to the entity that is the **target** of this link. + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.EntityReference target = 3; + */ + protected $target = null; + /** + * The start of the first event establishing this link. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 4; + */ + protected $start_time = null; + /** + * The end of the last event establishing this link. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 5; + */ + protected $end_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Immutable. The name of the link. Format: + * `projects/{project}/locations/{location}/links/{link}`. + * @type \Google\Cloud\DataCatalog\Lineage\V1\EntityReference $source + * The pointer to the entity that is the **source** of this link. + * @type \Google\Cloud\DataCatalog\Lineage\V1\EntityReference $target + * The pointer to the entity that is the **target** of this link. + * @type \Google\Protobuf\Timestamp $start_time + * The start of the first event establishing this link. + * @type \Google\Protobuf\Timestamp $end_time + * The end of the last event establishing this link. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Immutable. The name of the link. Format: + * `projects/{project}/locations/{location}/links/{link}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Immutable. The name of the link. Format: + * `projects/{project}/locations/{location}/links/{link}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The pointer to the entity that is the **source** of this link. + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.EntityReference source = 2; + * @return \Google\Cloud\DataCatalog\Lineage\V1\EntityReference|null + */ + public function getSource() + { + return $this->source; + } + + public function hasSource() + { + return isset($this->source); + } + + public function clearSource() + { + unset($this->source); + } + + /** + * The pointer to the entity that is the **source** of this link. + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.EntityReference source = 2; + * @param \Google\Cloud\DataCatalog\Lineage\V1\EntityReference $var + * @return $this + */ + public function setSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\Lineage\V1\EntityReference::class); + $this->source = $var; + + return $this; + } + + /** + * The pointer to the entity that is the **target** of this link. + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.EntityReference target = 3; + * @return \Google\Cloud\DataCatalog\Lineage\V1\EntityReference|null + */ + public function getTarget() + { + return $this->target; + } + + public function hasTarget() + { + return isset($this->target); + } + + public function clearTarget() + { + unset($this->target); + } + + /** + * The pointer to the entity that is the **target** of this link. + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.EntityReference target = 3; + * @param \Google\Cloud\DataCatalog\Lineage\V1\EntityReference $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\Lineage\V1\EntityReference::class); + $this->target = $var; + + return $this; + } + + /** + * The start of the first event establishing this link. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * The start of the first event establishing this link. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * The end of the last event establishing this link. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 5; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * The end of the last event establishing this link. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 5; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListLineageEventsRequest.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListLineageEventsRequest.php new file mode 100644 index 000000000000..02a1847041af --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListLineageEventsRequest.php @@ -0,0 +1,178 @@ +google.cloud.datacatalog.lineage.v1.ListLineageEventsRequest + */ +class ListLineageEventsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the run that owns the collection of lineage events to + * get. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The maximum number of lineage events to return. + * The service may return fewer events than this value. + * If unspecified, at most 50 events are returned. The maximum value is 100; + * values greater than 100 are cut to 100. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * The page token received from a previous `ListLineageEvents` call. Specify + * it to get the next page. + * When paginating, all other parameters specified in this call must + * match the parameters of the call that provided the page token. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The name of the run that owns the collection of lineage events to + * get. Please see {@see LineageClient::runName()} for help formatting this field. + * + * @return \Google\Cloud\DataCatalog\Lineage\V1\ListLineageEventsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the run that owns the collection of lineage events to + * get. + * @type int $page_size + * The maximum number of lineage events to return. + * The service may return fewer events than this value. + * If unspecified, at most 50 events are returned. The maximum value is 100; + * values greater than 100 are cut to 100. + * @type string $page_token + * The page token received from a previous `ListLineageEvents` call. Specify + * it to get the next page. + * When paginating, all other parameters specified in this call must + * match the parameters of the call that provided the page token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the run that owns the collection of lineage events to + * get. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the run that owns the collection of lineage events to + * get. + * + * 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; + } + + /** + * The maximum number of lineage events to return. + * The service may return fewer events than this value. + * If unspecified, at most 50 events are returned. The maximum value is 100; + * values greater than 100 are cut to 100. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of lineage events to return. + * The service may return fewer events than this value. + * If unspecified, at most 50 events are returned. The maximum value is 100; + * values greater than 100 are cut to 100. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The page token received from a previous `ListLineageEvents` call. Specify + * it to get the next page. + * When paginating, all other parameters specified in this call must + * match the parameters of the call that provided the page token. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The page token received from a previous `ListLineageEvents` call. Specify + * it to get the next page. + * When paginating, all other parameters specified in this call must + * match the parameters of the call that provided the page token. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListLineageEventsResponse.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListLineageEventsResponse.php new file mode 100644 index 000000000000..1543999a54a6 --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListLineageEventsResponse.php @@ -0,0 +1,106 @@ +google.cloud.datacatalog.lineage.v1.ListLineageEventsResponse + */ +class ListLineageEventsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Lineage events from the specified project and location. + * + * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.LineageEvent lineage_events = 1; + */ + private $lineage_events; + /** + * The token to specify as `page_token` in the next call to get the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DataCatalog\Lineage\V1\LineageEvent>|\Google\Protobuf\Internal\RepeatedField $lineage_events + * Lineage events from the specified project and location. + * @type string $next_page_token + * The token to specify as `page_token` in the next call to get the next page. + * If this field is omitted, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); + parent::__construct($data); + } + + /** + * Lineage events from the specified project and location. + * + * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.LineageEvent lineage_events = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLineageEvents() + { + return $this->lineage_events; + } + + /** + * Lineage events from the specified project and location. + * + * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.LineageEvent lineage_events = 1; + * @param array<\Google\Cloud\DataCatalog\Lineage\V1\LineageEvent>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLineageEvents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DataCatalog\Lineage\V1\LineageEvent::class); + $this->lineage_events = $arr; + + return $this; + } + + /** + * The token to specify as `page_token` in the next call to get the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * The token to specify as `page_token` in the next call to get the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListProcessesRequest.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListProcessesRequest.php new file mode 100644 index 000000000000..1b81bb00d128 --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListProcessesRequest.php @@ -0,0 +1,179 @@ +google.cloud.datacatalog.lineage.v1.ListProcessesRequest + */ +class ListProcessesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the project and its location that owns this + * collection of processes. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The maximum number of processes to return. The service may return + * fewer than this value. If unspecified, at most 50 processes are + * returned. The maximum value is 100; values greater than 100 are cut to + * 100. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * The page token received from a previous `ListProcesses` call. Specify + * it to get the next page. + * When paginating, all other parameters specified in this call must + * match the parameters of the call that provided the page token. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The name of the project and its location that owns this + * collection of processes. Please see + * {@see LineageClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\DataCatalog\Lineage\V1\ListProcessesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the project and its location that owns this + * collection of processes. + * @type int $page_size + * The maximum number of processes to return. The service may return + * fewer than this value. If unspecified, at most 50 processes are + * returned. The maximum value is 100; values greater than 100 are cut to + * 100. + * @type string $page_token + * The page token received from a previous `ListProcesses` call. Specify + * it to get the next page. + * When paginating, all other parameters specified in this call must + * match the parameters of the call that provided the page token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the project and its location that owns this + * collection of processes. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the project and its location that owns this + * collection of processes. + * + * 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; + } + + /** + * The maximum number of processes to return. The service may return + * fewer than this value. If unspecified, at most 50 processes are + * returned. The maximum value is 100; values greater than 100 are cut to + * 100. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of processes to return. The service may return + * fewer than this value. If unspecified, at most 50 processes are + * returned. The maximum value is 100; values greater than 100 are cut to + * 100. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The page token received from a previous `ListProcesses` call. Specify + * it to get the next page. + * When paginating, all other parameters specified in this call must + * match the parameters of the call that provided the page token. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The page token received from a previous `ListProcesses` call. Specify + * it to get the next page. + * When paginating, all other parameters specified in this call must + * match the parameters of the call that provided the page token. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListProcessesResponse.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListProcessesResponse.php new file mode 100644 index 000000000000..075a0e6e3dc4 --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListProcessesResponse.php @@ -0,0 +1,106 @@ +google.cloud.datacatalog.lineage.v1.ListProcessesResponse + */ +class ListProcessesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The processes from the specified project and location. + * + * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.Process processes = 1; + */ + private $processes; + /** + * The token to specify as `page_token` in the next call to get the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DataCatalog\Lineage\V1\Process>|\Google\Protobuf\Internal\RepeatedField $processes + * The processes from the specified project and location. + * @type string $next_page_token + * The token to specify as `page_token` in the next call to get the next page. + * If this field is omitted, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); + parent::__construct($data); + } + + /** + * The processes from the specified project and location. + * + * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.Process processes = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getProcesses() + { + return $this->processes; + } + + /** + * The processes from the specified project and location. + * + * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.Process processes = 1; + * @param array<\Google\Cloud\DataCatalog\Lineage\V1\Process>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setProcesses($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DataCatalog\Lineage\V1\Process::class); + $this->processes = $arr; + + return $this; + } + + /** + * The token to specify as `page_token` in the next call to get the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * The token to specify as `page_token` in the next call to get the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListRunsRequest.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListRunsRequest.php new file mode 100644 index 000000000000..6a762c1e9dcd --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListRunsRequest.php @@ -0,0 +1,174 @@ +google.cloud.datacatalog.lineage.v1.ListRunsRequest + */ +class ListRunsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of process that owns this collection of runs. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The maximum number of runs to return. The service may return + * fewer than this value. If unspecified, at most 50 runs are + * returned. The maximum value is 100; values greater than 100 are cut to + * 100. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * The page token received from a previous `ListRuns` call. Specify + * it to get the next page. + * When paginating, all other parameters specified in this call must + * match the parameters of the call that provided the page token. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The name of process that owns this collection of runs. Please see + * {@see LineageClient::processName()} for help formatting this field. + * + * @return \Google\Cloud\DataCatalog\Lineage\V1\ListRunsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of process that owns this collection of runs. + * @type int $page_size + * The maximum number of runs to return. The service may return + * fewer than this value. If unspecified, at most 50 runs are + * returned. The maximum value is 100; values greater than 100 are cut to + * 100. + * @type string $page_token + * The page token received from a previous `ListRuns` call. Specify + * it to get the next page. + * When paginating, all other parameters specified in this call must + * match the parameters of the call that provided the page token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of process that owns this collection of runs. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of process that owns this collection of runs. + * + * 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; + } + + /** + * The maximum number of runs to return. The service may return + * fewer than this value. If unspecified, at most 50 runs are + * returned. The maximum value is 100; values greater than 100 are cut to + * 100. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of runs to return. The service may return + * fewer than this value. If unspecified, at most 50 runs are + * returned. The maximum value is 100; values greater than 100 are cut to + * 100. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The page token received from a previous `ListRuns` call. Specify + * it to get the next page. + * When paginating, all other parameters specified in this call must + * match the parameters of the call that provided the page token. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The page token received from a previous `ListRuns` call. Specify + * it to get the next page. + * When paginating, all other parameters specified in this call must + * match the parameters of the call that provided the page token. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListRunsResponse.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListRunsResponse.php new file mode 100644 index 000000000000..ad73a867f0ca --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListRunsResponse.php @@ -0,0 +1,106 @@ +google.cloud.datacatalog.lineage.v1.ListRunsResponse + */ +class ListRunsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The runs from the specified project and location. + * + * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.Run runs = 1; + */ + private $runs; + /** + * The token to specify as `page_token` in the next call to get the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DataCatalog\Lineage\V1\Run>|\Google\Protobuf\Internal\RepeatedField $runs + * The runs from the specified project and location. + * @type string $next_page_token + * The token to specify as `page_token` in the next call to get the next page. + * If this field is omitted, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); + parent::__construct($data); + } + + /** + * The runs from the specified project and location. + * + * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.Run runs = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRuns() + { + return $this->runs; + } + + /** + * The runs from the specified project and location. + * + * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.Run runs = 1; + * @param array<\Google\Cloud\DataCatalog\Lineage\V1\Run>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRuns($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DataCatalog\Lineage\V1\Run::class); + $this->runs = $arr; + + return $this; + } + + /** + * The token to specify as `page_token` in the next call to get the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * The token to specify as `page_token` in the next call to get the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/OperationMetadata.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/OperationMetadata.php new file mode 100644 index 000000000000..4043b7e1dd3c --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/OperationMetadata.php @@ -0,0 +1,269 @@ +google.cloud.datacatalog.lineage.v1.OperationMetadata + */ +class OperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The current operation state. + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.OperationMetadata.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. The type of the operation being performed. + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.OperationMetadata.Type operation_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $operation_type = 0; + /** + * Output only. The [relative name] + * (https://cloud.google.com//apis/design/resource_names#relative_resource_name) + * of the resource being operated on. + * + * Generated from protobuf field string resource = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $resource = ''; + /** + * Output only. The UUID of the resource being operated on. + * + * Generated from protobuf field string resource_uuid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $resource_uuid = ''; + /** + * Output only. The timestamp of the operation submission to the server. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The timestamp of the operation termination, regardless of its + * success. This field is unset if the operation is still ongoing. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $state + * Output only. The current operation state. + * @type int $operation_type + * Output only. The type of the operation being performed. + * @type string $resource + * Output only. The [relative name] + * (https://cloud.google.com//apis/design/resource_names#relative_resource_name) + * of the resource being operated on. + * @type string $resource_uuid + * Output only. The UUID of the resource being operated on. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The timestamp of the operation submission to the server. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The timestamp of the operation termination, regardless of its + * success. This field is unset if the operation is still ongoing. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The current operation state. + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.OperationMetadata.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The current operation state. + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.OperationMetadata.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DataCatalog\Lineage\V1\OperationMetadata\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. The type of the operation being performed. + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.OperationMetadata.Type operation_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getOperationType() + { + return $this->operation_type; + } + + /** + * Output only. The type of the operation being performed. + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.OperationMetadata.Type operation_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setOperationType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DataCatalog\Lineage\V1\OperationMetadata\Type::class); + $this->operation_type = $var; + + return $this; + } + + /** + * Output only. The [relative name] + * (https://cloud.google.com//apis/design/resource_names#relative_resource_name) + * of the resource being operated on. + * + * Generated from protobuf field string resource = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Output only. The [relative name] + * (https://cloud.google.com//apis/design/resource_names#relative_resource_name) + * of the resource being operated on. + * + * Generated from protobuf field string resource = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * Output only. The UUID of the resource being operated on. + * + * Generated from protobuf field string resource_uuid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getResourceUuid() + { + return $this->resource_uuid; + } + + /** + * Output only. The UUID of the resource being operated on. + * + * Generated from protobuf field string resource_uuid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setResourceUuid($var) + { + GPBUtil::checkString($var, True); + $this->resource_uuid = $var; + + return $this; + } + + /** + * Output only. The timestamp of the operation submission to the server. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The timestamp of the operation submission to the server. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The timestamp of the operation termination, regardless of its + * success. This field is unset if the operation is still ongoing. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The timestamp of the operation termination, regardless of its + * success. This field is unset if the operation is still ongoing. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/OperationMetadata/State.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/OperationMetadata/State.php new file mode 100644 index 000000000000..5dcdd98eed98 --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/OperationMetadata/State.php @@ -0,0 +1,78 @@ +google.cloud.datacatalog.lineage.v1.OperationMetadata.State + */ +class State +{ + /** + * Unused. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The operation has been created but is not yet started. + * + * Generated from protobuf enum PENDING = 1; + */ + const PENDING = 1; + /** + * The operation is underway. + * + * Generated from protobuf enum RUNNING = 2; + */ + const RUNNING = 2; + /** + * The operation completed successfully. + * + * Generated from protobuf enum SUCCEEDED = 3; + */ + const SUCCEEDED = 3; + /** + * The operation is no longer running and did not succeed. + * + * Generated from protobuf enum FAILED = 4; + */ + const FAILED = 4; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::PENDING => 'PENDING', + self::RUNNING => 'RUNNING', + self::SUCCEEDED => 'SUCCEEDED', + self::FAILED => 'FAILED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\DataCatalog\Lineage\V1\OperationMetadata_State::class); + diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/OperationMetadata/Type.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/OperationMetadata/Type.php new file mode 100644 index 000000000000..2ea01f6e0b6e --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/OperationMetadata/Type.php @@ -0,0 +1,64 @@ +google.cloud.datacatalog.lineage.v1.OperationMetadata.Type + */ +class Type +{ + /** + * Unused. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * The resource deletion operation. + * + * Generated from protobuf enum DELETE = 1; + */ + const DELETE = 1; + /** + * The resource creation operation. + * + * Generated from protobuf enum CREATE = 2; + */ + const CREATE = 2; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::DELETE => 'DELETE', + self::CREATE => 'CREATE', + ]; + + 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(Type::class, \Google\Cloud\DataCatalog\Lineage\V1\OperationMetadata_Type::class); + diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Origin.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Origin.php new file mode 100644 index 000000000000..7ff80980f5ac --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Origin.php @@ -0,0 +1,141 @@ +google.cloud.datacatalog.lineage.v1.Origin + */ +class Origin extends \Google\Protobuf\Internal\Message +{ + /** + * Type of the source. + * Use of a source_type other than `CUSTOM` for process creation + * or updating is highly discouraged, and may be restricted in the future + * without notice. + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Origin.SourceType source_type = 1; + */ + protected $source_type = 0; + /** + * If the source_type isn't CUSTOM, the value of this field should be a GCP + * resource name of the system, which reports lineage. The project and + * location parts of the resource name must match the project and location of + * the lineage resource being created. Examples: + * - `{source_type: COMPOSER, name: + * "projects/foo/locations/us/environments/bar"}` + * - `{source_type: BIGQUERY, name: "projects/foo/locations/eu"}` + * - `{source_type: CUSTOM, name: "myCustomIntegration"}` + * + * Generated from protobuf field string name = 2; + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $source_type + * Type of the source. + * Use of a source_type other than `CUSTOM` for process creation + * or updating is highly discouraged, and may be restricted in the future + * without notice. + * @type string $name + * If the source_type isn't CUSTOM, the value of this field should be a GCP + * resource name of the system, which reports lineage. The project and + * location parts of the resource name must match the project and location of + * the lineage resource being created. Examples: + * - `{source_type: COMPOSER, name: + * "projects/foo/locations/us/environments/bar"}` + * - `{source_type: BIGQUERY, name: "projects/foo/locations/eu"}` + * - `{source_type: CUSTOM, name: "myCustomIntegration"}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); + parent::__construct($data); + } + + /** + * Type of the source. + * Use of a source_type other than `CUSTOM` for process creation + * or updating is highly discouraged, and may be restricted in the future + * without notice. + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Origin.SourceType source_type = 1; + * @return int + */ + public function getSourceType() + { + return $this->source_type; + } + + /** + * Type of the source. + * Use of a source_type other than `CUSTOM` for process creation + * or updating is highly discouraged, and may be restricted in the future + * without notice. + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Origin.SourceType source_type = 1; + * @param int $var + * @return $this + */ + public function setSourceType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DataCatalog\Lineage\V1\Origin\SourceType::class); + $this->source_type = $var; + + return $this; + } + + /** + * If the source_type isn't CUSTOM, the value of this field should be a GCP + * resource name of the system, which reports lineage. The project and + * location parts of the resource name must match the project and location of + * the lineage resource being created. Examples: + * - `{source_type: COMPOSER, name: + * "projects/foo/locations/us/environments/bar"}` + * - `{source_type: BIGQUERY, name: "projects/foo/locations/eu"}` + * - `{source_type: CUSTOM, name: "myCustomIntegration"}` + * + * Generated from protobuf field string name = 2; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * If the source_type isn't CUSTOM, the value of this field should be a GCP + * resource name of the system, which reports lineage. The project and + * location parts of the resource name must match the project and location of + * the lineage resource being created. Examples: + * - `{source_type: COMPOSER, name: + * "projects/foo/locations/us/environments/bar"}` + * - `{source_type: BIGQUERY, name: "projects/foo/locations/eu"}` + * - `{source_type: CUSTOM, name: "myCustomIntegration"}` + * + * Generated from protobuf field string name = 2; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Origin/SourceType.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Origin/SourceType.php new file mode 100644 index 000000000000..c1dcb06d5789 --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Origin/SourceType.php @@ -0,0 +1,92 @@ +google.cloud.datacatalog.lineage.v1.Origin.SourceType + */ +class SourceType +{ + /** + * Source is Unspecified + * + * Generated from protobuf enum SOURCE_TYPE_UNSPECIFIED = 0; + */ + const SOURCE_TYPE_UNSPECIFIED = 0; + /** + * A custom source + * + * Generated from protobuf enum CUSTOM = 1; + */ + const CUSTOM = 1; + /** + * BigQuery + * + * Generated from protobuf enum BIGQUERY = 2; + */ + const BIGQUERY = 2; + /** + * Data Fusion + * + * Generated from protobuf enum DATA_FUSION = 3; + */ + const DATA_FUSION = 3; + /** + * Composer + * + * Generated from protobuf enum COMPOSER = 4; + */ + const COMPOSER = 4; + /** + * Looker Studio + * + * Generated from protobuf enum LOOKER_STUDIO = 5; + */ + const LOOKER_STUDIO = 5; + /** + * Dataproc + * + * Generated from protobuf enum DATAPROC = 6; + */ + const DATAPROC = 6; + + private static $valueToName = [ + self::SOURCE_TYPE_UNSPECIFIED => 'SOURCE_TYPE_UNSPECIFIED', + self::CUSTOM => 'CUSTOM', + self::BIGQUERY => 'BIGQUERY', + self::DATA_FUSION => 'DATA_FUSION', + self::COMPOSER => 'COMPOSER', + self::LOOKER_STUDIO => 'LOOKER_STUDIO', + self::DATAPROC => 'DATAPROC', + ]; + + 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(SourceType::class, \Google\Cloud\DataCatalog\Lineage\V1\Origin_SourceType::class); + diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Process.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Process.php new file mode 100644 index 000000000000..7e3b5ce22728 --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Process.php @@ -0,0 +1,215 @@ +google.cloud.datacatalog.lineage.v1.Process + */ +class Process extends \Google\Protobuf\Internal\Message +{ + /** + * Immutable. The resource name of the lineage process. Format: + * `projects/{project}/locations/{location}/processes/{process}`. + * Can be specified or auto-assigned. + * {process} must be not longer than 200 characters and only + * contain characters in a set: `a-zA-Z0-9_-:.` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $name = ''; + /** + * Optional. A human-readable name you can set to display in a user interface. + * Must be not longer than 200 characters and only contain UTF-8 letters + * or numbers, spaces or characters like `_-:&.` + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_name = ''; + /** + * Optional. The attributes of the process. Should only be used for the + * purpose of non-semantic management (classifying, describing or labeling the + * process). + * Up to 100 attributes are allowed. + * + * Generated from protobuf field map attributes = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $attributes; + /** + * Optional. The origin of this process and its runs and lineage events. + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Origin origin = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $origin = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Immutable. The resource name of the lineage process. Format: + * `projects/{project}/locations/{location}/processes/{process}`. + * Can be specified or auto-assigned. + * {process} must be not longer than 200 characters and only + * contain characters in a set: `a-zA-Z0-9_-:.` + * @type string $display_name + * Optional. A human-readable name you can set to display in a user interface. + * Must be not longer than 200 characters and only contain UTF-8 letters + * or numbers, spaces or characters like `_-:&.` + * @type array|\Google\Protobuf\Internal\MapField $attributes + * Optional. The attributes of the process. Should only be used for the + * purpose of non-semantic management (classifying, describing or labeling the + * process). + * Up to 100 attributes are allowed. + * @type \Google\Cloud\DataCatalog\Lineage\V1\Origin $origin + * Optional. The origin of this process and its runs and lineage events. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); + parent::__construct($data); + } + + /** + * Immutable. The resource name of the lineage process. Format: + * `projects/{project}/locations/{location}/processes/{process}`. + * Can be specified or auto-assigned. + * {process} must be not longer than 200 characters and only + * contain characters in a set: `a-zA-Z0-9_-:.` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Immutable. The resource name of the lineage process. Format: + * `projects/{project}/locations/{location}/processes/{process}`. + * Can be specified or auto-assigned. + * {process} must be not longer than 200 characters and only + * contain characters in a set: `a-zA-Z0-9_-:.` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. A human-readable name you can set to display in a user interface. + * Must be not longer than 200 characters and only contain UTF-8 letters + * or numbers, spaces or characters like `_-:&.` + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Optional. A human-readable name you can set to display in a user interface. + * Must be not longer than 200 characters and only contain UTF-8 letters + * or numbers, spaces or characters like `_-:&.` + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Optional. The attributes of the process. Should only be used for the + * purpose of non-semantic management (classifying, describing or labeling the + * process). + * Up to 100 attributes are allowed. + * + * Generated from protobuf field map attributes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * Optional. The attributes of the process. Should only be used for the + * purpose of non-semantic management (classifying, describing or labeling the + * process). + * Up to 100 attributes are allowed. + * + * Generated from protobuf field map attributes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAttributes($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Value::class); + $this->attributes = $arr; + + return $this; + } + + /** + * Optional. The origin of this process and its runs and lineage events. + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Origin origin = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\DataCatalog\Lineage\V1\Origin|null + */ + public function getOrigin() + { + return $this->origin; + } + + public function hasOrigin() + { + return isset($this->origin); + } + + public function clearOrigin() + { + unset($this->origin); + } + + /** + * Optional. The origin of this process and its runs and lineage events. + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Origin origin = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\DataCatalog\Lineage\V1\Origin $var + * @return $this + */ + public function setOrigin($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\Lineage\V1\Origin::class); + $this->origin = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ProcessLinkInfo.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ProcessLinkInfo.php new file mode 100644 index 000000000000..2b02891300f5 --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ProcessLinkInfo.php @@ -0,0 +1,159 @@ +google.cloud.datacatalog.lineage.v1.ProcessLinkInfo + */ +class ProcessLinkInfo extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the link in the format of + * `projects/{project}/locations/{location}/links/{link}`. + * + * Generated from protobuf field string link = 1; + */ + protected $link = ''; + /** + * The start of the first event establishing this link-process tuple. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2; + */ + protected $start_time = null; + /** + * The end of the last event establishing this link-process tuple. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; + */ + protected $end_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $link + * The name of the link in the format of + * `projects/{project}/locations/{location}/links/{link}`. + * @type \Google\Protobuf\Timestamp $start_time + * The start of the first event establishing this link-process tuple. + * @type \Google\Protobuf\Timestamp $end_time + * The end of the last event establishing this link-process tuple. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); + parent::__construct($data); + } + + /** + * The name of the link in the format of + * `projects/{project}/locations/{location}/links/{link}`. + * + * Generated from protobuf field string link = 1; + * @return string + */ + public function getLink() + { + return $this->link; + } + + /** + * The name of the link in the format of + * `projects/{project}/locations/{location}/links/{link}`. + * + * Generated from protobuf field string link = 1; + * @param string $var + * @return $this + */ + public function setLink($var) + { + GPBUtil::checkString($var, True); + $this->link = $var; + + return $this; + } + + /** + * The start of the first event establishing this link-process tuple. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * The start of the first event establishing this link-process tuple. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * The end of the last event establishing this link-process tuple. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * The end of the last event establishing this link-process tuple. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ProcessLinks.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ProcessLinks.php new file mode 100644 index 000000000000..dc67efad53f0 --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ProcessLinks.php @@ -0,0 +1,121 @@ +google.cloud.datacatalog.lineage.v1.ProcessLinks + */ +class ProcessLinks extends \Google\Protobuf\Internal\Message +{ + /** + * The process name in the format of + * `projects/{project}/locations/{location}/processes/{process}`. + * + * Generated from protobuf field string process = 1 [(.google.api.resource_reference) = { + */ + protected $process = ''; + /** + * An array containing link details objects of the links provided in + * the original request. + * A single process can result in creating multiple links. + * If any of the links you provide in the request are created by + * the same process, they all are included in this array. + * + * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.ProcessLinkInfo links = 2; + */ + private $links; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $process + * The process name in the format of + * `projects/{project}/locations/{location}/processes/{process}`. + * @type array<\Google\Cloud\DataCatalog\Lineage\V1\ProcessLinkInfo>|\Google\Protobuf\Internal\RepeatedField $links + * An array containing link details objects of the links provided in + * the original request. + * A single process can result in creating multiple links. + * If any of the links you provide in the request are created by + * the same process, they all are included in this array. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); + parent::__construct($data); + } + + /** + * The process name in the format of + * `projects/{project}/locations/{location}/processes/{process}`. + * + * Generated from protobuf field string process = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getProcess() + { + return $this->process; + } + + /** + * The process name in the format of + * `projects/{project}/locations/{location}/processes/{process}`. + * + * Generated from protobuf field string process = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setProcess($var) + { + GPBUtil::checkString($var, True); + $this->process = $var; + + return $this; + } + + /** + * An array containing link details objects of the links provided in + * the original request. + * A single process can result in creating multiple links. + * If any of the links you provide in the request are created by + * the same process, they all are included in this array. + * + * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.ProcessLinkInfo links = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLinks() + { + return $this->links; + } + + /** + * An array containing link details objects of the links provided in + * the original request. + * A single process can result in creating multiple links. + * If any of the links you provide in the request are created by + * the same process, they all are included in this array. + * + * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.ProcessLinkInfo links = 2; + * @param array<\Google\Cloud\DataCatalog\Lineage\V1\ProcessLinkInfo>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLinks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DataCatalog\Lineage\V1\ProcessLinkInfo::class); + $this->links = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ProcessOpenLineageRunEventRequest.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ProcessOpenLineageRunEventRequest.php new file mode 100644 index 000000000000..b079efe53f2e --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ProcessOpenLineageRunEventRequest.php @@ -0,0 +1,179 @@ +google.cloud.datacatalog.lineage.v1.ProcessOpenLineageRunEventRequest + */ +class ProcessOpenLineageRunEventRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the project and its location that should own the + * process, run, and lineage event. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * Required. OpenLineage message following OpenLineage format: + * https://github.com/OpenLineage/OpenLineage/blob/main/spec/OpenLineage.json + * + * Generated from protobuf field .google.protobuf.Struct open_lineage = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $open_lineage = null; + /** + * A unique identifier for this request. Restricted to 36 ASCII characters. + * A random UUID is recommended. This request is idempotent only if a + * `request_id` is provided. + * + * Generated from protobuf field string request_id = 3; + */ + protected $request_id = ''; + + /** + * @param string $parent Required. The name of the project and its location that should own the + * process, run, and lineage event. + * @param \Google\Protobuf\Struct $openLineage Required. OpenLineage message following OpenLineage format: + * https://github.com/OpenLineage/OpenLineage/blob/main/spec/OpenLineage.json + * + * @return \Google\Cloud\DataCatalog\Lineage\V1\ProcessOpenLineageRunEventRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Protobuf\Struct $openLineage): self + { + return (new self()) + ->setParent($parent) + ->setOpenLineage($openLineage); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the project and its location that should own the + * process, run, and lineage event. + * @type \Google\Protobuf\Struct $open_lineage + * Required. OpenLineage message following OpenLineage format: + * https://github.com/OpenLineage/OpenLineage/blob/main/spec/OpenLineage.json + * @type string $request_id + * A unique identifier for this request. Restricted to 36 ASCII characters. + * A random UUID is recommended. This request is idempotent only if a + * `request_id` is provided. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the project and its location that should own the + * process, run, and lineage event. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The name of the project and its location that should own the + * process, run, and lineage event. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. OpenLineage message following OpenLineage format: + * https://github.com/OpenLineage/OpenLineage/blob/main/spec/OpenLineage.json + * + * Generated from protobuf field .google.protobuf.Struct open_lineage = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Struct|null + */ + public function getOpenLineage() + { + return $this->open_lineage; + } + + public function hasOpenLineage() + { + return isset($this->open_lineage); + } + + public function clearOpenLineage() + { + unset($this->open_lineage); + } + + /** + * Required. OpenLineage message following OpenLineage format: + * https://github.com/OpenLineage/OpenLineage/blob/main/spec/OpenLineage.json + * + * Generated from protobuf field .google.protobuf.Struct open_lineage = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setOpenLineage($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->open_lineage = $var; + + return $this; + } + + /** + * A unique identifier for this request. Restricted to 36 ASCII characters. + * A random UUID is recommended. This request is idempotent only if a + * `request_id` is provided. + * + * Generated from protobuf field string request_id = 3; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * A unique identifier for this request. Restricted to 36 ASCII characters. + * A random UUID is recommended. This request is idempotent only if a + * `request_id` is provided. + * + * Generated from protobuf field string request_id = 3; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ProcessOpenLineageRunEventResponse.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ProcessOpenLineageRunEventResponse.php new file mode 100644 index 000000000000..37a196bfebfd --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ProcessOpenLineageRunEventResponse.php @@ -0,0 +1,156 @@ +google.cloud.datacatalog.lineage.v1.ProcessOpenLineageRunEventResponse + */ +class ProcessOpenLineageRunEventResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Created process name. + * Format: `projects/{project}/locations/{location}/processes/{process}`. + * + * Generated from protobuf field string process = 1 [(.google.api.resource_reference) = { + */ + protected $process = ''; + /** + * Created run name. + * Format: + * `projects/{project}/locations/{location}/processes/{process}/runs/{run}`. + * + * Generated from protobuf field string run = 2 [(.google.api.resource_reference) = { + */ + protected $run = ''; + /** + * Created lineage event names. + * Format: + * `projects/{project}/locations/{location}/processes/{process}/runs/{run}/lineageEvents/{lineage_event}`. + * + * Generated from protobuf field repeated string lineage_events = 3 [(.google.api.resource_reference) = { + */ + private $lineage_events; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $process + * Created process name. + * Format: `projects/{project}/locations/{location}/processes/{process}`. + * @type string $run + * Created run name. + * Format: + * `projects/{project}/locations/{location}/processes/{process}/runs/{run}`. + * @type array|\Google\Protobuf\Internal\RepeatedField $lineage_events + * Created lineage event names. + * Format: + * `projects/{project}/locations/{location}/processes/{process}/runs/{run}/lineageEvents/{lineage_event}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); + parent::__construct($data); + } + + /** + * Created process name. + * Format: `projects/{project}/locations/{location}/processes/{process}`. + * + * Generated from protobuf field string process = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getProcess() + { + return $this->process; + } + + /** + * Created process name. + * Format: `projects/{project}/locations/{location}/processes/{process}`. + * + * Generated from protobuf field string process = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setProcess($var) + { + GPBUtil::checkString($var, True); + $this->process = $var; + + return $this; + } + + /** + * Created run name. + * Format: + * `projects/{project}/locations/{location}/processes/{process}/runs/{run}`. + * + * Generated from protobuf field string run = 2 [(.google.api.resource_reference) = { + * @return string + */ + public function getRun() + { + return $this->run; + } + + /** + * Created run name. + * Format: + * `projects/{project}/locations/{location}/processes/{process}/runs/{run}`. + * + * Generated from protobuf field string run = 2 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setRun($var) + { + GPBUtil::checkString($var, True); + $this->run = $var; + + return $this; + } + + /** + * Created lineage event names. + * Format: + * `projects/{project}/locations/{location}/processes/{process}/runs/{run}/lineageEvents/{lineage_event}`. + * + * Generated from protobuf field repeated string lineage_events = 3 [(.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLineageEvents() + { + return $this->lineage_events; + } + + /** + * Created lineage event names. + * Format: + * `projects/{project}/locations/{location}/processes/{process}/runs/{run}/lineageEvents/{lineage_event}`. + * + * Generated from protobuf field repeated string lineage_events = 3 [(.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLineageEvents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->lineage_events = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Run.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Run.php new file mode 100644 index 000000000000..b9f690869130 --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Run.php @@ -0,0 +1,290 @@ +google.cloud.datacatalog.lineage.v1.Run + */ +class Run extends \Google\Protobuf\Internal\Message +{ + /** + * Immutable. The resource name of the run. Format: + * `projects/{project}/locations/{location}/processes/{process}/runs/{run}`. + * Can be specified or auto-assigned. + * {run} must be not longer than 200 characters and only + * contain characters in a set: `a-zA-Z0-9_-:.` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $name = ''; + /** + * Optional. A human-readable name you can set to display in a user interface. + * Must be not longer than 1024 characters and only contain UTF-8 letters + * or numbers, spaces or characters like `_-:&.` + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_name = ''; + /** + * Optional. The attributes of the run. Should only be used for the purpose of + * non-semantic management (classifying, describing or labeling the run). + * Up to 100 attributes are allowed. + * + * Generated from protobuf field map attributes = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $attributes; + /** + * Required. The timestamp of the start of the run. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $start_time = null; + /** + * Optional. The timestamp of the end of the run. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $end_time = null; + /** + * Required. The state of the run. + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Run.State state = 6 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $state = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Immutable. The resource name of the run. Format: + * `projects/{project}/locations/{location}/processes/{process}/runs/{run}`. + * Can be specified or auto-assigned. + * {run} must be not longer than 200 characters and only + * contain characters in a set: `a-zA-Z0-9_-:.` + * @type string $display_name + * Optional. A human-readable name you can set to display in a user interface. + * Must be not longer than 1024 characters and only contain UTF-8 letters + * or numbers, spaces or characters like `_-:&.` + * @type array|\Google\Protobuf\Internal\MapField $attributes + * Optional. The attributes of the run. Should only be used for the purpose of + * non-semantic management (classifying, describing or labeling the run). + * Up to 100 attributes are allowed. + * @type \Google\Protobuf\Timestamp $start_time + * Required. The timestamp of the start of the run. + * @type \Google\Protobuf\Timestamp $end_time + * Optional. The timestamp of the end of the run. + * @type int $state + * Required. The state of the run. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); + parent::__construct($data); + } + + /** + * Immutable. The resource name of the run. Format: + * `projects/{project}/locations/{location}/processes/{process}/runs/{run}`. + * Can be specified or auto-assigned. + * {run} must be not longer than 200 characters and only + * contain characters in a set: `a-zA-Z0-9_-:.` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Immutable. The resource name of the run. Format: + * `projects/{project}/locations/{location}/processes/{process}/runs/{run}`. + * Can be specified or auto-assigned. + * {run} must be not longer than 200 characters and only + * contain characters in a set: `a-zA-Z0-9_-:.` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. A human-readable name you can set to display in a user interface. + * Must be not longer than 1024 characters and only contain UTF-8 letters + * or numbers, spaces or characters like `_-:&.` + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Optional. A human-readable name you can set to display in a user interface. + * Must be not longer than 1024 characters and only contain UTF-8 letters + * or numbers, spaces or characters like `_-:&.` + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Optional. The attributes of the run. Should only be used for the purpose of + * non-semantic management (classifying, describing or labeling the run). + * Up to 100 attributes are allowed. + * + * Generated from protobuf field map attributes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * Optional. The attributes of the run. Should only be used for the purpose of + * non-semantic management (classifying, describing or labeling the run). + * Up to 100 attributes are allowed. + * + * Generated from protobuf field map attributes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAttributes($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Value::class); + $this->attributes = $arr; + + return $this; + } + + /** + * Required. The timestamp of the start of the run. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Required. The timestamp of the start of the run. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Optional. The timestamp of the end of the run. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Optional. The timestamp of the end of the run. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Required. The state of the run. + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Run.State state = 6 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Required. The state of the run. + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Run.State state = 6 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DataCatalog\Lineage\V1\Run\State::class); + $this->state = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Run/State.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Run/State.php new file mode 100644 index 000000000000..7fce45aebf28 --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Run/State.php @@ -0,0 +1,79 @@ +google.cloud.datacatalog.lineage.v1.Run.State + */ +class State +{ + /** + * The state is unknown. The true state may be any of the below or a + * different state that is not supported here explicitly. + * + * Generated from protobuf enum UNKNOWN = 0; + */ + const UNKNOWN = 0; + /** + * The run is still executing. + * + * Generated from protobuf enum STARTED = 1; + */ + const STARTED = 1; + /** + * The run completed. + * + * Generated from protobuf enum COMPLETED = 2; + */ + const COMPLETED = 2; + /** + * The run failed. + * + * Generated from protobuf enum FAILED = 3; + */ + const FAILED = 3; + /** + * The run aborted. + * + * Generated from protobuf enum ABORTED = 4; + */ + const ABORTED = 4; + + private static $valueToName = [ + self::UNKNOWN => 'UNKNOWN', + self::STARTED => 'STARTED', + self::COMPLETED => 'COMPLETED', + self::FAILED => 'FAILED', + self::ABORTED => 'ABORTED', + ]; + + 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(State::class, \Google\Cloud\DataCatalog\Lineage\V1\Run_State::class); + diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/SearchLinksRequest.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/SearchLinksRequest.php new file mode 100644 index 000000000000..61cfe999f15d --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/SearchLinksRequest.php @@ -0,0 +1,245 @@ +google.cloud.datacatalog.lineage.v1.SearchLinksRequest + */ +class SearchLinksRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location you want search in. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of links to return in a single page of the + * response. A page may contain fewer links than this value. If unspecified, + * at most 10 links are returned. + * Maximum value is 100; values greater than 100 are reduced to 100. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The page token received from a previous `SearchLinksRequest` + * call. Use it to get the next page. + * When requesting subsequent pages of a response, remember that + * all parameters must match the values you provided + * in the original request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + protected $criteria; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location you want search in. + * @type \Google\Cloud\DataCatalog\Lineage\V1\EntityReference $source + * Optional. Send asset information in the **source** field to retrieve all + * links that lead from the specified asset to downstream assets. + * @type \Google\Cloud\DataCatalog\Lineage\V1\EntityReference $target + * Optional. Send asset information in the **target** field to retrieve all + * links that lead from upstream assets to the specified asset. + * @type int $page_size + * Optional. The maximum number of links to return in a single page of the + * response. A page may contain fewer links than this value. If unspecified, + * at most 10 links are returned. + * Maximum value is 100; values greater than 100 are reduced to 100. + * @type string $page_token + * Optional. The page token received from a previous `SearchLinksRequest` + * call. Use it to get the next page. + * When requesting subsequent pages of a response, remember that + * all parameters must match the values you provided + * in the original request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location you want search in. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location you want search in. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Send asset information in the **source** field to retrieve all + * links that lead from the specified asset to downstream assets. + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.EntityReference source = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\DataCatalog\Lineage\V1\EntityReference|null + */ + public function getSource() + { + return $this->readOneof(4); + } + + public function hasSource() + { + return $this->hasOneof(4); + } + + /** + * Optional. Send asset information in the **source** field to retrieve all + * links that lead from the specified asset to downstream assets. + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.EntityReference source = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\DataCatalog\Lineage\V1\EntityReference $var + * @return $this + */ + public function setSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\Lineage\V1\EntityReference::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Optional. Send asset information in the **target** field to retrieve all + * links that lead from upstream assets to the specified asset. + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.EntityReference target = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\DataCatalog\Lineage\V1\EntityReference|null + */ + public function getTarget() + { + return $this->readOneof(5); + } + + public function hasTarget() + { + return $this->hasOneof(5); + } + + /** + * Optional. Send asset information in the **target** field to retrieve all + * links that lead from upstream assets to the specified asset. + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.EntityReference target = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\DataCatalog\Lineage\V1\EntityReference $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\Lineage\V1\EntityReference::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Optional. The maximum number of links to return in a single page of the + * response. A page may contain fewer links than this value. If unspecified, + * at most 10 links are returned. + * Maximum value is 100; values greater than 100 are reduced to 100. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of links to return in a single page of the + * response. A page may contain fewer links than this value. If unspecified, + * at most 10 links are returned. + * Maximum value is 100; values greater than 100 are reduced to 100. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The page token received from a previous `SearchLinksRequest` + * call. Use it to get the next page. + * When requesting subsequent pages of a response, remember that + * all parameters must match the values you provided + * in the original request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The page token received from a previous `SearchLinksRequest` + * call. Use it to get the next page. + * When requesting subsequent pages of a response, remember that + * all parameters must match the values you provided + * in the original request. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * @return string + */ + public function getCriteria() + { + return $this->whichOneof("criteria"); + } + +} + diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/SearchLinksResponse.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/SearchLinksResponse.php new file mode 100644 index 000000000000..e54d2eb0e0fe --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/SearchLinksResponse.php @@ -0,0 +1,110 @@ +google.cloud.datacatalog.lineage.v1.SearchLinksResponse + */ +class SearchLinksResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of links for a given asset. Can be empty if the asset has no + * relations of requested type (source or target). + * + * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.Link links = 1; + */ + private $links; + /** + * The token to specify as `page_token` in the subsequent call to get the next + * page. Omitted if there are no more pages in the response. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DataCatalog\Lineage\V1\Link>|\Google\Protobuf\Internal\RepeatedField $links + * The list of links for a given asset. Can be empty if the asset has no + * relations of requested type (source or target). + * @type string $next_page_token + * The token to specify as `page_token` in the subsequent call to get the next + * page. Omitted if there are no more pages in the response. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); + parent::__construct($data); + } + + /** + * The list of links for a given asset. Can be empty if the asset has no + * relations of requested type (source or target). + * + * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.Link links = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLinks() + { + return $this->links; + } + + /** + * The list of links for a given asset. Can be empty if the asset has no + * relations of requested type (source or target). + * + * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.Link links = 1; + * @param array<\Google\Cloud\DataCatalog\Lineage\V1\Link>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLinks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DataCatalog\Lineage\V1\Link::class); + $this->links = $arr; + + return $this; + } + + /** + * The token to specify as `page_token` in the subsequent call to get the next + * page. Omitted if there are no more pages in the response. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * The token to specify as `page_token` in the subsequent call to get the next + * page. Omitted if there are no more pages in the response. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/UpdateProcessRequest.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/UpdateProcessRequest.php new file mode 100644 index 000000000000..9b26ec7372de --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/UpdateProcessRequest.php @@ -0,0 +1,182 @@ +google.cloud.datacatalog.lineage.v1.UpdateProcessRequest + */ +class UpdateProcessRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The lineage process to update. + * The process's `name` field is used to identify the process to update. + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Process process = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $process = null; + /** + * The list of fields to update. Currently not used. The whole message is + * updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + /** + * If set to true and the process is not found, the request inserts it. + * + * Generated from protobuf field bool allow_missing = 3; + */ + protected $allow_missing = false; + + /** + * @param \Google\Cloud\DataCatalog\Lineage\V1\Process $process Required. The lineage process to update. + * + * The process's `name` field is used to identify the process to update. + * @param \Google\Protobuf\FieldMask $updateMask The list of fields to update. Currently not used. The whole message is + * updated. + * + * @return \Google\Cloud\DataCatalog\Lineage\V1\UpdateProcessRequest + * + * @experimental + */ + public static function build(\Google\Cloud\DataCatalog\Lineage\V1\Process $process, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setProcess($process) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DataCatalog\Lineage\V1\Process $process + * Required. The lineage process to update. + * The process's `name` field is used to identify the process to update. + * @type \Google\Protobuf\FieldMask $update_mask + * The list of fields to update. Currently not used. The whole message is + * updated. + * @type bool $allow_missing + * If set to true and the process is not found, the request inserts it. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); + parent::__construct($data); + } + + /** + * Required. The lineage process to update. + * The process's `name` field is used to identify the process to update. + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Process process = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\DataCatalog\Lineage\V1\Process|null + */ + public function getProcess() + { + return $this->process; + } + + public function hasProcess() + { + return isset($this->process); + } + + public function clearProcess() + { + unset($this->process); + } + + /** + * Required. The lineage process to update. + * The process's `name` field is used to identify the process to update. + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Process process = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\DataCatalog\Lineage\V1\Process $var + * @return $this + */ + public function setProcess($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\Lineage\V1\Process::class); + $this->process = $var; + + return $this; + } + + /** + * The list of fields to update. Currently not used. The whole message is + * updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * The list of fields to update. Currently not used. The whole message is + * updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * If set to true and the process is not found, the request inserts it. + * + * Generated from protobuf field bool allow_missing = 3; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * If set to true and the process is not found, the request inserts it. + * + * Generated from protobuf field bool allow_missing = 3; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/UpdateRunRequest.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/UpdateRunRequest.php new file mode 100644 index 000000000000..8122fdd17704 --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/UpdateRunRequest.php @@ -0,0 +1,193 @@ +google.cloud.datacatalog.lineage.v1.UpdateRunRequest + */ +class UpdateRunRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The lineage run to update. + * The run's `name` field is used to identify the run to update. + * Format: + * `projects/{project}/locations/{location}/processes/{process}/runs/{run}`. + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Run run = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $run = null; + /** + * The list of fields to update. Currently not used. The whole message is + * updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + /** + * If set to true and the run is not found, the request creates it. + * + * Generated from protobuf field bool allow_missing = 3; + */ + protected $allow_missing = false; + + /** + * @param \Google\Cloud\DataCatalog\Lineage\V1\Run $run Required. The lineage run to update. + * + * The run's `name` field is used to identify the run to update. + * + * Format: + * `projects/{project}/locations/{location}/processes/{process}/runs/{run}`. + * @param \Google\Protobuf\FieldMask $updateMask The list of fields to update. Currently not used. The whole message is + * updated. + * + * @return \Google\Cloud\DataCatalog\Lineage\V1\UpdateRunRequest + * + * @experimental + */ + public static function build(\Google\Cloud\DataCatalog\Lineage\V1\Run $run, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setRun($run) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DataCatalog\Lineage\V1\Run $run + * Required. The lineage run to update. + * The run's `name` field is used to identify the run to update. + * Format: + * `projects/{project}/locations/{location}/processes/{process}/runs/{run}`. + * @type \Google\Protobuf\FieldMask $update_mask + * The list of fields to update. Currently not used. The whole message is + * updated. + * @type bool $allow_missing + * If set to true and the run is not found, the request creates it. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); + parent::__construct($data); + } + + /** + * Required. The lineage run to update. + * The run's `name` field is used to identify the run to update. + * Format: + * `projects/{project}/locations/{location}/processes/{process}/runs/{run}`. + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Run run = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\DataCatalog\Lineage\V1\Run|null + */ + public function getRun() + { + return $this->run; + } + + public function hasRun() + { + return isset($this->run); + } + + public function clearRun() + { + unset($this->run); + } + + /** + * Required. The lineage run to update. + * The run's `name` field is used to identify the run to update. + * Format: + * `projects/{project}/locations/{location}/processes/{process}/runs/{run}`. + * + * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Run run = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\DataCatalog\Lineage\V1\Run $var + * @return $this + */ + public function setRun($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\Lineage\V1\Run::class); + $this->run = $var; + + return $this; + } + + /** + * The list of fields to update. Currently not used. The whole message is + * updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * The list of fields to update. Currently not used. The whole message is + * updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * If set to true and the run is not found, the request creates it. + * + * Generated from protobuf field bool allow_missing = 3; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * If set to true and the run is not found, the request creates it. + * + * Generated from protobuf field bool allow_missing = 3; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/batch_search_link_processes.php b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/batch_search_link_processes.php new file mode 100644 index 000000000000..68e9a401868d --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/batch_search_link_processes.php @@ -0,0 +1,99 @@ +setParent($formattedParent) + ->setLinks($links); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $lineageClient->batchSearchLinkProcesses($request); + + /** @var ProcessLinks $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = LineageClient::locationName('[PROJECT]', '[LOCATION]'); + $linksElement = '[LINKS]'; + + batch_search_link_processes_sample($formattedParent, $linksElement); +} +// [END datalineage_v1_generated_Lineage_BatchSearchLinkProcesses_sync] diff --git a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/create_lineage_event.php b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/create_lineage_event.php new file mode 100644 index 000000000000..c9da4efde8aa --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/create_lineage_event.php @@ -0,0 +1,76 @@ +setStartTime($lineageEventStartTime); + $request = (new CreateLineageEventRequest()) + ->setParent($formattedParent) + ->setLineageEvent($lineageEvent); + + // Call the API and handle any network failures. + try { + /** @var LineageEvent $response */ + $response = $lineageClient->createLineageEvent($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = LineageClient::runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); + + create_lineage_event_sample($formattedParent); +} +// [END datalineage_v1_generated_Lineage_CreateLineageEvent_sync] diff --git a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/create_process.php b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/create_process.php new file mode 100644 index 000000000000..de3bd8e24140 --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/create_process.php @@ -0,0 +1,74 @@ +setParent($formattedParent) + ->setProcess($process); + + // Call the API and handle any network failures. + try { + /** @var Process $response */ + $response = $lineageClient->createProcess($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = LineageClient::locationName('[PROJECT]', '[LOCATION]'); + + create_process_sample($formattedParent); +} +// [END datalineage_v1_generated_Lineage_CreateProcess_sync] diff --git a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/create_run.php b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/create_run.php new file mode 100644 index 000000000000..0a001b418cd4 --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/create_run.php @@ -0,0 +1,80 @@ +setStartTime($runStartTime) + ->setState($runState); + $request = (new CreateRunRequest()) + ->setParent($formattedParent) + ->setRun($run); + + // Call the API and handle any network failures. + try { + /** @var Run $response */ + $response = $lineageClient->createRun($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = LineageClient::processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); + $runState = State::UNKNOWN; + + create_run_sample($formattedParent, $runState); +} +// [END datalineage_v1_generated_Lineage_CreateRun_sync] diff --git a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/delete_lineage_event.php b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/delete_lineage_event.php new file mode 100644 index 000000000000..a44e3cbec51a --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/delete_lineage_event.php @@ -0,0 +1,75 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $lineageClient->deleteLineageEvent($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = LineageClient::lineageEventName( + '[PROJECT]', + '[LOCATION]', + '[PROCESS]', + '[RUN]', + '[LINEAGE_EVENT]' + ); + + delete_lineage_event_sample($formattedName); +} +// [END datalineage_v1_generated_Lineage_DeleteLineageEvent_sync] diff --git a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/delete_process.php b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/delete_process.php new file mode 100644 index 000000000000..9e847a3a522f --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/delete_process.php @@ -0,0 +1,80 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $lineageClient->deleteProcess($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = LineageClient::processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); + + delete_process_sample($formattedName); +} +// [END datalineage_v1_generated_Lineage_DeleteProcess_sync] diff --git a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/delete_run.php b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/delete_run.php new file mode 100644 index 000000000000..d54daa9b613f --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/delete_run.php @@ -0,0 +1,80 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $lineageClient->deleteRun($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = LineageClient::runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); + + delete_run_sample($formattedName); +} +// [END datalineage_v1_generated_Lineage_DeleteRun_sync] diff --git a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/get_lineage_event.php b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/get_lineage_event.php new file mode 100644 index 000000000000..af73bcd87409 --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/get_lineage_event.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var LineageEvent $response */ + $response = $lineageClient->getLineageEvent($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = LineageClient::lineageEventName( + '[PROJECT]', + '[LOCATION]', + '[PROCESS]', + '[RUN]', + '[LINEAGE_EVENT]' + ); + + get_lineage_event_sample($formattedName); +} +// [END datalineage_v1_generated_Lineage_GetLineageEvent_sync] diff --git a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/get_process.php b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/get_process.php new file mode 100644 index 000000000000..bbcb7725fbd8 --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/get_process.php @@ -0,0 +1,71 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Process $response */ + $response = $lineageClient->getProcess($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = LineageClient::processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); + + get_process_sample($formattedName); +} +// [END datalineage_v1_generated_Lineage_GetProcess_sync] diff --git a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/get_run.php b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/get_run.php new file mode 100644 index 000000000000..1c7f828f3747 --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/get_run.php @@ -0,0 +1,71 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Run $response */ + $response = $lineageClient->getRun($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = LineageClient::runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); + + get_run_sample($formattedName); +} +// [END datalineage_v1_generated_Lineage_GetRun_sync] diff --git a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/list_lineage_events.php b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/list_lineage_events.php new file mode 100644 index 000000000000..6d9d7d95410f --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/list_lineage_events.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $lineageClient->listLineageEvents($request); + + /** @var LineageEvent $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = LineageClient::runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); + + list_lineage_events_sample($formattedParent); +} +// [END datalineage_v1_generated_Lineage_ListLineageEvents_sync] diff --git a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/list_processes.php b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/list_processes.php new file mode 100644 index 000000000000..cc374dcf0524 --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/list_processes.php @@ -0,0 +1,78 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $lineageClient->listProcesses($request); + + /** @var Process $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = LineageClient::locationName('[PROJECT]', '[LOCATION]'); + + list_processes_sample($formattedParent); +} +// [END datalineage_v1_generated_Lineage_ListProcesses_sync] diff --git a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/list_runs.php b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/list_runs.php new file mode 100644 index 000000000000..966835a13579 --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/list_runs.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $lineageClient->listRuns($request); + + /** @var Run $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = LineageClient::processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); + + list_runs_sample($formattedParent); +} +// [END datalineage_v1_generated_Lineage_ListRuns_sync] diff --git a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/process_open_lineage_run_event.php b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/process_open_lineage_run_event.php new file mode 100644 index 000000000000..31d127d270ef --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/process_open_lineage_run_event.php @@ -0,0 +1,77 @@ +setParent($parent) + ->setOpenLineage($openLineage); + + // Call the API and handle any network failures. + try { + /** @var ProcessOpenLineageRunEventResponse $response */ + $response = $lineageClient->processOpenLineageRunEvent($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + + process_open_lineage_run_event_sample($parent); +} +// [END datalineage_v1_generated_Lineage_ProcessOpenLineageRunEvent_sync] diff --git a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/search_links.php b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/search_links.php new file mode 100644 index 000000000000..0e5b874e858f --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/search_links.php @@ -0,0 +1,84 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $lineageClient->searchLinks($request); + + /** @var Link $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = LineageClient::locationName('[PROJECT]', '[LOCATION]'); + + search_links_sample($formattedParent); +} +// [END datalineage_v1_generated_Lineage_SearchLinks_sync] diff --git a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/update_process.php b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/update_process.php new file mode 100644 index 000000000000..706330545719 --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/update_process.php @@ -0,0 +1,59 @@ +setProcess($process); + + // Call the API and handle any network failures. + try { + /** @var Process $response */ + $response = $lineageClient->updateProcess($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END datalineage_v1_generated_Lineage_UpdateProcess_sync] diff --git a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/update_run.php b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/update_run.php new file mode 100644 index 000000000000..c8acb38a692d --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/update_run.php @@ -0,0 +1,76 @@ +setStartTime($runStartTime) + ->setState($runState); + $request = (new UpdateRunRequest()) + ->setRun($run); + + // Call the API and handle any network failures. + try { + /** @var Run $response */ + $response = $lineageClient->updateRun($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $runState = State::UNKNOWN; + + update_run_sample($runState); +} +// [END datalineage_v1_generated_Lineage_UpdateRun_sync] diff --git a/owl-bot-staging/DataCatalogLineage/v1/src/V1/Client/LineageClient.php b/owl-bot-staging/DataCatalogLineage/v1/src/V1/Client/LineageClient.php new file mode 100644 index 000000000000..7abb39d57029 --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/src/V1/Client/LineageClient.php @@ -0,0 +1,817 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/lineage_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/lineage_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/lineage_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/lineage_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Formats a string containing the fully-qualified path to represent a + * lineage_event resource. + * + * @param string $project + * @param string $location + * @param string $process + * @param string $run + * @param string $lineageEvent + * + * @return string The formatted lineage_event resource. + */ + public static function lineageEventName(string $project, string $location, string $process, string $run, string $lineageEvent): string + { + return self::getPathTemplate('lineageEvent')->render([ + 'project' => $project, + 'location' => $location, + 'process' => $process, + 'run' => $run, + 'lineage_event' => $lineageEvent, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a process + * resource. + * + * @param string $project + * @param string $location + * @param string $process + * + * @return string The formatted process resource. + */ + public static function processName(string $project, string $location, string $process): string + { + return self::getPathTemplate('process')->render([ + 'project' => $project, + 'location' => $location, + 'process' => $process, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a run + * resource. + * + * @param string $project + * @param string $location + * @param string $process + * @param string $run + * + * @return string The formatted run resource. + */ + public static function runName(string $project, string $location, string $process, string $run): string + { + return self::getPathTemplate('run')->render([ + 'project' => $project, + 'location' => $location, + 'process' => $process, + 'run' => $run, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - lineageEvent: projects/{project}/locations/{location}/processes/{process}/runs/{run}/lineageEvents/{lineage_event} + * - location: projects/{project}/locations/{location} + * - process: projects/{project}/locations/{location}/processes/{process} + * - run: projects/{project}/locations/{location}/processes/{process}/runs/{run} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'datalineage.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieve information about LineageProcesses associated with specific + * links. LineageProcesses are transformation pipelines that result in data + * flowing from **source** to **target** assets. Links between assets + * represent this operation. + * + * If you have specific link names, you can use this method to + * verify which LineageProcesses contribute to creating those links. + * See the + * [SearchLinks][google.cloud.datacatalog.lineage.v1.Lineage.SearchLinks] + * method for more information on how to retrieve link name. + * + * You can retrieve the LineageProcess information in every project where you + * have the `datalineage.events.get` permission. The project provided in the + * URL is used for Billing and Quota. + * + * The async variant is {@see LineageClient::batchSearchLinkProcessesAsync()} . + * + * @example samples/V1/LineageClient/batch_search_link_processes.php + * + * @param BatchSearchLinkProcessesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function batchSearchLinkProcesses(BatchSearchLinkProcessesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('BatchSearchLinkProcesses', $request, $callOptions); + } + + /** + * Creates a new lineage event. + * + * The async variant is {@see LineageClient::createLineageEventAsync()} . + * + * @example samples/V1/LineageClient/create_lineage_event.php + * + * @param CreateLineageEventRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return LineageEvent + * + * @throws ApiException Thrown if the API call fails. + */ + public function createLineageEvent(CreateLineageEventRequest $request, array $callOptions = []): LineageEvent + { + return $this->startApiCall('CreateLineageEvent', $request, $callOptions)->wait(); + } + + /** + * Creates a new process. + * + * The async variant is {@see LineageClient::createProcessAsync()} . + * + * @example samples/V1/LineageClient/create_process.php + * + * @param CreateProcessRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Process + * + * @throws ApiException Thrown if the API call fails. + */ + public function createProcess(CreateProcessRequest $request, array $callOptions = []): Process + { + return $this->startApiCall('CreateProcess', $request, $callOptions)->wait(); + } + + /** + * Creates a new run. + * + * The async variant is {@see LineageClient::createRunAsync()} . + * + * @example samples/V1/LineageClient/create_run.php + * + * @param CreateRunRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Run + * + * @throws ApiException Thrown if the API call fails. + */ + public function createRun(CreateRunRequest $request, array $callOptions = []): Run + { + return $this->startApiCall('CreateRun', $request, $callOptions)->wait(); + } + + /** + * Deletes the lineage event with the specified name. + * + * The async variant is {@see LineageClient::deleteLineageEventAsync()} . + * + * @example samples/V1/LineageClient/delete_lineage_event.php + * + * @param DeleteLineageEventRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteLineageEvent(DeleteLineageEventRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteLineageEvent', $request, $callOptions)->wait(); + } + + /** + * Deletes the process with the specified name. + * + * The async variant is {@see LineageClient::deleteProcessAsync()} . + * + * @example samples/V1/LineageClient/delete_process.php + * + * @param DeleteProcessRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteProcess(DeleteProcessRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteProcess', $request, $callOptions)->wait(); + } + + /** + * Deletes the run with the specified name. + * + * The async variant is {@see LineageClient::deleteRunAsync()} . + * + * @example samples/V1/LineageClient/delete_run.php + * + * @param DeleteRunRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteRun(DeleteRunRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteRun', $request, $callOptions)->wait(); + } + + /** + * Gets details of a specified lineage event. + * + * The async variant is {@see LineageClient::getLineageEventAsync()} . + * + * @example samples/V1/LineageClient/get_lineage_event.php + * + * @param GetLineageEventRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return LineageEvent + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLineageEvent(GetLineageEventRequest $request, array $callOptions = []): LineageEvent + { + return $this->startApiCall('GetLineageEvent', $request, $callOptions)->wait(); + } + + /** + * Gets the details of the specified process. + * + * The async variant is {@see LineageClient::getProcessAsync()} . + * + * @example samples/V1/LineageClient/get_process.php + * + * @param GetProcessRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Process + * + * @throws ApiException Thrown if the API call fails. + */ + public function getProcess(GetProcessRequest $request, array $callOptions = []): Process + { + return $this->startApiCall('GetProcess', $request, $callOptions)->wait(); + } + + /** + * Gets the details of the specified run. + * + * The async variant is {@see LineageClient::getRunAsync()} . + * + * @example samples/V1/LineageClient/get_run.php + * + * @param GetRunRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Run + * + * @throws ApiException Thrown if the API call fails. + */ + public function getRun(GetRunRequest $request, array $callOptions = []): Run + { + return $this->startApiCall('GetRun', $request, $callOptions)->wait(); + } + + /** + * Lists lineage events in the given project and location. The list order is + * not defined. + * + * The async variant is {@see LineageClient::listLineageEventsAsync()} . + * + * @example samples/V1/LineageClient/list_lineage_events.php + * + * @param ListLineageEventsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLineageEvents(ListLineageEventsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLineageEvents', $request, $callOptions); + } + + /** + * List processes in the given project and location. List order is descending + * by insertion time. + * + * The async variant is {@see LineageClient::listProcessesAsync()} . + * + * @example samples/V1/LineageClient/list_processes.php + * + * @param ListProcessesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listProcesses(ListProcessesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListProcesses', $request, $callOptions); + } + + /** + * Lists runs in the given project and location. List order is descending by + * `start_time`. + * + * The async variant is {@see LineageClient::listRunsAsync()} . + * + * @example samples/V1/LineageClient/list_runs.php + * + * @param ListRunsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listRuns(ListRunsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListRuns', $request, $callOptions); + } + + /** + * Creates new lineage events together with their parents: process and run. + * Updates the process and run if they already exist. + * Mapped from Open Lineage specification: + * https://github.com/OpenLineage/OpenLineage/blob/main/spec/OpenLineage.json. + * + * The async variant is {@see LineageClient::processOpenLineageRunEventAsync()} . + * + * @example samples/V1/LineageClient/process_open_lineage_run_event.php + * + * @param ProcessOpenLineageRunEventRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ProcessOpenLineageRunEventResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function processOpenLineageRunEvent(ProcessOpenLineageRunEventRequest $request, array $callOptions = []): ProcessOpenLineageRunEventResponse + { + return $this->startApiCall('ProcessOpenLineageRunEvent', $request, $callOptions)->wait(); + } + + /** + * Retrieve a list of links connected to a specific asset. + * Links represent the data flow between **source** (upstream) + * and **target** (downstream) assets in transformation pipelines. + * Links are stored in the same project as the Lineage Events that create + * them. + * + * You can retrieve links in every project where you have the + * `datalineage.events.get` permission. The project provided in the URL + * is used for Billing and Quota. + * + * The async variant is {@see LineageClient::searchLinksAsync()} . + * + * @example samples/V1/LineageClient/search_links.php + * + * @param SearchLinksRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function searchLinks(SearchLinksRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('SearchLinks', $request, $callOptions); + } + + /** + * Updates a process. + * + * The async variant is {@see LineageClient::updateProcessAsync()} . + * + * @example samples/V1/LineageClient/update_process.php + * + * @param UpdateProcessRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Process + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateProcess(UpdateProcessRequest $request, array $callOptions = []): Process + { + return $this->startApiCall('UpdateProcess', $request, $callOptions)->wait(); + } + + /** + * Updates a run. + * + * The async variant is {@see LineageClient::updateRunAsync()} . + * + * @example samples/V1/LineageClient/update_run.php + * + * @param UpdateRunRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Run + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateRun(UpdateRunRequest $request, array $callOptions = []): Run + { + return $this->startApiCall('UpdateRun', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/DataCatalogLineage/v1/src/V1/Gapic/LineageGapicClient.php b/owl-bot-staging/DataCatalogLineage/v1/src/V1/Gapic/LineageGapicClient.php new file mode 100644 index 000000000000..6d227fea2a33 --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/src/V1/Gapic/LineageGapicClient.php @@ -0,0 +1,1431 @@ +locationName('[PROJECT]', '[LOCATION]'); + * $links = []; + * // Iterate over pages of elements + * $pagedResponse = $lineageClient->batchSearchLinkProcesses($formattedParent, $links); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $lineageClient->batchSearchLinkProcesses($formattedParent, $links); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $lineageClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * This service has a new (beta) implementation. See {@see + * \Google\Cloud\DataCatalog\Lineage\V1\Client\LineageClient} to use the new + * surface. + */ +class LineageGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.datacatalog.lineage.v1.Lineage'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'datalineage.googleapis.com'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static $lineageEventNameTemplate; + + private static $locationNameTemplate; + + private static $processNameTemplate; + + private static $runNameTemplate; + + private static $pathTemplateMap; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/lineage_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/lineage_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/lineage_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/lineage_rest_client_config.php', + ], + ], + ]; + } + + private static function getLineageEventNameTemplate() + { + if (self::$lineageEventNameTemplate == null) { + self::$lineageEventNameTemplate = new PathTemplate('projects/{project}/locations/{location}/processes/{process}/runs/{run}/lineageEvents/{lineage_event}'); + } + + return self::$lineageEventNameTemplate; + } + + private static function getLocationNameTemplate() + { + if (self::$locationNameTemplate == null) { + self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); + } + + return self::$locationNameTemplate; + } + + private static function getProcessNameTemplate() + { + if (self::$processNameTemplate == null) { + self::$processNameTemplate = new PathTemplate('projects/{project}/locations/{location}/processes/{process}'); + } + + return self::$processNameTemplate; + } + + private static function getRunNameTemplate() + { + if (self::$runNameTemplate == null) { + self::$runNameTemplate = new PathTemplate('projects/{project}/locations/{location}/processes/{process}/runs/{run}'); + } + + return self::$runNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'lineageEvent' => self::getLineageEventNameTemplate(), + 'location' => self::getLocationNameTemplate(), + 'process' => self::getProcessNameTemplate(), + 'run' => self::getRunNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a + * lineage_event resource. + * + * @param string $project + * @param string $location + * @param string $process + * @param string $run + * @param string $lineageEvent + * + * @return string The formatted lineage_event resource. + */ + public static function lineageEventName($project, $location, $process, $run, $lineageEvent) + { + return self::getLineageEventNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'process' => $process, + 'run' => $run, + 'lineage_event' => $lineageEvent, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName($project, $location) + { + return self::getLocationNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a process + * resource. + * + * @param string $project + * @param string $location + * @param string $process + * + * @return string The formatted process resource. + */ + public static function processName($project, $location, $process) + { + return self::getProcessNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'process' => $process, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a run + * resource. + * + * @param string $project + * @param string $location + * @param string $process + * @param string $run + * + * @return string The formatted run resource. + */ + public static function runName($project, $location, $process, $run) + { + return self::getRunNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'process' => $process, + 'run' => $run, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - lineageEvent: projects/{project}/locations/{location}/processes/{process}/runs/{run}/lineageEvents/{lineage_event} + * - location: projects/{project}/locations/{location} + * - process: projects/{project}/locations/{location}/processes/{process} + * - run: projects/{project}/locations/{location}/processes/{process}/runs/{run} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + 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. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'datalineage.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** + * Retrieve information about LineageProcesses associated with specific + * links. LineageProcesses are transformation pipelines that result in data + * flowing from **source** to **target** assets. Links between assets + * represent this operation. + * + * If you have specific link names, you can use this method to + * verify which LineageProcesses contribute to creating those links. + * See the + * [SearchLinks][google.cloud.datacatalog.lineage.v1.Lineage.SearchLinks] + * method for more information on how to retrieve link name. + * + * You can retrieve the LineageProcess information in every project where you + * have the `datalineage.events.get` permission. The project provided in the + * URL is used for Billing and Quota. + * + * Sample code: + * ``` + * $lineageClient = new LineageClient(); + * try { + * $formattedParent = $lineageClient->locationName('[PROJECT]', '[LOCATION]'); + * $links = []; + * // Iterate over pages of elements + * $pagedResponse = $lineageClient->batchSearchLinkProcesses($formattedParent, $links); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $lineageClient->batchSearchLinkProcesses($formattedParent, $links); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $lineageClient->close(); + * } + * ``` + * + * @param string $parent Required. The project and location where you want to search. + * @param string[] $links Required. An array of links to check for their associated LineageProcesses. + * + * The maximum number of items in this array is 100. + * If the request contains more than 100 links, it returns the + * `INVALID_ARGUMENT` error. + * + * Format: `projects/{project}/locations/{location}/links/{link}`. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * 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 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\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function batchSearchLinkProcesses($parent, $links, array $optionalArgs = []) + { + $request = new BatchSearchLinkProcessesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setLinks($links); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('BatchSearchLinkProcesses', $optionalArgs, BatchSearchLinkProcessesResponse::class, $request); + } + + /** + * Creates a new lineage event. + * + * Sample code: + * ``` + * $lineageClient = new LineageClient(); + * try { + * $formattedParent = $lineageClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); + * $lineageEvent = new LineageEvent(); + * $response = $lineageClient->createLineageEvent($formattedParent, $lineageEvent); + * } finally { + * $lineageClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the run that should own the lineage event. + * @param LineageEvent $lineageEvent Required. The lineage event to create. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * A unique identifier for this request. Restricted to 36 ASCII characters. + * A random UUID is recommended. This request is idempotent only if a + * `request_id` is provided. + * @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\Cloud\DataCatalog\Lineage\V1\LineageEvent + * + * @throws ApiException if the remote call fails + */ + public function createLineageEvent($parent, $lineageEvent, array $optionalArgs = []) + { + $request = new CreateLineageEventRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setLineageEvent($lineageEvent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateLineageEvent', LineageEvent::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a new process. + * + * Sample code: + * ``` + * $lineageClient = new LineageClient(); + * try { + * $formattedParent = $lineageClient->locationName('[PROJECT]', '[LOCATION]'); + * $process = new Process(); + * $response = $lineageClient->createProcess($formattedParent, $process); + * } finally { + * $lineageClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the project and its location that should own the + * process. + * @param Process $process Required. The process to create. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * A unique identifier for this request. Restricted to 36 ASCII characters. + * A random UUID is recommended. This request is idempotent only if a + * `request_id` is provided. + * @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\Cloud\DataCatalog\Lineage\V1\Process + * + * @throws ApiException if the remote call fails + */ + public function createProcess($parent, $process, array $optionalArgs = []) + { + $request = new CreateProcessRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setProcess($process); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateProcess', Process::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a new run. + * + * Sample code: + * ``` + * $lineageClient = new LineageClient(); + * try { + * $formattedParent = $lineageClient->processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); + * $run = new Run(); + * $response = $lineageClient->createRun($formattedParent, $run); + * } finally { + * $lineageClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the process that should own the run. + * @param Run $run Required. The run to create. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * A unique identifier for this request. Restricted to 36 ASCII characters. + * A random UUID is recommended. This request is idempotent only if a + * `request_id` is provided. + * @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\Cloud\DataCatalog\Lineage\V1\Run + * + * @throws ApiException if the remote call fails + */ + public function createRun($parent, $run, array $optionalArgs = []) + { + $request = new CreateRunRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setRun($run); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateRun', Run::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes the lineage event with the specified name. + * + * Sample code: + * ``` + * $lineageClient = new LineageClient(); + * try { + * $formattedName = $lineageClient->lineageEventName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]', '[LINEAGE_EVENT]'); + * $lineageClient->deleteLineageEvent($formattedName); + * } finally { + * $lineageClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the lineage event to delete. + * @param array $optionalArgs { + * Optional. + * + * @type bool $allowMissing + * If set to true and the lineage event is not found, the request + * succeeds but the server doesn't perform any actions. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException if the remote call fails + */ + public function deleteLineageEvent($name, array $optionalArgs = []) + { + $request = new DeleteLineageEventRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['allowMissing'])) { + $request->setAllowMissing($optionalArgs['allowMissing']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteLineageEvent', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes the process with the specified name. + * + * Sample code: + * ``` + * $lineageClient = new LineageClient(); + * try { + * $formattedName = $lineageClient->processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); + * $operationResponse = $lineageClient->deleteProcess($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $lineageClient->deleteProcess($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $lineageClient->resumeOperation($operationName, 'deleteProcess'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $lineageClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the process to delete. + * @param array $optionalArgs { + * Optional. + * + * @type bool $allowMissing + * If set to true and the process is not found, the request + * succeeds but the server doesn't perform any actions. + * @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 deleteProcess($name, array $optionalArgs = []) + { + $request = new DeleteProcessRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['allowMissing'])) { + $request->setAllowMissing($optionalArgs['allowMissing']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('DeleteProcess', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Deletes the run with the specified name. + * + * Sample code: + * ``` + * $lineageClient = new LineageClient(); + * try { + * $formattedName = $lineageClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); + * $operationResponse = $lineageClient->deleteRun($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $lineageClient->deleteRun($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $lineageClient->resumeOperation($operationName, 'deleteRun'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $lineageClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the run to delete. + * @param array $optionalArgs { + * Optional. + * + * @type bool $allowMissing + * If set to true and the run is not found, the request + * succeeds but the server doesn't perform any actions. + * @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 deleteRun($name, array $optionalArgs = []) + { + $request = new DeleteRunRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['allowMissing'])) { + $request->setAllowMissing($optionalArgs['allowMissing']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('DeleteRun', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Gets details of a specified lineage event. + * + * Sample code: + * ``` + * $lineageClient = new LineageClient(); + * try { + * $formattedName = $lineageClient->lineageEventName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]', '[LINEAGE_EVENT]'); + * $response = $lineageClient->getLineageEvent($formattedName); + * } finally { + * $lineageClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the lineage event to get. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\DataCatalog\Lineage\V1\LineageEvent + * + * @throws ApiException if the remote call fails + */ + public function getLineageEvent($name, array $optionalArgs = []) + { + $request = new GetLineageEventRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetLineageEvent', LineageEvent::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the details of the specified process. + * + * Sample code: + * ``` + * $lineageClient = new LineageClient(); + * try { + * $formattedName = $lineageClient->processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); + * $response = $lineageClient->getProcess($formattedName); + * } finally { + * $lineageClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the process to get. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\DataCatalog\Lineage\V1\Process + * + * @throws ApiException if the remote call fails + */ + public function getProcess($name, array $optionalArgs = []) + { + $request = new GetProcessRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetProcess', Process::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the details of the specified run. + * + * Sample code: + * ``` + * $lineageClient = new LineageClient(); + * try { + * $formattedName = $lineageClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); + * $response = $lineageClient->getRun($formattedName); + * } finally { + * $lineageClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the run to get. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\DataCatalog\Lineage\V1\Run + * + * @throws ApiException if the remote call fails + */ + public function getRun($name, array $optionalArgs = []) + { + $request = new GetRunRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetRun', Run::class, $optionalArgs, $request)->wait(); + } + + /** + * Lists lineage events in the given project and location. The list order is + * not defined. + * + * Sample code: + * ``` + * $lineageClient = new LineageClient(); + * try { + * $formattedParent = $lineageClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); + * // Iterate over pages of elements + * $pagedResponse = $lineageClient->listLineageEvents($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $lineageClient->listLineageEvents($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $lineageClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the run that owns the collection of lineage events to + * get. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * 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 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\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listLineageEvents($parent, array $optionalArgs = []) + { + $request = new ListLineageEventsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLineageEvents', $optionalArgs, ListLineageEventsResponse::class, $request); + } + + /** + * List processes in the given project and location. List order is descending + * by insertion time. + * + * Sample code: + * ``` + * $lineageClient = new LineageClient(); + * try { + * $formattedParent = $lineageClient->locationName('[PROJECT]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $lineageClient->listProcesses($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $lineageClient->listProcesses($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $lineageClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the project and its location that owns this + * collection of processes. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * 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 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\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listProcesses($parent, array $optionalArgs = []) + { + $request = new ListProcessesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListProcesses', $optionalArgs, ListProcessesResponse::class, $request); + } + + /** + * Lists runs in the given project and location. List order is descending by + * `start_time`. + * + * Sample code: + * ``` + * $lineageClient = new LineageClient(); + * try { + * $formattedParent = $lineageClient->processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); + * // Iterate over pages of elements + * $pagedResponse = $lineageClient->listRuns($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $lineageClient->listRuns($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $lineageClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of process that owns this collection of runs. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * 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 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\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listRuns($parent, array $optionalArgs = []) + { + $request = new ListRunsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListRuns', $optionalArgs, ListRunsResponse::class, $request); + } + + /** + * Creates new lineage events together with their parents: process and run. + * Updates the process and run if they already exist. + * Mapped from Open Lineage specification: + * https://github.com/OpenLineage/OpenLineage/blob/main/spec/OpenLineage.json. + * + * Sample code: + * ``` + * $lineageClient = new LineageClient(); + * try { + * $parent = 'parent'; + * $openLineage = new Struct(); + * $response = $lineageClient->processOpenLineageRunEvent($parent, $openLineage); + * } finally { + * $lineageClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the project and its location that should own the + * process, run, and lineage event. + * @param Struct $openLineage Required. OpenLineage message following OpenLineage format: + * https://github.com/OpenLineage/OpenLineage/blob/main/spec/OpenLineage.json + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * A unique identifier for this request. Restricted to 36 ASCII characters. + * A random UUID is recommended. This request is idempotent only if a + * `request_id` is provided. + * @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\Cloud\DataCatalog\Lineage\V1\ProcessOpenLineageRunEventResponse + * + * @throws ApiException if the remote call fails + */ + public function processOpenLineageRunEvent($parent, $openLineage, array $optionalArgs = []) + { + $request = new ProcessOpenLineageRunEventRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setOpenLineage($openLineage); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('ProcessOpenLineageRunEvent', ProcessOpenLineageRunEventResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Retrieve a list of links connected to a specific asset. + * Links represent the data flow between **source** (upstream) + * and **target** (downstream) assets in transformation pipelines. + * Links are stored in the same project as the Lineage Events that create + * them. + * + * You can retrieve links in every project where you have the + * `datalineage.events.get` permission. The project provided in the URL + * is used for Billing and Quota. + * + * Sample code: + * ``` + * $lineageClient = new LineageClient(); + * try { + * $formattedParent = $lineageClient->locationName('[PROJECT]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $lineageClient->searchLinks($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $lineageClient->searchLinks($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $lineageClient->close(); + * } + * ``` + * + * @param string $parent Required. The project and location you want search in. + * @param array $optionalArgs { + * Optional. + * + * @type EntityReference $source + * Optional. Send asset information in the **source** field to retrieve all + * links that lead from the specified asset to downstream assets. + * @type EntityReference $target + * Optional. Send asset information in the **target** field to retrieve all + * links that lead from upstream assets to the specified asset. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * 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 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\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function searchLinks($parent, array $optionalArgs = []) + { + $request = new SearchLinksRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['source'])) { + $request->setSource($optionalArgs['source']); + } + + if (isset($optionalArgs['target'])) { + $request->setTarget($optionalArgs['target']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('SearchLinks', $optionalArgs, SearchLinksResponse::class, $request); + } + + /** + * Updates a process. + * + * Sample code: + * ``` + * $lineageClient = new LineageClient(); + * try { + * $process = new Process(); + * $response = $lineageClient->updateProcess($process); + * } finally { + * $lineageClient->close(); + * } + * ``` + * + * @param Process $process Required. The lineage process to update. + * + * The process's `name` field is used to identify the process to update. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * The list of fields to update. Currently not used. The whole message is + * updated. + * @type bool $allowMissing + * If set to true and the process is not found, the request inserts it. + * @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\Cloud\DataCatalog\Lineage\V1\Process + * + * @throws ApiException if the remote call fails + */ + public function updateProcess($process, array $optionalArgs = []) + { + $request = new UpdateProcessRequest(); + $requestParamHeaders = []; + $request->setProcess($process); + $requestParamHeaders['process.name'] = $process->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + if (isset($optionalArgs['allowMissing'])) { + $request->setAllowMissing($optionalArgs['allowMissing']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateProcess', Process::class, $optionalArgs, $request)->wait(); + } + + /** + * Updates a run. + * + * Sample code: + * ``` + * $lineageClient = new LineageClient(); + * try { + * $run = new Run(); + * $response = $lineageClient->updateRun($run); + * } finally { + * $lineageClient->close(); + * } + * ``` + * + * @param Run $run Required. The lineage run to update. + * + * The run's `name` field is used to identify the run to update. + * + * Format: + * `projects/{project}/locations/{location}/processes/{process}/runs/{run}`. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * The list of fields to update. Currently not used. The whole message is + * updated. + * @type bool $allowMissing + * If set to true and the run is not found, the request creates it. + * @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\Cloud\DataCatalog\Lineage\V1\Run + * + * @throws ApiException if the remote call fails + */ + public function updateRun($run, array $optionalArgs = []) + { + $request = new UpdateRunRequest(); + $requestParamHeaders = []; + $request->setRun($run); + $requestParamHeaders['run.name'] = $run->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + if (isset($optionalArgs['allowMissing'])) { + $request->setAllowMissing($optionalArgs['allowMissing']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateRun', Run::class, $optionalArgs, $request)->wait(); + } +} diff --git a/owl-bot-staging/DataCatalogLineage/v1/src/V1/LineageClient.php b/owl-bot-staging/DataCatalogLineage/v1/src/V1/LineageClient.php new file mode 100644 index 000000000000..f7aee18948eb --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/src/V1/LineageClient.php @@ -0,0 +1,34 @@ + [ + 'google.cloud.datacatalog.lineage.v1.Lineage' => [ + 'DeleteProcess' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\DataCatalog\Lineage\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteRun' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\DataCatalog\Lineage\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'BatchSearchLinkProcesses' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getProcessLinks', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\DataCatalog\Lineage\V1\BatchSearchLinkProcessesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateLineageEvent' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DataCatalog\Lineage\V1\LineageEvent', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateProcess' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DataCatalog\Lineage\V1\Process', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateRun' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DataCatalog\Lineage\V1\Run', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteLineageEvent' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetLineageEvent' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DataCatalog\Lineage\V1\LineageEvent', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetProcess' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DataCatalog\Lineage\V1\Process', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetRun' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DataCatalog\Lineage\V1\Run', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListLineageEvents' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLineageEvents', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\DataCatalog\Lineage\V1\ListLineageEventsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListProcesses' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getProcesses', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\DataCatalog\Lineage\V1\ListProcessesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListRuns' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getRuns', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\DataCatalog\Lineage\V1\ListRunsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ProcessOpenLineageRunEvent' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DataCatalog\Lineage\V1\ProcessOpenLineageRunEventResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'SearchLinks' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLinks', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\DataCatalog\Lineage\V1\SearchLinksResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateProcess' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DataCatalog\Lineage\V1\Process', + 'headerParams' => [ + [ + 'keyName' => 'process.name', + 'fieldAccessors' => [ + 'getProcess', + 'getName', + ], + ], + ], + ], + 'UpdateRun' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DataCatalog\Lineage\V1\Run', + 'headerParams' => [ + [ + 'keyName' => 'run.name', + 'fieldAccessors' => [ + 'getRun', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'lineageEvent' => 'projects/{project}/locations/{location}/processes/{process}/runs/{run}/lineageEvents/{lineage_event}', + 'location' => 'projects/{project}/locations/{location}', + 'process' => 'projects/{project}/locations/{location}/processes/{process}', + 'run' => 'projects/{project}/locations/{location}/processes/{process}/runs/{run}', + ], + ], + ], +]; diff --git a/owl-bot-staging/DataCatalogLineage/v1/src/V1/resources/lineage_rest_client_config.php b/owl-bot-staging/DataCatalogLineage/v1/src/V1/resources/lineage_rest_client_config.php new file mode 100644 index 000000000000..0f8e407dc4fb --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/src/V1/resources/lineage_rest_client_config.php @@ -0,0 +1,252 @@ + [ + 'google.cloud.datacatalog.lineage.v1.Lineage' => [ + 'BatchSearchLinkProcesses' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}:batchSearchLinkProcesses', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateLineageEvent' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/processes/*/runs/*}/lineageEvents', + 'body' => 'lineage_event', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateProcess' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/processes', + 'body' => 'process', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateRun' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/processes/*}/runs', + 'body' => 'run', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteLineageEvent' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/processes/*/runs/*/lineageEvents/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteProcess' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/processes/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteRun' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/processes/*/runs/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetLineageEvent' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/processes/*/runs/*/lineageEvents/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetProcess' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/processes/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetRun' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/processes/*/runs/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLineageEvents' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/processes/*/runs/*}/lineageEvents', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListProcesses' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/processes', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListRuns' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/processes/*}/runs', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ProcessOpenLineageRunEvent' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}:processOpenLineageRunEvent', + 'body' => 'open_lineage', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'SearchLinks' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}:searchLinks', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateProcess' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{process.name=projects/*/locations/*/processes/*}', + 'body' => 'process', + 'placeholders' => [ + 'process.name' => [ + 'getters' => [ + 'getProcess', + 'getName', + ], + ], + ], + ], + 'UpdateRun' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{run.name=projects/*/locations/*/processes/*/runs/*}', + 'body' => 'run', + 'placeholders' => [ + 'run.name' => [ + 'getters' => [ + 'getRun', + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/DataCatalogLineage/v1/tests/Unit/V1/Client/LineageClientTest.php b/owl-bot-staging/DataCatalogLineage/v1/tests/Unit/V1/Client/LineageClientTest.php new file mode 100644 index 000000000000..58f95fc0d16b --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/tests/Unit/V1/Client/LineageClientTest.php @@ -0,0 +1,1440 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return LineageClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new LineageClient($options); + } + + /** @test */ + public function batchSearchLinkProcessesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $processLinksElement = new ProcessLinks(); + $processLinks = [ + $processLinksElement, + ]; + $expectedResponse = new BatchSearchLinkProcessesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setProcessLinks($processLinks); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $links = []; + $request = (new BatchSearchLinkProcessesRequest()) + ->setParent($formattedParent) + ->setLinks($links); + $response = $gapicClient->batchSearchLinkProcesses($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getProcessLinks()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/BatchSearchLinkProcesses', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getLinks(); + $this->assertProtobufEquals($links, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function batchSearchLinkProcessesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $links = []; + $request = (new BatchSearchLinkProcessesRequest()) + ->setParent($formattedParent) + ->setLinks($links); + try { + $gapicClient->batchSearchLinkProcesses($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createLineageEventTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new LineageEvent(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); + $lineageEvent = new LineageEvent(); + $lineageEventStartTime = new Timestamp(); + $lineageEvent->setStartTime($lineageEventStartTime); + $request = (new CreateLineageEventRequest()) + ->setParent($formattedParent) + ->setLineageEvent($lineageEvent); + $response = $gapicClient->createLineageEvent($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/CreateLineageEvent', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getLineageEvent(); + $this->assertProtobufEquals($lineageEvent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createLineageEventExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); + $lineageEvent = new LineageEvent(); + $lineageEventStartTime = new Timestamp(); + $lineageEvent->setStartTime($lineageEventStartTime); + $request = (new CreateLineageEventRequest()) + ->setParent($formattedParent) + ->setLineageEvent($lineageEvent); + try { + $gapicClient->createLineageEvent($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createProcessTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Process(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $process = new Process(); + $request = (new CreateProcessRequest()) + ->setParent($formattedParent) + ->setProcess($process); + $response = $gapicClient->createProcess($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/CreateProcess', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getProcess(); + $this->assertProtobufEquals($process, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createProcessExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $process = new Process(); + $request = (new CreateProcessRequest()) + ->setParent($formattedParent) + ->setProcess($process); + try { + $gapicClient->createProcess($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createRunTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Run(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); + $run = new Run(); + $runStartTime = new Timestamp(); + $run->setStartTime($runStartTime); + $runState = State::UNKNOWN; + $run->setState($runState); + $request = (new CreateRunRequest()) + ->setParent($formattedParent) + ->setRun($run); + $response = $gapicClient->createRun($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/CreateRun', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getRun(); + $this->assertProtobufEquals($run, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createRunExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); + $run = new Run(); + $runStartTime = new Timestamp(); + $run->setStartTime($runStartTime); + $runState = State::UNKNOWN; + $run->setState($runState); + $request = (new CreateRunRequest()) + ->setParent($formattedParent) + ->setRun($run); + try { + $gapicClient->createRun($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteLineageEventTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->lineageEventName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]', '[LINEAGE_EVENT]'); + $request = (new DeleteLineageEventRequest()) + ->setName($formattedName); + $gapicClient->deleteLineageEvent($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/DeleteLineageEvent', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteLineageEventExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->lineageEventName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]', '[LINEAGE_EVENT]'); + $request = (new DeleteLineageEventRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteLineageEvent($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteProcessTest() + { + $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/deleteProcessTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteProcessTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); + $request = (new DeleteProcessRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteProcess($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/DeleteProcess', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteProcessTest'); + $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 deleteProcessExceptionTest() + { + $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/deleteProcessTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); + $request = (new DeleteProcessRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteProcess($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteProcessTest'); + 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 deleteRunTest() + { + $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/deleteRunTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteRunTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); + $request = (new DeleteRunRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteRun($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/DeleteRun', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteRunTest'); + $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 deleteRunExceptionTest() + { + $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/deleteRunTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); + $request = (new DeleteRunRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteRun($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteRunTest'); + 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 getLineageEventTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new LineageEvent(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->lineageEventName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]', '[LINEAGE_EVENT]'); + $request = (new GetLineageEventRequest()) + ->setName($formattedName); + $response = $gapicClient->getLineageEvent($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/GetLineageEvent', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLineageEventExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->lineageEventName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]', '[LINEAGE_EVENT]'); + $request = (new GetLineageEventRequest()) + ->setName($formattedName); + try { + $gapicClient->getLineageEvent($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getProcessTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Process(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); + $request = (new GetProcessRequest()) + ->setName($formattedName); + $response = $gapicClient->getProcess($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/GetProcess', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getProcessExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); + $request = (new GetProcessRequest()) + ->setName($formattedName); + try { + $gapicClient->getProcess($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getRunTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Run(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); + $request = (new GetRunRequest()) + ->setName($formattedName); + $response = $gapicClient->getRun($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/GetRun', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getRunExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); + $request = (new GetRunRequest()) + ->setName($formattedName); + try { + $gapicClient->getRun($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLineageEventsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $lineageEventsElement = new LineageEvent(); + $lineageEvents = [ + $lineageEventsElement, + ]; + $expectedResponse = new ListLineageEventsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLineageEvents($lineageEvents); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); + $request = (new ListLineageEventsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listLineageEvents($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLineageEvents()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/ListLineageEvents', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLineageEventsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); + $request = (new ListLineageEventsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listLineageEvents($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listProcessesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $processesElement = new Process(); + $processes = [ + $processesElement, + ]; + $expectedResponse = new ListProcessesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setProcesses($processes); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListProcessesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listProcesses($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getProcesses()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/ListProcesses', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listProcessesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListProcessesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listProcesses($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listRunsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $runsElement = new Run(); + $runs = [ + $runsElement, + ]; + $expectedResponse = new ListRunsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setRuns($runs); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); + $request = (new ListRunsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listRuns($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getRuns()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/ListRuns', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listRunsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); + $request = (new ListRunsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listRuns($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function processOpenLineageRunEventTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $process = 'process-309518737'; + $run = 'run113291'; + $expectedResponse = new ProcessOpenLineageRunEventResponse(); + $expectedResponse->setProcess($process); + $expectedResponse->setRun($run); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $openLineage = new Struct(); + $request = (new ProcessOpenLineageRunEventRequest()) + ->setParent($parent) + ->setOpenLineage($openLineage); + $response = $gapicClient->processOpenLineageRunEvent($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/ProcessOpenLineageRunEvent', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualRequestObject->getOpenLineage(); + $this->assertProtobufEquals($openLineage, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function processOpenLineageRunEventExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + $openLineage = new Struct(); + $request = (new ProcessOpenLineageRunEventRequest()) + ->setParent($parent) + ->setOpenLineage($openLineage); + try { + $gapicClient->processOpenLineageRunEvent($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchLinksTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $linksElement = new Link(); + $links = [ + $linksElement, + ]; + $expectedResponse = new SearchLinksResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLinks($links); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new SearchLinksRequest()) + ->setParent($formattedParent); + $response = $gapicClient->searchLinks($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLinks()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/SearchLinks', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchLinksExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new SearchLinksRequest()) + ->setParent($formattedParent); + try { + $gapicClient->searchLinks($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateProcessTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Process(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $process = new Process(); + $request = (new UpdateProcessRequest()) + ->setProcess($process); + $response = $gapicClient->updateProcess($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/UpdateProcess', $actualFuncCall); + $actualValue = $actualRequestObject->getProcess(); + $this->assertProtobufEquals($process, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateProcessExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $process = new Process(); + $request = (new UpdateProcessRequest()) + ->setProcess($process); + try { + $gapicClient->updateProcess($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateRunTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Run(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $run = new Run(); + $runStartTime = new Timestamp(); + $run->setStartTime($runStartTime); + $runState = State::UNKNOWN; + $run->setState($runState); + $request = (new UpdateRunRequest()) + ->setRun($run); + $response = $gapicClient->updateRun($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/UpdateRun', $actualFuncCall); + $actualValue = $actualRequestObject->getRun(); + $this->assertProtobufEquals($run, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateRunExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $run = new Run(); + $runStartTime = new Timestamp(); + $run->setStartTime($runStartTime); + $runState = State::UNKNOWN; + $run->setState($runState); + $request = (new UpdateRunRequest()) + ->setRun($run); + try { + $gapicClient->updateRun($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function batchSearchLinkProcessesAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $processLinksElement = new ProcessLinks(); + $processLinks = [ + $processLinksElement, + ]; + $expectedResponse = new BatchSearchLinkProcessesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setProcessLinks($processLinks); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $links = []; + $request = (new BatchSearchLinkProcessesRequest()) + ->setParent($formattedParent) + ->setLinks($links); + $response = $gapicClient->batchSearchLinkProcessesAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getProcessLinks()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/BatchSearchLinkProcesses', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getLinks(); + $this->assertProtobufEquals($links, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/DataCatalogLineage/v1/tests/Unit/V1/LineageClientTest.php b/owl-bot-staging/DataCatalogLineage/v1/tests/Unit/V1/LineageClientTest.php new file mode 100644 index 000000000000..d704af8f5acd --- /dev/null +++ b/owl-bot-staging/DataCatalogLineage/v1/tests/Unit/V1/LineageClientTest.php @@ -0,0 +1,1304 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return LineageClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new LineageClient($options); + } + + /** @test */ + public function batchSearchLinkProcessesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $processLinksElement = new ProcessLinks(); + $processLinks = [ + $processLinksElement, + ]; + $expectedResponse = new BatchSearchLinkProcessesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setProcessLinks($processLinks); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $links = []; + $response = $gapicClient->batchSearchLinkProcesses($formattedParent, $links); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getProcessLinks()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/BatchSearchLinkProcesses', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getLinks(); + $this->assertProtobufEquals($links, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function batchSearchLinkProcessesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $links = []; + try { + $gapicClient->batchSearchLinkProcesses($formattedParent, $links); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createLineageEventTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new LineageEvent(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); + $lineageEvent = new LineageEvent(); + $lineageEventStartTime = new Timestamp(); + $lineageEvent->setStartTime($lineageEventStartTime); + $response = $gapicClient->createLineageEvent($formattedParent, $lineageEvent); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/CreateLineageEvent', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getLineageEvent(); + $this->assertProtobufEquals($lineageEvent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createLineageEventExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); + $lineageEvent = new LineageEvent(); + $lineageEventStartTime = new Timestamp(); + $lineageEvent->setStartTime($lineageEventStartTime); + try { + $gapicClient->createLineageEvent($formattedParent, $lineageEvent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createProcessTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Process(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $process = new Process(); + $response = $gapicClient->createProcess($formattedParent, $process); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/CreateProcess', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getProcess(); + $this->assertProtobufEquals($process, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createProcessExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $process = new Process(); + try { + $gapicClient->createProcess($formattedParent, $process); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createRunTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Run(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); + $run = new Run(); + $runStartTime = new Timestamp(); + $run->setStartTime($runStartTime); + $runState = State::UNKNOWN; + $run->setState($runState); + $response = $gapicClient->createRun($formattedParent, $run); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/CreateRun', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getRun(); + $this->assertProtobufEquals($run, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createRunExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); + $run = new Run(); + $runStartTime = new Timestamp(); + $run->setStartTime($runStartTime); + $runState = State::UNKNOWN; + $run->setState($runState); + try { + $gapicClient->createRun($formattedParent, $run); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteLineageEventTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->lineageEventName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]', '[LINEAGE_EVENT]'); + $gapicClient->deleteLineageEvent($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/DeleteLineageEvent', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteLineageEventExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->lineageEventName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]', '[LINEAGE_EVENT]'); + try { + $gapicClient->deleteLineageEvent($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteProcessTest() + { + $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/deleteProcessTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteProcessTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); + $response = $gapicClient->deleteProcess($formattedName); + $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.lineage.v1.Lineage/DeleteProcess', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteProcessTest'); + $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 deleteProcessExceptionTest() + { + $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/deleteProcessTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); + $response = $gapicClient->deleteProcess($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteProcessTest'); + 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 deleteRunTest() + { + $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/deleteRunTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteRunTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); + $response = $gapicClient->deleteRun($formattedName); + $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.lineage.v1.Lineage/DeleteRun', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteRunTest'); + $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 deleteRunExceptionTest() + { + $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/deleteRunTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); + $response = $gapicClient->deleteRun($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteRunTest'); + 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 getLineageEventTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new LineageEvent(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->lineageEventName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]', '[LINEAGE_EVENT]'); + $response = $gapicClient->getLineageEvent($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/GetLineageEvent', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLineageEventExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->lineageEventName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]', '[LINEAGE_EVENT]'); + try { + $gapicClient->getLineageEvent($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getProcessTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Process(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); + $response = $gapicClient->getProcess($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/GetProcess', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getProcessExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); + try { + $gapicClient->getProcess($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getRunTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Run(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); + $response = $gapicClient->getRun($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/GetRun', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getRunExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); + try { + $gapicClient->getRun($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLineageEventsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $lineageEventsElement = new LineageEvent(); + $lineageEvents = [ + $lineageEventsElement, + ]; + $expectedResponse = new ListLineageEventsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLineageEvents($lineageEvents); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); + $response = $gapicClient->listLineageEvents($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLineageEvents()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/ListLineageEvents', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLineageEventsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); + try { + $gapicClient->listLineageEvents($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listProcessesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $processesElement = new Process(); + $processes = [ + $processesElement, + ]; + $expectedResponse = new ListProcessesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setProcesses($processes); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->listProcesses($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getProcesses()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/ListProcesses', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listProcessesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + try { + $gapicClient->listProcesses($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listRunsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $runsElement = new Run(); + $runs = [ + $runsElement, + ]; + $expectedResponse = new ListRunsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setRuns($runs); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); + $response = $gapicClient->listRuns($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getRuns()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/ListRuns', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listRunsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); + try { + $gapicClient->listRuns($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function processOpenLineageRunEventTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $process = 'process-309518737'; + $run = 'run113291'; + $expectedResponse = new ProcessOpenLineageRunEventResponse(); + $expectedResponse->setProcess($process); + $expectedResponse->setRun($run); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $openLineage = new Struct(); + $response = $gapicClient->processOpenLineageRunEvent($parent, $openLineage); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/ProcessOpenLineageRunEvent', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualRequestObject->getOpenLineage(); + $this->assertProtobufEquals($openLineage, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function processOpenLineageRunEventExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + $openLineage = new Struct(); + try { + $gapicClient->processOpenLineageRunEvent($parent, $openLineage); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchLinksTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $linksElement = new Link(); + $links = [ + $linksElement, + ]; + $expectedResponse = new SearchLinksResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLinks($links); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->searchLinks($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLinks()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/SearchLinks', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function searchLinksExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + try { + $gapicClient->searchLinks($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateProcessTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Process(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $process = new Process(); + $response = $gapicClient->updateProcess($process); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/UpdateProcess', $actualFuncCall); + $actualValue = $actualRequestObject->getProcess(); + $this->assertProtobufEquals($process, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateProcessExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $process = new Process(); + try { + $gapicClient->updateProcess($process); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateRunTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Run(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $run = new Run(); + $runStartTime = new Timestamp(); + $run->setStartTime($runStartTime); + $runState = State::UNKNOWN; + $run->setState($runState); + $response = $gapicClient->updateRun($run); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/UpdateRun', $actualFuncCall); + $actualValue = $actualRequestObject->getRun(); + $this->assertProtobufEquals($run, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateRunExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $run = new Run(); + $runStartTime = new Timestamp(); + $run->setStartTime($runStartTime); + $runState = State::UNKNOWN; + $run->setState($runState); + try { + $gapicClient->updateRun($run); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } +} From 0414d7214ca312012f10c1352796473d378b6d21 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Mon, 6 Nov 2023 11:59:36 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- DataCatalogLineage/metadata/V1/Lineage.php | Bin 10731 -> 11416 bytes .../batch_search_link_processes.php | 4 +- .../V1/LineageClient/create_lineage_event.php | 5 +- .../process_open_lineage_run_event.php | 0 .../samples/V1/LineageClient/search_links.php | 4 +- .../V1/BatchSearchLinkProcessesRequest.php | 8 +- .../src/V1/Client/LineageClient.php | 32 + DataCatalogLineage/src/V1/EntityReference.php | 44 +- .../src/V1/Gapic/LineageGapicClient.php | 68 +- DataCatalogLineage/src/V1/LineageEvent.php | 14 +- .../src/V1/OperationMetadata/Type.php | 7 + DataCatalogLineage/src/V1/Origin.php | 12 + .../src/V1/Origin/SourceType.php | 7 + DataCatalogLineage/src/V1/Process.php | 24 +- .../V1/ProcessOpenLineageRunEventRequest.php | 0 .../V1/ProcessOpenLineageRunEventResponse.php | 0 DataCatalogLineage/src/V1/Run.php | 20 +- .../src/V1/SearchLinksRequest.php | 8 +- .../src/V1/UpdateRunRequest.php | 34 + DataCatalogLineage/src/V1/gapic_metadata.json | 5 + .../V1/resources/lineage_client_config.json | 5 + .../resources/lineage_descriptor_config.php | 12 + .../resources/lineage_rest_client_config.php | 12 + .../Unit/V1/Client/LineageClientTest.php | 79 + .../tests/Unit/V1/LineageClientTest.php | 72 + .../Cloud/Datacatalog/Lineage/V1/Lineage.php | Bin 11416 -> 0 bytes .../V1/BatchSearchLinkProcessesRequest.php | 206 --- .../V1/BatchSearchLinkProcessesResponse.php | 106 -- .../Lineage/V1/CreateLineageEventRequest.php | 170 -- .../Lineage/V1/CreateProcessRequest.php | 175 -- .../Lineage/V1/CreateRunRequest.php | 170 -- .../Lineage/V1/DeleteLineageEventRequest.php | 120 -- .../Lineage/V1/DeleteProcessRequest.php | 120 -- .../Lineage/V1/DeleteRunRequest.php | 120 -- .../Lineage/V1/EntityReference.php | 75 - .../DataCatalog/Lineage/V1/EventLink.php | 121 -- .../Lineage/V1/GetLineageEventRequest.php | 82 - .../Lineage/V1/GetProcessRequest.php | 82 - .../DataCatalog/Lineage/V1/GetRunRequest.php | 82 - .../DataCatalog/Lineage/V1/LineageEvent.php | 226 --- .../Cloud/DataCatalog/Lineage/V1/Link.php | 250 --- .../Lineage/V1/ListLineageEventsRequest.php | 178 -- .../Lineage/V1/ListLineageEventsResponse.php | 106 -- .../Lineage/V1/ListProcessesRequest.php | 179 -- .../Lineage/V1/ListProcessesResponse.php | 106 -- .../Lineage/V1/ListRunsRequest.php | 174 -- .../Lineage/V1/ListRunsResponse.php | 106 -- .../Lineage/V1/OperationMetadata.php | 269 --- .../Lineage/V1/OperationMetadata/State.php | 78 - .../Lineage/V1/OperationMetadata/Type.php | 64 - .../Cloud/DataCatalog/Lineage/V1/Origin.php | 141 -- .../Lineage/V1/Origin/SourceType.php | 92 -- .../Cloud/DataCatalog/Lineage/V1/Process.php | 215 --- .../Lineage/V1/ProcessLinkInfo.php | 159 -- .../DataCatalog/Lineage/V1/ProcessLinks.php | 121 -- .../Cloud/DataCatalog/Lineage/V1/Run.php | 290 ---- .../DataCatalog/Lineage/V1/Run/State.php | 79 - .../Lineage/V1/SearchLinksRequest.php | 245 --- .../Lineage/V1/SearchLinksResponse.php | 110 -- .../Lineage/V1/UpdateProcessRequest.php | 182 --- .../Lineage/V1/UpdateRunRequest.php | 193 --- .../batch_search_link_processes.php | 99 -- .../V1/LineageClient/create_lineage_event.php | 76 - .../V1/LineageClient/create_process.php | 74 - .../samples/V1/LineageClient/create_run.php | 80 - .../V1/LineageClient/delete_lineage_event.php | 75 - .../V1/LineageClient/delete_process.php | 80 - .../samples/V1/LineageClient/delete_run.php | 80 - .../V1/LineageClient/get_lineage_event.php | 77 - .../samples/V1/LineageClient/get_process.php | 71 - .../v1/samples/V1/LineageClient/get_run.php | 71 - .../V1/LineageClient/list_lineage_events.php | 77 - .../V1/LineageClient/list_processes.php | 78 - .../v1/samples/V1/LineageClient/list_runs.php | 77 - .../samples/V1/LineageClient/search_links.php | 84 - .../V1/LineageClient/update_process.php | 59 - .../samples/V1/LineageClient/update_run.php | 76 - .../v1/src/V1/Client/LineageClient.php | 817 ---------- .../v1/src/V1/Gapic/LineageGapicClient.php | 1431 ---------------- .../v1/src/V1/LineageClient.php | 34 - .../v1/src/V1/gapic_metadata.json | 103 -- .../V1/resources/lineage_client_config.json | 119 -- .../resources/lineage_descriptor_config.php | 274 ---- .../resources/lineage_rest_client_config.php | 252 --- .../Unit/V1/Client/LineageClientTest.php | 1440 ----------------- .../v1/tests/Unit/V1/LineageClientTest.php | 1304 --------------- 86 files changed, 406 insertions(+), 12270 deletions(-) rename {owl-bot-staging/DataCatalogLineage/v1 => DataCatalogLineage}/samples/V1/LineageClient/process_open_lineage_run_event.php (100%) rename {owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage => DataCatalogLineage/src}/V1/ProcessOpenLineageRunEventRequest.php (100%) rename {owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage => DataCatalogLineage/src}/V1/ProcessOpenLineageRunEventResponse.php (100%) delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/GPBMetadata/Google/Cloud/Datacatalog/Lineage/V1/Lineage.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/BatchSearchLinkProcessesRequest.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/BatchSearchLinkProcessesResponse.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/CreateLineageEventRequest.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/CreateProcessRequest.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/CreateRunRequest.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/DeleteLineageEventRequest.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/DeleteProcessRequest.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/DeleteRunRequest.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/EntityReference.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/EventLink.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/GetLineageEventRequest.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/GetProcessRequest.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/GetRunRequest.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/LineageEvent.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Link.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListLineageEventsRequest.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListLineageEventsResponse.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListProcessesRequest.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListProcessesResponse.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListRunsRequest.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListRunsResponse.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/OperationMetadata.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/OperationMetadata/State.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/OperationMetadata/Type.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Origin.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Origin/SourceType.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Process.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ProcessLinkInfo.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ProcessLinks.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Run.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Run/State.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/SearchLinksRequest.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/SearchLinksResponse.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/UpdateProcessRequest.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/UpdateRunRequest.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/batch_search_link_processes.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/create_lineage_event.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/create_process.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/create_run.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/delete_lineage_event.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/delete_process.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/delete_run.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/get_lineage_event.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/get_process.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/get_run.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/list_lineage_events.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/list_processes.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/list_runs.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/search_links.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/update_process.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/update_run.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/src/V1/Client/LineageClient.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/src/V1/Gapic/LineageGapicClient.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/src/V1/LineageClient.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/src/V1/gapic_metadata.json delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/src/V1/resources/lineage_client_config.json delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/src/V1/resources/lineage_descriptor_config.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/src/V1/resources/lineage_rest_client_config.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/tests/Unit/V1/Client/LineageClientTest.php delete mode 100644 owl-bot-staging/DataCatalogLineage/v1/tests/Unit/V1/LineageClientTest.php diff --git a/DataCatalogLineage/metadata/V1/Lineage.php b/DataCatalogLineage/metadata/V1/Lineage.php index decabe03d58d7a577ba39ca7ae93f753da42056a..155e66baf2bd52923aa15e4c097a5b16ad3f5e50 100644 GIT binary patch delta 505 zcmaDIJR@?$PiCf*0h@m_uV9_r!_K#PBj*f8#%G(oxHmB}noR!7qfsx!#l_|vsetStartTime($lineageEventStartTime); $request = (new CreateLineageEventRequest()) ->setParent($formattedParent) ->setLineageEvent($lineageEvent); diff --git a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/process_open_lineage_run_event.php b/DataCatalogLineage/samples/V1/LineageClient/process_open_lineage_run_event.php similarity index 100% rename from owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/process_open_lineage_run_event.php rename to DataCatalogLineage/samples/V1/LineageClient/process_open_lineage_run_event.php diff --git a/DataCatalogLineage/samples/V1/LineageClient/search_links.php b/DataCatalogLineage/samples/V1/LineageClient/search_links.php index 84d588e16a42..0e5b874e858f 100644 --- a/DataCatalogLineage/samples/V1/LineageClient/search_links.php +++ b/DataCatalogLineage/samples/V1/LineageClient/search_links.php @@ -40,8 +40,8 @@ * `datalineage.events.get` permission. The project provided in the URL * is used for Billing and Quota. * - * @param string $formattedParent The project and location you want search in the format `projects/*/locations/*` - * Please see {@see LineageClient::locationName()} for help formatting this field. + * @param string $formattedParent The project and location you want search in. Please see + * {@see LineageClient::locationName()} for help formatting this field. */ function search_links_sample(string $formattedParent): void { diff --git a/DataCatalogLineage/src/V1/BatchSearchLinkProcessesRequest.php b/DataCatalogLineage/src/V1/BatchSearchLinkProcessesRequest.php index 4e8c23adcbb2..75a9ce2414ac 100644 --- a/DataCatalogLineage/src/V1/BatchSearchLinkProcessesRequest.php +++ b/DataCatalogLineage/src/V1/BatchSearchLinkProcessesRequest.php @@ -17,7 +17,7 @@ class BatchSearchLinkProcessesRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The project and location you want search in the format `projects/*/locations/*` + * Required. The project and location where you want to search. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -57,7 +57,7 @@ class BatchSearchLinkProcessesRequest extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $parent - * Required. The project and location you want search in the format `projects/*/locations/*` + * Required. The project and location where you want to search. * @type array|\Google\Protobuf\Internal\RepeatedField $links * Required. An array of links to check for their associated LineageProcesses. * The maximum number of items in this array is 100. @@ -81,7 +81,7 @@ public function __construct($data = NULL) { } /** - * Required. The project and location you want search in the format `projects/*/locations/*` + * Required. The project and location where you want to search. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -92,7 +92,7 @@ public function getParent() } /** - * Required. The project and location you want search in the format `projects/*/locations/*` + * Required. The project and location where you want to search. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/DataCatalogLineage/src/V1/Client/LineageClient.php b/DataCatalogLineage/src/V1/Client/LineageClient.php index e4d33148af22..7abb39d57029 100644 --- a/DataCatalogLineage/src/V1/Client/LineageClient.php +++ b/DataCatalogLineage/src/V1/Client/LineageClient.php @@ -50,6 +50,8 @@ use Google\Cloud\DataCatalog\Lineage\V1\ListProcessesRequest; use Google\Cloud\DataCatalog\Lineage\V1\ListRunsRequest; use Google\Cloud\DataCatalog\Lineage\V1\Process; +use Google\Cloud\DataCatalog\Lineage\V1\ProcessOpenLineageRunEventRequest; +use Google\Cloud\DataCatalog\Lineage\V1\ProcessOpenLineageRunEventResponse; use Google\Cloud\DataCatalog\Lineage\V1\Run; use Google\Cloud\DataCatalog\Lineage\V1\SearchLinksRequest; use Google\Cloud\DataCatalog\Lineage\V1\UpdateProcessRequest; @@ -90,6 +92,7 @@ * @method PromiseInterface listLineageEventsAsync(ListLineageEventsRequest $request, array $optionalArgs = []) * @method PromiseInterface listProcessesAsync(ListProcessesRequest $request, array $optionalArgs = []) * @method PromiseInterface listRunsAsync(ListRunsRequest $request, array $optionalArgs = []) + * @method PromiseInterface processOpenLineageRunEventAsync(ProcessOpenLineageRunEventRequest $request, array $optionalArgs = []) * @method PromiseInterface searchLinksAsync(SearchLinksRequest $request, array $optionalArgs = []) * @method PromiseInterface updateProcessAsync(UpdateProcessRequest $request, array $optionalArgs = []) * @method PromiseInterface updateRunAsync(UpdateRunRequest $request, array $optionalArgs = []) @@ -697,6 +700,35 @@ public function listRuns(ListRunsRequest $request, array $callOptions = []): Pag return $this->startApiCall('ListRuns', $request, $callOptions); } + /** + * Creates new lineage events together with their parents: process and run. + * Updates the process and run if they already exist. + * Mapped from Open Lineage specification: + * https://github.com/OpenLineage/OpenLineage/blob/main/spec/OpenLineage.json. + * + * The async variant is {@see LineageClient::processOpenLineageRunEventAsync()} . + * + * @example samples/V1/LineageClient/process_open_lineage_run_event.php + * + * @param ProcessOpenLineageRunEventRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ProcessOpenLineageRunEventResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function processOpenLineageRunEvent(ProcessOpenLineageRunEventRequest $request, array $callOptions = []): ProcessOpenLineageRunEventResponse + { + return $this->startApiCall('ProcessOpenLineageRunEvent', $request, $callOptions)->wait(); + } + /** * Retrieve a list of links connected to a specific asset. * Links represent the data flow between **source** (upstream) diff --git a/DataCatalogLineage/src/V1/EntityReference.php b/DataCatalogLineage/src/V1/EntityReference.php index d226e432446a..9925e0dce8a7 100644 --- a/DataCatalogLineage/src/V1/EntityReference.php +++ b/DataCatalogLineage/src/V1/EntityReference.php @@ -16,14 +16,9 @@ class EntityReference extends \Google\Protobuf\Internal\Message { /** - * Required. Fully Qualified Name of the entity. Useful for referencing - * entities that aren't represented as GCP resources, for example, tables in - * Dataproc Metastore API. - * Examples: - * * `bigquery:dataset.project_id.dataset_id` - * * `bigquery:table.project_id.dataset_id.table_id` - * * `pubsub:project_id.topic_id` - * * `dataproc_metastore:projectId.locationId.instanceId.databaseId.tableId` + * Required. [Fully Qualified Name + * (FQN)](https://cloud.google.com/data-catalog/docs/fully-qualified-names) + * of the entity. * * Generated from protobuf field string fully_qualified_name = 1 [(.google.api.field_behavior) = REQUIRED]; */ @@ -36,14 +31,9 @@ class EntityReference extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $fully_qualified_name - * Required. Fully Qualified Name of the entity. Useful for referencing - * entities that aren't represented as GCP resources, for example, tables in - * Dataproc Metastore API. - * Examples: - * * `bigquery:dataset.project_id.dataset_id` - * * `bigquery:table.project_id.dataset_id.table_id` - * * `pubsub:project_id.topic_id` - * * `dataproc_metastore:projectId.locationId.instanceId.databaseId.tableId` + * Required. [Fully Qualified Name + * (FQN)](https://cloud.google.com/data-catalog/docs/fully-qualified-names) + * of the entity. * } */ public function __construct($data = NULL) { @@ -52,14 +42,9 @@ public function __construct($data = NULL) { } /** - * Required. Fully Qualified Name of the entity. Useful for referencing - * entities that aren't represented as GCP resources, for example, tables in - * Dataproc Metastore API. - * Examples: - * * `bigquery:dataset.project_id.dataset_id` - * * `bigquery:table.project_id.dataset_id.table_id` - * * `pubsub:project_id.topic_id` - * * `dataproc_metastore:projectId.locationId.instanceId.databaseId.tableId` + * Required. [Fully Qualified Name + * (FQN)](https://cloud.google.com/data-catalog/docs/fully-qualified-names) + * of the entity. * * Generated from protobuf field string fully_qualified_name = 1 [(.google.api.field_behavior) = REQUIRED]; * @return string @@ -70,14 +55,9 @@ public function getFullyQualifiedName() } /** - * Required. Fully Qualified Name of the entity. Useful for referencing - * entities that aren't represented as GCP resources, for example, tables in - * Dataproc Metastore API. - * Examples: - * * `bigquery:dataset.project_id.dataset_id` - * * `bigquery:table.project_id.dataset_id.table_id` - * * `pubsub:project_id.topic_id` - * * `dataproc_metastore:projectId.locationId.instanceId.databaseId.tableId` + * Required. [Fully Qualified Name + * (FQN)](https://cloud.google.com/data-catalog/docs/fully-qualified-names) + * of the entity. * * Generated from protobuf field string fully_qualified_name = 1 [(.google.api.field_behavior) = REQUIRED]; * @param string $var diff --git a/DataCatalogLineage/src/V1/Gapic/LineageGapicClient.php b/DataCatalogLineage/src/V1/Gapic/LineageGapicClient.php index 4ff83a02d9e5..6d227fea2a33 100644 --- a/DataCatalogLineage/src/V1/Gapic/LineageGapicClient.php +++ b/DataCatalogLineage/src/V1/Gapic/LineageGapicClient.php @@ -55,6 +55,8 @@ use Google\Cloud\DataCatalog\Lineage\V1\ListRunsRequest; use Google\Cloud\DataCatalog\Lineage\V1\ListRunsResponse; use Google\Cloud\DataCatalog\Lineage\V1\Process; +use Google\Cloud\DataCatalog\Lineage\V1\ProcessOpenLineageRunEventRequest; +use Google\Cloud\DataCatalog\Lineage\V1\ProcessOpenLineageRunEventResponse; use Google\Cloud\DataCatalog\Lineage\V1\Run; use Google\Cloud\DataCatalog\Lineage\V1\SearchLinksRequest; use Google\Cloud\DataCatalog\Lineage\V1\SearchLinksResponse; @@ -63,6 +65,7 @@ use Google\LongRunning\Operation; use Google\Protobuf\FieldMask; use Google\Protobuf\GPBEmpty; +use Google\Protobuf\Struct; /** * Service Description: Lineage is used to track data flows between assets over time. You can @@ -461,7 +464,7 @@ public function __construct(array $options = []) * } * ``` * - * @param string $parent Required. The project and location you want search in the format `projects/*/locations/*` + * @param string $parent Required. The project and location where you want to search. * @param string[] $links Required. An array of links to check for their associated LineageProcesses. * * The maximum number of items in this array is 100. @@ -1170,6 +1173,61 @@ public function listRuns($parent, array $optionalArgs = []) return $this->getPagedListResponse('ListRuns', $optionalArgs, ListRunsResponse::class, $request); } + /** + * Creates new lineage events together with their parents: process and run. + * Updates the process and run if they already exist. + * Mapped from Open Lineage specification: + * https://github.com/OpenLineage/OpenLineage/blob/main/spec/OpenLineage.json. + * + * Sample code: + * ``` + * $lineageClient = new LineageClient(); + * try { + * $parent = 'parent'; + * $openLineage = new Struct(); + * $response = $lineageClient->processOpenLineageRunEvent($parent, $openLineage); + * } finally { + * $lineageClient->close(); + * } + * ``` + * + * @param string $parent Required. The name of the project and its location that should own the + * process, run, and lineage event. + * @param Struct $openLineage Required. OpenLineage message following OpenLineage format: + * https://github.com/OpenLineage/OpenLineage/blob/main/spec/OpenLineage.json + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * A unique identifier for this request. Restricted to 36 ASCII characters. + * A random UUID is recommended. This request is idempotent only if a + * `request_id` is provided. + * @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\Cloud\DataCatalog\Lineage\V1\ProcessOpenLineageRunEventResponse + * + * @throws ApiException if the remote call fails + */ + public function processOpenLineageRunEvent($parent, $openLineage, array $optionalArgs = []) + { + $request = new ProcessOpenLineageRunEventRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setOpenLineage($openLineage); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('ProcessOpenLineageRunEvent', ProcessOpenLineageRunEventResponse::class, $optionalArgs, $request)->wait(); + } + /** * Retrieve a list of links connected to a specific asset. * Links represent the data flow between **source** (upstream) @@ -1204,7 +1262,7 @@ public function listRuns($parent, array $optionalArgs = []) * } * ``` * - * @param string $parent Required. The project and location you want search in the format `projects/*/locations/*` + * @param string $parent Required. The project and location you want search in. * @param array $optionalArgs { * Optional. * @@ -1340,6 +1398,8 @@ public function updateProcess($process, array $optionalArgs = []) * @type FieldMask $updateMask * The list of fields to update. Currently not used. The whole message is * updated. + * @type bool $allowMissing + * If set to true and the run is not found, the request creates it. * @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 @@ -1360,6 +1420,10 @@ public function updateRun($run, array $optionalArgs = []) $request->setUpdateMask($optionalArgs['updateMask']); } + if (isset($optionalArgs['allowMissing'])) { + $request->setAllowMissing($optionalArgs['allowMissing']); + } + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); return $this->startCall('UpdateRun', Run::class, $optionalArgs, $request)->wait(); diff --git a/DataCatalogLineage/src/V1/LineageEvent.php b/DataCatalogLineage/src/V1/LineageEvent.php index 8a7f7044abf9..2f6da93d3340 100644 --- a/DataCatalogLineage/src/V1/LineageEvent.php +++ b/DataCatalogLineage/src/V1/LineageEvent.php @@ -34,11 +34,11 @@ class LineageEvent extends \Google\Protobuf\Internal\Message */ private $links; /** - * Optional. The beginning of the transformation which resulted in this + * Required. The beginning of the transformation which resulted in this * lineage event. For streaming scenarios, it should be the beginning of the * period from which the lineage is being reported. * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + * Generated from protobuf field .google.protobuf.Timestamp start_time = 6 [(.google.api.field_behavior) = REQUIRED]; */ protected $start_time = null; /** @@ -66,7 +66,7 @@ class LineageEvent extends \Google\Protobuf\Internal\Message * @type array<\Google\Cloud\DataCatalog\Lineage\V1\EventLink>|\Google\Protobuf\Internal\RepeatedField $links * Optional. List of source-target pairs. Can't contain more than 100 tuples. * @type \Google\Protobuf\Timestamp $start_time - * Optional. The beginning of the transformation which resulted in this + * Required. The beginning of the transformation which resulted in this * lineage event. For streaming scenarios, it should be the beginning of the * period from which the lineage is being reported. * @type \Google\Protobuf\Timestamp $end_time @@ -143,11 +143,11 @@ public function setLinks($var) } /** - * Optional. The beginning of the transformation which resulted in this + * Required. The beginning of the transformation which resulted in this * lineage event. For streaming scenarios, it should be the beginning of the * period from which the lineage is being reported. * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + * Generated from protobuf field .google.protobuf.Timestamp start_time = 6 [(.google.api.field_behavior) = REQUIRED]; * @return \Google\Protobuf\Timestamp|null */ public function getStartTime() @@ -166,11 +166,11 @@ public function clearStartTime() } /** - * Optional. The beginning of the transformation which resulted in this + * Required. The beginning of the transformation which resulted in this * lineage event. For streaming scenarios, it should be the beginning of the * period from which the lineage is being reported. * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + * Generated from protobuf field .google.protobuf.Timestamp start_time = 6 [(.google.api.field_behavior) = REQUIRED]; * @param \Google\Protobuf\Timestamp $var * @return $this */ diff --git a/DataCatalogLineage/src/V1/OperationMetadata/Type.php b/DataCatalogLineage/src/V1/OperationMetadata/Type.php index 8d81ee4f6faa..190f28ceea6a 100644 --- a/DataCatalogLineage/src/V1/OperationMetadata/Type.php +++ b/DataCatalogLineage/src/V1/OperationMetadata/Type.php @@ -25,10 +25,17 @@ class Type * Generated from protobuf enum DELETE = 1; */ const DELETE = 1; + /** + * The resource creation operation. + * + * Generated from protobuf enum CREATE = 2; + */ + const CREATE = 2; private static $valueToName = [ self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', self::DELETE => 'DELETE', + self::CREATE => 'CREATE', ]; public static function name($value) diff --git a/DataCatalogLineage/src/V1/Origin.php b/DataCatalogLineage/src/V1/Origin.php index 369d744cfb75..7ff80980f5ac 100644 --- a/DataCatalogLineage/src/V1/Origin.php +++ b/DataCatalogLineage/src/V1/Origin.php @@ -17,6 +17,9 @@ class Origin extends \Google\Protobuf\Internal\Message { /** * Type of the source. + * Use of a source_type other than `CUSTOM` for process creation + * or updating is highly discouraged, and may be restricted in the future + * without notice. * * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Origin.SourceType source_type = 1; */ @@ -43,6 +46,9 @@ class Origin extends \Google\Protobuf\Internal\Message * * @type int $source_type * Type of the source. + * Use of a source_type other than `CUSTOM` for process creation + * or updating is highly discouraged, and may be restricted in the future + * without notice. * @type string $name * If the source_type isn't CUSTOM, the value of this field should be a GCP * resource name of the system, which reports lineage. The project and @@ -61,6 +67,9 @@ public function __construct($data = NULL) { /** * Type of the source. + * Use of a source_type other than `CUSTOM` for process creation + * or updating is highly discouraged, and may be restricted in the future + * without notice. * * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Origin.SourceType source_type = 1; * @return int @@ -72,6 +81,9 @@ public function getSourceType() /** * Type of the source. + * Use of a source_type other than `CUSTOM` for process creation + * or updating is highly discouraged, and may be restricted in the future + * without notice. * * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Origin.SourceType source_type = 1; * @param int $var diff --git a/DataCatalogLineage/src/V1/Origin/SourceType.php b/DataCatalogLineage/src/V1/Origin/SourceType.php index a119c039e9ed..0a2243e4304a 100644 --- a/DataCatalogLineage/src/V1/Origin/SourceType.php +++ b/DataCatalogLineage/src/V1/Origin/SourceType.php @@ -49,6 +49,12 @@ class SourceType * Generated from protobuf enum LOOKER_STUDIO = 5; */ const LOOKER_STUDIO = 5; + /** + * Dataproc + * + * Generated from protobuf enum DATAPROC = 6; + */ + const DATAPROC = 6; private static $valueToName = [ self::SOURCE_TYPE_UNSPECIFIED => 'SOURCE_TYPE_UNSPECIFIED', @@ -57,6 +63,7 @@ class SourceType self::DATA_FUSION => 'DATA_FUSION', self::COMPOSER => 'COMPOSER', self::LOOKER_STUDIO => 'LOOKER_STUDIO', + self::DATAPROC => 'DATAPROC', ]; public static function name($value) diff --git a/DataCatalogLineage/src/V1/Process.php b/DataCatalogLineage/src/V1/Process.php index 2127534369a1..7e3b5ce22728 100644 --- a/DataCatalogLineage/src/V1/Process.php +++ b/DataCatalogLineage/src/V1/Process.php @@ -34,8 +34,10 @@ class Process extends \Google\Protobuf\Internal\Message */ protected $display_name = ''; /** - * Optional. The attributes of the process. Can be anything, for example, - * "author". Up to 100 attributes are allowed. + * Optional. The attributes of the process. Should only be used for the + * purpose of non-semantic management (classifying, describing or labeling the + * process). + * Up to 100 attributes are allowed. * * Generated from protobuf field map attributes = 3 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -64,8 +66,10 @@ class Process extends \Google\Protobuf\Internal\Message * Must be not longer than 200 characters and only contain UTF-8 letters * or numbers, spaces or characters like `_-:&.` * @type array|\Google\Protobuf\Internal\MapField $attributes - * Optional. The attributes of the process. Can be anything, for example, - * "author". Up to 100 attributes are allowed. + * Optional. The attributes of the process. Should only be used for the + * purpose of non-semantic management (classifying, describing or labeling the + * process). + * Up to 100 attributes are allowed. * @type \Google\Cloud\DataCatalog\Lineage\V1\Origin $origin * Optional. The origin of this process and its runs and lineage events. * } @@ -140,8 +144,10 @@ public function setDisplayName($var) } /** - * Optional. The attributes of the process. Can be anything, for example, - * "author". Up to 100 attributes are allowed. + * Optional. The attributes of the process. Should only be used for the + * purpose of non-semantic management (classifying, describing or labeling the + * process). + * Up to 100 attributes are allowed. * * Generated from protobuf field map attributes = 3 [(.google.api.field_behavior) = OPTIONAL]; * @return \Google\Protobuf\Internal\MapField @@ -152,8 +158,10 @@ public function getAttributes() } /** - * Optional. The attributes of the process. Can be anything, for example, - * "author". Up to 100 attributes are allowed. + * Optional. The attributes of the process. Should only be used for the + * purpose of non-semantic management (classifying, describing or labeling the + * process). + * Up to 100 attributes are allowed. * * Generated from protobuf field map attributes = 3 [(.google.api.field_behavior) = OPTIONAL]; * @param array|\Google\Protobuf\Internal\MapField $var diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ProcessOpenLineageRunEventRequest.php b/DataCatalogLineage/src/V1/ProcessOpenLineageRunEventRequest.php similarity index 100% rename from owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ProcessOpenLineageRunEventRequest.php rename to DataCatalogLineage/src/V1/ProcessOpenLineageRunEventRequest.php diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ProcessOpenLineageRunEventResponse.php b/DataCatalogLineage/src/V1/ProcessOpenLineageRunEventResponse.php similarity index 100% rename from owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ProcessOpenLineageRunEventResponse.php rename to DataCatalogLineage/src/V1/ProcessOpenLineageRunEventResponse.php diff --git a/DataCatalogLineage/src/V1/Run.php b/DataCatalogLineage/src/V1/Run.php index ffc30d399699..b9f690869130 100644 --- a/DataCatalogLineage/src/V1/Run.php +++ b/DataCatalogLineage/src/V1/Run.php @@ -35,8 +35,9 @@ class Run extends \Google\Protobuf\Internal\Message */ protected $display_name = ''; /** - * Optional. The attributes of the run. Can be anything, for example, a string - * with an SQL request. Up to 100 attributes are allowed. + * Optional. The attributes of the run. Should only be used for the purpose of + * non-semantic management (classifying, describing or labeling the run). + * Up to 100 attributes are allowed. * * Generated from protobuf field map attributes = 3 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -77,8 +78,9 @@ class Run extends \Google\Protobuf\Internal\Message * Must be not longer than 1024 characters and only contain UTF-8 letters * or numbers, spaces or characters like `_-:&.` * @type array|\Google\Protobuf\Internal\MapField $attributes - * Optional. The attributes of the run. Can be anything, for example, a string - * with an SQL request. Up to 100 attributes are allowed. + * Optional. The attributes of the run. Should only be used for the purpose of + * non-semantic management (classifying, describing or labeling the run). + * Up to 100 attributes are allowed. * @type \Google\Protobuf\Timestamp $start_time * Required. The timestamp of the start of the run. * @type \Google\Protobuf\Timestamp $end_time @@ -157,8 +159,9 @@ public function setDisplayName($var) } /** - * Optional. The attributes of the run. Can be anything, for example, a string - * with an SQL request. Up to 100 attributes are allowed. + * Optional. The attributes of the run. Should only be used for the purpose of + * non-semantic management (classifying, describing or labeling the run). + * Up to 100 attributes are allowed. * * Generated from protobuf field map attributes = 3 [(.google.api.field_behavior) = OPTIONAL]; * @return \Google\Protobuf\Internal\MapField @@ -169,8 +172,9 @@ public function getAttributes() } /** - * Optional. The attributes of the run. Can be anything, for example, a string - * with an SQL request. Up to 100 attributes are allowed. + * Optional. The attributes of the run. Should only be used for the purpose of + * non-semantic management (classifying, describing or labeling the run). + * Up to 100 attributes are allowed. * * Generated from protobuf field map attributes = 3 [(.google.api.field_behavior) = OPTIONAL]; * @param array|\Google\Protobuf\Internal\MapField $var diff --git a/DataCatalogLineage/src/V1/SearchLinksRequest.php b/DataCatalogLineage/src/V1/SearchLinksRequest.php index d2db56e9fb55..61cfe999f15d 100644 --- a/DataCatalogLineage/src/V1/SearchLinksRequest.php +++ b/DataCatalogLineage/src/V1/SearchLinksRequest.php @@ -17,7 +17,7 @@ class SearchLinksRequest extends \Google\Protobuf\Internal\Message { /** - * Required. The project and location you want search in the format `projects/*/locations/*` + * Required. The project and location you want search in. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -50,7 +50,7 @@ class SearchLinksRequest extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $parent - * Required. The project and location you want search in the format `projects/*/locations/*` + * Required. The project and location you want search in. * @type \Google\Cloud\DataCatalog\Lineage\V1\EntityReference $source * Optional. Send asset information in the **source** field to retrieve all * links that lead from the specified asset to downstream assets. @@ -76,7 +76,7 @@ public function __construct($data = NULL) { } /** - * Required. The project and location you want search in the format `projects/*/locations/*` + * Required. The project and location you want search in. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -87,7 +87,7 @@ public function getParent() } /** - * Required. The project and location you want search in the format `projects/*/locations/*` + * Required. The project and location you want search in. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/DataCatalogLineage/src/V1/UpdateRunRequest.php b/DataCatalogLineage/src/V1/UpdateRunRequest.php index 72b5866ce820..8122fdd17704 100644 --- a/DataCatalogLineage/src/V1/UpdateRunRequest.php +++ b/DataCatalogLineage/src/V1/UpdateRunRequest.php @@ -32,6 +32,12 @@ class UpdateRunRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; */ protected $update_mask = null; + /** + * If set to true and the run is not found, the request creates it. + * + * Generated from protobuf field bool allow_missing = 3; + */ + protected $allow_missing = false; /** * @param \Google\Cloud\DataCatalog\Lineage\V1\Run $run Required. The lineage run to update. @@ -68,6 +74,8 @@ public static function build(\Google\Cloud\DataCatalog\Lineage\V1\Run $run, \Goo * @type \Google\Protobuf\FieldMask $update_mask * The list of fields to update. Currently not used. The whole message is * updated. + * @type bool $allow_missing + * If set to true and the run is not found, the request creates it. * } */ public function __construct($data = NULL) { @@ -155,5 +163,31 @@ public function setUpdateMask($var) return $this; } + /** + * If set to true and the run is not found, the request creates it. + * + * Generated from protobuf field bool allow_missing = 3; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * If set to true and the run is not found, the request creates it. + * + * Generated from protobuf field bool allow_missing = 3; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + } diff --git a/DataCatalogLineage/src/V1/gapic_metadata.json b/DataCatalogLineage/src/V1/gapic_metadata.json index 7d0f974b35cc..1668b663dd4a 100644 --- a/DataCatalogLineage/src/V1/gapic_metadata.json +++ b/DataCatalogLineage/src/V1/gapic_metadata.json @@ -75,6 +75,11 @@ "listRuns" ] }, + "ProcessOpenLineageRunEvent": { + "methods": [ + "processOpenLineageRunEvent" + ] + }, "SearchLinks": { "methods": [ "searchLinks" diff --git a/DataCatalogLineage/src/V1/resources/lineage_client_config.json b/DataCatalogLineage/src/V1/resources/lineage_client_config.json index d8dd8870a7c9..33da215543da 100644 --- a/DataCatalogLineage/src/V1/resources/lineage_client_config.json +++ b/DataCatalogLineage/src/V1/resources/lineage_client_config.json @@ -93,6 +93,11 @@ "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "ProcessOpenLineageRunEvent": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "SearchLinks": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", diff --git a/DataCatalogLineage/src/V1/resources/lineage_descriptor_config.php b/DataCatalogLineage/src/V1/resources/lineage_descriptor_config.php index 6ead216d0eb0..67a2be85f895 100644 --- a/DataCatalogLineage/src/V1/resources/lineage_descriptor_config.php +++ b/DataCatalogLineage/src/V1/resources/lineage_descriptor_config.php @@ -205,6 +205,18 @@ ], ], ], + 'ProcessOpenLineageRunEvent' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DataCatalog\Lineage\V1\ProcessOpenLineageRunEventResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'SearchLinks' => [ 'pageStreaming' => [ 'requestPageTokenGetMethod' => 'getPageToken', diff --git a/DataCatalogLineage/src/V1/resources/lineage_rest_client_config.php b/DataCatalogLineage/src/V1/resources/lineage_rest_client_config.php index 39ff25c49e3a..0f8e407dc4fb 100644 --- a/DataCatalogLineage/src/V1/resources/lineage_rest_client_config.php +++ b/DataCatalogLineage/src/V1/resources/lineage_rest_client_config.php @@ -150,6 +150,18 @@ ], ], ], + 'ProcessOpenLineageRunEvent' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}:processOpenLineageRunEvent', + 'body' => 'open_lineage', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'SearchLinks' => [ 'method' => 'post', 'uriTemplate' => '/v1/{parent=projects/*/locations/*}:searchLinks', diff --git a/DataCatalogLineage/tests/Unit/V1/Client/LineageClientTest.php b/DataCatalogLineage/tests/Unit/V1/Client/LineageClientTest.php index 456e2e8591ec..58f95fc0d16b 100644 --- a/DataCatalogLineage/tests/Unit/V1/Client/LineageClientTest.php +++ b/DataCatalogLineage/tests/Unit/V1/Client/LineageClientTest.php @@ -49,6 +49,8 @@ use Google\Cloud\DataCatalog\Lineage\V1\ListRunsResponse; use Google\Cloud\DataCatalog\Lineage\V1\Process; use Google\Cloud\DataCatalog\Lineage\V1\ProcessLinks; +use Google\Cloud\DataCatalog\Lineage\V1\ProcessOpenLineageRunEventRequest; +use Google\Cloud\DataCatalog\Lineage\V1\ProcessOpenLineageRunEventResponse; use Google\Cloud\DataCatalog\Lineage\V1\Run; use Google\Cloud\DataCatalog\Lineage\V1\Run\State; use Google\Cloud\DataCatalog\Lineage\V1\SearchLinksRequest; @@ -59,6 +61,7 @@ use Google\LongRunning\Operation; use Google\Protobuf\Any; use Google\Protobuf\GPBEmpty; +use Google\Protobuf\Struct; use Google\Protobuf\Timestamp; use Google\Rpc\Code; use stdClass; @@ -185,6 +188,8 @@ public function createLineageEventTest() // Mock request $formattedParent = $gapicClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); $lineageEvent = new LineageEvent(); + $lineageEventStartTime = new Timestamp(); + $lineageEvent->setStartTime($lineageEventStartTime); $request = (new CreateLineageEventRequest()) ->setParent($formattedParent) ->setLineageEvent($lineageEvent); @@ -223,6 +228,8 @@ public function createLineageEventExceptionTest() // Mock request $formattedParent = $gapicClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); $lineageEvent = new LineageEvent(); + $lineageEventStartTime = new Timestamp(); + $lineageEvent->setStartTime($lineageEventStartTime); $request = (new CreateLineageEventRequest()) ->setParent($formattedParent) ->setLineageEvent($lineageEvent); @@ -1106,6 +1113,78 @@ public function listRunsExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function processOpenLineageRunEventTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $process = 'process-309518737'; + $run = 'run113291'; + $expectedResponse = new ProcessOpenLineageRunEventResponse(); + $expectedResponse->setProcess($process); + $expectedResponse->setRun($run); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $openLineage = new Struct(); + $request = (new ProcessOpenLineageRunEventRequest()) + ->setParent($parent) + ->setOpenLineage($openLineage); + $response = $gapicClient->processOpenLineageRunEvent($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/ProcessOpenLineageRunEvent', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualRequestObject->getOpenLineage(); + $this->assertProtobufEquals($openLineage, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function processOpenLineageRunEventExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + $openLineage = new Struct(); + $request = (new ProcessOpenLineageRunEventRequest()) + ->setParent($parent) + ->setOpenLineage($openLineage); + try { + $gapicClient->processOpenLineageRunEvent($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function searchLinksTest() { diff --git a/DataCatalogLineage/tests/Unit/V1/LineageClientTest.php b/DataCatalogLineage/tests/Unit/V1/LineageClientTest.php index 575205c031dc..d704af8f5acd 100644 --- a/DataCatalogLineage/tests/Unit/V1/LineageClientTest.php +++ b/DataCatalogLineage/tests/Unit/V1/LineageClientTest.php @@ -36,6 +36,7 @@ use Google\Cloud\DataCatalog\Lineage\V1\ListRunsResponse; use Google\Cloud\DataCatalog\Lineage\V1\Process; use Google\Cloud\DataCatalog\Lineage\V1\ProcessLinks; +use Google\Cloud\DataCatalog\Lineage\V1\ProcessOpenLineageRunEventResponse; use Google\Cloud\DataCatalog\Lineage\V1\Run; use Google\Cloud\DataCatalog\Lineage\V1\Run\State; use Google\Cloud\DataCatalog\Lineage\V1\SearchLinksResponse; @@ -43,6 +44,7 @@ use Google\LongRunning\Operation; use Google\Protobuf\Any; use Google\Protobuf\GPBEmpty; +use Google\Protobuf\Struct; use Google\Protobuf\Timestamp; use Google\Rpc\Code; use stdClass; @@ -163,6 +165,8 @@ public function createLineageEventTest() // Mock request $formattedParent = $gapicClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); $lineageEvent = new LineageEvent(); + $lineageEventStartTime = new Timestamp(); + $lineageEvent->setStartTime($lineageEventStartTime); $response = $gapicClient->createLineageEvent($formattedParent, $lineageEvent); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -198,6 +202,8 @@ public function createLineageEventExceptionTest() // Mock request $formattedParent = $gapicClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); $lineageEvent = new LineageEvent(); + $lineageEventStartTime = new Timestamp(); + $lineageEvent->setStartTime($lineageEventStartTime); try { $gapicClient->createLineageEvent($formattedParent, $lineageEvent); // If the $gapicClient method call did not throw, fail the test @@ -1030,6 +1036,72 @@ public function listRunsExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function processOpenLineageRunEventTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $process = 'process-309518737'; + $run = 'run113291'; + $expectedResponse = new ProcessOpenLineageRunEventResponse(); + $expectedResponse->setProcess($process); + $expectedResponse->setRun($run); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $openLineage = new Struct(); + $response = $gapicClient->processOpenLineageRunEvent($parent, $openLineage); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/ProcessOpenLineageRunEvent', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualRequestObject->getOpenLineage(); + $this->assertProtobufEquals($openLineage, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function processOpenLineageRunEventExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + $openLineage = new Struct(); + try { + $gapicClient->processOpenLineageRunEvent($parent, $openLineage); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function searchLinksTest() { diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/GPBMetadata/Google/Cloud/Datacatalog/Lineage/V1/Lineage.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/GPBMetadata/Google/Cloud/Datacatalog/Lineage/V1/Lineage.php deleted file mode 100644 index 155e66baf2bd52923aa15e4c097a5b16ad3f5e50..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11416 zcmb_iO>7%k9pAB&G7 z=l%ch|MB~Oy#KsgcU#*nbXi@s9II`5)`q&ir+V9#+G;nwX1&=^*E^e=R$Hw%cUyMD zYR6SIQ&97TH8q>bt-TDSZnM*_Te`Z{Y;HBIM7`1MY$P^J&#c4WMsq9CupP_XvJ#J$ z#m6}1j*w&ST5ij%Tk2{tb>H$#LRMX+jH+qEsG8|As@`Last=ZLB2;gfuB-B&&=aJ> zpH^qRVb@jHGd=k472B=Zj_uiI!~QmCc3a&v8?FVk{cATnPTjMcj!Fm$PTg9#sxqEr z?JKP&SmL%SL@N^GfMKdR$Ftgw*{EhLx8Al}Ub9_=>FAG=swuGI%sV*=X zb-ho>+p5>@Si#*@wQYHwwsVupO&IL^pQ-~4XSD39;W$lVg{I@`dRM0|i(!Q6hHW|C zXf!Lf)!0Z`+vX#?*&dCwWO4XN3wf{UY_&U%V>?^bLW_WQG$noCf#tHhEpJa=V4svK zeBX3;jzC)m_tr-+u)pb=4Z-4>yRE^SQjETO$L5GMHa2_!u0Y@}_>dt0x`I9}qUDhz z7GGv0aT?_DK#<3IkjEb_&tK$x&6W+>fWV2x`}|9R2b%;lwRH{}zTi?|L7O9kKjJ$l z8eR7%n!fw_q8B)Qi^pfeA`a#cMS}7lG7)ycjeNxyddXetEB;hS@6&t2A#8#6y(l^b z-l|)!i_fAllHBGLRauxyMgMAy<4frDhV8Z*=3b3Hiik%Ft{`N3UfW*pc$PaCRig{B z;5X1jvu$tL&fFO66-$0aie-V4P!97sG}FTw$53>~ z+GC30FQM^AW}{=x5oKb@=fwuXM)3#asUEqZ=o`-r6KMo80xC>DK#3cN>XHzqy9vba zS#{4%JmH`A!Rt^=NSr60h>!aTcuH(-v4!O0zV@3j6fJd}5$*r>0Q=t%x*UY{IP5jp z_OBrX!P@p}1SQ=5^MWNvPU}b9k7;7=2wp~$mb1Y~#;HXQAyIG&jgwMh%}v1iGs(Ev z;!vr}go$5@oH5NI*3Zf0VE}n^w z&Puz6W_q^3FQfCDoknA?_OJul3+l!OOW}TYk7)mhqO*QGB3fBo6wygmo{`MyeQe@> ztVZ!S&>6q%)x5nHOTA~3H>GUX&w3455EDl61vDvYE|ef%wxW0*O^csvosPXha~UmZ zQG5->>TL`1$OtJb8p?7~5fIhNBCT9NXCafUWowmuxtLAoR&tOyXo4wb^O;}3fnGg*?PfFpcPm$IRr!z>?HOE=2Xp=f*2iHTbJ23TcrFIF-8mxuG7K zh%@L+DArjUGnHEU+_);AhP00rbUsZX#T66=)q4!O2=x-Q!7?31s%r?=rz{DRA6O;1 z1jGIC3lO%_f(&c*2piat1b!@egbfoY)}g#>q(kLc=`R&4q>m;?5s2Suv(aciuI<{c z3#TIrmPzeCI=gClJp$ecwWr*cGRV;O(D{3|EBIONN%-e1nrgv-pyt9cohmwx0rvDK zueoD69QF^@`}KQ? zY&5C;OhK~@_mD}1O|SQ0{>v2eDn6_!(!0?cOD;%Z9d;d#^B;q74Cevi_$CbBBW`k1 z*v_J9z;-|=Na=xN7q{18xl3!I83HWeNd(!)8I#g455?q!-bWo(>(0&I!4+sjb z6~T8q1SKx~2$k%812+JohKAj2Ts->du6z7S*>R1a9K{Zl~`Y$^+>BgRH1 z?Cj6R3fHCLlW~Zb>FYXr@C6;ZlW6Vx3POR0FQAL%LZy_>)&?Jr)0OgC;XWLWPov3H zZuRX-w)8HXw`Wi+W2_mql}b5R$iqwz9+Pojp`0zvjsX&tQfd!pz^l;w>aqE-(9qs{|IdH_D3aIi zkXM~g*!ll7gmXQ{x=tv=p2j;7=7a9XcrEuS=;Bq7fDt z>9nL3sG2vlS0&W!4(W9Zu9iVp(F z#y@+51ZjY&FaxBa@c$JQZZ@F6Nhu$&#iMJGrW#zw%mI=iFQgZd|62u3l29zc6avdN z;9|LuSPp4jDjw?DkoX6NdOv=;5&s{6jX&{_gpI#msBlQ6|A7+;Q`Q7<2=t2(0h{>k-b+W4a5wD zPDpjR7h*kB$I!b>^5t7jPpC!=})Xc@VrM%ilCzO)|#Q<_1t(B0b z($PBD!`y>m@V93FrBy4#(S>B=Jh7tAb&4FGUPN|#~eLb2>Ixo|C4sg{OzOGeA}A>$TM zc|QM{F+co{#Gj1#w&%56J&}0)_%RpVzp-R?ylr;h^;Njm5J7u(kei$C9;+_y@T zJ6FxEI1j7%gXPb}sw%%_ORw4TbyfeKEnKvH7O7rg40WAy)b#*MUFSS?{lW731npg4 gyW-z8Tw+&Q12google.cloud.datacatalog.lineage.v1.BatchSearchLinkProcessesRequest - */ -class BatchSearchLinkProcessesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The project and location where you want to search. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. An array of links to check for their associated LineageProcesses. - * The maximum number of items in this array is 100. - * If the request contains more than 100 links, it returns the - * `INVALID_ARGUMENT` error. - * Format: `projects/{project}/locations/{location}/links/{link}`. - * - * Generated from protobuf field repeated string links = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $links; - /** - * The maximum number of processes to return in a single page of the response. - * A page may contain fewer results than this value. - * - * Generated from protobuf field int32 page_size = 3; - */ - protected $page_size = 0; - /** - * The page token received from a previous `BatchSearchLinkProcesses` call. - * Use it to get the next page. - * When requesting subsequent pages of a response, remember that - * all parameters must match the values you provided - * in the original request. - * - * Generated from protobuf field string page_token = 4; - */ - protected $page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The project and location where you want to search. - * @type array|\Google\Protobuf\Internal\RepeatedField $links - * Required. An array of links to check for their associated LineageProcesses. - * The maximum number of items in this array is 100. - * If the request contains more than 100 links, it returns the - * `INVALID_ARGUMENT` error. - * Format: `projects/{project}/locations/{location}/links/{link}`. - * @type int $page_size - * The maximum number of processes to return in a single page of the response. - * A page may contain fewer results than this value. - * @type string $page_token - * The page token received from a previous `BatchSearchLinkProcesses` call. - * Use it to get the next page. - * When requesting subsequent pages of a response, remember that - * all parameters must match the values you provided - * in the original request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); - parent::__construct($data); - } - - /** - * Required. The project and location where you want to search. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The project and location where you want to search. - * - * 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. An array of links to check for their associated LineageProcesses. - * The maximum number of items in this array is 100. - * If the request contains more than 100 links, it returns the - * `INVALID_ARGUMENT` error. - * Format: `projects/{project}/locations/{location}/links/{link}`. - * - * Generated from protobuf field repeated string links = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getLinks() - { - return $this->links; - } - - /** - * Required. An array of links to check for their associated LineageProcesses. - * The maximum number of items in this array is 100. - * If the request contains more than 100 links, it returns the - * `INVALID_ARGUMENT` error. - * Format: `projects/{project}/locations/{location}/links/{link}`. - * - * Generated from protobuf field repeated string links = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setLinks($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->links = $arr; - - return $this; - } - - /** - * The maximum number of processes to return in a single page of the response. - * A page may contain fewer results than this value. - * - * Generated from protobuf field int32 page_size = 3; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of processes to return in a single page of the response. - * A page may contain fewer results than this value. - * - * Generated from protobuf field int32 page_size = 3; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * The page token received from a previous `BatchSearchLinkProcesses` call. - * Use it to get the next page. - * When requesting subsequent pages of a response, remember that - * all parameters must match the values you provided - * in the original request. - * - * Generated from protobuf field string page_token = 4; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * The page token received from a previous `BatchSearchLinkProcesses` call. - * Use it to get the next page. - * When requesting subsequent pages of a response, remember that - * all parameters must match the values you provided - * in the original request. - * - * Generated from protobuf field string page_token = 4; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/BatchSearchLinkProcessesResponse.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/BatchSearchLinkProcessesResponse.php deleted file mode 100644 index 6dd4e7df55b5..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/BatchSearchLinkProcessesResponse.php +++ /dev/null @@ -1,106 +0,0 @@ -google.cloud.datacatalog.lineage.v1.BatchSearchLinkProcessesResponse - */ -class BatchSearchLinkProcessesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * An array of processes associated with the specified links. - * - * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.ProcessLinks process_links = 1; - */ - private $process_links; - /** - * The token to specify as `page_token` in the subsequent call to get the next - * page. Omitted if there are no more pages in the response. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\DataCatalog\Lineage\V1\ProcessLinks>|\Google\Protobuf\Internal\RepeatedField $process_links - * An array of processes associated with the specified links. - * @type string $next_page_token - * The token to specify as `page_token` in the subsequent call to get the next - * page. Omitted if there are no more pages in the response. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); - parent::__construct($data); - } - - /** - * An array of processes associated with the specified links. - * - * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.ProcessLinks process_links = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getProcessLinks() - { - return $this->process_links; - } - - /** - * An array of processes associated with the specified links. - * - * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.ProcessLinks process_links = 1; - * @param array<\Google\Cloud\DataCatalog\Lineage\V1\ProcessLinks>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setProcessLinks($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DataCatalog\Lineage\V1\ProcessLinks::class); - $this->process_links = $arr; - - return $this; - } - - /** - * The token to specify as `page_token` in the subsequent call to get the next - * page. Omitted if there are no more pages in the response. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * The token to specify as `page_token` in the subsequent call to get the next - * page. Omitted if there are no more pages in the response. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/CreateLineageEventRequest.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/CreateLineageEventRequest.php deleted file mode 100644 index dbe80ec46995..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/CreateLineageEventRequest.php +++ /dev/null @@ -1,170 +0,0 @@ -google.cloud.datacatalog.lineage.v1.CreateLineageEventRequest - */ -class CreateLineageEventRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the run that should own the lineage event. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The lineage event to create. - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.LineageEvent lineage_event = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $lineage_event = null; - /** - * A unique identifier for this request. Restricted to 36 ASCII characters. - * A random UUID is recommended. This request is idempotent only if a - * `request_id` is provided. - * - * Generated from protobuf field string request_id = 3; - */ - protected $request_id = ''; - - /** - * @param string $parent Required. The name of the run that should own the lineage event. Please see - * {@see LineageClient::runName()} for help formatting this field. - * @param \Google\Cloud\DataCatalog\Lineage\V1\LineageEvent $lineageEvent Required. The lineage event to create. - * - * @return \Google\Cloud\DataCatalog\Lineage\V1\CreateLineageEventRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\DataCatalog\Lineage\V1\LineageEvent $lineageEvent): self - { - return (new self()) - ->setParent($parent) - ->setLineageEvent($lineageEvent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the run that should own the lineage event. - * @type \Google\Cloud\DataCatalog\Lineage\V1\LineageEvent $lineage_event - * Required. The lineage event to create. - * @type string $request_id - * A unique identifier for this request. Restricted to 36 ASCII characters. - * A random UUID is recommended. This request is idempotent only if a - * `request_id` is provided. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the run that should own the lineage event. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The name of the run that should own the lineage event. - * - * 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 lineage event to create. - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.LineageEvent lineage_event = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\DataCatalog\Lineage\V1\LineageEvent|null - */ - public function getLineageEvent() - { - return $this->lineage_event; - } - - public function hasLineageEvent() - { - return isset($this->lineage_event); - } - - public function clearLineageEvent() - { - unset($this->lineage_event); - } - - /** - * Required. The lineage event to create. - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.LineageEvent lineage_event = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\DataCatalog\Lineage\V1\LineageEvent $var - * @return $this - */ - public function setLineageEvent($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\Lineage\V1\LineageEvent::class); - $this->lineage_event = $var; - - return $this; - } - - /** - * A unique identifier for this request. Restricted to 36 ASCII characters. - * A random UUID is recommended. This request is idempotent only if a - * `request_id` is provided. - * - * Generated from protobuf field string request_id = 3; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * A unique identifier for this request. Restricted to 36 ASCII characters. - * A random UUID is recommended. This request is idempotent only if a - * `request_id` is provided. - * - * Generated from protobuf field string request_id = 3; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/CreateProcessRequest.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/CreateProcessRequest.php deleted file mode 100644 index aa9d1ebaaee6..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/CreateProcessRequest.php +++ /dev/null @@ -1,175 +0,0 @@ -google.cloud.datacatalog.lineage.v1.CreateProcessRequest - */ -class CreateProcessRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the project and its location that should own the - * process. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The process to create. - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Process process = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $process = null; - /** - * A unique identifier for this request. Restricted to 36 ASCII characters. - * A random UUID is recommended. This request is idempotent only if a - * `request_id` is provided. - * - * Generated from protobuf field string request_id = 3; - */ - protected $request_id = ''; - - /** - * @param string $parent Required. The name of the project and its location that should own the - * process. Please see - * {@see LineageClient::locationName()} for help formatting this field. - * @param \Google\Cloud\DataCatalog\Lineage\V1\Process $process Required. The process to create. - * - * @return \Google\Cloud\DataCatalog\Lineage\V1\CreateProcessRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\DataCatalog\Lineage\V1\Process $process): self - { - return (new self()) - ->setParent($parent) - ->setProcess($process); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the project and its location that should own the - * process. - * @type \Google\Cloud\DataCatalog\Lineage\V1\Process $process - * Required. The process to create. - * @type string $request_id - * A unique identifier for this request. Restricted to 36 ASCII characters. - * A random UUID is recommended. This request is idempotent only if a - * `request_id` is provided. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the project and its location that should own the - * process. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The name of the project and its location that should own the - * process. - * - * 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 process to create. - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Process process = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\DataCatalog\Lineage\V1\Process|null - */ - public function getProcess() - { - return $this->process; - } - - public function hasProcess() - { - return isset($this->process); - } - - public function clearProcess() - { - unset($this->process); - } - - /** - * Required. The process to create. - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Process process = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\DataCatalog\Lineage\V1\Process $var - * @return $this - */ - public function setProcess($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\Lineage\V1\Process::class); - $this->process = $var; - - return $this; - } - - /** - * A unique identifier for this request. Restricted to 36 ASCII characters. - * A random UUID is recommended. This request is idempotent only if a - * `request_id` is provided. - * - * Generated from protobuf field string request_id = 3; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * A unique identifier for this request. Restricted to 36 ASCII characters. - * A random UUID is recommended. This request is idempotent only if a - * `request_id` is provided. - * - * Generated from protobuf field string request_id = 3; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/CreateRunRequest.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/CreateRunRequest.php deleted file mode 100644 index 67ac72ae8277..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/CreateRunRequest.php +++ /dev/null @@ -1,170 +0,0 @@ -google.cloud.datacatalog.lineage.v1.CreateRunRequest - */ -class CreateRunRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the process that should own the run. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The run to create. - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Run run = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $run = null; - /** - * A unique identifier for this request. Restricted to 36 ASCII characters. - * A random UUID is recommended. This request is idempotent only if a - * `request_id` is provided. - * - * Generated from protobuf field string request_id = 3; - */ - protected $request_id = ''; - - /** - * @param string $parent Required. The name of the process that should own the run. Please see - * {@see LineageClient::processName()} for help formatting this field. - * @param \Google\Cloud\DataCatalog\Lineage\V1\Run $run Required. The run to create. - * - * @return \Google\Cloud\DataCatalog\Lineage\V1\CreateRunRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\DataCatalog\Lineage\V1\Run $run): self - { - return (new self()) - ->setParent($parent) - ->setRun($run); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the process that should own the run. - * @type \Google\Cloud\DataCatalog\Lineage\V1\Run $run - * Required. The run to create. - * @type string $request_id - * A unique identifier for this request. Restricted to 36 ASCII characters. - * A random UUID is recommended. This request is idempotent only if a - * `request_id` is provided. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the process that should own the run. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The name of the process that should own the run. - * - * 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 run to create. - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Run run = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\DataCatalog\Lineage\V1\Run|null - */ - public function getRun() - { - return $this->run; - } - - public function hasRun() - { - return isset($this->run); - } - - public function clearRun() - { - unset($this->run); - } - - /** - * Required. The run to create. - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Run run = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\DataCatalog\Lineage\V1\Run $var - * @return $this - */ - public function setRun($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\Lineage\V1\Run::class); - $this->run = $var; - - return $this; - } - - /** - * A unique identifier for this request. Restricted to 36 ASCII characters. - * A random UUID is recommended. This request is idempotent only if a - * `request_id` is provided. - * - * Generated from protobuf field string request_id = 3; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * A unique identifier for this request. Restricted to 36 ASCII characters. - * A random UUID is recommended. This request is idempotent only if a - * `request_id` is provided. - * - * Generated from protobuf field string request_id = 3; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/DeleteLineageEventRequest.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/DeleteLineageEventRequest.php deleted file mode 100644 index 18b9d21a24a2..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/DeleteLineageEventRequest.php +++ /dev/null @@ -1,120 +0,0 @@ -google.cloud.datacatalog.lineage.v1.DeleteLineageEventRequest - */ -class DeleteLineageEventRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the lineage event to delete. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * If set to true and the lineage event is not found, the request - * succeeds but the server doesn't perform any actions. - * - * Generated from protobuf field bool allow_missing = 2; - */ - protected $allow_missing = false; - - /** - * @param string $name Required. The name of the lineage event to delete. Please see - * {@see LineageClient::lineageEventName()} for help formatting this field. - * - * @return \Google\Cloud\DataCatalog\Lineage\V1\DeleteLineageEventRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the lineage event to delete. - * @type bool $allow_missing - * If set to true and the lineage event is not found, the request - * succeeds but the server doesn't perform any actions. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the lineage event to delete. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the lineage event to delete. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * If set to true and the lineage event is not found, the request - * succeeds but the server doesn't perform any actions. - * - * Generated from protobuf field bool allow_missing = 2; - * @return bool - */ - public function getAllowMissing() - { - return $this->allow_missing; - } - - /** - * If set to true and the lineage event is not found, the request - * succeeds but the server doesn't perform any actions. - * - * Generated from protobuf field bool allow_missing = 2; - * @param bool $var - * @return $this - */ - public function setAllowMissing($var) - { - GPBUtil::checkBool($var); - $this->allow_missing = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/DeleteProcessRequest.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/DeleteProcessRequest.php deleted file mode 100644 index 088e68cffa5b..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/DeleteProcessRequest.php +++ /dev/null @@ -1,120 +0,0 @@ -google.cloud.datacatalog.lineage.v1.DeleteProcessRequest - */ -class DeleteProcessRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the process to delete. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * If set to true and the process is not found, the request - * succeeds but the server doesn't perform any actions. - * - * Generated from protobuf field bool allow_missing = 2; - */ - protected $allow_missing = false; - - /** - * @param string $name Required. The name of the process to delete. Please see - * {@see LineageClient::processName()} for help formatting this field. - * - * @return \Google\Cloud\DataCatalog\Lineage\V1\DeleteProcessRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the process to delete. - * @type bool $allow_missing - * If set to true and the process is not found, the request - * succeeds but the server doesn't perform any actions. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the process to delete. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the process to delete. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * If set to true and the process is not found, the request - * succeeds but the server doesn't perform any actions. - * - * Generated from protobuf field bool allow_missing = 2; - * @return bool - */ - public function getAllowMissing() - { - return $this->allow_missing; - } - - /** - * If set to true and the process is not found, the request - * succeeds but the server doesn't perform any actions. - * - * Generated from protobuf field bool allow_missing = 2; - * @param bool $var - * @return $this - */ - public function setAllowMissing($var) - { - GPBUtil::checkBool($var); - $this->allow_missing = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/DeleteRunRequest.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/DeleteRunRequest.php deleted file mode 100644 index bcc506513f22..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/DeleteRunRequest.php +++ /dev/null @@ -1,120 +0,0 @@ -google.cloud.datacatalog.lineage.v1.DeleteRunRequest - */ -class DeleteRunRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the run to delete. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * If set to true and the run is not found, the request - * succeeds but the server doesn't perform any actions. - * - * Generated from protobuf field bool allow_missing = 2; - */ - protected $allow_missing = false; - - /** - * @param string $name Required. The name of the run to delete. Please see - * {@see LineageClient::runName()} for help formatting this field. - * - * @return \Google\Cloud\DataCatalog\Lineage\V1\DeleteRunRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the run to delete. - * @type bool $allow_missing - * If set to true and the run is not found, the request - * succeeds but the server doesn't perform any actions. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the run to delete. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the run to delete. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * If set to true and the run is not found, the request - * succeeds but the server doesn't perform any actions. - * - * Generated from protobuf field bool allow_missing = 2; - * @return bool - */ - public function getAllowMissing() - { - return $this->allow_missing; - } - - /** - * If set to true and the run is not found, the request - * succeeds but the server doesn't perform any actions. - * - * Generated from protobuf field bool allow_missing = 2; - * @param bool $var - * @return $this - */ - public function setAllowMissing($var) - { - GPBUtil::checkBool($var); - $this->allow_missing = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/EntityReference.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/EntityReference.php deleted file mode 100644 index 9925e0dce8a7..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/EntityReference.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.datacatalog.lineage.v1.EntityReference - */ -class EntityReference extends \Google\Protobuf\Internal\Message -{ - /** - * Required. [Fully Qualified Name - * (FQN)](https://cloud.google.com/data-catalog/docs/fully-qualified-names) - * of the entity. - * - * Generated from protobuf field string fully_qualified_name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $fully_qualified_name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $fully_qualified_name - * Required. [Fully Qualified Name - * (FQN)](https://cloud.google.com/data-catalog/docs/fully-qualified-names) - * of the entity. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); - parent::__construct($data); - } - - /** - * Required. [Fully Qualified Name - * (FQN)](https://cloud.google.com/data-catalog/docs/fully-qualified-names) - * of the entity. - * - * Generated from protobuf field string fully_qualified_name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getFullyQualifiedName() - { - return $this->fully_qualified_name; - } - - /** - * Required. [Fully Qualified Name - * (FQN)](https://cloud.google.com/data-catalog/docs/fully-qualified-names) - * of the entity. - * - * Generated from protobuf field string fully_qualified_name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setFullyQualifiedName($var) - { - GPBUtil::checkString($var, True); - $this->fully_qualified_name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/EventLink.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/EventLink.php deleted file mode 100644 index 8d1247a25be5..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/EventLink.php +++ /dev/null @@ -1,121 +0,0 @@ -google.cloud.datacatalog.lineage.v1.EventLink - */ -class EventLink extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Reference to the source entity - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.EntityReference source = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $source = null; - /** - * Required. Reference to the target entity - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.EntityReference target = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $target = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\DataCatalog\Lineage\V1\EntityReference $source - * Required. Reference to the source entity - * @type \Google\Cloud\DataCatalog\Lineage\V1\EntityReference $target - * Required. Reference to the target entity - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); - parent::__construct($data); - } - - /** - * Required. Reference to the source entity - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.EntityReference source = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\DataCatalog\Lineage\V1\EntityReference|null - */ - public function getSource() - { - return $this->source; - } - - public function hasSource() - { - return isset($this->source); - } - - public function clearSource() - { - unset($this->source); - } - - /** - * Required. Reference to the source entity - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.EntityReference source = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\DataCatalog\Lineage\V1\EntityReference $var - * @return $this - */ - public function setSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\Lineage\V1\EntityReference::class); - $this->source = $var; - - return $this; - } - - /** - * Required. Reference to the target entity - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.EntityReference target = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\DataCatalog\Lineage\V1\EntityReference|null - */ - public function getTarget() - { - return $this->target; - } - - public function hasTarget() - { - return isset($this->target); - } - - public function clearTarget() - { - unset($this->target); - } - - /** - * Required. Reference to the target entity - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.EntityReference target = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\DataCatalog\Lineage\V1\EntityReference $var - * @return $this - */ - public function setTarget($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\Lineage\V1\EntityReference::class); - $this->target = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/GetLineageEventRequest.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/GetLineageEventRequest.php deleted file mode 100644 index bcfbb6140411..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/GetLineageEventRequest.php +++ /dev/null @@ -1,82 +0,0 @@ -google.cloud.datacatalog.lineage.v1.GetLineageEventRequest - */ -class GetLineageEventRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the lineage event to get. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The name of the lineage event to get. Please see - * {@see LineageClient::lineageEventName()} for help formatting this field. - * - * @return \Google\Cloud\DataCatalog\Lineage\V1\GetLineageEventRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the lineage event to get. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the lineage event to get. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the lineage event to get. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/GetProcessRequest.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/GetProcessRequest.php deleted file mode 100644 index 7f23ce58f182..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/GetProcessRequest.php +++ /dev/null @@ -1,82 +0,0 @@ -google.cloud.datacatalog.lineage.v1.GetProcessRequest - */ -class GetProcessRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the process to get. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The name of the process to get. Please see - * {@see LineageClient::processName()} for help formatting this field. - * - * @return \Google\Cloud\DataCatalog\Lineage\V1\GetProcessRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the process to get. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the process to get. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the process to get. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/GetRunRequest.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/GetRunRequest.php deleted file mode 100644 index b0f0b84a2848..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/GetRunRequest.php +++ /dev/null @@ -1,82 +0,0 @@ -google.cloud.datacatalog.lineage.v1.GetRunRequest - */ -class GetRunRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the run to get. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The name of the run to get. Please see - * {@see LineageClient::runName()} for help formatting this field. - * - * @return \Google\Cloud\DataCatalog\Lineage\V1\GetRunRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the run to get. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the run to get. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the run to get. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/LineageEvent.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/LineageEvent.php deleted file mode 100644 index 2f6da93d3340..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/LineageEvent.php +++ /dev/null @@ -1,226 +0,0 @@ -google.cloud.datacatalog.lineage.v1.LineageEvent - */ -class LineageEvent extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. The resource name of the lineage event. - * Format: - * `projects/{project}/locations/{location}/processes/{process}/runs/{run}/lineageEvents/{lineage_event}`. - * Can be specified or auto-assigned. - * {lineage_event} must be not longer than 200 characters and only - * contain characters in a set: `a-zA-Z0-9_-:.` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - protected $name = ''; - /** - * Optional. List of source-target pairs. Can't contain more than 100 tuples. - * - * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.EventLink links = 8 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $links; - /** - * Required. The beginning of the transformation which resulted in this - * lineage event. For streaming scenarios, it should be the beginning of the - * period from which the lineage is being reported. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 6 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $start_time = null; - /** - * Optional. The end of the transformation which resulted in this lineage - * event. For streaming scenarios, it should be the end of the period from - * which the lineage is being reported. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 7 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $end_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Immutable. The resource name of the lineage event. - * Format: - * `projects/{project}/locations/{location}/processes/{process}/runs/{run}/lineageEvents/{lineage_event}`. - * Can be specified or auto-assigned. - * {lineage_event} must be not longer than 200 characters and only - * contain characters in a set: `a-zA-Z0-9_-:.` - * @type array<\Google\Cloud\DataCatalog\Lineage\V1\EventLink>|\Google\Protobuf\Internal\RepeatedField $links - * Optional. List of source-target pairs. Can't contain more than 100 tuples. - * @type \Google\Protobuf\Timestamp $start_time - * Required. The beginning of the transformation which resulted in this - * lineage event. For streaming scenarios, it should be the beginning of the - * period from which the lineage is being reported. - * @type \Google\Protobuf\Timestamp $end_time - * Optional. The end of the transformation which resulted in this lineage - * event. For streaming scenarios, it should be the end of the period from - * which the lineage is being reported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); - parent::__construct($data); - } - - /** - * Immutable. The resource name of the lineage event. - * Format: - * `projects/{project}/locations/{location}/processes/{process}/runs/{run}/lineageEvents/{lineage_event}`. - * Can be specified or auto-assigned. - * {lineage_event} must be not longer than 200 characters and only - * contain characters in a set: `a-zA-Z0-9_-:.` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Immutable. The resource name of the lineage event. - * Format: - * `projects/{project}/locations/{location}/processes/{process}/runs/{run}/lineageEvents/{lineage_event}`. - * Can be specified or auto-assigned. - * {lineage_event} must be not longer than 200 characters and only - * contain characters in a set: `a-zA-Z0-9_-:.` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. List of source-target pairs. Can't contain more than 100 tuples. - * - * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.EventLink links = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getLinks() - { - return $this->links; - } - - /** - * Optional. List of source-target pairs. Can't contain more than 100 tuples. - * - * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.EventLink links = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @param array<\Google\Cloud\DataCatalog\Lineage\V1\EventLink>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setLinks($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DataCatalog\Lineage\V1\EventLink::class); - $this->links = $arr; - - return $this; - } - - /** - * Required. The beginning of the transformation which resulted in this - * lineage event. For streaming scenarios, it should be the beginning of the - * period from which the lineage is being reported. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 6 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getStartTime() - { - return $this->start_time; - } - - public function hasStartTime() - { - return isset($this->start_time); - } - - public function clearStartTime() - { - unset($this->start_time); - } - - /** - * Required. The beginning of the transformation which resulted in this - * lineage event. For streaming scenarios, it should be the beginning of the - * period from which the lineage is being reported. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 6 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->start_time = $var; - - return $this; - } - - /** - * Optional. The end of the transformation which resulted in this lineage - * event. For streaming scenarios, it should be the end of the period from - * which the lineage is being reported. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Optional. The end of the transformation which resulted in this lineage - * event. For streaming scenarios, it should be the end of the period from - * which the lineage is being reported. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Link.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Link.php deleted file mode 100644 index bc87e154dbeb..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Link.php +++ /dev/null @@ -1,250 +0,0 @@ -google.cloud.datacatalog.lineage.v1.Link - */ -class Link extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Immutable. The name of the link. Format: - * `projects/{project}/locations/{location}/links/{link}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - */ - protected $name = ''; - /** - * The pointer to the entity that is the **source** of this link. - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.EntityReference source = 2; - */ - protected $source = null; - /** - * The pointer to the entity that is the **target** of this link. - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.EntityReference target = 3; - */ - protected $target = null; - /** - * The start of the first event establishing this link. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 4; - */ - protected $start_time = null; - /** - * The end of the last event establishing this link. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 5; - */ - protected $end_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. Immutable. The name of the link. Format: - * `projects/{project}/locations/{location}/links/{link}`. - * @type \Google\Cloud\DataCatalog\Lineage\V1\EntityReference $source - * The pointer to the entity that is the **source** of this link. - * @type \Google\Cloud\DataCatalog\Lineage\V1\EntityReference $target - * The pointer to the entity that is the **target** of this link. - * @type \Google\Protobuf\Timestamp $start_time - * The start of the first event establishing this link. - * @type \Google\Protobuf\Timestamp $end_time - * The end of the last event establishing this link. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Immutable. The name of the link. Format: - * `projects/{project}/locations/{location}/links/{link}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. Immutable. The name of the link. Format: - * `projects/{project}/locations/{location}/links/{link}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The pointer to the entity that is the **source** of this link. - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.EntityReference source = 2; - * @return \Google\Cloud\DataCatalog\Lineage\V1\EntityReference|null - */ - public function getSource() - { - return $this->source; - } - - public function hasSource() - { - return isset($this->source); - } - - public function clearSource() - { - unset($this->source); - } - - /** - * The pointer to the entity that is the **source** of this link. - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.EntityReference source = 2; - * @param \Google\Cloud\DataCatalog\Lineage\V1\EntityReference $var - * @return $this - */ - public function setSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\Lineage\V1\EntityReference::class); - $this->source = $var; - - return $this; - } - - /** - * The pointer to the entity that is the **target** of this link. - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.EntityReference target = 3; - * @return \Google\Cloud\DataCatalog\Lineage\V1\EntityReference|null - */ - public function getTarget() - { - return $this->target; - } - - public function hasTarget() - { - return isset($this->target); - } - - public function clearTarget() - { - unset($this->target); - } - - /** - * The pointer to the entity that is the **target** of this link. - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.EntityReference target = 3; - * @param \Google\Cloud\DataCatalog\Lineage\V1\EntityReference $var - * @return $this - */ - public function setTarget($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\Lineage\V1\EntityReference::class); - $this->target = $var; - - return $this; - } - - /** - * The start of the first event establishing this link. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 4; - * @return \Google\Protobuf\Timestamp|null - */ - public function getStartTime() - { - return $this->start_time; - } - - public function hasStartTime() - { - return isset($this->start_time); - } - - public function clearStartTime() - { - unset($this->start_time); - } - - /** - * The start of the first event establishing this link. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 4; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->start_time = $var; - - return $this; - } - - /** - * The end of the last event establishing this link. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 5; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * The end of the last event establishing this link. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 5; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListLineageEventsRequest.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListLineageEventsRequest.php deleted file mode 100644 index 02a1847041af..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListLineageEventsRequest.php +++ /dev/null @@ -1,178 +0,0 @@ -google.cloud.datacatalog.lineage.v1.ListLineageEventsRequest - */ -class ListLineageEventsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the run that owns the collection of lineage events to - * get. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * The maximum number of lineage events to return. - * The service may return fewer events than this value. - * If unspecified, at most 50 events are returned. The maximum value is 100; - * values greater than 100 are cut to 100. - * - * Generated from protobuf field int32 page_size = 2; - */ - protected $page_size = 0; - /** - * The page token received from a previous `ListLineageEvents` call. Specify - * it to get the next page. - * When paginating, all other parameters specified in this call must - * match the parameters of the call that provided the page token. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - - /** - * @param string $parent Required. The name of the run that owns the collection of lineage events to - * get. Please see {@see LineageClient::runName()} for help formatting this field. - * - * @return \Google\Cloud\DataCatalog\Lineage\V1\ListLineageEventsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the run that owns the collection of lineage events to - * get. - * @type int $page_size - * The maximum number of lineage events to return. - * The service may return fewer events than this value. - * If unspecified, at most 50 events are returned. The maximum value is 100; - * values greater than 100 are cut to 100. - * @type string $page_token - * The page token received from a previous `ListLineageEvents` call. Specify - * it to get the next page. - * When paginating, all other parameters specified in this call must - * match the parameters of the call that provided the page token. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the run that owns the collection of lineage events to - * get. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The name of the run that owns the collection of lineage events to - * get. - * - * 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; - } - - /** - * The maximum number of lineage events to return. - * The service may return fewer events than this value. - * If unspecified, at most 50 events are returned. The maximum value is 100; - * values greater than 100 are cut to 100. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of lineage events to return. - * The service may return fewer events than this value. - * If unspecified, at most 50 events are returned. The maximum value is 100; - * values greater than 100 are cut to 100. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * The page token received from a previous `ListLineageEvents` call. Specify - * it to get the next page. - * When paginating, all other parameters specified in this call must - * match the parameters of the call that provided the page token. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * The page token received from a previous `ListLineageEvents` call. Specify - * it to get the next page. - * When paginating, all other parameters specified in this call must - * match the parameters of the call that provided the page token. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListLineageEventsResponse.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListLineageEventsResponse.php deleted file mode 100644 index 1543999a54a6..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListLineageEventsResponse.php +++ /dev/null @@ -1,106 +0,0 @@ -google.cloud.datacatalog.lineage.v1.ListLineageEventsResponse - */ -class ListLineageEventsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Lineage events from the specified project and location. - * - * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.LineageEvent lineage_events = 1; - */ - private $lineage_events; - /** - * The token to specify as `page_token` in the next call to get the next page. - * If this field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\DataCatalog\Lineage\V1\LineageEvent>|\Google\Protobuf\Internal\RepeatedField $lineage_events - * Lineage events from the specified project and location. - * @type string $next_page_token - * The token to specify as `page_token` in the next call to get the next page. - * If this field is omitted, there are no subsequent pages. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); - parent::__construct($data); - } - - /** - * Lineage events from the specified project and location. - * - * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.LineageEvent lineage_events = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getLineageEvents() - { - return $this->lineage_events; - } - - /** - * Lineage events from the specified project and location. - * - * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.LineageEvent lineage_events = 1; - * @param array<\Google\Cloud\DataCatalog\Lineage\V1\LineageEvent>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setLineageEvents($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DataCatalog\Lineage\V1\LineageEvent::class); - $this->lineage_events = $arr; - - return $this; - } - - /** - * The token to specify as `page_token` in the next call to get the next page. - * If this field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * The token to specify as `page_token` in the next call to get the next page. - * If this field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListProcessesRequest.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListProcessesRequest.php deleted file mode 100644 index 1b81bb00d128..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListProcessesRequest.php +++ /dev/null @@ -1,179 +0,0 @@ -google.cloud.datacatalog.lineage.v1.ListProcessesRequest - */ -class ListProcessesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the project and its location that owns this - * collection of processes. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * The maximum number of processes to return. The service may return - * fewer than this value. If unspecified, at most 50 processes are - * returned. The maximum value is 100; values greater than 100 are cut to - * 100. - * - * Generated from protobuf field int32 page_size = 2; - */ - protected $page_size = 0; - /** - * The page token received from a previous `ListProcesses` call. Specify - * it to get the next page. - * When paginating, all other parameters specified in this call must - * match the parameters of the call that provided the page token. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - - /** - * @param string $parent Required. The name of the project and its location that owns this - * collection of processes. Please see - * {@see LineageClient::locationName()} for help formatting this field. - * - * @return \Google\Cloud\DataCatalog\Lineage\V1\ListProcessesRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of the project and its location that owns this - * collection of processes. - * @type int $page_size - * The maximum number of processes to return. The service may return - * fewer than this value. If unspecified, at most 50 processes are - * returned. The maximum value is 100; values greater than 100 are cut to - * 100. - * @type string $page_token - * The page token received from a previous `ListProcesses` call. Specify - * it to get the next page. - * When paginating, all other parameters specified in this call must - * match the parameters of the call that provided the page token. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the project and its location that owns this - * collection of processes. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The name of the project and its location that owns this - * collection of processes. - * - * 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; - } - - /** - * The maximum number of processes to return. The service may return - * fewer than this value. If unspecified, at most 50 processes are - * returned. The maximum value is 100; values greater than 100 are cut to - * 100. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of processes to return. The service may return - * fewer than this value. If unspecified, at most 50 processes are - * returned. The maximum value is 100; values greater than 100 are cut to - * 100. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * The page token received from a previous `ListProcesses` call. Specify - * it to get the next page. - * When paginating, all other parameters specified in this call must - * match the parameters of the call that provided the page token. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * The page token received from a previous `ListProcesses` call. Specify - * it to get the next page. - * When paginating, all other parameters specified in this call must - * match the parameters of the call that provided the page token. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListProcessesResponse.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListProcessesResponse.php deleted file mode 100644 index 075a0e6e3dc4..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListProcessesResponse.php +++ /dev/null @@ -1,106 +0,0 @@ -google.cloud.datacatalog.lineage.v1.ListProcessesResponse - */ -class ListProcessesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The processes from the specified project and location. - * - * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.Process processes = 1; - */ - private $processes; - /** - * The token to specify as `page_token` in the next call to get the next page. - * If this field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\DataCatalog\Lineage\V1\Process>|\Google\Protobuf\Internal\RepeatedField $processes - * The processes from the specified project and location. - * @type string $next_page_token - * The token to specify as `page_token` in the next call to get the next page. - * If this field is omitted, there are no subsequent pages. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); - parent::__construct($data); - } - - /** - * The processes from the specified project and location. - * - * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.Process processes = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getProcesses() - { - return $this->processes; - } - - /** - * The processes from the specified project and location. - * - * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.Process processes = 1; - * @param array<\Google\Cloud\DataCatalog\Lineage\V1\Process>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setProcesses($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DataCatalog\Lineage\V1\Process::class); - $this->processes = $arr; - - return $this; - } - - /** - * The token to specify as `page_token` in the next call to get the next page. - * If this field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * The token to specify as `page_token` in the next call to get the next page. - * If this field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListRunsRequest.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListRunsRequest.php deleted file mode 100644 index 6a762c1e9dcd..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListRunsRequest.php +++ /dev/null @@ -1,174 +0,0 @@ -google.cloud.datacatalog.lineage.v1.ListRunsRequest - */ -class ListRunsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of process that owns this collection of runs. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * The maximum number of runs to return. The service may return - * fewer than this value. If unspecified, at most 50 runs are - * returned. The maximum value is 100; values greater than 100 are cut to - * 100. - * - * Generated from protobuf field int32 page_size = 2; - */ - protected $page_size = 0; - /** - * The page token received from a previous `ListRuns` call. Specify - * it to get the next page. - * When paginating, all other parameters specified in this call must - * match the parameters of the call that provided the page token. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - - /** - * @param string $parent Required. The name of process that owns this collection of runs. Please see - * {@see LineageClient::processName()} for help formatting this field. - * - * @return \Google\Cloud\DataCatalog\Lineage\V1\ListRunsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The name of process that owns this collection of runs. - * @type int $page_size - * The maximum number of runs to return. The service may return - * fewer than this value. If unspecified, at most 50 runs are - * returned. The maximum value is 100; values greater than 100 are cut to - * 100. - * @type string $page_token - * The page token received from a previous `ListRuns` call. Specify - * it to get the next page. - * When paginating, all other parameters specified in this call must - * match the parameters of the call that provided the page token. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of process that owns this collection of runs. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The name of process that owns this collection of runs. - * - * 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; - } - - /** - * The maximum number of runs to return. The service may return - * fewer than this value. If unspecified, at most 50 runs are - * returned. The maximum value is 100; values greater than 100 are cut to - * 100. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of runs to return. The service may return - * fewer than this value. If unspecified, at most 50 runs are - * returned. The maximum value is 100; values greater than 100 are cut to - * 100. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * The page token received from a previous `ListRuns` call. Specify - * it to get the next page. - * When paginating, all other parameters specified in this call must - * match the parameters of the call that provided the page token. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * The page token received from a previous `ListRuns` call. Specify - * it to get the next page. - * When paginating, all other parameters specified in this call must - * match the parameters of the call that provided the page token. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListRunsResponse.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListRunsResponse.php deleted file mode 100644 index ad73a867f0ca..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ListRunsResponse.php +++ /dev/null @@ -1,106 +0,0 @@ -google.cloud.datacatalog.lineage.v1.ListRunsResponse - */ -class ListRunsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The runs from the specified project and location. - * - * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.Run runs = 1; - */ - private $runs; - /** - * The token to specify as `page_token` in the next call to get the next page. - * If this field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\DataCatalog\Lineage\V1\Run>|\Google\Protobuf\Internal\RepeatedField $runs - * The runs from the specified project and location. - * @type string $next_page_token - * The token to specify as `page_token` in the next call to get the next page. - * If this field is omitted, there are no subsequent pages. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); - parent::__construct($data); - } - - /** - * The runs from the specified project and location. - * - * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.Run runs = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getRuns() - { - return $this->runs; - } - - /** - * The runs from the specified project and location. - * - * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.Run runs = 1; - * @param array<\Google\Cloud\DataCatalog\Lineage\V1\Run>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setRuns($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DataCatalog\Lineage\V1\Run::class); - $this->runs = $arr; - - return $this; - } - - /** - * The token to specify as `page_token` in the next call to get the next page. - * If this field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * The token to specify as `page_token` in the next call to get the next page. - * If this field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/OperationMetadata.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/OperationMetadata.php deleted file mode 100644 index 4043b7e1dd3c..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/OperationMetadata.php +++ /dev/null @@ -1,269 +0,0 @@ -google.cloud.datacatalog.lineage.v1.OperationMetadata - */ -class OperationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The current operation state. - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.OperationMetadata.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - /** - * Output only. The type of the operation being performed. - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.OperationMetadata.Type operation_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $operation_type = 0; - /** - * Output only. The [relative name] - * (https://cloud.google.com//apis/design/resource_names#relative_resource_name) - * of the resource being operated on. - * - * Generated from protobuf field string resource = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $resource = ''; - /** - * Output only. The UUID of the resource being operated on. - * - * Generated from protobuf field string resource_uuid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $resource_uuid = ''; - /** - * Output only. The timestamp of the operation submission to the server. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The timestamp of the operation termination, regardless of its - * success. This field is unset if the operation is still ongoing. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $end_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $state - * Output only. The current operation state. - * @type int $operation_type - * Output only. The type of the operation being performed. - * @type string $resource - * Output only. The [relative name] - * (https://cloud.google.com//apis/design/resource_names#relative_resource_name) - * of the resource being operated on. - * @type string $resource_uuid - * Output only. The UUID of the resource being operated on. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The timestamp of the operation submission to the server. - * @type \Google\Protobuf\Timestamp $end_time - * Output only. The timestamp of the operation termination, regardless of its - * success. This field is unset if the operation is still ongoing. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The current operation state. - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.OperationMetadata.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The current operation state. - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.OperationMetadata.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\DataCatalog\Lineage\V1\OperationMetadata\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. The type of the operation being performed. - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.OperationMetadata.Type operation_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getOperationType() - { - return $this->operation_type; - } - - /** - * Output only. The type of the operation being performed. - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.OperationMetadata.Type operation_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setOperationType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\DataCatalog\Lineage\V1\OperationMetadata\Type::class); - $this->operation_type = $var; - - return $this; - } - - /** - * Output only. The [relative name] - * (https://cloud.google.com//apis/design/resource_names#relative_resource_name) - * of the resource being operated on. - * - * Generated from protobuf field string resource = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getResource() - { - return $this->resource; - } - - /** - * Output only. The [relative name] - * (https://cloud.google.com//apis/design/resource_names#relative_resource_name) - * of the resource being operated on. - * - * Generated from protobuf field string resource = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setResource($var) - { - GPBUtil::checkString($var, True); - $this->resource = $var; - - return $this; - } - - /** - * Output only. The UUID of the resource being operated on. - * - * Generated from protobuf field string resource_uuid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getResourceUuid() - { - return $this->resource_uuid; - } - - /** - * Output only. The UUID of the resource being operated on. - * - * Generated from protobuf field string resource_uuid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setResourceUuid($var) - { - GPBUtil::checkString($var, True); - $this->resource_uuid = $var; - - return $this; - } - - /** - * Output only. The timestamp of the operation submission to the server. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The timestamp of the operation submission to the server. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The timestamp of the operation termination, regardless of its - * success. This field is unset if the operation is still ongoing. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Output only. The timestamp of the operation termination, regardless of its - * success. This field is unset if the operation is still ongoing. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/OperationMetadata/State.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/OperationMetadata/State.php deleted file mode 100644 index 5dcdd98eed98..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/OperationMetadata/State.php +++ /dev/null @@ -1,78 +0,0 @@ -google.cloud.datacatalog.lineage.v1.OperationMetadata.State - */ -class State -{ - /** - * Unused. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The operation has been created but is not yet started. - * - * Generated from protobuf enum PENDING = 1; - */ - const PENDING = 1; - /** - * The operation is underway. - * - * Generated from protobuf enum RUNNING = 2; - */ - const RUNNING = 2; - /** - * The operation completed successfully. - * - * Generated from protobuf enum SUCCEEDED = 3; - */ - const SUCCEEDED = 3; - /** - * The operation is no longer running and did not succeed. - * - * Generated from protobuf enum FAILED = 4; - */ - const FAILED = 4; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::PENDING => 'PENDING', - self::RUNNING => 'RUNNING', - self::SUCCEEDED => 'SUCCEEDED', - self::FAILED => 'FAILED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\DataCatalog\Lineage\V1\OperationMetadata_State::class); - diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/OperationMetadata/Type.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/OperationMetadata/Type.php deleted file mode 100644 index 2ea01f6e0b6e..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/OperationMetadata/Type.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.datacatalog.lineage.v1.OperationMetadata.Type - */ -class Type -{ - /** - * Unused. - * - * Generated from protobuf enum TYPE_UNSPECIFIED = 0; - */ - const TYPE_UNSPECIFIED = 0; - /** - * The resource deletion operation. - * - * Generated from protobuf enum DELETE = 1; - */ - const DELETE = 1; - /** - * The resource creation operation. - * - * Generated from protobuf enum CREATE = 2; - */ - const CREATE = 2; - - private static $valueToName = [ - self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', - self::DELETE => 'DELETE', - self::CREATE => 'CREATE', - ]; - - 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(Type::class, \Google\Cloud\DataCatalog\Lineage\V1\OperationMetadata_Type::class); - diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Origin.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Origin.php deleted file mode 100644 index 7ff80980f5ac..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Origin.php +++ /dev/null @@ -1,141 +0,0 @@ -google.cloud.datacatalog.lineage.v1.Origin - */ -class Origin extends \Google\Protobuf\Internal\Message -{ - /** - * Type of the source. - * Use of a source_type other than `CUSTOM` for process creation - * or updating is highly discouraged, and may be restricted in the future - * without notice. - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Origin.SourceType source_type = 1; - */ - protected $source_type = 0; - /** - * If the source_type isn't CUSTOM, the value of this field should be a GCP - * resource name of the system, which reports lineage. The project and - * location parts of the resource name must match the project and location of - * the lineage resource being created. Examples: - * - `{source_type: COMPOSER, name: - * "projects/foo/locations/us/environments/bar"}` - * - `{source_type: BIGQUERY, name: "projects/foo/locations/eu"}` - * - `{source_type: CUSTOM, name: "myCustomIntegration"}` - * - * Generated from protobuf field string name = 2; - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $source_type - * Type of the source. - * Use of a source_type other than `CUSTOM` for process creation - * or updating is highly discouraged, and may be restricted in the future - * without notice. - * @type string $name - * If the source_type isn't CUSTOM, the value of this field should be a GCP - * resource name of the system, which reports lineage. The project and - * location parts of the resource name must match the project and location of - * the lineage resource being created. Examples: - * - `{source_type: COMPOSER, name: - * "projects/foo/locations/us/environments/bar"}` - * - `{source_type: BIGQUERY, name: "projects/foo/locations/eu"}` - * - `{source_type: CUSTOM, name: "myCustomIntegration"}` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); - parent::__construct($data); - } - - /** - * Type of the source. - * Use of a source_type other than `CUSTOM` for process creation - * or updating is highly discouraged, and may be restricted in the future - * without notice. - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Origin.SourceType source_type = 1; - * @return int - */ - public function getSourceType() - { - return $this->source_type; - } - - /** - * Type of the source. - * Use of a source_type other than `CUSTOM` for process creation - * or updating is highly discouraged, and may be restricted in the future - * without notice. - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Origin.SourceType source_type = 1; - * @param int $var - * @return $this - */ - public function setSourceType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\DataCatalog\Lineage\V1\Origin\SourceType::class); - $this->source_type = $var; - - return $this; - } - - /** - * If the source_type isn't CUSTOM, the value of this field should be a GCP - * resource name of the system, which reports lineage. The project and - * location parts of the resource name must match the project and location of - * the lineage resource being created. Examples: - * - `{source_type: COMPOSER, name: - * "projects/foo/locations/us/environments/bar"}` - * - `{source_type: BIGQUERY, name: "projects/foo/locations/eu"}` - * - `{source_type: CUSTOM, name: "myCustomIntegration"}` - * - * Generated from protobuf field string name = 2; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * If the source_type isn't CUSTOM, the value of this field should be a GCP - * resource name of the system, which reports lineage. The project and - * location parts of the resource name must match the project and location of - * the lineage resource being created. Examples: - * - `{source_type: COMPOSER, name: - * "projects/foo/locations/us/environments/bar"}` - * - `{source_type: BIGQUERY, name: "projects/foo/locations/eu"}` - * - `{source_type: CUSTOM, name: "myCustomIntegration"}` - * - * Generated from protobuf field string name = 2; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Origin/SourceType.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Origin/SourceType.php deleted file mode 100644 index c1dcb06d5789..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Origin/SourceType.php +++ /dev/null @@ -1,92 +0,0 @@ -google.cloud.datacatalog.lineage.v1.Origin.SourceType - */ -class SourceType -{ - /** - * Source is Unspecified - * - * Generated from protobuf enum SOURCE_TYPE_UNSPECIFIED = 0; - */ - const SOURCE_TYPE_UNSPECIFIED = 0; - /** - * A custom source - * - * Generated from protobuf enum CUSTOM = 1; - */ - const CUSTOM = 1; - /** - * BigQuery - * - * Generated from protobuf enum BIGQUERY = 2; - */ - const BIGQUERY = 2; - /** - * Data Fusion - * - * Generated from protobuf enum DATA_FUSION = 3; - */ - const DATA_FUSION = 3; - /** - * Composer - * - * Generated from protobuf enum COMPOSER = 4; - */ - const COMPOSER = 4; - /** - * Looker Studio - * - * Generated from protobuf enum LOOKER_STUDIO = 5; - */ - const LOOKER_STUDIO = 5; - /** - * Dataproc - * - * Generated from protobuf enum DATAPROC = 6; - */ - const DATAPROC = 6; - - private static $valueToName = [ - self::SOURCE_TYPE_UNSPECIFIED => 'SOURCE_TYPE_UNSPECIFIED', - self::CUSTOM => 'CUSTOM', - self::BIGQUERY => 'BIGQUERY', - self::DATA_FUSION => 'DATA_FUSION', - self::COMPOSER => 'COMPOSER', - self::LOOKER_STUDIO => 'LOOKER_STUDIO', - self::DATAPROC => 'DATAPROC', - ]; - - 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(SourceType::class, \Google\Cloud\DataCatalog\Lineage\V1\Origin_SourceType::class); - diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Process.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Process.php deleted file mode 100644 index 7e3b5ce22728..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Process.php +++ /dev/null @@ -1,215 +0,0 @@ -google.cloud.datacatalog.lineage.v1.Process - */ -class Process extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. The resource name of the lineage process. Format: - * `projects/{project}/locations/{location}/processes/{process}`. - * Can be specified or auto-assigned. - * {process} must be not longer than 200 characters and only - * contain characters in a set: `a-zA-Z0-9_-:.` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - protected $name = ''; - /** - * Optional. A human-readable name you can set to display in a user interface. - * Must be not longer than 200 characters and only contain UTF-8 letters - * or numbers, spaces or characters like `_-:&.` - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $display_name = ''; - /** - * Optional. The attributes of the process. Should only be used for the - * purpose of non-semantic management (classifying, describing or labeling the - * process). - * Up to 100 attributes are allowed. - * - * Generated from protobuf field map attributes = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $attributes; - /** - * Optional. The origin of this process and its runs and lineage events. - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Origin origin = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $origin = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Immutable. The resource name of the lineage process. Format: - * `projects/{project}/locations/{location}/processes/{process}`. - * Can be specified or auto-assigned. - * {process} must be not longer than 200 characters and only - * contain characters in a set: `a-zA-Z0-9_-:.` - * @type string $display_name - * Optional. A human-readable name you can set to display in a user interface. - * Must be not longer than 200 characters and only contain UTF-8 letters - * or numbers, spaces or characters like `_-:&.` - * @type array|\Google\Protobuf\Internal\MapField $attributes - * Optional. The attributes of the process. Should only be used for the - * purpose of non-semantic management (classifying, describing or labeling the - * process). - * Up to 100 attributes are allowed. - * @type \Google\Cloud\DataCatalog\Lineage\V1\Origin $origin - * Optional. The origin of this process and its runs and lineage events. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); - parent::__construct($data); - } - - /** - * Immutable. The resource name of the lineage process. Format: - * `projects/{project}/locations/{location}/processes/{process}`. - * Can be specified or auto-assigned. - * {process} must be not longer than 200 characters and only - * contain characters in a set: `a-zA-Z0-9_-:.` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Immutable. The resource name of the lineage process. Format: - * `projects/{project}/locations/{location}/processes/{process}`. - * Can be specified or auto-assigned. - * {process} must be not longer than 200 characters and only - * contain characters in a set: `a-zA-Z0-9_-:.` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. A human-readable name you can set to display in a user interface. - * Must be not longer than 200 characters and only contain UTF-8 letters - * or numbers, spaces or characters like `_-:&.` - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * Optional. A human-readable name you can set to display in a user interface. - * Must be not longer than 200 characters and only contain UTF-8 letters - * or numbers, spaces or characters like `_-:&.` - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * Optional. The attributes of the process. Should only be used for the - * purpose of non-semantic management (classifying, describing or labeling the - * process). - * Up to 100 attributes are allowed. - * - * Generated from protobuf field map attributes = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAttributes() - { - return $this->attributes; - } - - /** - * Optional. The attributes of the process. Should only be used for the - * purpose of non-semantic management (classifying, describing or labeling the - * process). - * Up to 100 attributes are allowed. - * - * Generated from protobuf field map attributes = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAttributes($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Value::class); - $this->attributes = $arr; - - return $this; - } - - /** - * Optional. The origin of this process and its runs and lineage events. - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Origin origin = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\DataCatalog\Lineage\V1\Origin|null - */ - public function getOrigin() - { - return $this->origin; - } - - public function hasOrigin() - { - return isset($this->origin); - } - - public function clearOrigin() - { - unset($this->origin); - } - - /** - * Optional. The origin of this process and its runs and lineage events. - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Origin origin = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\DataCatalog\Lineage\V1\Origin $var - * @return $this - */ - public function setOrigin($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\Lineage\V1\Origin::class); - $this->origin = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ProcessLinkInfo.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ProcessLinkInfo.php deleted file mode 100644 index 2b02891300f5..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ProcessLinkInfo.php +++ /dev/null @@ -1,159 +0,0 @@ -google.cloud.datacatalog.lineage.v1.ProcessLinkInfo - */ -class ProcessLinkInfo extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the link in the format of - * `projects/{project}/locations/{location}/links/{link}`. - * - * Generated from protobuf field string link = 1; - */ - protected $link = ''; - /** - * The start of the first event establishing this link-process tuple. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 2; - */ - protected $start_time = null; - /** - * The end of the last event establishing this link-process tuple. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; - */ - protected $end_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $link - * The name of the link in the format of - * `projects/{project}/locations/{location}/links/{link}`. - * @type \Google\Protobuf\Timestamp $start_time - * The start of the first event establishing this link-process tuple. - * @type \Google\Protobuf\Timestamp $end_time - * The end of the last event establishing this link-process tuple. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); - parent::__construct($data); - } - - /** - * The name of the link in the format of - * `projects/{project}/locations/{location}/links/{link}`. - * - * Generated from protobuf field string link = 1; - * @return string - */ - public function getLink() - { - return $this->link; - } - - /** - * The name of the link in the format of - * `projects/{project}/locations/{location}/links/{link}`. - * - * Generated from protobuf field string link = 1; - * @param string $var - * @return $this - */ - public function setLink($var) - { - GPBUtil::checkString($var, True); - $this->link = $var; - - return $this; - } - - /** - * The start of the first event establishing this link-process tuple. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 2; - * @return \Google\Protobuf\Timestamp|null - */ - public function getStartTime() - { - return $this->start_time; - } - - public function hasStartTime() - { - return isset($this->start_time); - } - - public function clearStartTime() - { - unset($this->start_time); - } - - /** - * The start of the first event establishing this link-process tuple. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 2; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->start_time = $var; - - return $this; - } - - /** - * The end of the last event establishing this link-process tuple. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * The end of the last event establishing this link-process tuple. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ProcessLinks.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ProcessLinks.php deleted file mode 100644 index dc67efad53f0..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/ProcessLinks.php +++ /dev/null @@ -1,121 +0,0 @@ -google.cloud.datacatalog.lineage.v1.ProcessLinks - */ -class ProcessLinks extends \Google\Protobuf\Internal\Message -{ - /** - * The process name in the format of - * `projects/{project}/locations/{location}/processes/{process}`. - * - * Generated from protobuf field string process = 1 [(.google.api.resource_reference) = { - */ - protected $process = ''; - /** - * An array containing link details objects of the links provided in - * the original request. - * A single process can result in creating multiple links. - * If any of the links you provide in the request are created by - * the same process, they all are included in this array. - * - * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.ProcessLinkInfo links = 2; - */ - private $links; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $process - * The process name in the format of - * `projects/{project}/locations/{location}/processes/{process}`. - * @type array<\Google\Cloud\DataCatalog\Lineage\V1\ProcessLinkInfo>|\Google\Protobuf\Internal\RepeatedField $links - * An array containing link details objects of the links provided in - * the original request. - * A single process can result in creating multiple links. - * If any of the links you provide in the request are created by - * the same process, they all are included in this array. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); - parent::__construct($data); - } - - /** - * The process name in the format of - * `projects/{project}/locations/{location}/processes/{process}`. - * - * Generated from protobuf field string process = 1 [(.google.api.resource_reference) = { - * @return string - */ - public function getProcess() - { - return $this->process; - } - - /** - * The process name in the format of - * `projects/{project}/locations/{location}/processes/{process}`. - * - * Generated from protobuf field string process = 1 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setProcess($var) - { - GPBUtil::checkString($var, True); - $this->process = $var; - - return $this; - } - - /** - * An array containing link details objects of the links provided in - * the original request. - * A single process can result in creating multiple links. - * If any of the links you provide in the request are created by - * the same process, they all are included in this array. - * - * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.ProcessLinkInfo links = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getLinks() - { - return $this->links; - } - - /** - * An array containing link details objects of the links provided in - * the original request. - * A single process can result in creating multiple links. - * If any of the links you provide in the request are created by - * the same process, they all are included in this array. - * - * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.ProcessLinkInfo links = 2; - * @param array<\Google\Cloud\DataCatalog\Lineage\V1\ProcessLinkInfo>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setLinks($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DataCatalog\Lineage\V1\ProcessLinkInfo::class); - $this->links = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Run.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Run.php deleted file mode 100644 index b9f690869130..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Run.php +++ /dev/null @@ -1,290 +0,0 @@ -google.cloud.datacatalog.lineage.v1.Run - */ -class Run extends \Google\Protobuf\Internal\Message -{ - /** - * Immutable. The resource name of the run. Format: - * `projects/{project}/locations/{location}/processes/{process}/runs/{run}`. - * Can be specified or auto-assigned. - * {run} must be not longer than 200 characters and only - * contain characters in a set: `a-zA-Z0-9_-:.` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - */ - protected $name = ''; - /** - * Optional. A human-readable name you can set to display in a user interface. - * Must be not longer than 1024 characters and only contain UTF-8 letters - * or numbers, spaces or characters like `_-:&.` - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $display_name = ''; - /** - * Optional. The attributes of the run. Should only be used for the purpose of - * non-semantic management (classifying, describing or labeling the run). - * Up to 100 attributes are allowed. - * - * Generated from protobuf field map attributes = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $attributes; - /** - * Required. The timestamp of the start of the run. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $start_time = null; - /** - * Optional. The timestamp of the end of the run. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $end_time = null; - /** - * Required. The state of the run. - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Run.State state = 6 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $state = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Immutable. The resource name of the run. Format: - * `projects/{project}/locations/{location}/processes/{process}/runs/{run}`. - * Can be specified or auto-assigned. - * {run} must be not longer than 200 characters and only - * contain characters in a set: `a-zA-Z0-9_-:.` - * @type string $display_name - * Optional. A human-readable name you can set to display in a user interface. - * Must be not longer than 1024 characters and only contain UTF-8 letters - * or numbers, spaces or characters like `_-:&.` - * @type array|\Google\Protobuf\Internal\MapField $attributes - * Optional. The attributes of the run. Should only be used for the purpose of - * non-semantic management (classifying, describing or labeling the run). - * Up to 100 attributes are allowed. - * @type \Google\Protobuf\Timestamp $start_time - * Required. The timestamp of the start of the run. - * @type \Google\Protobuf\Timestamp $end_time - * Optional. The timestamp of the end of the run. - * @type int $state - * Required. The state of the run. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); - parent::__construct($data); - } - - /** - * Immutable. The resource name of the run. Format: - * `projects/{project}/locations/{location}/processes/{process}/runs/{run}`. - * Can be specified or auto-assigned. - * {run} must be not longer than 200 characters and only - * contain characters in a set: `a-zA-Z0-9_-:.` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Immutable. The resource name of the run. Format: - * `projects/{project}/locations/{location}/processes/{process}/runs/{run}`. - * Can be specified or auto-assigned. - * {run} must be not longer than 200 characters and only - * contain characters in a set: `a-zA-Z0-9_-:.` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. A human-readable name you can set to display in a user interface. - * Must be not longer than 1024 characters and only contain UTF-8 letters - * or numbers, spaces or characters like `_-:&.` - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * Optional. A human-readable name you can set to display in a user interface. - * Must be not longer than 1024 characters and only contain UTF-8 letters - * or numbers, spaces or characters like `_-:&.` - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * Optional. The attributes of the run. Should only be used for the purpose of - * non-semantic management (classifying, describing or labeling the run). - * Up to 100 attributes are allowed. - * - * Generated from protobuf field map attributes = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAttributes() - { - return $this->attributes; - } - - /** - * Optional. The attributes of the run. Should only be used for the purpose of - * non-semantic management (classifying, describing or labeling the run). - * Up to 100 attributes are allowed. - * - * Generated from protobuf field map attributes = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAttributes($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Value::class); - $this->attributes = $arr; - - return $this; - } - - /** - * Required. The timestamp of the start of the run. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getStartTime() - { - return $this->start_time; - } - - public function hasStartTime() - { - return isset($this->start_time); - } - - public function clearStartTime() - { - unset($this->start_time); - } - - /** - * Required. The timestamp of the start of the run. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 4 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->start_time = $var; - - return $this; - } - - /** - * Optional. The timestamp of the end of the run. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Optional. The timestamp of the end of the run. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Required. The state of the run. - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Run.State state = 6 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Required. The state of the run. - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Run.State state = 6 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\DataCatalog\Lineage\V1\Run\State::class); - $this->state = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Run/State.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Run/State.php deleted file mode 100644 index 7fce45aebf28..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/Run/State.php +++ /dev/null @@ -1,79 +0,0 @@ -google.cloud.datacatalog.lineage.v1.Run.State - */ -class State -{ - /** - * The state is unknown. The true state may be any of the below or a - * different state that is not supported here explicitly. - * - * Generated from protobuf enum UNKNOWN = 0; - */ - const UNKNOWN = 0; - /** - * The run is still executing. - * - * Generated from protobuf enum STARTED = 1; - */ - const STARTED = 1; - /** - * The run completed. - * - * Generated from protobuf enum COMPLETED = 2; - */ - const COMPLETED = 2; - /** - * The run failed. - * - * Generated from protobuf enum FAILED = 3; - */ - const FAILED = 3; - /** - * The run aborted. - * - * Generated from protobuf enum ABORTED = 4; - */ - const ABORTED = 4; - - private static $valueToName = [ - self::UNKNOWN => 'UNKNOWN', - self::STARTED => 'STARTED', - self::COMPLETED => 'COMPLETED', - self::FAILED => 'FAILED', - self::ABORTED => 'ABORTED', - ]; - - 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(State::class, \Google\Cloud\DataCatalog\Lineage\V1\Run_State::class); - diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/SearchLinksRequest.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/SearchLinksRequest.php deleted file mode 100644 index 61cfe999f15d..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/SearchLinksRequest.php +++ /dev/null @@ -1,245 +0,0 @@ -google.cloud.datacatalog.lineage.v1.SearchLinksRequest - */ -class SearchLinksRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The project and location you want search in. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. The maximum number of links to return in a single page of the - * response. A page may contain fewer links than this value. If unspecified, - * at most 10 links are returned. - * Maximum value is 100; values greater than 100 are reduced to 100. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. The page token received from a previous `SearchLinksRequest` - * call. Use it to get the next page. - * When requesting subsequent pages of a response, remember that - * all parameters must match the values you provided - * in the original request. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - protected $criteria; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The project and location you want search in. - * @type \Google\Cloud\DataCatalog\Lineage\V1\EntityReference $source - * Optional. Send asset information in the **source** field to retrieve all - * links that lead from the specified asset to downstream assets. - * @type \Google\Cloud\DataCatalog\Lineage\V1\EntityReference $target - * Optional. Send asset information in the **target** field to retrieve all - * links that lead from upstream assets to the specified asset. - * @type int $page_size - * Optional. The maximum number of links to return in a single page of the - * response. A page may contain fewer links than this value. If unspecified, - * at most 10 links are returned. - * Maximum value is 100; values greater than 100 are reduced to 100. - * @type string $page_token - * Optional. The page token received from a previous `SearchLinksRequest` - * call. Use it to get the next page. - * When requesting subsequent pages of a response, remember that - * all parameters must match the values you provided - * in the original request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); - parent::__construct($data); - } - - /** - * Required. The project and location you want search in. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The project and location you want search in. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. Send asset information in the **source** field to retrieve all - * links that lead from the specified asset to downstream assets. - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.EntityReference source = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\DataCatalog\Lineage\V1\EntityReference|null - */ - public function getSource() - { - return $this->readOneof(4); - } - - public function hasSource() - { - return $this->hasOneof(4); - } - - /** - * Optional. Send asset information in the **source** field to retrieve all - * links that lead from the specified asset to downstream assets. - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.EntityReference source = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\DataCatalog\Lineage\V1\EntityReference $var - * @return $this - */ - public function setSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\Lineage\V1\EntityReference::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * Optional. Send asset information in the **target** field to retrieve all - * links that lead from upstream assets to the specified asset. - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.EntityReference target = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\DataCatalog\Lineage\V1\EntityReference|null - */ - public function getTarget() - { - return $this->readOneof(5); - } - - public function hasTarget() - { - return $this->hasOneof(5); - } - - /** - * Optional. Send asset information in the **target** field to retrieve all - * links that lead from upstream assets to the specified asset. - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.EntityReference target = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\DataCatalog\Lineage\V1\EntityReference $var - * @return $this - */ - public function setTarget($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\Lineage\V1\EntityReference::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * Optional. The maximum number of links to return in a single page of the - * response. A page may contain fewer links than this value. If unspecified, - * at most 10 links are returned. - * Maximum value is 100; values greater than 100 are reduced to 100. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of links to return in a single page of the - * response. A page may contain fewer links than this value. If unspecified, - * at most 10 links are returned. - * Maximum value is 100; values greater than 100 are reduced to 100. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. The page token received from a previous `SearchLinksRequest` - * call. Use it to get the next page. - * When requesting subsequent pages of a response, remember that - * all parameters must match the values you provided - * in the original request. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. The page token received from a previous `SearchLinksRequest` - * call. Use it to get the next page. - * When requesting subsequent pages of a response, remember that - * all parameters must match the values you provided - * in the original request. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * @return string - */ - public function getCriteria() - { - return $this->whichOneof("criteria"); - } - -} - diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/SearchLinksResponse.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/SearchLinksResponse.php deleted file mode 100644 index e54d2eb0e0fe..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/SearchLinksResponse.php +++ /dev/null @@ -1,110 +0,0 @@ -google.cloud.datacatalog.lineage.v1.SearchLinksResponse - */ -class SearchLinksResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of links for a given asset. Can be empty if the asset has no - * relations of requested type (source or target). - * - * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.Link links = 1; - */ - private $links; - /** - * The token to specify as `page_token` in the subsequent call to get the next - * page. Omitted if there are no more pages in the response. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\DataCatalog\Lineage\V1\Link>|\Google\Protobuf\Internal\RepeatedField $links - * The list of links for a given asset. Can be empty if the asset has no - * relations of requested type (source or target). - * @type string $next_page_token - * The token to specify as `page_token` in the subsequent call to get the next - * page. Omitted if there are no more pages in the response. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); - parent::__construct($data); - } - - /** - * The list of links for a given asset. Can be empty if the asset has no - * relations of requested type (source or target). - * - * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.Link links = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getLinks() - { - return $this->links; - } - - /** - * The list of links for a given asset. Can be empty if the asset has no - * relations of requested type (source or target). - * - * Generated from protobuf field repeated .google.cloud.datacatalog.lineage.v1.Link links = 1; - * @param array<\Google\Cloud\DataCatalog\Lineage\V1\Link>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setLinks($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DataCatalog\Lineage\V1\Link::class); - $this->links = $arr; - - return $this; - } - - /** - * The token to specify as `page_token` in the subsequent call to get the next - * page. Omitted if there are no more pages in the response. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * The token to specify as `page_token` in the subsequent call to get the next - * page. Omitted if there are no more pages in the response. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/UpdateProcessRequest.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/UpdateProcessRequest.php deleted file mode 100644 index 9b26ec7372de..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/UpdateProcessRequest.php +++ /dev/null @@ -1,182 +0,0 @@ -google.cloud.datacatalog.lineage.v1.UpdateProcessRequest - */ -class UpdateProcessRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The lineage process to update. - * The process's `name` field is used to identify the process to update. - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Process process = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $process = null; - /** - * The list of fields to update. Currently not used. The whole message is - * updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - */ - protected $update_mask = null; - /** - * If set to true and the process is not found, the request inserts it. - * - * Generated from protobuf field bool allow_missing = 3; - */ - protected $allow_missing = false; - - /** - * @param \Google\Cloud\DataCatalog\Lineage\V1\Process $process Required. The lineage process to update. - * - * The process's `name` field is used to identify the process to update. - * @param \Google\Protobuf\FieldMask $updateMask The list of fields to update. Currently not used. The whole message is - * updated. - * - * @return \Google\Cloud\DataCatalog\Lineage\V1\UpdateProcessRequest - * - * @experimental - */ - public static function build(\Google\Cloud\DataCatalog\Lineage\V1\Process $process, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setProcess($process) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\DataCatalog\Lineage\V1\Process $process - * Required. The lineage process to update. - * The process's `name` field is used to identify the process to update. - * @type \Google\Protobuf\FieldMask $update_mask - * The list of fields to update. Currently not used. The whole message is - * updated. - * @type bool $allow_missing - * If set to true and the process is not found, the request inserts it. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); - parent::__construct($data); - } - - /** - * Required. The lineage process to update. - * The process's `name` field is used to identify the process to update. - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Process process = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\DataCatalog\Lineage\V1\Process|null - */ - public function getProcess() - { - return $this->process; - } - - public function hasProcess() - { - return isset($this->process); - } - - public function clearProcess() - { - unset($this->process); - } - - /** - * Required. The lineage process to update. - * The process's `name` field is used to identify the process to update. - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Process process = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\DataCatalog\Lineage\V1\Process $var - * @return $this - */ - public function setProcess($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\Lineage\V1\Process::class); - $this->process = $var; - - return $this; - } - - /** - * The list of fields to update. Currently not used. The whole message is - * updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * The list of fields to update. Currently not used. The whole message is - * updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * If set to true and the process is not found, the request inserts it. - * - * Generated from protobuf field bool allow_missing = 3; - * @return bool - */ - public function getAllowMissing() - { - return $this->allow_missing; - } - - /** - * If set to true and the process is not found, the request inserts it. - * - * Generated from protobuf field bool allow_missing = 3; - * @param bool $var - * @return $this - */ - public function setAllowMissing($var) - { - GPBUtil::checkBool($var); - $this->allow_missing = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/UpdateRunRequest.php b/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/UpdateRunRequest.php deleted file mode 100644 index 8122fdd17704..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/proto/src/Google/Cloud/DataCatalog/Lineage/V1/UpdateRunRequest.php +++ /dev/null @@ -1,193 +0,0 @@ -google.cloud.datacatalog.lineage.v1.UpdateRunRequest - */ -class UpdateRunRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The lineage run to update. - * The run's `name` field is used to identify the run to update. - * Format: - * `projects/{project}/locations/{location}/processes/{process}/runs/{run}`. - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Run run = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $run = null; - /** - * The list of fields to update. Currently not used. The whole message is - * updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - */ - protected $update_mask = null; - /** - * If set to true and the run is not found, the request creates it. - * - * Generated from protobuf field bool allow_missing = 3; - */ - protected $allow_missing = false; - - /** - * @param \Google\Cloud\DataCatalog\Lineage\V1\Run $run Required. The lineage run to update. - * - * The run's `name` field is used to identify the run to update. - * - * Format: - * `projects/{project}/locations/{location}/processes/{process}/runs/{run}`. - * @param \Google\Protobuf\FieldMask $updateMask The list of fields to update. Currently not used. The whole message is - * updated. - * - * @return \Google\Cloud\DataCatalog\Lineage\V1\UpdateRunRequest - * - * @experimental - */ - public static function build(\Google\Cloud\DataCatalog\Lineage\V1\Run $run, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setRun($run) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\DataCatalog\Lineage\V1\Run $run - * Required. The lineage run to update. - * The run's `name` field is used to identify the run to update. - * Format: - * `projects/{project}/locations/{location}/processes/{process}/runs/{run}`. - * @type \Google\Protobuf\FieldMask $update_mask - * The list of fields to update. Currently not used. The whole message is - * updated. - * @type bool $allow_missing - * If set to true and the run is not found, the request creates it. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Datacatalog\Lineage\V1\Lineage::initOnce(); - parent::__construct($data); - } - - /** - * Required. The lineage run to update. - * The run's `name` field is used to identify the run to update. - * Format: - * `projects/{project}/locations/{location}/processes/{process}/runs/{run}`. - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Run run = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\DataCatalog\Lineage\V1\Run|null - */ - public function getRun() - { - return $this->run; - } - - public function hasRun() - { - return isset($this->run); - } - - public function clearRun() - { - unset($this->run); - } - - /** - * Required. The lineage run to update. - * The run's `name` field is used to identify the run to update. - * Format: - * `projects/{project}/locations/{location}/processes/{process}/runs/{run}`. - * - * Generated from protobuf field .google.cloud.datacatalog.lineage.v1.Run run = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\DataCatalog\Lineage\V1\Run $var - * @return $this - */ - public function setRun($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\Lineage\V1\Run::class); - $this->run = $var; - - return $this; - } - - /** - * The list of fields to update. Currently not used. The whole message is - * updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * The list of fields to update. Currently not used. The whole message is - * updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * If set to true and the run is not found, the request creates it. - * - * Generated from protobuf field bool allow_missing = 3; - * @return bool - */ - public function getAllowMissing() - { - return $this->allow_missing; - } - - /** - * If set to true and the run is not found, the request creates it. - * - * Generated from protobuf field bool allow_missing = 3; - * @param bool $var - * @return $this - */ - public function setAllowMissing($var) - { - GPBUtil::checkBool($var); - $this->allow_missing = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/batch_search_link_processes.php b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/batch_search_link_processes.php deleted file mode 100644 index 68e9a401868d..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/batch_search_link_processes.php +++ /dev/null @@ -1,99 +0,0 @@ -setParent($formattedParent) - ->setLinks($links); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $lineageClient->batchSearchLinkProcesses($request); - - /** @var ProcessLinks $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = LineageClient::locationName('[PROJECT]', '[LOCATION]'); - $linksElement = '[LINKS]'; - - batch_search_link_processes_sample($formattedParent, $linksElement); -} -// [END datalineage_v1_generated_Lineage_BatchSearchLinkProcesses_sync] diff --git a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/create_lineage_event.php b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/create_lineage_event.php deleted file mode 100644 index c9da4efde8aa..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/create_lineage_event.php +++ /dev/null @@ -1,76 +0,0 @@ -setStartTime($lineageEventStartTime); - $request = (new CreateLineageEventRequest()) - ->setParent($formattedParent) - ->setLineageEvent($lineageEvent); - - // Call the API and handle any network failures. - try { - /** @var LineageEvent $response */ - $response = $lineageClient->createLineageEvent($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = LineageClient::runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); - - create_lineage_event_sample($formattedParent); -} -// [END datalineage_v1_generated_Lineage_CreateLineageEvent_sync] diff --git a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/create_process.php b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/create_process.php deleted file mode 100644 index de3bd8e24140..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/create_process.php +++ /dev/null @@ -1,74 +0,0 @@ -setParent($formattedParent) - ->setProcess($process); - - // Call the API and handle any network failures. - try { - /** @var Process $response */ - $response = $lineageClient->createProcess($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = LineageClient::locationName('[PROJECT]', '[LOCATION]'); - - create_process_sample($formattedParent); -} -// [END datalineage_v1_generated_Lineage_CreateProcess_sync] diff --git a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/create_run.php b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/create_run.php deleted file mode 100644 index 0a001b418cd4..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/create_run.php +++ /dev/null @@ -1,80 +0,0 @@ -setStartTime($runStartTime) - ->setState($runState); - $request = (new CreateRunRequest()) - ->setParent($formattedParent) - ->setRun($run); - - // Call the API and handle any network failures. - try { - /** @var Run $response */ - $response = $lineageClient->createRun($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = LineageClient::processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); - $runState = State::UNKNOWN; - - create_run_sample($formattedParent, $runState); -} -// [END datalineage_v1_generated_Lineage_CreateRun_sync] diff --git a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/delete_lineage_event.php b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/delete_lineage_event.php deleted file mode 100644 index a44e3cbec51a..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/delete_lineage_event.php +++ /dev/null @@ -1,75 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - $lineageClient->deleteLineageEvent($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = LineageClient::lineageEventName( - '[PROJECT]', - '[LOCATION]', - '[PROCESS]', - '[RUN]', - '[LINEAGE_EVENT]' - ); - - delete_lineage_event_sample($formattedName); -} -// [END datalineage_v1_generated_Lineage_DeleteLineageEvent_sync] diff --git a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/delete_process.php b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/delete_process.php deleted file mode 100644 index 9e847a3a522f..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/delete_process.php +++ /dev/null @@ -1,80 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $lineageClient->deleteProcess($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - printf('Operation completed successfully.' . PHP_EOL); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = LineageClient::processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); - - delete_process_sample($formattedName); -} -// [END datalineage_v1_generated_Lineage_DeleteProcess_sync] diff --git a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/delete_run.php b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/delete_run.php deleted file mode 100644 index d54daa9b613f..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/delete_run.php +++ /dev/null @@ -1,80 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $lineageClient->deleteRun($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - printf('Operation completed successfully.' . PHP_EOL); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = LineageClient::runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); - - delete_run_sample($formattedName); -} -// [END datalineage_v1_generated_Lineage_DeleteRun_sync] diff --git a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/get_lineage_event.php b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/get_lineage_event.php deleted file mode 100644 index af73bcd87409..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/get_lineage_event.php +++ /dev/null @@ -1,77 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var LineageEvent $response */ - $response = $lineageClient->getLineageEvent($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = LineageClient::lineageEventName( - '[PROJECT]', - '[LOCATION]', - '[PROCESS]', - '[RUN]', - '[LINEAGE_EVENT]' - ); - - get_lineage_event_sample($formattedName); -} -// [END datalineage_v1_generated_Lineage_GetLineageEvent_sync] diff --git a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/get_process.php b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/get_process.php deleted file mode 100644 index bbcb7725fbd8..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/get_process.php +++ /dev/null @@ -1,71 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Process $response */ - $response = $lineageClient->getProcess($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = LineageClient::processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); - - get_process_sample($formattedName); -} -// [END datalineage_v1_generated_Lineage_GetProcess_sync] diff --git a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/get_run.php b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/get_run.php deleted file mode 100644 index 1c7f828f3747..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/get_run.php +++ /dev/null @@ -1,71 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Run $response */ - $response = $lineageClient->getRun($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = LineageClient::runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); - - get_run_sample($formattedName); -} -// [END datalineage_v1_generated_Lineage_GetRun_sync] diff --git a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/list_lineage_events.php b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/list_lineage_events.php deleted file mode 100644 index 6d9d7d95410f..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/list_lineage_events.php +++ /dev/null @@ -1,77 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $lineageClient->listLineageEvents($request); - - /** @var LineageEvent $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = LineageClient::runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); - - list_lineage_events_sample($formattedParent); -} -// [END datalineage_v1_generated_Lineage_ListLineageEvents_sync] diff --git a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/list_processes.php b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/list_processes.php deleted file mode 100644 index cc374dcf0524..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/list_processes.php +++ /dev/null @@ -1,78 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $lineageClient->listProcesses($request); - - /** @var Process $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = LineageClient::locationName('[PROJECT]', '[LOCATION]'); - - list_processes_sample($formattedParent); -} -// [END datalineage_v1_generated_Lineage_ListProcesses_sync] diff --git a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/list_runs.php b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/list_runs.php deleted file mode 100644 index 966835a13579..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/list_runs.php +++ /dev/null @@ -1,77 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $lineageClient->listRuns($request); - - /** @var Run $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = LineageClient::processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); - - list_runs_sample($formattedParent); -} -// [END datalineage_v1_generated_Lineage_ListRuns_sync] diff --git a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/search_links.php b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/search_links.php deleted file mode 100644 index 0e5b874e858f..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/search_links.php +++ /dev/null @@ -1,84 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $lineageClient->searchLinks($request); - - /** @var Link $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = LineageClient::locationName('[PROJECT]', '[LOCATION]'); - - search_links_sample($formattedParent); -} -// [END datalineage_v1_generated_Lineage_SearchLinks_sync] diff --git a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/update_process.php b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/update_process.php deleted file mode 100644 index 706330545719..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/update_process.php +++ /dev/null @@ -1,59 +0,0 @@ -setProcess($process); - - // Call the API and handle any network failures. - try { - /** @var Process $response */ - $response = $lineageClient->updateProcess($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END datalineage_v1_generated_Lineage_UpdateProcess_sync] diff --git a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/update_run.php b/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/update_run.php deleted file mode 100644 index c8acb38a692d..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/samples/V1/LineageClient/update_run.php +++ /dev/null @@ -1,76 +0,0 @@ -setStartTime($runStartTime) - ->setState($runState); - $request = (new UpdateRunRequest()) - ->setRun($run); - - // Call the API and handle any network failures. - try { - /** @var Run $response */ - $response = $lineageClient->updateRun($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $runState = State::UNKNOWN; - - update_run_sample($runState); -} -// [END datalineage_v1_generated_Lineage_UpdateRun_sync] diff --git a/owl-bot-staging/DataCatalogLineage/v1/src/V1/Client/LineageClient.php b/owl-bot-staging/DataCatalogLineage/v1/src/V1/Client/LineageClient.php deleted file mode 100644 index 7abb39d57029..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/src/V1/Client/LineageClient.php +++ /dev/null @@ -1,817 +0,0 @@ - self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/lineage_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/lineage_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/lineage_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/lineage_rest_client_config.php', - ], - ], - ]; - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * Formats a string containing the fully-qualified path to represent a - * lineage_event resource. - * - * @param string $project - * @param string $location - * @param string $process - * @param string $run - * @param string $lineageEvent - * - * @return string The formatted lineage_event resource. - */ - public static function lineageEventName(string $project, string $location, string $process, string $run, string $lineageEvent): string - { - return self::getPathTemplate('lineageEvent')->render([ - 'project' => $project, - 'location' => $location, - 'process' => $process, - 'run' => $run, - 'lineage_event' => $lineageEvent, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName(string $project, string $location): string - { - return self::getPathTemplate('location')->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a process - * resource. - * - * @param string $project - * @param string $location - * @param string $process - * - * @return string The formatted process resource. - */ - public static function processName(string $project, string $location, string $process): string - { - return self::getPathTemplate('process')->render([ - 'project' => $project, - 'location' => $location, - 'process' => $process, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a run - * resource. - * - * @param string $project - * @param string $location - * @param string $process - * @param string $run - * - * @return string The formatted run resource. - */ - public static function runName(string $project, string $location, string $process, string $run): string - { - return self::getPathTemplate('run')->render([ - 'project' => $project, - 'location' => $location, - 'process' => $process, - 'run' => $run, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - lineageEvent: projects/{project}/locations/{location}/processes/{process}/runs/{run}/lineageEvents/{lineage_event} - * - location: projects/{project}/locations/{location} - * - process: projects/{project}/locations/{location}/processes/{process} - * - run: projects/{project}/locations/{location}/processes/{process}/runs/{run} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName(string $formattedName, string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'datalineage.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Retrieve information about LineageProcesses associated with specific - * links. LineageProcesses are transformation pipelines that result in data - * flowing from **source** to **target** assets. Links between assets - * represent this operation. - * - * If you have specific link names, you can use this method to - * verify which LineageProcesses contribute to creating those links. - * See the - * [SearchLinks][google.cloud.datacatalog.lineage.v1.Lineage.SearchLinks] - * method for more information on how to retrieve link name. - * - * You can retrieve the LineageProcess information in every project where you - * have the `datalineage.events.get` permission. The project provided in the - * URL is used for Billing and Quota. - * - * The async variant is {@see LineageClient::batchSearchLinkProcessesAsync()} . - * - * @example samples/V1/LineageClient/batch_search_link_processes.php - * - * @param BatchSearchLinkProcessesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function batchSearchLinkProcesses(BatchSearchLinkProcessesRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('BatchSearchLinkProcesses', $request, $callOptions); - } - - /** - * Creates a new lineage event. - * - * The async variant is {@see LineageClient::createLineageEventAsync()} . - * - * @example samples/V1/LineageClient/create_lineage_event.php - * - * @param CreateLineageEventRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return LineageEvent - * - * @throws ApiException Thrown if the API call fails. - */ - public function createLineageEvent(CreateLineageEventRequest $request, array $callOptions = []): LineageEvent - { - return $this->startApiCall('CreateLineageEvent', $request, $callOptions)->wait(); - } - - /** - * Creates a new process. - * - * The async variant is {@see LineageClient::createProcessAsync()} . - * - * @example samples/V1/LineageClient/create_process.php - * - * @param CreateProcessRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Process - * - * @throws ApiException Thrown if the API call fails. - */ - public function createProcess(CreateProcessRequest $request, array $callOptions = []): Process - { - return $this->startApiCall('CreateProcess', $request, $callOptions)->wait(); - } - - /** - * Creates a new run. - * - * The async variant is {@see LineageClient::createRunAsync()} . - * - * @example samples/V1/LineageClient/create_run.php - * - * @param CreateRunRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Run - * - * @throws ApiException Thrown if the API call fails. - */ - public function createRun(CreateRunRequest $request, array $callOptions = []): Run - { - return $this->startApiCall('CreateRun', $request, $callOptions)->wait(); - } - - /** - * Deletes the lineage event with the specified name. - * - * The async variant is {@see LineageClient::deleteLineageEventAsync()} . - * - * @example samples/V1/LineageClient/delete_lineage_event.php - * - * @param DeleteLineageEventRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteLineageEvent(DeleteLineageEventRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteLineageEvent', $request, $callOptions)->wait(); - } - - /** - * Deletes the process with the specified name. - * - * The async variant is {@see LineageClient::deleteProcessAsync()} . - * - * @example samples/V1/LineageClient/delete_process.php - * - * @param DeleteProcessRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteProcess(DeleteProcessRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('DeleteProcess', $request, $callOptions)->wait(); - } - - /** - * Deletes the run with the specified name. - * - * The async variant is {@see LineageClient::deleteRunAsync()} . - * - * @example samples/V1/LineageClient/delete_run.php - * - * @param DeleteRunRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteRun(DeleteRunRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('DeleteRun', $request, $callOptions)->wait(); - } - - /** - * Gets details of a specified lineage event. - * - * The async variant is {@see LineageClient::getLineageEventAsync()} . - * - * @example samples/V1/LineageClient/get_lineage_event.php - * - * @param GetLineageEventRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return LineageEvent - * - * @throws ApiException Thrown if the API call fails. - */ - public function getLineageEvent(GetLineageEventRequest $request, array $callOptions = []): LineageEvent - { - return $this->startApiCall('GetLineageEvent', $request, $callOptions)->wait(); - } - - /** - * Gets the details of the specified process. - * - * The async variant is {@see LineageClient::getProcessAsync()} . - * - * @example samples/V1/LineageClient/get_process.php - * - * @param GetProcessRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Process - * - * @throws ApiException Thrown if the API call fails. - */ - public function getProcess(GetProcessRequest $request, array $callOptions = []): Process - { - return $this->startApiCall('GetProcess', $request, $callOptions)->wait(); - } - - /** - * Gets the details of the specified run. - * - * The async variant is {@see LineageClient::getRunAsync()} . - * - * @example samples/V1/LineageClient/get_run.php - * - * @param GetRunRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Run - * - * @throws ApiException Thrown if the API call fails. - */ - public function getRun(GetRunRequest $request, array $callOptions = []): Run - { - return $this->startApiCall('GetRun', $request, $callOptions)->wait(); - } - - /** - * Lists lineage events in the given project and location. The list order is - * not defined. - * - * The async variant is {@see LineageClient::listLineageEventsAsync()} . - * - * @example samples/V1/LineageClient/list_lineage_events.php - * - * @param ListLineageEventsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listLineageEvents(ListLineageEventsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListLineageEvents', $request, $callOptions); - } - - /** - * List processes in the given project and location. List order is descending - * by insertion time. - * - * The async variant is {@see LineageClient::listProcessesAsync()} . - * - * @example samples/V1/LineageClient/list_processes.php - * - * @param ListProcessesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listProcesses(ListProcessesRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListProcesses', $request, $callOptions); - } - - /** - * Lists runs in the given project and location. List order is descending by - * `start_time`. - * - * The async variant is {@see LineageClient::listRunsAsync()} . - * - * @example samples/V1/LineageClient/list_runs.php - * - * @param ListRunsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listRuns(ListRunsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListRuns', $request, $callOptions); - } - - /** - * Creates new lineage events together with their parents: process and run. - * Updates the process and run if they already exist. - * Mapped from Open Lineage specification: - * https://github.com/OpenLineage/OpenLineage/blob/main/spec/OpenLineage.json. - * - * The async variant is {@see LineageClient::processOpenLineageRunEventAsync()} . - * - * @example samples/V1/LineageClient/process_open_lineage_run_event.php - * - * @param ProcessOpenLineageRunEventRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return ProcessOpenLineageRunEventResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function processOpenLineageRunEvent(ProcessOpenLineageRunEventRequest $request, array $callOptions = []): ProcessOpenLineageRunEventResponse - { - return $this->startApiCall('ProcessOpenLineageRunEvent', $request, $callOptions)->wait(); - } - - /** - * Retrieve a list of links connected to a specific asset. - * Links represent the data flow between **source** (upstream) - * and **target** (downstream) assets in transformation pipelines. - * Links are stored in the same project as the Lineage Events that create - * them. - * - * You can retrieve links in every project where you have the - * `datalineage.events.get` permission. The project provided in the URL - * is used for Billing and Quota. - * - * The async variant is {@see LineageClient::searchLinksAsync()} . - * - * @example samples/V1/LineageClient/search_links.php - * - * @param SearchLinksRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function searchLinks(SearchLinksRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('SearchLinks', $request, $callOptions); - } - - /** - * Updates a process. - * - * The async variant is {@see LineageClient::updateProcessAsync()} . - * - * @example samples/V1/LineageClient/update_process.php - * - * @param UpdateProcessRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Process - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateProcess(UpdateProcessRequest $request, array $callOptions = []): Process - { - return $this->startApiCall('UpdateProcess', $request, $callOptions)->wait(); - } - - /** - * Updates a run. - * - * The async variant is {@see LineageClient::updateRunAsync()} . - * - * @example samples/V1/LineageClient/update_run.php - * - * @param UpdateRunRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Run - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateRun(UpdateRunRequest $request, array $callOptions = []): Run - { - return $this->startApiCall('UpdateRun', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/DataCatalogLineage/v1/src/V1/Gapic/LineageGapicClient.php b/owl-bot-staging/DataCatalogLineage/v1/src/V1/Gapic/LineageGapicClient.php deleted file mode 100644 index 6d227fea2a33..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/src/V1/Gapic/LineageGapicClient.php +++ /dev/null @@ -1,1431 +0,0 @@ -locationName('[PROJECT]', '[LOCATION]'); - * $links = []; - * // Iterate over pages of elements - * $pagedResponse = $lineageClient->batchSearchLinkProcesses($formattedParent, $links); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $lineageClient->batchSearchLinkProcesses($formattedParent, $links); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $lineageClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * This service has a new (beta) implementation. See {@see - * \Google\Cloud\DataCatalog\Lineage\V1\Client\LineageClient} to use the new - * surface. - */ -class LineageGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.datacatalog.lineage.v1.Lineage'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'datalineage.googleapis.com'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $lineageEventNameTemplate; - - private static $locationNameTemplate; - - private static $processNameTemplate; - - private static $runNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/lineage_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/lineage_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/lineage_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/lineage_rest_client_config.php', - ], - ], - ]; - } - - private static function getLineageEventNameTemplate() - { - if (self::$lineageEventNameTemplate == null) { - self::$lineageEventNameTemplate = new PathTemplate('projects/{project}/locations/{location}/processes/{process}/runs/{run}/lineageEvents/{lineage_event}'); - } - - return self::$lineageEventNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getProcessNameTemplate() - { - if (self::$processNameTemplate == null) { - self::$processNameTemplate = new PathTemplate('projects/{project}/locations/{location}/processes/{process}'); - } - - return self::$processNameTemplate; - } - - private static function getRunNameTemplate() - { - if (self::$runNameTemplate == null) { - self::$runNameTemplate = new PathTemplate('projects/{project}/locations/{location}/processes/{process}/runs/{run}'); - } - - return self::$runNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'lineageEvent' => self::getLineageEventNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'process' => self::getProcessNameTemplate(), - 'run' => self::getRunNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a - * lineage_event resource. - * - * @param string $project - * @param string $location - * @param string $process - * @param string $run - * @param string $lineageEvent - * - * @return string The formatted lineage_event resource. - */ - public static function lineageEventName($project, $location, $process, $run, $lineageEvent) - { - return self::getLineageEventNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'process' => $process, - 'run' => $run, - 'lineage_event' => $lineageEvent, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a process - * resource. - * - * @param string $project - * @param string $location - * @param string $process - * - * @return string The formatted process resource. - */ - public static function processName($project, $location, $process) - { - return self::getProcessNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'process' => $process, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a run - * resource. - * - * @param string $project - * @param string $location - * @param string $process - * @param string $run - * - * @return string The formatted run resource. - */ - public static function runName($project, $location, $process, $run) - { - return self::getRunNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'process' => $process, - 'run' => $run, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - lineageEvent: projects/{project}/locations/{location}/processes/{process}/runs/{run}/lineageEvents/{lineage_event} - * - location: projects/{project}/locations/{location} - * - process: projects/{project}/locations/{location}/processes/{process} - * - run: projects/{project}/locations/{location}/processes/{process}/runs/{run} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - 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. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'datalineage.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Retrieve information about LineageProcesses associated with specific - * links. LineageProcesses are transformation pipelines that result in data - * flowing from **source** to **target** assets. Links between assets - * represent this operation. - * - * If you have specific link names, you can use this method to - * verify which LineageProcesses contribute to creating those links. - * See the - * [SearchLinks][google.cloud.datacatalog.lineage.v1.Lineage.SearchLinks] - * method for more information on how to retrieve link name. - * - * You can retrieve the LineageProcess information in every project where you - * have the `datalineage.events.get` permission. The project provided in the - * URL is used for Billing and Quota. - * - * Sample code: - * ``` - * $lineageClient = new LineageClient(); - * try { - * $formattedParent = $lineageClient->locationName('[PROJECT]', '[LOCATION]'); - * $links = []; - * // Iterate over pages of elements - * $pagedResponse = $lineageClient->batchSearchLinkProcesses($formattedParent, $links); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $lineageClient->batchSearchLinkProcesses($formattedParent, $links); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $lineageClient->close(); - * } - * ``` - * - * @param string $parent Required. The project and location where you want to search. - * @param string[] $links Required. An array of links to check for their associated LineageProcesses. - * - * The maximum number of items in this array is 100. - * If the request contains more than 100 links, it returns the - * `INVALID_ARGUMENT` error. - * - * Format: `projects/{project}/locations/{location}/links/{link}`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * 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 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\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function batchSearchLinkProcesses($parent, $links, array $optionalArgs = []) - { - $request = new BatchSearchLinkProcessesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setLinks($links); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('BatchSearchLinkProcesses', $optionalArgs, BatchSearchLinkProcessesResponse::class, $request); - } - - /** - * Creates a new lineage event. - * - * Sample code: - * ``` - * $lineageClient = new LineageClient(); - * try { - * $formattedParent = $lineageClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); - * $lineageEvent = new LineageEvent(); - * $response = $lineageClient->createLineageEvent($formattedParent, $lineageEvent); - * } finally { - * $lineageClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the run that should own the lineage event. - * @param LineageEvent $lineageEvent Required. The lineage event to create. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * A unique identifier for this request. Restricted to 36 ASCII characters. - * A random UUID is recommended. This request is idempotent only if a - * `request_id` is provided. - * @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\Cloud\DataCatalog\Lineage\V1\LineageEvent - * - * @throws ApiException if the remote call fails - */ - public function createLineageEvent($parent, $lineageEvent, array $optionalArgs = []) - { - $request = new CreateLineageEventRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setLineageEvent($lineageEvent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateLineageEvent', LineageEvent::class, $optionalArgs, $request)->wait(); - } - - /** - * Creates a new process. - * - * Sample code: - * ``` - * $lineageClient = new LineageClient(); - * try { - * $formattedParent = $lineageClient->locationName('[PROJECT]', '[LOCATION]'); - * $process = new Process(); - * $response = $lineageClient->createProcess($formattedParent, $process); - * } finally { - * $lineageClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the project and its location that should own the - * process. - * @param Process $process Required. The process to create. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * A unique identifier for this request. Restricted to 36 ASCII characters. - * A random UUID is recommended. This request is idempotent only if a - * `request_id` is provided. - * @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\Cloud\DataCatalog\Lineage\V1\Process - * - * @throws ApiException if the remote call fails - */ - public function createProcess($parent, $process, array $optionalArgs = []) - { - $request = new CreateProcessRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setProcess($process); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateProcess', Process::class, $optionalArgs, $request)->wait(); - } - - /** - * Creates a new run. - * - * Sample code: - * ``` - * $lineageClient = new LineageClient(); - * try { - * $formattedParent = $lineageClient->processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); - * $run = new Run(); - * $response = $lineageClient->createRun($formattedParent, $run); - * } finally { - * $lineageClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the process that should own the run. - * @param Run $run Required. The run to create. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * A unique identifier for this request. Restricted to 36 ASCII characters. - * A random UUID is recommended. This request is idempotent only if a - * `request_id` is provided. - * @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\Cloud\DataCatalog\Lineage\V1\Run - * - * @throws ApiException if the remote call fails - */ - public function createRun($parent, $run, array $optionalArgs = []) - { - $request = new CreateRunRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setRun($run); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateRun', Run::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes the lineage event with the specified name. - * - * Sample code: - * ``` - * $lineageClient = new LineageClient(); - * try { - * $formattedName = $lineageClient->lineageEventName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]', '[LINEAGE_EVENT]'); - * $lineageClient->deleteLineageEvent($formattedName); - * } finally { - * $lineageClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the lineage event to delete. - * @param array $optionalArgs { - * Optional. - * - * @type bool $allowMissing - * If set to true and the lineage event is not found, the request - * succeeds but the server doesn't perform any actions. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function deleteLineageEvent($name, array $optionalArgs = []) - { - $request = new DeleteLineageEventRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['allowMissing'])) { - $request->setAllowMissing($optionalArgs['allowMissing']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteLineageEvent', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes the process with the specified name. - * - * Sample code: - * ``` - * $lineageClient = new LineageClient(); - * try { - * $formattedName = $lineageClient->processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); - * $operationResponse = $lineageClient->deleteProcess($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $lineageClient->deleteProcess($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $lineageClient->resumeOperation($operationName, 'deleteProcess'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $lineageClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the process to delete. - * @param array $optionalArgs { - * Optional. - * - * @type bool $allowMissing - * If set to true and the process is not found, the request - * succeeds but the server doesn't perform any actions. - * @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 deleteProcess($name, array $optionalArgs = []) - { - $request = new DeleteProcessRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['allowMissing'])) { - $request->setAllowMissing($optionalArgs['allowMissing']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteProcess', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes the run with the specified name. - * - * Sample code: - * ``` - * $lineageClient = new LineageClient(); - * try { - * $formattedName = $lineageClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); - * $operationResponse = $lineageClient->deleteRun($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $lineageClient->deleteRun($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $lineageClient->resumeOperation($operationName, 'deleteRun'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $lineageClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the run to delete. - * @param array $optionalArgs { - * Optional. - * - * @type bool $allowMissing - * If set to true and the run is not found, the request - * succeeds but the server doesn't perform any actions. - * @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 deleteRun($name, array $optionalArgs = []) - { - $request = new DeleteRunRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['allowMissing'])) { - $request->setAllowMissing($optionalArgs['allowMissing']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteRun', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets details of a specified lineage event. - * - * Sample code: - * ``` - * $lineageClient = new LineageClient(); - * try { - * $formattedName = $lineageClient->lineageEventName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]', '[LINEAGE_EVENT]'); - * $response = $lineageClient->getLineageEvent($formattedName); - * } finally { - * $lineageClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the lineage event to get. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\DataCatalog\Lineage\V1\LineageEvent - * - * @throws ApiException if the remote call fails - */ - public function getLineageEvent($name, array $optionalArgs = []) - { - $request = new GetLineageEventRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetLineageEvent', LineageEvent::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets the details of the specified process. - * - * Sample code: - * ``` - * $lineageClient = new LineageClient(); - * try { - * $formattedName = $lineageClient->processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); - * $response = $lineageClient->getProcess($formattedName); - * } finally { - * $lineageClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the process to get. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\DataCatalog\Lineage\V1\Process - * - * @throws ApiException if the remote call fails - */ - public function getProcess($name, array $optionalArgs = []) - { - $request = new GetProcessRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetProcess', Process::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets the details of the specified run. - * - * Sample code: - * ``` - * $lineageClient = new LineageClient(); - * try { - * $formattedName = $lineageClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); - * $response = $lineageClient->getRun($formattedName); - * } finally { - * $lineageClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the run to get. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\DataCatalog\Lineage\V1\Run - * - * @throws ApiException if the remote call fails - */ - public function getRun($name, array $optionalArgs = []) - { - $request = new GetRunRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetRun', Run::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists lineage events in the given project and location. The list order is - * not defined. - * - * Sample code: - * ``` - * $lineageClient = new LineageClient(); - * try { - * $formattedParent = $lineageClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); - * // Iterate over pages of elements - * $pagedResponse = $lineageClient->listLineageEvents($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $lineageClient->listLineageEvents($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $lineageClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the run that owns the collection of lineage events to - * get. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * 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 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\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLineageEvents($parent, array $optionalArgs = []) - { - $request = new ListLineageEventsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLineageEvents', $optionalArgs, ListLineageEventsResponse::class, $request); - } - - /** - * List processes in the given project and location. List order is descending - * by insertion time. - * - * Sample code: - * ``` - * $lineageClient = new LineageClient(); - * try { - * $formattedParent = $lineageClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $lineageClient->listProcesses($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $lineageClient->listProcesses($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $lineageClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the project and its location that owns this - * collection of processes. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * 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 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\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listProcesses($parent, array $optionalArgs = []) - { - $request = new ListProcessesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListProcesses', $optionalArgs, ListProcessesResponse::class, $request); - } - - /** - * Lists runs in the given project and location. List order is descending by - * `start_time`. - * - * Sample code: - * ``` - * $lineageClient = new LineageClient(); - * try { - * $formattedParent = $lineageClient->processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); - * // Iterate over pages of elements - * $pagedResponse = $lineageClient->listRuns($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $lineageClient->listRuns($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $lineageClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of process that owns this collection of runs. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * 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 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\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listRuns($parent, array $optionalArgs = []) - { - $request = new ListRunsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListRuns', $optionalArgs, ListRunsResponse::class, $request); - } - - /** - * Creates new lineage events together with their parents: process and run. - * Updates the process and run if they already exist. - * Mapped from Open Lineage specification: - * https://github.com/OpenLineage/OpenLineage/blob/main/spec/OpenLineage.json. - * - * Sample code: - * ``` - * $lineageClient = new LineageClient(); - * try { - * $parent = 'parent'; - * $openLineage = new Struct(); - * $response = $lineageClient->processOpenLineageRunEvent($parent, $openLineage); - * } finally { - * $lineageClient->close(); - * } - * ``` - * - * @param string $parent Required. The name of the project and its location that should own the - * process, run, and lineage event. - * @param Struct $openLineage Required. OpenLineage message following OpenLineage format: - * https://github.com/OpenLineage/OpenLineage/blob/main/spec/OpenLineage.json - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * A unique identifier for this request. Restricted to 36 ASCII characters. - * A random UUID is recommended. This request is idempotent only if a - * `request_id` is provided. - * @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\Cloud\DataCatalog\Lineage\V1\ProcessOpenLineageRunEventResponse - * - * @throws ApiException if the remote call fails - */ - public function processOpenLineageRunEvent($parent, $openLineage, array $optionalArgs = []) - { - $request = new ProcessOpenLineageRunEventRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setOpenLineage($openLineage); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('ProcessOpenLineageRunEvent', ProcessOpenLineageRunEventResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Retrieve a list of links connected to a specific asset. - * Links represent the data flow between **source** (upstream) - * and **target** (downstream) assets in transformation pipelines. - * Links are stored in the same project as the Lineage Events that create - * them. - * - * You can retrieve links in every project where you have the - * `datalineage.events.get` permission. The project provided in the URL - * is used for Billing and Quota. - * - * Sample code: - * ``` - * $lineageClient = new LineageClient(); - * try { - * $formattedParent = $lineageClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $lineageClient->searchLinks($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $lineageClient->searchLinks($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $lineageClient->close(); - * } - * ``` - * - * @param string $parent Required. The project and location you want search in. - * @param array $optionalArgs { - * Optional. - * - * @type EntityReference $source - * Optional. Send asset information in the **source** field to retrieve all - * links that lead from the specified asset to downstream assets. - * @type EntityReference $target - * Optional. Send asset information in the **target** field to retrieve all - * links that lead from upstream assets to the specified asset. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * 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 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\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function searchLinks($parent, array $optionalArgs = []) - { - $request = new SearchLinksRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['source'])) { - $request->setSource($optionalArgs['source']); - } - - if (isset($optionalArgs['target'])) { - $request->setTarget($optionalArgs['target']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('SearchLinks', $optionalArgs, SearchLinksResponse::class, $request); - } - - /** - * Updates a process. - * - * Sample code: - * ``` - * $lineageClient = new LineageClient(); - * try { - * $process = new Process(); - * $response = $lineageClient->updateProcess($process); - * } finally { - * $lineageClient->close(); - * } - * ``` - * - * @param Process $process Required. The lineage process to update. - * - * The process's `name` field is used to identify the process to update. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * The list of fields to update. Currently not used. The whole message is - * updated. - * @type bool $allowMissing - * If set to true and the process is not found, the request inserts it. - * @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\Cloud\DataCatalog\Lineage\V1\Process - * - * @throws ApiException if the remote call fails - */ - public function updateProcess($process, array $optionalArgs = []) - { - $request = new UpdateProcessRequest(); - $requestParamHeaders = []; - $request->setProcess($process); - $requestParamHeaders['process.name'] = $process->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - if (isset($optionalArgs['allowMissing'])) { - $request->setAllowMissing($optionalArgs['allowMissing']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateProcess', Process::class, $optionalArgs, $request)->wait(); - } - - /** - * Updates a run. - * - * Sample code: - * ``` - * $lineageClient = new LineageClient(); - * try { - * $run = new Run(); - * $response = $lineageClient->updateRun($run); - * } finally { - * $lineageClient->close(); - * } - * ``` - * - * @param Run $run Required. The lineage run to update. - * - * The run's `name` field is used to identify the run to update. - * - * Format: - * `projects/{project}/locations/{location}/processes/{process}/runs/{run}`. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * The list of fields to update. Currently not used. The whole message is - * updated. - * @type bool $allowMissing - * If set to true and the run is not found, the request creates it. - * @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\Cloud\DataCatalog\Lineage\V1\Run - * - * @throws ApiException if the remote call fails - */ - public function updateRun($run, array $optionalArgs = []) - { - $request = new UpdateRunRequest(); - $requestParamHeaders = []; - $request->setRun($run); - $requestParamHeaders['run.name'] = $run->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - if (isset($optionalArgs['allowMissing'])) { - $request->setAllowMissing($optionalArgs['allowMissing']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateRun', Run::class, $optionalArgs, $request)->wait(); - } -} diff --git a/owl-bot-staging/DataCatalogLineage/v1/src/V1/LineageClient.php b/owl-bot-staging/DataCatalogLineage/v1/src/V1/LineageClient.php deleted file mode 100644 index f7aee18948eb..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/src/V1/LineageClient.php +++ /dev/null @@ -1,34 +0,0 @@ - [ - 'google.cloud.datacatalog.lineage.v1.Lineage' => [ - 'DeleteProcess' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\DataCatalog\Lineage\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'DeleteRun' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\DataCatalog\Lineage\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'BatchSearchLinkProcesses' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getProcessLinks', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\DataCatalog\Lineage\V1\BatchSearchLinkProcessesResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'CreateLineageEvent' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\DataCatalog\Lineage\V1\LineageEvent', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'CreateProcess' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\DataCatalog\Lineage\V1\Process', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'CreateRun' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\DataCatalog\Lineage\V1\Run', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteLineageEvent' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetLineageEvent' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\DataCatalog\Lineage\V1\LineageEvent', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetProcess' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\DataCatalog\Lineage\V1\Process', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetRun' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\DataCatalog\Lineage\V1\Run', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListLineageEvents' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getLineageEvents', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\DataCatalog\Lineage\V1\ListLineageEventsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'ListProcesses' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getProcesses', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\DataCatalog\Lineage\V1\ListProcessesResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'ListRuns' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getRuns', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\DataCatalog\Lineage\V1\ListRunsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'ProcessOpenLineageRunEvent' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\DataCatalog\Lineage\V1\ProcessOpenLineageRunEventResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'SearchLinks' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getLinks', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\DataCatalog\Lineage\V1\SearchLinksResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateProcess' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\DataCatalog\Lineage\V1\Process', - 'headerParams' => [ - [ - 'keyName' => 'process.name', - 'fieldAccessors' => [ - 'getProcess', - 'getName', - ], - ], - ], - ], - 'UpdateRun' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\DataCatalog\Lineage\V1\Run', - 'headerParams' => [ - [ - 'keyName' => 'run.name', - 'fieldAccessors' => [ - 'getRun', - 'getName', - ], - ], - ], - ], - 'templateMap' => [ - 'lineageEvent' => 'projects/{project}/locations/{location}/processes/{process}/runs/{run}/lineageEvents/{lineage_event}', - 'location' => 'projects/{project}/locations/{location}', - 'process' => 'projects/{project}/locations/{location}/processes/{process}', - 'run' => 'projects/{project}/locations/{location}/processes/{process}/runs/{run}', - ], - ], - ], -]; diff --git a/owl-bot-staging/DataCatalogLineage/v1/src/V1/resources/lineage_rest_client_config.php b/owl-bot-staging/DataCatalogLineage/v1/src/V1/resources/lineage_rest_client_config.php deleted file mode 100644 index 0f8e407dc4fb..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/src/V1/resources/lineage_rest_client_config.php +++ /dev/null @@ -1,252 +0,0 @@ - [ - 'google.cloud.datacatalog.lineage.v1.Lineage' => [ - 'BatchSearchLinkProcesses' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}:batchSearchLinkProcesses', - 'body' => '*', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'CreateLineageEvent' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*/processes/*/runs/*}/lineageEvents', - 'body' => 'lineage_event', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'CreateProcess' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/processes', - 'body' => 'process', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'CreateRun' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*/processes/*}/runs', - 'body' => 'run', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteLineageEvent' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/processes/*/runs/*/lineageEvents/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteProcess' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/processes/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteRun' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/processes/*/runs/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetLineageEvent' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/processes/*/runs/*/lineageEvents/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetProcess' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/processes/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetRun' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/processes/*/runs/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListLineageEvents' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*/processes/*/runs/*}/lineageEvents', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListProcesses' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/processes', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListRuns' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*/processes/*}/runs', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ProcessOpenLineageRunEvent' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}:processOpenLineageRunEvent', - 'body' => 'open_lineage', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'SearchLinks' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}:searchLinks', - 'body' => '*', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateProcess' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{process.name=projects/*/locations/*/processes/*}', - 'body' => 'process', - 'placeholders' => [ - 'process.name' => [ - 'getters' => [ - 'getProcess', - 'getName', - ], - ], - ], - ], - 'UpdateRun' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{run.name=projects/*/locations/*/processes/*/runs/*}', - 'body' => 'run', - 'placeholders' => [ - 'run.name' => [ - 'getters' => [ - 'getRun', - 'getName', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'CancelOperation' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteOperation' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], -]; diff --git a/owl-bot-staging/DataCatalogLineage/v1/tests/Unit/V1/Client/LineageClientTest.php b/owl-bot-staging/DataCatalogLineage/v1/tests/Unit/V1/Client/LineageClientTest.php deleted file mode 100644 index 58f95fc0d16b..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/tests/Unit/V1/Client/LineageClientTest.php +++ /dev/null @@ -1,1440 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return LineageClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new LineageClient($options); - } - - /** @test */ - public function batchSearchLinkProcessesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $processLinksElement = new ProcessLinks(); - $processLinks = [ - $processLinksElement, - ]; - $expectedResponse = new BatchSearchLinkProcessesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setProcessLinks($processLinks); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $links = []; - $request = (new BatchSearchLinkProcessesRequest()) - ->setParent($formattedParent) - ->setLinks($links); - $response = $gapicClient->batchSearchLinkProcesses($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getProcessLinks()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/BatchSearchLinkProcesses', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getLinks(); - $this->assertProtobufEquals($links, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function batchSearchLinkProcessesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $links = []; - $request = (new BatchSearchLinkProcessesRequest()) - ->setParent($formattedParent) - ->setLinks($links); - try { - $gapicClient->batchSearchLinkProcesses($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createLineageEventTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new LineageEvent(); - $expectedResponse->setName($name); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); - $lineageEvent = new LineageEvent(); - $lineageEventStartTime = new Timestamp(); - $lineageEvent->setStartTime($lineageEventStartTime); - $request = (new CreateLineageEventRequest()) - ->setParent($formattedParent) - ->setLineageEvent($lineageEvent); - $response = $gapicClient->createLineageEvent($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/CreateLineageEvent', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getLineageEvent(); - $this->assertProtobufEquals($lineageEvent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createLineageEventExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); - $lineageEvent = new LineageEvent(); - $lineageEventStartTime = new Timestamp(); - $lineageEvent->setStartTime($lineageEventStartTime); - $request = (new CreateLineageEventRequest()) - ->setParent($formattedParent) - ->setLineageEvent($lineageEvent); - try { - $gapicClient->createLineageEvent($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createProcessTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Process(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $process = new Process(); - $request = (new CreateProcessRequest()) - ->setParent($formattedParent) - ->setProcess($process); - $response = $gapicClient->createProcess($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/CreateProcess', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getProcess(); - $this->assertProtobufEquals($process, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createProcessExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $process = new Process(); - $request = (new CreateProcessRequest()) - ->setParent($formattedParent) - ->setProcess($process); - try { - $gapicClient->createProcess($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createRunTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Run(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); - $run = new Run(); - $runStartTime = new Timestamp(); - $run->setStartTime($runStartTime); - $runState = State::UNKNOWN; - $run->setState($runState); - $request = (new CreateRunRequest()) - ->setParent($formattedParent) - ->setRun($run); - $response = $gapicClient->createRun($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/CreateRun', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getRun(); - $this->assertProtobufEquals($run, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createRunExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); - $run = new Run(); - $runStartTime = new Timestamp(); - $run->setStartTime($runStartTime); - $runState = State::UNKNOWN; - $run->setState($runState); - $request = (new CreateRunRequest()) - ->setParent($formattedParent) - ->setRun($run); - try { - $gapicClient->createRun($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteLineageEventTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->lineageEventName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]', '[LINEAGE_EVENT]'); - $request = (new DeleteLineageEventRequest()) - ->setName($formattedName); - $gapicClient->deleteLineageEvent($request); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/DeleteLineageEvent', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteLineageEventExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->lineageEventName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]', '[LINEAGE_EVENT]'); - $request = (new DeleteLineageEventRequest()) - ->setName($formattedName); - try { - $gapicClient->deleteLineageEvent($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteProcessTest() - { - $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/deleteProcessTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteProcessTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); - $request = (new DeleteProcessRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteProcess($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/DeleteProcess', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteProcessTest'); - $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 deleteProcessExceptionTest() - { - $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/deleteProcessTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); - $request = (new DeleteProcessRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteProcess($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteProcessTest'); - 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 deleteRunTest() - { - $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/deleteRunTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteRunTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); - $request = (new DeleteRunRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteRun($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/DeleteRun', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteRunTest'); - $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 deleteRunExceptionTest() - { - $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/deleteRunTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); - $request = (new DeleteRunRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteRun($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteRunTest'); - 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 getLineageEventTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new LineageEvent(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->lineageEventName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]', '[LINEAGE_EVENT]'); - $request = (new GetLineageEventRequest()) - ->setName($formattedName); - $response = $gapicClient->getLineageEvent($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/GetLineageEvent', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLineageEventExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->lineageEventName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]', '[LINEAGE_EVENT]'); - $request = (new GetLineageEventRequest()) - ->setName($formattedName); - try { - $gapicClient->getLineageEvent($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getProcessTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Process(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); - $request = (new GetProcessRequest()) - ->setName($formattedName); - $response = $gapicClient->getProcess($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/GetProcess', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getProcessExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); - $request = (new GetProcessRequest()) - ->setName($formattedName); - try { - $gapicClient->getProcess($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getRunTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Run(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); - $request = (new GetRunRequest()) - ->setName($formattedName); - $response = $gapicClient->getRun($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/GetRun', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getRunExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); - $request = (new GetRunRequest()) - ->setName($formattedName); - try { - $gapicClient->getRun($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLineageEventsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $lineageEventsElement = new LineageEvent(); - $lineageEvents = [ - $lineageEventsElement, - ]; - $expectedResponse = new ListLineageEventsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLineageEvents($lineageEvents); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); - $request = (new ListLineageEventsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listLineageEvents($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLineageEvents()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/ListLineageEvents', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLineageEventsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); - $request = (new ListLineageEventsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listLineageEvents($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listProcessesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $processesElement = new Process(); - $processes = [ - $processesElement, - ]; - $expectedResponse = new ListProcessesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setProcesses($processes); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListProcessesRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listProcesses($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getProcesses()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/ListProcesses', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listProcessesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListProcessesRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listProcesses($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listRunsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $runsElement = new Run(); - $runs = [ - $runsElement, - ]; - $expectedResponse = new ListRunsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setRuns($runs); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); - $request = (new ListRunsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listRuns($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getRuns()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/ListRuns', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listRunsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); - $request = (new ListRunsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listRuns($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function processOpenLineageRunEventTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $process = 'process-309518737'; - $run = 'run113291'; - $expectedResponse = new ProcessOpenLineageRunEventResponse(); - $expectedResponse->setProcess($process); - $expectedResponse->setRun($run); - $transport->addResponse($expectedResponse); - // Mock request - $parent = 'parent-995424086'; - $openLineage = new Struct(); - $request = (new ProcessOpenLineageRunEventRequest()) - ->setParent($parent) - ->setOpenLineage($openLineage); - $response = $gapicClient->processOpenLineageRunEvent($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/ProcessOpenLineageRunEvent', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $actualValue = $actualRequestObject->getOpenLineage(); - $this->assertProtobufEquals($openLineage, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function processOpenLineageRunEventExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $parent = 'parent-995424086'; - $openLineage = new Struct(); - $request = (new ProcessOpenLineageRunEventRequest()) - ->setParent($parent) - ->setOpenLineage($openLineage); - try { - $gapicClient->processOpenLineageRunEvent($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function searchLinksTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $linksElement = new Link(); - $links = [ - $linksElement, - ]; - $expectedResponse = new SearchLinksResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLinks($links); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new SearchLinksRequest()) - ->setParent($formattedParent); - $response = $gapicClient->searchLinks($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLinks()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/SearchLinks', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function searchLinksExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new SearchLinksRequest()) - ->setParent($formattedParent); - try { - $gapicClient->searchLinks($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateProcessTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Process(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $process = new Process(); - $request = (new UpdateProcessRequest()) - ->setProcess($process); - $response = $gapicClient->updateProcess($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/UpdateProcess', $actualFuncCall); - $actualValue = $actualRequestObject->getProcess(); - $this->assertProtobufEquals($process, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateProcessExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $process = new Process(); - $request = (new UpdateProcessRequest()) - ->setProcess($process); - try { - $gapicClient->updateProcess($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateRunTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Run(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $run = new Run(); - $runStartTime = new Timestamp(); - $run->setStartTime($runStartTime); - $runState = State::UNKNOWN; - $run->setState($runState); - $request = (new UpdateRunRequest()) - ->setRun($run); - $response = $gapicClient->updateRun($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/UpdateRun', $actualFuncCall); - $actualValue = $actualRequestObject->getRun(); - $this->assertProtobufEquals($run, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateRunExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $run = new Run(); - $runStartTime = new Timestamp(); - $run->setStartTime($runStartTime); - $runState = State::UNKNOWN; - $run->setState($runState); - $request = (new UpdateRunRequest()) - ->setRun($run); - try { - $gapicClient->updateRun($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function batchSearchLinkProcessesAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $processLinksElement = new ProcessLinks(); - $processLinks = [ - $processLinksElement, - ]; - $expectedResponse = new BatchSearchLinkProcessesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setProcessLinks($processLinks); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $links = []; - $request = (new BatchSearchLinkProcessesRequest()) - ->setParent($formattedParent) - ->setLinks($links); - $response = $gapicClient->batchSearchLinkProcessesAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getProcessLinks()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/BatchSearchLinkProcesses', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getLinks(); - $this->assertProtobufEquals($links, $actualValue); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/DataCatalogLineage/v1/tests/Unit/V1/LineageClientTest.php b/owl-bot-staging/DataCatalogLineage/v1/tests/Unit/V1/LineageClientTest.php deleted file mode 100644 index d704af8f5acd..000000000000 --- a/owl-bot-staging/DataCatalogLineage/v1/tests/Unit/V1/LineageClientTest.php +++ /dev/null @@ -1,1304 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return LineageClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new LineageClient($options); - } - - /** @test */ - public function batchSearchLinkProcessesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $processLinksElement = new ProcessLinks(); - $processLinks = [ - $processLinksElement, - ]; - $expectedResponse = new BatchSearchLinkProcessesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setProcessLinks($processLinks); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $links = []; - $response = $gapicClient->batchSearchLinkProcesses($formattedParent, $links); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getProcessLinks()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/BatchSearchLinkProcesses', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getLinks(); - $this->assertProtobufEquals($links, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function batchSearchLinkProcessesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $links = []; - try { - $gapicClient->batchSearchLinkProcesses($formattedParent, $links); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createLineageEventTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new LineageEvent(); - $expectedResponse->setName($name); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); - $lineageEvent = new LineageEvent(); - $lineageEventStartTime = new Timestamp(); - $lineageEvent->setStartTime($lineageEventStartTime); - $response = $gapicClient->createLineageEvent($formattedParent, $lineageEvent); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/CreateLineageEvent', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getLineageEvent(); - $this->assertProtobufEquals($lineageEvent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createLineageEventExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); - $lineageEvent = new LineageEvent(); - $lineageEventStartTime = new Timestamp(); - $lineageEvent->setStartTime($lineageEventStartTime); - try { - $gapicClient->createLineageEvent($formattedParent, $lineageEvent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createProcessTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Process(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $process = new Process(); - $response = $gapicClient->createProcess($formattedParent, $process); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/CreateProcess', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getProcess(); - $this->assertProtobufEquals($process, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createProcessExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $process = new Process(); - try { - $gapicClient->createProcess($formattedParent, $process); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createRunTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Run(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); - $run = new Run(); - $runStartTime = new Timestamp(); - $run->setStartTime($runStartTime); - $runState = State::UNKNOWN; - $run->setState($runState); - $response = $gapicClient->createRun($formattedParent, $run); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/CreateRun', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getRun(); - $this->assertProtobufEquals($run, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createRunExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); - $run = new Run(); - $runStartTime = new Timestamp(); - $run->setStartTime($runStartTime); - $runState = State::UNKNOWN; - $run->setState($runState); - try { - $gapicClient->createRun($formattedParent, $run); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteLineageEventTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->lineageEventName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]', '[LINEAGE_EVENT]'); - $gapicClient->deleteLineageEvent($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/DeleteLineageEvent', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteLineageEventExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->lineageEventName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]', '[LINEAGE_EVENT]'); - try { - $gapicClient->deleteLineageEvent($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteProcessTest() - { - $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/deleteProcessTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteProcessTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); - $response = $gapicClient->deleteProcess($formattedName); - $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.lineage.v1.Lineage/DeleteProcess', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteProcessTest'); - $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 deleteProcessExceptionTest() - { - $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/deleteProcessTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); - $response = $gapicClient->deleteProcess($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteProcessTest'); - 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 deleteRunTest() - { - $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/deleteRunTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteRunTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); - $response = $gapicClient->deleteRun($formattedName); - $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.lineage.v1.Lineage/DeleteRun', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteRunTest'); - $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 deleteRunExceptionTest() - { - $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/deleteRunTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); - $response = $gapicClient->deleteRun($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteRunTest'); - 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 getLineageEventTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new LineageEvent(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->lineageEventName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]', '[LINEAGE_EVENT]'); - $response = $gapicClient->getLineageEvent($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/GetLineageEvent', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLineageEventExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->lineageEventName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]', '[LINEAGE_EVENT]'); - try { - $gapicClient->getLineageEvent($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getProcessTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Process(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); - $response = $gapicClient->getProcess($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/GetProcess', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getProcessExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); - try { - $gapicClient->getProcess($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getRunTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Run(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); - $response = $gapicClient->getRun($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/GetRun', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getRunExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); - try { - $gapicClient->getRun($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLineageEventsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $lineageEventsElement = new LineageEvent(); - $lineageEvents = [ - $lineageEventsElement, - ]; - $expectedResponse = new ListLineageEventsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLineageEvents($lineageEvents); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); - $response = $gapicClient->listLineageEvents($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLineageEvents()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/ListLineageEvents', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLineageEventsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->runName('[PROJECT]', '[LOCATION]', '[PROCESS]', '[RUN]'); - try { - $gapicClient->listLineageEvents($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listProcessesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $processesElement = new Process(); - $processes = [ - $processesElement, - ]; - $expectedResponse = new ListProcessesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setProcesses($processes); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listProcesses($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getProcesses()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/ListProcesses', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listProcessesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listProcesses($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listRunsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $runsElement = new Run(); - $runs = [ - $runsElement, - ]; - $expectedResponse = new ListRunsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setRuns($runs); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); - $response = $gapicClient->listRuns($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getRuns()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/ListRuns', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listRunsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->processName('[PROJECT]', '[LOCATION]', '[PROCESS]'); - try { - $gapicClient->listRuns($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function processOpenLineageRunEventTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $process = 'process-309518737'; - $run = 'run113291'; - $expectedResponse = new ProcessOpenLineageRunEventResponse(); - $expectedResponse->setProcess($process); - $expectedResponse->setRun($run); - $transport->addResponse($expectedResponse); - // Mock request - $parent = 'parent-995424086'; - $openLineage = new Struct(); - $response = $gapicClient->processOpenLineageRunEvent($parent, $openLineage); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/ProcessOpenLineageRunEvent', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $actualValue = $actualRequestObject->getOpenLineage(); - $this->assertProtobufEquals($openLineage, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function processOpenLineageRunEventExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $parent = 'parent-995424086'; - $openLineage = new Struct(); - try { - $gapicClient->processOpenLineageRunEvent($parent, $openLineage); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function searchLinksTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $linksElement = new Link(); - $links = [ - $linksElement, - ]; - $expectedResponse = new SearchLinksResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLinks($links); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->searchLinks($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLinks()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/SearchLinks', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function searchLinksExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->searchLinks($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateProcessTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Process(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $process = new Process(); - $response = $gapicClient->updateProcess($process); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/UpdateProcess', $actualFuncCall); - $actualValue = $actualRequestObject->getProcess(); - $this->assertProtobufEquals($process, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateProcessExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $process = new Process(); - try { - $gapicClient->updateProcess($process); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateRunTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Run(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - // Mock request - $run = new Run(); - $runStartTime = new Timestamp(); - $run->setStartTime($runStartTime); - $runState = State::UNKNOWN; - $run->setState($runState); - $response = $gapicClient->updateRun($run); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.datacatalog.lineage.v1.Lineage/UpdateRun', $actualFuncCall); - $actualValue = $actualRequestObject->getRun(); - $this->assertProtobufEquals($run, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateRunExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $run = new Run(); - $runStartTime = new Timestamp(); - $run->setStartTime($runStartTime); - $runState = State::UNKNOWN; - $run->setState($runState); - try { - $gapicClient->updateRun($run); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -}