public Task <Result> Remove(Firebase reference)
        {
            CheckDisposed();
            ArgUtils.CheckForNull(reference, nameof(reference));

            var request = new Request(reference, HttpMethod.Delete);

            return(PerformRequest(request));
        }
        public Task <Result> Push(Firebase reference, object content = null)
        {
            CheckDisposed();

            ArgUtils.CheckForNull(reference, nameof(reference));

            var request = new PushRequest(reference, content);

            return(PerformRequest(request));
        }
        public Task <Result> Set(Firebase reference, object content)
        {
            CheckDisposed();

            ArgUtils.CheckForNull(reference, nameof(reference));
            ArgUtils.CheckForNull(content, nameof(content));

            var request = new Request(reference, HttpMethod.Put, content);

            return(PerformRequest(request));
        }
        public void RemoveEventListener(IEventContract contract)
        {
            CheckDisposed();

            ArgUtils.CheckForNull(contract, nameof(contract));

            EventListenerRequest eventListenerRequest;

            if (!eventListenerRequests.TryGetValue(contract, out eventListenerRequest))
            {
                return;
            }

            eventListenerRequests.Remove(contract);

            eventListenerRequest.Stop();
        }
        public async void AddEventListener(IEventContract contract)
        {
            CheckDisposed();

            ArgUtils.CheckForNull(contract, nameof(contract));

            if (eventListenerRequests.ContainsKey(contract))
            {
                return;
            }

            var eventListenerRequest = new EventListenerRequest(contract, new Cache());

            eventListenerRequests.Add(contract, eventListenerRequest);

            HttpRequestMessage  requestMessage      = eventListenerRequest.CreateRequestMessage(Context);
            HttpResponseMessage httpResponseMessage =
                await SendRequestMessage(requestMessage, HttpCompletionOption.ResponseHeadersRead);

            eventListenerRequest.CreateResult(httpResponseMessage, Context);
        }