示例#1
0
 def get_template_client(self) -> WorkflowTemplateServiceClient:
     """
     Returns WorkflowTemplateServiceClient.
     """
     return WorkflowTemplateServiceClient(
         credentials=self._get_credentials(),
         client_info=self.client_info
     )
示例#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
        )
示例#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)