From de0f076ef9ff546c9a90513259ad6c42cd2224b3 Mon Sep 17 00:00:00 2001 From: TrueDoctor Date: Sat, 29 Sep 2018 16:51:26 +0200 Subject: added firebase api --- FireBase/Query/AuthQuery.cs | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 FireBase/Query/AuthQuery.cs (limited to 'FireBase/Query/AuthQuery.cs') diff --git a/FireBase/Query/AuthQuery.cs b/FireBase/Query/AuthQuery.cs new file mode 100644 index 0000000..8a8d3e8 --- /dev/null +++ b/FireBase/Query/AuthQuery.cs @@ -0,0 +1,33 @@ +namespace Firebase.Database.Query +{ + using System; + + /// + /// Represents an auth parameter in firebase query, e.g. "?auth=xyz". + /// + public class AuthQuery : ParameterQuery + { + private readonly Func tokenFactory; + + /// + /// Initializes a new instance of the class. + /// + /// The parent. + /// The authentication token factory. + /// The owner. + public AuthQuery(FirebaseQuery parent, Func tokenFactory, FirebaseClient client) : base(parent, () => client.Options.AsAccessToken ? "access_token" : "auth", client) + { + this.tokenFactory = tokenFactory; + } + + /// + /// Build the url parameter value of this child. + /// + /// The child of this child. + /// The . + protected override string BuildUrlParameter(FirebaseQuery child) + { + return this.tokenFactory(); + } + } +} -- cgit v1.2.3-70-g09d2