@@ -46,7 +46,7 @@ class ApplicationIntegrationToolset:
46
46
project="test-project",
47
47
location="us-central1"
48
48
integration="test-integration",
49
- trigger= "api_trigger/test_trigger",
49
+ triggers=[ "api_trigger/test_trigger"] ,
50
50
service_account_credentials={...},
51
51
)
52
52
@@ -80,7 +80,7 @@ def __init__(
80
80
project : str ,
81
81
location : str ,
82
82
integration : Optional [str ] = None ,
83
- trigger : Optional [str ] = None ,
83
+ triggers : Optional [List [ str ] ] = None ,
84
84
connection : Optional [str ] = None ,
85
85
entity_operations : Optional [str ] = None ,
86
86
actions : Optional [str ] = None ,
@@ -95,10 +95,11 @@ def __init__(
95
95
):
96
96
"""Args:
97
97
98
+ Args:
98
99
project: The GCP project ID.
99
100
location: The GCP location.
100
101
integration: The integration name.
101
- trigger : The trigger name .
102
+ triggers : The list of trigger names in the integration .
102
103
connection: The connection name.
103
104
entity_operations: The entity operations supported by the connection.
104
105
actions: The actions supported by the connection.
@@ -112,15 +113,17 @@ def __init__(
112
113
expose.
113
114
114
115
Raises:
115
- ValueError: If neither integration and trigger nor connection and
116
- (entity_operations or actions) is provided.
116
+ ValueError: If none of the following conditions are met:
117
+ - `integration` is provided.
118
+ - `connection` is provided and at least one of `entity_operations`
119
+ or `actions` is provided.
117
120
Exception: If there is an error during the initialization of the
118
121
integration or connection client.
119
122
"""
120
123
self .project = project
121
124
self .location = location
122
125
self .integration = integration
123
- self .trigger = trigger
126
+ self .triggers = triggers
124
127
self .connection = connection
125
128
self .entity_operations = entity_operations
126
129
self .actions = actions
@@ -133,14 +136,14 @@ def __init__(
133
136
project ,
134
137
location ,
135
138
integration ,
136
- trigger ,
139
+ triggers ,
137
140
connection ,
138
141
entity_operations ,
139
142
actions ,
140
143
service_account_json ,
141
144
)
142
145
connection_details = {}
143
- if integration and trigger :
146
+ if integration :
144
147
spec = integration_client .get_openapi_spec_for_integration ()
145
148
elif connection and (entity_operations or actions ):
146
149
connections_client = ConnectionsClient (
@@ -153,7 +156,7 @@ def __init__(
153
156
)
154
157
else :
155
158
raise ValueError (
156
- "Either (integration and trigger) or (connection and"
159
+ "Invalid request, Either integration or (connection and"
157
160
" (entity_operations or actions)) should be provided."
158
161
)
159
162
self .openapi_toolset = None
@@ -183,7 +186,7 @@ def _parse_spec_to_toolset(self, spec_dict, connection_details):
183
186
)
184
187
auth_scheme = HTTPBearer (bearerFormat = "JWT" )
185
188
186
- if self .integration and self . trigger :
189
+ if self .integration :
187
190
self .openapi_toolset = OpenAPIToolset (
188
191
spec_dict = spec_dict ,
189
192
auth_credential = auth_credential ,
0 commit comments