xref: /aosp_15_r20/external/googleapis/google/cloud/workflows/type/engine_call.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2022 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.cloud.workflows.type;
18
19import "google/protobuf/struct.proto";
20import "google/protobuf/timestamp.proto";
21
22option go_package = "cloud.google.com/go/workflows/type/typepb;typepb";
23option java_multiple_files = true;
24option java_outer_classname = "EngineCallProto";
25option java_package = "com.google.cloud.workflows.type";
26
27// Logged during a workflow execution if the customer has requested call
28// logging.
29message EngineCallLog {
30  // The state of a function call.
31  enum State {
32    // Function call state is unspecified or unknown.
33    STATE_UNSPECIFIED = 0;
34
35    // Function call is starting.
36    BEGUN = 1;
37
38    // Function call has completed successfully.
39    SUCCEEDED = 2;
40
41    // Function call did not succeed because an exception was raised.
42    EXCEPTION_RAISED = 3;
43
44    // Function call handled an exception and is continuing.
45    EXCEPTION_HANDLED = 4;
46  }
47
48  // Information about an argument to a called function.
49  message CallArg {
50    // A function argument, serialized to a string. This may be truncated for
51    // size reasons.
52    string argument = 1;
53  }
54
55  // Information about the start of a call.
56  message Begun {
57    // The arguments passed to the function. Only one of 'args' and 'named_args'
58    // will be populated.
59    repeated CallArg args = 1;
60
61    // The arguments passed to the function, as a map with the argument names as
62    // the keys. The values may be JSON values or they may be the serialized
63    // string forms of the arguments truncated for size reasons. Only one of
64    // 'args' and 'named_args' will be populated.
65    map<string, google.protobuf.Value> named_args = 2;
66  }
67
68  // Information about the end of a successful call.
69  message Succeeded {
70    // The time when the call started.
71    google.protobuf.Timestamp call_start_time = 1;
72
73    // The result of the call, if the call succeeded, serialized to a string.
74    // This may be truncated for size reasons.
75    string response = 2;
76  }
77
78  // Information about the end of a failed call.
79  message ExceptionRaised {
80    // The time when the call started.
81    google.protobuf.Timestamp call_start_time = 1;
82
83    // The exception message which terminated the call, truncated if necessary.
84    string exception = 2;
85
86    // The name of the step where the failure originates, if known. Truncated
87    // if necessary.
88    string origin = 3;
89  }
90
91  // Information about an exception which was handled.
92  message ExceptionHandled {
93    // The time when the call started.
94    google.protobuf.Timestamp call_start_time = 1;
95
96    // The exception message which was handled, truncated if necessary.
97    string exception = 2;
98
99    // The name of the step where the failure originates, if known. Truncated
100    // if necessary.
101    string origin = 3;
102  }
103
104  // The execution ID of the execution where the call occurred.
105  string execution_id = 1;
106
107  // The point in time when the activity occurred.
108  google.protobuf.Timestamp activity_time = 2;
109
110  // The state of the function execution.
111  State state = 3;
112
113  // The name of the step in which the call took place, truncated if necessary.
114  string step = 4;
115
116  // The name of the target of the call, truncated if necessary.
117  string callee = 5;
118
119  oneof details {
120    // Appears at the start of a call.
121    Begun begun = 6;
122
123    // Appears when a call returns successfully.
124    Succeeded succeeded = 7;
125
126    // Appears when a call returns because an exception was raised.
127    ExceptionRaised exception_raised = 8;
128
129    // Appears when an exception is handled and normal execution resumes.
130    ExceptionHandled exception_handled = 9;
131  }
132}
133