@@ -477,6 +477,63 @@ def _get_query_params_json(transcoded_request):
477477 query_params ["$alt" ] = "json;enum-encoding=int"
478478 return query_params
479479
480+ class _BaseExecutePipeline :
481+ def __hash__ (self ): # pragma: NO COVER
482+ return NotImplementedError ("__hash__ must be implemented." )
483+
484+ __REQUIRED_FIELDS_DEFAULT_VALUES : Dict [str , Any ] = {}
485+
486+ @classmethod
487+ def _get_unset_required_fields (cls , message_dict ):
488+ return {
489+ k : v
490+ for k , v in cls .__REQUIRED_FIELDS_DEFAULT_VALUES .items ()
491+ if k not in message_dict
492+ }
493+
494+ @staticmethod
495+ def _get_http_options ():
496+ http_options : List [Dict [str , str ]] = [
497+ {
498+ "method" : "post" ,
499+ "uri" : "/v1/{database=projects/*/databases/*}/documents:executePipeline" ,
500+ "body" : "*" ,
501+ },
502+ ]
503+ return http_options
504+
505+ @staticmethod
506+ def _get_transcoded_request (http_options , request ):
507+ pb_request = firestore .ExecutePipelineRequest .pb (request )
508+ transcoded_request = path_template .transcode (http_options , pb_request )
509+ return transcoded_request
510+
511+ @staticmethod
512+ def _get_request_body_json (transcoded_request ):
513+ # Jsonify the request body
514+
515+ body = json_format .MessageToJson (
516+ transcoded_request ["body" ], use_integers_for_enums = True
517+ )
518+ return body
519+
520+ @staticmethod
521+ def _get_query_params_json (transcoded_request ):
522+ query_params = json .loads (
523+ json_format .MessageToJson (
524+ transcoded_request ["query_params" ],
525+ use_integers_for_enums = True ,
526+ )
527+ )
528+ query_params .update (
529+ _BaseFirestoreRestTransport ._BaseExecutePipeline ._get_unset_required_fields (
530+ query_params
531+ )
532+ )
533+
534+ query_params ["$alt" ] = "json;enum-encoding=int"
535+ return query_params
536+
480537 class _BaseGetDocument :
481538 def __hash__ (self ): # pragma: NO COVER
482539 return NotImplementedError ("__hash__ must be implemented." )
0 commit comments