@@ -13,7 +13,7 @@ use temporal_sdk_core_api::envconfig::{
1313/// If fail is not null, it contains UTF-8 encoded error message.
1414/// The returned ByteArrays must be freed by the caller.
1515#[ repr( C ) ]
16- pub struct ClientConfigOrFail {
16+ pub struct ClientEnvConfigOrFail {
1717 pub success : * const ByteArray ,
1818 pub fail : * const ByteArray ,
1919}
@@ -24,14 +24,14 @@ pub struct ClientConfigOrFail {
2424/// If fail is not null, it contains UTF-8 encoded error message.
2525/// The returned ByteArrays must be freed by the caller.
2626#[ repr( C ) ]
27- pub struct ClientConfigProfileOrFail {
27+ pub struct ClientEnvConfigProfileOrFail {
2828 pub success : * const ByteArray ,
2929 pub fail : * const ByteArray ,
3030}
3131
3232/// Options for loading client configuration.
3333#[ repr( C ) ]
34- pub struct ClientConfigLoadOptions {
34+ pub struct ClientEnvConfigLoadOptions {
3535 pub path : ByteArrayRef ,
3636 pub data : ByteArrayRef ,
3737 pub config_file_strict : bool ,
@@ -40,7 +40,7 @@ pub struct ClientConfigLoadOptions {
4040
4141/// Options for loading a specific client configuration profile.
4242#[ repr( C ) ]
43- pub struct ClientConfigProfileLoadOptions {
43+ pub struct ClientEnvConfigProfileLoadOptions {
4444 pub profile : ByteArrayRef ,
4545 pub path : ByteArrayRef ,
4646 pub data : ByteArrayRef ,
@@ -52,11 +52,11 @@ pub struct ClientConfigProfileLoadOptions {
5252
5353// Wrapper types for JSON serialization
5454#[ derive( Serialize ) ]
55- struct ClientConfig {
56- profiles : HashMap < String , ClientConfigProfile > ,
55+ struct ClientEnvConfig {
56+ profiles : HashMap < String , ClientEnvConfigProfile > ,
5757}
5858
59- impl From < CoreClientConfig > for ClientConfig {
59+ impl From < CoreClientConfig > for ClientEnvConfig {
6060 fn from ( c : CoreClientConfig ) -> Self {
6161 Self {
6262 profiles : c. profiles . into_iter ( ) . map ( |( k, v) | ( k, v. into ( ) ) ) . collect ( ) ,
@@ -65,22 +65,22 @@ impl From<CoreClientConfig> for ClientConfig {
6565}
6666
6767#[ derive( Serialize ) ]
68- struct ClientConfigProfile {
68+ struct ClientEnvConfigProfile {
6969 #[ serde( skip_serializing_if = "Option::is_none" ) ]
7070 address : Option < String > ,
7171 #[ serde( skip_serializing_if = "Option::is_none" ) ]
7272 namespace : Option < String > ,
7373 #[ serde( skip_serializing_if = "Option::is_none" ) ]
7474 api_key : Option < String > ,
7575 #[ serde( skip_serializing_if = "Option::is_none" ) ]
76- tls : Option < ClientConfigTLS > ,
76+ tls : Option < ClientEnvConfigTLS > ,
7777 #[ serde( skip_serializing_if = "Option::is_none" ) ]
78- codec : Option < ClientConfigCodec > ,
78+ codec : Option < ClientEnvConfigCodec > ,
7979 #[ serde( skip_serializing_if = "HashMap::is_empty" ) ]
8080 grpc_meta : HashMap < String , String > ,
8181}
8282
83- impl From < CoreClientConfigProfile > for ClientConfigProfile {
83+ impl From < CoreClientConfigProfile > for ClientEnvConfigProfile {
8484 fn from ( c : CoreClientConfigProfile ) -> Self {
8585 Self {
8686 address : c. address ,
@@ -94,7 +94,7 @@ impl From<CoreClientConfigProfile> for ClientConfigProfile {
9494}
9595
9696#[ derive( Serialize ) ]
97- struct ClientConfigTLS {
97+ struct ClientEnvConfigTLS {
9898 #[ serde( skip_serializing_if = "Option::is_none" ) ]
9999 disabled : Option < bool > ,
100100 #[ serde( skip_serializing_if = "Option::is_none" ) ]
@@ -107,7 +107,7 @@ struct ClientConfigTLS {
107107 client_key : Option < DataSource > ,
108108}
109109
110- impl From < CoreClientConfigTLS > for ClientConfigTLS {
110+ impl From < CoreClientConfigTLS > for ClientEnvConfigTLS {
111111 fn from ( c : CoreClientConfigTLS ) -> Self {
112112 Self {
113113 disabled : c. disabled ,
@@ -120,14 +120,14 @@ impl From<CoreClientConfigTLS> for ClientConfigTLS {
120120}
121121
122122#[ derive( Serialize ) ]
123- struct ClientConfigCodec {
123+ struct ClientEnvConfigCodec {
124124 #[ serde( skip_serializing_if = "Option::is_none" ) ]
125125 endpoint : Option < String > ,
126126 #[ serde( skip_serializing_if = "Option::is_none" ) ]
127127 auth : Option < String > ,
128128}
129129
130- impl From < CoreClientConfigCodec > for ClientConfigCodec {
130+ impl From < CoreClientConfigCodec > for ClientEnvConfigCodec {
131131 fn from ( c : CoreClientConfigCodec ) -> Self {
132132 Self {
133133 endpoint : c. endpoint ,
@@ -204,18 +204,18 @@ fn serialize_or_error<T: Serialize>(data: T) -> Result<*const ByteArray, *const
204204/// Returns ClientConfigOrFail with either success JSON or error message.
205205/// The returned ByteArrays must be freed by the caller.
206206#[ unsafe( no_mangle) ]
207- pub extern "C" fn temporal_core_client_config_load (
208- options : * const ClientConfigLoadOptions ,
209- ) -> ClientConfigOrFail {
207+ pub extern "C" fn temporal_core_client_env_config_load (
208+ options : * const ClientEnvConfigLoadOptions ,
209+ ) -> ClientEnvConfigOrFail {
210210 if options. is_null ( ) {
211211 let err = ByteArray :: from_utf8 ( "Options cannot be null" . to_string ( ) ) ;
212- return ClientConfigOrFail {
212+ return ClientEnvConfigOrFail {
213213 success : std:: ptr:: null ( ) ,
214214 fail : err. into_raw ( ) ,
215215 } ;
216216 }
217217
218- let result = || -> Result < ClientConfig , String > {
218+ let result = || -> Result < ClientEnvConfig , String > {
219219 let opts = unsafe { & * options } ;
220220 let env_vars_map = parse_env_vars ( & opts. env_vars ) ?;
221221
@@ -232,18 +232,18 @@ pub extern "C" fn temporal_core_client_config_load(
232232
233233 match result ( ) {
234234 Ok ( data) => match serialize_or_error ( data) {
235- Ok ( success) => ClientConfigOrFail {
235+ Ok ( success) => ClientEnvConfigOrFail {
236236 success,
237237 fail : std:: ptr:: null ( ) ,
238238 } ,
239- Err ( fail) => ClientConfigOrFail {
239+ Err ( fail) => ClientEnvConfigOrFail {
240240 success : std:: ptr:: null ( ) ,
241241 fail,
242242 } ,
243243 } ,
244244 Err ( e) => {
245245 let err = ByteArray :: from_utf8 ( e) ;
246- ClientConfigOrFail {
246+ ClientEnvConfigOrFail {
247247 success : std:: ptr:: null ( ) ,
248248 fail : err. into_raw ( ) ,
249249 }
@@ -255,18 +255,18 @@ pub extern "C" fn temporal_core_client_config_load(
255255/// Returns ClientConfigProfileOrFail with either success JSON or error message.
256256/// The returned ByteArrays must be freed by the caller.
257257#[ unsafe( no_mangle) ]
258- pub extern "C" fn temporal_core_client_config_profile_load (
259- options : * const ClientConfigProfileLoadOptions ,
260- ) -> ClientConfigProfileOrFail {
258+ pub extern "C" fn temporal_core_client_env_config_profile_load (
259+ options : * const ClientEnvConfigProfileLoadOptions ,
260+ ) -> ClientEnvConfigProfileOrFail {
261261 if options. is_null ( ) {
262262 let err = ByteArray :: from_utf8 ( "Options cannot be null" . to_string ( ) ) ;
263- return ClientConfigProfileOrFail {
263+ return ClientEnvConfigProfileOrFail {
264264 success : std:: ptr:: null ( ) ,
265265 fail : err. into_raw ( ) ,
266266 } ;
267267 }
268268
269- let result = || -> Result < ClientConfigProfile , String > {
269+ let result = || -> Result < ClientEnvConfigProfile , String > {
270270 let opts = unsafe { & * options } ;
271271
272272 let profile_name = if !opts. profile . data . is_null ( ) && opts. profile . size > 0 {
@@ -294,18 +294,18 @@ pub extern "C" fn temporal_core_client_config_profile_load(
294294
295295 match result ( ) {
296296 Ok ( data) => match serialize_or_error ( data) {
297- Ok ( success) => ClientConfigProfileOrFail {
297+ Ok ( success) => ClientEnvConfigProfileOrFail {
298298 success,
299299 fail : std:: ptr:: null ( ) ,
300300 } ,
301- Err ( fail) => ClientConfigProfileOrFail {
301+ Err ( fail) => ClientEnvConfigProfileOrFail {
302302 success : std:: ptr:: null ( ) ,
303303 fail,
304304 } ,
305305 } ,
306306 Err ( e) => {
307307 let err = ByteArray :: from_utf8 ( e) ;
308- ClientConfigProfileOrFail {
308+ ClientEnvConfigProfileOrFail {
309309 success : std:: ptr:: null ( ) ,
310310 fail : err. into_raw ( ) ,
311311 }
0 commit comments