@@ -64,9 +64,9 @@ def handle_bad_response(self, response):
6464 )
6565
6666
67- class RStudioServer (AbstractRemoteServer ):
67+ class PositServer (AbstractRemoteServer ):
6868 """
69- A class used to represent the server of the shinyapps.io and RStudio Cloud APIs.
69+ A class used to represent the server of the shinyapps.io and Posit Cloud APIs.
7070 """
7171
7272 def __init__ (self , remote_name : str , url : str , account_name : str , token : str , secret : str ):
@@ -76,7 +76,7 @@ def __init__(self, remote_name: str, url: str, account_name: str, token: str, se
7676 self .secret = secret
7777
7878
79- class ShinyappsServer (RStudioServer ):
79+ class ShinyappsServer (PositServer ):
8080 """
8181 A class to encapsulate the information needed to interact with an
8282 instance of the shinyapps.io server.
@@ -89,16 +89,16 @@ def __init__(self, url: str, account_name: str, token: str, secret: str):
8989 super ().__init__ (remote_name = remote_name , url = url , account_name = account_name , token = token , secret = secret )
9090
9191
92- class CloudServer (RStudioServer ):
92+ class CloudServer (PositServer ):
9393 """
9494 A class to encapsulate the information needed to interact with an
95- instance of the RStudio Cloud server.
95+ instance of the Posit Cloud server.
9696 """
9797
9898 def __init__ (self , url : str , account_name : str , token : str , secret : str ):
99- remote_name = "RStudio Cloud"
100- if url == " rstudio.cloud" or url is None :
101- url = "https://api.rstudio .cloud"
99+ remote_name = "Posit Cloud"
100+ if url in { "posit.cloud" , " rstudio.cloud", None } :
101+ url = "https://api.posit .cloud"
102102 super ().__init__ (remote_name = remote_name , url = url , account_name = account_name , token = token , secret = secret )
103103
104104
@@ -475,7 +475,7 @@ def setup_remote_server(
475475 if api_key :
476476 self .remote_server = RSConnectServer (url , api_key , insecure , ca_data )
477477 elif token and secret :
478- if url and "rstudio.cloud" in url :
478+ if url and ( "rstudio.cloud" in url or "posit.cloud" in url ) :
479479 self .remote_server = CloudServer (url , account_name , token , secret )
480480 else :
481481 self .remote_server = ShinyappsServer (url , account_name , token , secret )
@@ -485,8 +485,8 @@ def setup_remote_server(
485485 def setup_client (self , cookies = None , timeout = 30 , ** kwargs ):
486486 if isinstance (self .remote_server , RSConnectServer ):
487487 self .client = RSConnectClient (self .remote_server , cookies , timeout )
488- elif isinstance (self .remote_server , RStudioServer ):
489- self .client = RStudioClient (self .remote_server , timeout )
488+ elif isinstance (self .remote_server , PositServer ):
489+ self .client = PositClient (self .remote_server , timeout )
490490 else :
491491 raise RSConnectException ("Unable to infer Connect client." )
492492
@@ -515,7 +515,7 @@ def validate_server(
515515 ):
516516 if (url and api_key ) or isinstance (self .remote_server , RSConnectServer ):
517517 self .validate_connect_server (name , url , api_key , insecure , cacert , api_key_is_required )
518- elif (url and token and secret ) or isinstance (self .remote_server , RStudioServer ):
518+ elif (url and token and secret ) or isinstance (self .remote_server , PositServer ):
519519 self .validate_rstudio_server (url , account_name , token , secret )
520520 else :
521521 raise RSConnectException ("Unable to validate server from information provided." )
@@ -596,11 +596,11 @@ def validate_rstudio_server(
596596 secret = secret or self .remote_server .secret
597597 server = (
598598 CloudServer (url , account_name , token , secret )
599- if "rstudio.cloud" in url
599+ if "rstudio.cloud" in url or "posit.cloud" in url
600600 else ShinyappsServer (url , account_name , token , secret )
601601 )
602602
603- with RStudioClient (server ) as client :
603+ with PositClient (server ) as client :
604604 try :
605605 result = client .get_current_user ()
606606 server .handle_bad_response (result )
@@ -657,7 +657,7 @@ def check_server_capabilities(self, capability_functions):
657657 :param details_source: the source for obtaining server details, gather_server_details(),
658658 by default.
659659 """
660- if isinstance (self .remote_server , RStudioServer ):
660+ if isinstance (self .remote_server , PositServer ):
661661 return self
662662
663663 details = self .server_details
@@ -847,7 +847,7 @@ def validate_app_mode(self, *args, **kwargs):
847847 if isinstance (self .remote_server , RSConnectServer ):
848848 app = get_app_info (self .remote_server , app_id )
849849 existing_app_mode = AppModes .get_by_ordinal (app .get ("app_mode" , 0 ), True )
850- elif isinstance (self .remote_server , RStudioServer ):
850+ elif isinstance (self .remote_server , PositServer ):
851851 app = get_rstudio_app_info (self .remote_server , app_id )
852852 existing_app_mode = AppModes .get_by_cloud_name (app .json_data ["mode" ])
853853 else :
@@ -1008,14 +1008,14 @@ def __init__(
10081008 self .output_id = output_id
10091009
10101010
1011- class RStudioClient (HTTPServer ):
1011+ class PositClient (HTTPServer ):
10121012 """
1013- An HTTP client to call the RStudio Cloud and shinyapps.io APIs.
1013+ An HTTP client to call the Posit Cloud and shinyapps.io APIs.
10141014 """
10151015
10161016 _TERMINAL_STATUSES = {"success" , "failed" , "error" }
10171017
1018- def __init__ (self , rstudio_server : RStudioServer , timeout : int = 30 ):
1018+ def __init__ (self , rstudio_server : PositServer , timeout : int = 30 ):
10191019 self ._token = rstudio_server .token
10201020 try :
10211021 self ._key = base64 .b64decode (rstudio_server .secret )
@@ -1156,7 +1156,7 @@ class ShinyappsService:
11561156 Encapsulates operations involving multiple API calls to shinyapps.io.
11571157 """
11581158
1159- def __init__ (self , rstudio_client : RStudioClient , server : ShinyappsServer ):
1159+ def __init__ (self , rstudio_client : PositClient , server : ShinyappsServer ):
11601160 self ._rstudio_client = rstudio_client
11611161 self ._server = server
11621162
@@ -1202,10 +1202,10 @@ def do_deploy(self, bundle_id, app_id):
12021202
12031203class CloudService :
12041204 """
1205- Encapsulates operations involving multiple API calls to RStudio Cloud.
1205+ Encapsulates operations involving multiple API calls to Posit Cloud.
12061206 """
12071207
1208- def __init__ (self , rstudio_client : RStudioClient , server : CloudServer ):
1208+ def __init__ (self , rstudio_client : PositClient , server : CloudServer ):
12091209 self ._rstudio_client = rstudio_client
12101210 self ._server = server
12111211
@@ -1332,7 +1332,7 @@ def get_app_info(connect_server, app_id):
13321332
13331333
13341334def get_rstudio_app_info (server , app_id ):
1335- with RStudioClient (server ) as client :
1335+ with PositClient (server ) as client :
13361336 result = client .get_application (app_id )
13371337 server .handle_bad_response (result )
13381338 return result
@@ -1541,7 +1541,7 @@ def find_unique_name(remote_server: TargetableServer, name: str):
15411541 mapping_function = lambda client , app : app ["name" ],
15421542 )
15431543 elif isinstance (remote_server , ShinyappsServer ):
1544- client = RStudioClient (remote_server )
1544+ client = PositClient (remote_server )
15451545 existing_names = client .get_applications_like_name (name )
15461546 else :
15471547 # non-unique names are permitted in cloud
0 commit comments