diff --git a/Bynder/Api/Settings.cs b/Bynder/Api/Settings.cs index 9776d8d..0a45069 100644 --- a/Bynder/Api/Settings.cs +++ b/Bynder/Api/Settings.cs @@ -1,6 +1,9 @@ -// Copyright (c) Bynder. All rights reserved. +// Copyright (c) Bynder. All rights reserved. // Licensed under the MIT License. See LICENSE file in the project root for full license information. +using Newtonsoft.Json; +using System.IO; + namespace Bynder.Api { /// @@ -11,26 +14,41 @@ public class Settings /// /// Oauth Consumer key /// + [JsonProperty("consumer_key")] public string CONSUMER_KEY { get; set; } /// /// Oauth Consumer secret /// + [JsonProperty("consumer_secret")] public string CONSUMER_SECRET { get; set; } /// - /// Oauth token + /// Oauth token /// + [JsonProperty("token")] public string TOKEN { get; set; } /// - /// Oauth secret + /// Oauth secret /// + [JsonProperty("token_secret")] public string TOKEN_SECRET { get; set; } /// /// Bynder domain Url we want to communicate with /// + [JsonProperty("api_base_url")] public string URL { get; set; } + + /// + /// Create a using the given filepath + /// + /// JSON file path + /// instance + public static Settings FromJson(string filepath) + { + return JsonConvert.DeserializeObject(File.ReadAllText(filepath)); + } } }