11use super :: ResourceIdentifier ;
2- use crate :: runs:: v2:: {
3- CreateRunRequest , GetRunRequest , ListRunsRequest , Run , UpdateRunRequest ,
4- run_service_client:: RunServiceClient ,
2+ use crate :: {
3+ metadata:: v1:: MetadataValue ,
4+ runs:: v2:: {
5+ CreateRunRequest , GetRunRequest , ListRunsRequest , Run , UpdateRunRequest ,
6+ run_service_client:: RunServiceClient ,
7+ } ,
58} ;
69use async_trait:: async_trait;
710use pbjson_types:: FieldMask ;
@@ -25,16 +28,17 @@ pub trait RunServiceWrapper: Deref<Target = RunServiceClient<SiftChannel>> + Der
2528 client_key : & str ,
2629 description : & str ,
2730 tags : & [ String ] ,
31+ metadata : & [ MetadataValue ] ,
2832 ) -> Result < Run > ;
2933
3034 /// Update a run. The `updated_run` is expected to contain the `run_id` or `client_key` used to
31- /// identify the run to update. The `field_mask ` is a list of snake_cased field names used to
35+ /// identify the run to update. The `update_mask ` is a list of snake_cased field names used to
3236 /// indicate which fields should actually be updated. A list of valid field names can be found
33- /// at [`this link`]. The [Run] returned is the updated run. If `field_masks ` is empty, then no
37+ /// at [`this link`]. The [Run] returned is the updated run. If `update_mask ` is empty, then no
3438 /// update is required and the `updated_run` is simply returned.
3539 ///
3640 /// [`this link`]: https://docs.siftstack.com/docs/api/grpc/protocol-buffers/runs#updaterunrequest
37- async fn try_update_run ( & mut self , updated_run : Run , field_masks : & [ String ] ) -> Result < Run > ;
41+ async fn try_update_run ( & mut self , updated_run : Run , update_mask : & [ String ] ) -> Result < Run > ;
3842
3943 /// Retrieve a run by ID.
4044 async fn try_get_run_by_id ( & mut self , run_id : & str ) -> Result < Run > ;
@@ -94,8 +98,10 @@ impl RunServiceWrapper for RunServiceWrapperImpl {
9498 client_key : & str ,
9599 description : & str ,
96100 tags : & [ String ] ,
101+ metadata : & [ MetadataValue ] ,
97102 ) -> Result < Run > {
98103 let tags = tags. to_vec ( ) ;
104+ let metadata = metadata. to_vec ( ) ;
99105
100106 if name. is_empty ( ) {
101107 return Err ( Error :: new_arg_error ( "run name cannot be blank" ) ) ;
@@ -110,6 +116,7 @@ impl RunServiceWrapper for RunServiceWrapperImpl {
110116 description : description. to_string ( ) ,
111117 tags,
112118 client_key : Some ( client_key. to_string ( ) ) ,
119+ metadata,
113120 ..Default :: default ( )
114121 } )
115122 . await
@@ -123,21 +130,21 @@ impl RunServiceWrapper for RunServiceWrapperImpl {
123130 }
124131
125132 /// Update a run. The `updated_run` is expected to contain the `run_id` or `client_key` used to
126- /// identify the run to update. The `field_mask ` is a list of snake_cased field names used to
133+ /// identify the run to update. The `update_mask ` is a list of snake_cased field names used to
127134 /// indicate which fields should actually be updated. A list of valid field names can be found
128- /// at [`this link`]. The [Run] returned is the updated run. If `field_masks ` is empty, then no
135+ /// at [`this link`]. The [Run] returned is the updated run. If `update_mask ` is empty, then no
129136 /// update is required and the `updated_run` is simply returned.
130137 ///
131138 /// [`this link`]: https://docs.siftstack.com/docs/api/grpc/protocol-buffers/runs#updaterunrequest
132- async fn try_update_run ( & mut self , updated_run : Run , field_masks : & [ String ] ) -> Result < Run > {
133- if field_masks . is_empty ( ) {
139+ async fn try_update_run ( & mut self , updated_run : Run , update_mask : & [ String ] ) -> Result < Run > {
140+ if update_mask . is_empty ( ) {
134141 return Ok ( updated_run) ;
135142 }
136143
137144 let run = self
138145 . update_run ( UpdateRunRequest {
139146 update_mask : Some ( FieldMask {
140- paths : field_masks . to_vec ( ) ,
147+ paths : update_mask . to_vec ( ) ,
141148 } ) ,
142149 run : Some ( updated_run) ,
143150 } )
0 commit comments