Ejemplo n.º 1
0
 def get_template_client(self) -> WorkflowTemplateServiceClient:
     """
     Returns WorkflowTemplateServiceClient.
     """
     return WorkflowTemplateServiceClient(
         credentials=self._get_credentials(),
         client_info=self.client_info
     )
Ejemplo n.º 2
0
    def get_template_client(self, location: Optional[str] = None) -> WorkflowTemplateServiceClient:
        """Returns WorkflowTemplateServiceClient."""
        client_options = None
        if location and location != 'global':
            client_options = {'api_endpoint': f'{location}-dataproc.googleapis.com:443'}

        return WorkflowTemplateServiceClient(
            credentials=self._get_credentials(), client_info=self.client_info, client_options=client_options
        )
Ejemplo n.º 3
0
    def get_template_client(
            self,
            region: Optional[str] = None,
            location: Optional[str] = None) -> WorkflowTemplateServiceClient:
        """Returns WorkflowTemplateServiceClient."""
        if location is not None:
            warnings.warn(
                "Parameter `location` will be deprecated. "
                "Please provide value through `region` parameter instead.",
                DeprecationWarning,
                stacklevel=2,
            )
            region = location
        client_options = None
        if region and region != 'global':
            client_options = {
                'api_endpoint': f'{region}-dataproc.googleapis.com:443'
            }

        return WorkflowTemplateServiceClient(
            credentials=self._get_credentials(),
            client_info=self.client_info,
            client_options=client_options)