Пример #1
0
        /// <summary>
        /// RamBase API Client
        /// </summary>
        /// <param name="clientId">RamBase client id</param>
        /// <param name="clientSecret">RamBase client secret</param>
        /// <param name="defaultTimeout">Default HTTP request timeout</param>
        /// <param name="defaultPath">Default API path</param>
        public RamBaseApi(string clientId, string clientSecret, int defaultTimeout = _timeout, string defaultPath = "https://api.rambase.net")
        {
            ClientId     = clientId;
            ClientSecret = clientSecret;
            ApiPath      = defaultPath;

            if (!defaultPath.EndsWith("/"))
            {
                ApiPath += "/";
            }

            _httpClient = new HttpClient();
            _httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
            _httpClient.Timeout     = TimeSpan.FromMilliseconds(defaultTimeout);
            _httpClient.BaseAddress = new Uri(defaultPath);

            _authentication = new RamBaseAuthentication(_httpClient);
            _request        = new RamBaseRequest(_httpClient);
            _operations     = new RamBaseOperations(_request);
            _access         = new RamBaseAccess(_request);
            _domainValues   = new RamBaseDomainValues(_request);
            _metadata       = new RamBaseMetadata(_request);
            _sessions       = new RamBaseSessions(_request);
        }
Пример #2
0
 public RamBaseSessions(RamBaseRequest request)
 {
     _request = request;
 }
Пример #3
0
 public RamBaseOperations(RamBaseRequest request)
 {
     _request = request;
 }
Пример #4
0
 public RamBaseAccess(RamBaseRequest ramBaseRequest)
 {
     _request = ramBaseRequest;
 }
 public RamBaseDomainValues(RamBaseRequest ramBaseRequest)
 {
     _request = ramBaseRequest;
 }
Пример #6
0
 public RamBaseMetadata(RamBaseRequest request)
 {
     _request = request;
 }