public RestApiProvider(string connectionString)
        {
            string key;

            (_baseEndpoint, key, _, _port) = ConnectionStringParser.Parse(connectionString);
            _restApiAccessTokenGenerator   = new RestApiAccessTokenGenerator(new AccessKey(key));
        }
        public RestApiProvider(string connectionString, string hubName)
        {
            string accessKey;

            (_baseEndpoint, accessKey, _, _) = ConnectionStringParser.Parse(connectionString);
            _hubName = hubName;
            _restApiAccessTokenGenerator = new RestApiAccessTokenGenerator(accessKey);
            _commonPrefix = $"{_baseEndpoint}/api/v1/hubs/{_hubName}";
        }
Exemple #3
0
        public RestApiProvider(string connectionString, string hubName)
        {
            string accessKey;

            (_baseEndpoint, accessKey, _, _port) = ConnectionStringParser.Parse(connectionString);
            _hubName = hubName;
            _restApiAccessTokenGenerator = new RestApiAccessTokenGenerator(accessKey);
            _requestPrefix  = _port == null ? $"{_baseEndpoint}/api/v1/hubs/{_hubName}" : $"{_baseEndpoint}:{_port}/api/v1/hubs/{_hubName}";
            _audiencePrefix = $"{_baseEndpoint}/api/v1/hubs/{_hubName}";
        }
 public RestApiProvider(ServiceEndpoint endpoint)
 {
     _audienceBaseUrl             = endpoint.AudienceBaseUrl;
     _serverEndpoint              = endpoint.Endpoint;
     _restApiAccessTokenGenerator = new RestApiAccessTokenGenerator(endpoint.AccessKey);
 }
 public RestApiProvider(ServiceEndpoint endpoint)
 {
     _baseEndpoint = endpoint.Endpoint;
     _port         = endpoint.Port;
     _restApiAccessTokenGenerator = new RestApiAccessTokenGenerator(endpoint.AccessKey);
 }