From 55c67f4cb0d728618d85e5ededbe83254c522f85 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 16 Aug 2023 22:55:29 +0000 Subject: [PATCH 1/2] feat: add UNAVAILABLE and QUEUED to state enum feat: add LOG_NONE to call_log_level feat: add status, labels, duration and state_error fields to Execution feat: add filter and order_by fields to ListExecutionsRequest PiperOrigin-RevId: 557594531 Source-Link: https://github.com/googleapis/googleapis/commit/6ba6f91298976f366f1b3eb2bfa4c5abe73f372c Source-Link: https://github.com/googleapis/googleapis-gen/commit/6c079c0825df88bccc6bc11135ca9ef719d717e6 Copy-Tag: eyJwIjoiV29ya2Zsb3dzLy5Pd2xCb3QueWFtbCIsImgiOiI2YzA3OWMwODI1ZGY4OGJjY2M2YmMxMTEzNWNhOWVmNzE5ZDcxN2U2In0= --- .../Workflows/Executions/V1/Executions.php | Bin 0 -> 5072 bytes .../Executions/V1/CancelExecutionRequest.php | 93 ++ .../Executions/V1/CreateExecutionRequest.php | 139 +++ .../Workflows/Executions/V1/Execution.php | 608 +++++++++++++ .../Executions/V1/Execution/CallLogLevel.php | 73 ++ .../Executions/V1/Execution/Error.php | 148 ++++ .../Executions/V1/Execution/StackTrace.php | 70 ++ .../V1/Execution/StackTraceElement.php | 148 ++++ .../Execution/StackTraceElement/Position.php | 144 +++ .../Executions/V1/Execution/State.php | 93 ++ .../Executions/V1/Execution/StateError.php | 104 +++ .../V1/Execution/StateError/Type.php | 57 ++ .../Executions/V1/Execution/Status.php | 94 ++ .../Executions/V1/Execution/Status/Step.php | 104 +++ .../Workflows/Executions/V1/ExecutionView.php | 63 ++ .../Executions/V1/GetExecutionRequest.php | 131 +++ .../Executions/V1/ListExecutionsRequest.php | 322 +++++++ .../Executions/V1/ListExecutionsResponse.php | 107 +++ .../V1/ExecutionsClient/cancel_execution.php | 78 ++ .../V1/ExecutionsClient/create_execution.php | 75 ++ .../V1/ExecutionsClient/get_execution.php | 78 ++ .../V1/ExecutionsClient/list_executions.php | 80 ++ .../BaseClient/ExecutionsBaseClient.php | 349 ++++++++ .../v1/src/V1/Client/ExecutionsClient.php | 40 + .../Executions/v1/src/V1/gapic_metadata.json | 38 + .../resources/executions_client_config.json | 42 + .../executions_descriptor_config.php | 68 ++ .../executions_rest_client_config.php | 54 ++ .../Unit/V1/Client/ExecutionsClientTest.php | 389 ++++++++ .../Executions/V1Beta/Executions.php | Bin 0 -> 3803 bytes .../V1beta/CancelExecutionRequest.php | 77 ++ .../V1beta/CreateExecutionRequest.php | 121 +++ .../Workflows/Executions/V1beta/Execution.php | 359 ++++++++ .../Executions/V1beta/Execution/Error.php | 104 +++ .../Executions/V1beta/Execution/State.php | 79 ++ .../Executions/V1beta/ExecutionView.php | 63 ++ .../Executions/V1beta/GetExecutionRequest.php | 115 +++ .../V1beta/ListExecutionsRequest.php | 207 +++++ .../V1beta/ListExecutionsResponse.php | 107 +++ .../ExecutionsClient/cancel_execution.php | 73 ++ .../ExecutionsClient/create_execution.php | 71 ++ .../V1beta/ExecutionsClient/get_execution.php | 73 ++ .../ExecutionsClient/list_executions.php | 75 ++ .../v1beta/src/V1beta/ExecutionsClient.php | 36 + .../V1beta/Gapic/ExecutionsGapicClient.php | 516 +++++++++++ .../v1beta/src/V1beta/gapic_metadata.json | 38 + .../resources/executions_client_config.json | 46 + .../executions_descriptor_config.php | 18 + .../executions_rest_client_config.php | 54 ++ .../Unit/V1beta/ExecutionsClientTest.php | 332 +++++++ .../Google/Cloud/Workflows/V1/Workflows.php | Bin 0 -> 4839 bytes .../Workflows/V1/CreateWorkflowRequest.php | 201 +++++ .../Workflows/V1/DeleteWorkflowRequest.php | 88 ++ .../Cloud/Workflows/V1/GetWorkflowRequest.php | 137 +++ .../Workflows/V1/ListWorkflowsRequest.php | 260 ++++++ .../Workflows/V1/ListWorkflowsResponse.php | 141 +++ .../Cloud/Workflows/V1/OperationMetadata.php | 223 +++++ .../Workflows/V1/UpdateWorkflowRequest.php | 143 +++ .../Google/Cloud/Workflows/V1/Workflow.php | 713 +++++++++++++++ .../Workflows/V1/Workflow/CallLogLevel.php | 73 ++ .../Cloud/Workflows/V1/Workflow/State.php | 64 ++ .../Workflows/V1/Workflow/StateError.php | 104 +++ .../Workflows/V1/Workflow/StateError/Type.php | 57 ++ .../V1/WorkflowsClient/create_workflow.php | 98 +++ .../V1/WorkflowsClient/delete_workflow.php | 83 ++ .../V1/WorkflowsClient/get_location.php | 57 ++ .../V1/WorkflowsClient/get_workflow.php | 72 ++ .../V1/WorkflowsClient/list_locations.php | 62 ++ .../V1/WorkflowsClient/list_workflows.php | 78 ++ .../V1/WorkflowsClient/update_workflow.php | 75 ++ .../Client/BaseClient/WorkflowsBaseClient.php | 494 +++++++++++ .../v1/src/V1/Client/WorkflowsClient.php | 40 + .../Workflows/v1/src/V1/gapic_metadata.json | 53 ++ .../V1/resources/workflows_client_config.json | 57 ++ .../resources/workflows_descriptor_config.php | 137 +++ .../workflows_rest_client_config.php | 129 +++ .../Unit/V1/Client/WorkflowsClientTest.php | 829 ++++++++++++++++++ .../Cloud/Workflows/V1Beta/Workflows.php | Bin 0 -> 4084 bytes .../V1beta/CreateWorkflowRequest.php | 175 ++++ .../V1beta/DeleteWorkflowRequest.php | 73 ++ .../Workflows/V1beta/GetWorkflowRequest.php | 72 ++ .../Workflows/V1beta/ListWorkflowsRequest.php | 245 ++++++ .../V1beta/ListWorkflowsResponse.php | 141 +++ .../Workflows/V1beta/OperationMetadata.php | 223 +++++ .../V1beta/UpdateWorkflowRequest.php | 127 +++ .../Cloud/Workflows/V1beta/Workflow.php | 503 +++++++++++ .../Cloud/Workflows/V1beta/Workflow/State.php | 58 ++ .../WorkflowsClient/create_workflow.php | 93 ++ .../WorkflowsClient/delete_workflow.php | 78 ++ .../V1beta/WorkflowsClient/get_workflow.php | 67 ++ .../V1beta/WorkflowsClient/list_workflows.php | 73 ++ .../WorkflowsClient/update_workflow.php | 72 ++ .../src/V1beta/Gapic/WorkflowsGapicClient.php | 714 +++++++++++++++ .../v1beta/src/V1beta/WorkflowsClient.php | 36 + .../v1beta/src/V1beta/gapic_metadata.json | 43 + .../resources/workflows_client_config.json | 47 + .../resources/workflows_descriptor_config.php | 48 + .../workflows_rest_client_config.php | 129 +++ .../tests/Unit/V1beta/WorkflowsClientTest.php | 582 ++++++++++++ 99 files changed, 14420 insertions(+) create mode 100644 owl-bot-staging/Workflows/Executions/v1/proto/src/GPBMetadata/Google/Cloud/Workflows/Executions/V1/Executions.php create mode 100644 owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/CancelExecutionRequest.php create mode 100644 owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/CreateExecutionRequest.php create mode 100644 owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution.php create mode 100644 owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/CallLogLevel.php create mode 100644 owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/Error.php create mode 100644 owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/StackTrace.php create mode 100644 owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/StackTraceElement.php create mode 100644 owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/StackTraceElement/Position.php create mode 100644 owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/State.php create mode 100644 owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/StateError.php create mode 100644 owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/StateError/Type.php create mode 100644 owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/Status.php create mode 100644 owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/Status/Step.php create mode 100644 owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/ExecutionView.php create mode 100644 owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/GetExecutionRequest.php create mode 100644 owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/ListExecutionsRequest.php create mode 100644 owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/ListExecutionsResponse.php create mode 100644 owl-bot-staging/Workflows/Executions/v1/samples/V1/ExecutionsClient/cancel_execution.php create mode 100644 owl-bot-staging/Workflows/Executions/v1/samples/V1/ExecutionsClient/create_execution.php create mode 100644 owl-bot-staging/Workflows/Executions/v1/samples/V1/ExecutionsClient/get_execution.php create mode 100644 owl-bot-staging/Workflows/Executions/v1/samples/V1/ExecutionsClient/list_executions.php create mode 100644 owl-bot-staging/Workflows/Executions/v1/src/V1/Client/BaseClient/ExecutionsBaseClient.php create mode 100644 owl-bot-staging/Workflows/Executions/v1/src/V1/Client/ExecutionsClient.php create mode 100644 owl-bot-staging/Workflows/Executions/v1/src/V1/gapic_metadata.json create mode 100644 owl-bot-staging/Workflows/Executions/v1/src/V1/resources/executions_client_config.json create mode 100644 owl-bot-staging/Workflows/Executions/v1/src/V1/resources/executions_descriptor_config.php create mode 100644 owl-bot-staging/Workflows/Executions/v1/src/V1/resources/executions_rest_client_config.php create mode 100644 owl-bot-staging/Workflows/Executions/v1/tests/Unit/V1/Client/ExecutionsClientTest.php create mode 100644 owl-bot-staging/Workflows/Executions/v1beta/proto/src/GPBMetadata/Google/Cloud/Workflows/Executions/V1Beta/Executions.php create mode 100644 owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/CancelExecutionRequest.php create mode 100644 owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/CreateExecutionRequest.php create mode 100644 owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/Execution.php create mode 100644 owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/Execution/Error.php create mode 100644 owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/Execution/State.php create mode 100644 owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/ExecutionView.php create mode 100644 owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/GetExecutionRequest.php create mode 100644 owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/ListExecutionsRequest.php create mode 100644 owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/ListExecutionsResponse.php create mode 100644 owl-bot-staging/Workflows/Executions/v1beta/samples/V1beta/ExecutionsClient/cancel_execution.php create mode 100644 owl-bot-staging/Workflows/Executions/v1beta/samples/V1beta/ExecutionsClient/create_execution.php create mode 100644 owl-bot-staging/Workflows/Executions/v1beta/samples/V1beta/ExecutionsClient/get_execution.php create mode 100644 owl-bot-staging/Workflows/Executions/v1beta/samples/V1beta/ExecutionsClient/list_executions.php create mode 100644 owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/ExecutionsClient.php create mode 100644 owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/Gapic/ExecutionsGapicClient.php create mode 100644 owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/gapic_metadata.json create mode 100644 owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/resources/executions_client_config.json create mode 100644 owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/resources/executions_descriptor_config.php create mode 100644 owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/resources/executions_rest_client_config.php create mode 100644 owl-bot-staging/Workflows/Executions/v1beta/tests/Unit/V1beta/ExecutionsClientTest.php create mode 100644 owl-bot-staging/Workflows/v1/proto/src/GPBMetadata/Google/Cloud/Workflows/V1/Workflows.php create mode 100644 owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/CreateWorkflowRequest.php create mode 100644 owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/DeleteWorkflowRequest.php create mode 100644 owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/GetWorkflowRequest.php create mode 100644 owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/ListWorkflowsRequest.php create mode 100644 owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/ListWorkflowsResponse.php create mode 100644 owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/OperationMetadata.php create mode 100644 owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/UpdateWorkflowRequest.php create mode 100644 owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/Workflow.php create mode 100644 owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/Workflow/CallLogLevel.php create mode 100644 owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/Workflow/State.php create mode 100644 owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/Workflow/StateError.php create mode 100644 owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/Workflow/StateError/Type.php create mode 100644 owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/create_workflow.php create mode 100644 owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/delete_workflow.php create mode 100644 owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/get_location.php create mode 100644 owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/get_workflow.php create mode 100644 owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/list_locations.php create mode 100644 owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/list_workflows.php create mode 100644 owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/update_workflow.php create mode 100644 owl-bot-staging/Workflows/v1/src/V1/Client/BaseClient/WorkflowsBaseClient.php create mode 100644 owl-bot-staging/Workflows/v1/src/V1/Client/WorkflowsClient.php create mode 100644 owl-bot-staging/Workflows/v1/src/V1/gapic_metadata.json create mode 100644 owl-bot-staging/Workflows/v1/src/V1/resources/workflows_client_config.json create mode 100644 owl-bot-staging/Workflows/v1/src/V1/resources/workflows_descriptor_config.php create mode 100644 owl-bot-staging/Workflows/v1/src/V1/resources/workflows_rest_client_config.php create mode 100644 owl-bot-staging/Workflows/v1/tests/Unit/V1/Client/WorkflowsClientTest.php create mode 100644 owl-bot-staging/Workflows/v1beta/proto/src/GPBMetadata/Google/Cloud/Workflows/V1Beta/Workflows.php create mode 100644 owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/CreateWorkflowRequest.php create mode 100644 owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/DeleteWorkflowRequest.php create mode 100644 owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/GetWorkflowRequest.php create mode 100644 owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/ListWorkflowsRequest.php create mode 100644 owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/ListWorkflowsResponse.php create mode 100644 owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/OperationMetadata.php create mode 100644 owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/UpdateWorkflowRequest.php create mode 100644 owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/Workflow.php create mode 100644 owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/Workflow/State.php create mode 100644 owl-bot-staging/Workflows/v1beta/samples/V1beta/WorkflowsClient/create_workflow.php create mode 100644 owl-bot-staging/Workflows/v1beta/samples/V1beta/WorkflowsClient/delete_workflow.php create mode 100644 owl-bot-staging/Workflows/v1beta/samples/V1beta/WorkflowsClient/get_workflow.php create mode 100644 owl-bot-staging/Workflows/v1beta/samples/V1beta/WorkflowsClient/list_workflows.php create mode 100644 owl-bot-staging/Workflows/v1beta/samples/V1beta/WorkflowsClient/update_workflow.php create mode 100644 owl-bot-staging/Workflows/v1beta/src/V1beta/Gapic/WorkflowsGapicClient.php create mode 100644 owl-bot-staging/Workflows/v1beta/src/V1beta/WorkflowsClient.php create mode 100644 owl-bot-staging/Workflows/v1beta/src/V1beta/gapic_metadata.json create mode 100644 owl-bot-staging/Workflows/v1beta/src/V1beta/resources/workflows_client_config.json create mode 100644 owl-bot-staging/Workflows/v1beta/src/V1beta/resources/workflows_descriptor_config.php create mode 100644 owl-bot-staging/Workflows/v1beta/src/V1beta/resources/workflows_rest_client_config.php create mode 100644 owl-bot-staging/Workflows/v1beta/tests/Unit/V1beta/WorkflowsClientTest.php diff --git a/owl-bot-staging/Workflows/Executions/v1/proto/src/GPBMetadata/Google/Cloud/Workflows/Executions/V1/Executions.php b/owl-bot-staging/Workflows/Executions/v1/proto/src/GPBMetadata/Google/Cloud/Workflows/Executions/V1/Executions.php new file mode 100644 index 0000000000000000000000000000000000000000..84359f945f1b3db4f98924a6c9c0e61910568c53 GIT binary patch literal 5072 zcmb_gOK;m&79Lu%A|1aJrfF3zI*ghkj?+jJ2OYFZG6gNut{TO1E!pWq083FdZ0~i)MnoP+k$bxgBm}5awQhcWkf`gEq;*Mh3H4p;Uf?%V za1md1o&lch7#-QNY=#2DU#$*f8mjm;!J26hi%uuAWe~HsK@PPO!*-_=-6LTcP3&Zh z{ictFivdnERqI{xPx8XE{*2VG_a(FDEv*A=2T}E8$YWMl9t@ zFNAYUcf3v`%=m`Vzn38w6HvSiX-4RRAPK9vjnubtO1ukz7`s$ul7%^3SXeKXxmm6Q z&6eX-aG^VpC037%q$U&j6J#Ub3yXos%THN}YK0rA!#txODWq}x^7KykYT9#UIBt2{yeQV z2Al8kC{UTHb&2T}7Nisw#=U8kH3DhHqVAd4hJ_%XD#v&!aIZS8#vrRhpo?D#a2cQJ zM{O6UlwuN=WN{JF9wiPhba4ePxi(HYix+rK>~tXO*d7iY+bZw^es=~(MvaztLyg5Z zAsbyYPfTW*Q7$DeLk6d|e{2Oz3+_!~4d`LuMXIO)41*C{NHZRghw>}|@^gDx{0!y; z_!ugVc4pdIZwQlaV>kVj2HxewW{@%cNTm$h5U5!)76MiLLVyfQpzn!$u%!F0i^)=1 zrlJ6+t}w0+$xfW&YmjFD$$ST$E-nYw-g3pi3jxZM#5nZuU}IpF^WBdiP0t)&E6eL| z&j5L-y4*%JrCX3@|KbafZ-20>sQWvuU8PpvswcQej!+8aYHM!AH z8_jLCp&TfUu>dc_5?f+h*uEBeas^h{qafy%+T3Y;fc`8(mOb2Q?kM?G^-JLg`Evno zMNKp@Yx!)#G3%A_*jtGkzSzPk_*bG+uW}wDC5r4x8@JY3Jg^C=N)05L8RT`N=iB)$YI7B(0)5o`nNbQ~N>OQq~f!WG&G_ z){>p$i5#{B@jC%l#>!co(7iFSD7b0sw)Alj&vxlK;;9bV^F+>bNM4T#CH_}{#Uv@j zwStYnv8yLci8uS4ShS+Yi{GjXy;#b%DC6-2XDl7r%#DVnMt z_)-inBI8mA;nChm<;AwNg1fJslrenoke;N2A-0snNde9&h|8z$#AO ziE_QMGUWR%`yR6^eE1H3gA3m=*$f}p2}TV)t>EMw`6}gf?+sU-?hmpy$+W#6lX!-6 mK{tca)V_No{+#eS|MZjiQsm(g%+R0ll_=QBzvf)P1;8(RkeZPI literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/CancelExecutionRequest.php b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/CancelExecutionRequest.php new file mode 100644 index 000000000000..2db4641d945c --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/CancelExecutionRequest.php @@ -0,0 +1,93 @@ +google.cloud.workflows.executions.v1.CancelExecutionRequest + */ +class CancelExecutionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the execution to be cancelled. + * Format: + * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the execution to be cancelled. + * Format: + * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + * Please see {@see ExecutionsClient::executionName()} for help formatting this field. + * + * @return \Google\Cloud\Workflows\Executions\V1\CancelExecutionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the execution to be cancelled. + * Format: + * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Workflows\Executions\V1\Executions::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the execution to be cancelled. + * Format: + * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the execution to be cancelled. + * Format: + * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + * + * 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/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/CreateExecutionRequest.php b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/CreateExecutionRequest.php new file mode 100644 index 000000000000..01da8af0af3b --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/CreateExecutionRequest.php @@ -0,0 +1,139 @@ +google.cloud.workflows.executions.v1.CreateExecutionRequest + */ +class CreateExecutionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the workflow for which an execution should be created. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * The latest revision of the workflow will be used. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Execution to be created. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $execution = null; + + /** + * @param string $parent Required. Name of the workflow for which an execution should be created. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * The latest revision of the workflow will be used. Please see + * {@see ExecutionsClient::workflowName()} for help formatting this field. + * @param \Google\Cloud\Workflows\Executions\V1\Execution $execution Required. Execution to be created. + * + * @return \Google\Cloud\Workflows\Executions\V1\CreateExecutionRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Workflows\Executions\V1\Execution $execution): self + { + return (new self()) + ->setParent($parent) + ->setExecution($execution); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Name of the workflow for which an execution should be created. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * The latest revision of the workflow will be used. + * @type \Google\Cloud\Workflows\Executions\V1\Execution $execution + * Required. Execution to be created. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Workflows\Executions\V1\Executions::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the workflow for which an execution should be created. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * The latest revision of the workflow will be used. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Name of the workflow for which an execution should be created. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * The latest revision of the workflow will be used. + * + * 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. Execution to be created. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Workflows\Executions\V1\Execution|null + */ + public function getExecution() + { + return $this->execution; + } + + public function hasExecution() + { + return isset($this->execution); + } + + public function clearExecution() + { + unset($this->execution); + } + + /** + * Required. Execution to be created. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Workflows\Executions\V1\Execution $var + * @return $this + */ + public function setExecution($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Workflows\Executions\V1\Execution::class); + $this->execution = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution.php b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution.php new file mode 100644 index 000000000000..cd76e9a60ca6 --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution.php @@ -0,0 +1,608 @@ +google.cloud.workflows.executions.v1.Execution + */ +class Execution extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The resource name of the execution. + * Format: + * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Output only. Marks the beginning of execution. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $start_time = null; + /** + * Output only. Marks the end of execution, successful or not. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. Measures the duration of the execution. + * + * Generated from protobuf field .google.protobuf.Duration duration = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $duration = null; + /** + * Output only. Current state of the execution. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Input parameters of the execution represented as a JSON string. + * The size limit is 32KB. + * *Note*: If you are using the REST API directly to run your workflow, you + * must escape any JSON string value of `argument`. Example: + * `'{"argument":"{\"firstName\":\"FIRST\",\"lastName\":\"LAST\"}"}'` + * + * Generated from protobuf field string argument = 5; + */ + protected $argument = ''; + /** + * Output only. Output of the execution represented as a JSON string. The + * value can only be present if the execution's state is `SUCCEEDED`. + * + * Generated from protobuf field string result = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $result = ''; + /** + * Output only. The error which caused the execution to finish prematurely. + * The value is only present if the execution's state is `FAILED` + * or `CANCELLED`. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $error = null; + /** + * Output only. Revision of the workflow this execution is using. + * + * Generated from protobuf field string workflow_revision_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $workflow_revision_id = ''; + /** + * The call logging level associated to this execution. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.CallLogLevel call_log_level = 9; + */ + protected $call_log_level = 0; + /** + * Output only. Status tracks the current steps and progress data of this + * execution. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.Status status = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status = null; + /** + * Labels associated with this execution. + * Labels can contain at most 64 entries. Keys and values can be no longer + * than 63 characters and can only contain lowercase letters, numeric + * characters, underscores, and dashes. Label keys must start with a letter. + * International characters are allowed. + * By default, labels are inherited from the workflow but are overridden by + * any labels associated with the execution. + * + * Generated from protobuf field map labels = 11; + */ + private $labels; + /** + * Output only. Error regarding the state of the Execution resource. For + * example, this field will have error details if the execution data is + * unavailable due to revoked KMS key permissions. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.StateError state_error = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state_error = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The resource name of the execution. + * Format: + * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + * @type \Google\Protobuf\Timestamp $start_time + * Output only. Marks the beginning of execution. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. Marks the end of execution, successful or not. + * @type \Google\Protobuf\Duration $duration + * Output only. Measures the duration of the execution. + * @type int $state + * Output only. Current state of the execution. + * @type string $argument + * Input parameters of the execution represented as a JSON string. + * The size limit is 32KB. + * *Note*: If you are using the REST API directly to run your workflow, you + * must escape any JSON string value of `argument`. Example: + * `'{"argument":"{\"firstName\":\"FIRST\",\"lastName\":\"LAST\"}"}'` + * @type string $result + * Output only. Output of the execution represented as a JSON string. The + * value can only be present if the execution's state is `SUCCEEDED`. + * @type \Google\Cloud\Workflows\Executions\V1\Execution\Error $error + * Output only. The error which caused the execution to finish prematurely. + * The value is only present if the execution's state is `FAILED` + * or `CANCELLED`. + * @type string $workflow_revision_id + * Output only. Revision of the workflow this execution is using. + * @type int $call_log_level + * The call logging level associated to this execution. + * @type \Google\Cloud\Workflows\Executions\V1\Execution\Status $status + * Output only. Status tracks the current steps and progress data of this + * execution. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels associated with this execution. + * Labels can contain at most 64 entries. Keys and values can be no longer + * than 63 characters and can only contain lowercase letters, numeric + * characters, underscores, and dashes. Label keys must start with a letter. + * International characters are allowed. + * By default, labels are inherited from the workflow but are overridden by + * any labels associated with the execution. + * @type \Google\Cloud\Workflows\Executions\V1\Execution\StateError $state_error + * Output only. Error regarding the state of the Execution resource. For + * example, this field will have error details if the execution data is + * unavailable due to revoked KMS key permissions. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Workflows\Executions\V1\Executions::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The resource name of the execution. + * Format: + * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The resource name of the execution. + * Format: + * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Marks the beginning of execution. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Output only. Marks the beginning of execution. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Output only. Marks the end of execution, successful or not. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. Marks the end of execution, successful or not. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. Measures the duration of the execution. + * + * Generated from protobuf field .google.protobuf.Duration duration = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Duration|null + */ + public function getDuration() + { + return $this->duration; + } + + public function hasDuration() + { + return isset($this->duration); + } + + public function clearDuration() + { + unset($this->duration); + } + + /** + * Output only. Measures the duration of the execution. + * + * Generated from protobuf field .google.protobuf.Duration duration = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->duration = $var; + + return $this; + } + + /** + * Output only. Current state of the execution. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. Current state of the execution. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Workflows\Executions\V1\Execution\State::class); + $this->state = $var; + + return $this; + } + + /** + * Input parameters of the execution represented as a JSON string. + * The size limit is 32KB. + * *Note*: If you are using the REST API directly to run your workflow, you + * must escape any JSON string value of `argument`. Example: + * `'{"argument":"{\"firstName\":\"FIRST\",\"lastName\":\"LAST\"}"}'` + * + * Generated from protobuf field string argument = 5; + * @return string + */ + public function getArgument() + { + return $this->argument; + } + + /** + * Input parameters of the execution represented as a JSON string. + * The size limit is 32KB. + * *Note*: If you are using the REST API directly to run your workflow, you + * must escape any JSON string value of `argument`. Example: + * `'{"argument":"{\"firstName\":\"FIRST\",\"lastName\":\"LAST\"}"}'` + * + * Generated from protobuf field string argument = 5; + * @param string $var + * @return $this + */ + public function setArgument($var) + { + GPBUtil::checkString($var, True); + $this->argument = $var; + + return $this; + } + + /** + * Output only. Output of the execution represented as a JSON string. The + * value can only be present if the execution's state is `SUCCEEDED`. + * + * Generated from protobuf field string result = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getResult() + { + return $this->result; + } + + /** + * Output only. Output of the execution represented as a JSON string. The + * value can only be present if the execution's state is `SUCCEEDED`. + * + * Generated from protobuf field string result = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setResult($var) + { + GPBUtil::checkString($var, True); + $this->result = $var; + + return $this; + } + + /** + * Output only. The error which caused the execution to finish prematurely. + * The value is only present if the execution's state is `FAILED` + * or `CANCELLED`. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Workflows\Executions\V1\Execution\Error|null + */ + public function getError() + { + return $this->error; + } + + public function hasError() + { + return isset($this->error); + } + + public function clearError() + { + unset($this->error); + } + + /** + * Output only. The error which caused the execution to finish prematurely. + * The value is only present if the execution's state is `FAILED` + * or `CANCELLED`. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Workflows\Executions\V1\Execution\Error $var + * @return $this + */ + public function setError($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Workflows\Executions\V1\Execution\Error::class); + $this->error = $var; + + return $this; + } + + /** + * Output only. Revision of the workflow this execution is using. + * + * Generated from protobuf field string workflow_revision_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getWorkflowRevisionId() + { + return $this->workflow_revision_id; + } + + /** + * Output only. Revision of the workflow this execution is using. + * + * Generated from protobuf field string workflow_revision_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setWorkflowRevisionId($var) + { + GPBUtil::checkString($var, True); + $this->workflow_revision_id = $var; + + return $this; + } + + /** + * The call logging level associated to this execution. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.CallLogLevel call_log_level = 9; + * @return int + */ + public function getCallLogLevel() + { + return $this->call_log_level; + } + + /** + * The call logging level associated to this execution. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.CallLogLevel call_log_level = 9; + * @param int $var + * @return $this + */ + public function setCallLogLevel($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Workflows\Executions\V1\Execution\CallLogLevel::class); + $this->call_log_level = $var; + + return $this; + } + + /** + * Output only. Status tracks the current steps and progress data of this + * execution. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.Status status = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Workflows\Executions\V1\Execution\Status|null + */ + public function getStatus() + { + return $this->status; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * Output only. Status tracks the current steps and progress data of this + * execution. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.Status status = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Workflows\Executions\V1\Execution\Status $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Workflows\Executions\V1\Execution\Status::class); + $this->status = $var; + + return $this; + } + + /** + * Labels associated with this execution. + * Labels can contain at most 64 entries. Keys and values can be no longer + * than 63 characters and can only contain lowercase letters, numeric + * characters, underscores, and dashes. Label keys must start with a letter. + * International characters are allowed. + * By default, labels are inherited from the workflow but are overridden by + * any labels associated with the execution. + * + * Generated from protobuf field map labels = 11; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels associated with this execution. + * Labels can contain at most 64 entries. Keys and values can be no longer + * than 63 characters and can only contain lowercase letters, numeric + * characters, underscores, and dashes. Label keys must start with a letter. + * International characters are allowed. + * By default, labels are inherited from the workflow but are overridden by + * any labels associated with the execution. + * + * Generated from protobuf field map labels = 11; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Output only. Error regarding the state of the Execution resource. For + * example, this field will have error details if the execution data is + * unavailable due to revoked KMS key permissions. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.StateError state_error = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Workflows\Executions\V1\Execution\StateError|null + */ + public function getStateError() + { + return $this->state_error; + } + + public function hasStateError() + { + return isset($this->state_error); + } + + public function clearStateError() + { + unset($this->state_error); + } + + /** + * Output only. Error regarding the state of the Execution resource. For + * example, this field will have error details if the execution data is + * unavailable due to revoked KMS key permissions. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.StateError state_error = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Workflows\Executions\V1\Execution\StateError $var + * @return $this + */ + public function setStateError($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Workflows\Executions\V1\Execution\StateError::class); + $this->state_error = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/CallLogLevel.php b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/CallLogLevel.php new file mode 100644 index 000000000000..ff6b5532dbfb --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/CallLogLevel.php @@ -0,0 +1,73 @@ +google.cloud.workflows.executions.v1.Execution.CallLogLevel + */ +class CallLogLevel +{ + /** + * No call logging level specified. + * + * Generated from protobuf enum CALL_LOG_LEVEL_UNSPECIFIED = 0; + */ + const CALL_LOG_LEVEL_UNSPECIFIED = 0; + /** + * Log all call steps within workflows, all call returns, and all exceptions + * raised. + * + * Generated from protobuf enum LOG_ALL_CALLS = 1; + */ + const LOG_ALL_CALLS = 1; + /** + * Log only exceptions that are raised from call steps within workflows. + * + * Generated from protobuf enum LOG_ERRORS_ONLY = 2; + */ + const LOG_ERRORS_ONLY = 2; + /** + * Explicitly log nothing. + * + * Generated from protobuf enum LOG_NONE = 3; + */ + const LOG_NONE = 3; + + private static $valueToName = [ + self::CALL_LOG_LEVEL_UNSPECIFIED => 'CALL_LOG_LEVEL_UNSPECIFIED', + self::LOG_ALL_CALLS => 'LOG_ALL_CALLS', + self::LOG_ERRORS_ONLY => 'LOG_ERRORS_ONLY', + self::LOG_NONE => 'LOG_NONE', + ]; + + 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(CallLogLevel::class, \Google\Cloud\Workflows\Executions\V1\Execution_CallLogLevel::class); + diff --git a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/Error.php b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/Error.php new file mode 100644 index 000000000000..33cfcd89b58e --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/Error.php @@ -0,0 +1,148 @@ +google.cloud.workflows.executions.v1.Execution.Error + */ +class Error extends \Google\Protobuf\Internal\Message +{ + /** + * Error message and data returned represented as a JSON string. + * + * Generated from protobuf field string payload = 1; + */ + protected $payload = ''; + /** + * Human-readable stack trace string. + * + * Generated from protobuf field string context = 2; + */ + protected $context = ''; + /** + * Stack trace with detailed information of where error was generated. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.StackTrace stack_trace = 3; + */ + protected $stack_trace = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $payload + * Error message and data returned represented as a JSON string. + * @type string $context + * Human-readable stack trace string. + * @type \Google\Cloud\Workflows\Executions\V1\Execution\StackTrace $stack_trace + * Stack trace with detailed information of where error was generated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Workflows\Executions\V1\Executions::initOnce(); + parent::__construct($data); + } + + /** + * Error message and data returned represented as a JSON string. + * + * Generated from protobuf field string payload = 1; + * @return string + */ + public function getPayload() + { + return $this->payload; + } + + /** + * Error message and data returned represented as a JSON string. + * + * Generated from protobuf field string payload = 1; + * @param string $var + * @return $this + */ + public function setPayload($var) + { + GPBUtil::checkString($var, True); + $this->payload = $var; + + return $this; + } + + /** + * Human-readable stack trace string. + * + * Generated from protobuf field string context = 2; + * @return string + */ + public function getContext() + { + return $this->context; + } + + /** + * Human-readable stack trace string. + * + * Generated from protobuf field string context = 2; + * @param string $var + * @return $this + */ + public function setContext($var) + { + GPBUtil::checkString($var, True); + $this->context = $var; + + return $this; + } + + /** + * Stack trace with detailed information of where error was generated. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.StackTrace stack_trace = 3; + * @return \Google\Cloud\Workflows\Executions\V1\Execution\StackTrace|null + */ + public function getStackTrace() + { + return $this->stack_trace; + } + + public function hasStackTrace() + { + return isset($this->stack_trace); + } + + public function clearStackTrace() + { + unset($this->stack_trace); + } + + /** + * Stack trace with detailed information of where error was generated. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.StackTrace stack_trace = 3; + * @param \Google\Cloud\Workflows\Executions\V1\Execution\StackTrace $var + * @return $this + */ + public function setStackTrace($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Workflows\Executions\V1\Execution\StackTrace::class); + $this->stack_trace = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Error::class, \Google\Cloud\Workflows\Executions\V1\Execution_Error::class); + diff --git a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/StackTrace.php b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/StackTrace.php new file mode 100644 index 000000000000..ba74ffea90a7 --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/StackTrace.php @@ -0,0 +1,70 @@ +google.cloud.workflows.executions.v1.Execution.StackTrace + */ +class StackTrace extends \Google\Protobuf\Internal\Message +{ + /** + * An array of stack elements. + * + * Generated from protobuf field repeated .google.cloud.workflows.executions.v1.Execution.StackTraceElement elements = 1; + */ + private $elements; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Workflows\Executions\V1\Execution\StackTraceElement>|\Google\Protobuf\Internal\RepeatedField $elements + * An array of stack elements. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Workflows\Executions\V1\Executions::initOnce(); + parent::__construct($data); + } + + /** + * An array of stack elements. + * + * Generated from protobuf field repeated .google.cloud.workflows.executions.v1.Execution.StackTraceElement elements = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getElements() + { + return $this->elements; + } + + /** + * An array of stack elements. + * + * Generated from protobuf field repeated .google.cloud.workflows.executions.v1.Execution.StackTraceElement elements = 1; + * @param array<\Google\Cloud\Workflows\Executions\V1\Execution\StackTraceElement>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setElements($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Workflows\Executions\V1\Execution\StackTraceElement::class); + $this->elements = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(StackTrace::class, \Google\Cloud\Workflows\Executions\V1\Execution_StackTrace::class); + diff --git a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/StackTraceElement.php b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/StackTraceElement.php new file mode 100644 index 000000000000..54ffcdb61d1a --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/StackTraceElement.php @@ -0,0 +1,148 @@ +google.cloud.workflows.executions.v1.Execution.StackTraceElement + */ +class StackTraceElement extends \Google\Protobuf\Internal\Message +{ + /** + * The step the error occurred at. + * + * Generated from protobuf field string step = 1; + */ + protected $step = ''; + /** + * The routine where the error occurred. + * + * Generated from protobuf field string routine = 2; + */ + protected $routine = ''; + /** + * The source position information of the stack trace element. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.StackTraceElement.Position position = 3; + */ + protected $position = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $step + * The step the error occurred at. + * @type string $routine + * The routine where the error occurred. + * @type \Google\Cloud\Workflows\Executions\V1\Execution\StackTraceElement\Position $position + * The source position information of the stack trace element. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Workflows\Executions\V1\Executions::initOnce(); + parent::__construct($data); + } + + /** + * The step the error occurred at. + * + * Generated from protobuf field string step = 1; + * @return string + */ + public function getStep() + { + return $this->step; + } + + /** + * The step the error occurred at. + * + * Generated from protobuf field string step = 1; + * @param string $var + * @return $this + */ + public function setStep($var) + { + GPBUtil::checkString($var, True); + $this->step = $var; + + return $this; + } + + /** + * The routine where the error occurred. + * + * Generated from protobuf field string routine = 2; + * @return string + */ + public function getRoutine() + { + return $this->routine; + } + + /** + * The routine where the error occurred. + * + * Generated from protobuf field string routine = 2; + * @param string $var + * @return $this + */ + public function setRoutine($var) + { + GPBUtil::checkString($var, True); + $this->routine = $var; + + return $this; + } + + /** + * The source position information of the stack trace element. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.StackTraceElement.Position position = 3; + * @return \Google\Cloud\Workflows\Executions\V1\Execution\StackTraceElement\Position|null + */ + public function getPosition() + { + return $this->position; + } + + public function hasPosition() + { + return isset($this->position); + } + + public function clearPosition() + { + unset($this->position); + } + + /** + * The source position information of the stack trace element. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.StackTraceElement.Position position = 3; + * @param \Google\Cloud\Workflows\Executions\V1\Execution\StackTraceElement\Position $var + * @return $this + */ + public function setPosition($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Workflows\Executions\V1\Execution\StackTraceElement\Position::class); + $this->position = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(StackTraceElement::class, \Google\Cloud\Workflows\Executions\V1\Execution_StackTraceElement::class); + diff --git a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/StackTraceElement/Position.php b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/StackTraceElement/Position.php new file mode 100644 index 000000000000..61107a127090 --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/StackTraceElement/Position.php @@ -0,0 +1,144 @@ +google.cloud.workflows.executions.v1.Execution.StackTraceElement.Position + */ +class Position extends \Google\Protobuf\Internal\Message +{ + /** + * The source code line number the current instruction was generated from. + * + * Generated from protobuf field int64 line = 1; + */ + protected $line = 0; + /** + * The source code column position (of the line) the current instruction + * was generated from. + * + * Generated from protobuf field int64 column = 2; + */ + protected $column = 0; + /** + * The number of bytes of source code making up this stack trace element. + * + * Generated from protobuf field int64 length = 3; + */ + protected $length = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $line + * The source code line number the current instruction was generated from. + * @type int|string $column + * The source code column position (of the line) the current instruction + * was generated from. + * @type int|string $length + * The number of bytes of source code making up this stack trace element. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Workflows\Executions\V1\Executions::initOnce(); + parent::__construct($data); + } + + /** + * The source code line number the current instruction was generated from. + * + * Generated from protobuf field int64 line = 1; + * @return int|string + */ + public function getLine() + { + return $this->line; + } + + /** + * The source code line number the current instruction was generated from. + * + * Generated from protobuf field int64 line = 1; + * @param int|string $var + * @return $this + */ + public function setLine($var) + { + GPBUtil::checkInt64($var); + $this->line = $var; + + return $this; + } + + /** + * The source code column position (of the line) the current instruction + * was generated from. + * + * Generated from protobuf field int64 column = 2; + * @return int|string + */ + public function getColumn() + { + return $this->column; + } + + /** + * The source code column position (of the line) the current instruction + * was generated from. + * + * Generated from protobuf field int64 column = 2; + * @param int|string $var + * @return $this + */ + public function setColumn($var) + { + GPBUtil::checkInt64($var); + $this->column = $var; + + return $this; + } + + /** + * The number of bytes of source code making up this stack trace element. + * + * Generated from protobuf field int64 length = 3; + * @return int|string + */ + public function getLength() + { + return $this->length; + } + + /** + * The number of bytes of source code making up this stack trace element. + * + * Generated from protobuf field int64 length = 3; + * @param int|string $var + * @return $this + */ + public function setLength($var) + { + GPBUtil::checkInt64($var); + $this->length = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Position::class, \Google\Cloud\Workflows\Executions\V1\Execution_StackTraceElement_Position::class); + diff --git a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/State.php b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/State.php new file mode 100644 index 000000000000..79500707a958 --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/State.php @@ -0,0 +1,93 @@ +google.cloud.workflows.executions.v1.Execution.State + */ +class State +{ + /** + * Invalid state. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The execution is in progress. + * + * Generated from protobuf enum ACTIVE = 1; + */ + const ACTIVE = 1; + /** + * The execution finished successfully. + * + * Generated from protobuf enum SUCCEEDED = 2; + */ + const SUCCEEDED = 2; + /** + * The execution failed with an error. + * + * Generated from protobuf enum FAILED = 3; + */ + const FAILED = 3; + /** + * The execution was stopped intentionally. + * + * Generated from protobuf enum CANCELLED = 4; + */ + const CANCELLED = 4; + /** + * Execution data is unavailable. See the `state_error` field. + * + * Generated from protobuf enum UNAVAILABLE = 5; + */ + const UNAVAILABLE = 5; + /** + * Request has been placed in the backlog for processing at a later time. + * + * Generated from protobuf enum QUEUED = 6; + */ + const QUEUED = 6; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::ACTIVE => 'ACTIVE', + self::SUCCEEDED => 'SUCCEEDED', + self::FAILED => 'FAILED', + self::CANCELLED => 'CANCELLED', + self::UNAVAILABLE => 'UNAVAILABLE', + self::QUEUED => 'QUEUED', + ]; + + 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\Workflows\Executions\V1\Execution_State::class); + diff --git a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/StateError.php b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/StateError.php new file mode 100644 index 000000000000..86fe3c37a521 --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/StateError.php @@ -0,0 +1,104 @@ +google.cloud.workflows.executions.v1.Execution.StateError + */ +class StateError extends \Google\Protobuf\Internal\Message +{ + /** + * Provides specifics about the error. + * + * Generated from protobuf field string details = 1; + */ + protected $details = ''; + /** + * The type of this state error. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.StateError.Type type = 2; + */ + protected $type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $details + * Provides specifics about the error. + * @type int $type + * The type of this state error. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Workflows\Executions\V1\Executions::initOnce(); + parent::__construct($data); + } + + /** + * Provides specifics about the error. + * + * Generated from protobuf field string details = 1; + * @return string + */ + public function getDetails() + { + return $this->details; + } + + /** + * Provides specifics about the error. + * + * Generated from protobuf field string details = 1; + * @param string $var + * @return $this + */ + public function setDetails($var) + { + GPBUtil::checkString($var, True); + $this->details = $var; + + return $this; + } + + /** + * The type of this state error. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.StateError.Type type = 2; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * The type of this state error. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.StateError.Type type = 2; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Workflows\Executions\V1\Execution\StateError\Type::class); + $this->type = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(StateError::class, \Google\Cloud\Workflows\Executions\V1\Execution_StateError::class); + diff --git a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/StateError/Type.php b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/StateError/Type.php new file mode 100644 index 000000000000..82ea0cbcf588 --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/StateError/Type.php @@ -0,0 +1,57 @@ +google.cloud.workflows.executions.v1.Execution.StateError.Type + */ +class Type +{ + /** + * No type specified. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * Caused by an issue with KMS. + * + * Generated from protobuf enum KMS_ERROR = 1; + */ + const KMS_ERROR = 1; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::KMS_ERROR => 'KMS_ERROR', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\Workflows\Executions\V1\Execution_StateError_Type::class); + diff --git a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/Status.php b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/Status.php new file mode 100644 index 000000000000..e561ba569538 --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/Status.php @@ -0,0 +1,94 @@ +google.cloud.workflows.executions.v1.Execution.Status + */ +class Status extends \Google\Protobuf\Internal\Message +{ + /** + * A list of currently executing or last executed step names for the + * workflow execution currently running. If the workflow has succeeded or + * failed, this is the last attempted or executed step. Presently, if the + * current step is inside a subworkflow, the list only includes that step. + * In the future, the list will contain items for each step in the call + * stack, starting with the outermost step in the `main` subworkflow, and + * ending with the most deeply nested step. + * + * Generated from protobuf field repeated .google.cloud.workflows.executions.v1.Execution.Status.Step current_steps = 1; + */ + private $current_steps; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Workflows\Executions\V1\Execution\Status\Step>|\Google\Protobuf\Internal\RepeatedField $current_steps + * A list of currently executing or last executed step names for the + * workflow execution currently running. If the workflow has succeeded or + * failed, this is the last attempted or executed step. Presently, if the + * current step is inside a subworkflow, the list only includes that step. + * In the future, the list will contain items for each step in the call + * stack, starting with the outermost step in the `main` subworkflow, and + * ending with the most deeply nested step. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Workflows\Executions\V1\Executions::initOnce(); + parent::__construct($data); + } + + /** + * A list of currently executing or last executed step names for the + * workflow execution currently running. If the workflow has succeeded or + * failed, this is the last attempted or executed step. Presently, if the + * current step is inside a subworkflow, the list only includes that step. + * In the future, the list will contain items for each step in the call + * stack, starting with the outermost step in the `main` subworkflow, and + * ending with the most deeply nested step. + * + * Generated from protobuf field repeated .google.cloud.workflows.executions.v1.Execution.Status.Step current_steps = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCurrentSteps() + { + return $this->current_steps; + } + + /** + * A list of currently executing or last executed step names for the + * workflow execution currently running. If the workflow has succeeded or + * failed, this is the last attempted or executed step. Presently, if the + * current step is inside a subworkflow, the list only includes that step. + * In the future, the list will contain items for each step in the call + * stack, starting with the outermost step in the `main` subworkflow, and + * ending with the most deeply nested step. + * + * Generated from protobuf field repeated .google.cloud.workflows.executions.v1.Execution.Status.Step current_steps = 1; + * @param array<\Google\Cloud\Workflows\Executions\V1\Execution\Status\Step>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCurrentSteps($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Workflows\Executions\V1\Execution\Status\Step::class); + $this->current_steps = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Status::class, \Google\Cloud\Workflows\Executions\V1\Execution_Status::class); + diff --git a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/Status/Step.php b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/Status/Step.php new file mode 100644 index 000000000000..2a4809523790 --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/Status/Step.php @@ -0,0 +1,104 @@ +google.cloud.workflows.executions.v1.Execution.Status.Step + */ +class Step extends \Google\Protobuf\Internal\Message +{ + /** + * Name of a routine within the workflow. + * + * Generated from protobuf field string routine = 1; + */ + protected $routine = ''; + /** + * Name of a step within the routine. + * + * Generated from protobuf field string step = 2; + */ + protected $step = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $routine + * Name of a routine within the workflow. + * @type string $step + * Name of a step within the routine. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Workflows\Executions\V1\Executions::initOnce(); + parent::__construct($data); + } + + /** + * Name of a routine within the workflow. + * + * Generated from protobuf field string routine = 1; + * @return string + */ + public function getRoutine() + { + return $this->routine; + } + + /** + * Name of a routine within the workflow. + * + * Generated from protobuf field string routine = 1; + * @param string $var + * @return $this + */ + public function setRoutine($var) + { + GPBUtil::checkString($var, True); + $this->routine = $var; + + return $this; + } + + /** + * Name of a step within the routine. + * + * Generated from protobuf field string step = 2; + * @return string + */ + public function getStep() + { + return $this->step; + } + + /** + * Name of a step within the routine. + * + * Generated from protobuf field string step = 2; + * @param string $var + * @return $this + */ + public function setStep($var) + { + GPBUtil::checkString($var, True); + $this->step = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Step::class, \Google\Cloud\Workflows\Executions\V1\Execution_Status_Step::class); + diff --git a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/ExecutionView.php b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/ExecutionView.php new file mode 100644 index 000000000000..3cf62b861520 --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/ExecutionView.php @@ -0,0 +1,63 @@ +google.cloud.workflows.executions.v1.ExecutionView + */ +class ExecutionView +{ + /** + * The default / unset value. + * + * Generated from protobuf enum EXECUTION_VIEW_UNSPECIFIED = 0; + */ + const EXECUTION_VIEW_UNSPECIFIED = 0; + /** + * Includes only basic metadata about the execution. + * The following fields are returned: name, start_time, end_time, duration, + * state, and workflow_revision_id. + * + * Generated from protobuf enum BASIC = 1; + */ + const BASIC = 1; + /** + * Includes all data. + * + * Generated from protobuf enum FULL = 2; + */ + const FULL = 2; + + private static $valueToName = [ + self::EXECUTION_VIEW_UNSPECIFIED => 'EXECUTION_VIEW_UNSPECIFIED', + self::BASIC => 'BASIC', + self::FULL => 'FULL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/GetExecutionRequest.php b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/GetExecutionRequest.php new file mode 100644 index 000000000000..50cf0dfb16bc --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/GetExecutionRequest.php @@ -0,0 +1,131 @@ +google.cloud.workflows.executions.v1.GetExecutionRequest + */ +class GetExecutionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the execution to be retrieved. + * Format: + * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. A view defining which fields should be filled in the returned + * execution. The API will default to the FULL view. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1.ExecutionView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $view = 0; + + /** + * @param string $name Required. Name of the execution to be retrieved. + * Format: + * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + * Please see {@see ExecutionsClient::executionName()} for help formatting this field. + * + * @return \Google\Cloud\Workflows\Executions\V1\GetExecutionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the execution to be retrieved. + * Format: + * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + * @type int $view + * Optional. A view defining which fields should be filled in the returned + * execution. The API will default to the FULL view. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Workflows\Executions\V1\Executions::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the execution to be retrieved. + * Format: + * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the execution to be retrieved. + * Format: + * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. A view defining which fields should be filled in the returned + * execution. The API will default to the FULL view. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1.ExecutionView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * Optional. A view defining which fields should be filled in the returned + * execution. The API will default to the FULL view. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1.ExecutionView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Workflows\Executions\V1\ExecutionView::class); + $this->view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/ListExecutionsRequest.php b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/ListExecutionsRequest.php new file mode 100644 index 000000000000..22bdd8f45dc0 --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/ListExecutionsRequest.php @@ -0,0 +1,322 @@ +google.cloud.workflows.executions.v1.ListExecutionsRequest + */ +class ListExecutionsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the workflow for which the executions should be listed. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Maximum number of executions to return per call. + * Max supported value depends on the selected Execution view: it's 1000 for + * BASIC and 100 for FULL. The default value used if the field is not + * specified is 100, regardless of the selected view. Values greater than + * the max value will be coerced down to it. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * A page token, received from a previous `ListExecutions` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListExecutions` must + * match the call that provided the page token. + * Note that pagination is applied to dynamic data. The list of executions + * returned can change between page requests. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * Optional. A view defining which fields should be filled in the returned + * executions. The API will default to the BASIC view. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1.ExecutionView view = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $view = 0; + /** + * Optional. Filters applied to the [Executions.ListExecutions] results. + * The following fields are supported for filtering: + * executionID, state, startTime, endTime, duration, workflowRevisionID, + * stepName, and label. + * + * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. The ordering applied to the [Executions.ListExecutions] results. + * By default the ordering is based on descending start time. + * The following fields are supported for order by: + * executionID, startTime, endTime, duration, state, and workflowRevisionID. + * + * Generated from protobuf field string order_by = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. Name of the workflow for which the executions should be listed. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * Please see {@see ExecutionsClient::workflowName()} for help formatting this field. + * + * @return \Google\Cloud\Workflows\Executions\V1\ListExecutionsRequest + * + * @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. Name of the workflow for which the executions should be listed. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * @type int $page_size + * Maximum number of executions to return per call. + * Max supported value depends on the selected Execution view: it's 1000 for + * BASIC and 100 for FULL. The default value used if the field is not + * specified is 100, regardless of the selected view. Values greater than + * the max value will be coerced down to it. + * @type string $page_token + * A page token, received from a previous `ListExecutions` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListExecutions` must + * match the call that provided the page token. + * Note that pagination is applied to dynamic data. The list of executions + * returned can change between page requests. + * @type int $view + * Optional. A view defining which fields should be filled in the returned + * executions. The API will default to the BASIC view. + * @type string $filter + * Optional. Filters applied to the [Executions.ListExecutions] results. + * The following fields are supported for filtering: + * executionID, state, startTime, endTime, duration, workflowRevisionID, + * stepName, and label. + * @type string $order_by + * Optional. The ordering applied to the [Executions.ListExecutions] results. + * By default the ordering is based on descending start time. + * The following fields are supported for order by: + * executionID, startTime, endTime, duration, state, and workflowRevisionID. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Workflows\Executions\V1\Executions::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the workflow for which the executions should be listed. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Name of the workflow for which the executions should be listed. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * + * 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; + } + + /** + * Maximum number of executions to return per call. + * Max supported value depends on the selected Execution view: it's 1000 for + * BASIC and 100 for FULL. The default value used if the field is not + * specified is 100, regardless of the selected view. Values greater than + * the max value will be coerced down to it. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Maximum number of executions to return per call. + * Max supported value depends on the selected Execution view: it's 1000 for + * BASIC and 100 for FULL. The default value used if the field is not + * specified is 100, regardless of the selected view. Values greater than + * the max value will be coerced down to it. + * + * 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; + } + + /** + * A page token, received from a previous `ListExecutions` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListExecutions` must + * match the call that provided the page token. + * Note that pagination is applied to dynamic data. The list of executions + * returned can change between page requests. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A page token, received from a previous `ListExecutions` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListExecutions` must + * match the call that provided the page token. + * Note that pagination is applied to dynamic data. The list of executions + * returned can change between page requests. + * + * 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; + } + + /** + * Optional. A view defining which fields should be filled in the returned + * executions. The API will default to the BASIC view. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1.ExecutionView view = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * Optional. A view defining which fields should be filled in the returned + * executions. The API will default to the BASIC view. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1.ExecutionView view = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Workflows\Executions\V1\ExecutionView::class); + $this->view = $var; + + return $this; + } + + /** + * Optional. Filters applied to the [Executions.ListExecutions] results. + * The following fields are supported for filtering: + * executionID, state, startTime, endTime, duration, workflowRevisionID, + * stepName, and label. + * + * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filters applied to the [Executions.ListExecutions] results. + * The following fields are supported for filtering: + * executionID, state, startTime, endTime, duration, workflowRevisionID, + * stepName, and label. + * + * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. The ordering applied to the [Executions.ListExecutions] results. + * By default the ordering is based on descending start time. + * The following fields are supported for order by: + * executionID, startTime, endTime, duration, state, and workflowRevisionID. + * + * Generated from protobuf field string order_by = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. The ordering applied to the [Executions.ListExecutions] results. + * By default the ordering is based on descending start time. + * The following fields are supported for order by: + * executionID, startTime, endTime, duration, state, and workflowRevisionID. + * + * Generated from protobuf field string order_by = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/ListExecutionsResponse.php b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/ListExecutionsResponse.php new file mode 100644 index 000000000000..6f950c9185b5 --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/ListExecutionsResponse.php @@ -0,0 +1,107 @@ +google.cloud.workflows.executions.v1.ListExecutionsResponse + */ +class ListExecutionsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The executions which match the request. + * + * Generated from protobuf field repeated .google.cloud.workflows.executions.v1.Execution executions = 1; + */ + private $executions; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Workflows\Executions\V1\Execution>|\Google\Protobuf\Internal\RepeatedField $executions + * The executions which match the request. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Workflows\Executions\V1\Executions::initOnce(); + parent::__construct($data); + } + + /** + * The executions which match the request. + * + * Generated from protobuf field repeated .google.cloud.workflows.executions.v1.Execution executions = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExecutions() + { + return $this->executions; + } + + /** + * The executions which match the request. + * + * Generated from protobuf field repeated .google.cloud.workflows.executions.v1.Execution executions = 1; + * @param array<\Google\Cloud\Workflows\Executions\V1\Execution>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExecutions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Workflows\Executions\V1\Execution::class); + $this->executions = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Workflows/Executions/v1/samples/V1/ExecutionsClient/cancel_execution.php b/owl-bot-staging/Workflows/Executions/v1/samples/V1/ExecutionsClient/cancel_execution.php new file mode 100644 index 000000000000..cdb9e9234478 --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1/samples/V1/ExecutionsClient/cancel_execution.php @@ -0,0 +1,78 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Execution $response */ + $response = $executionsClient->cancelExecution($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 = ExecutionsClient::executionName( + '[PROJECT]', + '[LOCATION]', + '[WORKFLOW]', + '[EXECUTION]' + ); + + cancel_execution_sample($formattedName); +} +// [END workflowexecutions_v1_generated_Executions_CancelExecution_sync] diff --git a/owl-bot-staging/Workflows/Executions/v1/samples/V1/ExecutionsClient/create_execution.php b/owl-bot-staging/Workflows/Executions/v1/samples/V1/ExecutionsClient/create_execution.php new file mode 100644 index 000000000000..0b317eb189cc --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1/samples/V1/ExecutionsClient/create_execution.php @@ -0,0 +1,75 @@ +setParent($formattedParent) + ->setExecution($execution); + + // Call the API and handle any network failures. + try { + /** @var Execution $response */ + $response = $executionsClient->createExecution($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 = ExecutionsClient::workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); + + create_execution_sample($formattedParent); +} +// [END workflowexecutions_v1_generated_Executions_CreateExecution_sync] diff --git a/owl-bot-staging/Workflows/Executions/v1/samples/V1/ExecutionsClient/get_execution.php b/owl-bot-staging/Workflows/Executions/v1/samples/V1/ExecutionsClient/get_execution.php new file mode 100644 index 000000000000..c13b2df91460 --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1/samples/V1/ExecutionsClient/get_execution.php @@ -0,0 +1,78 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Execution $response */ + $response = $executionsClient->getExecution($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 = ExecutionsClient::executionName( + '[PROJECT]', + '[LOCATION]', + '[WORKFLOW]', + '[EXECUTION]' + ); + + get_execution_sample($formattedName); +} +// [END workflowexecutions_v1_generated_Executions_GetExecution_sync] diff --git a/owl-bot-staging/Workflows/Executions/v1/samples/V1/ExecutionsClient/list_executions.php b/owl-bot-staging/Workflows/Executions/v1/samples/V1/ExecutionsClient/list_executions.php new file mode 100644 index 000000000000..2a9f644e779e --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1/samples/V1/ExecutionsClient/list_executions.php @@ -0,0 +1,80 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $executionsClient->listExecutions($request); + + /** @var Execution $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 = ExecutionsClient::workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); + + list_executions_sample($formattedParent); +} +// [END workflowexecutions_v1_generated_Executions_ListExecutions_sync] diff --git a/owl-bot-staging/Workflows/Executions/v1/src/V1/Client/BaseClient/ExecutionsBaseClient.php b/owl-bot-staging/Workflows/Executions/v1/src/V1/Client/BaseClient/ExecutionsBaseClient.php new file mode 100644 index 000000000000..011a711708ae --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1/src/V1/Client/BaseClient/ExecutionsBaseClient.php @@ -0,0 +1,349 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../../resources/executions_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../../resources/executions_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../../resources/executions_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../../resources/executions_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a execution + * resource. + * + * @param string $project + * @param string $location + * @param string $workflow + * @param string $execution + * + * @return string The formatted execution resource. + */ + public static function executionName(string $project, string $location, string $workflow, string $execution): string + { + return self::getPathTemplate('execution')->render([ + 'project' => $project, + 'location' => $location, + 'workflow' => $workflow, + 'execution' => $execution, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a workflow + * resource. + * + * @param string $project + * @param string $location + * @param string $workflow + * + * @return string The formatted workflow resource. + */ + public static function workflowName(string $project, string $location, string $workflow): string + { + return self::getPathTemplate('workflow')->render([ + 'project' => $project, + 'location' => $location, + 'workflow' => $workflow, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - execution: projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + * - workflow: projects/{project}/locations/{location}/workflows/{workflow} + * + * 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 'workflowexecutions.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Cancels an execution of the given name. + * + * The async variant is {@see self::cancelExecutionAsync()} . + * + * @example samples/V1/ExecutionsClient/cancel_execution.php + * + * @param CancelExecutionRequest $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 Execution + * + * @throws ApiException Thrown if the API call fails. + */ + public function cancelExecution(CancelExecutionRequest $request, array $callOptions = []): Execution + { + return $this->startApiCall('CancelExecution', $request, $callOptions)->wait(); + } + + /** + * Creates a new execution using the latest revision of the given workflow. + * + * The async variant is {@see self::createExecutionAsync()} . + * + * @example samples/V1/ExecutionsClient/create_execution.php + * + * @param CreateExecutionRequest $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 Execution + * + * @throws ApiException Thrown if the API call fails. + */ + public function createExecution(CreateExecutionRequest $request, array $callOptions = []): Execution + { + return $this->startApiCall('CreateExecution', $request, $callOptions)->wait(); + } + + /** + * Returns an execution of the given name. + * + * The async variant is {@see self::getExecutionAsync()} . + * + * @example samples/V1/ExecutionsClient/get_execution.php + * + * @param GetExecutionRequest $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 Execution + * + * @throws ApiException Thrown if the API call fails. + */ + public function getExecution(GetExecutionRequest $request, array $callOptions = []): Execution + { + return $this->startApiCall('GetExecution', $request, $callOptions)->wait(); + } + + /** + * Returns a list of executions which belong to the workflow with + * the given name. The method returns executions of all workflow + * revisions. Returned executions are ordered by their start time (newest + * first). + * + * The async variant is {@see self::listExecutionsAsync()} . + * + * @example samples/V1/ExecutionsClient/list_executions.php + * + * @param ListExecutionsRequest $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 listExecutions(ListExecutionsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListExecutions', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Workflows/Executions/v1/src/V1/Client/ExecutionsClient.php b/owl-bot-staging/Workflows/Executions/v1/src/V1/Client/ExecutionsClient.php new file mode 100644 index 000000000000..2ff8b03b6b80 --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1/src/V1/Client/ExecutionsClient.php @@ -0,0 +1,40 @@ + [ + 'google.cloud.workflows.executions.v1.Executions' => [ + 'CancelExecution' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Workflows\Executions\V1\Execution', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'CreateExecution' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Workflows\Executions\V1\Execution', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetExecution' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Workflows\Executions\V1\Execution', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListExecutions' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getExecutions', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Workflows\Executions\V1\ListExecutionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'templateMap' => [ + 'execution' => 'projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}', + 'workflow' => 'projects/{project}/locations/{location}/workflows/{workflow}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Workflows/Executions/v1/src/V1/resources/executions_rest_client_config.php b/owl-bot-staging/Workflows/Executions/v1/src/V1/resources/executions_rest_client_config.php new file mode 100644 index 000000000000..09d749a4004f --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1/src/V1/resources/executions_rest_client_config.php @@ -0,0 +1,54 @@ + [ + 'google.cloud.workflows.executions.v1.Executions' => [ + 'CancelExecution' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/workflows/*/executions/*}:cancel', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'CreateExecution' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/workflows/*}/executions', + 'body' => 'execution', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'GetExecution' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/workflows/*/executions/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListExecutions' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/workflows/*}/executions', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Workflows/Executions/v1/tests/Unit/V1/Client/ExecutionsClientTest.php b/owl-bot-staging/Workflows/Executions/v1/tests/Unit/V1/Client/ExecutionsClientTest.php new file mode 100644 index 000000000000..81326ab26aab --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1/tests/Unit/V1/Client/ExecutionsClientTest.php @@ -0,0 +1,389 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ExecutionsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ExecutionsClient($options); + } + + /** @test */ + public function cancelExecutionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $argument = 'argument-1589682499'; + $result = 'result-934426595'; + $workflowRevisionId = 'workflowRevisionId-1453295745'; + $expectedResponse = new Execution(); + $expectedResponse->setName($name2); + $expectedResponse->setArgument($argument); + $expectedResponse->setResult($result); + $expectedResponse->setWorkflowRevisionId($workflowRevisionId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[WORKFLOW]', '[EXECUTION]'); + $request = (new CancelExecutionRequest()) + ->setName($formattedName); + $response = $gapicClient->cancelExecution($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.workflows.executions.v1.Executions/CancelExecution', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function cancelExecutionExceptionTest() + { + $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->executionName('[PROJECT]', '[LOCATION]', '[WORKFLOW]', '[EXECUTION]'); + $request = (new CancelExecutionRequest()) + ->setName($formattedName); + try { + $gapicClient->cancelExecution($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 createExecutionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $argument = 'argument-1589682499'; + $result = 'result-934426595'; + $workflowRevisionId = 'workflowRevisionId-1453295745'; + $expectedResponse = new Execution(); + $expectedResponse->setName($name); + $expectedResponse->setArgument($argument); + $expectedResponse->setResult($result); + $expectedResponse->setWorkflowRevisionId($workflowRevisionId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); + $execution = new Execution(); + $request = (new CreateExecutionRequest()) + ->setParent($formattedParent) + ->setExecution($execution); + $response = $gapicClient->createExecution($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.workflows.executions.v1.Executions/CreateExecution', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getExecution(); + $this->assertProtobufEquals($execution, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createExecutionExceptionTest() + { + $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->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); + $execution = new Execution(); + $request = (new CreateExecutionRequest()) + ->setParent($formattedParent) + ->setExecution($execution); + try { + $gapicClient->createExecution($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 getExecutionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $argument = 'argument-1589682499'; + $result = 'result-934426595'; + $workflowRevisionId = 'workflowRevisionId-1453295745'; + $expectedResponse = new Execution(); + $expectedResponse->setName($name2); + $expectedResponse->setArgument($argument); + $expectedResponse->setResult($result); + $expectedResponse->setWorkflowRevisionId($workflowRevisionId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[WORKFLOW]', '[EXECUTION]'); + $request = (new GetExecutionRequest()) + ->setName($formattedName); + $response = $gapicClient->getExecution($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.workflows.executions.v1.Executions/GetExecution', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getExecutionExceptionTest() + { + $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->executionName('[PROJECT]', '[LOCATION]', '[WORKFLOW]', '[EXECUTION]'); + $request = (new GetExecutionRequest()) + ->setName($formattedName); + try { + $gapicClient->getExecution($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 listExecutionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $executionsElement = new Execution(); + $executions = [ + $executionsElement, + ]; + $expectedResponse = new ListExecutionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setExecutions($executions); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); + $request = (new ListExecutionsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listExecutions($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getExecutions()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.workflows.executions.v1.Executions/ListExecutions', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listExecutionsExceptionTest() + { + $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->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); + $request = (new ListExecutionsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listExecutions($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 cancelExecutionAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $argument = 'argument-1589682499'; + $result = 'result-934426595'; + $workflowRevisionId = 'workflowRevisionId-1453295745'; + $expectedResponse = new Execution(); + $expectedResponse->setName($name2); + $expectedResponse->setArgument($argument); + $expectedResponse->setResult($result); + $expectedResponse->setWorkflowRevisionId($workflowRevisionId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[WORKFLOW]', '[EXECUTION]'); + $request = (new CancelExecutionRequest()) + ->setName($formattedName); + $response = $gapicClient->cancelExecutionAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.workflows.executions.v1.Executions/CancelExecution', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Workflows/Executions/v1beta/proto/src/GPBMetadata/Google/Cloud/Workflows/Executions/V1Beta/Executions.php b/owl-bot-staging/Workflows/Executions/v1beta/proto/src/GPBMetadata/Google/Cloud/Workflows/Executions/V1Beta/Executions.php new file mode 100644 index 0000000000000000000000000000000000000000..9e6db986aa75114b43d2ce37a731288f062dd1cd GIT binary patch literal 3803 zcmb_fO;g)O7_N*B_-zA3X^87XE1b;4xL^%%=wLz;*%piw1D@DGr}d0Sme)p&kW^_6 zNj$#f&_B>W&_n-9FTJ(BaY|=$%AuEBI_;&q`dAA?r^b{Evb68l^FGhJyAK{&M;6=_ zwvmBs1*4YGd@0}~Bv`hIP1V$eX1Co&wxF8FmZl>+D+t9sVRx@4$i-4^ftWgG*H%$Z z=$K|lN202m-IjQ2+Rxj%dFqJh1yZ|MGYv;PS!p7ygx+M`C;*0Xj2uf*k+5CK?~pYu z1uOM!*I~Ut9o7#6hjp1btRJl8$>I$FRaYEG7<_>q2;|S|Hg!!E9IRmS@1Eu~G(*Fh zqHC{6rJF)q(H%t0FRpEO4V5M>P=h@~Md?Ms^GVmLmjs+fej+ z5jm=@S=h8IWN9wfL6|{I-=r7)u+*K_7Sdjhx!i>$HwA2WQ8>CF*a&xRW5dmxI_R^f z`XvBLmR6Sx!=xyXHso@Hng%ZZ&9I#+0u~S%A+IYL^JKHnLa~4okmWQVPDe- ziLi2PT^`Zx+44ip?~v4Lv4(6BVy78|6wv$d_dKkR&1gRDnPy!vWSJPU12JShF(mK! zK@>|P(xF&;qDX!g`p~9;Hkv-7{(?_J3v3^@AzN2ogqI=?u<;h8{)|GLsfE7@QL4ZM zCvfR_e&UTZ!LI=jEN$GNmWc@Y@ZoAQ>sJ-H%`(V6qZOD&M$0pq7|mn{VwCwP5hd$q zR@Z|N{|Q`{rJt=*2VMqqFs;~~?lFNe5u?@cw_uWh)75celK%FVk*LVFO*=8=W;s?= znL6;?Ex^Y?iyJmN(HtVPhSo|h`9#*EKFI-OWjmj9^CYWY7$buz%I=3R1IQo zMf`2JS*=Mmxv{@nt;mJaR!J_-eZT`uN`+eKK%V3H8xXJV7YedmB%dPm)0R{!ljjNg zsUYnZZaFs3uBBYV7RZa`5YMuO2;_=1fnMzI`zr+#TaBeAm+5`TdEjLitnKb9Yv&00)|H8pXVZrd5qc+HSxUZwJJMwD|?cX89~RYET_6T<+zMrV{-pziEU7< zo5MTRuTu61W6Q~j;_2zB-&nSdDP4Tz-J6yzUBPYBKF+`AV2SL;BXb}>JD3p_dL5~7 zUzNR6lz(cYdwa(WDQ}RiNK(0QIkTD@gB4cuourJi6F*>rALGo>oFvxRT)WQ><4fM{ XCv;h&$3;!O}G+ literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/CancelExecutionRequest.php b/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/CancelExecutionRequest.php new file mode 100644 index 000000000000..28c9ab2611dc --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/CancelExecutionRequest.php @@ -0,0 +1,77 @@ +google.cloud.workflows.executions.v1beta.CancelExecutionRequest + */ +class CancelExecutionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the execution to be cancelled. + * Format: + * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the execution to be cancelled. + * Format: + * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Workflows\Executions\V1Beta\Executions::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the execution to be cancelled. + * Format: + * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the execution to be cancelled. + * Format: + * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + * + * 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/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/CreateExecutionRequest.php b/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/CreateExecutionRequest.php new file mode 100644 index 000000000000..0ce4e08aa9b5 --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/CreateExecutionRequest.php @@ -0,0 +1,121 @@ +google.cloud.workflows.executions.v1beta.CreateExecutionRequest + */ +class CreateExecutionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the workflow for which an execution should be created. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * The latest revision of the workflow will be used. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Execution to be created. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1beta.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $execution = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Name of the workflow for which an execution should be created. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * The latest revision of the workflow will be used. + * @type \Google\Cloud\Workflows\Executions\V1beta\Execution $execution + * Required. Execution to be created. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Workflows\Executions\V1Beta\Executions::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the workflow for which an execution should be created. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * The latest revision of the workflow will be used. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Name of the workflow for which an execution should be created. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * The latest revision of the workflow will be used. + * + * 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. Execution to be created. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1beta.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Workflows\Executions\V1beta\Execution|null + */ + public function getExecution() + { + return $this->execution; + } + + public function hasExecution() + { + return isset($this->execution); + } + + public function clearExecution() + { + unset($this->execution); + } + + /** + * Required. Execution to be created. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1beta.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Workflows\Executions\V1beta\Execution $var + * @return $this + */ + public function setExecution($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Workflows\Executions\V1beta\Execution::class); + $this->execution = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/Execution.php b/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/Execution.php new file mode 100644 index 000000000000..a7c7ff753389 --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/Execution.php @@ -0,0 +1,359 @@ +google.cloud.workflows.executions.v1beta.Execution + */ +class Execution extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The resource name of the execution. + * Format: + * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Output only. Marks the beginning of execution. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $start_time = null; + /** + * Output only. Marks the end of execution, successful or not. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. Current state of the execution. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1beta.Execution.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Input parameters of the execution represented as a JSON string. + * The size limit is 32KB. + * + * Generated from protobuf field string argument = 5; + */ + protected $argument = ''; + /** + * Output only. Output of the execution represented as a JSON string. The + * value can only be present if the execution's state is `SUCCEEDED`. + * + * Generated from protobuf field string result = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $result = ''; + /** + * Output only. The error which caused the execution to finish prematurely. + * The value is only present if the execution's state is `FAILED` + * or `CANCELLED`. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1beta.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $error = null; + /** + * Output only. Revision of the workflow this execution is using. + * + * Generated from protobuf field string workflow_revision_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $workflow_revision_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The resource name of the execution. + * Format: + * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + * @type \Google\Protobuf\Timestamp $start_time + * Output only. Marks the beginning of execution. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. Marks the end of execution, successful or not. + * @type int $state + * Output only. Current state of the execution. + * @type string $argument + * Input parameters of the execution represented as a JSON string. + * The size limit is 32KB. + * @type string $result + * Output only. Output of the execution represented as a JSON string. The + * value can only be present if the execution's state is `SUCCEEDED`. + * @type \Google\Cloud\Workflows\Executions\V1beta\Execution\Error $error + * Output only. The error which caused the execution to finish prematurely. + * The value is only present if the execution's state is `FAILED` + * or `CANCELLED`. + * @type string $workflow_revision_id + * Output only. Revision of the workflow this execution is using. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Workflows\Executions\V1Beta\Executions::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The resource name of the execution. + * Format: + * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The resource name of the execution. + * Format: + * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Marks the beginning of execution. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Output only. Marks the beginning of execution. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Output only. Marks the end of execution, successful or not. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. Marks the end of execution, successful or not. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. Current state of the execution. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1beta.Execution.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. Current state of the execution. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1beta.Execution.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Workflows\Executions\V1beta\Execution\State::class); + $this->state = $var; + + return $this; + } + + /** + * Input parameters of the execution represented as a JSON string. + * The size limit is 32KB. + * + * Generated from protobuf field string argument = 5; + * @return string + */ + public function getArgument() + { + return $this->argument; + } + + /** + * Input parameters of the execution represented as a JSON string. + * The size limit is 32KB. + * + * Generated from protobuf field string argument = 5; + * @param string $var + * @return $this + */ + public function setArgument($var) + { + GPBUtil::checkString($var, True); + $this->argument = $var; + + return $this; + } + + /** + * Output only. Output of the execution represented as a JSON string. The + * value can only be present if the execution's state is `SUCCEEDED`. + * + * Generated from protobuf field string result = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getResult() + { + return $this->result; + } + + /** + * Output only. Output of the execution represented as a JSON string. The + * value can only be present if the execution's state is `SUCCEEDED`. + * + * Generated from protobuf field string result = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setResult($var) + { + GPBUtil::checkString($var, True); + $this->result = $var; + + return $this; + } + + /** + * Output only. The error which caused the execution to finish prematurely. + * The value is only present if the execution's state is `FAILED` + * or `CANCELLED`. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1beta.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Workflows\Executions\V1beta\Execution\Error|null + */ + public function getError() + { + return $this->error; + } + + public function hasError() + { + return isset($this->error); + } + + public function clearError() + { + unset($this->error); + } + + /** + * Output only. The error which caused the execution to finish prematurely. + * The value is only present if the execution's state is `FAILED` + * or `CANCELLED`. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1beta.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Workflows\Executions\V1beta\Execution\Error $var + * @return $this + */ + public function setError($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Workflows\Executions\V1beta\Execution\Error::class); + $this->error = $var; + + return $this; + } + + /** + * Output only. Revision of the workflow this execution is using. + * + * Generated from protobuf field string workflow_revision_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getWorkflowRevisionId() + { + return $this->workflow_revision_id; + } + + /** + * Output only. Revision of the workflow this execution is using. + * + * Generated from protobuf field string workflow_revision_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setWorkflowRevisionId($var) + { + GPBUtil::checkString($var, True); + $this->workflow_revision_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/Execution/Error.php b/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/Execution/Error.php new file mode 100644 index 000000000000..c8f9da2bfc7f --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/Execution/Error.php @@ -0,0 +1,104 @@ +google.cloud.workflows.executions.v1beta.Execution.Error + */ +class Error extends \Google\Protobuf\Internal\Message +{ + /** + * Error payload returned by the execution, represented as a JSON string. + * + * Generated from protobuf field string payload = 1; + */ + protected $payload = ''; + /** + * Human readable error context, helpful for debugging purposes. + * + * Generated from protobuf field string context = 2; + */ + protected $context = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $payload + * Error payload returned by the execution, represented as a JSON string. + * @type string $context + * Human readable error context, helpful for debugging purposes. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Workflows\Executions\V1Beta\Executions::initOnce(); + parent::__construct($data); + } + + /** + * Error payload returned by the execution, represented as a JSON string. + * + * Generated from protobuf field string payload = 1; + * @return string + */ + public function getPayload() + { + return $this->payload; + } + + /** + * Error payload returned by the execution, represented as a JSON string. + * + * Generated from protobuf field string payload = 1; + * @param string $var + * @return $this + */ + public function setPayload($var) + { + GPBUtil::checkString($var, True); + $this->payload = $var; + + return $this; + } + + /** + * Human readable error context, helpful for debugging purposes. + * + * Generated from protobuf field string context = 2; + * @return string + */ + public function getContext() + { + return $this->context; + } + + /** + * Human readable error context, helpful for debugging purposes. + * + * Generated from protobuf field string context = 2; + * @param string $var + * @return $this + */ + public function setContext($var) + { + GPBUtil::checkString($var, True); + $this->context = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Error::class, \Google\Cloud\Workflows\Executions\V1beta\Execution_Error::class); + diff --git a/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/Execution/State.php b/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/Execution/State.php new file mode 100644 index 000000000000..cb9bfc9bd8b8 --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/Execution/State.php @@ -0,0 +1,79 @@ +google.cloud.workflows.executions.v1beta.Execution.State + */ +class State +{ + /** + * Invalid state. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The execution is in progress. + * + * Generated from protobuf enum ACTIVE = 1; + */ + const ACTIVE = 1; + /** + * The execution finished successfully. + * + * Generated from protobuf enum SUCCEEDED = 2; + */ + const SUCCEEDED = 2; + /** + * The execution failed with an error. + * + * Generated from protobuf enum FAILED = 3; + */ + const FAILED = 3; + /** + * The execution was stopped intentionally. + * + * Generated from protobuf enum CANCELLED = 4; + */ + const CANCELLED = 4; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::ACTIVE => 'ACTIVE', + self::SUCCEEDED => 'SUCCEEDED', + self::FAILED => 'FAILED', + self::CANCELLED => 'CANCELLED', + ]; + + 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\Workflows\Executions\V1beta\Execution_State::class); + diff --git a/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/ExecutionView.php b/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/ExecutionView.php new file mode 100644 index 000000000000..22912dec5990 --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/ExecutionView.php @@ -0,0 +1,63 @@ +google.cloud.workflows.executions.v1beta.ExecutionView + */ +class ExecutionView +{ + /** + * The default / unset value. + * + * Generated from protobuf enum EXECUTION_VIEW_UNSPECIFIED = 0; + */ + const EXECUTION_VIEW_UNSPECIFIED = 0; + /** + * Includes only basic metadata about the execution. + * Following fields are returned: name, start_time, end_time, state + * and workflow_revision_id. + * + * Generated from protobuf enum BASIC = 1; + */ + const BASIC = 1; + /** + * Includes all data. + * + * Generated from protobuf enum FULL = 2; + */ + const FULL = 2; + + private static $valueToName = [ + self::EXECUTION_VIEW_UNSPECIFIED => 'EXECUTION_VIEW_UNSPECIFIED', + self::BASIC => 'BASIC', + self::FULL => 'FULL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/GetExecutionRequest.php b/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/GetExecutionRequest.php new file mode 100644 index 000000000000..7f1b36d86bbf --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/GetExecutionRequest.php @@ -0,0 +1,115 @@ +google.cloud.workflows.executions.v1beta.GetExecutionRequest + */ +class GetExecutionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the execution to be retrieved. + * Format: + * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. A view defining which fields should be filled in the returned execution. + * The API will default to the FULL view. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1beta.ExecutionView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $view = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the execution to be retrieved. + * Format: + * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + * @type int $view + * Optional. A view defining which fields should be filled in the returned execution. + * The API will default to the FULL view. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Workflows\Executions\V1Beta\Executions::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the execution to be retrieved. + * Format: + * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the execution to be retrieved. + * Format: + * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. A view defining which fields should be filled in the returned execution. + * The API will default to the FULL view. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1beta.ExecutionView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * Optional. A view defining which fields should be filled in the returned execution. + * The API will default to the FULL view. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1beta.ExecutionView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Workflows\Executions\V1beta\ExecutionView::class); + $this->view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/ListExecutionsRequest.php b/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/ListExecutionsRequest.php new file mode 100644 index 000000000000..077109024a4b --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/ListExecutionsRequest.php @@ -0,0 +1,207 @@ +google.cloud.workflows.executions.v1beta.ListExecutionsRequest + */ +class ListExecutionsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the workflow for which the executions should be listed. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Maximum number of executions to return per call. + * Max supported value depends on the selected Execution view: it's 10000 for + * BASIC and 100 for FULL. The default value used if the field is not + * specified is 100, regardless of the selected view. Values greater than + * the max value will be coerced down to it. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * A page token, received from a previous `ListExecutions` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListExecutions` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * Optional. A view defining which fields should be filled in the returned executions. + * The API will default to the BASIC view. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1beta.ExecutionView view = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $view = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Name of the workflow for which the executions should be listed. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * @type int $page_size + * Maximum number of executions to return per call. + * Max supported value depends on the selected Execution view: it's 10000 for + * BASIC and 100 for FULL. The default value used if the field is not + * specified is 100, regardless of the selected view. Values greater than + * the max value will be coerced down to it. + * @type string $page_token + * A page token, received from a previous `ListExecutions` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListExecutions` must + * match the call that provided the page token. + * @type int $view + * Optional. A view defining which fields should be filled in the returned executions. + * The API will default to the BASIC view. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Workflows\Executions\V1Beta\Executions::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the workflow for which the executions should be listed. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Name of the workflow for which the executions should be listed. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * + * 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; + } + + /** + * Maximum number of executions to return per call. + * Max supported value depends on the selected Execution view: it's 10000 for + * BASIC and 100 for FULL. The default value used if the field is not + * specified is 100, regardless of the selected view. Values greater than + * the max value will be coerced down to it. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Maximum number of executions to return per call. + * Max supported value depends on the selected Execution view: it's 10000 for + * BASIC and 100 for FULL. The default value used if the field is not + * specified is 100, regardless of the selected view. Values greater than + * the max value will be coerced down to it. + * + * 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; + } + + /** + * A page token, received from a previous `ListExecutions` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListExecutions` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A page token, received from a previous `ListExecutions` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListExecutions` must + * match 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; + } + + /** + * Optional. A view defining which fields should be filled in the returned executions. + * The API will default to the BASIC view. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1beta.ExecutionView view = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * Optional. A view defining which fields should be filled in the returned executions. + * The API will default to the BASIC view. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1beta.ExecutionView view = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Workflows\Executions\V1beta\ExecutionView::class); + $this->view = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/ListExecutionsResponse.php b/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/ListExecutionsResponse.php new file mode 100644 index 000000000000..9858451191f4 --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/ListExecutionsResponse.php @@ -0,0 +1,107 @@ +google.cloud.workflows.executions.v1beta.ListExecutionsResponse + */ +class ListExecutionsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The executions which match the request. + * + * Generated from protobuf field repeated .google.cloud.workflows.executions.v1beta.Execution executions = 1; + */ + private $executions; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Workflows\Executions\V1beta\Execution>|\Google\Protobuf\Internal\RepeatedField $executions + * The executions which match the request. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Workflows\Executions\V1Beta\Executions::initOnce(); + parent::__construct($data); + } + + /** + * The executions which match the request. + * + * Generated from protobuf field repeated .google.cloud.workflows.executions.v1beta.Execution executions = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExecutions() + { + return $this->executions; + } + + /** + * The executions which match the request. + * + * Generated from protobuf field repeated .google.cloud.workflows.executions.v1beta.Execution executions = 1; + * @param array<\Google\Cloud\Workflows\Executions\V1beta\Execution>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExecutions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Workflows\Executions\V1beta\Execution::class); + $this->executions = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Workflows/Executions/v1beta/samples/V1beta/ExecutionsClient/cancel_execution.php b/owl-bot-staging/Workflows/Executions/v1beta/samples/V1beta/ExecutionsClient/cancel_execution.php new file mode 100644 index 000000000000..716b3a2daf1d --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1beta/samples/V1beta/ExecutionsClient/cancel_execution.php @@ -0,0 +1,73 @@ +cancelExecution($formattedName); + 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 = ExecutionsClient::executionName( + '[PROJECT]', + '[LOCATION]', + '[WORKFLOW]', + '[EXECUTION]' + ); + + cancel_execution_sample($formattedName); +} +// [END workflowexecutions_v1beta_generated_Executions_CancelExecution_sync] diff --git a/owl-bot-staging/Workflows/Executions/v1beta/samples/V1beta/ExecutionsClient/create_execution.php b/owl-bot-staging/Workflows/Executions/v1beta/samples/V1beta/ExecutionsClient/create_execution.php new file mode 100644 index 000000000000..9f65c09d2b2e --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1beta/samples/V1beta/ExecutionsClient/create_execution.php @@ -0,0 +1,71 @@ +createExecution($formattedParent, $execution); + 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 = ExecutionsClient::workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); + + create_execution_sample($formattedParent); +} +// [END workflowexecutions_v1beta_generated_Executions_CreateExecution_sync] diff --git a/owl-bot-staging/Workflows/Executions/v1beta/samples/V1beta/ExecutionsClient/get_execution.php b/owl-bot-staging/Workflows/Executions/v1beta/samples/V1beta/ExecutionsClient/get_execution.php new file mode 100644 index 000000000000..1ff13e38f564 --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1beta/samples/V1beta/ExecutionsClient/get_execution.php @@ -0,0 +1,73 @@ +getExecution($formattedName); + 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 = ExecutionsClient::executionName( + '[PROJECT]', + '[LOCATION]', + '[WORKFLOW]', + '[EXECUTION]' + ); + + get_execution_sample($formattedName); +} +// [END workflowexecutions_v1beta_generated_Executions_GetExecution_sync] diff --git a/owl-bot-staging/Workflows/Executions/v1beta/samples/V1beta/ExecutionsClient/list_executions.php b/owl-bot-staging/Workflows/Executions/v1beta/samples/V1beta/ExecutionsClient/list_executions.php new file mode 100644 index 000000000000..f6ac20c7208c --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1beta/samples/V1beta/ExecutionsClient/list_executions.php @@ -0,0 +1,75 @@ +listExecutions($formattedParent); + + /** @var Execution $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 = ExecutionsClient::workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); + + list_executions_sample($formattedParent); +} +// [END workflowexecutions_v1beta_generated_Executions_ListExecutions_sync] diff --git a/owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/ExecutionsClient.php b/owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/ExecutionsClient.php new file mode 100644 index 000000000000..1e4a13ee7b14 --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/ExecutionsClient.php @@ -0,0 +1,36 @@ +executionName('[PROJECT]', '[LOCATION]', '[WORKFLOW]', '[EXECUTION]'); + * $response = $executionsClient->cancelExecution($formattedName); + * } finally { + * $executionsClient->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. + * + * @experimental + */ +class ExecutionsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.workflows.executions.v1beta.Executions'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'workflowexecutions.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 $executionNameTemplate; + + private static $workflowNameTemplate; + + private static $pathTemplateMap; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/executions_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/executions_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/executions_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/executions_rest_client_config.php', + ], + ], + ]; + } + + private static function getExecutionNameTemplate() + { + if (self::$executionNameTemplate == null) { + self::$executionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}'); + } + + return self::$executionNameTemplate; + } + + private static function getWorkflowNameTemplate() + { + if (self::$workflowNameTemplate == null) { + self::$workflowNameTemplate = new PathTemplate('projects/{project}/locations/{location}/workflows/{workflow}'); + } + + return self::$workflowNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'execution' => self::getExecutionNameTemplate(), + 'workflow' => self::getWorkflowNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a execution + * resource. + * + * @param string $project + * @param string $location + * @param string $workflow + * @param string $execution + * + * @return string The formatted execution resource. + * + * @experimental + */ + public static function executionName($project, $location, $workflow, $execution) + { + return self::getExecutionNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'workflow' => $workflow, + 'execution' => $execution, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a workflow + * resource. + * + * @param string $project + * @param string $location + * @param string $workflow + * + * @return string The formatted workflow resource. + * + * @experimental + */ + public static function workflowName($project, $location, $workflow) + { + return self::getWorkflowNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'workflow' => $workflow, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - execution: projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + * - workflow: projects/{project}/locations/{location}/workflows/{workflow} + * + * 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. + * + * @experimental + */ + 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"); + } + + /** + * 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 'workflowexecutions.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 + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** + * Cancels an execution of the given name. + * + * Sample code: + * ``` + * $executionsClient = new ExecutionsClient(); + * try { + * $formattedName = $executionsClient->executionName('[PROJECT]', '[LOCATION]', '[WORKFLOW]', '[EXECUTION]'); + * $response = $executionsClient->cancelExecution($formattedName); + * } finally { + * $executionsClient->close(); + * } + * ``` + * + * @param string $name Required. Name of the execution to be cancelled. + * Format: + * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + * @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\Workflows\Executions\V1beta\Execution + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function cancelExecution($name, array $optionalArgs = []) + { + $request = new CancelExecutionRequest(); + $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('CancelExecution', Execution::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a new execution using the latest revision of the given workflow. + * + * Sample code: + * ``` + * $executionsClient = new ExecutionsClient(); + * try { + * $formattedParent = $executionsClient->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); + * $execution = new Execution(); + * $response = $executionsClient->createExecution($formattedParent, $execution); + * } finally { + * $executionsClient->close(); + * } + * ``` + * + * @param string $parent Required. Name of the workflow for which an execution should be created. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * The latest revision of the workflow will be used. + * @param Execution $execution Required. Execution to be created. + * @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\Workflows\Executions\V1beta\Execution + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function createExecution($parent, $execution, array $optionalArgs = []) + { + $request = new CreateExecutionRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setExecution($execution); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateExecution', Execution::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns an execution of the given name. + * + * Sample code: + * ``` + * $executionsClient = new ExecutionsClient(); + * try { + * $formattedName = $executionsClient->executionName('[PROJECT]', '[LOCATION]', '[WORKFLOW]', '[EXECUTION]'); + * $response = $executionsClient->getExecution($formattedName); + * } finally { + * $executionsClient->close(); + * } + * ``` + * + * @param string $name Required. Name of the execution to be retrieved. + * Format: + * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + * @param array $optionalArgs { + * Optional. + * + * @type int $view + * Optional. A view defining which fields should be filled in the returned execution. + * The API will default to the FULL view. + * For allowed values, use constants defined on {@see \Google\Cloud\Workflows\Executions\V1beta\ExecutionView} + * @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\Workflows\Executions\V1beta\Execution + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function getExecution($name, array $optionalArgs = []) + { + $request = new GetExecutionRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['view'])) { + $request->setView($optionalArgs['view']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetExecution', Execution::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns a list of executions which belong to the workflow with + * the given name. The method returns executions of all workflow + * revisions. Returned executions are ordered by their start time (newest + * first). + * + * Sample code: + * ``` + * $executionsClient = new ExecutionsClient(); + * try { + * $formattedParent = $executionsClient->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); + * // Iterate over pages of elements + * $pagedResponse = $executionsClient->listExecutions($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $executionsClient->listExecutions($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $executionsClient->close(); + * } + * ``` + * + * @param string $parent Required. Name of the workflow for which the executions should be listed. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * @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 int $view + * Optional. A view defining which fields should be filled in the returned executions. + * The API will default to the BASIC view. + * For allowed values, use constants defined on {@see \Google\Cloud\Workflows\Executions\V1beta\ExecutionView} + * @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 + * + * @experimental + */ + public function listExecutions($parent, array $optionalArgs = []) + { + $request = new ListExecutionsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['view'])) { + $request->setView($optionalArgs['view']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListExecutions', $optionalArgs, ListExecutionsResponse::class, $request); + } +} diff --git a/owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/gapic_metadata.json b/owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/gapic_metadata.json new file mode 100644 index 000000000000..81c967306926 --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/gapic_metadata.json @@ -0,0 +1,38 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.workflows.executions.v1beta", + "libraryPackage": "Google\\Cloud\\Workflows\\Executions\\V1beta", + "services": { + "Executions": { + "clients": { + "grpc": { + "libraryClient": "ExecutionsGapicClient", + "rpcs": { + "CancelExecution": { + "methods": [ + "cancelExecution" + ] + }, + "CreateExecution": { + "methods": [ + "createExecution" + ] + }, + "GetExecution": { + "methods": [ + "getExecution" + ] + }, + "ListExecutions": { + "methods": [ + "listExecutions" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/resources/executions_client_config.json b/owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/resources/executions_client_config.json new file mode 100644 index 000000000000..a3c456bd2230 --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/resources/executions_client_config.json @@ -0,0 +1,46 @@ +{ + "interfaces": { + "google.cloud.workflows.executions.v1beta.Executions": { + "retry_codes": { + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "non_idempotent": [] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 20000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 20000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CancelExecution": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateExecution": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetExecution": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListExecutions": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/resources/executions_descriptor_config.php b/owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/resources/executions_descriptor_config.php new file mode 100644 index 000000000000..0836e4ff2d47 --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/resources/executions_descriptor_config.php @@ -0,0 +1,18 @@ + [ + 'google.cloud.workflows.executions.v1beta.Executions' => [ + 'ListExecutions' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getExecutions', + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/resources/executions_rest_client_config.php b/owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/resources/executions_rest_client_config.php new file mode 100644 index 000000000000..1a24fec7f007 --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/resources/executions_rest_client_config.php @@ -0,0 +1,54 @@ + [ + 'google.cloud.workflows.executions.v1beta.Executions' => [ + 'CancelExecution' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/workflows/*/executions/*}:cancel', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'CreateExecution' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*/workflows/*}/executions', + 'body' => 'execution', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'GetExecution' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/workflows/*/executions/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListExecutions' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*/workflows/*}/executions', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Workflows/Executions/v1beta/tests/Unit/V1beta/ExecutionsClientTest.php b/owl-bot-staging/Workflows/Executions/v1beta/tests/Unit/V1beta/ExecutionsClientTest.php new file mode 100644 index 000000000000..9db7bf3fc1ab --- /dev/null +++ b/owl-bot-staging/Workflows/Executions/v1beta/tests/Unit/V1beta/ExecutionsClientTest.php @@ -0,0 +1,332 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ExecutionsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ExecutionsClient($options); + } + + /** @test */ + public function cancelExecutionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $argument = 'argument-1589682499'; + $result = 'result-934426595'; + $workflowRevisionId = 'workflowRevisionId-1453295745'; + $expectedResponse = new Execution(); + $expectedResponse->setName($name2); + $expectedResponse->setArgument($argument); + $expectedResponse->setResult($result); + $expectedResponse->setWorkflowRevisionId($workflowRevisionId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[WORKFLOW]', '[EXECUTION]'); + $response = $gapicClient->cancelExecution($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.workflows.executions.v1beta.Executions/CancelExecution', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function cancelExecutionExceptionTest() + { + $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->executionName('[PROJECT]', '[LOCATION]', '[WORKFLOW]', '[EXECUTION]'); + try { + $gapicClient->cancelExecution($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 createExecutionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $argument = 'argument-1589682499'; + $result = 'result-934426595'; + $workflowRevisionId = 'workflowRevisionId-1453295745'; + $expectedResponse = new Execution(); + $expectedResponse->setName($name); + $expectedResponse->setArgument($argument); + $expectedResponse->setResult($result); + $expectedResponse->setWorkflowRevisionId($workflowRevisionId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); + $execution = new Execution(); + $response = $gapicClient->createExecution($formattedParent, $execution); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.workflows.executions.v1beta.Executions/CreateExecution', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getExecution(); + $this->assertProtobufEquals($execution, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createExecutionExceptionTest() + { + $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->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); + $execution = new Execution(); + try { + $gapicClient->createExecution($formattedParent, $execution); + // 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 getExecutionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $argument = 'argument-1589682499'; + $result = 'result-934426595'; + $workflowRevisionId = 'workflowRevisionId-1453295745'; + $expectedResponse = new Execution(); + $expectedResponse->setName($name2); + $expectedResponse->setArgument($argument); + $expectedResponse->setResult($result); + $expectedResponse->setWorkflowRevisionId($workflowRevisionId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[WORKFLOW]', '[EXECUTION]'); + $response = $gapicClient->getExecution($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.workflows.executions.v1beta.Executions/GetExecution', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getExecutionExceptionTest() + { + $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->executionName('[PROJECT]', '[LOCATION]', '[WORKFLOW]', '[EXECUTION]'); + try { + $gapicClient->getExecution($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 listExecutionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $executionsElement = new Execution(); + $executions = [ + $executionsElement, + ]; + $expectedResponse = new ListExecutionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setExecutions($executions); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); + $response = $gapicClient->listExecutions($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getExecutions()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.workflows.executions.v1beta.Executions/ListExecutions', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listExecutionsExceptionTest() + { + $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->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); + try { + $gapicClient->listExecutions($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()); + } +} diff --git a/owl-bot-staging/Workflows/v1/proto/src/GPBMetadata/Google/Cloud/Workflows/V1/Workflows.php b/owl-bot-staging/Workflows/v1/proto/src/GPBMetadata/Google/Cloud/Workflows/V1/Workflows.php new file mode 100644 index 0000000000000000000000000000000000000000..69a34d200c3b524890ae851167587bd1f659c7b5 GIT binary patch literal 4839 zcmbtY&rjQS6kniF@=_rEwy0^UZf;tsz)HN*s#`;8bNQ^WU3QwZ^ZtoR)lS>3r)russi&QH+WUU(uVVtGq2q$%?|aXm_v`bXeeZ#@ z<-k>GiCWavd|H=kdy>CJCC9aWTenTA)@n4UE9v%*W0=&$-LCiOpl`W zVcAB@(tX3WB&M)x>2z{R3T!gjYmSYc&r1SQg#`lxQC+rt>ROsvU8J7w8jf$f6%;KL zn$(X%$nH!|g^y+CjD|EBU@R04ft;6ow?*Smmn4_^E!UdkxS4@YbX7efV2Wc@70a?& z6l}{Y6uLfjO}t5Q!8EAlpG@bWLCt!RZfR}9c2B0dM#FOH8)VtGnr_Ro469jPby$&} z%*iNs7`f7pdAcjX7)m8MRN>nSylr?)moV8P#`oaGfg*4 zXLxiq)HS;~lkF&Hq0psJh;sopl}uSy!b8C#(P02#2V);f2z-%*F9IA0r}6>5BZ8I}X7lSzp*Z+T86+7< zxwLI~XizoknN!SWaB>?`x=T?|We_t%c#@jU3iASgJ}Qt%tK}dchFZh@Y0bm=2u1v% zr~6ZX0K=wMqo$V`kp>Z^EKnYu=z=EWaJr6@ z)4-es#jU_8f6t-3s>fz;_4A;vx%>vI=01c|>_0gV>5b==lKOOIy;53Oez;s(Out7) zA^G^px>{OWTU|>hvNMp1S3n8|F^wUXQ5b4#W-9=bEDU^-$j(B#*DvxGo!lG@afoCB z&aQ7L8@-4ChLwel<;_w$f$>N^T~Rib<+4&Nm(l~dI-H58g}e{h1*Ke8%d1OjxwKg- z_qcZ!M%fV)VRGwe^Bjz`TioMyb#=T!GSc|W}B$fm6a(@fqMm!0miB<~BWo#H5#x#*%g&Ha#o^JT;Hg>`R@e$m1y zL+-+`qq*2+K^|Bq4e(A9_7AmEImAHDLekNiRP}Io;x#lx2mrt3+uPLQ^q3@LFx)Uq z+=2q8BWW11-8vR}ZI3ftGS`8L9&Db2YY8QHASpazHOqMBY9Cd~xW%Gh`f3bIz}!gZ zEejb|-_mL(0cWG7P`pSGG!vhJ0gA(BqQOgUzzDVK!I)+lK6XsA z7VtF}H~z3CaK~sN38b2M`x5z>J~$v5mRR<< zsnnwobYJfNH-G%~{eVnn*c;h?z!LKjDNV=7XgWqhFO`r`$d3s~#Ttvu90NHfCjj@; z>A8CcFtUx{4G3c_Io)}w@Ewo5O2F8`h9t*@>7b~+hOxjiRC&R;oaQHqF9KU z`lWIy2>lJws?i1Z>&`*ZKHd46yHlLK!|Pr|J>Rci@zk9c+Bae>^|qX4%P*9SQ0yJQ zzbpAI-*>!%Ebs2__6{Mf>bL)Ea27DvH;_(kZM|@P_lEKH14s-zi15Rd7SO5S3 literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/CreateWorkflowRequest.php b/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/CreateWorkflowRequest.php new file mode 100644 index 000000000000..6a782e25355d --- /dev/null +++ b/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/CreateWorkflowRequest.php @@ -0,0 +1,201 @@ +google.cloud.workflows.v1.CreateWorkflowRequest + */ +class CreateWorkflowRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Project and location in which the workflow should be created. + * Format: projects/{project}/locations/{location} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Workflow to be created. + * + * Generated from protobuf field .google.cloud.workflows.v1.Workflow workflow = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $workflow = null; + /** + * Required. The ID of the workflow to be created. It has to fulfill the + * following requirements: + * * Must contain only letters, numbers, underscores and hyphens. + * * Must start with a letter. + * * Must be between 1-64 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project and location. + * + * Generated from protobuf field string workflow_id = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $workflow_id = ''; + + /** + * @param string $parent Required. Project and location in which the workflow should be created. + * Format: projects/{project}/locations/{location} + * Please see {@see WorkflowsClient::locationName()} for help formatting this field. + * @param \Google\Cloud\Workflows\V1\Workflow $workflow Required. Workflow to be created. + * @param string $workflowId Required. The ID of the workflow to be created. It has to fulfill the + * following requirements: + * + * * Must contain only letters, numbers, underscores and hyphens. + * * Must start with a letter. + * * Must be between 1-64 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project and location. + * + * @return \Google\Cloud\Workflows\V1\CreateWorkflowRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Workflows\V1\Workflow $workflow, string $workflowId): self + { + return (new self()) + ->setParent($parent) + ->setWorkflow($workflow) + ->setWorkflowId($workflowId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Project and location in which the workflow should be created. + * Format: projects/{project}/locations/{location} + * @type \Google\Cloud\Workflows\V1\Workflow $workflow + * Required. Workflow to be created. + * @type string $workflow_id + * Required. The ID of the workflow to be created. It has to fulfill the + * following requirements: + * * Must contain only letters, numbers, underscores and hyphens. + * * Must start with a letter. + * * Must be between 1-64 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project and location. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Workflows\V1\Workflows::initOnce(); + parent::__construct($data); + } + + /** + * Required. Project and location in which the workflow should be created. + * Format: projects/{project}/locations/{location} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Project and location in which the workflow should be created. + * Format: projects/{project}/locations/{location} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. Workflow to be created. + * + * Generated from protobuf field .google.cloud.workflows.v1.Workflow workflow = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Workflows\V1\Workflow|null + */ + public function getWorkflow() + { + return $this->workflow; + } + + public function hasWorkflow() + { + return isset($this->workflow); + } + + public function clearWorkflow() + { + unset($this->workflow); + } + + /** + * Required. Workflow to be created. + * + * Generated from protobuf field .google.cloud.workflows.v1.Workflow workflow = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Workflows\V1\Workflow $var + * @return $this + */ + public function setWorkflow($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Workflows\V1\Workflow::class); + $this->workflow = $var; + + return $this; + } + + /** + * Required. The ID of the workflow to be created. It has to fulfill the + * following requirements: + * * Must contain only letters, numbers, underscores and hyphens. + * * Must start with a letter. + * * Must be between 1-64 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project and location. + * + * Generated from protobuf field string workflow_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getWorkflowId() + { + return $this->workflow_id; + } + + /** + * Required. The ID of the workflow to be created. It has to fulfill the + * following requirements: + * * Must contain only letters, numbers, underscores and hyphens. + * * Must start with a letter. + * * Must be between 1-64 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project and location. + * + * Generated from protobuf field string workflow_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setWorkflowId($var) + { + GPBUtil::checkString($var, True); + $this->workflow_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/DeleteWorkflowRequest.php b/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/DeleteWorkflowRequest.php new file mode 100644 index 000000000000..ded08ff65dce --- /dev/null +++ b/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/DeleteWorkflowRequest.php @@ -0,0 +1,88 @@ +google.cloud.workflows.v1.DeleteWorkflowRequest + */ +class DeleteWorkflowRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the workflow to be deleted. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the workflow to be deleted. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * Please see {@see WorkflowsClient::workflowName()} for help formatting this field. + * + * @return \Google\Cloud\Workflows\V1\DeleteWorkflowRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the workflow to be deleted. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Workflows\V1\Workflows::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the workflow to be deleted. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the workflow to be deleted. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * + * 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/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/GetWorkflowRequest.php b/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/GetWorkflowRequest.php new file mode 100644 index 000000000000..8bffc47fd013 --- /dev/null +++ b/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/GetWorkflowRequest.php @@ -0,0 +1,137 @@ +google.cloud.workflows.v1.GetWorkflowRequest + */ +class GetWorkflowRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the workflow for which information should be retrieved. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. The revision of the workflow to retrieve. If the revision_id is + * empty, the latest revision is retrieved. + * The format is "000001-a4d", where the first six characters define + * the zero-padded decimal revision number. They are followed by a hyphen and + * three hexadecimal characters. + * + * Generated from protobuf field string revision_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $revision_id = ''; + + /** + * @param string $name Required. Name of the workflow for which information should be retrieved. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * Please see {@see WorkflowsClient::workflowName()} for help formatting this field. + * + * @return \Google\Cloud\Workflows\V1\GetWorkflowRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the workflow for which information should be retrieved. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * @type string $revision_id + * Optional. The revision of the workflow to retrieve. If the revision_id is + * empty, the latest revision is retrieved. + * The format is "000001-a4d", where the first six characters define + * the zero-padded decimal revision number. They are followed by a hyphen and + * three hexadecimal characters. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Workflows\V1\Workflows::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the workflow for which information should be retrieved. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the workflow for which information should be retrieved. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The revision of the workflow to retrieve. If the revision_id is + * empty, the latest revision is retrieved. + * The format is "000001-a4d", where the first six characters define + * the zero-padded decimal revision number. They are followed by a hyphen and + * three hexadecimal characters. + * + * Generated from protobuf field string revision_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRevisionId() + { + return $this->revision_id; + } + + /** + * Optional. The revision of the workflow to retrieve. If the revision_id is + * empty, the latest revision is retrieved. + * The format is "000001-a4d", where the first six characters define + * the zero-padded decimal revision number. They are followed by a hyphen and + * three hexadecimal characters. + * + * Generated from protobuf field string revision_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRevisionId($var) + { + GPBUtil::checkString($var, True); + $this->revision_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/ListWorkflowsRequest.php b/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/ListWorkflowsRequest.php new file mode 100644 index 000000000000..536f26ddfc4f --- /dev/null +++ b/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/ListWorkflowsRequest.php @@ -0,0 +1,260 @@ +google.cloud.workflows.v1.ListWorkflowsRequest + */ +class ListWorkflowsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Project and location from which the workflows should be listed. + * Format: projects/{project}/locations/{location} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Maximum number of workflows to return per call. The service might return + * fewer than this value even if not at the end of the collection. If a value + * is not specified, a default value of 500 is used. The maximum permitted + * value is 1000 and values greater than 1000 are coerced down to 1000. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * A page token, received from a previous `ListWorkflows` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListWorkflows` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * Filter to restrict results to specific workflows. + * + * Generated from protobuf field string filter = 4; + */ + protected $filter = ''; + /** + * Comma-separated list of fields that specify the order of the results. + * Default sorting order for a field is ascending. To specify descending order + * for a field, append a "desc" suffix. + * If not specified, the results are returned in an unspecified order. + * + * Generated from protobuf field string order_by = 5; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. Project and location from which the workflows should be listed. + * Format: projects/{project}/locations/{location} + * Please see {@see WorkflowsClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\Workflows\V1\ListWorkflowsRequest + * + * @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. Project and location from which the workflows should be listed. + * Format: projects/{project}/locations/{location} + * @type int $page_size + * Maximum number of workflows to return per call. The service might return + * fewer than this value even if not at the end of the collection. If a value + * is not specified, a default value of 500 is used. The maximum permitted + * value is 1000 and values greater than 1000 are coerced down to 1000. + * @type string $page_token + * A page token, received from a previous `ListWorkflows` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListWorkflows` must + * match the call that provided the page token. + * @type string $filter + * Filter to restrict results to specific workflows. + * @type string $order_by + * Comma-separated list of fields that specify the order of the results. + * Default sorting order for a field is ascending. To specify descending order + * for a field, append a "desc" suffix. + * If not specified, the results are returned in an unspecified order. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Workflows\V1\Workflows::initOnce(); + parent::__construct($data); + } + + /** + * Required. Project and location from which the workflows should be listed. + * Format: projects/{project}/locations/{location} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Project and location from which the workflows should be listed. + * Format: projects/{project}/locations/{location} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Maximum number of workflows to return per call. The service might return + * fewer than this value even if not at the end of the collection. If a value + * is not specified, a default value of 500 is used. The maximum permitted + * value is 1000 and values greater than 1000 are coerced down to 1000. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Maximum number of workflows to return per call. The service might return + * fewer than this value even if not at the end of the collection. If a value + * is not specified, a default value of 500 is used. The maximum permitted + * value is 1000 and values greater than 1000 are coerced down to 1000. + * + * 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; + } + + /** + * A page token, received from a previous `ListWorkflows` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListWorkflows` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A page token, received from a previous `ListWorkflows` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListWorkflows` must + * match 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; + } + + /** + * Filter to restrict results to specific workflows. + * + * Generated from protobuf field string filter = 4; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Filter to restrict results to specific workflows. + * + * Generated from protobuf field string filter = 4; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Comma-separated list of fields that specify the order of the results. + * Default sorting order for a field is ascending. To specify descending order + * for a field, append a "desc" suffix. + * If not specified, the results are returned in an unspecified order. + * + * Generated from protobuf field string order_by = 5; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Comma-separated list of fields that specify the order of the results. + * Default sorting order for a field is ascending. To specify descending order + * for a field, append a "desc" suffix. + * If not specified, the results are returned in an unspecified order. + * + * Generated from protobuf field string order_by = 5; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/ListWorkflowsResponse.php b/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/ListWorkflowsResponse.php new file mode 100644 index 000000000000..34d3acf2bb91 --- /dev/null +++ b/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/ListWorkflowsResponse.php @@ -0,0 +1,141 @@ +google.cloud.workflows.v1.ListWorkflowsResponse + */ +class ListWorkflowsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The workflows that match the request. + * + * Generated from protobuf field repeated .google.cloud.workflows.v1.Workflow workflows = 1; + */ + private $workflows; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Unreachable resources. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Workflows\V1\Workflow>|\Google\Protobuf\Internal\RepeatedField $workflows + * The workflows that match the request. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Unreachable resources. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Workflows\V1\Workflows::initOnce(); + parent::__construct($data); + } + + /** + * The workflows that match the request. + * + * Generated from protobuf field repeated .google.cloud.workflows.v1.Workflow workflows = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getWorkflows() + { + return $this->workflows; + } + + /** + * The workflows that match the request. + * + * Generated from protobuf field repeated .google.cloud.workflows.v1.Workflow workflows = 1; + * @param array<\Google\Cloud\Workflows\V1\Workflow>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setWorkflows($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Workflows\V1\Workflow::class); + $this->workflows = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Unreachable resources. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Unreachable resources. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/OperationMetadata.php b/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/OperationMetadata.php new file mode 100644 index 000000000000..498dac12a82c --- /dev/null +++ b/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/OperationMetadata.php @@ -0,0 +1,223 @@ +google.cloud.workflows.v1.OperationMetadata + */ +class OperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; + */ + protected $create_time = null; + /** + * The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + */ + protected $end_time = null; + /** + * Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3; + */ + protected $target = ''; + /** + * Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4; + */ + protected $verb = ''; + /** + * API version used to start the operation. + * + * Generated from protobuf field string api_version = 5; + */ + protected $api_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * The time the operation was created. + * @type \Google\Protobuf\Timestamp $end_time + * The time the operation finished running. + * @type string $target + * Server-defined resource path for the target of the operation. + * @type string $verb + * Name of the verb executed by the operation. + * @type string $api_version + * API version used to start the operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Workflows\V1\Workflows::initOnce(); + parent::__construct($data); + } + + /** + * The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3; + * @return string + */ + public function getTarget() + { + return $this->target; + } + + /** + * Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + + /** + * Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4; + * @return string + */ + public function getVerb() + { + return $this->verb; + } + + /** + * Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4; + * @param string $var + * @return $this + */ + public function setVerb($var) + { + GPBUtil::checkString($var, True); + $this->verb = $var; + + return $this; + } + + /** + * API version used to start the operation. + * + * Generated from protobuf field string api_version = 5; + * @return string + */ + public function getApiVersion() + { + return $this->api_version; + } + + /** + * API version used to start the operation. + * + * Generated from protobuf field string api_version = 5; + * @param string $var + * @return $this + */ + public function setApiVersion($var) + { + GPBUtil::checkString($var, True); + $this->api_version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/UpdateWorkflowRequest.php b/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/UpdateWorkflowRequest.php new file mode 100644 index 000000000000..6a77b5a19df4 --- /dev/null +++ b/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/UpdateWorkflowRequest.php @@ -0,0 +1,143 @@ +google.cloud.workflows.v1.UpdateWorkflowRequest + */ +class UpdateWorkflowRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Workflow to be updated. + * + * Generated from protobuf field .google.cloud.workflows.v1.Workflow workflow = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $workflow = null; + /** + * List of fields to be updated. If not present, the entire workflow + * will be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Workflows\V1\Workflow $workflow Required. Workflow to be updated. + * @param \Google\Protobuf\FieldMask $updateMask List of fields to be updated. If not present, the entire workflow + * will be updated. + * + * @return \Google\Cloud\Workflows\V1\UpdateWorkflowRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Workflows\V1\Workflow $workflow, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setWorkflow($workflow) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Workflows\V1\Workflow $workflow + * Required. Workflow to be updated. + * @type \Google\Protobuf\FieldMask $update_mask + * List of fields to be updated. If not present, the entire workflow + * will be updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Workflows\V1\Workflows::initOnce(); + parent::__construct($data); + } + + /** + * Required. Workflow to be updated. + * + * Generated from protobuf field .google.cloud.workflows.v1.Workflow workflow = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Workflows\V1\Workflow|null + */ + public function getWorkflow() + { + return $this->workflow; + } + + public function hasWorkflow() + { + return isset($this->workflow); + } + + public function clearWorkflow() + { + unset($this->workflow); + } + + /** + * Required. Workflow to be updated. + * + * Generated from protobuf field .google.cloud.workflows.v1.Workflow workflow = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Workflows\V1\Workflow $var + * @return $this + */ + public function setWorkflow($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Workflows\V1\Workflow::class); + $this->workflow = $var; + + return $this; + } + + /** + * List of fields to be updated. If not present, the entire workflow + * will be 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); + } + + /** + * List of fields to be updated. If not present, the entire workflow + * will be 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; + } + +} + diff --git a/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/Workflow.php b/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/Workflow.php new file mode 100644 index 000000000000..c57333d720cc --- /dev/null +++ b/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/Workflow.php @@ -0,0 +1,713 @@ +google.cloud.workflows.v1.Workflow + */ +class Workflow extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the workflow. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Description of the workflow provided by the user. + * Must be at most 1000 unicode characters long. + * + * Generated from protobuf field string description = 2; + */ + protected $description = ''; + /** + * Output only. State of the workflow deployment. + * + * Generated from protobuf field .google.cloud.workflows.v1.Workflow.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. The revision of the workflow. + * A new revision of a workflow is created as a result of updating the + * following properties of a workflow: + * - [Service account][google.cloud.workflows.v1.Workflow.service_account] + * - [Workflow code to be + * executed][google.cloud.workflows.v1.Workflow.source_contents] + * The format is "000001-a4d", where the first six characters define + * the zero-padded revision ordinal number. They are followed by a hyphen and + * three hexadecimal random characters. + * + * Generated from protobuf field string revision_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $revision_id = ''; + /** + * Output only. The timestamp for when the workflow was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The timestamp for when the workflow was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. The timestamp for the latest revision of the workflow's + * creation. + * + * Generated from protobuf field .google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $revision_create_time = null; + /** + * Labels associated with this workflow. + * Labels can contain at most 64 entries. Keys and values can be no longer + * than 63 characters and can only contain lowercase letters, numeric + * characters, underscores, and dashes. Label keys must start with a letter. + * International characters are allowed. + * + * Generated from protobuf field map labels = 8; + */ + private $labels; + /** + * The service account associated with the latest workflow version. + * This service account represents the identity of the workflow and determines + * what permissions the workflow has. + * Format: projects/{project}/serviceAccounts/{account} or {account} + * Using `-` as a wildcard for the `{project}` or not providing one at all + * will infer the project from the account. The `{account}` value can be the + * `email` address or the `unique_id` of the service account. + * If not provided, workflow will use the project's default service account. + * Modifying this field for an existing workflow results in a new workflow + * revision. + * + * Generated from protobuf field string service_account = 9; + */ + protected $service_account = ''; + /** + * Optional. The resource name of a KMS crypto key used to encrypt or decrypt + * the data associated with the workflow. + * Format: + * projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey} + * Using `-` as a wildcard for the `{project}` or not providing one at all + * will infer the project from the account. + * If not provided, data associated with the workflow will not be + * CMEK-encrypted. + * + * Generated from protobuf field string crypto_key_name = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $crypto_key_name = ''; + /** + * Output only. Error regarding the state of the workflow. For example, this + * field will have error details if the execution data is unavailable due to + * revoked KMS key permissions. + * + * Generated from protobuf field .google.cloud.workflows.v1.Workflow.StateError state_error = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state_error = null; + /** + * Optional. Describes the level of platform logging to apply to calls and + * call responses during executions of this workflow. If both the workflow and + * the execution specify a logging level, the execution level takes + * precedence. + * + * Generated from protobuf field .google.cloud.workflows.v1.Workflow.CallLogLevel call_log_level = 13 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $call_log_level = 0; + /** + * Optional. User-defined environment variables associated with this workflow + * revision. This map has a maximum length of 20. Each string can take up to + * 40KiB. Keys cannot be empty strings and cannot start with “GOOGLE” or + * “WORKFLOWS". + * + * Generated from protobuf field map user_env_vars = 14 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $user_env_vars; + protected $source_code; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The resource name of the workflow. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * @type string $description + * Description of the workflow provided by the user. + * Must be at most 1000 unicode characters long. + * @type int $state + * Output only. State of the workflow deployment. + * @type string $revision_id + * Output only. The revision of the workflow. + * A new revision of a workflow is created as a result of updating the + * following properties of a workflow: + * - [Service account][google.cloud.workflows.v1.Workflow.service_account] + * - [Workflow code to be + * executed][google.cloud.workflows.v1.Workflow.source_contents] + * The format is "000001-a4d", where the first six characters define + * the zero-padded revision ordinal number. They are followed by a hyphen and + * three hexadecimal random characters. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The timestamp for when the workflow was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The timestamp for when the workflow was last updated. + * @type \Google\Protobuf\Timestamp $revision_create_time + * Output only. The timestamp for the latest revision of the workflow's + * creation. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels associated with this workflow. + * Labels can contain at most 64 entries. Keys and values can be no longer + * than 63 characters and can only contain lowercase letters, numeric + * characters, underscores, and dashes. Label keys must start with a letter. + * International characters are allowed. + * @type string $service_account + * The service account associated with the latest workflow version. + * This service account represents the identity of the workflow and determines + * what permissions the workflow has. + * Format: projects/{project}/serviceAccounts/{account} or {account} + * Using `-` as a wildcard for the `{project}` or not providing one at all + * will infer the project from the account. The `{account}` value can be the + * `email` address or the `unique_id` of the service account. + * If not provided, workflow will use the project's default service account. + * Modifying this field for an existing workflow results in a new workflow + * revision. + * @type string $source_contents + * Workflow code to be executed. The size limit is 128KB. + * @type string $crypto_key_name + * Optional. The resource name of a KMS crypto key used to encrypt or decrypt + * the data associated with the workflow. + * Format: + * projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey} + * Using `-` as a wildcard for the `{project}` or not providing one at all + * will infer the project from the account. + * If not provided, data associated with the workflow will not be + * CMEK-encrypted. + * @type \Google\Cloud\Workflows\V1\Workflow\StateError $state_error + * Output only. Error regarding the state of the workflow. For example, this + * field will have error details if the execution data is unavailable due to + * revoked KMS key permissions. + * @type int $call_log_level + * Optional. Describes the level of platform logging to apply to calls and + * call responses during executions of this workflow. If both the workflow and + * the execution specify a logging level, the execution level takes + * precedence. + * @type array|\Google\Protobuf\Internal\MapField $user_env_vars + * Optional. User-defined environment variables associated with this workflow + * revision. This map has a maximum length of 20. Each string can take up to + * 40KiB. Keys cannot be empty strings and cannot start with “GOOGLE” or + * “WORKFLOWS". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Workflows\V1\Workflows::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the workflow. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The resource name of the workflow. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Description of the workflow provided by the user. + * Must be at most 1000 unicode characters long. + * + * Generated from protobuf field string description = 2; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Description of the workflow provided by the user. + * Must be at most 1000 unicode characters long. + * + * Generated from protobuf field string description = 2; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. State of the workflow deployment. + * + * Generated from protobuf field .google.cloud.workflows.v1.Workflow.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. State of the workflow deployment. + * + * Generated from protobuf field .google.cloud.workflows.v1.Workflow.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Workflows\V1\Workflow\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. The revision of the workflow. + * A new revision of a workflow is created as a result of updating the + * following properties of a workflow: + * - [Service account][google.cloud.workflows.v1.Workflow.service_account] + * - [Workflow code to be + * executed][google.cloud.workflows.v1.Workflow.source_contents] + * The format is "000001-a4d", where the first six characters define + * the zero-padded revision ordinal number. They are followed by a hyphen and + * three hexadecimal random characters. + * + * Generated from protobuf field string revision_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getRevisionId() + { + return $this->revision_id; + } + + /** + * Output only. The revision of the workflow. + * A new revision of a workflow is created as a result of updating the + * following properties of a workflow: + * - [Service account][google.cloud.workflows.v1.Workflow.service_account] + * - [Workflow code to be + * executed][google.cloud.workflows.v1.Workflow.source_contents] + * The format is "000001-a4d", where the first six characters define + * the zero-padded revision ordinal number. They are followed by a hyphen and + * three hexadecimal random characters. + * + * Generated from protobuf field string revision_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setRevisionId($var) + { + GPBUtil::checkString($var, True); + $this->revision_id = $var; + + return $this; + } + + /** + * Output only. The timestamp for when the workflow was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The timestamp for when the workflow was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The timestamp for when the workflow was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The timestamp for when the workflow was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. The timestamp for the latest revision of the workflow's + * creation. + * + * Generated from protobuf field .google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getRevisionCreateTime() + { + return $this->revision_create_time; + } + + public function hasRevisionCreateTime() + { + return isset($this->revision_create_time); + } + + public function clearRevisionCreateTime() + { + unset($this->revision_create_time); + } + + /** + * Output only. The timestamp for the latest revision of the workflow's + * creation. + * + * Generated from protobuf field .google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setRevisionCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->revision_create_time = $var; + + return $this; + } + + /** + * Labels associated with this workflow. + * Labels can contain at most 64 entries. Keys and values can be no longer + * than 63 characters and can only contain lowercase letters, numeric + * characters, underscores, and dashes. Label keys must start with a letter. + * International characters are allowed. + * + * Generated from protobuf field map labels = 8; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels associated with this workflow. + * Labels can contain at most 64 entries. Keys and values can be no longer + * than 63 characters and can only contain lowercase letters, numeric + * characters, underscores, and dashes. Label keys must start with a letter. + * International characters are allowed. + * + * Generated from protobuf field map labels = 8; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * The service account associated with the latest workflow version. + * This service account represents the identity of the workflow and determines + * what permissions the workflow has. + * Format: projects/{project}/serviceAccounts/{account} or {account} + * Using `-` as a wildcard for the `{project}` or not providing one at all + * will infer the project from the account. The `{account}` value can be the + * `email` address or the `unique_id` of the service account. + * If not provided, workflow will use the project's default service account. + * Modifying this field for an existing workflow results in a new workflow + * revision. + * + * Generated from protobuf field string service_account = 9; + * @return string + */ + public function getServiceAccount() + { + return $this->service_account; + } + + /** + * The service account associated with the latest workflow version. + * This service account represents the identity of the workflow and determines + * what permissions the workflow has. + * Format: projects/{project}/serviceAccounts/{account} or {account} + * Using `-` as a wildcard for the `{project}` or not providing one at all + * will infer the project from the account. The `{account}` value can be the + * `email` address or the `unique_id` of the service account. + * If not provided, workflow will use the project's default service account. + * Modifying this field for an existing workflow results in a new workflow + * revision. + * + * Generated from protobuf field string service_account = 9; + * @param string $var + * @return $this + */ + public function setServiceAccount($var) + { + GPBUtil::checkString($var, True); + $this->service_account = $var; + + return $this; + } + + /** + * Workflow code to be executed. The size limit is 128KB. + * + * Generated from protobuf field string source_contents = 10; + * @return string + */ + public function getSourceContents() + { + return $this->readOneof(10); + } + + public function hasSourceContents() + { + return $this->hasOneof(10); + } + + /** + * Workflow code to be executed. The size limit is 128KB. + * + * Generated from protobuf field string source_contents = 10; + * @param string $var + * @return $this + */ + public function setSourceContents($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(10, $var); + + return $this; + } + + /** + * Optional. The resource name of a KMS crypto key used to encrypt or decrypt + * the data associated with the workflow. + * Format: + * projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey} + * Using `-` as a wildcard for the `{project}` or not providing one at all + * will infer the project from the account. + * If not provided, data associated with the workflow will not be + * CMEK-encrypted. + * + * Generated from protobuf field string crypto_key_name = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getCryptoKeyName() + { + return $this->crypto_key_name; + } + + /** + * Optional. The resource name of a KMS crypto key used to encrypt or decrypt + * the data associated with the workflow. + * Format: + * projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey} + * Using `-` as a wildcard for the `{project}` or not providing one at all + * will infer the project from the account. + * If not provided, data associated with the workflow will not be + * CMEK-encrypted. + * + * Generated from protobuf field string crypto_key_name = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setCryptoKeyName($var) + { + GPBUtil::checkString($var, True); + $this->crypto_key_name = $var; + + return $this; + } + + /** + * Output only. Error regarding the state of the workflow. For example, this + * field will have error details if the execution data is unavailable due to + * revoked KMS key permissions. + * + * Generated from protobuf field .google.cloud.workflows.v1.Workflow.StateError state_error = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Workflows\V1\Workflow\StateError|null + */ + public function getStateError() + { + return $this->state_error; + } + + public function hasStateError() + { + return isset($this->state_error); + } + + public function clearStateError() + { + unset($this->state_error); + } + + /** + * Output only. Error regarding the state of the workflow. For example, this + * field will have error details if the execution data is unavailable due to + * revoked KMS key permissions. + * + * Generated from protobuf field .google.cloud.workflows.v1.Workflow.StateError state_error = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Workflows\V1\Workflow\StateError $var + * @return $this + */ + public function setStateError($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Workflows\V1\Workflow\StateError::class); + $this->state_error = $var; + + return $this; + } + + /** + * Optional. Describes the level of platform logging to apply to calls and + * call responses during executions of this workflow. If both the workflow and + * the execution specify a logging level, the execution level takes + * precedence. + * + * Generated from protobuf field .google.cloud.workflows.v1.Workflow.CallLogLevel call_log_level = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getCallLogLevel() + { + return $this->call_log_level; + } + + /** + * Optional. Describes the level of platform logging to apply to calls and + * call responses during executions of this workflow. If both the workflow and + * the execution specify a logging level, the execution level takes + * precedence. + * + * Generated from protobuf field .google.cloud.workflows.v1.Workflow.CallLogLevel call_log_level = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setCallLogLevel($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Workflows\V1\Workflow\CallLogLevel::class); + $this->call_log_level = $var; + + return $this; + } + + /** + * Optional. User-defined environment variables associated with this workflow + * revision. This map has a maximum length of 20. Each string can take up to + * 40KiB. Keys cannot be empty strings and cannot start with “GOOGLE” or + * “WORKFLOWS". + * + * Generated from protobuf field map user_env_vars = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getUserEnvVars() + { + return $this->user_env_vars; + } + + /** + * Optional. User-defined environment variables associated with this workflow + * revision. This map has a maximum length of 20. Each string can take up to + * 40KiB. Keys cannot be empty strings and cannot start with “GOOGLE” or + * “WORKFLOWS". + * + * Generated from protobuf field map user_env_vars = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setUserEnvVars($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->user_env_vars = $arr; + + return $this; + } + + /** + * @return string + */ + public function getSourceCode() + { + return $this->whichOneof("source_code"); + } + +} + diff --git a/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/Workflow/CallLogLevel.php b/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/Workflow/CallLogLevel.php new file mode 100644 index 000000000000..fd7dbbc0dacf --- /dev/null +++ b/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/Workflow/CallLogLevel.php @@ -0,0 +1,73 @@ +google.cloud.workflows.v1.Workflow.CallLogLevel + */ +class CallLogLevel +{ + /** + * No call logging level specified. + * + * Generated from protobuf enum CALL_LOG_LEVEL_UNSPECIFIED = 0; + */ + const CALL_LOG_LEVEL_UNSPECIFIED = 0; + /** + * Log all call steps within workflows, all call returns, and all exceptions + * raised. + * + * Generated from protobuf enum LOG_ALL_CALLS = 1; + */ + const LOG_ALL_CALLS = 1; + /** + * Log only exceptions that are raised from call steps within workflows. + * + * Generated from protobuf enum LOG_ERRORS_ONLY = 2; + */ + const LOG_ERRORS_ONLY = 2; + /** + * Explicitly log nothing. + * + * Generated from protobuf enum LOG_NONE = 3; + */ + const LOG_NONE = 3; + + private static $valueToName = [ + self::CALL_LOG_LEVEL_UNSPECIFIED => 'CALL_LOG_LEVEL_UNSPECIFIED', + self::LOG_ALL_CALLS => 'LOG_ALL_CALLS', + self::LOG_ERRORS_ONLY => 'LOG_ERRORS_ONLY', + self::LOG_NONE => 'LOG_NONE', + ]; + + 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(CallLogLevel::class, \Google\Cloud\Workflows\V1\Workflow_CallLogLevel::class); + diff --git a/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/Workflow/State.php b/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/Workflow/State.php new file mode 100644 index 000000000000..675b0444e92d --- /dev/null +++ b/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/Workflow/State.php @@ -0,0 +1,64 @@ +google.cloud.workflows.v1.Workflow.State + */ +class State +{ + /** + * Invalid state. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The workflow has been deployed successfully and is serving. + * + * Generated from protobuf enum ACTIVE = 1; + */ + const ACTIVE = 1; + /** + * Workflow data is unavailable. See the `state_error` field. + * + * Generated from protobuf enum UNAVAILABLE = 2; + */ + const UNAVAILABLE = 2; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::ACTIVE => 'ACTIVE', + self::UNAVAILABLE => 'UNAVAILABLE', + ]; + + 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\Workflows\V1\Workflow_State::class); + diff --git a/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/Workflow/StateError.php b/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/Workflow/StateError.php new file mode 100644 index 000000000000..eb9d406a37da --- /dev/null +++ b/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/Workflow/StateError.php @@ -0,0 +1,104 @@ +google.cloud.workflows.v1.Workflow.StateError + */ +class StateError extends \Google\Protobuf\Internal\Message +{ + /** + * Provides specifics about the error. + * + * Generated from protobuf field string details = 1; + */ + protected $details = ''; + /** + * The type of this state error. + * + * Generated from protobuf field .google.cloud.workflows.v1.Workflow.StateError.Type type = 2; + */ + protected $type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $details + * Provides specifics about the error. + * @type int $type + * The type of this state error. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Workflows\V1\Workflows::initOnce(); + parent::__construct($data); + } + + /** + * Provides specifics about the error. + * + * Generated from protobuf field string details = 1; + * @return string + */ + public function getDetails() + { + return $this->details; + } + + /** + * Provides specifics about the error. + * + * Generated from protobuf field string details = 1; + * @param string $var + * @return $this + */ + public function setDetails($var) + { + GPBUtil::checkString($var, True); + $this->details = $var; + + return $this; + } + + /** + * The type of this state error. + * + * Generated from protobuf field .google.cloud.workflows.v1.Workflow.StateError.Type type = 2; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * The type of this state error. + * + * Generated from protobuf field .google.cloud.workflows.v1.Workflow.StateError.Type type = 2; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Workflows\V1\Workflow\StateError\Type::class); + $this->type = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(StateError::class, \Google\Cloud\Workflows\V1\Workflow_StateError::class); + diff --git a/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/Workflow/StateError/Type.php b/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/Workflow/StateError/Type.php new file mode 100644 index 000000000000..3a3520248b24 --- /dev/null +++ b/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/Workflow/StateError/Type.php @@ -0,0 +1,57 @@ +google.cloud.workflows.v1.Workflow.StateError.Type + */ +class Type +{ + /** + * No type specified. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * Caused by an issue with KMS. + * + * Generated from protobuf enum KMS_ERROR = 1; + */ + const KMS_ERROR = 1; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::KMS_ERROR => 'KMS_ERROR', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\Workflows\V1\Workflow_StateError_Type::class); + diff --git a/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/create_workflow.php b/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/create_workflow.php new file mode 100644 index 000000000000..f24d7ea3d11d --- /dev/null +++ b/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/create_workflow.php @@ -0,0 +1,98 @@ +setParent($formattedParent) + ->setWorkflow($workflow) + ->setWorkflowId($workflowId); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $workflowsClient->createWorkflow($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Workflow $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = WorkflowsClient::locationName('[PROJECT]', '[LOCATION]'); + $workflowId = '[WORKFLOW_ID]'; + + create_workflow_sample($formattedParent, $workflowId); +} +// [END workflows_v1_generated_Workflows_CreateWorkflow_sync] diff --git a/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/delete_workflow.php b/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/delete_workflow.php new file mode 100644 index 000000000000..c2b7ac200b74 --- /dev/null +++ b/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/delete_workflow.php @@ -0,0 +1,83 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $workflowsClient->deleteWorkflow($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 = WorkflowsClient::workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); + + delete_workflow_sample($formattedName); +} +// [END workflows_v1_generated_Workflows_DeleteWorkflow_sync] diff --git a/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/get_location.php b/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/get_location.php new file mode 100644 index 000000000000..6080669fa709 --- /dev/null +++ b/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END workflows_v1_generated_Workflows_GetLocation_sync] diff --git a/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/get_workflow.php b/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/get_workflow.php new file mode 100644 index 000000000000..64742ab2b7a9 --- /dev/null +++ b/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/get_workflow.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Workflow $response */ + $response = $workflowsClient->getWorkflow($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 = WorkflowsClient::workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); + + get_workflow_sample($formattedName); +} +// [END workflows_v1_generated_Workflows_GetWorkflow_sync] diff --git a/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/list_locations.php b/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/list_locations.php new file mode 100644 index 000000000000..72d2c6aa8c5e --- /dev/null +++ b/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END workflows_v1_generated_Workflows_ListLocations_sync] diff --git a/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/list_workflows.php b/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/list_workflows.php new file mode 100644 index 000000000000..9c1267dd7883 --- /dev/null +++ b/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/list_workflows.php @@ -0,0 +1,78 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $workflowsClient->listWorkflows($request); + + /** @var Workflow $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 = WorkflowsClient::locationName('[PROJECT]', '[LOCATION]'); + + list_workflows_sample($formattedParent); +} +// [END workflows_v1_generated_Workflows_ListWorkflows_sync] diff --git a/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/update_workflow.php b/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/update_workflow.php new file mode 100644 index 000000000000..69de724a7404 --- /dev/null +++ b/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/update_workflow.php @@ -0,0 +1,75 @@ +setWorkflow($workflow); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $workflowsClient->updateWorkflow($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Workflow $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END workflows_v1_generated_Workflows_UpdateWorkflow_sync] diff --git a/owl-bot-staging/Workflows/v1/src/V1/Client/BaseClient/WorkflowsBaseClient.php b/owl-bot-staging/Workflows/v1/src/V1/Client/BaseClient/WorkflowsBaseClient.php new file mode 100644 index 000000000000..0a3f2525cbca --- /dev/null +++ b/owl-bot-staging/Workflows/v1/src/V1/Client/BaseClient/WorkflowsBaseClient.php @@ -0,0 +1,494 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../../resources/workflows_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../../resources/workflows_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../../resources/workflows_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../../resources/workflows_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 crypto_key + * resource. + * + * @param string $project + * @param string $location + * @param string $keyRing + * @param string $cryptoKey + * + * @return string The formatted crypto_key resource. + */ + public static function cryptoKeyName(string $project, string $location, string $keyRing, string $cryptoKey): string + { + return self::getPathTemplate('cryptoKey')->render([ + 'project' => $project, + 'location' => $location, + 'keyRing' => $keyRing, + 'cryptoKey' => $cryptoKey, + ]); + } + + /** + * 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 workflow + * resource. + * + * @param string $project + * @param string $location + * @param string $workflow + * + * @return string The formatted workflow resource. + */ + public static function workflowName(string $project, string $location, string $workflow): string + { + return self::getPathTemplate('workflow')->render([ + 'project' => $project, + 'location' => $location, + 'workflow' => $workflow, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - cryptoKey: projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey} + * - location: projects/{project}/locations/{location} + * - workflow: projects/{project}/locations/{location}/workflows/{workflow} + * + * 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 'workflows.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new workflow. If a workflow with the specified name already + * exists in the specified project and location, the long running operation + * returns a [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error. + * + * The async variant is {@see self::createWorkflowAsync()} . + * + * @example samples/V1/WorkflowsClient/create_workflow.php + * + * @param CreateWorkflowRequest $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 createWorkflow(CreateWorkflowRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateWorkflow', $request, $callOptions)->wait(); + } + + /** + * Deletes a workflow with the specified name. + * This method also cancels and deletes all running executions of the + * workflow. + * + * The async variant is {@see self::deleteWorkflowAsync()} . + * + * @example samples/V1/WorkflowsClient/delete_workflow.php + * + * @param DeleteWorkflowRequest $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 deleteWorkflow(DeleteWorkflowRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteWorkflow', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single workflow. + * + * The async variant is {@see self::getWorkflowAsync()} . + * + * @example samples/V1/WorkflowsClient/get_workflow.php + * + * @param GetWorkflowRequest $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 Workflow + * + * @throws ApiException Thrown if the API call fails. + */ + public function getWorkflow(GetWorkflowRequest $request, array $callOptions = []): Workflow + { + return $this->startApiCall('GetWorkflow', $request, $callOptions)->wait(); + } + + /** + * Lists workflows in a given project and location. + * The default order is not specified. + * + * The async variant is {@see self::listWorkflowsAsync()} . + * + * @example samples/V1/WorkflowsClient/list_workflows.php + * + * @param ListWorkflowsRequest $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 listWorkflows(ListWorkflowsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListWorkflows', $request, $callOptions); + } + + /** + * Updates an existing workflow. + * Running this method has no impact on already running executions of the + * workflow. A new revision of the workflow might be created as a result of a + * successful update operation. In that case, the new revision is used + * in new workflow executions. + * + * The async variant is {@see self::updateWorkflowAsync()} . + * + * @example samples/V1/WorkflowsClient/update_workflow.php + * + * @param UpdateWorkflowRequest $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 updateWorkflow(UpdateWorkflowRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateWorkflow', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see self::getLocationAsync()} . + * + * @example samples/V1/WorkflowsClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see self::listLocationsAsync()} . + * + * @example samples/V1/WorkflowsClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Workflows/v1/src/V1/Client/WorkflowsClient.php b/owl-bot-staging/Workflows/v1/src/V1/Client/WorkflowsClient.php new file mode 100644 index 000000000000..4c5a9c18fa50 --- /dev/null +++ b/owl-bot-staging/Workflows/v1/src/V1/Client/WorkflowsClient.php @@ -0,0 +1,40 @@ + [ + 'google.cloud.workflows.v1.Workflows' => [ + 'CreateWorkflow' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Workflows\V1\Workflow', + 'metadataReturnType' => '\Google\Cloud\Workflows\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteWorkflow' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\Workflows\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateWorkflow' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Workflows\V1\Workflow', + 'metadataReturnType' => '\Google\Cloud\Workflows\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'workflow.name', + 'fieldAccessors' => [ + 'getWorkflow', + 'getName', + ], + ], + ], + ], + 'GetWorkflow' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Workflows\V1\Workflow', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListWorkflows' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getWorkflows', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Workflows\V1\ListWorkflowsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'cryptoKey' => 'projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey}', + 'location' => 'projects/{project}/locations/{location}', + 'workflow' => 'projects/{project}/locations/{location}/workflows/{workflow}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Workflows/v1/src/V1/resources/workflows_rest_client_config.php b/owl-bot-staging/Workflows/v1/src/V1/resources/workflows_rest_client_config.php new file mode 100644 index 000000000000..0ce03d0f8a98 --- /dev/null +++ b/owl-bot-staging/Workflows/v1/src/V1/resources/workflows_rest_client_config.php @@ -0,0 +1,129 @@ + [ + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.workflows.v1.Workflows' => [ + 'CreateWorkflow' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/workflows', + 'body' => 'workflow', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'workflow_id', + ], + ], + 'DeleteWorkflow' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/workflows/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetWorkflow' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/workflows/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListWorkflows' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/workflows', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateWorkflow' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{workflow.name=projects/*/locations/*/workflows/*}', + 'body' => 'workflow', + 'placeholders' => [ + 'workflow.name' => [ + 'getters' => [ + 'getWorkflow', + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Workflows/v1/tests/Unit/V1/Client/WorkflowsClientTest.php b/owl-bot-staging/Workflows/v1/tests/Unit/V1/Client/WorkflowsClientTest.php new file mode 100644 index 000000000000..2171345be81d --- /dev/null +++ b/owl-bot-staging/Workflows/v1/tests/Unit/V1/Client/WorkflowsClientTest.php @@ -0,0 +1,829 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return WorkflowsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new WorkflowsClient($options); + } + + /** @test */ + public function createWorkflowTest() + { + $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/createWorkflowTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $revisionId = 'revisionId513861631'; + $serviceAccount = 'serviceAccount-1948028253'; + $sourceContents = 'sourceContents-1799875906'; + $cryptoKeyName = 'cryptoKeyName-184663511'; + $expectedResponse = new Workflow(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setRevisionId($revisionId); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setSourceContents($sourceContents); + $expectedResponse->setCryptoKeyName($cryptoKeyName); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createWorkflowTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $workflow = new Workflow(); + $workflowId = 'workflowId1712917915'; + $request = (new CreateWorkflowRequest()) + ->setParent($formattedParent) + ->setWorkflow($workflow) + ->setWorkflowId($workflowId); + $response = $gapicClient->createWorkflow($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.workflows.v1.Workflows/CreateWorkflow', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getWorkflow(); + $this->assertProtobufEquals($workflow, $actualValue); + $actualValue = $actualApiRequestObject->getWorkflowId(); + $this->assertProtobufEquals($workflowId, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createWorkflowTest'); + $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 createWorkflowExceptionTest() + { + $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/createWorkflowTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $workflow = new Workflow(); + $workflowId = 'workflowId1712917915'; + $request = (new CreateWorkflowRequest()) + ->setParent($formattedParent) + ->setWorkflow($workflow) + ->setWorkflowId($workflowId); + $response = $gapicClient->createWorkflow($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createWorkflowTest'); + 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 deleteWorkflowTest() + { + $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/deleteWorkflowTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteWorkflowTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); + $request = (new DeleteWorkflowRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteWorkflow($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.workflows.v1.Workflows/DeleteWorkflow', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteWorkflowTest'); + $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 deleteWorkflowExceptionTest() + { + $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/deleteWorkflowTest'); + $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->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); + $request = (new DeleteWorkflowRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteWorkflow($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteWorkflowTest'); + 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 getWorkflowTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $revisionId2 = 'revisionId2-100208654'; + $serviceAccount = 'serviceAccount-1948028253'; + $sourceContents = 'sourceContents-1799875906'; + $cryptoKeyName = 'cryptoKeyName-184663511'; + $expectedResponse = new Workflow(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setRevisionId($revisionId2); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setSourceContents($sourceContents); + $expectedResponse->setCryptoKeyName($cryptoKeyName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); + $request = (new GetWorkflowRequest()) + ->setName($formattedName); + $response = $gapicClient->getWorkflow($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.workflows.v1.Workflows/GetWorkflow', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getWorkflowExceptionTest() + { + $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->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); + $request = (new GetWorkflowRequest()) + ->setName($formattedName); + try { + $gapicClient->getWorkflow($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 listWorkflowsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $workflowsElement = new Workflow(); + $workflows = [ + $workflowsElement, + ]; + $expectedResponse = new ListWorkflowsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setWorkflows($workflows); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListWorkflowsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listWorkflows($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getWorkflows()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.workflows.v1.Workflows/ListWorkflows', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listWorkflowsExceptionTest() + { + $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 ListWorkflowsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listWorkflows($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 updateWorkflowTest() + { + $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/updateWorkflowTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $revisionId = 'revisionId513861631'; + $serviceAccount = 'serviceAccount-1948028253'; + $sourceContents = 'sourceContents-1799875906'; + $cryptoKeyName = 'cryptoKeyName-184663511'; + $expectedResponse = new Workflow(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setRevisionId($revisionId); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setSourceContents($sourceContents); + $expectedResponse->setCryptoKeyName($cryptoKeyName); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateWorkflowTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $workflow = new Workflow(); + $request = (new UpdateWorkflowRequest()) + ->setWorkflow($workflow); + $response = $gapicClient->updateWorkflow($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.workflows.v1.Workflows/UpdateWorkflow', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getWorkflow(); + $this->assertProtobufEquals($workflow, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateWorkflowTest'); + $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 updateWorkflowExceptionTest() + { + $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/updateWorkflowTest'); + $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 + $workflow = new Workflow(); + $request = (new UpdateWorkflowRequest()) + ->setWorkflow($workflow); + $response = $gapicClient->updateWorkflow($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateWorkflowTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createWorkflowAsyncTest() + { + $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/createWorkflowTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $revisionId = 'revisionId513861631'; + $serviceAccount = 'serviceAccount-1948028253'; + $sourceContents = 'sourceContents-1799875906'; + $cryptoKeyName = 'cryptoKeyName-184663511'; + $expectedResponse = new Workflow(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setRevisionId($revisionId); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setSourceContents($sourceContents); + $expectedResponse->setCryptoKeyName($cryptoKeyName); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createWorkflowTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $workflow = new Workflow(); + $workflowId = 'workflowId1712917915'; + $request = (new CreateWorkflowRequest()) + ->setParent($formattedParent) + ->setWorkflow($workflow) + ->setWorkflowId($workflowId); + $response = $gapicClient->createWorkflowAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.workflows.v1.Workflows/CreateWorkflow', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getWorkflow(); + $this->assertProtobufEquals($workflow, $actualValue); + $actualValue = $actualApiRequestObject->getWorkflowId(); + $this->assertProtobufEquals($workflowId, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createWorkflowTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/Workflows/v1beta/proto/src/GPBMetadata/Google/Cloud/Workflows/V1Beta/Workflows.php b/owl-bot-staging/Workflows/v1beta/proto/src/GPBMetadata/Google/Cloud/Workflows/V1Beta/Workflows.php new file mode 100644 index 0000000000000000000000000000000000000000..a0693520bcad216d4bd8e88bb0fc3172df9a901b GIT binary patch literal 4084 zcmbtXL37(g6t0sd#A_PbrJ1^6Iw)>unr0Gdl6D4An-)27LS~Z2)28hV;~9@EuN@It z64J^cWPAWF+_`b*M1KQ6phw`;Qx9B#Ur-JVZ?)RB?6}y5Tq0}VdwTDC@B4Q5-UI*8 zN7t2Y;*!9mq^{IX6naP$Kk%q$d5%(x8VwRCme=xahXkskZ0;)$_YaiP=FY(axQ1R7 zSVUKvp4W7UW;tF|*N(m5sNs0Wq1Ill5o&f{sBvV3T(d<&-?WIbT`ul{N!_GoWjhX1 z*Q)72ta+(pQ8%rI2s0y;$s{P|JMu`MN}CWU`D?67LPHnmO1{t_x$R~n`h z67W82+lX9?+McU0hke%~i?IG#m z)%7N!5=!=F@mBI#7S3)ci#$hNKa=FTLW78;zpf|&p;6%8jq_#!I`XM905rq5D~9WO z3h6%IW*h07mVlnh$Le(a+15A+YBPtwcTcA-)F-* zUXikQan^fgcr<#(()YlIp`~WaAM6{?%gTK_nGT~~m&33H4Imza)B+*RY1|G78a<K!a^+YRm+31c4?SLY~ho0^D8Kq4v|BX zN8}{w*abAzHl2v@Ug;AbW(rGaDuy1v2n2T zv~)3}*Z(j~w9uVz-dY&zP=$?16TQUupc9`Fi-y{1^3>5B&*Ivkor=d!cl*&!Mbu95 z0?NtS>ZI^}23_8@Ln@+&kI3f{&>eq-rhPMj+IexsTd$0Xzl`f>LBtOe$Yp}NNe=iD z%KB!LR72Q_Vl1XG6dJ#x-Vt%*;mzV%G~KWr*i-ln;)`g;3+g1O)=uKt%ND-Mpt-)} zLLXF~U>#*eNg*W2Mxb(Y#2H|HcgYvDn#zc?3n&-4zyRyetT~KhlZ)BH9>Uv1;v?Ys zAkEb-I5Meza0I@E=TOr|%rfyxg!~_f-$ygz%Q4_%putEy!9+m>V4}d(B^HH=LK)3% z5{FRIpYDG~;9Ef8Nvs(CA=70r5gfY=4I0R`h>36l#aRWDyJ6vn47wyYR&gN15GJij zJe9Lyq!8j|G(+4vmrXWG|0=zg07wS)#Rgg~h(ykQc}nXvYH24w|W zA^s_YF7)sM57WOM>tx{O?+hVKpA)BEq4@PLzkN4x8?TB}?kU%abty|rDLGn7$<1-1fUG@#>rbKh8^U{bnWc+&u&GvE@55un4TqJ!> z)R{V0sB->5@8VR~3*%#}O96OkyvG}|EEp{xfZ8vNYpD~*fZ6{QYV9Tb&{})VN36BQ zyRy_Rb+Fi}n6%*qtzsK3zyU;z z?%)$varT+GxR%+4v7Gtz0k;$google.cloud.workflows.v1beta.CreateWorkflowRequest + */ +class CreateWorkflowRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Project and location in which the workflow should be created. + * Format: projects/{project}/locations/{location} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Workflow to be created. + * + * Generated from protobuf field .google.cloud.workflows.v1beta.Workflow workflow = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $workflow = null; + /** + * Required. The ID of the workflow to be created. It has to fulfill the + * following requirements: + * * Must contain only letters, numbers, underscores and hyphens. + * * Must start with a letter. + * * Must be between 1-64 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project and location. + * + * Generated from protobuf field string workflow_id = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $workflow_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Project and location in which the workflow should be created. + * Format: projects/{project}/locations/{location} + * @type \Google\Cloud\Workflows\V1beta\Workflow $workflow + * Required. Workflow to be created. + * @type string $workflow_id + * Required. The ID of the workflow to be created. It has to fulfill the + * following requirements: + * * Must contain only letters, numbers, underscores and hyphens. + * * Must start with a letter. + * * Must be between 1-64 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project and location. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Workflows\V1Beta\Workflows::initOnce(); + parent::__construct($data); + } + + /** + * Required. Project and location in which the workflow should be created. + * Format: projects/{project}/locations/{location} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Project and location in which the workflow should be created. + * Format: projects/{project}/locations/{location} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. Workflow to be created. + * + * Generated from protobuf field .google.cloud.workflows.v1beta.Workflow workflow = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Workflows\V1beta\Workflow|null + */ + public function getWorkflow() + { + return $this->workflow; + } + + public function hasWorkflow() + { + return isset($this->workflow); + } + + public function clearWorkflow() + { + unset($this->workflow); + } + + /** + * Required. Workflow to be created. + * + * Generated from protobuf field .google.cloud.workflows.v1beta.Workflow workflow = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Workflows\V1beta\Workflow $var + * @return $this + */ + public function setWorkflow($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Workflows\V1beta\Workflow::class); + $this->workflow = $var; + + return $this; + } + + /** + * Required. The ID of the workflow to be created. It has to fulfill the + * following requirements: + * * Must contain only letters, numbers, underscores and hyphens. + * * Must start with a letter. + * * Must be between 1-64 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project and location. + * + * Generated from protobuf field string workflow_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getWorkflowId() + { + return $this->workflow_id; + } + + /** + * Required. The ID of the workflow to be created. It has to fulfill the + * following requirements: + * * Must contain only letters, numbers, underscores and hyphens. + * * Must start with a letter. + * * Must be between 1-64 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project and location. + * + * Generated from protobuf field string workflow_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setWorkflowId($var) + { + GPBUtil::checkString($var, True); + $this->workflow_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/DeleteWorkflowRequest.php b/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/DeleteWorkflowRequest.php new file mode 100644 index 000000000000..8eed6f4b51e7 --- /dev/null +++ b/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/DeleteWorkflowRequest.php @@ -0,0 +1,73 @@ +google.cloud.workflows.v1beta.DeleteWorkflowRequest + */ +class DeleteWorkflowRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the workflow to be deleted. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the workflow to be deleted. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Workflows\V1Beta\Workflows::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the workflow to be deleted. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the workflow to be deleted. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * + * 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/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/GetWorkflowRequest.php b/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/GetWorkflowRequest.php new file mode 100644 index 000000000000..aa97008d3024 --- /dev/null +++ b/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/GetWorkflowRequest.php @@ -0,0 +1,72 @@ +google.cloud.workflows.v1beta.GetWorkflowRequest + */ +class GetWorkflowRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the workflow which information should be retrieved. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the workflow which information should be retrieved. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Workflows\V1Beta\Workflows::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the workflow which information should be retrieved. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the workflow which information should be retrieved. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * + * 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/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/ListWorkflowsRequest.php b/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/ListWorkflowsRequest.php new file mode 100644 index 000000000000..a7864f89afd7 --- /dev/null +++ b/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/ListWorkflowsRequest.php @@ -0,0 +1,245 @@ +google.cloud.workflows.v1beta.ListWorkflowsRequest + */ +class ListWorkflowsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Project and location from which the workflows should be listed. + * Format: projects/{project}/locations/{location} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Maximum number of workflows to return per call. The service may return + * fewer than this value. If the value is not specified, a default value of + * 500 will be used. The maximum permitted value is 1000 and values greater + * than 1000 will be coerced down to 1000. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * A page token, received from a previous `ListWorkflows` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListWorkflows` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * Filter to restrict results to specific workflows. + * + * Generated from protobuf field string filter = 4; + */ + protected $filter = ''; + /** + * Comma-separated list of fields that that specify the order of the results. + * Default sorting order for a field is ascending. To specify descending order + * for a field, append a " desc" suffix. + * If not specified, the results will be returned in an unspecified order. + * + * Generated from protobuf field string order_by = 5; + */ + protected $order_by = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Project and location from which the workflows should be listed. + * Format: projects/{project}/locations/{location} + * @type int $page_size + * Maximum number of workflows to return per call. The service may return + * fewer than this value. If the value is not specified, a default value of + * 500 will be used. The maximum permitted value is 1000 and values greater + * than 1000 will be coerced down to 1000. + * @type string $page_token + * A page token, received from a previous `ListWorkflows` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListWorkflows` must + * match the call that provided the page token. + * @type string $filter + * Filter to restrict results to specific workflows. + * @type string $order_by + * Comma-separated list of fields that that specify the order of the results. + * Default sorting order for a field is ascending. To specify descending order + * for a field, append a " desc" suffix. + * If not specified, the results will be returned in an unspecified order. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Workflows\V1Beta\Workflows::initOnce(); + parent::__construct($data); + } + + /** + * Required. Project and location from which the workflows should be listed. + * Format: projects/{project}/locations/{location} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. Project and location from which the workflows should be listed. + * Format: projects/{project}/locations/{location} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Maximum number of workflows to return per call. The service may return + * fewer than this value. If the value is not specified, a default value of + * 500 will be used. The maximum permitted value is 1000 and values greater + * than 1000 will be coerced down to 1000. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Maximum number of workflows to return per call. The service may return + * fewer than this value. If the value is not specified, a default value of + * 500 will be used. The maximum permitted value is 1000 and values greater + * than 1000 will be coerced down to 1000. + * + * 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; + } + + /** + * A page token, received from a previous `ListWorkflows` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListWorkflows` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A page token, received from a previous `ListWorkflows` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListWorkflows` must + * match 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; + } + + /** + * Filter to restrict results to specific workflows. + * + * Generated from protobuf field string filter = 4; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Filter to restrict results to specific workflows. + * + * Generated from protobuf field string filter = 4; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Comma-separated list of fields that that specify the order of the results. + * Default sorting order for a field is ascending. To specify descending order + * for a field, append a " desc" suffix. + * If not specified, the results will be returned in an unspecified order. + * + * Generated from protobuf field string order_by = 5; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Comma-separated list of fields that that specify the order of the results. + * Default sorting order for a field is ascending. To specify descending order + * for a field, append a " desc" suffix. + * If not specified, the results will be returned in an unspecified order. + * + * Generated from protobuf field string order_by = 5; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/ListWorkflowsResponse.php b/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/ListWorkflowsResponse.php new file mode 100644 index 000000000000..50f2cadd0328 --- /dev/null +++ b/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/ListWorkflowsResponse.php @@ -0,0 +1,141 @@ +google.cloud.workflows.v1beta.ListWorkflowsResponse + */ +class ListWorkflowsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The workflows which match the request. + * + * Generated from protobuf field repeated .google.cloud.workflows.v1beta.Workflow workflows = 1; + */ + private $workflows; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Unreachable resources. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Workflows\V1beta\Workflow>|\Google\Protobuf\Internal\RepeatedField $workflows + * The workflows which match the request. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Unreachable resources. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Workflows\V1Beta\Workflows::initOnce(); + parent::__construct($data); + } + + /** + * The workflows which match the request. + * + * Generated from protobuf field repeated .google.cloud.workflows.v1beta.Workflow workflows = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getWorkflows() + { + return $this->workflows; + } + + /** + * The workflows which match the request. + * + * Generated from protobuf field repeated .google.cloud.workflows.v1beta.Workflow workflows = 1; + * @param array<\Google\Cloud\Workflows\V1beta\Workflow>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setWorkflows($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Workflows\V1beta\Workflow::class); + $this->workflows = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Unreachable resources. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Unreachable resources. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/OperationMetadata.php b/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/OperationMetadata.php new file mode 100644 index 000000000000..b4e7df568749 --- /dev/null +++ b/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/OperationMetadata.php @@ -0,0 +1,223 @@ +google.cloud.workflows.v1beta.OperationMetadata + */ +class OperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; + */ + protected $create_time = null; + /** + * The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + */ + protected $end_time = null; + /** + * Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3; + */ + protected $target = ''; + /** + * Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4; + */ + protected $verb = ''; + /** + * API version used to start the operation. + * + * Generated from protobuf field string api_version = 5; + */ + protected $api_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * The time the operation was created. + * @type \Google\Protobuf\Timestamp $end_time + * The time the operation finished running. + * @type string $target + * Server-defined resource path for the target of the operation. + * @type string $verb + * Name of the verb executed by the operation. + * @type string $api_version + * API version used to start the operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Workflows\V1Beta\Workflows::initOnce(); + parent::__construct($data); + } + + /** + * The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3; + * @return string + */ + public function getTarget() + { + return $this->target; + } + + /** + * Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + + /** + * Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4; + * @return string + */ + public function getVerb() + { + return $this->verb; + } + + /** + * Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4; + * @param string $var + * @return $this + */ + public function setVerb($var) + { + GPBUtil::checkString($var, True); + $this->verb = $var; + + return $this; + } + + /** + * API version used to start the operation. + * + * Generated from protobuf field string api_version = 5; + * @return string + */ + public function getApiVersion() + { + return $this->api_version; + } + + /** + * API version used to start the operation. + * + * Generated from protobuf field string api_version = 5; + * @param string $var + * @return $this + */ + public function setApiVersion($var) + { + GPBUtil::checkString($var, True); + $this->api_version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/UpdateWorkflowRequest.php b/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/UpdateWorkflowRequest.php new file mode 100644 index 000000000000..eedfd1e55dd6 --- /dev/null +++ b/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/UpdateWorkflowRequest.php @@ -0,0 +1,127 @@ +google.cloud.workflows.v1beta.UpdateWorkflowRequest + */ +class UpdateWorkflowRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Workflow to be updated. + * + * Generated from protobuf field .google.cloud.workflows.v1beta.Workflow workflow = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $workflow = null; + /** + * List of fields to be updated. If not present, the entire workflow + * will be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Workflows\V1beta\Workflow $workflow + * Required. Workflow to be updated. + * @type \Google\Protobuf\FieldMask $update_mask + * List of fields to be updated. If not present, the entire workflow + * will be updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Workflows\V1Beta\Workflows::initOnce(); + parent::__construct($data); + } + + /** + * Required. Workflow to be updated. + * + * Generated from protobuf field .google.cloud.workflows.v1beta.Workflow workflow = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Workflows\V1beta\Workflow|null + */ + public function getWorkflow() + { + return $this->workflow; + } + + public function hasWorkflow() + { + return isset($this->workflow); + } + + public function clearWorkflow() + { + unset($this->workflow); + } + + /** + * Required. Workflow to be updated. + * + * Generated from protobuf field .google.cloud.workflows.v1beta.Workflow workflow = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Workflows\V1beta\Workflow $var + * @return $this + */ + public function setWorkflow($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Workflows\V1beta\Workflow::class); + $this->workflow = $var; + + return $this; + } + + /** + * List of fields to be updated. If not present, the entire workflow + * will be 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); + } + + /** + * List of fields to be updated. If not present, the entire workflow + * will be 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; + } + +} + diff --git a/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/Workflow.php b/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/Workflow.php new file mode 100644 index 000000000000..b4dcfbd75c43 --- /dev/null +++ b/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/Workflow.php @@ -0,0 +1,503 @@ +google.cloud.workflows.v1beta.Workflow + */ +class Workflow extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the workflow. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Description of the workflow provided by the user. + * Must be at most 1000 unicode characters long. + * + * Generated from protobuf field string description = 2; + */ + protected $description = ''; + /** + * Output only. State of the workflow deployment. + * + * Generated from protobuf field .google.cloud.workflows.v1beta.Workflow.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. The revision of the workflow. + * A new revision of a workflow is created as a result of updating the + * following fields of a workflow: + * - `source_code` + * - `service_account` + * The format is "000001-a4d", where the first 6 characters define + * the zero-padded revision ordinal number. They are followed by a hyphen and + * 3 hexadecimal random characters. + * + * Generated from protobuf field string revision_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $revision_id = ''; + /** + * Output only. The timestamp of when the workflow was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The last update timestamp of the workflow. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. The timestamp that the latest revision of the workflow + * was created. + * + * Generated from protobuf field .google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $revision_create_time = null; + /** + * Labels associated with this workflow. + * Labels can contain at most 64 entries. Keys and values can be no longer + * than 63 characters and can only contain lowercase letters, numeric + * characters, underscores and dashes. Label keys must start with a letter. + * International characters are allowed. + * + * Generated from protobuf field map labels = 8; + */ + private $labels; + /** + * Name of the service account associated with the latest workflow version. + * This service account represents the identity of the workflow and determines + * what permissions the workflow has. + * Format: projects/{project}/serviceAccounts/{account} + * Using `-` as a wildcard for the `{project}` will infer the project from + * the account. The `{account}` value can be the `email` address or the + * `unique_id` of the service account. + * If not provided, workflow will use the project's default service account. + * Modifying this field for an existing workflow results in a new workflow + * revision. + * + * Generated from protobuf field string service_account = 9; + */ + protected $service_account = ''; + protected $source_code; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The resource name of the workflow. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * @type string $description + * Description of the workflow provided by the user. + * Must be at most 1000 unicode characters long. + * @type int $state + * Output only. State of the workflow deployment. + * @type string $revision_id + * Output only. The revision of the workflow. + * A new revision of a workflow is created as a result of updating the + * following fields of a workflow: + * - `source_code` + * - `service_account` + * The format is "000001-a4d", where the first 6 characters define + * the zero-padded revision ordinal number. They are followed by a hyphen and + * 3 hexadecimal random characters. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The timestamp of when the workflow was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The last update timestamp of the workflow. + * @type \Google\Protobuf\Timestamp $revision_create_time + * Output only. The timestamp that the latest revision of the workflow + * was created. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels associated with this workflow. + * Labels can contain at most 64 entries. Keys and values can be no longer + * than 63 characters and can only contain lowercase letters, numeric + * characters, underscores and dashes. Label keys must start with a letter. + * International characters are allowed. + * @type string $service_account + * Name of the service account associated with the latest workflow version. + * This service account represents the identity of the workflow and determines + * what permissions the workflow has. + * Format: projects/{project}/serviceAccounts/{account} + * Using `-` as a wildcard for the `{project}` will infer the project from + * the account. The `{account}` value can be the `email` address or the + * `unique_id` of the service account. + * If not provided, workflow will use the project's default service account. + * Modifying this field for an existing workflow results in a new workflow + * revision. + * @type string $source_contents + * Workflow code to be executed. The size limit is 32KB. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Workflows\V1Beta\Workflows::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the workflow. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The resource name of the workflow. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Description of the workflow provided by the user. + * Must be at most 1000 unicode characters long. + * + * Generated from protobuf field string description = 2; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Description of the workflow provided by the user. + * Must be at most 1000 unicode characters long. + * + * Generated from protobuf field string description = 2; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. State of the workflow deployment. + * + * Generated from protobuf field .google.cloud.workflows.v1beta.Workflow.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. State of the workflow deployment. + * + * Generated from protobuf field .google.cloud.workflows.v1beta.Workflow.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Workflows\V1beta\Workflow\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. The revision of the workflow. + * A new revision of a workflow is created as a result of updating the + * following fields of a workflow: + * - `source_code` + * - `service_account` + * The format is "000001-a4d", where the first 6 characters define + * the zero-padded revision ordinal number. They are followed by a hyphen and + * 3 hexadecimal random characters. + * + * Generated from protobuf field string revision_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getRevisionId() + { + return $this->revision_id; + } + + /** + * Output only. The revision of the workflow. + * A new revision of a workflow is created as a result of updating the + * following fields of a workflow: + * - `source_code` + * - `service_account` + * The format is "000001-a4d", where the first 6 characters define + * the zero-padded revision ordinal number. They are followed by a hyphen and + * 3 hexadecimal random characters. + * + * Generated from protobuf field string revision_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setRevisionId($var) + { + GPBUtil::checkString($var, True); + $this->revision_id = $var; + + return $this; + } + + /** + * Output only. The timestamp of when the workflow was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The timestamp of when the workflow was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The last update timestamp of the workflow. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The last update timestamp of the workflow. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. The timestamp that the latest revision of the workflow + * was created. + * + * Generated from protobuf field .google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getRevisionCreateTime() + { + return $this->revision_create_time; + } + + public function hasRevisionCreateTime() + { + return isset($this->revision_create_time); + } + + public function clearRevisionCreateTime() + { + unset($this->revision_create_time); + } + + /** + * Output only. The timestamp that the latest revision of the workflow + * was created. + * + * Generated from protobuf field .google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setRevisionCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->revision_create_time = $var; + + return $this; + } + + /** + * Labels associated with this workflow. + * Labels can contain at most 64 entries. Keys and values can be no longer + * than 63 characters and can only contain lowercase letters, numeric + * characters, underscores and dashes. Label keys must start with a letter. + * International characters are allowed. + * + * Generated from protobuf field map labels = 8; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels associated with this workflow. + * Labels can contain at most 64 entries. Keys and values can be no longer + * than 63 characters and can only contain lowercase letters, numeric + * characters, underscores and dashes. Label keys must start with a letter. + * International characters are allowed. + * + * Generated from protobuf field map labels = 8; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Name of the service account associated with the latest workflow version. + * This service account represents the identity of the workflow and determines + * what permissions the workflow has. + * Format: projects/{project}/serviceAccounts/{account} + * Using `-` as a wildcard for the `{project}` will infer the project from + * the account. The `{account}` value can be the `email` address or the + * `unique_id` of the service account. + * If not provided, workflow will use the project's default service account. + * Modifying this field for an existing workflow results in a new workflow + * revision. + * + * Generated from protobuf field string service_account = 9; + * @return string + */ + public function getServiceAccount() + { + return $this->service_account; + } + + /** + * Name of the service account associated with the latest workflow version. + * This service account represents the identity of the workflow and determines + * what permissions the workflow has. + * Format: projects/{project}/serviceAccounts/{account} + * Using `-` as a wildcard for the `{project}` will infer the project from + * the account. The `{account}` value can be the `email` address or the + * `unique_id` of the service account. + * If not provided, workflow will use the project's default service account. + * Modifying this field for an existing workflow results in a new workflow + * revision. + * + * Generated from protobuf field string service_account = 9; + * @param string $var + * @return $this + */ + public function setServiceAccount($var) + { + GPBUtil::checkString($var, True); + $this->service_account = $var; + + return $this; + } + + /** + * Workflow code to be executed. The size limit is 32KB. + * + * Generated from protobuf field string source_contents = 10; + * @return string + */ + public function getSourceContents() + { + return $this->readOneof(10); + } + + public function hasSourceContents() + { + return $this->hasOneof(10); + } + + /** + * Workflow code to be executed. The size limit is 32KB. + * + * Generated from protobuf field string source_contents = 10; + * @param string $var + * @return $this + */ + public function setSourceContents($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(10, $var); + + return $this; + } + + /** + * @return string + */ + public function getSourceCode() + { + return $this->whichOneof("source_code"); + } + +} + diff --git a/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/Workflow/State.php b/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/Workflow/State.php new file mode 100644 index 000000000000..ded042b45d2c --- /dev/null +++ b/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/Workflow/State.php @@ -0,0 +1,58 @@ +google.cloud.workflows.v1beta.Workflow.State + */ +class State +{ + /** + * Invalid state. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The workflow has been deployed successfully and is serving. + * + * Generated from protobuf enum ACTIVE = 1; + */ + const ACTIVE = 1; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::ACTIVE => 'ACTIVE', + ]; + + 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\Workflows\V1beta\Workflow_State::class); + diff --git a/owl-bot-staging/Workflows/v1beta/samples/V1beta/WorkflowsClient/create_workflow.php b/owl-bot-staging/Workflows/v1beta/samples/V1beta/WorkflowsClient/create_workflow.php new file mode 100644 index 000000000000..bc06e2f97d09 --- /dev/null +++ b/owl-bot-staging/Workflows/v1beta/samples/V1beta/WorkflowsClient/create_workflow.php @@ -0,0 +1,93 @@ +createWorkflow($formattedParent, $workflow, $workflowId); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Workflow $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = WorkflowsClient::locationName('[PROJECT]', '[LOCATION]'); + $workflowId = '[WORKFLOW_ID]'; + + create_workflow_sample($formattedParent, $workflowId); +} +// [END workflows_v1beta_generated_Workflows_CreateWorkflow_sync] diff --git a/owl-bot-staging/Workflows/v1beta/samples/V1beta/WorkflowsClient/delete_workflow.php b/owl-bot-staging/Workflows/v1beta/samples/V1beta/WorkflowsClient/delete_workflow.php new file mode 100644 index 000000000000..c46edf18f0b8 --- /dev/null +++ b/owl-bot-staging/Workflows/v1beta/samples/V1beta/WorkflowsClient/delete_workflow.php @@ -0,0 +1,78 @@ +deleteWorkflow($formattedName); + $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 = WorkflowsClient::workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); + + delete_workflow_sample($formattedName); +} +// [END workflows_v1beta_generated_Workflows_DeleteWorkflow_sync] diff --git a/owl-bot-staging/Workflows/v1beta/samples/V1beta/WorkflowsClient/get_workflow.php b/owl-bot-staging/Workflows/v1beta/samples/V1beta/WorkflowsClient/get_workflow.php new file mode 100644 index 000000000000..98d3980788ce --- /dev/null +++ b/owl-bot-staging/Workflows/v1beta/samples/V1beta/WorkflowsClient/get_workflow.php @@ -0,0 +1,67 @@ +getWorkflow($formattedName); + 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 = WorkflowsClient::workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); + + get_workflow_sample($formattedName); +} +// [END workflows_v1beta_generated_Workflows_GetWorkflow_sync] diff --git a/owl-bot-staging/Workflows/v1beta/samples/V1beta/WorkflowsClient/list_workflows.php b/owl-bot-staging/Workflows/v1beta/samples/V1beta/WorkflowsClient/list_workflows.php new file mode 100644 index 000000000000..2c50ff843aa7 --- /dev/null +++ b/owl-bot-staging/Workflows/v1beta/samples/V1beta/WorkflowsClient/list_workflows.php @@ -0,0 +1,73 @@ +listWorkflows($formattedParent); + + /** @var Workflow $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 = WorkflowsClient::locationName('[PROJECT]', '[LOCATION]'); + + list_workflows_sample($formattedParent); +} +// [END workflows_v1beta_generated_Workflows_ListWorkflows_sync] diff --git a/owl-bot-staging/Workflows/v1beta/samples/V1beta/WorkflowsClient/update_workflow.php b/owl-bot-staging/Workflows/v1beta/samples/V1beta/WorkflowsClient/update_workflow.php new file mode 100644 index 000000000000..82e8d02f4c18 --- /dev/null +++ b/owl-bot-staging/Workflows/v1beta/samples/V1beta/WorkflowsClient/update_workflow.php @@ -0,0 +1,72 @@ +updateWorkflow($workflow); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Workflow $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END workflows_v1beta_generated_Workflows_UpdateWorkflow_sync] diff --git a/owl-bot-staging/Workflows/v1beta/src/V1beta/Gapic/WorkflowsGapicClient.php b/owl-bot-staging/Workflows/v1beta/src/V1beta/Gapic/WorkflowsGapicClient.php new file mode 100644 index 000000000000..2914615fb4eb --- /dev/null +++ b/owl-bot-staging/Workflows/v1beta/src/V1beta/Gapic/WorkflowsGapicClient.php @@ -0,0 +1,714 @@ +locationName('[PROJECT]', '[LOCATION]'); + * $workflow = new Workflow(); + * $workflowId = 'workflow_id'; + * $operationResponse = $workflowsClient->createWorkflow($formattedParent, $workflow, $workflowId); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $workflowsClient->createWorkflow($formattedParent, $workflow, $workflowId); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $workflowsClient->resumeOperation($operationName, 'createWorkflow'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $workflowsClient->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. + * + * @experimental + */ +class WorkflowsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.workflows.v1beta.Workflows'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'workflows.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 $locationNameTemplate; + + private static $workflowNameTemplate; + + 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/workflows_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/workflows_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/workflows_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/workflows_rest_client_config.php', + ], + ], + ]; + } + + private static function getLocationNameTemplate() + { + if (self::$locationNameTemplate == null) { + self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); + } + + return self::$locationNameTemplate; + } + + private static function getWorkflowNameTemplate() + { + if (self::$workflowNameTemplate == null) { + self::$workflowNameTemplate = new PathTemplate('projects/{project}/locations/{location}/workflows/{workflow}'); + } + + return self::$workflowNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'location' => self::getLocationNameTemplate(), + 'workflow' => self::getWorkflowNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * 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. + * + * @experimental + */ + 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 workflow + * resource. + * + * @param string $project + * @param string $location + * @param string $workflow + * + * @return string The formatted workflow resource. + * + * @experimental + */ + public static function workflowName($project, $location, $workflow) + { + return self::getWorkflowNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'workflow' => $workflow, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - location: projects/{project}/locations/{location} + * - workflow: projects/{project}/locations/{location}/workflows/{workflow} + * + * 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. + * + * @experimental + */ + 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 + * + * @experimental + */ + 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 + * + * @experimental + */ + 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 'workflows.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 + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** + * Creates a new workflow. If a workflow with the specified name already + * exists in the specified project and location, the long running operation + * will return [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error. + * + * Sample code: + * ``` + * $workflowsClient = new WorkflowsClient(); + * try { + * $formattedParent = $workflowsClient->locationName('[PROJECT]', '[LOCATION]'); + * $workflow = new Workflow(); + * $workflowId = 'workflow_id'; + * $operationResponse = $workflowsClient->createWorkflow($formattedParent, $workflow, $workflowId); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $workflowsClient->createWorkflow($formattedParent, $workflow, $workflowId); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $workflowsClient->resumeOperation($operationName, 'createWorkflow'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $workflowsClient->close(); + * } + * ``` + * + * @param string $parent Required. Project and location in which the workflow should be created. + * Format: projects/{project}/locations/{location} + * @param Workflow $workflow Required. Workflow to be created. + * @param string $workflowId Required. The ID of the workflow to be created. It has to fulfill the + * following requirements: + * + * * Must contain only letters, numbers, underscores and hyphens. + * * Must start with a letter. + * * Must be between 1-64 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project and location. + * @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\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function createWorkflow($parent, $workflow, $workflowId, array $optionalArgs = []) + { + $request = new CreateWorkflowRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setWorkflow($workflow); + $request->setWorkflowId($workflowId); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateWorkflow', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Deletes a workflow with the specified name. + * This method also cancels and deletes all running executions of the + * workflow. + * + * Sample code: + * ``` + * $workflowsClient = new WorkflowsClient(); + * try { + * $formattedName = $workflowsClient->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); + * $operationResponse = $workflowsClient->deleteWorkflow($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 = $workflowsClient->deleteWorkflow($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $workflowsClient->resumeOperation($operationName, 'deleteWorkflow'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $workflowsClient->close(); + * } + * ``` + * + * @param string $name Required. Name of the workflow to be deleted. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * @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\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function deleteWorkflow($name, array $optionalArgs = []) + { + $request = new DeleteWorkflowRequest(); + $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->startOperationsCall('DeleteWorkflow', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Gets details of a single Workflow. + * + * Sample code: + * ``` + * $workflowsClient = new WorkflowsClient(); + * try { + * $formattedName = $workflowsClient->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); + * $response = $workflowsClient->getWorkflow($formattedName); + * } finally { + * $workflowsClient->close(); + * } + * ``` + * + * @param string $name Required. Name of the workflow which information should be retrieved. + * Format: projects/{project}/locations/{location}/workflows/{workflow} + * @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\Workflows\V1beta\Workflow + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function getWorkflow($name, array $optionalArgs = []) + { + $request = new GetWorkflowRequest(); + $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('GetWorkflow', Workflow::class, $optionalArgs, $request)->wait(); + } + + /** + * Lists Workflows in a given project and location. + * The default order is not specified. + * + * Sample code: + * ``` + * $workflowsClient = new WorkflowsClient(); + * try { + * $formattedParent = $workflowsClient->locationName('[PROJECT]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $workflowsClient->listWorkflows($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $workflowsClient->listWorkflows($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $workflowsClient->close(); + * } + * ``` + * + * @param string $parent Required. Project and location from which the workflows should be listed. + * Format: projects/{project}/locations/{location} + * @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 string $filter + * Filter to restrict results to specific workflows. + * @type string $orderBy + * Comma-separated list of fields that that specify the order of the results. + * Default sorting order for a field is ascending. To specify descending order + * for a field, append a " desc" suffix. + * If not specified, the results will be returned in an unspecified order. + * @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 + * + * @experimental + */ + public function listWorkflows($parent, array $optionalArgs = []) + { + $request = new ListWorkflowsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListWorkflows', $optionalArgs, ListWorkflowsResponse::class, $request); + } + + /** + * Updates an existing workflow. + * Running this method has no impact on already running executions of the + * workflow. A new revision of the workflow may be created as a result of a + * successful update operation. In that case, such revision will be used + * in new workflow executions. + * + * Sample code: + * ``` + * $workflowsClient = new WorkflowsClient(); + * try { + * $workflow = new Workflow(); + * $operationResponse = $workflowsClient->updateWorkflow($workflow); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $workflowsClient->updateWorkflow($workflow); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $workflowsClient->resumeOperation($operationName, 'updateWorkflow'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $workflowsClient->close(); + * } + * ``` + * + * @param Workflow $workflow Required. Workflow to be updated. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * List of fields to be updated. If not present, the entire workflow + * will be updated. + * @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 + * + * @experimental + */ + public function updateWorkflow($workflow, array $optionalArgs = []) + { + $request = new UpdateWorkflowRequest(); + $requestParamHeaders = []; + $request->setWorkflow($workflow); + $requestParamHeaders['workflow.name'] = $workflow->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('UpdateWorkflow', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } +} diff --git a/owl-bot-staging/Workflows/v1beta/src/V1beta/WorkflowsClient.php b/owl-bot-staging/Workflows/v1beta/src/V1beta/WorkflowsClient.php new file mode 100644 index 000000000000..866499e8fc40 --- /dev/null +++ b/owl-bot-staging/Workflows/v1beta/src/V1beta/WorkflowsClient.php @@ -0,0 +1,36 @@ + [ + 'google.cloud.workflows.v1beta.Workflows' => [ + 'CreateWorkflow' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Workflows\V1beta\Workflow', + 'metadataReturnType' => '\Google\Cloud\Workflows\V1beta\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'DeleteWorkflow' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\Workflows\V1beta\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'UpdateWorkflow' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Workflows\V1beta\Workflow', + 'metadataReturnType' => '\Google\Cloud\Workflows\V1beta\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'ListWorkflows' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getWorkflows', + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Workflows/v1beta/src/V1beta/resources/workflows_rest_client_config.php b/owl-bot-staging/Workflows/v1beta/src/V1beta/resources/workflows_rest_client_config.php new file mode 100644 index 000000000000..35bd2027c0e3 --- /dev/null +++ b/owl-bot-staging/Workflows/v1beta/src/V1beta/resources/workflows_rest_client_config.php @@ -0,0 +1,129 @@ + [ + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.workflows.v1beta.Workflows' => [ + 'CreateWorkflow' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*}/workflows', + 'body' => 'workflow', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'workflow_id', + ], + ], + 'DeleteWorkflow' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/workflows/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetWorkflow' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/workflows/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListWorkflows' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*}/workflows', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateWorkflow' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1beta/{workflow.name=projects/*/locations/*/workflows/*}', + 'body' => 'workflow', + 'placeholders' => [ + 'workflow.name' => [ + 'getters' => [ + 'getWorkflow', + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Workflows/v1beta/tests/Unit/V1beta/WorkflowsClientTest.php b/owl-bot-staging/Workflows/v1beta/tests/Unit/V1beta/WorkflowsClientTest.php new file mode 100644 index 000000000000..2bb06cc9c188 --- /dev/null +++ b/owl-bot-staging/Workflows/v1beta/tests/Unit/V1beta/WorkflowsClientTest.php @@ -0,0 +1,582 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return WorkflowsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new WorkflowsClient($options); + } + + /** @test */ + public function createWorkflowTest() + { + $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/createWorkflowTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $revisionId = 'revisionId513861631'; + $serviceAccount = 'serviceAccount-1948028253'; + $sourceContents = 'sourceContents-1799875906'; + $expectedResponse = new Workflow(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setRevisionId($revisionId); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setSourceContents($sourceContents); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createWorkflowTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $workflow = new Workflow(); + $workflowId = 'workflowId1712917915'; + $response = $gapicClient->createWorkflow($formattedParent, $workflow, $workflowId); + $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.workflows.v1beta.Workflows/CreateWorkflow', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getWorkflow(); + $this->assertProtobufEquals($workflow, $actualValue); + $actualValue = $actualApiRequestObject->getWorkflowId(); + $this->assertProtobufEquals($workflowId, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createWorkflowTest'); + $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 createWorkflowExceptionTest() + { + $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/createWorkflowTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $workflow = new Workflow(); + $workflowId = 'workflowId1712917915'; + $response = $gapicClient->createWorkflow($formattedParent, $workflow, $workflowId); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createWorkflowTest'); + 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 deleteWorkflowTest() + { + $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/deleteWorkflowTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteWorkflowTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); + $response = $gapicClient->deleteWorkflow($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.workflows.v1beta.Workflows/DeleteWorkflow', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteWorkflowTest'); + $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 deleteWorkflowExceptionTest() + { + $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/deleteWorkflowTest'); + $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->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); + $response = $gapicClient->deleteWorkflow($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteWorkflowTest'); + 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 getWorkflowTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $revisionId = 'revisionId513861631'; + $serviceAccount = 'serviceAccount-1948028253'; + $sourceContents = 'sourceContents-1799875906'; + $expectedResponse = new Workflow(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setRevisionId($revisionId); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setSourceContents($sourceContents); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); + $response = $gapicClient->getWorkflow($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.workflows.v1beta.Workflows/GetWorkflow', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getWorkflowExceptionTest() + { + $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->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); + try { + $gapicClient->getWorkflow($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 listWorkflowsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $workflowsElement = new Workflow(); + $workflows = [ + $workflowsElement, + ]; + $expectedResponse = new ListWorkflowsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setWorkflows($workflows); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->listWorkflows($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getWorkflows()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.workflows.v1beta.Workflows/ListWorkflows', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listWorkflowsExceptionTest() + { + $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->listWorkflows($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 updateWorkflowTest() + { + $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/updateWorkflowTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $revisionId = 'revisionId513861631'; + $serviceAccount = 'serviceAccount-1948028253'; + $sourceContents = 'sourceContents-1799875906'; + $expectedResponse = new Workflow(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setRevisionId($revisionId); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setSourceContents($sourceContents); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateWorkflowTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $workflow = new Workflow(); + $response = $gapicClient->updateWorkflow($workflow); + $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.workflows.v1beta.Workflows/UpdateWorkflow', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getWorkflow(); + $this->assertProtobufEquals($workflow, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateWorkflowTest'); + $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 updateWorkflowExceptionTest() + { + $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/updateWorkflowTest'); + $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 + $workflow = new Workflow(); + $response = $gapicClient->updateWorkflow($workflow); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateWorkflowTest'); + 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()); + } +} From 4c1de9389794209d0e35a97a6d12f63fc6da1a37 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 16 Aug 2023 22:58:48 +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 --- .../metadata/Executions/V1/Executions.php | Bin 4267 -> 5072 bytes Workflows/src/Executions/V1/Execution.php | 202 +++++ .../Executions/V1/Execution/CallLogLevel.php | 9 +- .../src/Executions/V1/Execution/State.php | 14 + .../Executions/V1/Execution/StateError.php | 4 +- .../V1/Execution/StateError/Type.php | 0 .../src}/Executions/V1/Execution/Status.php | 0 .../Executions/V1/Execution/Status/Step.php | 4 +- Workflows/src/Executions/V1/ExecutionView.php | 4 +- .../src/Executions/V1/GetExecutionRequest.php | 16 +- .../Executions/V1/ListExecutionsRequest.php | 124 ++- .../Workflows/Executions/V1/Executions.php | Bin 5072 -> 0 bytes .../Executions/V1/CancelExecutionRequest.php | 93 -- .../Executions/V1/CreateExecutionRequest.php | 139 --- .../Workflows/Executions/V1/Execution.php | 608 ------------- .../Executions/V1/Execution/CallLogLevel.php | 73 -- .../Executions/V1/Execution/Error.php | 148 ---- .../Executions/V1/Execution/StackTrace.php | 70 -- .../V1/Execution/StackTraceElement.php | 148 ---- .../Execution/StackTraceElement/Position.php | 144 --- .../Executions/V1/Execution/State.php | 93 -- .../Workflows/Executions/V1/ExecutionView.php | 63 -- .../Executions/V1/GetExecutionRequest.php | 131 --- .../Executions/V1/ListExecutionsRequest.php | 322 ------- .../Executions/V1/ListExecutionsResponse.php | 107 --- .../V1/ExecutionsClient/cancel_execution.php | 78 -- .../V1/ExecutionsClient/create_execution.php | 75 -- .../V1/ExecutionsClient/get_execution.php | 78 -- .../V1/ExecutionsClient/list_executions.php | 80 -- .../BaseClient/ExecutionsBaseClient.php | 349 -------- .../v1/src/V1/Client/ExecutionsClient.php | 40 - .../Executions/v1/src/V1/gapic_metadata.json | 38 - .../resources/executions_client_config.json | 42 - .../executions_descriptor_config.php | 68 -- .../executions_rest_client_config.php | 54 -- .../Unit/V1/Client/ExecutionsClientTest.php | 389 -------- .../Executions/V1Beta/Executions.php | Bin 3803 -> 0 bytes .../V1beta/CancelExecutionRequest.php | 77 -- .../V1beta/CreateExecutionRequest.php | 121 --- .../Workflows/Executions/V1beta/Execution.php | 359 -------- .../Executions/V1beta/Execution/Error.php | 104 --- .../Executions/V1beta/Execution/State.php | 79 -- .../Executions/V1beta/ExecutionView.php | 63 -- .../Executions/V1beta/GetExecutionRequest.php | 115 --- .../V1beta/ListExecutionsRequest.php | 207 ----- .../V1beta/ListExecutionsResponse.php | 107 --- .../ExecutionsClient/cancel_execution.php | 73 -- .../ExecutionsClient/create_execution.php | 71 -- .../V1beta/ExecutionsClient/get_execution.php | 73 -- .../ExecutionsClient/list_executions.php | 75 -- .../v1beta/src/V1beta/ExecutionsClient.php | 36 - .../V1beta/Gapic/ExecutionsGapicClient.php | 516 ----------- .../v1beta/src/V1beta/gapic_metadata.json | 38 - .../resources/executions_client_config.json | 46 - .../executions_descriptor_config.php | 18 - .../executions_rest_client_config.php | 54 -- .../Unit/V1beta/ExecutionsClientTest.php | 332 ------- .../Google/Cloud/Workflows/V1/Workflows.php | Bin 4839 -> 0 bytes .../Workflows/V1/CreateWorkflowRequest.php | 201 ----- .../Workflows/V1/DeleteWorkflowRequest.php | 88 -- .../Cloud/Workflows/V1/GetWorkflowRequest.php | 137 --- .../Workflows/V1/ListWorkflowsRequest.php | 260 ------ .../Workflows/V1/ListWorkflowsResponse.php | 141 --- .../Cloud/Workflows/V1/OperationMetadata.php | 223 ----- .../Workflows/V1/UpdateWorkflowRequest.php | 143 --- .../Google/Cloud/Workflows/V1/Workflow.php | 713 --------------- .../Workflows/V1/Workflow/CallLogLevel.php | 73 -- .../Cloud/Workflows/V1/Workflow/State.php | 64 -- .../Workflows/V1/Workflow/StateError.php | 104 --- .../Workflows/V1/Workflow/StateError/Type.php | 57 -- .../V1/WorkflowsClient/create_workflow.php | 98 --- .../V1/WorkflowsClient/delete_workflow.php | 83 -- .../V1/WorkflowsClient/get_location.php | 57 -- .../V1/WorkflowsClient/get_workflow.php | 72 -- .../V1/WorkflowsClient/list_locations.php | 62 -- .../V1/WorkflowsClient/list_workflows.php | 78 -- .../V1/WorkflowsClient/update_workflow.php | 75 -- .../Client/BaseClient/WorkflowsBaseClient.php | 494 ----------- .../v1/src/V1/Client/WorkflowsClient.php | 40 - .../Workflows/v1/src/V1/gapic_metadata.json | 53 -- .../V1/resources/workflows_client_config.json | 57 -- .../resources/workflows_descriptor_config.php | 137 --- .../workflows_rest_client_config.php | 129 --- .../Unit/V1/Client/WorkflowsClientTest.php | 829 ------------------ .../Cloud/Workflows/V1Beta/Workflows.php | Bin 4084 -> 0 bytes .../V1beta/CreateWorkflowRequest.php | 175 ---- .../V1beta/DeleteWorkflowRequest.php | 73 -- .../Workflows/V1beta/GetWorkflowRequest.php | 72 -- .../Workflows/V1beta/ListWorkflowsRequest.php | 245 ------ .../V1beta/ListWorkflowsResponse.php | 141 --- .../Workflows/V1beta/OperationMetadata.php | 223 ----- .../V1beta/UpdateWorkflowRequest.php | 127 --- .../Cloud/Workflows/V1beta/Workflow.php | 503 ----------- .../Cloud/Workflows/V1beta/Workflow/State.php | 58 -- .../WorkflowsClient/create_workflow.php | 93 -- .../WorkflowsClient/delete_workflow.php | 78 -- .../V1beta/WorkflowsClient/get_workflow.php | 67 -- .../V1beta/WorkflowsClient/list_workflows.php | 73 -- .../WorkflowsClient/update_workflow.php | 72 -- .../src/V1beta/Gapic/WorkflowsGapicClient.php | 714 --------------- .../v1beta/src/V1beta/WorkflowsClient.php | 36 - .../v1beta/src/V1beta/gapic_metadata.json | 43 - .../resources/workflows_client_config.json | 47 - .../resources/workflows_descriptor_config.php | 48 - .../workflows_rest_client_config.php | 129 --- .../tests/Unit/V1beta/WorkflowsClientTest.php | 582 ------------ 106 files changed, 350 insertions(+), 14088 deletions(-) rename {owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows => Workflows/src}/Executions/V1/Execution/StateError.php (98%) rename {owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows => Workflows/src}/Executions/V1/Execution/StateError/Type.php (100%) rename {owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows => Workflows/src}/Executions/V1/Execution/Status.php (100%) rename {owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows => Workflows/src}/Executions/V1/Execution/Status/Step.php (97%) delete mode 100644 owl-bot-staging/Workflows/Executions/v1/proto/src/GPBMetadata/Google/Cloud/Workflows/Executions/V1/Executions.php delete mode 100644 owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/CancelExecutionRequest.php delete mode 100644 owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/CreateExecutionRequest.php delete mode 100644 owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution.php delete mode 100644 owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/CallLogLevel.php delete mode 100644 owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/Error.php delete mode 100644 owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/StackTrace.php delete mode 100644 owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/StackTraceElement.php delete mode 100644 owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/StackTraceElement/Position.php delete mode 100644 owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/State.php delete mode 100644 owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/ExecutionView.php delete mode 100644 owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/GetExecutionRequest.php delete mode 100644 owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/ListExecutionsRequest.php delete mode 100644 owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/ListExecutionsResponse.php delete mode 100644 owl-bot-staging/Workflows/Executions/v1/samples/V1/ExecutionsClient/cancel_execution.php delete mode 100644 owl-bot-staging/Workflows/Executions/v1/samples/V1/ExecutionsClient/create_execution.php delete mode 100644 owl-bot-staging/Workflows/Executions/v1/samples/V1/ExecutionsClient/get_execution.php delete mode 100644 owl-bot-staging/Workflows/Executions/v1/samples/V1/ExecutionsClient/list_executions.php delete mode 100644 owl-bot-staging/Workflows/Executions/v1/src/V1/Client/BaseClient/ExecutionsBaseClient.php delete mode 100644 owl-bot-staging/Workflows/Executions/v1/src/V1/Client/ExecutionsClient.php delete mode 100644 owl-bot-staging/Workflows/Executions/v1/src/V1/gapic_metadata.json delete mode 100644 owl-bot-staging/Workflows/Executions/v1/src/V1/resources/executions_client_config.json delete mode 100644 owl-bot-staging/Workflows/Executions/v1/src/V1/resources/executions_descriptor_config.php delete mode 100644 owl-bot-staging/Workflows/Executions/v1/src/V1/resources/executions_rest_client_config.php delete mode 100644 owl-bot-staging/Workflows/Executions/v1/tests/Unit/V1/Client/ExecutionsClientTest.php delete mode 100644 owl-bot-staging/Workflows/Executions/v1beta/proto/src/GPBMetadata/Google/Cloud/Workflows/Executions/V1Beta/Executions.php delete mode 100644 owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/CancelExecutionRequest.php delete mode 100644 owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/CreateExecutionRequest.php delete mode 100644 owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/Execution.php delete mode 100644 owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/Execution/Error.php delete mode 100644 owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/Execution/State.php delete mode 100644 owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/ExecutionView.php delete mode 100644 owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/GetExecutionRequest.php delete mode 100644 owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/ListExecutionsRequest.php delete mode 100644 owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/ListExecutionsResponse.php delete mode 100644 owl-bot-staging/Workflows/Executions/v1beta/samples/V1beta/ExecutionsClient/cancel_execution.php delete mode 100644 owl-bot-staging/Workflows/Executions/v1beta/samples/V1beta/ExecutionsClient/create_execution.php delete mode 100644 owl-bot-staging/Workflows/Executions/v1beta/samples/V1beta/ExecutionsClient/get_execution.php delete mode 100644 owl-bot-staging/Workflows/Executions/v1beta/samples/V1beta/ExecutionsClient/list_executions.php delete mode 100644 owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/ExecutionsClient.php delete mode 100644 owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/Gapic/ExecutionsGapicClient.php delete mode 100644 owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/gapic_metadata.json delete mode 100644 owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/resources/executions_client_config.json delete mode 100644 owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/resources/executions_descriptor_config.php delete mode 100644 owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/resources/executions_rest_client_config.php delete mode 100644 owl-bot-staging/Workflows/Executions/v1beta/tests/Unit/V1beta/ExecutionsClientTest.php delete mode 100644 owl-bot-staging/Workflows/v1/proto/src/GPBMetadata/Google/Cloud/Workflows/V1/Workflows.php delete mode 100644 owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/CreateWorkflowRequest.php delete mode 100644 owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/DeleteWorkflowRequest.php delete mode 100644 owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/GetWorkflowRequest.php delete mode 100644 owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/ListWorkflowsRequest.php delete mode 100644 owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/ListWorkflowsResponse.php delete mode 100644 owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/OperationMetadata.php delete mode 100644 owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/UpdateWorkflowRequest.php delete mode 100644 owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/Workflow.php delete mode 100644 owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/Workflow/CallLogLevel.php delete mode 100644 owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/Workflow/State.php delete mode 100644 owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/Workflow/StateError.php delete mode 100644 owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/Workflow/StateError/Type.php delete mode 100644 owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/create_workflow.php delete mode 100644 owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/delete_workflow.php delete mode 100644 owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/get_location.php delete mode 100644 owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/get_workflow.php delete mode 100644 owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/list_locations.php delete mode 100644 owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/list_workflows.php delete mode 100644 owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/update_workflow.php delete mode 100644 owl-bot-staging/Workflows/v1/src/V1/Client/BaseClient/WorkflowsBaseClient.php delete mode 100644 owl-bot-staging/Workflows/v1/src/V1/Client/WorkflowsClient.php delete mode 100644 owl-bot-staging/Workflows/v1/src/V1/gapic_metadata.json delete mode 100644 owl-bot-staging/Workflows/v1/src/V1/resources/workflows_client_config.json delete mode 100644 owl-bot-staging/Workflows/v1/src/V1/resources/workflows_descriptor_config.php delete mode 100644 owl-bot-staging/Workflows/v1/src/V1/resources/workflows_rest_client_config.php delete mode 100644 owl-bot-staging/Workflows/v1/tests/Unit/V1/Client/WorkflowsClientTest.php delete mode 100644 owl-bot-staging/Workflows/v1beta/proto/src/GPBMetadata/Google/Cloud/Workflows/V1Beta/Workflows.php delete mode 100644 owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/CreateWorkflowRequest.php delete mode 100644 owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/DeleteWorkflowRequest.php delete mode 100644 owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/GetWorkflowRequest.php delete mode 100644 owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/ListWorkflowsRequest.php delete mode 100644 owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/ListWorkflowsResponse.php delete mode 100644 owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/OperationMetadata.php delete mode 100644 owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/UpdateWorkflowRequest.php delete mode 100644 owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/Workflow.php delete mode 100644 owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/Workflow/State.php delete mode 100644 owl-bot-staging/Workflows/v1beta/samples/V1beta/WorkflowsClient/create_workflow.php delete mode 100644 owl-bot-staging/Workflows/v1beta/samples/V1beta/WorkflowsClient/delete_workflow.php delete mode 100644 owl-bot-staging/Workflows/v1beta/samples/V1beta/WorkflowsClient/get_workflow.php delete mode 100644 owl-bot-staging/Workflows/v1beta/samples/V1beta/WorkflowsClient/list_workflows.php delete mode 100644 owl-bot-staging/Workflows/v1beta/samples/V1beta/WorkflowsClient/update_workflow.php delete mode 100644 owl-bot-staging/Workflows/v1beta/src/V1beta/Gapic/WorkflowsGapicClient.php delete mode 100644 owl-bot-staging/Workflows/v1beta/src/V1beta/WorkflowsClient.php delete mode 100644 owl-bot-staging/Workflows/v1beta/src/V1beta/gapic_metadata.json delete mode 100644 owl-bot-staging/Workflows/v1beta/src/V1beta/resources/workflows_client_config.json delete mode 100644 owl-bot-staging/Workflows/v1beta/src/V1beta/resources/workflows_descriptor_config.php delete mode 100644 owl-bot-staging/Workflows/v1beta/src/V1beta/resources/workflows_rest_client_config.php delete mode 100644 owl-bot-staging/Workflows/v1beta/tests/Unit/V1beta/WorkflowsClientTest.php diff --git a/Workflows/metadata/Executions/V1/Executions.php b/Workflows/metadata/Executions/V1/Executions.php index 1cbda3d791d5167dff8612f3deba3a3f20c371e6..84359f945f1b3db4f98924a6c9c0e61910568c53 100644 GIT binary patch delta 604 zcmYjN-)hrP822P;ntoYpJSwEU&{~ug)NG7ZWJ9ELQER()HtAqD3+Z|`>OxabPK1J> z;)S3$YOZ_$Zxli3ts>|P_z2#5;X8Ovx{6na^ZS1PzVG9OpNpS=NZMvheKrh7$!qDE z@}&&5H_cjdPkvlHcNm6;0a+T;kcIvDU}-RCev_-x*Fy4JesN_Pv^i`plu=b*DOxj~ zHP>15gy{oi9bw!AHDW%CBNI}=wdAR?T8yI&`Bz;Q)4=bOATsr`%A$!E= z1iPRMJ@E*oAvN=<$r`8Cz!pgAGku@=gf5nzBT$_*40j>FA5%(3%!?QqM<)8`zq%Jk zmczl)B~ZkRPePW4F&mBur=e;NFMuLcrX+r)cL+e(k~C1T2ZZ@UUV6sf0)*ou O*PocGfTwqJ``N$pa-+Wh delta 68 zcmV-K0K5OtC#xZ_!vd530!{+b8k0@~vy&kNAp)NXlSBlEv;71$0ka|ptpNfeRFfhK aR01Mala&fqllcmY0l|}m3&OK<3|.google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ private $end_time = null; + /** + * Output only. Measures the duration of the execution. + * + * Generated from protobuf field .google.protobuf.Duration duration = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $duration = null; /** * Output only. Current state of the execution. * @@ -79,6 +85,33 @@ class Execution extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.CallLogLevel call_log_level = 9; */ private $call_log_level = 0; + /** + * Output only. Status tracks the current steps and progress data of this + * execution. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.Status status = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $status = null; + /** + * Labels associated with this execution. + * Labels can contain at most 64 entries. Keys and values can be no longer + * than 63 characters and can only contain lowercase letters, numeric + * characters, underscores, and dashes. Label keys must start with a letter. + * International characters are allowed. + * By default, labels are inherited from the workflow but are overridden by + * any labels associated with the execution. + * + * Generated from protobuf field map labels = 11; + */ + private $labels; + /** + * Output only. Error regarding the state of the Execution resource. For + * example, this field will have error details if the execution data is + * unavailable due to revoked KMS key permissions. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.StateError state_error = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $state_error = null; /** * Constructor. @@ -94,6 +127,8 @@ class Execution extends \Google\Protobuf\Internal\Message * Output only. Marks the beginning of execution. * @type \Google\Protobuf\Timestamp $end_time * Output only. Marks the end of execution, successful or not. + * @type \Google\Protobuf\Duration $duration + * Output only. Measures the duration of the execution. * @type int $state * Output only. Current state of the execution. * @type string $argument @@ -113,6 +148,21 @@ class Execution extends \Google\Protobuf\Internal\Message * Output only. Revision of the workflow this execution is using. * @type int $call_log_level * The call logging level associated to this execution. + * @type \Google\Cloud\Workflows\Executions\V1\Execution\Status $status + * Output only. Status tracks the current steps and progress data of this + * execution. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels associated with this execution. + * Labels can contain at most 64 entries. Keys and values can be no longer + * than 63 characters and can only contain lowercase letters, numeric + * characters, underscores, and dashes. Label keys must start with a letter. + * International characters are allowed. + * By default, labels are inherited from the workflow but are overridden by + * any labels associated with the execution. + * @type \Google\Cloud\Workflows\Executions\V1\Execution\StateError $state_error + * Output only. Error regarding the state of the Execution resource. For + * example, this field will have error details if the execution data is + * unavailable due to revoked KMS key permissions. * } */ public function __construct($data = NULL) { @@ -222,6 +272,42 @@ public function setEndTime($var) return $this; } + /** + * Output only. Measures the duration of the execution. + * + * Generated from protobuf field .google.protobuf.Duration duration = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Duration|null + */ + public function getDuration() + { + return $this->duration; + } + + public function hasDuration() + { + return isset($this->duration); + } + + public function clearDuration() + { + unset($this->duration); + } + + /** + * Output only. Measures the duration of the execution. + * + * Generated from protobuf field .google.protobuf.Duration duration = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->duration = $var; + + return $this; + } + /** * Output only. Current state of the execution. * @@ -402,5 +488,121 @@ public function setCallLogLevel($var) return $this; } + /** + * Output only. Status tracks the current steps and progress data of this + * execution. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.Status status = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Workflows\Executions\V1\Execution\Status|null + */ + public function getStatus() + { + return $this->status; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * Output only. Status tracks the current steps and progress data of this + * execution. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.Status status = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Workflows\Executions\V1\Execution\Status $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Workflows\Executions\V1\Execution\Status::class); + $this->status = $var; + + return $this; + } + + /** + * Labels associated with this execution. + * Labels can contain at most 64 entries. Keys and values can be no longer + * than 63 characters and can only contain lowercase letters, numeric + * characters, underscores, and dashes. Label keys must start with a letter. + * International characters are allowed. + * By default, labels are inherited from the workflow but are overridden by + * any labels associated with the execution. + * + * Generated from protobuf field map labels = 11; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels associated with this execution. + * Labels can contain at most 64 entries. Keys and values can be no longer + * than 63 characters and can only contain lowercase letters, numeric + * characters, underscores, and dashes. Label keys must start with a letter. + * International characters are allowed. + * By default, labels are inherited from the workflow but are overridden by + * any labels associated with the execution. + * + * Generated from protobuf field map labels = 11; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Output only. Error regarding the state of the Execution resource. For + * example, this field will have error details if the execution data is + * unavailable due to revoked KMS key permissions. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.StateError state_error = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Workflows\Executions\V1\Execution\StateError|null + */ + public function getStateError() + { + return $this->state_error; + } + + public function hasStateError() + { + return isset($this->state_error); + } + + public function clearStateError() + { + unset($this->state_error); + } + + /** + * Output only. Error regarding the state of the Execution resource. For + * example, this field will have error details if the execution data is + * unavailable due to revoked KMS key permissions. + * + * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.StateError state_error = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Workflows\Executions\V1\Execution\StateError $var + * @return $this + */ + public function setStateError($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Workflows\Executions\V1\Execution\StateError::class); + $this->state_error = $var; + + return $this; + } + } diff --git a/Workflows/src/Executions/V1/Execution/CallLogLevel.php b/Workflows/src/Executions/V1/Execution/CallLogLevel.php index dbc2fd0a6d5e..ff6b5532dbfb 100644 --- a/Workflows/src/Executions/V1/Execution/CallLogLevel.php +++ b/Workflows/src/Executions/V1/Execution/CallLogLevel.php @@ -15,7 +15,7 @@ class CallLogLevel { /** - * No call logging specified. + * No call logging level specified. * * Generated from protobuf enum CALL_LOG_LEVEL_UNSPECIFIED = 0; */ @@ -33,11 +33,18 @@ class CallLogLevel * Generated from protobuf enum LOG_ERRORS_ONLY = 2; */ const LOG_ERRORS_ONLY = 2; + /** + * Explicitly log nothing. + * + * Generated from protobuf enum LOG_NONE = 3; + */ + const LOG_NONE = 3; private static $valueToName = [ self::CALL_LOG_LEVEL_UNSPECIFIED => 'CALL_LOG_LEVEL_UNSPECIFIED', self::LOG_ALL_CALLS => 'LOG_ALL_CALLS', self::LOG_ERRORS_ONLY => 'LOG_ERRORS_ONLY', + self::LOG_NONE => 'LOG_NONE', ]; public static function name($value) diff --git a/Workflows/src/Executions/V1/Execution/State.php b/Workflows/src/Executions/V1/Execution/State.php index 5b5702c3bb32..79500707a958 100644 --- a/Workflows/src/Executions/V1/Execution/State.php +++ b/Workflows/src/Executions/V1/Execution/State.php @@ -44,6 +44,18 @@ class State * Generated from protobuf enum CANCELLED = 4; */ const CANCELLED = 4; + /** + * Execution data is unavailable. See the `state_error` field. + * + * Generated from protobuf enum UNAVAILABLE = 5; + */ + const UNAVAILABLE = 5; + /** + * Request has been placed in the backlog for processing at a later time. + * + * Generated from protobuf enum QUEUED = 6; + */ + const QUEUED = 6; private static $valueToName = [ self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', @@ -51,6 +63,8 @@ class State self::SUCCEEDED => 'SUCCEEDED', self::FAILED => 'FAILED', self::CANCELLED => 'CANCELLED', + self::UNAVAILABLE => 'UNAVAILABLE', + self::QUEUED => 'QUEUED', ]; public static function name($value) diff --git a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/StateError.php b/Workflows/src/Executions/V1/Execution/StateError.php similarity index 98% rename from owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/StateError.php rename to Workflows/src/Executions/V1/Execution/StateError.php index 86fe3c37a521..3fe8c06d64a0 100644 --- a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/StateError.php +++ b/Workflows/src/Executions/V1/Execution/StateError.php @@ -20,13 +20,13 @@ class StateError extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string details = 1; */ - protected $details = ''; + private $details = ''; /** * The type of this state error. * * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.StateError.Type type = 2; */ - protected $type = 0; + private $type = 0; /** * Constructor. diff --git a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/StateError/Type.php b/Workflows/src/Executions/V1/Execution/StateError/Type.php similarity index 100% rename from owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/StateError/Type.php rename to Workflows/src/Executions/V1/Execution/StateError/Type.php diff --git a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/Status.php b/Workflows/src/Executions/V1/Execution/Status.php similarity index 100% rename from owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/Status.php rename to Workflows/src/Executions/V1/Execution/Status.php diff --git a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/Status/Step.php b/Workflows/src/Executions/V1/Execution/Status/Step.php similarity index 97% rename from owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/Status/Step.php rename to Workflows/src/Executions/V1/Execution/Status/Step.php index 2a4809523790..04744bc3bc09 100644 --- a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/Status/Step.php +++ b/Workflows/src/Executions/V1/Execution/Status/Step.php @@ -20,13 +20,13 @@ class Step extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string routine = 1; */ - protected $routine = ''; + private $routine = ''; /** * Name of a step within the routine. * * Generated from protobuf field string step = 2; */ - protected $step = ''; + private $step = ''; /** * Constructor. diff --git a/Workflows/src/Executions/V1/ExecutionView.php b/Workflows/src/Executions/V1/ExecutionView.php index 589d3628b918..3cf62b861520 100644 --- a/Workflows/src/Executions/V1/ExecutionView.php +++ b/Workflows/src/Executions/V1/ExecutionView.php @@ -21,8 +21,8 @@ class ExecutionView const EXECUTION_VIEW_UNSPECIFIED = 0; /** * Includes only basic metadata about the execution. - * Following fields are returned: name, start_time, end_time, state - * and workflow_revision_id. + * The following fields are returned: name, start_time, end_time, duration, + * state, and workflow_revision_id. * * Generated from protobuf enum BASIC = 1; */ diff --git a/Workflows/src/Executions/V1/GetExecutionRequest.php b/Workflows/src/Executions/V1/GetExecutionRequest.php index a754d7d49def..fd2c9fb63909 100644 --- a/Workflows/src/Executions/V1/GetExecutionRequest.php +++ b/Workflows/src/Executions/V1/GetExecutionRequest.php @@ -26,8 +26,8 @@ class GetExecutionRequest extends \Google\Protobuf\Internal\Message */ private $name = ''; /** - * Optional. A view defining which fields should be filled in the returned execution. - * The API will default to the FULL view. + * Optional. A view defining which fields should be filled in the returned + * execution. The API will default to the FULL view. * * Generated from protobuf field .google.cloud.workflows.executions.v1.ExecutionView view = 2 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -60,8 +60,8 @@ public static function build(string $name): self * Format: * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} * @type int $view - * Optional. A view defining which fields should be filled in the returned execution. - * The API will default to the FULL view. + * Optional. A view defining which fields should be filled in the returned + * execution. The API will default to the FULL view. * } */ public function __construct($data = NULL) { @@ -100,8 +100,8 @@ public function setName($var) } /** - * Optional. A view defining which fields should be filled in the returned execution. - * The API will default to the FULL view. + * Optional. A view defining which fields should be filled in the returned + * execution. The API will default to the FULL view. * * Generated from protobuf field .google.cloud.workflows.executions.v1.ExecutionView view = 2 [(.google.api.field_behavior) = OPTIONAL]; * @return int @@ -112,8 +112,8 @@ public function getView() } /** - * Optional. A view defining which fields should be filled in the returned execution. - * The API will default to the FULL view. + * Optional. A view defining which fields should be filled in the returned + * execution. The API will default to the FULL view. * * Generated from protobuf field .google.cloud.workflows.executions.v1.ExecutionView view = 2 [(.google.api.field_behavior) = OPTIONAL]; * @param int $var diff --git a/Workflows/src/Executions/V1/ListExecutionsRequest.php b/Workflows/src/Executions/V1/ListExecutionsRequest.php index ff2582a940dd..e2e457023463 100644 --- a/Workflows/src/Executions/V1/ListExecutionsRequest.php +++ b/Workflows/src/Executions/V1/ListExecutionsRequest.php @@ -26,7 +26,7 @@ class ListExecutionsRequest extends \Google\Protobuf\Internal\Message private $parent = ''; /** * Maximum number of executions to return per call. - * Max supported value depends on the selected Execution view: it's 10000 for + * Max supported value depends on the selected Execution view: it's 1000 for * BASIC and 100 for FULL. The default value used if the field is not * specified is 100, regardless of the selected view. Values greater than * the max value will be coerced down to it. @@ -39,17 +39,37 @@ class ListExecutionsRequest extends \Google\Protobuf\Internal\Message * Provide this to retrieve the subsequent page. * When paginating, all other parameters provided to `ListExecutions` must * match the call that provided the page token. + * Note that pagination is applied to dynamic data. The list of executions + * returned can change between page requests. * * Generated from protobuf field string page_token = 3; */ private $page_token = ''; /** - * Optional. A view defining which fields should be filled in the returned executions. - * The API will default to the BASIC view. + * Optional. A view defining which fields should be filled in the returned + * executions. The API will default to the BASIC view. * * Generated from protobuf field .google.cloud.workflows.executions.v1.ExecutionView view = 4 [(.google.api.field_behavior) = OPTIONAL]; */ private $view = 0; + /** + * Optional. Filters applied to the [Executions.ListExecutions] results. + * The following fields are supported for filtering: + * executionID, state, startTime, endTime, duration, workflowRevisionID, + * stepName, and label. + * + * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $filter = ''; + /** + * Optional. The ordering applied to the [Executions.ListExecutions] results. + * By default the ordering is based on descending start time. + * The following fields are supported for order by: + * executionID, startTime, endTime, duration, state, and workflowRevisionID. + * + * Generated from protobuf field string order_by = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $order_by = ''; /** * @param string $parent Required. Name of the workflow for which the executions should be listed. @@ -77,7 +97,7 @@ public static function build(string $parent): self * Format: projects/{project}/locations/{location}/workflows/{workflow} * @type int $page_size * Maximum number of executions to return per call. - * Max supported value depends on the selected Execution view: it's 10000 for + * Max supported value depends on the selected Execution view: it's 1000 for * BASIC and 100 for FULL. The default value used if the field is not * specified is 100, regardless of the selected view. Values greater than * the max value will be coerced down to it. @@ -86,9 +106,21 @@ public static function build(string $parent): self * Provide this to retrieve the subsequent page. * When paginating, all other parameters provided to `ListExecutions` must * match the call that provided the page token. + * Note that pagination is applied to dynamic data. The list of executions + * returned can change between page requests. * @type int $view - * Optional. A view defining which fields should be filled in the returned executions. - * The API will default to the BASIC view. + * Optional. A view defining which fields should be filled in the returned + * executions. The API will default to the BASIC view. + * @type string $filter + * Optional. Filters applied to the [Executions.ListExecutions] results. + * The following fields are supported for filtering: + * executionID, state, startTime, endTime, duration, workflowRevisionID, + * stepName, and label. + * @type string $order_by + * Optional. The ordering applied to the [Executions.ListExecutions] results. + * By default the ordering is based on descending start time. + * The following fields are supported for order by: + * executionID, startTime, endTime, duration, state, and workflowRevisionID. * } */ public function __construct($data = NULL) { @@ -126,7 +158,7 @@ public function setParent($var) /** * Maximum number of executions to return per call. - * Max supported value depends on the selected Execution view: it's 10000 for + * Max supported value depends on the selected Execution view: it's 1000 for * BASIC and 100 for FULL. The default value used if the field is not * specified is 100, regardless of the selected view. Values greater than * the max value will be coerced down to it. @@ -141,7 +173,7 @@ public function getPageSize() /** * Maximum number of executions to return per call. - * Max supported value depends on the selected Execution view: it's 10000 for + * Max supported value depends on the selected Execution view: it's 1000 for * BASIC and 100 for FULL. The default value used if the field is not * specified is 100, regardless of the selected view. Values greater than * the max value will be coerced down to it. @@ -163,6 +195,8 @@ public function setPageSize($var) * Provide this to retrieve the subsequent page. * When paginating, all other parameters provided to `ListExecutions` must * match the call that provided the page token. + * Note that pagination is applied to dynamic data. The list of executions + * returned can change between page requests. * * Generated from protobuf field string page_token = 3; * @return string @@ -177,6 +211,8 @@ public function getPageToken() * Provide this to retrieve the subsequent page. * When paginating, all other parameters provided to `ListExecutions` must * match the call that provided the page token. + * Note that pagination is applied to dynamic data. The list of executions + * returned can change between page requests. * * Generated from protobuf field string page_token = 3; * @param string $var @@ -191,8 +227,8 @@ public function setPageToken($var) } /** - * Optional. A view defining which fields should be filled in the returned executions. - * The API will default to the BASIC view. + * Optional. A view defining which fields should be filled in the returned + * executions. The API will default to the BASIC view. * * Generated from protobuf field .google.cloud.workflows.executions.v1.ExecutionView view = 4 [(.google.api.field_behavior) = OPTIONAL]; * @return int @@ -203,8 +239,8 @@ public function getView() } /** - * Optional. A view defining which fields should be filled in the returned executions. - * The API will default to the BASIC view. + * Optional. A view defining which fields should be filled in the returned + * executions. The API will default to the BASIC view. * * Generated from protobuf field .google.cloud.workflows.executions.v1.ExecutionView view = 4 [(.google.api.field_behavior) = OPTIONAL]; * @param int $var @@ -218,5 +254,69 @@ public function setView($var) return $this; } + /** + * Optional. Filters applied to the [Executions.ListExecutions] results. + * The following fields are supported for filtering: + * executionID, state, startTime, endTime, duration, workflowRevisionID, + * stepName, and label. + * + * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filters applied to the [Executions.ListExecutions] results. + * The following fields are supported for filtering: + * executionID, state, startTime, endTime, duration, workflowRevisionID, + * stepName, and label. + * + * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. The ordering applied to the [Executions.ListExecutions] results. + * By default the ordering is based on descending start time. + * The following fields are supported for order by: + * executionID, startTime, endTime, duration, state, and workflowRevisionID. + * + * Generated from protobuf field string order_by = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. The ordering applied to the [Executions.ListExecutions] results. + * By default the ordering is based on descending start time. + * The following fields are supported for order by: + * executionID, startTime, endTime, duration, state, and workflowRevisionID. + * + * Generated from protobuf field string order_by = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + } diff --git a/owl-bot-staging/Workflows/Executions/v1/proto/src/GPBMetadata/Google/Cloud/Workflows/Executions/V1/Executions.php b/owl-bot-staging/Workflows/Executions/v1/proto/src/GPBMetadata/Google/Cloud/Workflows/Executions/V1/Executions.php deleted file mode 100644 index 84359f945f1b3db4f98924a6c9c0e61910568c53..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5072 zcmb_gOK;m&79Lu%A|1aJrfF3zI*ghkj?+jJ2OYFZG6gNut{TO1E!pWq083FdZ0~i)MnoP+k$bxgBm}5awQhcWkf`gEq;*Mh3H4p;Uf?%V za1md1o&lch7#-QNY=#2DU#$*f8mjm;!J26hi%uuAWe~HsK@PPO!*-_=-6LTcP3&Zh z{ictFivdnERqI{xPx8XE{*2VG_a(FDEv*A=2T}E8$YWMl9t@ zFNAYUcf3v`%=m`Vzn38w6HvSiX-4RRAPK9vjnubtO1ukz7`s$ul7%^3SXeKXxmm6Q z&6eX-aG^VpC037%q$U&j6J#Ub3yXos%THN}YK0rA!#txODWq}x^7KykYT9#UIBt2{yeQV z2Al8kC{UTHb&2T}7Nisw#=U8kH3DhHqVAd4hJ_%XD#v&!aIZS8#vrRhpo?D#a2cQJ zM{O6UlwuN=WN{JF9wiPhba4ePxi(HYix+rK>~tXO*d7iY+bZw^es=~(MvaztLyg5Z zAsbyYPfTW*Q7$DeLk6d|e{2Oz3+_!~4d`LuMXIO)41*C{NHZRghw>}|@^gDx{0!y; z_!ugVc4pdIZwQlaV>kVj2HxewW{@%cNTm$h5U5!)76MiLLVyfQpzn!$u%!F0i^)=1 zrlJ6+t}w0+$xfW&YmjFD$$ST$E-nYw-g3pi3jxZM#5nZuU}IpF^WBdiP0t)&E6eL| z&j5L-y4*%JrCX3@|KbafZ-20>sQWvuU8PpvswcQej!+8aYHM!AH z8_jLCp&TfUu>dc_5?f+h*uEBeas^h{qafy%+T3Y;fc`8(mOb2Q?kM?G^-JLg`Evno zMNKp@Yx!)#G3%A_*jtGkzSzPk_*bG+uW}wDC5r4x8@JY3Jg^C=N)05L8RT`N=iB)$YI7B(0)5o`nNbQ~N>OQq~f!WG&G_ z){>p$i5#{B@jC%l#>!co(7iFSD7b0sw)Alj&vxlK;;9bV^F+>bNM4T#CH_}{#Uv@j zwStYnv8yLci8uS4ShS+Yi{GjXy;#b%DC6-2XDl7r%#DVnMt z_)-inBI8mA;nChm<;AwNg1fJslrenoke;N2A-0snNde9&h|8z$#AO ziE_QMGUWR%`yR6^eE1H3gA3m=*$f}p2}TV)t>EMw`6}gf?+sU-?hmpy$+W#6lX!-6 mK{tca)V_No{+#eS|MZjiQsm(g%+R0ll_=QBzvf)P1;8(RkeZPI diff --git a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/CancelExecutionRequest.php b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/CancelExecutionRequest.php deleted file mode 100644 index 2db4641d945c..000000000000 --- a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/CancelExecutionRequest.php +++ /dev/null @@ -1,93 +0,0 @@ -google.cloud.workflows.executions.v1.CancelExecutionRequest - */ -class CancelExecutionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the execution to be cancelled. - * Format: - * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. Name of the execution to be cancelled. - * Format: - * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} - * Please see {@see ExecutionsClient::executionName()} for help formatting this field. - * - * @return \Google\Cloud\Workflows\Executions\V1\CancelExecutionRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the execution to be cancelled. - * Format: - * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Workflows\Executions\V1\Executions::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the execution to be cancelled. - * Format: - * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Name of the execution to be cancelled. - * Format: - * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} - * - * 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/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/CreateExecutionRequest.php b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/CreateExecutionRequest.php deleted file mode 100644 index 01da8af0af3b..000000000000 --- a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/CreateExecutionRequest.php +++ /dev/null @@ -1,139 +0,0 @@ -google.cloud.workflows.executions.v1.CreateExecutionRequest - */ -class CreateExecutionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the workflow for which an execution should be created. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * The latest revision of the workflow will be used. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. Execution to be created. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $execution = null; - - /** - * @param string $parent Required. Name of the workflow for which an execution should be created. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * The latest revision of the workflow will be used. Please see - * {@see ExecutionsClient::workflowName()} for help formatting this field. - * @param \Google\Cloud\Workflows\Executions\V1\Execution $execution Required. Execution to be created. - * - * @return \Google\Cloud\Workflows\Executions\V1\CreateExecutionRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\Workflows\Executions\V1\Execution $execution): self - { - return (new self()) - ->setParent($parent) - ->setExecution($execution); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. Name of the workflow for which an execution should be created. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * The latest revision of the workflow will be used. - * @type \Google\Cloud\Workflows\Executions\V1\Execution $execution - * Required. Execution to be created. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Workflows\Executions\V1\Executions::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the workflow for which an execution should be created. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * The latest revision of the workflow will be used. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. Name of the workflow for which an execution should be created. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * The latest revision of the workflow will be used. - * - * 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. Execution to be created. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Workflows\Executions\V1\Execution|null - */ - public function getExecution() - { - return $this->execution; - } - - public function hasExecution() - { - return isset($this->execution); - } - - public function clearExecution() - { - unset($this->execution); - } - - /** - * Required. Execution to be created. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Workflows\Executions\V1\Execution $var - * @return $this - */ - public function setExecution($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Workflows\Executions\V1\Execution::class); - $this->execution = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution.php b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution.php deleted file mode 100644 index cd76e9a60ca6..000000000000 --- a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution.php +++ /dev/null @@ -1,608 +0,0 @@ -google.cloud.workflows.executions.v1.Execution - */ -class Execution extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The resource name of the execution. - * Format: - * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * Output only. Marks the beginning of execution. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $start_time = null; - /** - * Output only. Marks the end of execution, successful or not. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $end_time = null; - /** - * Output only. Measures the duration of the execution. - * - * Generated from protobuf field .google.protobuf.Duration duration = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $duration = null; - /** - * Output only. Current state of the execution. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - /** - * Input parameters of the execution represented as a JSON string. - * The size limit is 32KB. - * *Note*: If you are using the REST API directly to run your workflow, you - * must escape any JSON string value of `argument`. Example: - * `'{"argument":"{\"firstName\":\"FIRST\",\"lastName\":\"LAST\"}"}'` - * - * Generated from protobuf field string argument = 5; - */ - protected $argument = ''; - /** - * Output only. Output of the execution represented as a JSON string. The - * value can only be present if the execution's state is `SUCCEEDED`. - * - * Generated from protobuf field string result = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $result = ''; - /** - * Output only. The error which caused the execution to finish prematurely. - * The value is only present if the execution's state is `FAILED` - * or `CANCELLED`. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $error = null; - /** - * Output only. Revision of the workflow this execution is using. - * - * Generated from protobuf field string workflow_revision_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $workflow_revision_id = ''; - /** - * The call logging level associated to this execution. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.CallLogLevel call_log_level = 9; - */ - protected $call_log_level = 0; - /** - * Output only. Status tracks the current steps and progress data of this - * execution. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.Status status = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $status = null; - /** - * Labels associated with this execution. - * Labels can contain at most 64 entries. Keys and values can be no longer - * than 63 characters and can only contain lowercase letters, numeric - * characters, underscores, and dashes. Label keys must start with a letter. - * International characters are allowed. - * By default, labels are inherited from the workflow but are overridden by - * any labels associated with the execution. - * - * Generated from protobuf field map labels = 11; - */ - private $labels; - /** - * Output only. Error regarding the state of the Execution resource. For - * example, this field will have error details if the execution data is - * unavailable due to revoked KMS key permissions. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.StateError state_error = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state_error = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The resource name of the execution. - * Format: - * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} - * @type \Google\Protobuf\Timestamp $start_time - * Output only. Marks the beginning of execution. - * @type \Google\Protobuf\Timestamp $end_time - * Output only. Marks the end of execution, successful or not. - * @type \Google\Protobuf\Duration $duration - * Output only. Measures the duration of the execution. - * @type int $state - * Output only. Current state of the execution. - * @type string $argument - * Input parameters of the execution represented as a JSON string. - * The size limit is 32KB. - * *Note*: If you are using the REST API directly to run your workflow, you - * must escape any JSON string value of `argument`. Example: - * `'{"argument":"{\"firstName\":\"FIRST\",\"lastName\":\"LAST\"}"}'` - * @type string $result - * Output only. Output of the execution represented as a JSON string. The - * value can only be present if the execution's state is `SUCCEEDED`. - * @type \Google\Cloud\Workflows\Executions\V1\Execution\Error $error - * Output only. The error which caused the execution to finish prematurely. - * The value is only present if the execution's state is `FAILED` - * or `CANCELLED`. - * @type string $workflow_revision_id - * Output only. Revision of the workflow this execution is using. - * @type int $call_log_level - * The call logging level associated to this execution. - * @type \Google\Cloud\Workflows\Executions\V1\Execution\Status $status - * Output only. Status tracks the current steps and progress data of this - * execution. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Labels associated with this execution. - * Labels can contain at most 64 entries. Keys and values can be no longer - * than 63 characters and can only contain lowercase letters, numeric - * characters, underscores, and dashes. Label keys must start with a letter. - * International characters are allowed. - * By default, labels are inherited from the workflow but are overridden by - * any labels associated with the execution. - * @type \Google\Cloud\Workflows\Executions\V1\Execution\StateError $state_error - * Output only. Error regarding the state of the Execution resource. For - * example, this field will have error details if the execution data is - * unavailable due to revoked KMS key permissions. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Workflows\Executions\V1\Executions::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The resource name of the execution. - * Format: - * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The resource name of the execution. - * Format: - * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. Marks the beginning of execution. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getStartTime() - { - return $this->start_time; - } - - public function hasStartTime() - { - return isset($this->start_time); - } - - public function clearStartTime() - { - unset($this->start_time); - } - - /** - * Output only. Marks the beginning of execution. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->start_time = $var; - - return $this; - } - - /** - * Output only. Marks the end of execution, successful or not. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Output only. Marks the end of execution, successful or not. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Output only. Measures the duration of the execution. - * - * Generated from protobuf field .google.protobuf.Duration duration = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Duration|null - */ - public function getDuration() - { - return $this->duration; - } - - public function hasDuration() - { - return isset($this->duration); - } - - public function clearDuration() - { - unset($this->duration); - } - - /** - * Output only. Measures the duration of the execution. - * - * Generated from protobuf field .google.protobuf.Duration duration = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setDuration($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->duration = $var; - - return $this; - } - - /** - * Output only. Current state of the execution. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. Current state of the execution. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Workflows\Executions\V1\Execution\State::class); - $this->state = $var; - - return $this; - } - - /** - * Input parameters of the execution represented as a JSON string. - * The size limit is 32KB. - * *Note*: If you are using the REST API directly to run your workflow, you - * must escape any JSON string value of `argument`. Example: - * `'{"argument":"{\"firstName\":\"FIRST\",\"lastName\":\"LAST\"}"}'` - * - * Generated from protobuf field string argument = 5; - * @return string - */ - public function getArgument() - { - return $this->argument; - } - - /** - * Input parameters of the execution represented as a JSON string. - * The size limit is 32KB. - * *Note*: If you are using the REST API directly to run your workflow, you - * must escape any JSON string value of `argument`. Example: - * `'{"argument":"{\"firstName\":\"FIRST\",\"lastName\":\"LAST\"}"}'` - * - * Generated from protobuf field string argument = 5; - * @param string $var - * @return $this - */ - public function setArgument($var) - { - GPBUtil::checkString($var, True); - $this->argument = $var; - - return $this; - } - - /** - * Output only. Output of the execution represented as a JSON string. The - * value can only be present if the execution's state is `SUCCEEDED`. - * - * Generated from protobuf field string result = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getResult() - { - return $this->result; - } - - /** - * Output only. Output of the execution represented as a JSON string. The - * value can only be present if the execution's state is `SUCCEEDED`. - * - * Generated from protobuf field string result = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setResult($var) - { - GPBUtil::checkString($var, True); - $this->result = $var; - - return $this; - } - - /** - * Output only. The error which caused the execution to finish prematurely. - * The value is only present if the execution's state is `FAILED` - * or `CANCELLED`. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Workflows\Executions\V1\Execution\Error|null - */ - public function getError() - { - return $this->error; - } - - public function hasError() - { - return isset($this->error); - } - - public function clearError() - { - unset($this->error); - } - - /** - * Output only. The error which caused the execution to finish prematurely. - * The value is only present if the execution's state is `FAILED` - * or `CANCELLED`. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Workflows\Executions\V1\Execution\Error $var - * @return $this - */ - public function setError($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Workflows\Executions\V1\Execution\Error::class); - $this->error = $var; - - return $this; - } - - /** - * Output only. Revision of the workflow this execution is using. - * - * Generated from protobuf field string workflow_revision_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getWorkflowRevisionId() - { - return $this->workflow_revision_id; - } - - /** - * Output only. Revision of the workflow this execution is using. - * - * Generated from protobuf field string workflow_revision_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setWorkflowRevisionId($var) - { - GPBUtil::checkString($var, True); - $this->workflow_revision_id = $var; - - return $this; - } - - /** - * The call logging level associated to this execution. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.CallLogLevel call_log_level = 9; - * @return int - */ - public function getCallLogLevel() - { - return $this->call_log_level; - } - - /** - * The call logging level associated to this execution. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.CallLogLevel call_log_level = 9; - * @param int $var - * @return $this - */ - public function setCallLogLevel($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Workflows\Executions\V1\Execution\CallLogLevel::class); - $this->call_log_level = $var; - - return $this; - } - - /** - * Output only. Status tracks the current steps and progress data of this - * execution. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.Status status = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Workflows\Executions\V1\Execution\Status|null - */ - public function getStatus() - { - return $this->status; - } - - public function hasStatus() - { - return isset($this->status); - } - - public function clearStatus() - { - unset($this->status); - } - - /** - * Output only. Status tracks the current steps and progress data of this - * execution. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.Status status = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Workflows\Executions\V1\Execution\Status $var - * @return $this - */ - public function setStatus($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Workflows\Executions\V1\Execution\Status::class); - $this->status = $var; - - return $this; - } - - /** - * Labels associated with this execution. - * Labels can contain at most 64 entries. Keys and values can be no longer - * than 63 characters and can only contain lowercase letters, numeric - * characters, underscores, and dashes. Label keys must start with a letter. - * International characters are allowed. - * By default, labels are inherited from the workflow but are overridden by - * any labels associated with the execution. - * - * Generated from protobuf field map labels = 11; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Labels associated with this execution. - * Labels can contain at most 64 entries. Keys and values can be no longer - * than 63 characters and can only contain lowercase letters, numeric - * characters, underscores, and dashes. Label keys must start with a letter. - * International characters are allowed. - * By default, labels are inherited from the workflow but are overridden by - * any labels associated with the execution. - * - * Generated from protobuf field map labels = 11; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setLabels($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->labels = $arr; - - return $this; - } - - /** - * Output only. Error regarding the state of the Execution resource. For - * example, this field will have error details if the execution data is - * unavailable due to revoked KMS key permissions. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.StateError state_error = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Workflows\Executions\V1\Execution\StateError|null - */ - public function getStateError() - { - return $this->state_error; - } - - public function hasStateError() - { - return isset($this->state_error); - } - - public function clearStateError() - { - unset($this->state_error); - } - - /** - * Output only. Error regarding the state of the Execution resource. For - * example, this field will have error details if the execution data is - * unavailable due to revoked KMS key permissions. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.StateError state_error = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Workflows\Executions\V1\Execution\StateError $var - * @return $this - */ - public function setStateError($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Workflows\Executions\V1\Execution\StateError::class); - $this->state_error = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/CallLogLevel.php b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/CallLogLevel.php deleted file mode 100644 index ff6b5532dbfb..000000000000 --- a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/CallLogLevel.php +++ /dev/null @@ -1,73 +0,0 @@ -google.cloud.workflows.executions.v1.Execution.CallLogLevel - */ -class CallLogLevel -{ - /** - * No call logging level specified. - * - * Generated from protobuf enum CALL_LOG_LEVEL_UNSPECIFIED = 0; - */ - const CALL_LOG_LEVEL_UNSPECIFIED = 0; - /** - * Log all call steps within workflows, all call returns, and all exceptions - * raised. - * - * Generated from protobuf enum LOG_ALL_CALLS = 1; - */ - const LOG_ALL_CALLS = 1; - /** - * Log only exceptions that are raised from call steps within workflows. - * - * Generated from protobuf enum LOG_ERRORS_ONLY = 2; - */ - const LOG_ERRORS_ONLY = 2; - /** - * Explicitly log nothing. - * - * Generated from protobuf enum LOG_NONE = 3; - */ - const LOG_NONE = 3; - - private static $valueToName = [ - self::CALL_LOG_LEVEL_UNSPECIFIED => 'CALL_LOG_LEVEL_UNSPECIFIED', - self::LOG_ALL_CALLS => 'LOG_ALL_CALLS', - self::LOG_ERRORS_ONLY => 'LOG_ERRORS_ONLY', - self::LOG_NONE => 'LOG_NONE', - ]; - - 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(CallLogLevel::class, \Google\Cloud\Workflows\Executions\V1\Execution_CallLogLevel::class); - diff --git a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/Error.php b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/Error.php deleted file mode 100644 index 33cfcd89b58e..000000000000 --- a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/Error.php +++ /dev/null @@ -1,148 +0,0 @@ -google.cloud.workflows.executions.v1.Execution.Error - */ -class Error extends \Google\Protobuf\Internal\Message -{ - /** - * Error message and data returned represented as a JSON string. - * - * Generated from protobuf field string payload = 1; - */ - protected $payload = ''; - /** - * Human-readable stack trace string. - * - * Generated from protobuf field string context = 2; - */ - protected $context = ''; - /** - * Stack trace with detailed information of where error was generated. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.StackTrace stack_trace = 3; - */ - protected $stack_trace = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $payload - * Error message and data returned represented as a JSON string. - * @type string $context - * Human-readable stack trace string. - * @type \Google\Cloud\Workflows\Executions\V1\Execution\StackTrace $stack_trace - * Stack trace with detailed information of where error was generated. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Workflows\Executions\V1\Executions::initOnce(); - parent::__construct($data); - } - - /** - * Error message and data returned represented as a JSON string. - * - * Generated from protobuf field string payload = 1; - * @return string - */ - public function getPayload() - { - return $this->payload; - } - - /** - * Error message and data returned represented as a JSON string. - * - * Generated from protobuf field string payload = 1; - * @param string $var - * @return $this - */ - public function setPayload($var) - { - GPBUtil::checkString($var, True); - $this->payload = $var; - - return $this; - } - - /** - * Human-readable stack trace string. - * - * Generated from protobuf field string context = 2; - * @return string - */ - public function getContext() - { - return $this->context; - } - - /** - * Human-readable stack trace string. - * - * Generated from protobuf field string context = 2; - * @param string $var - * @return $this - */ - public function setContext($var) - { - GPBUtil::checkString($var, True); - $this->context = $var; - - return $this; - } - - /** - * Stack trace with detailed information of where error was generated. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.StackTrace stack_trace = 3; - * @return \Google\Cloud\Workflows\Executions\V1\Execution\StackTrace|null - */ - public function getStackTrace() - { - return $this->stack_trace; - } - - public function hasStackTrace() - { - return isset($this->stack_trace); - } - - public function clearStackTrace() - { - unset($this->stack_trace); - } - - /** - * Stack trace with detailed information of where error was generated. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.StackTrace stack_trace = 3; - * @param \Google\Cloud\Workflows\Executions\V1\Execution\StackTrace $var - * @return $this - */ - public function setStackTrace($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Workflows\Executions\V1\Execution\StackTrace::class); - $this->stack_trace = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Error::class, \Google\Cloud\Workflows\Executions\V1\Execution_Error::class); - diff --git a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/StackTrace.php b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/StackTrace.php deleted file mode 100644 index ba74ffea90a7..000000000000 --- a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/StackTrace.php +++ /dev/null @@ -1,70 +0,0 @@ -google.cloud.workflows.executions.v1.Execution.StackTrace - */ -class StackTrace extends \Google\Protobuf\Internal\Message -{ - /** - * An array of stack elements. - * - * Generated from protobuf field repeated .google.cloud.workflows.executions.v1.Execution.StackTraceElement elements = 1; - */ - private $elements; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Workflows\Executions\V1\Execution\StackTraceElement>|\Google\Protobuf\Internal\RepeatedField $elements - * An array of stack elements. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Workflows\Executions\V1\Executions::initOnce(); - parent::__construct($data); - } - - /** - * An array of stack elements. - * - * Generated from protobuf field repeated .google.cloud.workflows.executions.v1.Execution.StackTraceElement elements = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getElements() - { - return $this->elements; - } - - /** - * An array of stack elements. - * - * Generated from protobuf field repeated .google.cloud.workflows.executions.v1.Execution.StackTraceElement elements = 1; - * @param array<\Google\Cloud\Workflows\Executions\V1\Execution\StackTraceElement>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setElements($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Workflows\Executions\V1\Execution\StackTraceElement::class); - $this->elements = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(StackTrace::class, \Google\Cloud\Workflows\Executions\V1\Execution_StackTrace::class); - diff --git a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/StackTraceElement.php b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/StackTraceElement.php deleted file mode 100644 index 54ffcdb61d1a..000000000000 --- a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/StackTraceElement.php +++ /dev/null @@ -1,148 +0,0 @@ -google.cloud.workflows.executions.v1.Execution.StackTraceElement - */ -class StackTraceElement extends \Google\Protobuf\Internal\Message -{ - /** - * The step the error occurred at. - * - * Generated from protobuf field string step = 1; - */ - protected $step = ''; - /** - * The routine where the error occurred. - * - * Generated from protobuf field string routine = 2; - */ - protected $routine = ''; - /** - * The source position information of the stack trace element. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.StackTraceElement.Position position = 3; - */ - protected $position = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $step - * The step the error occurred at. - * @type string $routine - * The routine where the error occurred. - * @type \Google\Cloud\Workflows\Executions\V1\Execution\StackTraceElement\Position $position - * The source position information of the stack trace element. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Workflows\Executions\V1\Executions::initOnce(); - parent::__construct($data); - } - - /** - * The step the error occurred at. - * - * Generated from protobuf field string step = 1; - * @return string - */ - public function getStep() - { - return $this->step; - } - - /** - * The step the error occurred at. - * - * Generated from protobuf field string step = 1; - * @param string $var - * @return $this - */ - public function setStep($var) - { - GPBUtil::checkString($var, True); - $this->step = $var; - - return $this; - } - - /** - * The routine where the error occurred. - * - * Generated from protobuf field string routine = 2; - * @return string - */ - public function getRoutine() - { - return $this->routine; - } - - /** - * The routine where the error occurred. - * - * Generated from protobuf field string routine = 2; - * @param string $var - * @return $this - */ - public function setRoutine($var) - { - GPBUtil::checkString($var, True); - $this->routine = $var; - - return $this; - } - - /** - * The source position information of the stack trace element. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.StackTraceElement.Position position = 3; - * @return \Google\Cloud\Workflows\Executions\V1\Execution\StackTraceElement\Position|null - */ - public function getPosition() - { - return $this->position; - } - - public function hasPosition() - { - return isset($this->position); - } - - public function clearPosition() - { - unset($this->position); - } - - /** - * The source position information of the stack trace element. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1.Execution.StackTraceElement.Position position = 3; - * @param \Google\Cloud\Workflows\Executions\V1\Execution\StackTraceElement\Position $var - * @return $this - */ - public function setPosition($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Workflows\Executions\V1\Execution\StackTraceElement\Position::class); - $this->position = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(StackTraceElement::class, \Google\Cloud\Workflows\Executions\V1\Execution_StackTraceElement::class); - diff --git a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/StackTraceElement/Position.php b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/StackTraceElement/Position.php deleted file mode 100644 index 61107a127090..000000000000 --- a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/StackTraceElement/Position.php +++ /dev/null @@ -1,144 +0,0 @@ -google.cloud.workflows.executions.v1.Execution.StackTraceElement.Position - */ -class Position extends \Google\Protobuf\Internal\Message -{ - /** - * The source code line number the current instruction was generated from. - * - * Generated from protobuf field int64 line = 1; - */ - protected $line = 0; - /** - * The source code column position (of the line) the current instruction - * was generated from. - * - * Generated from protobuf field int64 column = 2; - */ - protected $column = 0; - /** - * The number of bytes of source code making up this stack trace element. - * - * Generated from protobuf field int64 length = 3; - */ - protected $length = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int|string $line - * The source code line number the current instruction was generated from. - * @type int|string $column - * The source code column position (of the line) the current instruction - * was generated from. - * @type int|string $length - * The number of bytes of source code making up this stack trace element. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Workflows\Executions\V1\Executions::initOnce(); - parent::__construct($data); - } - - /** - * The source code line number the current instruction was generated from. - * - * Generated from protobuf field int64 line = 1; - * @return int|string - */ - public function getLine() - { - return $this->line; - } - - /** - * The source code line number the current instruction was generated from. - * - * Generated from protobuf field int64 line = 1; - * @param int|string $var - * @return $this - */ - public function setLine($var) - { - GPBUtil::checkInt64($var); - $this->line = $var; - - return $this; - } - - /** - * The source code column position (of the line) the current instruction - * was generated from. - * - * Generated from protobuf field int64 column = 2; - * @return int|string - */ - public function getColumn() - { - return $this->column; - } - - /** - * The source code column position (of the line) the current instruction - * was generated from. - * - * Generated from protobuf field int64 column = 2; - * @param int|string $var - * @return $this - */ - public function setColumn($var) - { - GPBUtil::checkInt64($var); - $this->column = $var; - - return $this; - } - - /** - * The number of bytes of source code making up this stack trace element. - * - * Generated from protobuf field int64 length = 3; - * @return int|string - */ - public function getLength() - { - return $this->length; - } - - /** - * The number of bytes of source code making up this stack trace element. - * - * Generated from protobuf field int64 length = 3; - * @param int|string $var - * @return $this - */ - public function setLength($var) - { - GPBUtil::checkInt64($var); - $this->length = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Position::class, \Google\Cloud\Workflows\Executions\V1\Execution_StackTraceElement_Position::class); - diff --git a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/State.php b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/State.php deleted file mode 100644 index 79500707a958..000000000000 --- a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/Execution/State.php +++ /dev/null @@ -1,93 +0,0 @@ -google.cloud.workflows.executions.v1.Execution.State - */ -class State -{ - /** - * Invalid state. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The execution is in progress. - * - * Generated from protobuf enum ACTIVE = 1; - */ - const ACTIVE = 1; - /** - * The execution finished successfully. - * - * Generated from protobuf enum SUCCEEDED = 2; - */ - const SUCCEEDED = 2; - /** - * The execution failed with an error. - * - * Generated from protobuf enum FAILED = 3; - */ - const FAILED = 3; - /** - * The execution was stopped intentionally. - * - * Generated from protobuf enum CANCELLED = 4; - */ - const CANCELLED = 4; - /** - * Execution data is unavailable. See the `state_error` field. - * - * Generated from protobuf enum UNAVAILABLE = 5; - */ - const UNAVAILABLE = 5; - /** - * Request has been placed in the backlog for processing at a later time. - * - * Generated from protobuf enum QUEUED = 6; - */ - const QUEUED = 6; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::ACTIVE => 'ACTIVE', - self::SUCCEEDED => 'SUCCEEDED', - self::FAILED => 'FAILED', - self::CANCELLED => 'CANCELLED', - self::UNAVAILABLE => 'UNAVAILABLE', - self::QUEUED => 'QUEUED', - ]; - - 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\Workflows\Executions\V1\Execution_State::class); - diff --git a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/ExecutionView.php b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/ExecutionView.php deleted file mode 100644 index 3cf62b861520..000000000000 --- a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/ExecutionView.php +++ /dev/null @@ -1,63 +0,0 @@ -google.cloud.workflows.executions.v1.ExecutionView - */ -class ExecutionView -{ - /** - * The default / unset value. - * - * Generated from protobuf enum EXECUTION_VIEW_UNSPECIFIED = 0; - */ - const EXECUTION_VIEW_UNSPECIFIED = 0; - /** - * Includes only basic metadata about the execution. - * The following fields are returned: name, start_time, end_time, duration, - * state, and workflow_revision_id. - * - * Generated from protobuf enum BASIC = 1; - */ - const BASIC = 1; - /** - * Includes all data. - * - * Generated from protobuf enum FULL = 2; - */ - const FULL = 2; - - private static $valueToName = [ - self::EXECUTION_VIEW_UNSPECIFIED => 'EXECUTION_VIEW_UNSPECIFIED', - self::BASIC => 'BASIC', - self::FULL => 'FULL', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - diff --git a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/GetExecutionRequest.php b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/GetExecutionRequest.php deleted file mode 100644 index 50cf0dfb16bc..000000000000 --- a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/GetExecutionRequest.php +++ /dev/null @@ -1,131 +0,0 @@ -google.cloud.workflows.executions.v1.GetExecutionRequest - */ -class GetExecutionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the execution to be retrieved. - * Format: - * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Optional. A view defining which fields should be filled in the returned - * execution. The API will default to the FULL view. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1.ExecutionView view = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $view = 0; - - /** - * @param string $name Required. Name of the execution to be retrieved. - * Format: - * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} - * Please see {@see ExecutionsClient::executionName()} for help formatting this field. - * - * @return \Google\Cloud\Workflows\Executions\V1\GetExecutionRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the execution to be retrieved. - * Format: - * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} - * @type int $view - * Optional. A view defining which fields should be filled in the returned - * execution. The API will default to the FULL view. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Workflows\Executions\V1\Executions::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the execution to be retrieved. - * Format: - * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Name of the execution to be retrieved. - * Format: - * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. A view defining which fields should be filled in the returned - * execution. The API will default to the FULL view. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1.ExecutionView view = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getView() - { - return $this->view; - } - - /** - * Optional. A view defining which fields should be filled in the returned - * execution. The API will default to the FULL view. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1.ExecutionView view = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setView($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Workflows\Executions\V1\ExecutionView::class); - $this->view = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/ListExecutionsRequest.php b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/ListExecutionsRequest.php deleted file mode 100644 index 22bdd8f45dc0..000000000000 --- a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/ListExecutionsRequest.php +++ /dev/null @@ -1,322 +0,0 @@ -google.cloud.workflows.executions.v1.ListExecutionsRequest - */ -class ListExecutionsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the workflow for which the executions should be listed. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Maximum number of executions to return per call. - * Max supported value depends on the selected Execution view: it's 1000 for - * BASIC and 100 for FULL. The default value used if the field is not - * specified is 100, regardless of the selected view. Values greater than - * the max value will be coerced down to it. - * - * Generated from protobuf field int32 page_size = 2; - */ - protected $page_size = 0; - /** - * A page token, received from a previous `ListExecutions` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListExecutions` must - * match the call that provided the page token. - * Note that pagination is applied to dynamic data. The list of executions - * returned can change between page requests. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - /** - * Optional. A view defining which fields should be filled in the returned - * executions. The API will default to the BASIC view. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1.ExecutionView view = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $view = 0; - /** - * Optional. Filters applied to the [Executions.ListExecutions] results. - * The following fields are supported for filtering: - * executionID, state, startTime, endTime, duration, workflowRevisionID, - * stepName, and label. - * - * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - /** - * Optional. The ordering applied to the [Executions.ListExecutions] results. - * By default the ordering is based on descending start time. - * The following fields are supported for order by: - * executionID, startTime, endTime, duration, state, and workflowRevisionID. - * - * Generated from protobuf field string order_by = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $order_by = ''; - - /** - * @param string $parent Required. Name of the workflow for which the executions should be listed. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * Please see {@see ExecutionsClient::workflowName()} for help formatting this field. - * - * @return \Google\Cloud\Workflows\Executions\V1\ListExecutionsRequest - * - * @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. Name of the workflow for which the executions should be listed. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * @type int $page_size - * Maximum number of executions to return per call. - * Max supported value depends on the selected Execution view: it's 1000 for - * BASIC and 100 for FULL. The default value used if the field is not - * specified is 100, regardless of the selected view. Values greater than - * the max value will be coerced down to it. - * @type string $page_token - * A page token, received from a previous `ListExecutions` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListExecutions` must - * match the call that provided the page token. - * Note that pagination is applied to dynamic data. The list of executions - * returned can change between page requests. - * @type int $view - * Optional. A view defining which fields should be filled in the returned - * executions. The API will default to the BASIC view. - * @type string $filter - * Optional. Filters applied to the [Executions.ListExecutions] results. - * The following fields are supported for filtering: - * executionID, state, startTime, endTime, duration, workflowRevisionID, - * stepName, and label. - * @type string $order_by - * Optional. The ordering applied to the [Executions.ListExecutions] results. - * By default the ordering is based on descending start time. - * The following fields are supported for order by: - * executionID, startTime, endTime, duration, state, and workflowRevisionID. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Workflows\Executions\V1\Executions::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the workflow for which the executions should be listed. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. Name of the workflow for which the executions should be listed. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * - * 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; - } - - /** - * Maximum number of executions to return per call. - * Max supported value depends on the selected Execution view: it's 1000 for - * BASIC and 100 for FULL. The default value used if the field is not - * specified is 100, regardless of the selected view. Values greater than - * the max value will be coerced down to it. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Maximum number of executions to return per call. - * Max supported value depends on the selected Execution view: it's 1000 for - * BASIC and 100 for FULL. The default value used if the field is not - * specified is 100, regardless of the selected view. Values greater than - * the max value will be coerced down to it. - * - * 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; - } - - /** - * A page token, received from a previous `ListExecutions` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListExecutions` must - * match the call that provided the page token. - * Note that pagination is applied to dynamic data. The list of executions - * returned can change between page requests. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A page token, received from a previous `ListExecutions` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListExecutions` must - * match the call that provided the page token. - * Note that pagination is applied to dynamic data. The list of executions - * returned can change between page requests. - * - * 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; - } - - /** - * Optional. A view defining which fields should be filled in the returned - * executions. The API will default to the BASIC view. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1.ExecutionView view = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getView() - { - return $this->view; - } - - /** - * Optional. A view defining which fields should be filled in the returned - * executions. The API will default to the BASIC view. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1.ExecutionView view = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setView($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Workflows\Executions\V1\ExecutionView::class); - $this->view = $var; - - return $this; - } - - /** - * Optional. Filters applied to the [Executions.ListExecutions] results. - * The following fields are supported for filtering: - * executionID, state, startTime, endTime, duration, workflowRevisionID, - * stepName, and label. - * - * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. Filters applied to the [Executions.ListExecutions] results. - * The following fields are supported for filtering: - * executionID, state, startTime, endTime, duration, workflowRevisionID, - * stepName, and label. - * - * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Optional. The ordering applied to the [Executions.ListExecutions] results. - * By default the ordering is based on descending start time. - * The following fields are supported for order by: - * executionID, startTime, endTime, duration, state, and workflowRevisionID. - * - * Generated from protobuf field string order_by = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. The ordering applied to the [Executions.ListExecutions] results. - * By default the ordering is based on descending start time. - * The following fields are supported for order by: - * executionID, startTime, endTime, duration, state, and workflowRevisionID. - * - * Generated from protobuf field string order_by = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/ListExecutionsResponse.php b/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/ListExecutionsResponse.php deleted file mode 100644 index 6f950c9185b5..000000000000 --- a/owl-bot-staging/Workflows/Executions/v1/proto/src/Google/Cloud/Workflows/Executions/V1/ListExecutionsResponse.php +++ /dev/null @@ -1,107 +0,0 @@ -google.cloud.workflows.executions.v1.ListExecutionsResponse - */ -class ListExecutionsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The executions which match the request. - * - * Generated from protobuf field repeated .google.cloud.workflows.executions.v1.Execution executions = 1; - */ - private $executions; - /** - * A token, which can be sent as `page_token` to retrieve the next page. - * If this field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Workflows\Executions\V1\Execution>|\Google\Protobuf\Internal\RepeatedField $executions - * The executions which match the request. - * @type string $next_page_token - * A token, which can be sent as `page_token` to retrieve the next page. - * If this field is omitted, there are no subsequent pages. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Workflows\Executions\V1\Executions::initOnce(); - parent::__construct($data); - } - - /** - * The executions which match the request. - * - * Generated from protobuf field repeated .google.cloud.workflows.executions.v1.Execution executions = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getExecutions() - { - return $this->executions; - } - - /** - * The executions which match the request. - * - * Generated from protobuf field repeated .google.cloud.workflows.executions.v1.Execution executions = 1; - * @param array<\Google\Cloud\Workflows\Executions\V1\Execution>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setExecutions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Workflows\Executions\V1\Execution::class); - $this->executions = $arr; - - return $this; - } - - /** - * A token, which can be sent as `page_token` to retrieve the next page. - * If this field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token, which can be sent as `page_token` to retrieve the next page. - * If this field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Workflows/Executions/v1/samples/V1/ExecutionsClient/cancel_execution.php b/owl-bot-staging/Workflows/Executions/v1/samples/V1/ExecutionsClient/cancel_execution.php deleted file mode 100644 index cdb9e9234478..000000000000 --- a/owl-bot-staging/Workflows/Executions/v1/samples/V1/ExecutionsClient/cancel_execution.php +++ /dev/null @@ -1,78 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Execution $response */ - $response = $executionsClient->cancelExecution($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 = ExecutionsClient::executionName( - '[PROJECT]', - '[LOCATION]', - '[WORKFLOW]', - '[EXECUTION]' - ); - - cancel_execution_sample($formattedName); -} -// [END workflowexecutions_v1_generated_Executions_CancelExecution_sync] diff --git a/owl-bot-staging/Workflows/Executions/v1/samples/V1/ExecutionsClient/create_execution.php b/owl-bot-staging/Workflows/Executions/v1/samples/V1/ExecutionsClient/create_execution.php deleted file mode 100644 index 0b317eb189cc..000000000000 --- a/owl-bot-staging/Workflows/Executions/v1/samples/V1/ExecutionsClient/create_execution.php +++ /dev/null @@ -1,75 +0,0 @@ -setParent($formattedParent) - ->setExecution($execution); - - // Call the API and handle any network failures. - try { - /** @var Execution $response */ - $response = $executionsClient->createExecution($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 = ExecutionsClient::workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); - - create_execution_sample($formattedParent); -} -// [END workflowexecutions_v1_generated_Executions_CreateExecution_sync] diff --git a/owl-bot-staging/Workflows/Executions/v1/samples/V1/ExecutionsClient/get_execution.php b/owl-bot-staging/Workflows/Executions/v1/samples/V1/ExecutionsClient/get_execution.php deleted file mode 100644 index c13b2df91460..000000000000 --- a/owl-bot-staging/Workflows/Executions/v1/samples/V1/ExecutionsClient/get_execution.php +++ /dev/null @@ -1,78 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Execution $response */ - $response = $executionsClient->getExecution($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 = ExecutionsClient::executionName( - '[PROJECT]', - '[LOCATION]', - '[WORKFLOW]', - '[EXECUTION]' - ); - - get_execution_sample($formattedName); -} -// [END workflowexecutions_v1_generated_Executions_GetExecution_sync] diff --git a/owl-bot-staging/Workflows/Executions/v1/samples/V1/ExecutionsClient/list_executions.php b/owl-bot-staging/Workflows/Executions/v1/samples/V1/ExecutionsClient/list_executions.php deleted file mode 100644 index 2a9f644e779e..000000000000 --- a/owl-bot-staging/Workflows/Executions/v1/samples/V1/ExecutionsClient/list_executions.php +++ /dev/null @@ -1,80 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $executionsClient->listExecutions($request); - - /** @var Execution $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 = ExecutionsClient::workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); - - list_executions_sample($formattedParent); -} -// [END workflowexecutions_v1_generated_Executions_ListExecutions_sync] diff --git a/owl-bot-staging/Workflows/Executions/v1/src/V1/Client/BaseClient/ExecutionsBaseClient.php b/owl-bot-staging/Workflows/Executions/v1/src/V1/Client/BaseClient/ExecutionsBaseClient.php deleted file mode 100644 index 011a711708ae..000000000000 --- a/owl-bot-staging/Workflows/Executions/v1/src/V1/Client/BaseClient/ExecutionsBaseClient.php +++ /dev/null @@ -1,349 +0,0 @@ - self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../../resources/executions_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../../resources/executions_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../../resources/executions_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../../resources/executions_rest_client_config.php', - ], - ], - ]; - } - - /** - * Formats a string containing the fully-qualified path to represent a execution - * resource. - * - * @param string $project - * @param string $location - * @param string $workflow - * @param string $execution - * - * @return string The formatted execution resource. - */ - public static function executionName(string $project, string $location, string $workflow, string $execution): string - { - return self::getPathTemplate('execution')->render([ - 'project' => $project, - 'location' => $location, - 'workflow' => $workflow, - 'execution' => $execution, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a workflow - * resource. - * - * @param string $project - * @param string $location - * @param string $workflow - * - * @return string The formatted workflow resource. - */ - public static function workflowName(string $project, string $location, string $workflow): string - { - return self::getPathTemplate('workflow')->render([ - 'project' => $project, - 'location' => $location, - 'workflow' => $workflow, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - execution: projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} - * - workflow: projects/{project}/locations/{location}/workflows/{workflow} - * - * 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 'workflowexecutions.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Cancels an execution of the given name. - * - * The async variant is {@see self::cancelExecutionAsync()} . - * - * @example samples/V1/ExecutionsClient/cancel_execution.php - * - * @param CancelExecutionRequest $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 Execution - * - * @throws ApiException Thrown if the API call fails. - */ - public function cancelExecution(CancelExecutionRequest $request, array $callOptions = []): Execution - { - return $this->startApiCall('CancelExecution', $request, $callOptions)->wait(); - } - - /** - * Creates a new execution using the latest revision of the given workflow. - * - * The async variant is {@see self::createExecutionAsync()} . - * - * @example samples/V1/ExecutionsClient/create_execution.php - * - * @param CreateExecutionRequest $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 Execution - * - * @throws ApiException Thrown if the API call fails. - */ - public function createExecution(CreateExecutionRequest $request, array $callOptions = []): Execution - { - return $this->startApiCall('CreateExecution', $request, $callOptions)->wait(); - } - - /** - * Returns an execution of the given name. - * - * The async variant is {@see self::getExecutionAsync()} . - * - * @example samples/V1/ExecutionsClient/get_execution.php - * - * @param GetExecutionRequest $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 Execution - * - * @throws ApiException Thrown if the API call fails. - */ - public function getExecution(GetExecutionRequest $request, array $callOptions = []): Execution - { - return $this->startApiCall('GetExecution', $request, $callOptions)->wait(); - } - - /** - * Returns a list of executions which belong to the workflow with - * the given name. The method returns executions of all workflow - * revisions. Returned executions are ordered by their start time (newest - * first). - * - * The async variant is {@see self::listExecutionsAsync()} . - * - * @example samples/V1/ExecutionsClient/list_executions.php - * - * @param ListExecutionsRequest $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 listExecutions(ListExecutionsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListExecutions', $request, $callOptions); - } -} diff --git a/owl-bot-staging/Workflows/Executions/v1/src/V1/Client/ExecutionsClient.php b/owl-bot-staging/Workflows/Executions/v1/src/V1/Client/ExecutionsClient.php deleted file mode 100644 index 2ff8b03b6b80..000000000000 --- a/owl-bot-staging/Workflows/Executions/v1/src/V1/Client/ExecutionsClient.php +++ /dev/null @@ -1,40 +0,0 @@ - [ - 'google.cloud.workflows.executions.v1.Executions' => [ - 'CancelExecution' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Workflows\Executions\V1\Execution', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'CreateExecution' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Workflows\Executions\V1\Execution', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'GetExecution' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Workflows\Executions\V1\Execution', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListExecutions' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getExecutions', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Workflows\Executions\V1\ListExecutionsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'templateMap' => [ - 'execution' => 'projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}', - 'workflow' => 'projects/{project}/locations/{location}/workflows/{workflow}', - ], - ], - ], -]; diff --git a/owl-bot-staging/Workflows/Executions/v1/src/V1/resources/executions_rest_client_config.php b/owl-bot-staging/Workflows/Executions/v1/src/V1/resources/executions_rest_client_config.php deleted file mode 100644 index 09d749a4004f..000000000000 --- a/owl-bot-staging/Workflows/Executions/v1/src/V1/resources/executions_rest_client_config.php +++ /dev/null @@ -1,54 +0,0 @@ - [ - 'google.cloud.workflows.executions.v1.Executions' => [ - 'CancelExecution' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/workflows/*/executions/*}:cancel', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'CreateExecution' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*/workflows/*}/executions', - 'body' => 'execution', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'GetExecution' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/workflows/*/executions/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListExecutions' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*/workflows/*}/executions', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - ], - ], -]; diff --git a/owl-bot-staging/Workflows/Executions/v1/tests/Unit/V1/Client/ExecutionsClientTest.php b/owl-bot-staging/Workflows/Executions/v1/tests/Unit/V1/Client/ExecutionsClientTest.php deleted file mode 100644 index 81326ab26aab..000000000000 --- a/owl-bot-staging/Workflows/Executions/v1/tests/Unit/V1/Client/ExecutionsClientTest.php +++ /dev/null @@ -1,389 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return ExecutionsClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new ExecutionsClient($options); - } - - /** @test */ - public function cancelExecutionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $argument = 'argument-1589682499'; - $result = 'result-934426595'; - $workflowRevisionId = 'workflowRevisionId-1453295745'; - $expectedResponse = new Execution(); - $expectedResponse->setName($name2); - $expectedResponse->setArgument($argument); - $expectedResponse->setResult($result); - $expectedResponse->setWorkflowRevisionId($workflowRevisionId); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[WORKFLOW]', '[EXECUTION]'); - $request = (new CancelExecutionRequest()) - ->setName($formattedName); - $response = $gapicClient->cancelExecution($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.workflows.executions.v1.Executions/CancelExecution', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function cancelExecutionExceptionTest() - { - $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->executionName('[PROJECT]', '[LOCATION]', '[WORKFLOW]', '[EXECUTION]'); - $request = (new CancelExecutionRequest()) - ->setName($formattedName); - try { - $gapicClient->cancelExecution($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 createExecutionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $argument = 'argument-1589682499'; - $result = 'result-934426595'; - $workflowRevisionId = 'workflowRevisionId-1453295745'; - $expectedResponse = new Execution(); - $expectedResponse->setName($name); - $expectedResponse->setArgument($argument); - $expectedResponse->setResult($result); - $expectedResponse->setWorkflowRevisionId($workflowRevisionId); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); - $execution = new Execution(); - $request = (new CreateExecutionRequest()) - ->setParent($formattedParent) - ->setExecution($execution); - $response = $gapicClient->createExecution($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.workflows.executions.v1.Executions/CreateExecution', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getExecution(); - $this->assertProtobufEquals($execution, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createExecutionExceptionTest() - { - $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->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); - $execution = new Execution(); - $request = (new CreateExecutionRequest()) - ->setParent($formattedParent) - ->setExecution($execution); - try { - $gapicClient->createExecution($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 getExecutionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $argument = 'argument-1589682499'; - $result = 'result-934426595'; - $workflowRevisionId = 'workflowRevisionId-1453295745'; - $expectedResponse = new Execution(); - $expectedResponse->setName($name2); - $expectedResponse->setArgument($argument); - $expectedResponse->setResult($result); - $expectedResponse->setWorkflowRevisionId($workflowRevisionId); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[WORKFLOW]', '[EXECUTION]'); - $request = (new GetExecutionRequest()) - ->setName($formattedName); - $response = $gapicClient->getExecution($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.workflows.executions.v1.Executions/GetExecution', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getExecutionExceptionTest() - { - $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->executionName('[PROJECT]', '[LOCATION]', '[WORKFLOW]', '[EXECUTION]'); - $request = (new GetExecutionRequest()) - ->setName($formattedName); - try { - $gapicClient->getExecution($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 listExecutionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $executionsElement = new Execution(); - $executions = [ - $executionsElement, - ]; - $expectedResponse = new ListExecutionsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setExecutions($executions); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); - $request = (new ListExecutionsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listExecutions($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getExecutions()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.workflows.executions.v1.Executions/ListExecutions', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listExecutionsExceptionTest() - { - $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->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); - $request = (new ListExecutionsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listExecutions($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 cancelExecutionAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $argument = 'argument-1589682499'; - $result = 'result-934426595'; - $workflowRevisionId = 'workflowRevisionId-1453295745'; - $expectedResponse = new Execution(); - $expectedResponse->setName($name2); - $expectedResponse->setArgument($argument); - $expectedResponse->setResult($result); - $expectedResponse->setWorkflowRevisionId($workflowRevisionId); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[WORKFLOW]', '[EXECUTION]'); - $request = (new CancelExecutionRequest()) - ->setName($formattedName); - $response = $gapicClient->cancelExecutionAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.workflows.executions.v1.Executions/CancelExecution', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/Workflows/Executions/v1beta/proto/src/GPBMetadata/Google/Cloud/Workflows/Executions/V1Beta/Executions.php b/owl-bot-staging/Workflows/Executions/v1beta/proto/src/GPBMetadata/Google/Cloud/Workflows/Executions/V1Beta/Executions.php deleted file mode 100644 index 9e6db986aa75114b43d2ce37a731288f062dd1cd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3803 zcmb_fO;g)O7_N*B_-zA3X^87XE1b;4xL^%%=wLz;*%piw1D@DGr}d0Sme)p&kW^_6 zNj$#f&_B>W&_n-9FTJ(BaY|=$%AuEBI_;&q`dAA?r^b{Evb68l^FGhJyAK{&M;6=_ zwvmBs1*4YGd@0}~Bv`hIP1V$eX1Co&wxF8FmZl>+D+t9sVRx@4$i-4^ftWgG*H%$Z z=$K|lN202m-IjQ2+Rxj%dFqJh1yZ|MGYv;PS!p7ygx+M`C;*0Xj2uf*k+5CK?~pYu z1uOM!*I~Ut9o7#6hjp1btRJl8$>I$FRaYEG7<_>q2;|S|Hg!!E9IRmS@1Eu~G(*Fh zqHC{6rJF)q(H%t0FRpEO4V5M>P=h@~Md?Ms^GVmLmjs+fej+ z5jm=@S=h8IWN9wfL6|{I-=r7)u+*K_7Sdjhx!i>$HwA2WQ8>CF*a&xRW5dmxI_R^f z`XvBLmR6Sx!=xyXHso@Hng%ZZ&9I#+0u~S%A+IYL^JKHnLa~4okmWQVPDe- ziLi2PT^`Zx+44ip?~v4Lv4(6BVy78|6wv$d_dKkR&1gRDnPy!vWSJPU12JShF(mK! zK@>|P(xF&;qDX!g`p~9;Hkv-7{(?_J3v3^@AzN2ogqI=?u<;h8{)|GLsfE7@QL4ZM zCvfR_e&UTZ!LI=jEN$GNmWc@Y@ZoAQ>sJ-H%`(V6qZOD&M$0pq7|mn{VwCwP5hd$q zR@Z|N{|Q`{rJt=*2VMqqFs;~~?lFNe5u?@cw_uWh)75celK%FVk*LVFO*=8=W;s?= znL6;?Ex^Y?iyJmN(HtVPhSo|h`9#*EKFI-OWjmj9^CYWY7$buz%I=3R1IQo zMf`2JS*=Mmxv{@nt;mJaR!J_-eZT`uN`+eKK%V3H8xXJV7YedmB%dPm)0R{!ljjNg zsUYnZZaFs3uBBYV7RZa`5YMuO2;_=1fnMzI`zr+#TaBeAm+5`TdEjLitnKb9Yv&00)|H8pXVZrd5qc+HSxUZwJJMwD|?cX89~RYET_6T<+zMrV{-pziEU7< zo5MTRuTu61W6Q~j;_2zB-&nSdDP4Tz-J6yzUBPYBKF+`AV2SL;BXb}>JD3p_dL5~7 zUzNR6lz(cYdwa(WDQ}RiNK(0QIkTD@gB4cuourJi6F*>rALGo>oFvxRT)WQ><4fM{ XCv;h&$3;!O}G+ diff --git a/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/CancelExecutionRequest.php b/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/CancelExecutionRequest.php deleted file mode 100644 index 28c9ab2611dc..000000000000 --- a/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/CancelExecutionRequest.php +++ /dev/null @@ -1,77 +0,0 @@ -google.cloud.workflows.executions.v1beta.CancelExecutionRequest - */ -class CancelExecutionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the execution to be cancelled. - * Format: - * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the execution to be cancelled. - * Format: - * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Workflows\Executions\V1Beta\Executions::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the execution to be cancelled. - * Format: - * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Name of the execution to be cancelled. - * Format: - * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} - * - * 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/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/CreateExecutionRequest.php b/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/CreateExecutionRequest.php deleted file mode 100644 index 0ce4e08aa9b5..000000000000 --- a/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/CreateExecutionRequest.php +++ /dev/null @@ -1,121 +0,0 @@ -google.cloud.workflows.executions.v1beta.CreateExecutionRequest - */ -class CreateExecutionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the workflow for which an execution should be created. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * The latest revision of the workflow will be used. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. Execution to be created. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1beta.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $execution = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. Name of the workflow for which an execution should be created. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * The latest revision of the workflow will be used. - * @type \Google\Cloud\Workflows\Executions\V1beta\Execution $execution - * Required. Execution to be created. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Workflows\Executions\V1Beta\Executions::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the workflow for which an execution should be created. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * The latest revision of the workflow will be used. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. Name of the workflow for which an execution should be created. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * The latest revision of the workflow will be used. - * - * 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. Execution to be created. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1beta.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Workflows\Executions\V1beta\Execution|null - */ - public function getExecution() - { - return $this->execution; - } - - public function hasExecution() - { - return isset($this->execution); - } - - public function clearExecution() - { - unset($this->execution); - } - - /** - * Required. Execution to be created. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1beta.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Workflows\Executions\V1beta\Execution $var - * @return $this - */ - public function setExecution($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Workflows\Executions\V1beta\Execution::class); - $this->execution = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/Execution.php b/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/Execution.php deleted file mode 100644 index a7c7ff753389..000000000000 --- a/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/Execution.php +++ /dev/null @@ -1,359 +0,0 @@ -google.cloud.workflows.executions.v1beta.Execution - */ -class Execution extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The resource name of the execution. - * Format: - * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * Output only. Marks the beginning of execution. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $start_time = null; - /** - * Output only. Marks the end of execution, successful or not. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $end_time = null; - /** - * Output only. Current state of the execution. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1beta.Execution.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - /** - * Input parameters of the execution represented as a JSON string. - * The size limit is 32KB. - * - * Generated from protobuf field string argument = 5; - */ - protected $argument = ''; - /** - * Output only. Output of the execution represented as a JSON string. The - * value can only be present if the execution's state is `SUCCEEDED`. - * - * Generated from protobuf field string result = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $result = ''; - /** - * Output only. The error which caused the execution to finish prematurely. - * The value is only present if the execution's state is `FAILED` - * or `CANCELLED`. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1beta.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $error = null; - /** - * Output only. Revision of the workflow this execution is using. - * - * Generated from protobuf field string workflow_revision_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $workflow_revision_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The resource name of the execution. - * Format: - * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} - * @type \Google\Protobuf\Timestamp $start_time - * Output only. Marks the beginning of execution. - * @type \Google\Protobuf\Timestamp $end_time - * Output only. Marks the end of execution, successful or not. - * @type int $state - * Output only. Current state of the execution. - * @type string $argument - * Input parameters of the execution represented as a JSON string. - * The size limit is 32KB. - * @type string $result - * Output only. Output of the execution represented as a JSON string. The - * value can only be present if the execution's state is `SUCCEEDED`. - * @type \Google\Cloud\Workflows\Executions\V1beta\Execution\Error $error - * Output only. The error which caused the execution to finish prematurely. - * The value is only present if the execution's state is `FAILED` - * or `CANCELLED`. - * @type string $workflow_revision_id - * Output only. Revision of the workflow this execution is using. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Workflows\Executions\V1Beta\Executions::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The resource name of the execution. - * Format: - * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The resource name of the execution. - * Format: - * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. Marks the beginning of execution. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getStartTime() - { - return $this->start_time; - } - - public function hasStartTime() - { - return isset($this->start_time); - } - - public function clearStartTime() - { - unset($this->start_time); - } - - /** - * Output only. Marks the beginning of execution. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->start_time = $var; - - return $this; - } - - /** - * Output only. Marks the end of execution, successful or not. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Output only. Marks the end of execution, successful or not. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Output only. Current state of the execution. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1beta.Execution.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. Current state of the execution. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1beta.Execution.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Workflows\Executions\V1beta\Execution\State::class); - $this->state = $var; - - return $this; - } - - /** - * Input parameters of the execution represented as a JSON string. - * The size limit is 32KB. - * - * Generated from protobuf field string argument = 5; - * @return string - */ - public function getArgument() - { - return $this->argument; - } - - /** - * Input parameters of the execution represented as a JSON string. - * The size limit is 32KB. - * - * Generated from protobuf field string argument = 5; - * @param string $var - * @return $this - */ - public function setArgument($var) - { - GPBUtil::checkString($var, True); - $this->argument = $var; - - return $this; - } - - /** - * Output only. Output of the execution represented as a JSON string. The - * value can only be present if the execution's state is `SUCCEEDED`. - * - * Generated from protobuf field string result = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getResult() - { - return $this->result; - } - - /** - * Output only. Output of the execution represented as a JSON string. The - * value can only be present if the execution's state is `SUCCEEDED`. - * - * Generated from protobuf field string result = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setResult($var) - { - GPBUtil::checkString($var, True); - $this->result = $var; - - return $this; - } - - /** - * Output only. The error which caused the execution to finish prematurely. - * The value is only present if the execution's state is `FAILED` - * or `CANCELLED`. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1beta.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Workflows\Executions\V1beta\Execution\Error|null - */ - public function getError() - { - return $this->error; - } - - public function hasError() - { - return isset($this->error); - } - - public function clearError() - { - unset($this->error); - } - - /** - * Output only. The error which caused the execution to finish prematurely. - * The value is only present if the execution's state is `FAILED` - * or `CANCELLED`. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1beta.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Workflows\Executions\V1beta\Execution\Error $var - * @return $this - */ - public function setError($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Workflows\Executions\V1beta\Execution\Error::class); - $this->error = $var; - - return $this; - } - - /** - * Output only. Revision of the workflow this execution is using. - * - * Generated from protobuf field string workflow_revision_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getWorkflowRevisionId() - { - return $this->workflow_revision_id; - } - - /** - * Output only. Revision of the workflow this execution is using. - * - * Generated from protobuf field string workflow_revision_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setWorkflowRevisionId($var) - { - GPBUtil::checkString($var, True); - $this->workflow_revision_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/Execution/Error.php b/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/Execution/Error.php deleted file mode 100644 index c8f9da2bfc7f..000000000000 --- a/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/Execution/Error.php +++ /dev/null @@ -1,104 +0,0 @@ -google.cloud.workflows.executions.v1beta.Execution.Error - */ -class Error extends \Google\Protobuf\Internal\Message -{ - /** - * Error payload returned by the execution, represented as a JSON string. - * - * Generated from protobuf field string payload = 1; - */ - protected $payload = ''; - /** - * Human readable error context, helpful for debugging purposes. - * - * Generated from protobuf field string context = 2; - */ - protected $context = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $payload - * Error payload returned by the execution, represented as a JSON string. - * @type string $context - * Human readable error context, helpful for debugging purposes. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Workflows\Executions\V1Beta\Executions::initOnce(); - parent::__construct($data); - } - - /** - * Error payload returned by the execution, represented as a JSON string. - * - * Generated from protobuf field string payload = 1; - * @return string - */ - public function getPayload() - { - return $this->payload; - } - - /** - * Error payload returned by the execution, represented as a JSON string. - * - * Generated from protobuf field string payload = 1; - * @param string $var - * @return $this - */ - public function setPayload($var) - { - GPBUtil::checkString($var, True); - $this->payload = $var; - - return $this; - } - - /** - * Human readable error context, helpful for debugging purposes. - * - * Generated from protobuf field string context = 2; - * @return string - */ - public function getContext() - { - return $this->context; - } - - /** - * Human readable error context, helpful for debugging purposes. - * - * Generated from protobuf field string context = 2; - * @param string $var - * @return $this - */ - public function setContext($var) - { - GPBUtil::checkString($var, True); - $this->context = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Error::class, \Google\Cloud\Workflows\Executions\V1beta\Execution_Error::class); - diff --git a/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/Execution/State.php b/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/Execution/State.php deleted file mode 100644 index cb9bfc9bd8b8..000000000000 --- a/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/Execution/State.php +++ /dev/null @@ -1,79 +0,0 @@ -google.cloud.workflows.executions.v1beta.Execution.State - */ -class State -{ - /** - * Invalid state. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The execution is in progress. - * - * Generated from protobuf enum ACTIVE = 1; - */ - const ACTIVE = 1; - /** - * The execution finished successfully. - * - * Generated from protobuf enum SUCCEEDED = 2; - */ - const SUCCEEDED = 2; - /** - * The execution failed with an error. - * - * Generated from protobuf enum FAILED = 3; - */ - const FAILED = 3; - /** - * The execution was stopped intentionally. - * - * Generated from protobuf enum CANCELLED = 4; - */ - const CANCELLED = 4; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::ACTIVE => 'ACTIVE', - self::SUCCEEDED => 'SUCCEEDED', - self::FAILED => 'FAILED', - self::CANCELLED => 'CANCELLED', - ]; - - 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\Workflows\Executions\V1beta\Execution_State::class); - diff --git a/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/ExecutionView.php b/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/ExecutionView.php deleted file mode 100644 index 22912dec5990..000000000000 --- a/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/ExecutionView.php +++ /dev/null @@ -1,63 +0,0 @@ -google.cloud.workflows.executions.v1beta.ExecutionView - */ -class ExecutionView -{ - /** - * The default / unset value. - * - * Generated from protobuf enum EXECUTION_VIEW_UNSPECIFIED = 0; - */ - const EXECUTION_VIEW_UNSPECIFIED = 0; - /** - * Includes only basic metadata about the execution. - * Following fields are returned: name, start_time, end_time, state - * and workflow_revision_id. - * - * Generated from protobuf enum BASIC = 1; - */ - const BASIC = 1; - /** - * Includes all data. - * - * Generated from protobuf enum FULL = 2; - */ - const FULL = 2; - - private static $valueToName = [ - self::EXECUTION_VIEW_UNSPECIFIED => 'EXECUTION_VIEW_UNSPECIFIED', - self::BASIC => 'BASIC', - self::FULL => 'FULL', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - diff --git a/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/GetExecutionRequest.php b/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/GetExecutionRequest.php deleted file mode 100644 index 7f1b36d86bbf..000000000000 --- a/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/GetExecutionRequest.php +++ /dev/null @@ -1,115 +0,0 @@ -google.cloud.workflows.executions.v1beta.GetExecutionRequest - */ -class GetExecutionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the execution to be retrieved. - * Format: - * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Optional. A view defining which fields should be filled in the returned execution. - * The API will default to the FULL view. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1beta.ExecutionView view = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $view = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the execution to be retrieved. - * Format: - * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} - * @type int $view - * Optional. A view defining which fields should be filled in the returned execution. - * The API will default to the FULL view. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Workflows\Executions\V1Beta\Executions::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the execution to be retrieved. - * Format: - * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Name of the execution to be retrieved. - * Format: - * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. A view defining which fields should be filled in the returned execution. - * The API will default to the FULL view. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1beta.ExecutionView view = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getView() - { - return $this->view; - } - - /** - * Optional. A view defining which fields should be filled in the returned execution. - * The API will default to the FULL view. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1beta.ExecutionView view = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setView($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Workflows\Executions\V1beta\ExecutionView::class); - $this->view = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/ListExecutionsRequest.php b/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/ListExecutionsRequest.php deleted file mode 100644 index 077109024a4b..000000000000 --- a/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/ListExecutionsRequest.php +++ /dev/null @@ -1,207 +0,0 @@ -google.cloud.workflows.executions.v1beta.ListExecutionsRequest - */ -class ListExecutionsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the workflow for which the executions should be listed. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Maximum number of executions to return per call. - * Max supported value depends on the selected Execution view: it's 10000 for - * BASIC and 100 for FULL. The default value used if the field is not - * specified is 100, regardless of the selected view. Values greater than - * the max value will be coerced down to it. - * - * Generated from protobuf field int32 page_size = 2; - */ - protected $page_size = 0; - /** - * A page token, received from a previous `ListExecutions` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListExecutions` must - * match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - /** - * Optional. A view defining which fields should be filled in the returned executions. - * The API will default to the BASIC view. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1beta.ExecutionView view = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $view = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. Name of the workflow for which the executions should be listed. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * @type int $page_size - * Maximum number of executions to return per call. - * Max supported value depends on the selected Execution view: it's 10000 for - * BASIC and 100 for FULL. The default value used if the field is not - * specified is 100, regardless of the selected view. Values greater than - * the max value will be coerced down to it. - * @type string $page_token - * A page token, received from a previous `ListExecutions` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListExecutions` must - * match the call that provided the page token. - * @type int $view - * Optional. A view defining which fields should be filled in the returned executions. - * The API will default to the BASIC view. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Workflows\Executions\V1Beta\Executions::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the workflow for which the executions should be listed. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. Name of the workflow for which the executions should be listed. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * - * 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; - } - - /** - * Maximum number of executions to return per call. - * Max supported value depends on the selected Execution view: it's 10000 for - * BASIC and 100 for FULL. The default value used if the field is not - * specified is 100, regardless of the selected view. Values greater than - * the max value will be coerced down to it. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Maximum number of executions to return per call. - * Max supported value depends on the selected Execution view: it's 10000 for - * BASIC and 100 for FULL. The default value used if the field is not - * specified is 100, regardless of the selected view. Values greater than - * the max value will be coerced down to it. - * - * 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; - } - - /** - * A page token, received from a previous `ListExecutions` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListExecutions` must - * match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A page token, received from a previous `ListExecutions` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListExecutions` must - * match 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; - } - - /** - * Optional. A view defining which fields should be filled in the returned executions. - * The API will default to the BASIC view. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1beta.ExecutionView view = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getView() - { - return $this->view; - } - - /** - * Optional. A view defining which fields should be filled in the returned executions. - * The API will default to the BASIC view. - * - * Generated from protobuf field .google.cloud.workflows.executions.v1beta.ExecutionView view = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setView($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Workflows\Executions\V1beta\ExecutionView::class); - $this->view = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/ListExecutionsResponse.php b/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/ListExecutionsResponse.php deleted file mode 100644 index 9858451191f4..000000000000 --- a/owl-bot-staging/Workflows/Executions/v1beta/proto/src/Google/Cloud/Workflows/Executions/V1beta/ListExecutionsResponse.php +++ /dev/null @@ -1,107 +0,0 @@ -google.cloud.workflows.executions.v1beta.ListExecutionsResponse - */ -class ListExecutionsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The executions which match the request. - * - * Generated from protobuf field repeated .google.cloud.workflows.executions.v1beta.Execution executions = 1; - */ - private $executions; - /** - * A token, which can be sent as `page_token` to retrieve the next page. - * If this field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Workflows\Executions\V1beta\Execution>|\Google\Protobuf\Internal\RepeatedField $executions - * The executions which match the request. - * @type string $next_page_token - * A token, which can be sent as `page_token` to retrieve the next page. - * If this field is omitted, there are no subsequent pages. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Workflows\Executions\V1Beta\Executions::initOnce(); - parent::__construct($data); - } - - /** - * The executions which match the request. - * - * Generated from protobuf field repeated .google.cloud.workflows.executions.v1beta.Execution executions = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getExecutions() - { - return $this->executions; - } - - /** - * The executions which match the request. - * - * Generated from protobuf field repeated .google.cloud.workflows.executions.v1beta.Execution executions = 1; - * @param array<\Google\Cloud\Workflows\Executions\V1beta\Execution>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setExecutions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Workflows\Executions\V1beta\Execution::class); - $this->executions = $arr; - - return $this; - } - - /** - * A token, which can be sent as `page_token` to retrieve the next page. - * If this field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token, which can be sent as `page_token` to retrieve the next page. - * If this field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Workflows/Executions/v1beta/samples/V1beta/ExecutionsClient/cancel_execution.php b/owl-bot-staging/Workflows/Executions/v1beta/samples/V1beta/ExecutionsClient/cancel_execution.php deleted file mode 100644 index 716b3a2daf1d..000000000000 --- a/owl-bot-staging/Workflows/Executions/v1beta/samples/V1beta/ExecutionsClient/cancel_execution.php +++ /dev/null @@ -1,73 +0,0 @@ -cancelExecution($formattedName); - 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 = ExecutionsClient::executionName( - '[PROJECT]', - '[LOCATION]', - '[WORKFLOW]', - '[EXECUTION]' - ); - - cancel_execution_sample($formattedName); -} -// [END workflowexecutions_v1beta_generated_Executions_CancelExecution_sync] diff --git a/owl-bot-staging/Workflows/Executions/v1beta/samples/V1beta/ExecutionsClient/create_execution.php b/owl-bot-staging/Workflows/Executions/v1beta/samples/V1beta/ExecutionsClient/create_execution.php deleted file mode 100644 index 9f65c09d2b2e..000000000000 --- a/owl-bot-staging/Workflows/Executions/v1beta/samples/V1beta/ExecutionsClient/create_execution.php +++ /dev/null @@ -1,71 +0,0 @@ -createExecution($formattedParent, $execution); - 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 = ExecutionsClient::workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); - - create_execution_sample($formattedParent); -} -// [END workflowexecutions_v1beta_generated_Executions_CreateExecution_sync] diff --git a/owl-bot-staging/Workflows/Executions/v1beta/samples/V1beta/ExecutionsClient/get_execution.php b/owl-bot-staging/Workflows/Executions/v1beta/samples/V1beta/ExecutionsClient/get_execution.php deleted file mode 100644 index 1ff13e38f564..000000000000 --- a/owl-bot-staging/Workflows/Executions/v1beta/samples/V1beta/ExecutionsClient/get_execution.php +++ /dev/null @@ -1,73 +0,0 @@ -getExecution($formattedName); - 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 = ExecutionsClient::executionName( - '[PROJECT]', - '[LOCATION]', - '[WORKFLOW]', - '[EXECUTION]' - ); - - get_execution_sample($formattedName); -} -// [END workflowexecutions_v1beta_generated_Executions_GetExecution_sync] diff --git a/owl-bot-staging/Workflows/Executions/v1beta/samples/V1beta/ExecutionsClient/list_executions.php b/owl-bot-staging/Workflows/Executions/v1beta/samples/V1beta/ExecutionsClient/list_executions.php deleted file mode 100644 index f6ac20c7208c..000000000000 --- a/owl-bot-staging/Workflows/Executions/v1beta/samples/V1beta/ExecutionsClient/list_executions.php +++ /dev/null @@ -1,75 +0,0 @@ -listExecutions($formattedParent); - - /** @var Execution $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 = ExecutionsClient::workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); - - list_executions_sample($formattedParent); -} -// [END workflowexecutions_v1beta_generated_Executions_ListExecutions_sync] diff --git a/owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/ExecutionsClient.php b/owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/ExecutionsClient.php deleted file mode 100644 index 1e4a13ee7b14..000000000000 --- a/owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/ExecutionsClient.php +++ /dev/null @@ -1,36 +0,0 @@ -executionName('[PROJECT]', '[LOCATION]', '[WORKFLOW]', '[EXECUTION]'); - * $response = $executionsClient->cancelExecution($formattedName); - * } finally { - * $executionsClient->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. - * - * @experimental - */ -class ExecutionsGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.workflows.executions.v1beta.Executions'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'workflowexecutions.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 $executionNameTemplate; - - private static $workflowNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/executions_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/executions_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/executions_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/executions_rest_client_config.php', - ], - ], - ]; - } - - private static function getExecutionNameTemplate() - { - if (self::$executionNameTemplate == null) { - self::$executionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}'); - } - - return self::$executionNameTemplate; - } - - private static function getWorkflowNameTemplate() - { - if (self::$workflowNameTemplate == null) { - self::$workflowNameTemplate = new PathTemplate('projects/{project}/locations/{location}/workflows/{workflow}'); - } - - return self::$workflowNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'execution' => self::getExecutionNameTemplate(), - 'workflow' => self::getWorkflowNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a execution - * resource. - * - * @param string $project - * @param string $location - * @param string $workflow - * @param string $execution - * - * @return string The formatted execution resource. - * - * @experimental - */ - public static function executionName($project, $location, $workflow, $execution) - { - return self::getExecutionNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'workflow' => $workflow, - 'execution' => $execution, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a workflow - * resource. - * - * @param string $project - * @param string $location - * @param string $workflow - * - * @return string The formatted workflow resource. - * - * @experimental - */ - public static function workflowName($project, $location, $workflow) - { - return self::getWorkflowNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'workflow' => $workflow, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - execution: projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} - * - workflow: projects/{project}/locations/{location}/workflows/{workflow} - * - * 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. - * - * @experimental - */ - 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"); - } - - /** - * 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 'workflowexecutions.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 - * - * @experimental - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Cancels an execution of the given name. - * - * Sample code: - * ``` - * $executionsClient = new ExecutionsClient(); - * try { - * $formattedName = $executionsClient->executionName('[PROJECT]', '[LOCATION]', '[WORKFLOW]', '[EXECUTION]'); - * $response = $executionsClient->cancelExecution($formattedName); - * } finally { - * $executionsClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the execution to be cancelled. - * Format: - * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} - * @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\Workflows\Executions\V1beta\Execution - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function cancelExecution($name, array $optionalArgs = []) - { - $request = new CancelExecutionRequest(); - $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('CancelExecution', Execution::class, $optionalArgs, $request)->wait(); - } - - /** - * Creates a new execution using the latest revision of the given workflow. - * - * Sample code: - * ``` - * $executionsClient = new ExecutionsClient(); - * try { - * $formattedParent = $executionsClient->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); - * $execution = new Execution(); - * $response = $executionsClient->createExecution($formattedParent, $execution); - * } finally { - * $executionsClient->close(); - * } - * ``` - * - * @param string $parent Required. Name of the workflow for which an execution should be created. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * The latest revision of the workflow will be used. - * @param Execution $execution Required. Execution to be created. - * @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\Workflows\Executions\V1beta\Execution - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createExecution($parent, $execution, array $optionalArgs = []) - { - $request = new CreateExecutionRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setExecution($execution); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateExecution', Execution::class, $optionalArgs, $request)->wait(); - } - - /** - * Returns an execution of the given name. - * - * Sample code: - * ``` - * $executionsClient = new ExecutionsClient(); - * try { - * $formattedName = $executionsClient->executionName('[PROJECT]', '[LOCATION]', '[WORKFLOW]', '[EXECUTION]'); - * $response = $executionsClient->getExecution($formattedName); - * } finally { - * $executionsClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the execution to be retrieved. - * Format: - * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} - * @param array $optionalArgs { - * Optional. - * - * @type int $view - * Optional. A view defining which fields should be filled in the returned execution. - * The API will default to the FULL view. - * For allowed values, use constants defined on {@see \Google\Cloud\Workflows\Executions\V1beta\ExecutionView} - * @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\Workflows\Executions\V1beta\Execution - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getExecution($name, array $optionalArgs = []) - { - $request = new GetExecutionRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['view'])) { - $request->setView($optionalArgs['view']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetExecution', Execution::class, $optionalArgs, $request)->wait(); - } - - /** - * Returns a list of executions which belong to the workflow with - * the given name. The method returns executions of all workflow - * revisions. Returned executions are ordered by their start time (newest - * first). - * - * Sample code: - * ``` - * $executionsClient = new ExecutionsClient(); - * try { - * $formattedParent = $executionsClient->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); - * // Iterate over pages of elements - * $pagedResponse = $executionsClient->listExecutions($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $executionsClient->listExecutions($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $executionsClient->close(); - * } - * ``` - * - * @param string $parent Required. Name of the workflow for which the executions should be listed. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * @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 int $view - * Optional. A view defining which fields should be filled in the returned executions. - * The API will default to the BASIC view. - * For allowed values, use constants defined on {@see \Google\Cloud\Workflows\Executions\V1beta\ExecutionView} - * @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 - * - * @experimental - */ - public function listExecutions($parent, array $optionalArgs = []) - { - $request = new ListExecutionsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['view'])) { - $request->setView($optionalArgs['view']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListExecutions', $optionalArgs, ListExecutionsResponse::class, $request); - } -} diff --git a/owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/gapic_metadata.json b/owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/gapic_metadata.json deleted file mode 100644 index 81c967306926..000000000000 --- a/owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/gapic_metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.cloud.workflows.executions.v1beta", - "libraryPackage": "Google\\Cloud\\Workflows\\Executions\\V1beta", - "services": { - "Executions": { - "clients": { - "grpc": { - "libraryClient": "ExecutionsGapicClient", - "rpcs": { - "CancelExecution": { - "methods": [ - "cancelExecution" - ] - }, - "CreateExecution": { - "methods": [ - "createExecution" - ] - }, - "GetExecution": { - "methods": [ - "getExecution" - ] - }, - "ListExecutions": { - "methods": [ - "listExecutions" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/resources/executions_client_config.json b/owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/resources/executions_client_config.json deleted file mode 100644 index a3c456bd2230..000000000000 --- a/owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/resources/executions_client_config.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "interfaces": { - "google.cloud.workflows.executions.v1beta.Executions": { - "retry_codes": { - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "non_idempotent": [] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CancelExecution": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateExecution": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetExecution": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListExecutions": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/resources/executions_descriptor_config.php b/owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/resources/executions_descriptor_config.php deleted file mode 100644 index 0836e4ff2d47..000000000000 --- a/owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/resources/executions_descriptor_config.php +++ /dev/null @@ -1,18 +0,0 @@ - [ - 'google.cloud.workflows.executions.v1beta.Executions' => [ - 'ListExecutions' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getExecutions', - ], - ], - ], - ], -]; diff --git a/owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/resources/executions_rest_client_config.php b/owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/resources/executions_rest_client_config.php deleted file mode 100644 index 1a24fec7f007..000000000000 --- a/owl-bot-staging/Workflows/Executions/v1beta/src/V1beta/resources/executions_rest_client_config.php +++ /dev/null @@ -1,54 +0,0 @@ - [ - 'google.cloud.workflows.executions.v1beta.Executions' => [ - 'CancelExecution' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/workflows/*/executions/*}:cancel', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'CreateExecution' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*/workflows/*}/executions', - 'body' => 'execution', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'GetExecution' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/workflows/*/executions/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListExecutions' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*/workflows/*}/executions', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - ], - ], -]; diff --git a/owl-bot-staging/Workflows/Executions/v1beta/tests/Unit/V1beta/ExecutionsClientTest.php b/owl-bot-staging/Workflows/Executions/v1beta/tests/Unit/V1beta/ExecutionsClientTest.php deleted file mode 100644 index 9db7bf3fc1ab..000000000000 --- a/owl-bot-staging/Workflows/Executions/v1beta/tests/Unit/V1beta/ExecutionsClientTest.php +++ /dev/null @@ -1,332 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return ExecutionsClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new ExecutionsClient($options); - } - - /** @test */ - public function cancelExecutionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $argument = 'argument-1589682499'; - $result = 'result-934426595'; - $workflowRevisionId = 'workflowRevisionId-1453295745'; - $expectedResponse = new Execution(); - $expectedResponse->setName($name2); - $expectedResponse->setArgument($argument); - $expectedResponse->setResult($result); - $expectedResponse->setWorkflowRevisionId($workflowRevisionId); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[WORKFLOW]', '[EXECUTION]'); - $response = $gapicClient->cancelExecution($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.workflows.executions.v1beta.Executions/CancelExecution', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function cancelExecutionExceptionTest() - { - $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->executionName('[PROJECT]', '[LOCATION]', '[WORKFLOW]', '[EXECUTION]'); - try { - $gapicClient->cancelExecution($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 createExecutionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $argument = 'argument-1589682499'; - $result = 'result-934426595'; - $workflowRevisionId = 'workflowRevisionId-1453295745'; - $expectedResponse = new Execution(); - $expectedResponse->setName($name); - $expectedResponse->setArgument($argument); - $expectedResponse->setResult($result); - $expectedResponse->setWorkflowRevisionId($workflowRevisionId); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); - $execution = new Execution(); - $response = $gapicClient->createExecution($formattedParent, $execution); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.workflows.executions.v1beta.Executions/CreateExecution', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getExecution(); - $this->assertProtobufEquals($execution, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createExecutionExceptionTest() - { - $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->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); - $execution = new Execution(); - try { - $gapicClient->createExecution($formattedParent, $execution); - // 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 getExecutionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $argument = 'argument-1589682499'; - $result = 'result-934426595'; - $workflowRevisionId = 'workflowRevisionId-1453295745'; - $expectedResponse = new Execution(); - $expectedResponse->setName($name2); - $expectedResponse->setArgument($argument); - $expectedResponse->setResult($result); - $expectedResponse->setWorkflowRevisionId($workflowRevisionId); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[WORKFLOW]', '[EXECUTION]'); - $response = $gapicClient->getExecution($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.workflows.executions.v1beta.Executions/GetExecution', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getExecutionExceptionTest() - { - $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->executionName('[PROJECT]', '[LOCATION]', '[WORKFLOW]', '[EXECUTION]'); - try { - $gapicClient->getExecution($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 listExecutionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $executionsElement = new Execution(); - $executions = [ - $executionsElement, - ]; - $expectedResponse = new ListExecutionsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setExecutions($executions); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); - $response = $gapicClient->listExecutions($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getExecutions()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.workflows.executions.v1beta.Executions/ListExecutions', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listExecutionsExceptionTest() - { - $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->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); - try { - $gapicClient->listExecutions($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()); - } -} diff --git a/owl-bot-staging/Workflows/v1/proto/src/GPBMetadata/Google/Cloud/Workflows/V1/Workflows.php b/owl-bot-staging/Workflows/v1/proto/src/GPBMetadata/Google/Cloud/Workflows/V1/Workflows.php deleted file mode 100644 index 69a34d200c3b524890ae851167587bd1f659c7b5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4839 zcmbtY&rjQS6kniF@=_rEwy0^UZf;tsz)HN*s#`;8bNQ^WU3QwZ^ZtoR)lS>3r)russi&QH+WUU(uVVtGq2q$%?|aXm_v`bXeeZ#@ z<-k>GiCWavd|H=kdy>CJCC9aWTenTA)@n4UE9v%*W0=&$-LCiOpl`W zVcAB@(tX3WB&M)x>2z{R3T!gjYmSYc&r1SQg#`lxQC+rt>ROsvU8J7w8jf$f6%;KL zn$(X%$nH!|g^y+CjD|EBU@R04ft;6ow?*Smmn4_^E!UdkxS4@YbX7efV2Wc@70a?& z6l}{Y6uLfjO}t5Q!8EAlpG@bWLCt!RZfR}9c2B0dM#FOH8)VtGnr_Ro469jPby$&} z%*iNs7`f7pdAcjX7)m8MRN>nSylr?)moV8P#`oaGfg*4 zXLxiq)HS;~lkF&Hq0psJh;sopl}uSy!b8C#(P02#2V);f2z-%*F9IA0r}6>5BZ8I}X7lSzp*Z+T86+7< zxwLI~XizoknN!SWaB>?`x=T?|We_t%c#@jU3iASgJ}Qt%tK}dchFZh@Y0bm=2u1v% zr~6ZX0K=wMqo$V`kp>Z^EKnYu=z=EWaJr6@ z)4-es#jU_8f6t-3s>fz;_4A;vx%>vI=01c|>_0gV>5b==lKOOIy;53Oez;s(Out7) zA^G^px>{OWTU|>hvNMp1S3n8|F^wUXQ5b4#W-9=bEDU^-$j(B#*DvxGo!lG@afoCB z&aQ7L8@-4ChLwel<;_w$f$>N^T~Rib<+4&Nm(l~dI-H58g}e{h1*Ke8%d1OjxwKg- z_qcZ!M%fV)VRGwe^Bjz`TioMyb#=T!GSc|W}B$fm6a(@fqMm!0miB<~BWo#H5#x#*%g&Ha#o^JT;Hg>`R@e$m1y zL+-+`qq*2+K^|Bq4e(A9_7AmEImAHDLekNiRP}Io;x#lx2mrt3+uPLQ^q3@LFx)Uq z+=2q8BWW11-8vR}ZI3ftGS`8L9&Db2YY8QHASpazHOqMBY9Cd~xW%Gh`f3bIz}!gZ zEejb|-_mL(0cWG7P`pSGG!vhJ0gA(BqQOgUzzDVK!I)+lK6XsA z7VtF}H~z3CaK~sN38b2M`x5z>J~$v5mRR<< zsnnwobYJfNH-G%~{eVnn*c;h?z!LKjDNV=7XgWqhFO`r`$d3s~#Ttvu90NHfCjj@; z>A8CcFtUx{4G3c_Io)}w@Ewo5O2F8`h9t*@>7b~+hOxjiRC&R;oaQHqF9KU z`lWIy2>lJws?i1Z>&`*ZKHd46yHlLK!|Pr|J>Rci@zk9c+Bae>^|qX4%P*9SQ0yJQ zzbpAI-*>!%Ebs2__6{Mf>bL)Ea27DvH;_(kZM|@P_lEKH14s-zi15Rd7SO5S3 diff --git a/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/CreateWorkflowRequest.php b/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/CreateWorkflowRequest.php deleted file mode 100644 index 6a782e25355d..000000000000 --- a/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/CreateWorkflowRequest.php +++ /dev/null @@ -1,201 +0,0 @@ -google.cloud.workflows.v1.CreateWorkflowRequest - */ -class CreateWorkflowRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Project and location in which the workflow should be created. - * Format: projects/{project}/locations/{location} - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. Workflow to be created. - * - * Generated from protobuf field .google.cloud.workflows.v1.Workflow workflow = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $workflow = null; - /** - * Required. The ID of the workflow to be created. It has to fulfill the - * following requirements: - * * Must contain only letters, numbers, underscores and hyphens. - * * Must start with a letter. - * * Must be between 1-64 characters. - * * Must end with a number or a letter. - * * Must be unique within the customer project and location. - * - * Generated from protobuf field string workflow_id = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $workflow_id = ''; - - /** - * @param string $parent Required. Project and location in which the workflow should be created. - * Format: projects/{project}/locations/{location} - * Please see {@see WorkflowsClient::locationName()} for help formatting this field. - * @param \Google\Cloud\Workflows\V1\Workflow $workflow Required. Workflow to be created. - * @param string $workflowId Required. The ID of the workflow to be created. It has to fulfill the - * following requirements: - * - * * Must contain only letters, numbers, underscores and hyphens. - * * Must start with a letter. - * * Must be between 1-64 characters. - * * Must end with a number or a letter. - * * Must be unique within the customer project and location. - * - * @return \Google\Cloud\Workflows\V1\CreateWorkflowRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\Workflows\V1\Workflow $workflow, string $workflowId): self - { - return (new self()) - ->setParent($parent) - ->setWorkflow($workflow) - ->setWorkflowId($workflowId); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. Project and location in which the workflow should be created. - * Format: projects/{project}/locations/{location} - * @type \Google\Cloud\Workflows\V1\Workflow $workflow - * Required. Workflow to be created. - * @type string $workflow_id - * Required. The ID of the workflow to be created. It has to fulfill the - * following requirements: - * * Must contain only letters, numbers, underscores and hyphens. - * * Must start with a letter. - * * Must be between 1-64 characters. - * * Must end with a number or a letter. - * * Must be unique within the customer project and location. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Workflows\V1\Workflows::initOnce(); - parent::__construct($data); - } - - /** - * Required. Project and location in which the workflow should be created. - * Format: projects/{project}/locations/{location} - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. Project and location in which the workflow should be created. - * Format: projects/{project}/locations/{location} - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. Workflow to be created. - * - * Generated from protobuf field .google.cloud.workflows.v1.Workflow workflow = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Workflows\V1\Workflow|null - */ - public function getWorkflow() - { - return $this->workflow; - } - - public function hasWorkflow() - { - return isset($this->workflow); - } - - public function clearWorkflow() - { - unset($this->workflow); - } - - /** - * Required. Workflow to be created. - * - * Generated from protobuf field .google.cloud.workflows.v1.Workflow workflow = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Workflows\V1\Workflow $var - * @return $this - */ - public function setWorkflow($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Workflows\V1\Workflow::class); - $this->workflow = $var; - - return $this; - } - - /** - * Required. The ID of the workflow to be created. It has to fulfill the - * following requirements: - * * Must contain only letters, numbers, underscores and hyphens. - * * Must start with a letter. - * * Must be between 1-64 characters. - * * Must end with a number or a letter. - * * Must be unique within the customer project and location. - * - * Generated from protobuf field string workflow_id = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getWorkflowId() - { - return $this->workflow_id; - } - - /** - * Required. The ID of the workflow to be created. It has to fulfill the - * following requirements: - * * Must contain only letters, numbers, underscores and hyphens. - * * Must start with a letter. - * * Must be between 1-64 characters. - * * Must end with a number or a letter. - * * Must be unique within the customer project and location. - * - * Generated from protobuf field string workflow_id = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setWorkflowId($var) - { - GPBUtil::checkString($var, True); - $this->workflow_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/DeleteWorkflowRequest.php b/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/DeleteWorkflowRequest.php deleted file mode 100644 index ded08ff65dce..000000000000 --- a/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/DeleteWorkflowRequest.php +++ /dev/null @@ -1,88 +0,0 @@ -google.cloud.workflows.v1.DeleteWorkflowRequest - */ -class DeleteWorkflowRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the workflow to be deleted. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. Name of the workflow to be deleted. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * Please see {@see WorkflowsClient::workflowName()} for help formatting this field. - * - * @return \Google\Cloud\Workflows\V1\DeleteWorkflowRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the workflow to be deleted. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Workflows\V1\Workflows::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the workflow to be deleted. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Name of the workflow to be deleted. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * - * 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/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/GetWorkflowRequest.php b/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/GetWorkflowRequest.php deleted file mode 100644 index 8bffc47fd013..000000000000 --- a/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/GetWorkflowRequest.php +++ /dev/null @@ -1,137 +0,0 @@ -google.cloud.workflows.v1.GetWorkflowRequest - */ -class GetWorkflowRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the workflow for which information should be retrieved. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Optional. The revision of the workflow to retrieve. If the revision_id is - * empty, the latest revision is retrieved. - * The format is "000001-a4d", where the first six characters define - * the zero-padded decimal revision number. They are followed by a hyphen and - * three hexadecimal characters. - * - * Generated from protobuf field string revision_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $revision_id = ''; - - /** - * @param string $name Required. Name of the workflow for which information should be retrieved. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * Please see {@see WorkflowsClient::workflowName()} for help formatting this field. - * - * @return \Google\Cloud\Workflows\V1\GetWorkflowRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the workflow for which information should be retrieved. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * @type string $revision_id - * Optional. The revision of the workflow to retrieve. If the revision_id is - * empty, the latest revision is retrieved. - * The format is "000001-a4d", where the first six characters define - * the zero-padded decimal revision number. They are followed by a hyphen and - * three hexadecimal characters. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Workflows\V1\Workflows::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the workflow for which information should be retrieved. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Name of the workflow for which information should be retrieved. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. The revision of the workflow to retrieve. If the revision_id is - * empty, the latest revision is retrieved. - * The format is "000001-a4d", where the first six characters define - * the zero-padded decimal revision number. They are followed by a hyphen and - * three hexadecimal characters. - * - * Generated from protobuf field string revision_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRevisionId() - { - return $this->revision_id; - } - - /** - * Optional. The revision of the workflow to retrieve. If the revision_id is - * empty, the latest revision is retrieved. - * The format is "000001-a4d", where the first six characters define - * the zero-padded decimal revision number. They are followed by a hyphen and - * three hexadecimal characters. - * - * Generated from protobuf field string revision_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRevisionId($var) - { - GPBUtil::checkString($var, True); - $this->revision_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/ListWorkflowsRequest.php b/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/ListWorkflowsRequest.php deleted file mode 100644 index 536f26ddfc4f..000000000000 --- a/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/ListWorkflowsRequest.php +++ /dev/null @@ -1,260 +0,0 @@ -google.cloud.workflows.v1.ListWorkflowsRequest - */ -class ListWorkflowsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Project and location from which the workflows should be listed. - * Format: projects/{project}/locations/{location} - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Maximum number of workflows to return per call. The service might return - * fewer than this value even if not at the end of the collection. If a value - * is not specified, a default value of 500 is used. The maximum permitted - * value is 1000 and values greater than 1000 are coerced down to 1000. - * - * Generated from protobuf field int32 page_size = 2; - */ - protected $page_size = 0; - /** - * A page token, received from a previous `ListWorkflows` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListWorkflows` must - * match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - /** - * Filter to restrict results to specific workflows. - * - * Generated from protobuf field string filter = 4; - */ - protected $filter = ''; - /** - * Comma-separated list of fields that specify the order of the results. - * Default sorting order for a field is ascending. To specify descending order - * for a field, append a "desc" suffix. - * If not specified, the results are returned in an unspecified order. - * - * Generated from protobuf field string order_by = 5; - */ - protected $order_by = ''; - - /** - * @param string $parent Required. Project and location from which the workflows should be listed. - * Format: projects/{project}/locations/{location} - * Please see {@see WorkflowsClient::locationName()} for help formatting this field. - * - * @return \Google\Cloud\Workflows\V1\ListWorkflowsRequest - * - * @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. Project and location from which the workflows should be listed. - * Format: projects/{project}/locations/{location} - * @type int $page_size - * Maximum number of workflows to return per call. The service might return - * fewer than this value even if not at the end of the collection. If a value - * is not specified, a default value of 500 is used. The maximum permitted - * value is 1000 and values greater than 1000 are coerced down to 1000. - * @type string $page_token - * A page token, received from a previous `ListWorkflows` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListWorkflows` must - * match the call that provided the page token. - * @type string $filter - * Filter to restrict results to specific workflows. - * @type string $order_by - * Comma-separated list of fields that specify the order of the results. - * Default sorting order for a field is ascending. To specify descending order - * for a field, append a "desc" suffix. - * If not specified, the results are returned in an unspecified order. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Workflows\V1\Workflows::initOnce(); - parent::__construct($data); - } - - /** - * Required. Project and location from which the workflows should be listed. - * Format: projects/{project}/locations/{location} - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. Project and location from which the workflows should be listed. - * Format: projects/{project}/locations/{location} - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Maximum number of workflows to return per call. The service might return - * fewer than this value even if not at the end of the collection. If a value - * is not specified, a default value of 500 is used. The maximum permitted - * value is 1000 and values greater than 1000 are coerced down to 1000. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Maximum number of workflows to return per call. The service might return - * fewer than this value even if not at the end of the collection. If a value - * is not specified, a default value of 500 is used. The maximum permitted - * value is 1000 and values greater than 1000 are coerced down to 1000. - * - * 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; - } - - /** - * A page token, received from a previous `ListWorkflows` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListWorkflows` must - * match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A page token, received from a previous `ListWorkflows` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListWorkflows` must - * match 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; - } - - /** - * Filter to restrict results to specific workflows. - * - * Generated from protobuf field string filter = 4; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Filter to restrict results to specific workflows. - * - * Generated from protobuf field string filter = 4; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Comma-separated list of fields that specify the order of the results. - * Default sorting order for a field is ascending. To specify descending order - * for a field, append a "desc" suffix. - * If not specified, the results are returned in an unspecified order. - * - * Generated from protobuf field string order_by = 5; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Comma-separated list of fields that specify the order of the results. - * Default sorting order for a field is ascending. To specify descending order - * for a field, append a "desc" suffix. - * If not specified, the results are returned in an unspecified order. - * - * Generated from protobuf field string order_by = 5; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/ListWorkflowsResponse.php b/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/ListWorkflowsResponse.php deleted file mode 100644 index 34d3acf2bb91..000000000000 --- a/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/ListWorkflowsResponse.php +++ /dev/null @@ -1,141 +0,0 @@ -google.cloud.workflows.v1.ListWorkflowsResponse - */ -class ListWorkflowsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The workflows that match the request. - * - * Generated from protobuf field repeated .google.cloud.workflows.v1.Workflow workflows = 1; - */ - private $workflows; - /** - * A token, which can be sent as `page_token` to retrieve the next page. - * If this field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - /** - * Unreachable resources. - * - * Generated from protobuf field repeated string unreachable = 3; - */ - private $unreachable; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Workflows\V1\Workflow>|\Google\Protobuf\Internal\RepeatedField $workflows - * The workflows that match the request. - * @type string $next_page_token - * A token, which can be sent as `page_token` to retrieve the next page. - * If this field is omitted, there are no subsequent pages. - * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable - * Unreachable resources. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Workflows\V1\Workflows::initOnce(); - parent::__construct($data); - } - - /** - * The workflows that match the request. - * - * Generated from protobuf field repeated .google.cloud.workflows.v1.Workflow workflows = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getWorkflows() - { - return $this->workflows; - } - - /** - * The workflows that match the request. - * - * Generated from protobuf field repeated .google.cloud.workflows.v1.Workflow workflows = 1; - * @param array<\Google\Cloud\Workflows\V1\Workflow>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setWorkflows($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Workflows\V1\Workflow::class); - $this->workflows = $arr; - - return $this; - } - - /** - * A token, which can be sent as `page_token` to retrieve the next page. - * If this field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token, which can be sent as `page_token` to retrieve the next page. - * If this field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - - /** - * Unreachable resources. - * - * Generated from protobuf field repeated string unreachable = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUnreachable() - { - return $this->unreachable; - } - - /** - * Unreachable resources. - * - * Generated from protobuf field repeated string unreachable = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUnreachable($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->unreachable = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/OperationMetadata.php b/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/OperationMetadata.php deleted file mode 100644 index 498dac12a82c..000000000000 --- a/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/OperationMetadata.php +++ /dev/null @@ -1,223 +0,0 @@ -google.cloud.workflows.v1.OperationMetadata - */ -class OperationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; - */ - protected $create_time = null; - /** - * The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; - */ - protected $end_time = null; - /** - * Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3; - */ - protected $target = ''; - /** - * Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4; - */ - protected $verb = ''; - /** - * API version used to start the operation. - * - * Generated from protobuf field string api_version = 5; - */ - protected $api_version = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $create_time - * The time the operation was created. - * @type \Google\Protobuf\Timestamp $end_time - * The time the operation finished running. - * @type string $target - * Server-defined resource path for the target of the operation. - * @type string $verb - * Name of the verb executed by the operation. - * @type string $api_version - * API version used to start the operation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Workflows\V1\Workflows::initOnce(); - parent::__construct($data); - } - - /** - * The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3; - * @return string - */ - public function getTarget() - { - return $this->target; - } - - /** - * Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3; - * @param string $var - * @return $this - */ - public function setTarget($var) - { - GPBUtil::checkString($var, True); - $this->target = $var; - - return $this; - } - - /** - * Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4; - * @return string - */ - public function getVerb() - { - return $this->verb; - } - - /** - * Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4; - * @param string $var - * @return $this - */ - public function setVerb($var) - { - GPBUtil::checkString($var, True); - $this->verb = $var; - - return $this; - } - - /** - * API version used to start the operation. - * - * Generated from protobuf field string api_version = 5; - * @return string - */ - public function getApiVersion() - { - return $this->api_version; - } - - /** - * API version used to start the operation. - * - * Generated from protobuf field string api_version = 5; - * @param string $var - * @return $this - */ - public function setApiVersion($var) - { - GPBUtil::checkString($var, True); - $this->api_version = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/UpdateWorkflowRequest.php b/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/UpdateWorkflowRequest.php deleted file mode 100644 index 6a77b5a19df4..000000000000 --- a/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/UpdateWorkflowRequest.php +++ /dev/null @@ -1,143 +0,0 @@ -google.cloud.workflows.v1.UpdateWorkflowRequest - */ -class UpdateWorkflowRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Workflow to be updated. - * - * Generated from protobuf field .google.cloud.workflows.v1.Workflow workflow = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $workflow = null; - /** - * List of fields to be updated. If not present, the entire workflow - * will be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - */ - protected $update_mask = null; - - /** - * @param \Google\Cloud\Workflows\V1\Workflow $workflow Required. Workflow to be updated. - * @param \Google\Protobuf\FieldMask $updateMask List of fields to be updated. If not present, the entire workflow - * will be updated. - * - * @return \Google\Cloud\Workflows\V1\UpdateWorkflowRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Workflows\V1\Workflow $workflow, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setWorkflow($workflow) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Workflows\V1\Workflow $workflow - * Required. Workflow to be updated. - * @type \Google\Protobuf\FieldMask $update_mask - * List of fields to be updated. If not present, the entire workflow - * will be updated. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Workflows\V1\Workflows::initOnce(); - parent::__construct($data); - } - - /** - * Required. Workflow to be updated. - * - * Generated from protobuf field .google.cloud.workflows.v1.Workflow workflow = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Workflows\V1\Workflow|null - */ - public function getWorkflow() - { - return $this->workflow; - } - - public function hasWorkflow() - { - return isset($this->workflow); - } - - public function clearWorkflow() - { - unset($this->workflow); - } - - /** - * Required. Workflow to be updated. - * - * Generated from protobuf field .google.cloud.workflows.v1.Workflow workflow = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Workflows\V1\Workflow $var - * @return $this - */ - public function setWorkflow($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Workflows\V1\Workflow::class); - $this->workflow = $var; - - return $this; - } - - /** - * List of fields to be updated. If not present, the entire workflow - * will be 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); - } - - /** - * List of fields to be updated. If not present, the entire workflow - * will be 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; - } - -} - diff --git a/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/Workflow.php b/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/Workflow.php deleted file mode 100644 index c57333d720cc..000000000000 --- a/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/Workflow.php +++ /dev/null @@ -1,713 +0,0 @@ -google.cloud.workflows.v1.Workflow - */ -class Workflow extends \Google\Protobuf\Internal\Message -{ - /** - * The resource name of the workflow. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * Description of the workflow provided by the user. - * Must be at most 1000 unicode characters long. - * - * Generated from protobuf field string description = 2; - */ - protected $description = ''; - /** - * Output only. State of the workflow deployment. - * - * Generated from protobuf field .google.cloud.workflows.v1.Workflow.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - /** - * Output only. The revision of the workflow. - * A new revision of a workflow is created as a result of updating the - * following properties of a workflow: - * - [Service account][google.cloud.workflows.v1.Workflow.service_account] - * - [Workflow code to be - * executed][google.cloud.workflows.v1.Workflow.source_contents] - * The format is "000001-a4d", where the first six characters define - * the zero-padded revision ordinal number. They are followed by a hyphen and - * three hexadecimal random characters. - * - * Generated from protobuf field string revision_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $revision_id = ''; - /** - * Output only. The timestamp for when the workflow was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The timestamp for when the workflow was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Output only. The timestamp for the latest revision of the workflow's - * creation. - * - * Generated from protobuf field .google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $revision_create_time = null; - /** - * Labels associated with this workflow. - * Labels can contain at most 64 entries. Keys and values can be no longer - * than 63 characters and can only contain lowercase letters, numeric - * characters, underscores, and dashes. Label keys must start with a letter. - * International characters are allowed. - * - * Generated from protobuf field map labels = 8; - */ - private $labels; - /** - * The service account associated with the latest workflow version. - * This service account represents the identity of the workflow and determines - * what permissions the workflow has. - * Format: projects/{project}/serviceAccounts/{account} or {account} - * Using `-` as a wildcard for the `{project}` or not providing one at all - * will infer the project from the account. The `{account}` value can be the - * `email` address or the `unique_id` of the service account. - * If not provided, workflow will use the project's default service account. - * Modifying this field for an existing workflow results in a new workflow - * revision. - * - * Generated from protobuf field string service_account = 9; - */ - protected $service_account = ''; - /** - * Optional. The resource name of a KMS crypto key used to encrypt or decrypt - * the data associated with the workflow. - * Format: - * projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey} - * Using `-` as a wildcard for the `{project}` or not providing one at all - * will infer the project from the account. - * If not provided, data associated with the workflow will not be - * CMEK-encrypted. - * - * Generated from protobuf field string crypto_key_name = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - */ - protected $crypto_key_name = ''; - /** - * Output only. Error regarding the state of the workflow. For example, this - * field will have error details if the execution data is unavailable due to - * revoked KMS key permissions. - * - * Generated from protobuf field .google.cloud.workflows.v1.Workflow.StateError state_error = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state_error = null; - /** - * Optional. Describes the level of platform logging to apply to calls and - * call responses during executions of this workflow. If both the workflow and - * the execution specify a logging level, the execution level takes - * precedence. - * - * Generated from protobuf field .google.cloud.workflows.v1.Workflow.CallLogLevel call_log_level = 13 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $call_log_level = 0; - /** - * Optional. User-defined environment variables associated with this workflow - * revision. This map has a maximum length of 20. Each string can take up to - * 40KiB. Keys cannot be empty strings and cannot start with “GOOGLE” or - * “WORKFLOWS". - * - * Generated from protobuf field map user_env_vars = 14 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $user_env_vars; - protected $source_code; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The resource name of the workflow. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * @type string $description - * Description of the workflow provided by the user. - * Must be at most 1000 unicode characters long. - * @type int $state - * Output only. State of the workflow deployment. - * @type string $revision_id - * Output only. The revision of the workflow. - * A new revision of a workflow is created as a result of updating the - * following properties of a workflow: - * - [Service account][google.cloud.workflows.v1.Workflow.service_account] - * - [Workflow code to be - * executed][google.cloud.workflows.v1.Workflow.source_contents] - * The format is "000001-a4d", where the first six characters define - * the zero-padded revision ordinal number. They are followed by a hyphen and - * three hexadecimal random characters. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The timestamp for when the workflow was created. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The timestamp for when the workflow was last updated. - * @type \Google\Protobuf\Timestamp $revision_create_time - * Output only. The timestamp for the latest revision of the workflow's - * creation. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Labels associated with this workflow. - * Labels can contain at most 64 entries. Keys and values can be no longer - * than 63 characters and can only contain lowercase letters, numeric - * characters, underscores, and dashes. Label keys must start with a letter. - * International characters are allowed. - * @type string $service_account - * The service account associated with the latest workflow version. - * This service account represents the identity of the workflow and determines - * what permissions the workflow has. - * Format: projects/{project}/serviceAccounts/{account} or {account} - * Using `-` as a wildcard for the `{project}` or not providing one at all - * will infer the project from the account. The `{account}` value can be the - * `email` address or the `unique_id` of the service account. - * If not provided, workflow will use the project's default service account. - * Modifying this field for an existing workflow results in a new workflow - * revision. - * @type string $source_contents - * Workflow code to be executed. The size limit is 128KB. - * @type string $crypto_key_name - * Optional. The resource name of a KMS crypto key used to encrypt or decrypt - * the data associated with the workflow. - * Format: - * projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey} - * Using `-` as a wildcard for the `{project}` or not providing one at all - * will infer the project from the account. - * If not provided, data associated with the workflow will not be - * CMEK-encrypted. - * @type \Google\Cloud\Workflows\V1\Workflow\StateError $state_error - * Output only. Error regarding the state of the workflow. For example, this - * field will have error details if the execution data is unavailable due to - * revoked KMS key permissions. - * @type int $call_log_level - * Optional. Describes the level of platform logging to apply to calls and - * call responses during executions of this workflow. If both the workflow and - * the execution specify a logging level, the execution level takes - * precedence. - * @type array|\Google\Protobuf\Internal\MapField $user_env_vars - * Optional. User-defined environment variables associated with this workflow - * revision. This map has a maximum length of 20. Each string can take up to - * 40KiB. Keys cannot be empty strings and cannot start with “GOOGLE” or - * “WORKFLOWS". - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Workflows\V1\Workflows::initOnce(); - parent::__construct($data); - } - - /** - * The resource name of the workflow. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The resource name of the workflow. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Description of the workflow provided by the user. - * Must be at most 1000 unicode characters long. - * - * Generated from protobuf field string description = 2; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Description of the workflow provided by the user. - * Must be at most 1000 unicode characters long. - * - * Generated from protobuf field string description = 2; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Output only. State of the workflow deployment. - * - * Generated from protobuf field .google.cloud.workflows.v1.Workflow.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. State of the workflow deployment. - * - * Generated from protobuf field .google.cloud.workflows.v1.Workflow.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Workflows\V1\Workflow\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. The revision of the workflow. - * A new revision of a workflow is created as a result of updating the - * following properties of a workflow: - * - [Service account][google.cloud.workflows.v1.Workflow.service_account] - * - [Workflow code to be - * executed][google.cloud.workflows.v1.Workflow.source_contents] - * The format is "000001-a4d", where the first six characters define - * the zero-padded revision ordinal number. They are followed by a hyphen and - * three hexadecimal random characters. - * - * Generated from protobuf field string revision_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getRevisionId() - { - return $this->revision_id; - } - - /** - * Output only. The revision of the workflow. - * A new revision of a workflow is created as a result of updating the - * following properties of a workflow: - * - [Service account][google.cloud.workflows.v1.Workflow.service_account] - * - [Workflow code to be - * executed][google.cloud.workflows.v1.Workflow.source_contents] - * The format is "000001-a4d", where the first six characters define - * the zero-padded revision ordinal number. They are followed by a hyphen and - * three hexadecimal random characters. - * - * Generated from protobuf field string revision_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setRevisionId($var) - { - GPBUtil::checkString($var, True); - $this->revision_id = $var; - - return $this; - } - - /** - * Output only. The timestamp for when the workflow was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The timestamp for when the workflow was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The timestamp for when the workflow was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->update_time; - } - - public function hasUpdateTime() - { - return isset($this->update_time); - } - - public function clearUpdateTime() - { - unset($this->update_time); - } - - /** - * Output only. The timestamp for when the workflow was last updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Output only. The timestamp for the latest revision of the workflow's - * creation. - * - * Generated from protobuf field .google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getRevisionCreateTime() - { - return $this->revision_create_time; - } - - public function hasRevisionCreateTime() - { - return isset($this->revision_create_time); - } - - public function clearRevisionCreateTime() - { - unset($this->revision_create_time); - } - - /** - * Output only. The timestamp for the latest revision of the workflow's - * creation. - * - * Generated from protobuf field .google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setRevisionCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->revision_create_time = $var; - - return $this; - } - - /** - * Labels associated with this workflow. - * Labels can contain at most 64 entries. Keys and values can be no longer - * than 63 characters and can only contain lowercase letters, numeric - * characters, underscores, and dashes. Label keys must start with a letter. - * International characters are allowed. - * - * Generated from protobuf field map labels = 8; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Labels associated with this workflow. - * Labels can contain at most 64 entries. Keys and values can be no longer - * than 63 characters and can only contain lowercase letters, numeric - * characters, underscores, and dashes. Label keys must start with a letter. - * International characters are allowed. - * - * Generated from protobuf field map labels = 8; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setLabels($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->labels = $arr; - - return $this; - } - - /** - * The service account associated with the latest workflow version. - * This service account represents the identity of the workflow and determines - * what permissions the workflow has. - * Format: projects/{project}/serviceAccounts/{account} or {account} - * Using `-` as a wildcard for the `{project}` or not providing one at all - * will infer the project from the account. The `{account}` value can be the - * `email` address or the `unique_id` of the service account. - * If not provided, workflow will use the project's default service account. - * Modifying this field for an existing workflow results in a new workflow - * revision. - * - * Generated from protobuf field string service_account = 9; - * @return string - */ - public function getServiceAccount() - { - return $this->service_account; - } - - /** - * The service account associated with the latest workflow version. - * This service account represents the identity of the workflow and determines - * what permissions the workflow has. - * Format: projects/{project}/serviceAccounts/{account} or {account} - * Using `-` as a wildcard for the `{project}` or not providing one at all - * will infer the project from the account. The `{account}` value can be the - * `email` address or the `unique_id` of the service account. - * If not provided, workflow will use the project's default service account. - * Modifying this field for an existing workflow results in a new workflow - * revision. - * - * Generated from protobuf field string service_account = 9; - * @param string $var - * @return $this - */ - public function setServiceAccount($var) - { - GPBUtil::checkString($var, True); - $this->service_account = $var; - - return $this; - } - - /** - * Workflow code to be executed. The size limit is 128KB. - * - * Generated from protobuf field string source_contents = 10; - * @return string - */ - public function getSourceContents() - { - return $this->readOneof(10); - } - - public function hasSourceContents() - { - return $this->hasOneof(10); - } - - /** - * Workflow code to be executed. The size limit is 128KB. - * - * Generated from protobuf field string source_contents = 10; - * @param string $var - * @return $this - */ - public function setSourceContents($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(10, $var); - - return $this; - } - - /** - * Optional. The resource name of a KMS crypto key used to encrypt or decrypt - * the data associated with the workflow. - * Format: - * projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey} - * Using `-` as a wildcard for the `{project}` or not providing one at all - * will infer the project from the account. - * If not provided, data associated with the workflow will not be - * CMEK-encrypted. - * - * Generated from protobuf field string crypto_key_name = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @return string - */ - public function getCryptoKeyName() - { - return $this->crypto_key_name; - } - - /** - * Optional. The resource name of a KMS crypto key used to encrypt or decrypt - * the data associated with the workflow. - * Format: - * projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey} - * Using `-` as a wildcard for the `{project}` or not providing one at all - * will infer the project from the account. - * If not provided, data associated with the workflow will not be - * CMEK-encrypted. - * - * Generated from protobuf field string crypto_key_name = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setCryptoKeyName($var) - { - GPBUtil::checkString($var, True); - $this->crypto_key_name = $var; - - return $this; - } - - /** - * Output only. Error regarding the state of the workflow. For example, this - * field will have error details if the execution data is unavailable due to - * revoked KMS key permissions. - * - * Generated from protobuf field .google.cloud.workflows.v1.Workflow.StateError state_error = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Workflows\V1\Workflow\StateError|null - */ - public function getStateError() - { - return $this->state_error; - } - - public function hasStateError() - { - return isset($this->state_error); - } - - public function clearStateError() - { - unset($this->state_error); - } - - /** - * Output only. Error regarding the state of the workflow. For example, this - * field will have error details if the execution data is unavailable due to - * revoked KMS key permissions. - * - * Generated from protobuf field .google.cloud.workflows.v1.Workflow.StateError state_error = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Workflows\V1\Workflow\StateError $var - * @return $this - */ - public function setStateError($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Workflows\V1\Workflow\StateError::class); - $this->state_error = $var; - - return $this; - } - - /** - * Optional. Describes the level of platform logging to apply to calls and - * call responses during executions of this workflow. If both the workflow and - * the execution specify a logging level, the execution level takes - * precedence. - * - * Generated from protobuf field .google.cloud.workflows.v1.Workflow.CallLogLevel call_log_level = 13 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getCallLogLevel() - { - return $this->call_log_level; - } - - /** - * Optional. Describes the level of platform logging to apply to calls and - * call responses during executions of this workflow. If both the workflow and - * the execution specify a logging level, the execution level takes - * precedence. - * - * Generated from protobuf field .google.cloud.workflows.v1.Workflow.CallLogLevel call_log_level = 13 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setCallLogLevel($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Workflows\V1\Workflow\CallLogLevel::class); - $this->call_log_level = $var; - - return $this; - } - - /** - * Optional. User-defined environment variables associated with this workflow - * revision. This map has a maximum length of 20. Each string can take up to - * 40KiB. Keys cannot be empty strings and cannot start with “GOOGLE” or - * “WORKFLOWS". - * - * Generated from protobuf field map user_env_vars = 14 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getUserEnvVars() - { - return $this->user_env_vars; - } - - /** - * Optional. User-defined environment variables associated with this workflow - * revision. This map has a maximum length of 20. Each string can take up to - * 40KiB. Keys cannot be empty strings and cannot start with “GOOGLE” or - * “WORKFLOWS". - * - * Generated from protobuf field map user_env_vars = 14 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setUserEnvVars($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->user_env_vars = $arr; - - return $this; - } - - /** - * @return string - */ - public function getSourceCode() - { - return $this->whichOneof("source_code"); - } - -} - diff --git a/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/Workflow/CallLogLevel.php b/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/Workflow/CallLogLevel.php deleted file mode 100644 index fd7dbbc0dacf..000000000000 --- a/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/Workflow/CallLogLevel.php +++ /dev/null @@ -1,73 +0,0 @@ -google.cloud.workflows.v1.Workflow.CallLogLevel - */ -class CallLogLevel -{ - /** - * No call logging level specified. - * - * Generated from protobuf enum CALL_LOG_LEVEL_UNSPECIFIED = 0; - */ - const CALL_LOG_LEVEL_UNSPECIFIED = 0; - /** - * Log all call steps within workflows, all call returns, and all exceptions - * raised. - * - * Generated from protobuf enum LOG_ALL_CALLS = 1; - */ - const LOG_ALL_CALLS = 1; - /** - * Log only exceptions that are raised from call steps within workflows. - * - * Generated from protobuf enum LOG_ERRORS_ONLY = 2; - */ - const LOG_ERRORS_ONLY = 2; - /** - * Explicitly log nothing. - * - * Generated from protobuf enum LOG_NONE = 3; - */ - const LOG_NONE = 3; - - private static $valueToName = [ - self::CALL_LOG_LEVEL_UNSPECIFIED => 'CALL_LOG_LEVEL_UNSPECIFIED', - self::LOG_ALL_CALLS => 'LOG_ALL_CALLS', - self::LOG_ERRORS_ONLY => 'LOG_ERRORS_ONLY', - self::LOG_NONE => 'LOG_NONE', - ]; - - 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(CallLogLevel::class, \Google\Cloud\Workflows\V1\Workflow_CallLogLevel::class); - diff --git a/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/Workflow/State.php b/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/Workflow/State.php deleted file mode 100644 index 675b0444e92d..000000000000 --- a/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/Workflow/State.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.workflows.v1.Workflow.State - */ -class State -{ - /** - * Invalid state. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The workflow has been deployed successfully and is serving. - * - * Generated from protobuf enum ACTIVE = 1; - */ - const ACTIVE = 1; - /** - * Workflow data is unavailable. See the `state_error` field. - * - * Generated from protobuf enum UNAVAILABLE = 2; - */ - const UNAVAILABLE = 2; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::ACTIVE => 'ACTIVE', - self::UNAVAILABLE => 'UNAVAILABLE', - ]; - - 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\Workflows\V1\Workflow_State::class); - diff --git a/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/Workflow/StateError.php b/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/Workflow/StateError.php deleted file mode 100644 index eb9d406a37da..000000000000 --- a/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/Workflow/StateError.php +++ /dev/null @@ -1,104 +0,0 @@ -google.cloud.workflows.v1.Workflow.StateError - */ -class StateError extends \Google\Protobuf\Internal\Message -{ - /** - * Provides specifics about the error. - * - * Generated from protobuf field string details = 1; - */ - protected $details = ''; - /** - * The type of this state error. - * - * Generated from protobuf field .google.cloud.workflows.v1.Workflow.StateError.Type type = 2; - */ - protected $type = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $details - * Provides specifics about the error. - * @type int $type - * The type of this state error. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Workflows\V1\Workflows::initOnce(); - parent::__construct($data); - } - - /** - * Provides specifics about the error. - * - * Generated from protobuf field string details = 1; - * @return string - */ - public function getDetails() - { - return $this->details; - } - - /** - * Provides specifics about the error. - * - * Generated from protobuf field string details = 1; - * @param string $var - * @return $this - */ - public function setDetails($var) - { - GPBUtil::checkString($var, True); - $this->details = $var; - - return $this; - } - - /** - * The type of this state error. - * - * Generated from protobuf field .google.cloud.workflows.v1.Workflow.StateError.Type type = 2; - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * The type of this state error. - * - * Generated from protobuf field .google.cloud.workflows.v1.Workflow.StateError.Type type = 2; - * @param int $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Workflows\V1\Workflow\StateError\Type::class); - $this->type = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(StateError::class, \Google\Cloud\Workflows\V1\Workflow_StateError::class); - diff --git a/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/Workflow/StateError/Type.php b/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/Workflow/StateError/Type.php deleted file mode 100644 index 3a3520248b24..000000000000 --- a/owl-bot-staging/Workflows/v1/proto/src/Google/Cloud/Workflows/V1/Workflow/StateError/Type.php +++ /dev/null @@ -1,57 +0,0 @@ -google.cloud.workflows.v1.Workflow.StateError.Type - */ -class Type -{ - /** - * No type specified. - * - * Generated from protobuf enum TYPE_UNSPECIFIED = 0; - */ - const TYPE_UNSPECIFIED = 0; - /** - * Caused by an issue with KMS. - * - * Generated from protobuf enum KMS_ERROR = 1; - */ - const KMS_ERROR = 1; - - private static $valueToName = [ - self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', - self::KMS_ERROR => 'KMS_ERROR', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Type::class, \Google\Cloud\Workflows\V1\Workflow_StateError_Type::class); - diff --git a/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/create_workflow.php b/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/create_workflow.php deleted file mode 100644 index f24d7ea3d11d..000000000000 --- a/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/create_workflow.php +++ /dev/null @@ -1,98 +0,0 @@ -setParent($formattedParent) - ->setWorkflow($workflow) - ->setWorkflowId($workflowId); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $workflowsClient->createWorkflow($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Workflow $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = WorkflowsClient::locationName('[PROJECT]', '[LOCATION]'); - $workflowId = '[WORKFLOW_ID]'; - - create_workflow_sample($formattedParent, $workflowId); -} -// [END workflows_v1_generated_Workflows_CreateWorkflow_sync] diff --git a/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/delete_workflow.php b/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/delete_workflow.php deleted file mode 100644 index c2b7ac200b74..000000000000 --- a/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/delete_workflow.php +++ /dev/null @@ -1,83 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $workflowsClient->deleteWorkflow($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 = WorkflowsClient::workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); - - delete_workflow_sample($formattedName); -} -// [END workflows_v1_generated_Workflows_DeleteWorkflow_sync] diff --git a/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/get_location.php b/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/get_location.php deleted file mode 100644 index 6080669fa709..000000000000 --- a/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/get_location.php +++ /dev/null @@ -1,57 +0,0 @@ -getLocation($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END workflows_v1_generated_Workflows_GetLocation_sync] diff --git a/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/get_workflow.php b/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/get_workflow.php deleted file mode 100644 index 64742ab2b7a9..000000000000 --- a/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/get_workflow.php +++ /dev/null @@ -1,72 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Workflow $response */ - $response = $workflowsClient->getWorkflow($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 = WorkflowsClient::workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); - - get_workflow_sample($formattedName); -} -// [END workflows_v1_generated_Workflows_GetWorkflow_sync] diff --git a/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/list_locations.php b/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/list_locations.php deleted file mode 100644 index 72d2c6aa8c5e..000000000000 --- a/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/list_locations.php +++ /dev/null @@ -1,62 +0,0 @@ -listLocations($request); - - /** @var Location $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END workflows_v1_generated_Workflows_ListLocations_sync] diff --git a/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/list_workflows.php b/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/list_workflows.php deleted file mode 100644 index 9c1267dd7883..000000000000 --- a/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/list_workflows.php +++ /dev/null @@ -1,78 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $workflowsClient->listWorkflows($request); - - /** @var Workflow $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 = WorkflowsClient::locationName('[PROJECT]', '[LOCATION]'); - - list_workflows_sample($formattedParent); -} -// [END workflows_v1_generated_Workflows_ListWorkflows_sync] diff --git a/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/update_workflow.php b/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/update_workflow.php deleted file mode 100644 index 69de724a7404..000000000000 --- a/owl-bot-staging/Workflows/v1/samples/V1/WorkflowsClient/update_workflow.php +++ /dev/null @@ -1,75 +0,0 @@ -setWorkflow($workflow); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $workflowsClient->updateWorkflow($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Workflow $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END workflows_v1_generated_Workflows_UpdateWorkflow_sync] diff --git a/owl-bot-staging/Workflows/v1/src/V1/Client/BaseClient/WorkflowsBaseClient.php b/owl-bot-staging/Workflows/v1/src/V1/Client/BaseClient/WorkflowsBaseClient.php deleted file mode 100644 index 0a3f2525cbca..000000000000 --- a/owl-bot-staging/Workflows/v1/src/V1/Client/BaseClient/WorkflowsBaseClient.php +++ /dev/null @@ -1,494 +0,0 @@ - self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../../resources/workflows_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../../resources/workflows_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../../resources/workflows_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../../resources/workflows_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 crypto_key - * resource. - * - * @param string $project - * @param string $location - * @param string $keyRing - * @param string $cryptoKey - * - * @return string The formatted crypto_key resource. - */ - public static function cryptoKeyName(string $project, string $location, string $keyRing, string $cryptoKey): string - { - return self::getPathTemplate('cryptoKey')->render([ - 'project' => $project, - 'location' => $location, - 'keyRing' => $keyRing, - 'cryptoKey' => $cryptoKey, - ]); - } - - /** - * 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 workflow - * resource. - * - * @param string $project - * @param string $location - * @param string $workflow - * - * @return string The formatted workflow resource. - */ - public static function workflowName(string $project, string $location, string $workflow): string - { - return self::getPathTemplate('workflow')->render([ - 'project' => $project, - 'location' => $location, - 'workflow' => $workflow, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - cryptoKey: projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey} - * - location: projects/{project}/locations/{location} - * - workflow: projects/{project}/locations/{location}/workflows/{workflow} - * - * 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 'workflows.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Creates a new workflow. If a workflow with the specified name already - * exists in the specified project and location, the long running operation - * returns a [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error. - * - * The async variant is {@see self::createWorkflowAsync()} . - * - * @example samples/V1/WorkflowsClient/create_workflow.php - * - * @param CreateWorkflowRequest $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 createWorkflow(CreateWorkflowRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('CreateWorkflow', $request, $callOptions)->wait(); - } - - /** - * Deletes a workflow with the specified name. - * This method also cancels and deletes all running executions of the - * workflow. - * - * The async variant is {@see self::deleteWorkflowAsync()} . - * - * @example samples/V1/WorkflowsClient/delete_workflow.php - * - * @param DeleteWorkflowRequest $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 deleteWorkflow(DeleteWorkflowRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('DeleteWorkflow', $request, $callOptions)->wait(); - } - - /** - * Gets details of a single workflow. - * - * The async variant is {@see self::getWorkflowAsync()} . - * - * @example samples/V1/WorkflowsClient/get_workflow.php - * - * @param GetWorkflowRequest $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 Workflow - * - * @throws ApiException Thrown if the API call fails. - */ - public function getWorkflow(GetWorkflowRequest $request, array $callOptions = []): Workflow - { - return $this->startApiCall('GetWorkflow', $request, $callOptions)->wait(); - } - - /** - * Lists workflows in a given project and location. - * The default order is not specified. - * - * The async variant is {@see self::listWorkflowsAsync()} . - * - * @example samples/V1/WorkflowsClient/list_workflows.php - * - * @param ListWorkflowsRequest $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 listWorkflows(ListWorkflowsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListWorkflows', $request, $callOptions); - } - - /** - * Updates an existing workflow. - * Running this method has no impact on already running executions of the - * workflow. A new revision of the workflow might be created as a result of a - * successful update operation. In that case, the new revision is used - * in new workflow executions. - * - * The async variant is {@see self::updateWorkflowAsync()} . - * - * @example samples/V1/WorkflowsClient/update_workflow.php - * - * @param UpdateWorkflowRequest $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 updateWorkflow(UpdateWorkflowRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('UpdateWorkflow', $request, $callOptions)->wait(); - } - - /** - * Gets information about a location. - * - * The async variant is {@see self::getLocationAsync()} . - * - * @example samples/V1/WorkflowsClient/get_location.php - * - * @param GetLocationRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Location - * - * @throws ApiException Thrown if the API call fails. - */ - public function getLocation(GetLocationRequest $request, array $callOptions = []): Location - { - return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * The async variant is {@see self::listLocationsAsync()} . - * - * @example samples/V1/WorkflowsClient/list_locations.php - * - * @param ListLocationsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListLocations', $request, $callOptions); - } -} diff --git a/owl-bot-staging/Workflows/v1/src/V1/Client/WorkflowsClient.php b/owl-bot-staging/Workflows/v1/src/V1/Client/WorkflowsClient.php deleted file mode 100644 index 4c5a9c18fa50..000000000000 --- a/owl-bot-staging/Workflows/v1/src/V1/Client/WorkflowsClient.php +++ /dev/null @@ -1,40 +0,0 @@ - [ - 'google.cloud.workflows.v1.Workflows' => [ - 'CreateWorkflow' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Workflows\V1\Workflow', - 'metadataReturnType' => '\Google\Cloud\Workflows\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteWorkflow' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\Workflows\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'UpdateWorkflow' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Workflows\V1\Workflow', - 'metadataReturnType' => '\Google\Cloud\Workflows\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'workflow.name', - 'fieldAccessors' => [ - 'getWorkflow', - 'getName', - ], - ], - ], - ], - 'GetWorkflow' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Workflows\V1\Workflow', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListWorkflows' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getWorkflows', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Workflows\V1\ListWorkflowsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'GetLocation' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Location\Location', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'ListLocations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getLocations', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - 'interfaceOverride' => 'google.cloud.location.Locations', - ], - 'templateMap' => [ - 'cryptoKey' => 'projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey}', - 'location' => 'projects/{project}/locations/{location}', - 'workflow' => 'projects/{project}/locations/{location}/workflows/{workflow}', - ], - ], - ], -]; diff --git a/owl-bot-staging/Workflows/v1/src/V1/resources/workflows_rest_client_config.php b/owl-bot-staging/Workflows/v1/src/V1/resources/workflows_rest_client_config.php deleted file mode 100644 index 0ce03d0f8a98..000000000000 --- a/owl-bot-staging/Workflows/v1/src/V1/resources/workflows_rest_client_config.php +++ /dev/null @@ -1,129 +0,0 @@ - [ - 'google.cloud.location.Locations' => [ - 'GetLocation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListLocations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*}/locations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.cloud.workflows.v1.Workflows' => [ - 'CreateWorkflow' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/workflows', - 'body' => 'workflow', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'workflow_id', - ], - ], - 'DeleteWorkflow' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/workflows/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetWorkflow' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/workflows/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListWorkflows' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/workflows', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateWorkflow' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{workflow.name=projects/*/locations/*/workflows/*}', - 'body' => 'workflow', - 'placeholders' => [ - 'workflow.name' => [ - 'getters' => [ - 'getWorkflow', - 'getName', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'DeleteOperation' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Workflows/v1/tests/Unit/V1/Client/WorkflowsClientTest.php b/owl-bot-staging/Workflows/v1/tests/Unit/V1/Client/WorkflowsClientTest.php deleted file mode 100644 index 2171345be81d..000000000000 --- a/owl-bot-staging/Workflows/v1/tests/Unit/V1/Client/WorkflowsClientTest.php +++ /dev/null @@ -1,829 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return WorkflowsClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new WorkflowsClient($options); - } - - /** @test */ - public function createWorkflowTest() - { - $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/createWorkflowTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $revisionId = 'revisionId513861631'; - $serviceAccount = 'serviceAccount-1948028253'; - $sourceContents = 'sourceContents-1799875906'; - $cryptoKeyName = 'cryptoKeyName-184663511'; - $expectedResponse = new Workflow(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setRevisionId($revisionId); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setSourceContents($sourceContents); - $expectedResponse->setCryptoKeyName($cryptoKeyName); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createWorkflowTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $workflow = new Workflow(); - $workflowId = 'workflowId1712917915'; - $request = (new CreateWorkflowRequest()) - ->setParent($formattedParent) - ->setWorkflow($workflow) - ->setWorkflowId($workflowId); - $response = $gapicClient->createWorkflow($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.workflows.v1.Workflows/CreateWorkflow', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getWorkflow(); - $this->assertProtobufEquals($workflow, $actualValue); - $actualValue = $actualApiRequestObject->getWorkflowId(); - $this->assertProtobufEquals($workflowId, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createWorkflowTest'); - $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 createWorkflowExceptionTest() - { - $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/createWorkflowTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $workflow = new Workflow(); - $workflowId = 'workflowId1712917915'; - $request = (new CreateWorkflowRequest()) - ->setParent($formattedParent) - ->setWorkflow($workflow) - ->setWorkflowId($workflowId); - $response = $gapicClient->createWorkflow($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createWorkflowTest'); - 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 deleteWorkflowTest() - { - $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/deleteWorkflowTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteWorkflowTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); - $request = (new DeleteWorkflowRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteWorkflow($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.workflows.v1.Workflows/DeleteWorkflow', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteWorkflowTest'); - $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 deleteWorkflowExceptionTest() - { - $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/deleteWorkflowTest'); - $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->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); - $request = (new DeleteWorkflowRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteWorkflow($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteWorkflowTest'); - 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 getWorkflowTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $revisionId2 = 'revisionId2-100208654'; - $serviceAccount = 'serviceAccount-1948028253'; - $sourceContents = 'sourceContents-1799875906'; - $cryptoKeyName = 'cryptoKeyName-184663511'; - $expectedResponse = new Workflow(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setRevisionId($revisionId2); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setSourceContents($sourceContents); - $expectedResponse->setCryptoKeyName($cryptoKeyName); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); - $request = (new GetWorkflowRequest()) - ->setName($formattedName); - $response = $gapicClient->getWorkflow($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.workflows.v1.Workflows/GetWorkflow', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getWorkflowExceptionTest() - { - $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->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); - $request = (new GetWorkflowRequest()) - ->setName($formattedName); - try { - $gapicClient->getWorkflow($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 listWorkflowsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $workflowsElement = new Workflow(); - $workflows = [ - $workflowsElement, - ]; - $expectedResponse = new ListWorkflowsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setWorkflows($workflows); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListWorkflowsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listWorkflows($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getWorkflows()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.workflows.v1.Workflows/ListWorkflows', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listWorkflowsExceptionTest() - { - $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 ListWorkflowsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listWorkflows($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 updateWorkflowTest() - { - $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/updateWorkflowTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $revisionId = 'revisionId513861631'; - $serviceAccount = 'serviceAccount-1948028253'; - $sourceContents = 'sourceContents-1799875906'; - $cryptoKeyName = 'cryptoKeyName-184663511'; - $expectedResponse = new Workflow(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setRevisionId($revisionId); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setSourceContents($sourceContents); - $expectedResponse->setCryptoKeyName($cryptoKeyName); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateWorkflowTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $workflow = new Workflow(); - $request = (new UpdateWorkflowRequest()) - ->setWorkflow($workflow); - $response = $gapicClient->updateWorkflow($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.workflows.v1.Workflows/UpdateWorkflow', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getWorkflow(); - $this->assertProtobufEquals($workflow, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateWorkflowTest'); - $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 updateWorkflowExceptionTest() - { - $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/updateWorkflowTest'); - $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 - $workflow = new Workflow(); - $request = (new UpdateWorkflowRequest()) - ->setWorkflow($workflow); - $response = $gapicClient->updateWorkflow($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateWorkflowTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $request = new GetLocationRequest(); - $response = $gapicClient->getLocation($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - $request = new GetLocationRequest(); - try { - $gapicClient->getLocation($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $request = new ListLocationsRequest(); - $response = $gapicClient->listLocations($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - $request = new ListLocationsRequest(); - try { - $gapicClient->listLocations($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createWorkflowAsyncTest() - { - $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/createWorkflowTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $revisionId = 'revisionId513861631'; - $serviceAccount = 'serviceAccount-1948028253'; - $sourceContents = 'sourceContents-1799875906'; - $cryptoKeyName = 'cryptoKeyName-184663511'; - $expectedResponse = new Workflow(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setRevisionId($revisionId); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setSourceContents($sourceContents); - $expectedResponse->setCryptoKeyName($cryptoKeyName); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createWorkflowTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $workflow = new Workflow(); - $workflowId = 'workflowId1712917915'; - $request = (new CreateWorkflowRequest()) - ->setParent($formattedParent) - ->setWorkflow($workflow) - ->setWorkflowId($workflowId); - $response = $gapicClient->createWorkflowAsync($request)->wait(); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.workflows.v1.Workflows/CreateWorkflow', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getWorkflow(); - $this->assertProtobufEquals($workflow, $actualValue); - $actualValue = $actualApiRequestObject->getWorkflowId(); - $this->assertProtobufEquals($workflowId, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createWorkflowTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } -} diff --git a/owl-bot-staging/Workflows/v1beta/proto/src/GPBMetadata/Google/Cloud/Workflows/V1Beta/Workflows.php b/owl-bot-staging/Workflows/v1beta/proto/src/GPBMetadata/Google/Cloud/Workflows/V1Beta/Workflows.php deleted file mode 100644 index a0693520bcad216d4bd8e88bb0fc3172df9a901b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4084 zcmbtXL37(g6t0sd#A_PbrJ1^6Iw)>unr0Gdl6D4An-)27LS~Z2)28hV;~9@EuN@It z64J^cWPAWF+_`b*M1KQ6phw`;Qx9B#Ur-JVZ?)RB?6}y5Tq0}VdwTDC@B4Q5-UI*8 zN7t2Y;*!9mq^{IX6naP$Kk%q$d5%(x8VwRCme=xahXkskZ0;)$_YaiP=FY(axQ1R7 zSVUKvp4W7UW;tF|*N(m5sNs0Wq1Ill5o&f{sBvV3T(d<&-?WIbT`ul{N!_GoWjhX1 z*Q)72ta+(pQ8%rI2s0y;$s{P|JMu`MN}CWU`D?67LPHnmO1{t_x$R~n`h z67W82+lX9?+McU0hke%~i?IG#m z)%7N!5=!=F@mBI#7S3)ci#$hNKa=FTLW78;zpf|&p;6%8jq_#!I`XM905rq5D~9WO z3h6%IW*h07mVlnh$Le(a+15A+YBPtwcTcA-)F-* zUXikQan^fgcr<#(()YlIp`~WaAM6{?%gTK_nGT~~m&33H4Imza)B+*RY1|G78a<K!a^+YRm+31c4?SLY~ho0^D8Kq4v|BX zN8}{w*abAzHl2v@Ug;AbW(rGaDuy1v2n2T zv~)3}*Z(j~w9uVz-dY&zP=$?16TQUupc9`Fi-y{1^3>5B&*Ivkor=d!cl*&!Mbu95 z0?NtS>ZI^}23_8@Ln@+&kI3f{&>eq-rhPMj+IexsTd$0Xzl`f>LBtOe$Yp}NNe=iD z%KB!LR72Q_Vl1XG6dJ#x-Vt%*;mzV%G~KWr*i-ln;)`g;3+g1O)=uKt%ND-Mpt-)} zLLXF~U>#*eNg*W2Mxb(Y#2H|HcgYvDn#zc?3n&-4zyRyetT~KhlZ)BH9>Uv1;v?Ys zAkEb-I5Meza0I@E=TOr|%rfyxg!~_f-$ygz%Q4_%putEy!9+m>V4}d(B^HH=LK)3% z5{FRIpYDG~;9Ef8Nvs(CA=70r5gfY=4I0R`h>36l#aRWDyJ6vn47wyYR&gN15GJij zJe9Lyq!8j|G(+4vmrXWG|0=zg07wS)#Rgg~h(ykQc}nXvYH24w|W zA^s_YF7)sM57WOM>tx{O?+hVKpA)BEq4@PLzkN4x8?TB}?kU%abty|rDLGn7$<1-1fUG@#>rbKh8^U{bnWc+&u&GvE@55un4TqJ!> z)R{V0sB->5@8VR~3*%#}O96OkyvG}|EEp{xfZ8vNYpD~*fZ6{QYV9Tb&{})VN36BQ zyRy_Rb+Fi}n6%*qtzsK3zyU;z z?%)$varT+GxR%+4v7Gtz0k;$google.cloud.workflows.v1beta.CreateWorkflowRequest - */ -class CreateWorkflowRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Project and location in which the workflow should be created. - * Format: projects/{project}/locations/{location} - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. Workflow to be created. - * - * Generated from protobuf field .google.cloud.workflows.v1beta.Workflow workflow = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $workflow = null; - /** - * Required. The ID of the workflow to be created. It has to fulfill the - * following requirements: - * * Must contain only letters, numbers, underscores and hyphens. - * * Must start with a letter. - * * Must be between 1-64 characters. - * * Must end with a number or a letter. - * * Must be unique within the customer project and location. - * - * Generated from protobuf field string workflow_id = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $workflow_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. Project and location in which the workflow should be created. - * Format: projects/{project}/locations/{location} - * @type \Google\Cloud\Workflows\V1beta\Workflow $workflow - * Required. Workflow to be created. - * @type string $workflow_id - * Required. The ID of the workflow to be created. It has to fulfill the - * following requirements: - * * Must contain only letters, numbers, underscores and hyphens. - * * Must start with a letter. - * * Must be between 1-64 characters. - * * Must end with a number or a letter. - * * Must be unique within the customer project and location. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Workflows\V1Beta\Workflows::initOnce(); - parent::__construct($data); - } - - /** - * Required. Project and location in which the workflow should be created. - * Format: projects/{project}/locations/{location} - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. Project and location in which the workflow should be created. - * Format: projects/{project}/locations/{location} - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. Workflow to be created. - * - * Generated from protobuf field .google.cloud.workflows.v1beta.Workflow workflow = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Workflows\V1beta\Workflow|null - */ - public function getWorkflow() - { - return $this->workflow; - } - - public function hasWorkflow() - { - return isset($this->workflow); - } - - public function clearWorkflow() - { - unset($this->workflow); - } - - /** - * Required. Workflow to be created. - * - * Generated from protobuf field .google.cloud.workflows.v1beta.Workflow workflow = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Workflows\V1beta\Workflow $var - * @return $this - */ - public function setWorkflow($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Workflows\V1beta\Workflow::class); - $this->workflow = $var; - - return $this; - } - - /** - * Required. The ID of the workflow to be created. It has to fulfill the - * following requirements: - * * Must contain only letters, numbers, underscores and hyphens. - * * Must start with a letter. - * * Must be between 1-64 characters. - * * Must end with a number or a letter. - * * Must be unique within the customer project and location. - * - * Generated from protobuf field string workflow_id = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getWorkflowId() - { - return $this->workflow_id; - } - - /** - * Required. The ID of the workflow to be created. It has to fulfill the - * following requirements: - * * Must contain only letters, numbers, underscores and hyphens. - * * Must start with a letter. - * * Must be between 1-64 characters. - * * Must end with a number or a letter. - * * Must be unique within the customer project and location. - * - * Generated from protobuf field string workflow_id = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setWorkflowId($var) - { - GPBUtil::checkString($var, True); - $this->workflow_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/DeleteWorkflowRequest.php b/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/DeleteWorkflowRequest.php deleted file mode 100644 index 8eed6f4b51e7..000000000000 --- a/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/DeleteWorkflowRequest.php +++ /dev/null @@ -1,73 +0,0 @@ -google.cloud.workflows.v1beta.DeleteWorkflowRequest - */ -class DeleteWorkflowRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the workflow to be deleted. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the workflow to be deleted. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Workflows\V1Beta\Workflows::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the workflow to be deleted. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Name of the workflow to be deleted. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * - * 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/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/GetWorkflowRequest.php b/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/GetWorkflowRequest.php deleted file mode 100644 index aa97008d3024..000000000000 --- a/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/GetWorkflowRequest.php +++ /dev/null @@ -1,72 +0,0 @@ -google.cloud.workflows.v1beta.GetWorkflowRequest - */ -class GetWorkflowRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the workflow which information should be retrieved. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the workflow which information should be retrieved. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Workflows\V1Beta\Workflows::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the workflow which information should be retrieved. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Name of the workflow which information should be retrieved. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * - * 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/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/ListWorkflowsRequest.php b/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/ListWorkflowsRequest.php deleted file mode 100644 index a7864f89afd7..000000000000 --- a/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/ListWorkflowsRequest.php +++ /dev/null @@ -1,245 +0,0 @@ -google.cloud.workflows.v1beta.ListWorkflowsRequest - */ -class ListWorkflowsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Project and location from which the workflows should be listed. - * Format: projects/{project}/locations/{location} - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Maximum number of workflows to return per call. The service may return - * fewer than this value. If the value is not specified, a default value of - * 500 will be used. The maximum permitted value is 1000 and values greater - * than 1000 will be coerced down to 1000. - * - * Generated from protobuf field int32 page_size = 2; - */ - protected $page_size = 0; - /** - * A page token, received from a previous `ListWorkflows` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListWorkflows` must - * match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - /** - * Filter to restrict results to specific workflows. - * - * Generated from protobuf field string filter = 4; - */ - protected $filter = ''; - /** - * Comma-separated list of fields that that specify the order of the results. - * Default sorting order for a field is ascending. To specify descending order - * for a field, append a " desc" suffix. - * If not specified, the results will be returned in an unspecified order. - * - * Generated from protobuf field string order_by = 5; - */ - protected $order_by = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. Project and location from which the workflows should be listed. - * Format: projects/{project}/locations/{location} - * @type int $page_size - * Maximum number of workflows to return per call. The service may return - * fewer than this value. If the value is not specified, a default value of - * 500 will be used. The maximum permitted value is 1000 and values greater - * than 1000 will be coerced down to 1000. - * @type string $page_token - * A page token, received from a previous `ListWorkflows` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListWorkflows` must - * match the call that provided the page token. - * @type string $filter - * Filter to restrict results to specific workflows. - * @type string $order_by - * Comma-separated list of fields that that specify the order of the results. - * Default sorting order for a field is ascending. To specify descending order - * for a field, append a " desc" suffix. - * If not specified, the results will be returned in an unspecified order. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Workflows\V1Beta\Workflows::initOnce(); - parent::__construct($data); - } - - /** - * Required. Project and location from which the workflows should be listed. - * Format: projects/{project}/locations/{location} - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. Project and location from which the workflows should be listed. - * Format: projects/{project}/locations/{location} - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Maximum number of workflows to return per call. The service may return - * fewer than this value. If the value is not specified, a default value of - * 500 will be used. The maximum permitted value is 1000 and values greater - * than 1000 will be coerced down to 1000. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Maximum number of workflows to return per call. The service may return - * fewer than this value. If the value is not specified, a default value of - * 500 will be used. The maximum permitted value is 1000 and values greater - * than 1000 will be coerced down to 1000. - * - * 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; - } - - /** - * A page token, received from a previous `ListWorkflows` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListWorkflows` must - * match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A page token, received from a previous `ListWorkflows` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListWorkflows` must - * match 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; - } - - /** - * Filter to restrict results to specific workflows. - * - * Generated from protobuf field string filter = 4; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Filter to restrict results to specific workflows. - * - * Generated from protobuf field string filter = 4; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Comma-separated list of fields that that specify the order of the results. - * Default sorting order for a field is ascending. To specify descending order - * for a field, append a " desc" suffix. - * If not specified, the results will be returned in an unspecified order. - * - * Generated from protobuf field string order_by = 5; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Comma-separated list of fields that that specify the order of the results. - * Default sorting order for a field is ascending. To specify descending order - * for a field, append a " desc" suffix. - * If not specified, the results will be returned in an unspecified order. - * - * Generated from protobuf field string order_by = 5; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/ListWorkflowsResponse.php b/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/ListWorkflowsResponse.php deleted file mode 100644 index 50f2cadd0328..000000000000 --- a/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/ListWorkflowsResponse.php +++ /dev/null @@ -1,141 +0,0 @@ -google.cloud.workflows.v1beta.ListWorkflowsResponse - */ -class ListWorkflowsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The workflows which match the request. - * - * Generated from protobuf field repeated .google.cloud.workflows.v1beta.Workflow workflows = 1; - */ - private $workflows; - /** - * A token, which can be sent as `page_token` to retrieve the next page. - * If this field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - /** - * Unreachable resources. - * - * Generated from protobuf field repeated string unreachable = 3; - */ - private $unreachable; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Workflows\V1beta\Workflow>|\Google\Protobuf\Internal\RepeatedField $workflows - * The workflows which match the request. - * @type string $next_page_token - * A token, which can be sent as `page_token` to retrieve the next page. - * If this field is omitted, there are no subsequent pages. - * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable - * Unreachable resources. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Workflows\V1Beta\Workflows::initOnce(); - parent::__construct($data); - } - - /** - * The workflows which match the request. - * - * Generated from protobuf field repeated .google.cloud.workflows.v1beta.Workflow workflows = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getWorkflows() - { - return $this->workflows; - } - - /** - * The workflows which match the request. - * - * Generated from protobuf field repeated .google.cloud.workflows.v1beta.Workflow workflows = 1; - * @param array<\Google\Cloud\Workflows\V1beta\Workflow>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setWorkflows($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Workflows\V1beta\Workflow::class); - $this->workflows = $arr; - - return $this; - } - - /** - * A token, which can be sent as `page_token` to retrieve the next page. - * If this field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token, which can be sent as `page_token` to retrieve the next page. - * If this field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - - /** - * Unreachable resources. - * - * Generated from protobuf field repeated string unreachable = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUnreachable() - { - return $this->unreachable; - } - - /** - * Unreachable resources. - * - * Generated from protobuf field repeated string unreachable = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUnreachable($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->unreachable = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/OperationMetadata.php b/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/OperationMetadata.php deleted file mode 100644 index b4e7df568749..000000000000 --- a/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/OperationMetadata.php +++ /dev/null @@ -1,223 +0,0 @@ -google.cloud.workflows.v1beta.OperationMetadata - */ -class OperationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; - */ - protected $create_time = null; - /** - * The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; - */ - protected $end_time = null; - /** - * Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3; - */ - protected $target = ''; - /** - * Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4; - */ - protected $verb = ''; - /** - * API version used to start the operation. - * - * Generated from protobuf field string api_version = 5; - */ - protected $api_version = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $create_time - * The time the operation was created. - * @type \Google\Protobuf\Timestamp $end_time - * The time the operation finished running. - * @type string $target - * Server-defined resource path for the target of the operation. - * @type string $verb - * Name of the verb executed by the operation. - * @type string $api_version - * API version used to start the operation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Workflows\V1Beta\Workflows::initOnce(); - parent::__construct($data); - } - - /** - * The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3; - * @return string - */ - public function getTarget() - { - return $this->target; - } - - /** - * Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3; - * @param string $var - * @return $this - */ - public function setTarget($var) - { - GPBUtil::checkString($var, True); - $this->target = $var; - - return $this; - } - - /** - * Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4; - * @return string - */ - public function getVerb() - { - return $this->verb; - } - - /** - * Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4; - * @param string $var - * @return $this - */ - public function setVerb($var) - { - GPBUtil::checkString($var, True); - $this->verb = $var; - - return $this; - } - - /** - * API version used to start the operation. - * - * Generated from protobuf field string api_version = 5; - * @return string - */ - public function getApiVersion() - { - return $this->api_version; - } - - /** - * API version used to start the operation. - * - * Generated from protobuf field string api_version = 5; - * @param string $var - * @return $this - */ - public function setApiVersion($var) - { - GPBUtil::checkString($var, True); - $this->api_version = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/UpdateWorkflowRequest.php b/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/UpdateWorkflowRequest.php deleted file mode 100644 index eedfd1e55dd6..000000000000 --- a/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/UpdateWorkflowRequest.php +++ /dev/null @@ -1,127 +0,0 @@ -google.cloud.workflows.v1beta.UpdateWorkflowRequest - */ -class UpdateWorkflowRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Workflow to be updated. - * - * Generated from protobuf field .google.cloud.workflows.v1beta.Workflow workflow = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $workflow = null; - /** - * List of fields to be updated. If not present, the entire workflow - * will be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - */ - protected $update_mask = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Workflows\V1beta\Workflow $workflow - * Required. Workflow to be updated. - * @type \Google\Protobuf\FieldMask $update_mask - * List of fields to be updated. If not present, the entire workflow - * will be updated. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Workflows\V1Beta\Workflows::initOnce(); - parent::__construct($data); - } - - /** - * Required. Workflow to be updated. - * - * Generated from protobuf field .google.cloud.workflows.v1beta.Workflow workflow = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Workflows\V1beta\Workflow|null - */ - public function getWorkflow() - { - return $this->workflow; - } - - public function hasWorkflow() - { - return isset($this->workflow); - } - - public function clearWorkflow() - { - unset($this->workflow); - } - - /** - * Required. Workflow to be updated. - * - * Generated from protobuf field .google.cloud.workflows.v1beta.Workflow workflow = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Workflows\V1beta\Workflow $var - * @return $this - */ - public function setWorkflow($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Workflows\V1beta\Workflow::class); - $this->workflow = $var; - - return $this; - } - - /** - * List of fields to be updated. If not present, the entire workflow - * will be 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); - } - - /** - * List of fields to be updated. If not present, the entire workflow - * will be 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; - } - -} - diff --git a/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/Workflow.php b/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/Workflow.php deleted file mode 100644 index b4dcfbd75c43..000000000000 --- a/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/Workflow.php +++ /dev/null @@ -1,503 +0,0 @@ -google.cloud.workflows.v1beta.Workflow - */ -class Workflow extends \Google\Protobuf\Internal\Message -{ - /** - * The resource name of the workflow. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * Description of the workflow provided by the user. - * Must be at most 1000 unicode characters long. - * - * Generated from protobuf field string description = 2; - */ - protected $description = ''; - /** - * Output only. State of the workflow deployment. - * - * Generated from protobuf field .google.cloud.workflows.v1beta.Workflow.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - /** - * Output only. The revision of the workflow. - * A new revision of a workflow is created as a result of updating the - * following fields of a workflow: - * - `source_code` - * - `service_account` - * The format is "000001-a4d", where the first 6 characters define - * the zero-padded revision ordinal number. They are followed by a hyphen and - * 3 hexadecimal random characters. - * - * Generated from protobuf field string revision_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $revision_id = ''; - /** - * Output only. The timestamp of when the workflow was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The last update timestamp of the workflow. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Output only. The timestamp that the latest revision of the workflow - * was created. - * - * Generated from protobuf field .google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $revision_create_time = null; - /** - * Labels associated with this workflow. - * Labels can contain at most 64 entries. Keys and values can be no longer - * than 63 characters and can only contain lowercase letters, numeric - * characters, underscores and dashes. Label keys must start with a letter. - * International characters are allowed. - * - * Generated from protobuf field map labels = 8; - */ - private $labels; - /** - * Name of the service account associated with the latest workflow version. - * This service account represents the identity of the workflow and determines - * what permissions the workflow has. - * Format: projects/{project}/serviceAccounts/{account} - * Using `-` as a wildcard for the `{project}` will infer the project from - * the account. The `{account}` value can be the `email` address or the - * `unique_id` of the service account. - * If not provided, workflow will use the project's default service account. - * Modifying this field for an existing workflow results in a new workflow - * revision. - * - * Generated from protobuf field string service_account = 9; - */ - protected $service_account = ''; - protected $source_code; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The resource name of the workflow. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * @type string $description - * Description of the workflow provided by the user. - * Must be at most 1000 unicode characters long. - * @type int $state - * Output only. State of the workflow deployment. - * @type string $revision_id - * Output only. The revision of the workflow. - * A new revision of a workflow is created as a result of updating the - * following fields of a workflow: - * - `source_code` - * - `service_account` - * The format is "000001-a4d", where the first 6 characters define - * the zero-padded revision ordinal number. They are followed by a hyphen and - * 3 hexadecimal random characters. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The timestamp of when the workflow was created. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The last update timestamp of the workflow. - * @type \Google\Protobuf\Timestamp $revision_create_time - * Output only. The timestamp that the latest revision of the workflow - * was created. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Labels associated with this workflow. - * Labels can contain at most 64 entries. Keys and values can be no longer - * than 63 characters and can only contain lowercase letters, numeric - * characters, underscores and dashes. Label keys must start with a letter. - * International characters are allowed. - * @type string $service_account - * Name of the service account associated with the latest workflow version. - * This service account represents the identity of the workflow and determines - * what permissions the workflow has. - * Format: projects/{project}/serviceAccounts/{account} - * Using `-` as a wildcard for the `{project}` will infer the project from - * the account. The `{account}` value can be the `email` address or the - * `unique_id` of the service account. - * If not provided, workflow will use the project's default service account. - * Modifying this field for an existing workflow results in a new workflow - * revision. - * @type string $source_contents - * Workflow code to be executed. The size limit is 32KB. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Workflows\V1Beta\Workflows::initOnce(); - parent::__construct($data); - } - - /** - * The resource name of the workflow. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The resource name of the workflow. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Description of the workflow provided by the user. - * Must be at most 1000 unicode characters long. - * - * Generated from protobuf field string description = 2; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Description of the workflow provided by the user. - * Must be at most 1000 unicode characters long. - * - * Generated from protobuf field string description = 2; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Output only. State of the workflow deployment. - * - * Generated from protobuf field .google.cloud.workflows.v1beta.Workflow.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. State of the workflow deployment. - * - * Generated from protobuf field .google.cloud.workflows.v1beta.Workflow.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Workflows\V1beta\Workflow\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. The revision of the workflow. - * A new revision of a workflow is created as a result of updating the - * following fields of a workflow: - * - `source_code` - * - `service_account` - * The format is "000001-a4d", where the first 6 characters define - * the zero-padded revision ordinal number. They are followed by a hyphen and - * 3 hexadecimal random characters. - * - * Generated from protobuf field string revision_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getRevisionId() - { - return $this->revision_id; - } - - /** - * Output only. The revision of the workflow. - * A new revision of a workflow is created as a result of updating the - * following fields of a workflow: - * - `source_code` - * - `service_account` - * The format is "000001-a4d", where the first 6 characters define - * the zero-padded revision ordinal number. They are followed by a hyphen and - * 3 hexadecimal random characters. - * - * Generated from protobuf field string revision_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setRevisionId($var) - { - GPBUtil::checkString($var, True); - $this->revision_id = $var; - - return $this; - } - - /** - * Output only. The timestamp of when the workflow was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The timestamp of when the workflow was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The last update timestamp of the workflow. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->update_time; - } - - public function hasUpdateTime() - { - return isset($this->update_time); - } - - public function clearUpdateTime() - { - unset($this->update_time); - } - - /** - * Output only. The last update timestamp of the workflow. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Output only. The timestamp that the latest revision of the workflow - * was created. - * - * Generated from protobuf field .google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getRevisionCreateTime() - { - return $this->revision_create_time; - } - - public function hasRevisionCreateTime() - { - return isset($this->revision_create_time); - } - - public function clearRevisionCreateTime() - { - unset($this->revision_create_time); - } - - /** - * Output only. The timestamp that the latest revision of the workflow - * was created. - * - * Generated from protobuf field .google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setRevisionCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->revision_create_time = $var; - - return $this; - } - - /** - * Labels associated with this workflow. - * Labels can contain at most 64 entries. Keys and values can be no longer - * than 63 characters and can only contain lowercase letters, numeric - * characters, underscores and dashes. Label keys must start with a letter. - * International characters are allowed. - * - * Generated from protobuf field map labels = 8; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Labels associated with this workflow. - * Labels can contain at most 64 entries. Keys and values can be no longer - * than 63 characters and can only contain lowercase letters, numeric - * characters, underscores and dashes. Label keys must start with a letter. - * International characters are allowed. - * - * Generated from protobuf field map labels = 8; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setLabels($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->labels = $arr; - - return $this; - } - - /** - * Name of the service account associated with the latest workflow version. - * This service account represents the identity of the workflow and determines - * what permissions the workflow has. - * Format: projects/{project}/serviceAccounts/{account} - * Using `-` as a wildcard for the `{project}` will infer the project from - * the account. The `{account}` value can be the `email` address or the - * `unique_id` of the service account. - * If not provided, workflow will use the project's default service account. - * Modifying this field for an existing workflow results in a new workflow - * revision. - * - * Generated from protobuf field string service_account = 9; - * @return string - */ - public function getServiceAccount() - { - return $this->service_account; - } - - /** - * Name of the service account associated with the latest workflow version. - * This service account represents the identity of the workflow and determines - * what permissions the workflow has. - * Format: projects/{project}/serviceAccounts/{account} - * Using `-` as a wildcard for the `{project}` will infer the project from - * the account. The `{account}` value can be the `email` address or the - * `unique_id` of the service account. - * If not provided, workflow will use the project's default service account. - * Modifying this field for an existing workflow results in a new workflow - * revision. - * - * Generated from protobuf field string service_account = 9; - * @param string $var - * @return $this - */ - public function setServiceAccount($var) - { - GPBUtil::checkString($var, True); - $this->service_account = $var; - - return $this; - } - - /** - * Workflow code to be executed. The size limit is 32KB. - * - * Generated from protobuf field string source_contents = 10; - * @return string - */ - public function getSourceContents() - { - return $this->readOneof(10); - } - - public function hasSourceContents() - { - return $this->hasOneof(10); - } - - /** - * Workflow code to be executed. The size limit is 32KB. - * - * Generated from protobuf field string source_contents = 10; - * @param string $var - * @return $this - */ - public function setSourceContents($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(10, $var); - - return $this; - } - - /** - * @return string - */ - public function getSourceCode() - { - return $this->whichOneof("source_code"); - } - -} - diff --git a/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/Workflow/State.php b/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/Workflow/State.php deleted file mode 100644 index ded042b45d2c..000000000000 --- a/owl-bot-staging/Workflows/v1beta/proto/src/Google/Cloud/Workflows/V1beta/Workflow/State.php +++ /dev/null @@ -1,58 +0,0 @@ -google.cloud.workflows.v1beta.Workflow.State - */ -class State -{ - /** - * Invalid state. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The workflow has been deployed successfully and is serving. - * - * Generated from protobuf enum ACTIVE = 1; - */ - const ACTIVE = 1; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::ACTIVE => 'ACTIVE', - ]; - - 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\Workflows\V1beta\Workflow_State::class); - diff --git a/owl-bot-staging/Workflows/v1beta/samples/V1beta/WorkflowsClient/create_workflow.php b/owl-bot-staging/Workflows/v1beta/samples/V1beta/WorkflowsClient/create_workflow.php deleted file mode 100644 index bc06e2f97d09..000000000000 --- a/owl-bot-staging/Workflows/v1beta/samples/V1beta/WorkflowsClient/create_workflow.php +++ /dev/null @@ -1,93 +0,0 @@ -createWorkflow($formattedParent, $workflow, $workflowId); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Workflow $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = WorkflowsClient::locationName('[PROJECT]', '[LOCATION]'); - $workflowId = '[WORKFLOW_ID]'; - - create_workflow_sample($formattedParent, $workflowId); -} -// [END workflows_v1beta_generated_Workflows_CreateWorkflow_sync] diff --git a/owl-bot-staging/Workflows/v1beta/samples/V1beta/WorkflowsClient/delete_workflow.php b/owl-bot-staging/Workflows/v1beta/samples/V1beta/WorkflowsClient/delete_workflow.php deleted file mode 100644 index c46edf18f0b8..000000000000 --- a/owl-bot-staging/Workflows/v1beta/samples/V1beta/WorkflowsClient/delete_workflow.php +++ /dev/null @@ -1,78 +0,0 @@ -deleteWorkflow($formattedName); - $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 = WorkflowsClient::workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); - - delete_workflow_sample($formattedName); -} -// [END workflows_v1beta_generated_Workflows_DeleteWorkflow_sync] diff --git a/owl-bot-staging/Workflows/v1beta/samples/V1beta/WorkflowsClient/get_workflow.php b/owl-bot-staging/Workflows/v1beta/samples/V1beta/WorkflowsClient/get_workflow.php deleted file mode 100644 index 98d3980788ce..000000000000 --- a/owl-bot-staging/Workflows/v1beta/samples/V1beta/WorkflowsClient/get_workflow.php +++ /dev/null @@ -1,67 +0,0 @@ -getWorkflow($formattedName); - 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 = WorkflowsClient::workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); - - get_workflow_sample($formattedName); -} -// [END workflows_v1beta_generated_Workflows_GetWorkflow_sync] diff --git a/owl-bot-staging/Workflows/v1beta/samples/V1beta/WorkflowsClient/list_workflows.php b/owl-bot-staging/Workflows/v1beta/samples/V1beta/WorkflowsClient/list_workflows.php deleted file mode 100644 index 2c50ff843aa7..000000000000 --- a/owl-bot-staging/Workflows/v1beta/samples/V1beta/WorkflowsClient/list_workflows.php +++ /dev/null @@ -1,73 +0,0 @@ -listWorkflows($formattedParent); - - /** @var Workflow $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 = WorkflowsClient::locationName('[PROJECT]', '[LOCATION]'); - - list_workflows_sample($formattedParent); -} -// [END workflows_v1beta_generated_Workflows_ListWorkflows_sync] diff --git a/owl-bot-staging/Workflows/v1beta/samples/V1beta/WorkflowsClient/update_workflow.php b/owl-bot-staging/Workflows/v1beta/samples/V1beta/WorkflowsClient/update_workflow.php deleted file mode 100644 index 82e8d02f4c18..000000000000 --- a/owl-bot-staging/Workflows/v1beta/samples/V1beta/WorkflowsClient/update_workflow.php +++ /dev/null @@ -1,72 +0,0 @@ -updateWorkflow($workflow); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Workflow $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END workflows_v1beta_generated_Workflows_UpdateWorkflow_sync] diff --git a/owl-bot-staging/Workflows/v1beta/src/V1beta/Gapic/WorkflowsGapicClient.php b/owl-bot-staging/Workflows/v1beta/src/V1beta/Gapic/WorkflowsGapicClient.php deleted file mode 100644 index 2914615fb4eb..000000000000 --- a/owl-bot-staging/Workflows/v1beta/src/V1beta/Gapic/WorkflowsGapicClient.php +++ /dev/null @@ -1,714 +0,0 @@ -locationName('[PROJECT]', '[LOCATION]'); - * $workflow = new Workflow(); - * $workflowId = 'workflow_id'; - * $operationResponse = $workflowsClient->createWorkflow($formattedParent, $workflow, $workflowId); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $workflowsClient->createWorkflow($formattedParent, $workflow, $workflowId); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $workflowsClient->resumeOperation($operationName, 'createWorkflow'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $workflowsClient->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. - * - * @experimental - */ -class WorkflowsGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.workflows.v1beta.Workflows'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'workflows.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 $locationNameTemplate; - - private static $workflowNameTemplate; - - 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/workflows_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/workflows_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/workflows_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/workflows_rest_client_config.php', - ], - ], - ]; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getWorkflowNameTemplate() - { - if (self::$workflowNameTemplate == null) { - self::$workflowNameTemplate = new PathTemplate('projects/{project}/locations/{location}/workflows/{workflow}'); - } - - return self::$workflowNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'location' => self::getLocationNameTemplate(), - 'workflow' => self::getWorkflowNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * 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. - * - * @experimental - */ - 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 workflow - * resource. - * - * @param string $project - * @param string $location - * @param string $workflow - * - * @return string The formatted workflow resource. - * - * @experimental - */ - public static function workflowName($project, $location, $workflow) - { - return self::getWorkflowNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'workflow' => $workflow, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - location: projects/{project}/locations/{location} - * - workflow: projects/{project}/locations/{location}/workflows/{workflow} - * - * 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. - * - * @experimental - */ - 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 - * - * @experimental - */ - 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 - * - * @experimental - */ - 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 'workflows.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 - * - * @experimental - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Creates a new workflow. If a workflow with the specified name already - * exists in the specified project and location, the long running operation - * will return [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error. - * - * Sample code: - * ``` - * $workflowsClient = new WorkflowsClient(); - * try { - * $formattedParent = $workflowsClient->locationName('[PROJECT]', '[LOCATION]'); - * $workflow = new Workflow(); - * $workflowId = 'workflow_id'; - * $operationResponse = $workflowsClient->createWorkflow($formattedParent, $workflow, $workflowId); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $workflowsClient->createWorkflow($formattedParent, $workflow, $workflowId); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $workflowsClient->resumeOperation($operationName, 'createWorkflow'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $workflowsClient->close(); - * } - * ``` - * - * @param string $parent Required. Project and location in which the workflow should be created. - * Format: projects/{project}/locations/{location} - * @param Workflow $workflow Required. Workflow to be created. - * @param string $workflowId Required. The ID of the workflow to be created. It has to fulfill the - * following requirements: - * - * * Must contain only letters, numbers, underscores and hyphens. - * * Must start with a letter. - * * Must be between 1-64 characters. - * * Must end with a number or a letter. - * * Must be unique within the customer project and location. - * @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\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createWorkflow($parent, $workflow, $workflowId, array $optionalArgs = []) - { - $request = new CreateWorkflowRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setWorkflow($workflow); - $request->setWorkflowId($workflowId); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateWorkflow', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a workflow with the specified name. - * This method also cancels and deletes all running executions of the - * workflow. - * - * Sample code: - * ``` - * $workflowsClient = new WorkflowsClient(); - * try { - * $formattedName = $workflowsClient->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); - * $operationResponse = $workflowsClient->deleteWorkflow($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 = $workflowsClient->deleteWorkflow($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $workflowsClient->resumeOperation($operationName, 'deleteWorkflow'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $workflowsClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the workflow to be deleted. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * @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\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteWorkflow($name, array $optionalArgs = []) - { - $request = new DeleteWorkflowRequest(); - $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->startOperationsCall('DeleteWorkflow', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets details of a single Workflow. - * - * Sample code: - * ``` - * $workflowsClient = new WorkflowsClient(); - * try { - * $formattedName = $workflowsClient->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); - * $response = $workflowsClient->getWorkflow($formattedName); - * } finally { - * $workflowsClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the workflow which information should be retrieved. - * Format: projects/{project}/locations/{location}/workflows/{workflow} - * @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\Workflows\V1beta\Workflow - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getWorkflow($name, array $optionalArgs = []) - { - $request = new GetWorkflowRequest(); - $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('GetWorkflow', Workflow::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists Workflows in a given project and location. - * The default order is not specified. - * - * Sample code: - * ``` - * $workflowsClient = new WorkflowsClient(); - * try { - * $formattedParent = $workflowsClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $workflowsClient->listWorkflows($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $workflowsClient->listWorkflows($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $workflowsClient->close(); - * } - * ``` - * - * @param string $parent Required. Project and location from which the workflows should be listed. - * Format: projects/{project}/locations/{location} - * @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 string $filter - * Filter to restrict results to specific workflows. - * @type string $orderBy - * Comma-separated list of fields that that specify the order of the results. - * Default sorting order for a field is ascending. To specify descending order - * for a field, append a " desc" suffix. - * If not specified, the results will be returned in an unspecified order. - * @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 - * - * @experimental - */ - public function listWorkflows($parent, array $optionalArgs = []) - { - $request = new ListWorkflowsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListWorkflows', $optionalArgs, ListWorkflowsResponse::class, $request); - } - - /** - * Updates an existing workflow. - * Running this method has no impact on already running executions of the - * workflow. A new revision of the workflow may be created as a result of a - * successful update operation. In that case, such revision will be used - * in new workflow executions. - * - * Sample code: - * ``` - * $workflowsClient = new WorkflowsClient(); - * try { - * $workflow = new Workflow(); - * $operationResponse = $workflowsClient->updateWorkflow($workflow); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $workflowsClient->updateWorkflow($workflow); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $workflowsClient->resumeOperation($operationName, 'updateWorkflow'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $workflowsClient->close(); - * } - * ``` - * - * @param Workflow $workflow Required. Workflow to be updated. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * List of fields to be updated. If not present, the entire workflow - * will be updated. - * @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 - * - * @experimental - */ - public function updateWorkflow($workflow, array $optionalArgs = []) - { - $request = new UpdateWorkflowRequest(); - $requestParamHeaders = []; - $request->setWorkflow($workflow); - $requestParamHeaders['workflow.name'] = $workflow->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateWorkflow', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } -} diff --git a/owl-bot-staging/Workflows/v1beta/src/V1beta/WorkflowsClient.php b/owl-bot-staging/Workflows/v1beta/src/V1beta/WorkflowsClient.php deleted file mode 100644 index 866499e8fc40..000000000000 --- a/owl-bot-staging/Workflows/v1beta/src/V1beta/WorkflowsClient.php +++ /dev/null @@ -1,36 +0,0 @@ - [ - 'google.cloud.workflows.v1beta.Workflows' => [ - 'CreateWorkflow' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Workflows\V1beta\Workflow', - 'metadataReturnType' => '\Google\Cloud\Workflows\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'DeleteWorkflow' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\Workflows\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'UpdateWorkflow' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Workflows\V1beta\Workflow', - 'metadataReturnType' => '\Google\Cloud\Workflows\V1beta\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'ListWorkflows' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getWorkflows', - ], - ], - ], - ], -]; diff --git a/owl-bot-staging/Workflows/v1beta/src/V1beta/resources/workflows_rest_client_config.php b/owl-bot-staging/Workflows/v1beta/src/V1beta/resources/workflows_rest_client_config.php deleted file mode 100644 index 35bd2027c0e3..000000000000 --- a/owl-bot-staging/Workflows/v1beta/src/V1beta/resources/workflows_rest_client_config.php +++ /dev/null @@ -1,129 +0,0 @@ - [ - 'google.cloud.location.Locations' => [ - 'GetLocation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListLocations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*}/locations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.cloud.workflows.v1beta.Workflows' => [ - 'CreateWorkflow' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*}/workflows', - 'body' => 'workflow', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'workflow_id', - ], - ], - 'DeleteWorkflow' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/workflows/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetWorkflow' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/workflows/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListWorkflows' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{parent=projects/*/locations/*}/workflows', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateWorkflow' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1beta/{workflow.name=projects/*/locations/*/workflows/*}', - 'body' => 'workflow', - 'placeholders' => [ - 'workflow.name' => [ - 'getters' => [ - 'getWorkflow', - 'getName', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'DeleteOperation' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta/{name=projects/*/locations/*}/operations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Workflows/v1beta/tests/Unit/V1beta/WorkflowsClientTest.php b/owl-bot-staging/Workflows/v1beta/tests/Unit/V1beta/WorkflowsClientTest.php deleted file mode 100644 index 2bb06cc9c188..000000000000 --- a/owl-bot-staging/Workflows/v1beta/tests/Unit/V1beta/WorkflowsClientTest.php +++ /dev/null @@ -1,582 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return WorkflowsClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new WorkflowsClient($options); - } - - /** @test */ - public function createWorkflowTest() - { - $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/createWorkflowTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $revisionId = 'revisionId513861631'; - $serviceAccount = 'serviceAccount-1948028253'; - $sourceContents = 'sourceContents-1799875906'; - $expectedResponse = new Workflow(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setRevisionId($revisionId); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setSourceContents($sourceContents); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createWorkflowTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $workflow = new Workflow(); - $workflowId = 'workflowId1712917915'; - $response = $gapicClient->createWorkflow($formattedParent, $workflow, $workflowId); - $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.workflows.v1beta.Workflows/CreateWorkflow', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getWorkflow(); - $this->assertProtobufEquals($workflow, $actualValue); - $actualValue = $actualApiRequestObject->getWorkflowId(); - $this->assertProtobufEquals($workflowId, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createWorkflowTest'); - $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 createWorkflowExceptionTest() - { - $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/createWorkflowTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $workflow = new Workflow(); - $workflowId = 'workflowId1712917915'; - $response = $gapicClient->createWorkflow($formattedParent, $workflow, $workflowId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createWorkflowTest'); - 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 deleteWorkflowTest() - { - $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/deleteWorkflowTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteWorkflowTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); - $response = $gapicClient->deleteWorkflow($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.workflows.v1beta.Workflows/DeleteWorkflow', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteWorkflowTest'); - $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 deleteWorkflowExceptionTest() - { - $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/deleteWorkflowTest'); - $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->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); - $response = $gapicClient->deleteWorkflow($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteWorkflowTest'); - 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 getWorkflowTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $revisionId = 'revisionId513861631'; - $serviceAccount = 'serviceAccount-1948028253'; - $sourceContents = 'sourceContents-1799875906'; - $expectedResponse = new Workflow(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setRevisionId($revisionId); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setSourceContents($sourceContents); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); - $response = $gapicClient->getWorkflow($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.workflows.v1beta.Workflows/GetWorkflow', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getWorkflowExceptionTest() - { - $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->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); - try { - $gapicClient->getWorkflow($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 listWorkflowsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $workflowsElement = new Workflow(); - $workflows = [ - $workflowsElement, - ]; - $expectedResponse = new ListWorkflowsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setWorkflows($workflows); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listWorkflows($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getWorkflows()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.workflows.v1beta.Workflows/ListWorkflows', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listWorkflowsExceptionTest() - { - $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->listWorkflows($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 updateWorkflowTest() - { - $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/updateWorkflowTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $description = 'description-1724546052'; - $revisionId = 'revisionId513861631'; - $serviceAccount = 'serviceAccount-1948028253'; - $sourceContents = 'sourceContents-1799875906'; - $expectedResponse = new Workflow(); - $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setRevisionId($revisionId); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setSourceContents($sourceContents); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateWorkflowTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $workflow = new Workflow(); - $response = $gapicClient->updateWorkflow($workflow); - $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.workflows.v1beta.Workflows/UpdateWorkflow', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getWorkflow(); - $this->assertProtobufEquals($workflow, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateWorkflowTest'); - $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 updateWorkflowExceptionTest() - { - $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/updateWorkflowTest'); - $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 - $workflow = new Workflow(); - $response = $gapicClient->updateWorkflow($workflow); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateWorkflowTest'); - 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()); - } -}