@@ -259,15 +259,15 @@ def __init__(
259
259
self .api_key = None
260
260
self .bootstrap_jwt = None
261
261
262
- def token_endpoint (self ):
262
+ def token_endpoint (self ) -> str :
263
263
params = get_connection_parameters (self .snowflake_connection_name )
264
264
265
265
if params is None :
266
266
raise RSConnectException ("No Snowflake connection found." )
267
267
268
268
return "https://{}.snowflakecomputing.com/" .format (params ["account" ])
269
269
270
- def fmt_payload (self ):
270
+ def fmt_payload (self ) -> str :
271
271
params = get_connection_parameters (self .snowflake_connection_name )
272
272
273
273
if params is None :
@@ -282,7 +282,7 @@ def fmt_payload(self):
282
282
payload = urlencode (payload )
283
283
return payload
284
284
285
- def exchange_token (self ):
285
+ def exchange_token (self ) -> str | bytes :
286
286
try :
287
287
server = HTTPServer (url = self .token_endpoint ())
288
288
payload = self .fmt_payload ()
@@ -1880,7 +1880,7 @@ def verify_api_key(connect_server: RSConnectServer) -> str:
1880
1880
return result ["username" ]
1881
1881
1882
1882
1883
- def get_python_info (connect_server : RSConnectServer ):
1883
+ def get_python_info (connect_server : PositConnectServer ):
1884
1884
"""
1885
1885
Return information about versions of Python that are installed on the indicated
1886
1886
Connect server.
@@ -1894,7 +1894,7 @@ def get_python_info(connect_server: RSConnectServer):
1894
1894
return result
1895
1895
1896
1896
1897
- def get_app_info (connect_server : RSConnectServer , app_id : str ):
1897
+ def get_app_info (connect_server : PositConnectServer , app_id : str ):
1898
1898
"""
1899
1899
Return information about an application that has been created in Connect.
1900
1900
@@ -1915,7 +1915,7 @@ def get_posit_app_info(server: PositServer, app_id: str):
1915
1915
return response ["source" ]
1916
1916
1917
1917
1918
- def get_app_config (connect_server : RSConnectServer , app_id : str ):
1918
+ def get_app_config (connect_server : PositConnectServer , app_id : str ):
1919
1919
"""
1920
1920
Return the configuration information for an application that has been created
1921
1921
in Connect.
@@ -1931,7 +1931,7 @@ def get_app_config(connect_server: RSConnectServer, app_id: str):
1931
1931
1932
1932
1933
1933
def emit_task_log (
1934
- connect_server : RSConnectServer ,
1934
+ connect_server : PositConnectServer ,
1935
1935
app_id : str ,
1936
1936
task_id : str ,
1937
1937
log_callback : Optional [Callable [[str ], None ]],
@@ -1967,7 +1967,7 @@ def emit_task_log(
1967
1967
1968
1968
1969
1969
def retrieve_matching_apps (
1970
- connect_server : RSConnectServer ,
1970
+ connect_server : PositConnectServer ,
1971
1971
filters : Optional [dict [str , str | int ]] = None ,
1972
1972
limit : Optional [int ] = None ,
1973
1973
mapping_function : Optional [Callable [[RSConnectClient , ContentItemV0 ], AbbreviatedAppItem | None ]] = None ,
@@ -2043,7 +2043,7 @@ class AbbreviatedAppItem(TypedDict):
2043
2043
config_url : str
2044
2044
2045
2045
2046
- def override_title_search (connect_server : RSConnectServer , app_id : str , app_title : str ):
2046
+ def override_title_search (connect_server : PositConnectServer , app_id : str , app_title : str ):
2047
2047
"""
2048
2048
Returns a list of abbreviated app data that contains apps with a title
2049
2049
that matches the given one and/or the specific app noted by its ID.
@@ -2124,7 +2124,7 @@ def find_unique_name(remote_server: TargetableServer, name: str):
2124
2124
:param name: the default name for an app.
2125
2125
:return: the name, potentially with a suffixed number to guarantee uniqueness.
2126
2126
"""
2127
- if isinstance (remote_server , RSConnectServer ):
2127
+ if isinstance (remote_server , PositConnectServer ):
2128
2128
existing_names = retrieve_matching_apps (
2129
2129
remote_server ,
2130
2130
filters = {"search" : name },
0 commit comments