2626import os
2727from typing import Optional
2828
29+ from sap_cloud_sdk .core .telemetry import Module
2930from sap_cloud_sdk .destination ._models import (
3031 Destination ,
3132 AuthToken ,
@@ -83,6 +84,7 @@ def create_client(
8384 instance : Optional [str ] = None ,
8485 config : Optional [DestinationConfig ] = None ,
8586 use_default_proxy : bool = False ,
87+ _telemetry_source : Optional [Module ] = None ,
8688):
8789 """Creates a Destination client with local/cloud detection.
8890
@@ -98,6 +100,7 @@ def create_client(
98100 will attempt to load transparent proxy configuration from APPFND_CONHOS_TRANSP_PROXY
99101 environment variable. To use a custom proxy, use client.set_proxy() after creation.
100102 Defaults to False.
103+ _telemetry_source: Internal telemetry source identifier. Not intended for external use.
101104
102105 Returns:
103106 DestinationClient or LocalDevDestinationClient: Client implementing the Destination interface.
@@ -118,7 +121,9 @@ def create_client(
118121 tp = TokenProvider (binding )
119122 http = DestinationHttp (config = binding , token_provider = tp )
120123
121- return DestinationClient (http , use_default_proxy )
124+ return DestinationClient (
125+ http , use_default_proxy , _telemetry_source = _telemetry_source
126+ )
122127
123128 except Exception as e :
124129 raise ClientCreationError (f"failed to create destination client: { e } " )
@@ -128,6 +133,7 @@ def create_fragment_client(
128133 * ,
129134 instance : Optional [str ] = None ,
130135 config : Optional [DestinationConfig ] = None ,
136+ _telemetry_source : Optional [Module ] = None ,
131137):
132138 """Creates a Fragment client with local/cloud detection.
133139
@@ -139,6 +145,7 @@ def create_fragment_client(
139145 Args:
140146 instance: Instance name used for secret resolution in cloud mode. Defaults to "default".
141147 config: Optional explicit DestinationConfig.
148+ _telemetry_source: Internal telemetry source identifier. Not intended for external use.
142149
143150 Returns:
144151 FragmentClient or LocalDevFragmentClient: Client for managing destination fragments.
@@ -159,7 +166,7 @@ def create_fragment_client(
159166 tp = TokenProvider (binding )
160167 http = DestinationHttp (config = binding , token_provider = tp )
161168
162- return FragmentClient (http )
169+ return FragmentClient (http , _telemetry_source = _telemetry_source )
163170
164171 except Exception as e :
165172 raise ClientCreationError (f"failed to create fragment client: { e } " )
@@ -169,6 +176,7 @@ def create_certificate_client(
169176 * ,
170177 instance : Optional [str ] = None ,
171178 config : Optional [DestinationConfig ] = None ,
179+ _telemetry_source : Optional [Module ] = None ,
172180):
173181 """Creates a Certificate client with local/cloud detection.
174182
@@ -180,6 +188,7 @@ def create_certificate_client(
180188 Args:
181189 instance: Instance name used for secret resolution in cloud mode. Defaults to "default".
182190 config: Optional explicit DestinationConfig.
191+ _telemetry_source: Internal telemetry source identifier. Not intended for external use.
183192
184193 Returns:
185194 CertificateClient or LocalDevCertificateClient: Client for managing certificates.
@@ -200,7 +209,7 @@ def create_certificate_client(
200209 tp = TokenProvider (binding )
201210 http = DestinationHttp (config = binding , token_provider = tp )
202211
203- return CertificateClient (http )
212+ return CertificateClient (http , _telemetry_source = _telemetry_source )
204213
205214 except Exception as e :
206215 raise ClientCreationError (f"failed to create certificate client: { e } " )
0 commit comments