From ce78f056931b9b1a631d90885475474ba64a355c Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Thu, 22 Dec 2016 11:01:24 -0700 Subject: [PATCH 01/93] Added folder for entities (classes) --- BrightLocal/src/BrightLocal/Entities/Clients.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 BrightLocal/src/BrightLocal/Entities/Clients.cs diff --git a/BrightLocal/src/BrightLocal/Entities/Clients.cs b/BrightLocal/src/BrightLocal/Entities/Clients.cs new file mode 100644 index 0000000..a3058e5 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Entities/Clients.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace BrightLocal.Entities +{ + public class Clients + { + } +} From 62eb5e224213983c37ee7e03921ae271040d0c74 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Thu, 22 Dec 2016 15:30:56 -0700 Subject: [PATCH 02/93] createds BLService base class and client entity --- .../src/BrightLocal/BrightLocalService.cs | 20 +++++++++++++++++++ .../BrightLocal/Entities/BrightLocalClient.cs | 18 +++++++++++++++++ .../Clients/ClientService.cs} | 4 ++-- 3 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 BrightLocal/src/BrightLocal/BrightLocalService.cs create mode 100644 BrightLocal/src/BrightLocal/Entities/BrightLocalClient.cs rename BrightLocal/src/BrightLocal/{Entities/Clients.cs => Services/Clients/ClientService.cs} (65%) diff --git a/BrightLocal/src/BrightLocal/BrightLocalService.cs b/BrightLocal/src/BrightLocal/BrightLocalService.cs new file mode 100644 index 0000000..d75fb50 --- /dev/null +++ b/BrightLocal/src/BrightLocal/BrightLocalService.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace BrightLocal +{ + public abstract class BrightLocalService + { + // Decalre Variables + private string api_key; + private string api_secret; + + protected BrightLocalService(string key, string secret) + { + api_key = key; + api_secret = secret; + } + } +} diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalClient.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalClient.cs new file mode 100644 index 0000000..6e08660 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalClient.cs @@ -0,0 +1,18 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace BrightLocal.Entities +{ + public class BrightLocalClient + { + [JsonProperty("name")] + public string name { get; set; } + [JsonProperty("company-url")] + public string companyUrl { get; set; } + [JsonProperty("business-category-id")] + public int businessCategoryId { get; set; } + } +} diff --git a/BrightLocal/src/BrightLocal/Entities/Clients.cs b/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs similarity index 65% rename from BrightLocal/src/BrightLocal/Entities/Clients.cs rename to BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs index a3058e5..8e1a782 100644 --- a/BrightLocal/src/BrightLocal/Entities/Clients.cs +++ b/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs @@ -3,9 +3,9 @@ using System.Linq; using System.Threading.Tasks; -namespace BrightLocal.Entities +namespace BrightLocal.Services { - public class Clients + public class ClientService { } } From 1a53fa735ecce89cb85394b7c1846d31d37e0570 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Thu, 22 Dec 2016 15:39:32 -0700 Subject: [PATCH 03/93] added base class containing Id property --- .../src/BrightLocal/Entities/Base/EntityWithId.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 BrightLocal/src/BrightLocal/Entities/Base/EntityWithId.cs diff --git a/BrightLocal/src/BrightLocal/Entities/Base/EntityWithId.cs b/BrightLocal/src/BrightLocal/Entities/Base/EntityWithId.cs new file mode 100644 index 0000000..e83691d --- /dev/null +++ b/BrightLocal/src/BrightLocal/Entities/Base/EntityWithId.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace BrightLocal.Entities.Base +{ + public class EntityWithId + { + public string id { get; set; } + } +} From 2ef84b337b61a57b04572cd4660255b56cab8067 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Sun, 25 Dec 2016 14:37:40 -0700 Subject: [PATCH 04/93] Added Service and request objects --- .../src/BrightLocal/BrightLocalService.cs | 2 +- .../BrightLocalConfiguration.cs | 33 ++++ .../Infrastructure/BrightLocalRequestor.cs | 143 ++++++++++++++++++ .../src/BrightLocal/Infrastructure/Urls.cs | 13 ++ .../Services/Clients/ClientService.cs | 5 +- BrightLocal/src/BrightLocal/project.json | 12 +- 6 files changed, 196 insertions(+), 12 deletions(-) create mode 100644 BrightLocal/src/BrightLocal/Infrastructure/BrightLocalConfiguration.cs create mode 100644 BrightLocal/src/BrightLocal/Infrastructure/BrightLocalRequestor.cs create mode 100644 BrightLocal/src/BrightLocal/Infrastructure/Urls.cs diff --git a/BrightLocal/src/BrightLocal/BrightLocalService.cs b/BrightLocal/src/BrightLocal/BrightLocalService.cs index d75fb50..c0ef0a2 100644 --- a/BrightLocal/src/BrightLocal/BrightLocalService.cs +++ b/BrightLocal/src/BrightLocal/BrightLocalService.cs @@ -11,7 +11,7 @@ public abstract class BrightLocalService private string api_key; private string api_secret; - protected BrightLocalService(string key, string secret) + internal BrightLocalService(string key, string secret) { api_key = key; api_secret = secret; diff --git a/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalConfiguration.cs b/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalConfiguration.cs new file mode 100644 index 0000000..741f5c8 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalConfiguration.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Configuration; + +namespace BrightLocal.Infrastructure +{ + public class BrightLocalConfiguration + { + // Decalre Variables + private static string api_key; + private static string api_secret; + + public static string GetApiKey() + { + api_key = ConfigurationManager.AppSettings["BrightLocalApiKey"]; + return api_key; + } + + public static string GetApiSecret() + { + api_secret = ConfigurationManager.AppSettings["BrightLocalApiSecret"]; + return api_secret; + } + + public static void SetApiCreds(string newApiKey, string newApiSecret) + { + api_key = newApiKey; + api_secret = newApiSecret; + } + } +} diff --git a/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalRequestor.cs b/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalRequestor.cs new file mode 100644 index 0000000..2ab0752 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalRequestor.cs @@ -0,0 +1,143 @@ +using RestSharp; +using RestSharp.Extensions.MonoHttp; +using System; +using System.Collections.Generic; +using System.Dynamic; +using System.Linq; +using System.Security.Cryptography; +using System.Threading.Tasks; + +namespace BrightLocal.Infrastructure +{ + public class BrightLocalRequestor + { + private static readonly System.Uri baseUrl = new System.Uri(Urls.BaseUrl); + + // create an instance of restsharp client + RestClient client = new RestClient(); + + + // Create base 64 sha1 encrypted signature + private static string CreateSig(string apiKey, string secretKey, double expires) + { + var encoding = new System.Text.ASCIIEncoding(); + byte[] keyByte = encoding.GetBytes(secretKey); + byte[] messageBytes = encoding.GetBytes(apiKey + expires); + using (var hmacsha1 = new HMACSHA1(keyByte)) + { + byte[] hashmessage = hmacsha1.ComputeHash(messageBytes); + var signature = Convert.ToBase64String(hashmessage); + var sig = HttpUtility.UrlEncode(signature); + return signature; + } + + } + + // Create expires paramater for signature and api requests + private static double CreateExpiresParameter() + { + DateTime date = DateTime.Now; + DateTime origin = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc); // The seconds since the Unix Epoch (January 1 1970 00:00:00 GMT) + TimeSpan diff = date.ToUniversalTime() - origin; // Subtract the seconds since the Unix Epoch from today's date. + return Math.Floor(diff.TotalSeconds + 1800); // Not more than 1800 seconds + } + + // Function that creates and sends the actual request. + public IRestResponse Call(Method method, string endPoint, Dictionary apiParameters) + { + + // create sxpires variable + var expires = CreateExpiresParameter(); + // set base url + client.BaseUrl = baseUrl; + // Generate encoded signature + var sig = CreateSig(BrightLocalConfiguration.GetApiKey(), BrightLocalConfiguration.GetApiSecret(), expires); + // Generate the request + var request = GetApiRequest(method, endPoint, BrightLocalConfiguration.GetApiKey(), sig, expires, apiParameters); + // execure the request + var response = client.Execute(request); + // check for a succesful response from server + if (response.ResponseStatus != ResponseStatus.Completed) + { + throw new ApplicationException(response.ErrorMessage); + } + + return response; + + + } + + // Methods for post, put, get, delete + public IRestResponse Post(string endPoint, Dictionary apiParameters) + { + Method method = Method.POST; + return Call(method, endPoint, apiParameters); + } + + public IRestResponse Put(string endPoint, Dictionary apiParameters) + { + Method method = Method.PUT; + return Call(method, endPoint, apiParameters); + } + + public IRestResponse Get(string endPoint, Dictionary apiParameters) + { + Method method = Method.GET; + return Call(method, endPoint, apiParameters); + } + + public IRestResponse Delete(string endPoint, Dictionary apiParameters) + { + Method method = Method.DELETE; + return Call(method, endPoint, apiParameters); + } + + + private static RestRequest GetApiRequest(Method method, string url, string api_key, string sig, double expires, Dictionary apiParameters) + { + // Create a new restsharp request + RestRequest request = new RestRequest(url, method); + // Add appropriate headers to request + request.AddHeader("Content-Type", "application/json"); + request.AddHeader("Accept", "application/json"); + + // Add key, sig and expires to request + request.AddParameter("api-key", api_key); + request.AddParameter("sig", sig); + request.AddParameter("expires", expires); + + // Loop through the parameters passed in as a dictionary and add each one to a dynamic object + var eo = new ExpandoObject(); + var eoColl = (ICollection>)eo; + foreach (var kvp in apiParameters) + { + eoColl.Add(kvp); + } + dynamic eoDynamic = eo; + + // Add each parameter to restsharp request + foreach (var prop in eoDynamic) + { + request.AddParameter(prop.Key, prop.Value); + } + + return request; + + } + + // api class contructor + public api(string key, string secret) + { + api_key = key; + api_secret = secret; + + } + + public class Parameters : Dictionary + { + + } + + + } +} diff --git a/BrightLocal/src/BrightLocal/Infrastructure/Urls.cs b/BrightLocal/src/BrightLocal/Infrastructure/Urls.cs new file mode 100644 index 0000000..0a83ccc --- /dev/null +++ b/BrightLocal/src/BrightLocal/Infrastructure/Urls.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace BrightLocal.Infrastructure +{ + internal static class Urls + { + internal static string BaseUrl => "https://tools.brightlocal.com/seo-tools/api"; + internal static string Clients => BaseUrl + "/v1/clients-and-locations/clients/"; + } +} diff --git a/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs b/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs index 8e1a782..84187a4 100644 --- a/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs +++ b/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs @@ -5,7 +5,10 @@ namespace BrightLocal.Services { - public class ClientService + public class ClientService : BrightLocalService { + public ClientService(string apiKey = null, string apiSecret = null) : base(apiKey, apiSecret) { } + + } } diff --git a/BrightLocal/src/BrightLocal/project.json b/BrightLocal/src/BrightLocal/project.json index 188b698..9e64f08 100644 --- a/BrightLocal/src/BrightLocal/project.json +++ b/BrightLocal/src/BrightLocal/project.json @@ -1,4 +1,4 @@ -{ +{ "version": "1.0.0-*", "id": "BrightLocal", "description": "A c# wrapper class for consuming The Bright Local api. Automatically generates the proper authentication, with the siganture and expires parameter. Avoid the need to generate your own authentication signature. See documentation for examples.", @@ -8,20 +8,12 @@ }, "frameworks": { - - "net451": { - "dependencies": { - "RestSharp": "105.2.3" - }, - "frameworkAssemblies": { - "System.Web": "4.0.0.0" - } - }, "net45": { "dependencies": { "RestSharp": "105.2.3" }, "frameworkAssemblies": { + "System.Configuration": "4.0.0.0", "System.Web": "4.0.0.0" } } From 3682db5d6003f72dfcf34d465f7ee62fb25270a3 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Mon, 26 Dec 2016 10:34:23 -0700 Subject: [PATCH 05/93] added parameter function, clientOptions class and a requestor service --- .../BrightLocal/Entities/BrightLocalClient.cs | 8 +++-- .../BrightLocalConfiguration.cs | 10 ++++-- .../Infrastructure/BrightLocalRequestor.cs | 35 +++++++++---------- .../Services/Clients/ClientOptions.cs | 18 ++++++++++ .../Services/Clients/ClientService.cs | 14 ++++++-- .../src/BrightLocal/Services/Parameters.cs | 33 +++++++++++++++++ 6 files changed, 93 insertions(+), 25 deletions(-) create mode 100644 BrightLocal/src/BrightLocal/Services/Clients/ClientOptions.cs create mode 100644 BrightLocal/src/BrightLocal/Services/Parameters.cs diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalClient.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalClient.cs index 6e08660..7fe2bc9 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalClient.cs +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalClient.cs @@ -8,8 +8,12 @@ namespace BrightLocal.Entities { public class BrightLocalClient { - [JsonProperty("name")] - public string name { get; set; } + [JsonProperty("client-id")] + public int clientId { get; set; } + [JsonProperty("succecss")] + public bool success { get; set; } + [JsonProperty("company-name")] + public string companyName { get; set; } [JsonProperty("company-url")] public string companyUrl { get; set; } [JsonProperty("business-category-id")] diff --git a/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalConfiguration.cs b/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalConfiguration.cs index 741f5c8..d0da5b6 100644 --- a/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalConfiguration.cs +++ b/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalConfiguration.cs @@ -14,13 +14,19 @@ public class BrightLocalConfiguration public static string GetApiKey() { - api_key = ConfigurationManager.AppSettings["BrightLocalApiKey"]; + if (string.IsNullOrEmpty(api_key)) + { + api_key = ConfigurationManager.AppSettings["BrightLocalApiKey"]; + } return api_key; } public static string GetApiSecret() { - api_secret = ConfigurationManager.AppSettings["BrightLocalApiSecret"]; + if (string.IsNullOrEmpty(api_secret)) + { + api_secret = ConfigurationManager.AppSettings["BrightLocalApiSecret"]; + } return api_secret; } diff --git a/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalRequestor.cs b/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalRequestor.cs index 2ab0752..e2c1a81 100644 --- a/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalRequestor.cs +++ b/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalRequestor.cs @@ -1,4 +1,5 @@ -using RestSharp; +using Newtonsoft.Json; +using RestSharp; using RestSharp.Extensions.MonoHttp; using System; using System.Collections.Generic; @@ -61,10 +62,21 @@ public IRestResponse Call(Method method, string endPoint, Dictionary - { - - } - - } } diff --git a/BrightLocal/src/BrightLocal/Services/Clients/ClientOptions.cs b/BrightLocal/src/BrightLocal/Services/Clients/ClientOptions.cs new file mode 100644 index 0000000..a9ac524 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Services/Clients/ClientOptions.cs @@ -0,0 +1,18 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace BrightLocal.Services.Clients +{ + public class ClientOptions + { + [JsonProperty("name")] + public string name { get; set; } + [JsonProperty("company-url")] + public string companyUrl { get; set; } + [JsonProperty("business-category-id")] + public int businessCategoryId { get; set; } + } +} diff --git a/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs b/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs index 84187a4..cce8c64 100644 --- a/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs +++ b/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs @@ -1,4 +1,8 @@ -using System; +using BrightLocal.Entities; +using BrightLocal.Infrastructure; +using BrightLocal.Services.Clients; +using Newtonsoft.Json; +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; @@ -9,6 +13,12 @@ public class ClientService : BrightLocalService { public ClientService(string apiKey = null, string apiSecret = null) : base(apiKey, apiSecret) { } - + BrightLocalRequestor request = new BrightLocalRequestor(); + public virtual BrightLocalClient Create(ClientOptions createOptions) + { + var parameters = Parameters.convertListToParameters(createOptions); + var success = request.Post(Urls.Clients, parameters); + return JsonConvert.DeserializeObject(success.Content); + } } } diff --git a/BrightLocal/src/BrightLocal/Services/Parameters.cs b/BrightLocal/src/BrightLocal/Services/Parameters.cs new file mode 100644 index 0000000..b9648dc --- /dev/null +++ b/BrightLocal/src/BrightLocal/Services/Parameters.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Threading.Tasks; + +namespace BrightLocal.Services +{ + public class Parameters + { + public static requestParameters convertListToParameters(Object item) + { + var parameters = new requestParameters(); + foreach (var directoryinfo in item.GetType().GetProperties()) + { + foreach (CustomAttributeData att in directoryinfo.CustomAttributes) + { + foreach (CustomAttributeTypedArgument arg in att.ConstructorArguments) + { + parameters.Add(arg.Value.ToString(), directoryinfo.GetValue(item, null)); + + } + } + } + return parameters; + } + + public class requestParameters : Dictionary + { + + } + } +} From b549ad733e21e4b973e278abdeedc13ab5e7821b Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Mon, 26 Dec 2016 10:42:12 -0700 Subject: [PATCH 06/93] Added example for creating a client --- .../Account-Methods/clientExamples.cs | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs new file mode 100644 index 0000000..38a81fc --- /dev/null +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs @@ -0,0 +1,24 @@ +using BrightLocal.Entities; +using BrightLocal.Services; +using BrightLocal.Services.Clients; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace BrightLocal.Examples_version2.Account_Methods +{ + public class clientExamples + { + public static BrightLocalClient Create() + { + var myClient = new ClientOptions(); + myClient.name = "Le Bernardin"; + myClient.companyUrl = "le-bernardin.com"; + myClient.businessCategoryId = 791; + + var clientService = new ClientService(); + return clientService.Create(myClient); + } + } +} From 7b9cce7cd19399dc1a9c384ea6816c1fbb4d737a Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Mon, 26 Dec 2016 10:46:31 -0700 Subject: [PATCH 07/93] adjusted syntax for return type --- .../Examples-version2/Account-Methods/clientExamples.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs index 38a81fc..b488540 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs @@ -18,7 +18,9 @@ public static BrightLocalClient Create() myClient.businessCategoryId = 791; var clientService = new ClientService(); - return clientService.Create(myClient); + + BrightLocalClient newClient = clientService.Create(myClient); + return newClient; } } } From c7270d3c4d0e0a99369a97115675cea4bd26af99 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Mon, 26 Dec 2016 10:51:41 -0700 Subject: [PATCH 08/93] added method and example for updating a client --- .../Account-Methods/clientExamples.cs | 14 +++++++++++++ .../Services/Clients/ClientService.cs | 7 +++++++ .../Services/Clients/UpdateClientOptions.cs | 20 +++++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 BrightLocal/src/BrightLocal/Services/Clients/UpdateClientOptions.cs diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs index b488540..8cb28ab 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs @@ -22,5 +22,19 @@ public static BrightLocalClient Create() BrightLocalClient newClient = clientService.Create(myClient); return newClient; } + + public static BrightLocalClient Update() + { + var myClient = new UpdateClientOptions(); + myClient.clientId = 36447; + myClient.name = "Le Bernardin"; + myClient.companyUrl = "le-bernardin.com"; + myClient.businessCategoryId = 791; + + var clientService = new ClientService(); + + BrightLocalClient updateClient = clientService.Update(myClient); + return updateClient; + } } } diff --git a/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs b/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs index cce8c64..a8518c0 100644 --- a/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs +++ b/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs @@ -20,5 +20,12 @@ public virtual BrightLocalClient Create(ClientOptions createOptions) var success = request.Post(Urls.Clients, parameters); return JsonConvert.DeserializeObject(success.Content); } + + public virtual BrightLocalClient Update(UpdateClientOptions updateOptions) + { + var parameters = Parameters.convertListToParameters(updateOptions); + var success = request.Put(Urls.Clients, parameters); + return JsonConvert.DeserializeObject(success.Content); + } } } diff --git a/BrightLocal/src/BrightLocal/Services/Clients/UpdateClientOptions.cs b/BrightLocal/src/BrightLocal/Services/Clients/UpdateClientOptions.cs new file mode 100644 index 0000000..f55a616 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Services/Clients/UpdateClientOptions.cs @@ -0,0 +1,20 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace BrightLocal.Services.Clients +{ + public class UpdateClientOptions + { + [JsonProperty("client-id")] + public int clientId { get; set; } + [JsonProperty("name")] + public string name { get; set; } + [JsonProperty("company-url")] + public string companyUrl { get; set; } + [JsonProperty("business-category-id")] + public int businessCategoryId { get; set; } + } +} From 7b687f8f7b7241c6dd3205c327d2bec962a23d79 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Tue, 27 Dec 2016 13:09:57 -0700 Subject: [PATCH 09/93] Fixed services constructure for authenticating with api key and secret. There are now two ways a user can enter their api credentials. They can be added as keys in web.config or they can be added in any service initialization. Details will be in docs. --- .../src/BrightLocal/BrightLocalService.cs | 19 +++----- .../BrightLocal/Entities/Base/EntityWithId.cs | 2 +- .../BrightLocal/Entities/BrightLocalClient.cs | 2 +- .../Account-Methods/clientExamples.cs | 32 +++++++++++-- .../BrightLocalConfiguration.cs | 8 ++-- .../Infrastructure/BrightLocalRequestor.cs | 40 ++++++++-------- .../ObjectToDictionaryHelper.cs | 44 +++++++++++++++++ .../src/BrightLocal/Infrastructure/Urls.cs | 5 +- .../Services/Clients/ClientOptions.cs | 2 +- .../Services/Clients/ClientService.cs | 47 +++++++++++++++---- .../Services/Clients/UpdateClientOptions.cs | 2 +- .../src/BrightLocal/Services/Parameters.cs | 2 +- BrightLocal/src/BrightLocal/project.json | 12 ++++- 13 files changed, 159 insertions(+), 58 deletions(-) create mode 100644 BrightLocal/src/BrightLocal/Infrastructure/ObjectToDictionaryHelper.cs diff --git a/BrightLocal/src/BrightLocal/BrightLocalService.cs b/BrightLocal/src/BrightLocal/BrightLocalService.cs index c0ef0a2..5d8bb51 100644 --- a/BrightLocal/src/BrightLocal/BrightLocalService.cs +++ b/BrightLocal/src/BrightLocal/BrightLocalService.cs @@ -1,20 +1,15 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace BrightLocal +namespace BrightLocal { - public abstract class BrightLocalService + public class BrightLocalService { // Decalre Variables - private string api_key; - private string api_secret; + public string api_key; + public string api_secret; - internal BrightLocalService(string key, string secret) + protected BrightLocalService(string apiKey, string apiSecret) { - api_key = key; - api_secret = secret; + api_key = apiKey; + api_secret = apiSecret; } } } diff --git a/BrightLocal/src/BrightLocal/Entities/Base/EntityWithId.cs b/BrightLocal/src/BrightLocal/Entities/Base/EntityWithId.cs index e83691d..43f2dfd 100644 --- a/BrightLocal/src/BrightLocal/Entities/Base/EntityWithId.cs +++ b/BrightLocal/src/BrightLocal/Entities/Base/EntityWithId.cs @@ -3,7 +3,7 @@ using System.Linq; using System.Threading.Tasks; -namespace BrightLocal.Entities.Base +namespace BrightLocal { public class EntityWithId { diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalClient.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalClient.cs index 7fe2bc9..968c6f0 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalClient.cs +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalClient.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Threading.Tasks; -namespace BrightLocal.Entities +namespace BrightLocal { public class BrightLocalClient { diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs index 8cb28ab..ffa844e 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs @@ -1,7 +1,4 @@ -using BrightLocal.Entities; -using BrightLocal.Services; -using BrightLocal.Services.Clients; -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; @@ -36,5 +33,32 @@ public static BrightLocalClient Update() BrightLocalClient updateClient = clientService.Update(myClient); return updateClient; } + + public static BrightLocalClient Delete() + { + var clientId = 1; + var clientService = new ClientService(); + + BrightLocalClient deleteClient = clientService.Delete(clientId); + return deleteClient; + } + + public static BrightLocalClient Get() + { + var clientId = 1; + var clientService = new ClientService(); + + BrightLocalClient client = clientService.Get(clientId); + return client; + } + + public static List Search() + { + var searchQuery = "le-bernardin"; + var clientService = new ClientService(); + + var results = clientService.Search(searchQuery); + return results; + } } } diff --git a/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalConfiguration.cs b/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalConfiguration.cs index d0da5b6..d997455 100644 --- a/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalConfiguration.cs +++ b/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalConfiguration.cs @@ -4,15 +4,15 @@ using System.Threading.Tasks; using System.Configuration; -namespace BrightLocal.Infrastructure +namespace BrightLocal { - public class BrightLocalConfiguration + public static class BrightLocalConfiguration { // Decalre Variables private static string api_key; private static string api_secret; - public static string GetApiKey() + internal static string GetApiKey() { if (string.IsNullOrEmpty(api_key)) { @@ -21,7 +21,7 @@ public static string GetApiKey() return api_key; } - public static string GetApiSecret() + internal static string GetApiSecret() { if (string.IsNullOrEmpty(api_secret)) { diff --git a/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalRequestor.cs b/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalRequestor.cs index e2c1a81..9436980 100644 --- a/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalRequestor.cs +++ b/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalRequestor.cs @@ -8,12 +8,12 @@ using System.Security.Cryptography; using System.Threading.Tasks; -namespace BrightLocal.Infrastructure +namespace BrightLocal { public class BrightLocalRequestor { private static readonly System.Uri baseUrl = new System.Uri(Urls.BaseUrl); - + // create an instance of restsharp client RestClient client = new RestClient(); @@ -43,29 +43,27 @@ private static double CreateExpiresParameter() return Math.Floor(diff.TotalSeconds + 1800); // Not more than 1800 seconds } + // Function that creates and sends the actual request. - public IRestResponse Call(Method method, string endPoint, Dictionary apiParameters) + public IRestResponse Call(Method method, string endPoint, Dictionary apiParameters, string apiKey, string apiSecret) { - + apiKey = apiKey ?? BrightLocalConfiguration.GetApiKey(); + apiSecret = apiSecret ?? BrightLocalConfiguration.GetApiSecret(); // create sxpires variable var expires = CreateExpiresParameter(); // set base url client.BaseUrl = baseUrl; // Generate encoded signature - var sig = CreateSig(BrightLocalConfiguration.GetApiKey(), BrightLocalConfiguration.GetApiSecret(), expires); + var sig = CreateSig(apiKey, apiSecret, expires); // Generate the request - var request = GetApiRequest(method, endPoint, BrightLocalConfiguration.GetApiKey(), sig, expires, apiParameters); + var request = GetApiRequest(method, endPoint, apiKey, sig, expires, apiParameters); // execure the request var response = client.Execute(request); // check for a succesful response from server - if (response.ResponseStatus != ResponseStatus.Completed) - { - throw new ApplicationException(response.ErrorMessage); - } if (response.ResponseStatus == ResponseStatus.Completed) { dynamic result = JsonConvert.DeserializeObject(response.Content); - if (!result.success) + if (result.success != "true") { string message = "Error adding job"; var batchException = new ApplicationException(message + result.errors, result.ErrorException); @@ -80,31 +78,30 @@ public IRestResponse Call(Method method, string endPoint, Dictionary apiParameters) + public IRestResponse Post(string endPoint, Dictionary apiParameters, string apiKey, string apiSecret) { Method method = Method.POST; - return Call(method, endPoint, apiParameters); + return Call(method, endPoint, apiParameters, apiKey, apiSecret); } - public IRestResponse Put(string endPoint, Dictionary apiParameters) + public IRestResponse Put(string endPoint, Dictionary apiParameters, string apiKey, string apiSecret) { Method method = Method.PUT; - return Call(method, endPoint, apiParameters); + return Call(method, endPoint, apiParameters, apiKey, apiSecret); } - public IRestResponse Get(string endPoint, Dictionary apiParameters) + public IRestResponse Get(string endPoint, Dictionary apiParameters, string apiKey, string apiSecret) { Method method = Method.GET; - return Call(method, endPoint, apiParameters); + return Call(method, endPoint, apiParameters, apiKey, apiSecret); } - public IRestResponse Delete(string endPoint, Dictionary apiParameters) + public IRestResponse Delete(string endPoint, Dictionary apiParameters, string apiKey, string apiSecret) { Method method = Method.DELETE; - return Call(method, endPoint, apiParameters); + return Call(method, endPoint, apiParameters, apiKey, apiSecret); } - - + private static RestRequest GetApiRequest(Method method, string url, string api_key, string sig, double expires, Dictionary apiParameters) { // Create a new restsharp request @@ -136,5 +133,6 @@ private static RestRequest GetApiRequest(Method method, string url, string api_k return request; } + } } diff --git a/BrightLocal/src/BrightLocal/Infrastructure/ObjectToDictionaryHelper.cs b/BrightLocal/src/BrightLocal/Infrastructure/ObjectToDictionaryHelper.cs new file mode 100644 index 0000000..7b30426 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Infrastructure/ObjectToDictionaryHelper.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Threading.Tasks; + +namespace BrightLocal +{ + public static class ObjectToDictionaryHelper + { + public static Dictionary ToDictionary(this object source) + { + return source.ToDictionary(); + } + + public static Dictionary ToDictionary(this object source) + { + if (source == null) + ThrowExceptionWhenSourceArgumentIsNull(); + + var dictionary = new Dictionary(); + foreach (PropertyDescriptor property in TypeDescriptor.GetProperties(source)) + AddPropertyToDictionary(property, source, dictionary); + return dictionary; + } + + private static void AddPropertyToDictionary(PropertyDescriptor property, object source, Dictionary dictionary) + { + object value = property.GetValue(source); + if (IsOfType(value)) + dictionary.Add(property.Name, (T)value); + } + + private static bool IsOfType(object value) + { + return value is T; + } + + private static void ThrowExceptionWhenSourceArgumentIsNull() + { + throw new ArgumentNullException("source", "Unable to convert object to a dictionary. The source object is null."); + } + } +} diff --git a/BrightLocal/src/BrightLocal/Infrastructure/Urls.cs b/BrightLocal/src/BrightLocal/Infrastructure/Urls.cs index 0a83ccc..90058f6 100644 --- a/BrightLocal/src/BrightLocal/Infrastructure/Urls.cs +++ b/BrightLocal/src/BrightLocal/Infrastructure/Urls.cs @@ -3,11 +3,12 @@ using System.Linq; using System.Threading.Tasks; -namespace BrightLocal.Infrastructure +namespace BrightLocal { internal static class Urls { internal static string BaseUrl => "https://tools.brightlocal.com/seo-tools/api"; - internal static string Clients => BaseUrl + "/v1/clients-and-locations/clients/"; + internal static string Clients => "/v1/clients-and-locations/clients/"; + } } diff --git a/BrightLocal/src/BrightLocal/Services/Clients/ClientOptions.cs b/BrightLocal/src/BrightLocal/Services/Clients/ClientOptions.cs index a9ac524..a9050c1 100644 --- a/BrightLocal/src/BrightLocal/Services/Clients/ClientOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/Clients/ClientOptions.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Threading.Tasks; -namespace BrightLocal.Services.Clients +namespace BrightLocal { public class ClientOptions { diff --git a/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs b/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs index a8518c0..2597a46 100644 --- a/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs +++ b/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs @@ -1,31 +1,62 @@ -using BrightLocal.Entities; -using BrightLocal.Infrastructure; -using BrightLocal.Services.Clients; + using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -namespace BrightLocal.Services +namespace BrightLocal { public class ClientService : BrightLocalService { - public ClientService(string apiKey = null, string apiSecret = null) : base(apiKey, apiSecret) { } + public ClientService(string apiKey = null, string apiSecret = null) : base(apiKey, apiSecret) { } + + + BrightLocalRequestor request = new BrightLocalRequestor(); - BrightLocalRequestor request = new BrightLocalRequestor(); public virtual BrightLocalClient Create(ClientOptions createOptions) { var parameters = Parameters.convertListToParameters(createOptions); - var success = request.Post(Urls.Clients, parameters); + var success = request.Post(Urls.Clients, parameters, this.api_key, this.api_secret); return JsonConvert.DeserializeObject(success.Content); } public virtual BrightLocalClient Update(UpdateClientOptions updateOptions) { var parameters = Parameters.convertListToParameters(updateOptions); - var success = request.Put(Urls.Clients, parameters); + var success = request.Put(Urls.Clients, parameters, this.api_key, this.api_secret); return JsonConvert.DeserializeObject(success.Content); } + + public virtual BrightLocalClient Delete(int clientId) + { + var parameters = new Parameters.requestParameters(); + parameters.Add("client-id", clientId); + var success = request.Delete(Urls.Clients, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual BrightLocalClient Get(int clientId) + { + var url = string.Format(Urls.Clients + "/{0}", clientId); + var parameters = new Parameters.requestParameters(); + var success = request.Get(url, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual List Search(string query) + { + var url = string.Format(Urls.Clients + "/search"); + var parameters = new Parameters.requestParameters(); + parameters.Add("q", query); + var results = request.Get(url, parameters, this.api_key, this.api_secret); + + List clients = new List(); + foreach (var client in results.Content[0].ToString()) + { + clients.Add(JsonConvert.DeserializeObject(client.ToString())); + } + return clients; + } } } diff --git a/BrightLocal/src/BrightLocal/Services/Clients/UpdateClientOptions.cs b/BrightLocal/src/BrightLocal/Services/Clients/UpdateClientOptions.cs index f55a616..208a570 100644 --- a/BrightLocal/src/BrightLocal/Services/Clients/UpdateClientOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/Clients/UpdateClientOptions.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Threading.Tasks; -namespace BrightLocal.Services.Clients +namespace BrightLocal { public class UpdateClientOptions { diff --git a/BrightLocal/src/BrightLocal/Services/Parameters.cs b/BrightLocal/src/BrightLocal/Services/Parameters.cs index b9648dc..4a6ca45 100644 --- a/BrightLocal/src/BrightLocal/Services/Parameters.cs +++ b/BrightLocal/src/BrightLocal/Services/Parameters.cs @@ -4,7 +4,7 @@ using System.Reflection; using System.Threading.Tasks; -namespace BrightLocal.Services +namespace BrightLocal { public class Parameters { diff --git a/BrightLocal/src/BrightLocal/project.json b/BrightLocal/src/BrightLocal/project.json index 9e64f08..7558eb8 100644 --- a/BrightLocal/src/BrightLocal/project.json +++ b/BrightLocal/src/BrightLocal/project.json @@ -1,13 +1,21 @@ { - "version": "1.0.0-*", + "version": "2.0.0-*", "id": "BrightLocal", "description": "A c# wrapper class for consuming The Bright Local api. Automatically generates the proper authentication, with the siganture and expires parameter. Avoid the need to generate your own authentication signature. See documentation for examples.", "dependencies": { "Newtonsoft.Json": "9.0.1" - }, "frameworks": { + "net452": { + "dependencies": { + "RestSharp": "105.2.3" + }, + "frameworkAssemblies": { + "System.Configuration": "4.0.0.0", + "System.Web": "4.0.0.0" + } + }, "net45": { "dependencies": { "RestSharp": "105.2.3" From 03c9e98ba58cd58ce92a275263257c352112aba5 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Wed, 28 Dec 2016 14:58:39 -0700 Subject: [PATCH 10/93] Added readme for version 2 of c# wrapper --- .../BrightLocalConfiguration.cs | 2 +- Documentation/README.md | 27 ++++++ README.md | 84 ++++++++++++++----- 3 files changed, 93 insertions(+), 20 deletions(-) create mode 100644 Documentation/README.md diff --git a/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalConfiguration.cs b/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalConfiguration.cs index d997455..6cd5d92 100644 --- a/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalConfiguration.cs +++ b/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalConfiguration.cs @@ -30,7 +30,7 @@ internal static string GetApiSecret() return api_secret; } - public static void SetApiCreds(string newApiKey, string newApiSecret) + public static void SetApiCredentials(string newApiKey, string newApiSecret) { api_key = newApiKey; api_secret = newApiSecret; diff --git a/Documentation/README.md b/Documentation/README.md new file mode 100644 index 0000000..b33dde6 --- /dev/null +++ b/Documentation/README.md @@ -0,0 +1,27 @@ +# BrightLocal-Api-C-Sharp-Wrapper +Bright Local Api C# Wrapper + +A c# wrapper class for consuming The Bright Local api. Automatically generates the proper authentication, with the siganture and expires. Avoid the need to generate your own authentication signature. + + +## Documentation + +1. [Installation](Documentation/INSTALLATION.md) + +### Account Methods + +2. [Client Examples](Documentation/CLIENTS.md) +3. [Location Examples](Documentation/LOCATIONS.md) +4. [Local Search Rank Checker Examples](Documentation/LSRC.md) +5. [Local SEO Check-up Examples](Documentation/LSCU.md) +6. [Citation Tracker Examples](Documentation/CT.md) +7. [Citation Burst Examples](Documentation/CB.md) +8. [ReviewFlow Reports Examples](Documentation/RF.md) +9. [Google+ Local Wizard Reports Examples](Documentation/GPW.md) + +### Batch Methods + +10. [Rankings Examples](Documentation/RANKINGS.md) +11. [Local Directories Examples](Documentation/LOCAL-DIRECTORIES.md) +12. [Reviews Examples](Documentation/REVIEWS.md) +13. [Offsite SEO & Social PRofiles Examples](Documentation/OFFSITE&SP.md) \ No newline at end of file diff --git a/README.md b/README.md index b33dde6..dc64186 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,73 @@ -# BrightLocal-Api-C-Sharp-Wrapper -Bright Local Api C# Wrapper +![BrightLocal](https://www.brightlocal.com/wp-content/themes/ashdown-local/images/logo.png) -A c# wrapper class for consuming The Bright Local api. Automatically generates the proper authentication, with the siganture and expires. Avoid the need to generate your own authentication signature. +**BrightLocal API Wrapper Version 2.0** +For version 1.0 [Click Here](Documentation/README.md) -## Documentation +Quick Start +----------- -1. [Installation](Documentation/INSTALLATION.md) +It is recommended that you install BrightLocal via NuGet ` nuget Install-Package BrightLocal`. | https://www.nuget.org/packages/BrightLocal/1.0.0/ -### Account Methods +```csharp + nuget Install-Package BrightLocal +``` -2. [Client Examples](Documentation/CLIENTS.md) -3. [Location Examples](Documentation/LOCATIONS.md) -4. [Local Search Rank Checker Examples](Documentation/LSRC.md) -5. [Local SEO Check-up Examples](Documentation/LSCU.md) -6. [Citation Tracker Examples](Documentation/CT.md) -7. [Citation Burst Examples](Documentation/CB.md) -8. [ReviewFlow Reports Examples](Documentation/RF.md) -9. [Google+ Local Wizard Reports Examples](Documentation/GPW.md) +Next you will need to provide BrightLocal with your api key & api secret. There are currently 2 ways to do this: -### Batch Methods +a) Add an AppSetting with your api key to your config (this is the easiest way and will work throughout the app on every request) + +```xml + + ... + + + ... + +``` + +b) In your application initialization, call this method (this is a programmatic way, but you only have to do it once during startup) + +```csharp + BrightLocalConfiguration.SetApiCredentials("[your api key here]", "[your api secret here]"); +``` + +c) In any of the service constructors, you can optionally pass the api key & api secret (will be assigned that apikey for the life of the service instance). + +```csharp + var clientService = new ClientService("[your api key here]", "[your api secret here]"); +``` + +Clients +----- + +### Adding a client + +```csharp + var myClient = new ClientOptions(); + myClient.name = "Le Bernardin"; + myClient.companyUrl = "le-bernardin.com"; + myClient.businessCategoryId = 791; + + var clientService = new ClientService(); + + BrightLocalClient newClient = clientService.Create(myClient); +``` + +The returned BrightLocalClient entity above will have a client-id. You will want to persist this for later. When you create a location you will be able to assign it +to a client id (or not). + +### Updating a client + +```csharp + var myClient = new UpdateClientOptions(); + myClient.clientId = 36447; + myClient.name = "Le Bernardin"; + myClient.companyUrl = "le-bernardin.com"; + myClient.businessCategoryId = 791; + + var clientService = new ClientService(); + + BrightLocalClient updateClient = clientService.Update(myClient); +``` -10. [Rankings Examples](Documentation/RANKINGS.md) -11. [Local Directories Examples](Documentation/LOCAL-DIRECTORIES.md) -12. [Reviews Examples](Documentation/REVIEWS.md) -13. [Offsite SEO & Social PRofiles Examples](Documentation/OFFSITE&SP.md) \ No newline at end of file From f73ad5d64cb756f99d2dd9391c70044b6802e109 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Wed, 28 Dec 2016 15:11:19 -0700 Subject: [PATCH 11/93] added examples for client methods version 2 --- .../Account-Methods/clientExamples.cs | 2 +- README.md | 27 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs index ffa844e..a900deb 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs @@ -57,7 +57,7 @@ public static List Search() var searchQuery = "le-bernardin"; var clientService = new ClientService(); - var results = clientService.Search(searchQuery); + List results = clientService.Search(searchQuery); return results; } } diff --git a/README.md b/README.md index dc64186..bf2e62b 100644 --- a/README.md +++ b/README.md @@ -71,3 +71,30 @@ to a client id (or not). BrightLocalClient updateClient = clientService.Update(myClient); ``` +### Deleting a client + +```csharp + var clientId = 1; + var clientService = new ClientService(); + + BrightLocalClient deleteClient = clientService.Delete(clientId); +``` + +### Getting a client + +```csharp + var clientId = 1; + var clientService = new ClientService(); + + BrightLocalClient client = clientService.Get(clientId); +``` + +### Searching for a client + +```csharp + var searchQuery = "le-bernardin"; + var clientService = new ClientService(); + + List results = clientService.Search(searchQuery); // returns a list of type BrightLocalClient +``` + From 6b7c8ac9f8d0865349a5b158cc1b87b55f88d6a9 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Wed, 28 Dec 2016 15:21:08 -0700 Subject: [PATCH 12/93] Added services section to readme with clickable link to examples --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index bf2e62b..626b427 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,10 @@ **BrightLocal API Wrapper Version 2.0** For version 1.0 [Click Here](Documentation/README.md) +**BrightLocal API Services** + +[Clients](#clients) + Quick Start ----------- From ea752e10a5b95fcc1bd1d2ae7670cf41e2a09765 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Wed, 28 Dec 2016 15:26:39 -0700 Subject: [PATCH 13/93] Added a brightlocal logo png file with the "local" in blue for git documentation. white wasnt showing --- Documentation/logo.png | Bin 0 -> 5766 bytes README.md | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 Documentation/logo.png diff --git a/Documentation/logo.png b/Documentation/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..6a3e8586d66168d322342f9bb48f6452aa071545 GIT binary patch literal 5766 zcmV;17J2E3P)001xu1^@s6mZ@=W00009a7bBm000XU z000XU0RWnu7ytkYPiaF#P*7-ZbZ>KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 z?2xS?_ve_-kiKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z000ZINkl{*+B8Xcja5K z2@-t6QL)QC5e|MIqOJwxG9l6-Oee)5!f!!*1K>Rov%V;+#@kaT!-3k8I3kfK=+cCI z31Hb^D!+XmoZI9OLp@LM_I6dU<461NUFx}qG*Dijw_k*-in1%$$AbBqYIo8_7aOZV z+%CX-ZKkmFrmN9FBqqO3WY~NTutIWr=fmp zo8%nxfZgJRU?U(q1ZW~K62J`v=Yts81w`CCGCjQ+Kw*EFQ;=f~LIkD`Ma9%vg@{Q)3#Y0>2B?bdti>*hS^V)A+dcUnMLP*(3QDaxvOyC3|I2W3Pj zhLiHj>hhN;B{M}ZgJkO1u{XMay*2=29fFr+Z$45uxpF2%{uvmO)$;zOF@KXqgvgSMF}pZIeum{5JZoDax+gV4LI| z55eK6`Ct2LlfQeVW(RP|5#wB=E&=dav;r)ivgrVT1GXt_57;Xe7w>I@$YJX}CppSi zqfG+>!1i?lPg$>x7KwP@u59}qDg6~Z7TZ8Q(VA*^(lE23VDMfJ^qY4?A=u-A0%cs+ z2EH^E*VgB_>oGVC~2{669A^$KSZ=7j4^Yh}IEyv31^6sa?%#QY7AJz~4IJc&$ zw{ex%x#y5-xd7LbJg=f5|0G2I-0I`X#kW>|VVyWCb>uqhGR)df@->-d6%Co%GX8H0 zv#OTI$?)Osv7dc)_dDU+N{IHc1z^VX{441dZiOaLY2b?zBZ z@*2V9fPFtA6X1fbVMq&r9syY1khcurY7)+l@evpYusFq)a%cIjdAC3z$J(D`MC0PH z6UsZyk>MJ>j^v^st)+o1bU84qbl3c83#V@S000`3ovt*iyun&0^8>Ht5P;=z241Lk zjA4J#wCxiJ`y7Hj-f0dh1iYybEvtL5!WoMcsU;2buck8oNH95Ct(Vp3E+zOJ0cVK$ zc^M2>DPYM*Ma)NMZfyxWp_~`3>HuGeen%>YW0R-a?HY#ZmBa{8jOS$Ovj@yf81pLt zH+I=qb{Az=zuBFuoFSOzzf5(&`80sEXth{g=biwn7lN1^0I)%zorIbNViJiN5NWhT z#a==$$5Qbpeoegt;B|;-07WFPwdA~+8JDOf0A5V;oo<3L;%AmVR#|)0qMuNt&k};a z9R%+;(0#>s8>XzzJzi0*1MmZj^dFqkjdOc6tFWbG&XBkskdXiZ5mU(Lq0OygVqfv> zElp+hxxG(6s%K&Gd?I+;*ZQBk7Uk@0_Af@B9F?9{1#&LP5tb*LdzseCKbWTqvnrqH zxc`FJy)NBl{2j#AmgWTjUi9N&De*$kP(27z2ueB zhj#q~AVob~R-bnl!3zMn0pyi|p;}%QX?^J7DR2BQ#1L977o$47qSi8Z;gqV{h`gWI zoe6T5C9F0!H#IF-I(=s+xE`IkwPme$_Jb)2DLGb8E0mT#Sar|-9hFa7?>&-J(^$GY z_eX}Ic33q3y%O)V#17C85n>P562tyN@d)*7Unf8>03_zH^BD$)R>3_5Syf>xD@CM* zfr~?k$S)U8sjiJ!BTls-Xf*4WPTzdA+x}$EmSg4hc@-odwlp?-?O*E`dnz6{_?7I+ z7>CmYQv6DBIE>K~0lYg*b3sPnN&5rfh$n#Rd+$sZqO_tuZ{^F|+@r$8OdT}*BL`Z) zUK8CeCFca>SkP4=wX9`ZkifkH@T8pH+~a~Px26>$9|rJN7(GN66a59!pccid9z574 z(fV14yaHe^AWaq!jsf{pLaOmm#V+^6P%bbKG}z|J+3AZ^FpqbdLqx8zR4}>nrqdtpOBXGV zL8Q@QoUvl4o#ngpuI*_vEP#RNUC{`3g>n8wk_i@-e;O{q*G9|nh}??sL@$2lWDp=- zuqm9EmY4vrTYgo%x2-U{YITb=O%TYt7MxuO0~@-{#vl(UB1fZ|;xsM`TpUSQfVs3I zG6hg{c#Tq@g&>JF;QIY4uFpB(lI+b#;A@*DA}1^%d16Jqdww_%NU9T238uQ6)*guensHfKxx!t;XI&Ebd>vIK{*%22H@G{MI#3w0Qi8)Adh#Q zyV`BUS}-k42*kB@f6=BP20li+Fp3y}4`fyC7t6OC1e~)+V|?s`gKiAEkz!+D$bm0v z;6)8UzdQj83sKC7IsS+M04mCPHV%e;{umno5)7zHF$@*++(5K^5wvY`MOc|k7&a#2 zlGDYta3NvI3?3L`lgTr5q0Sx_>X|seJz(>q->nW8Gv+PWsnu> z<5ndi*cy}=-WRf|Qg;r5PdRP99F>%G;UI@jiD6$u4}fL6b7upb7a%>cHh$vi*8(*q zi`Li8xj490iTCdF2rL+c1S(*mBnhtZae?{J3B54~a$f<+iiX_9N~zKyjvpL&t7=oc zMpT$p^CkqJbU8q#CNOE^3to3;;i<xe-IZC(ho4oK!B|$ z>Y*T&lS;h#|2AE%k_hJnA-)6Qy#TVU;tS-Av>`vvhw+G}{6c}%mM}auEy4J>ydiI+ z2wDlaNnGXs6d-v(@h7qu~SjQ48hRHLFC=fMTm$gB9+b3dUMf~O?w8)(d=tI zx>O5(A6hK!Y1K_Nfm&u;yybdeO3hvoSr^(mDwc;9F^26U^^9@LBOM?P`M)L`5rX|O zf&7g?L#y^}^q=Jtj!r_lia8Cakj1FfY=N>Aeg>^7JM+Bug4QLk)aRBu$YKa43ZVgh zNG-oB%&z`xg?HXKBm|}i0W;0#(r|R~BEr`L5@@uJBhMNW&5luDoU{HCTdjgg5 zi3NhS1(U0045SP%)y^56l$dmdseNa(X@0&a=e16d$KjCjSe`i@NnbHN>-wxI?Jli% z-(t{c=<-8#ngCyWU}6ZJFOyfy#_lBNU&iuY~v+5j97T3H?N{-D4asqYTs~E#hm~{-traCb!0P zSG$e5V=w`RS^@F_>-L9;e#SQKaLL_=I8`*{E(X+k3&7ggUZyn~V7JpuMfB5!S=B3T z)7l;|CL~a^7&v2`051>Ge3cD8I|q!hi`K6Lf# Date: Wed, 28 Dec 2016 15:27:40 -0700 Subject: [PATCH 14/93] Fixed url to logo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8ae4eec..25d2c0f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![BrightLocal](https://github.com/BrightLocal/C-Sharp-Api-Wrapper/tree/Developer/version2.0/Documentation) +![BrightLocal](https://github.com/BrightLocal/C-Sharp-Api-Wrapper/tree/Developer/version2.0/Documentation/logo.png) **BrightLocal API Wrapper Version 2.0** From 3b80ce75be19594643ba050152b5bad805e8240b Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Wed, 28 Dec 2016 15:32:28 -0700 Subject: [PATCH 15/93] fixed url path to logo file --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 25d2c0f..c0122bb 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![BrightLocal](https://github.com/BrightLocal/C-Sharp-Api-Wrapper/tree/Developer/version2.0/Documentation/logo.png) +![BrightLocal](https://github.com/BrightLocal/C-Sharp-Api-Wrapper/blob/master/Documentation/logo.png) **BrightLocal API Wrapper Version 2.0** From 52bcb90aa4e924c2fa4b123847c277376c3f922d Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Thu, 29 Dec 2016 11:50:17 -0700 Subject: [PATCH 16/93] added Location entity and location option class --- .../src/BrightLocal/Entities/BrightLocalLocation.cs | 11 +++++++++++ .../Account-Methods/locationExamples.cs | 7 +++++++ .../BrightLocal/Services/Locations/LocationOptions.cs | 11 +++++++++++ .../BrightLocal/Services/Locations/LocationService.cs | 11 +++++++++++ 4 files changed, 40 insertions(+) create mode 100644 BrightLocal/src/BrightLocal/Entities/BrightLocalLocation.cs create mode 100644 BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/locationExamples.cs create mode 100644 BrightLocal/src/BrightLocal/Services/Locations/LocationOptions.cs create mode 100644 BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalLocation.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalLocation.cs new file mode 100644 index 0000000..76b03de --- /dev/null +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalLocation.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace BrightLocal.Entities +{ + public class BrightLocalLocation + { + } +} diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/locationExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/locationExamples.cs new file mode 100644 index 0000000..5433c6e --- /dev/null +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/locationExamples.cs @@ -0,0 +1,7 @@ + +namespace BrightLocal.Examples_version2.Account_Methods +{ + public class locationExamples + { + } +} diff --git a/BrightLocal/src/BrightLocal/Services/Locations/LocationOptions.cs b/BrightLocal/src/BrightLocal/Services/Locations/LocationOptions.cs new file mode 100644 index 0000000..5af5542 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Services/Locations/LocationOptions.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace BrightLocal.Services.Locations +{ + public class LocationOptions + { + } +} diff --git a/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs b/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs new file mode 100644 index 0000000..ebce554 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace BrightLocal.Services.Locations +{ + public class LocationService + { + } +} From 6c8e77befc22ee698b5b9370e34d92ecdb4de1dc Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Thu, 29 Dec 2016 14:00:14 -0700 Subject: [PATCH 17/93] Added functions to LocationServices object --- .../Services/Locations/LocationService.cs | 56 +++++++++++++++++-- 1 file changed, 51 insertions(+), 5 deletions(-) diff --git a/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs b/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs index ebce554..b87b06e 100644 --- a/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs +++ b/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs @@ -1,11 +1,57 @@ -using System; +using Newtonsoft.Json; +using System; using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -namespace BrightLocal.Services.Locations +namespace BrightLocal { - public class LocationService + public class LocationService: BrightLocalService { + public LocationService(string apiKey = null, string apiSecret = null) : base(apiKey, apiSecret) { } + + BrightLocalRequestor request = new BrightLocalRequestor(); + + public virtual BrightLocalLocation Create(LocationOptions createOptions) + { + var parameters = Parameters.convertListToParameters(createOptions); + var success = request.Post(Urls.Locations, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual BrightLocalLocation Update(LocationOptions createOptions) + { + var parameters = Parameters.convertListToParameters(createOptions); + var success = request.Put(Urls.Locations, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual BrightLocalLocation Delete(int locationId) + { + var parameters = new Parameters.requestParameters(); + var success = request.Delete(Urls.Locations + "/" + locationId, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual BrightLocalLocation Get(int locationId) + { + var url = string.Format(Urls.Locations + "/{0}", locationId); + var parameters = new Parameters.requestParameters(); + var success = request.Get(url, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual List Search(string query) + { + var url = string.Format(Urls.Locations + "/search"); + var parameters = new Parameters.requestParameters(); + parameters.Add("q", query); + var results = request.Get(url, parameters, this.api_key, this.api_secret); + + List locations = new List(); + foreach (var location in results.Content[0].ToString()) + { + locations.Add(JsonConvert.DeserializeObject(location.ToString())); + } + return locations; + } } } From 6b3a2020bcb6048e6e271eae4fb6335424f2cde3 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Thu, 29 Dec 2016 14:29:28 -0700 Subject: [PATCH 18/93] created UpdateLocationOptions object --- .../Locations/UpdateLocationOptions.cs | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 BrightLocal/src/BrightLocal/Services/Locations/UpdateLocationOptions.cs diff --git a/BrightLocal/src/BrightLocal/Services/Locations/UpdateLocationOptions.cs b/BrightLocal/src/BrightLocal/Services/Locations/UpdateLocationOptions.cs new file mode 100644 index 0000000..6a02cac --- /dev/null +++ b/BrightLocal/src/BrightLocal/Services/Locations/UpdateLocationOptions.cs @@ -0,0 +1,63 @@ +using Newtonsoft.Json; +using RestSharp; + +namespace BrightLocal +{ + public class UpdateLocationOptions + { + [JsonProperty("location-id")] + public int locationId { get; set; } + [JsonProperty("name")] + public string name { get; set; } + [JsonProperty("client-id")] + public int clientId { get; set; } + [JsonProperty("url")] + public string url { get; set; } + [JsonProperty("business-category-id")] + public int businessCategoryId { get; set; } + [JsonProperty("country")] + public string country { get; set; } + [JsonProperty("address1")] + public string address1 { get; set; } + [JsonProperty("address2")] + public string address2 { get; set; } + [JsonProperty("region")] + public string region { get; set; } + [JsonProperty("city")] + public string city { get; set; } + [JsonProperty("postcode")] + public string postcode { get; set; } + [JsonProperty("telephone")] + public string telephone { get; set; } + [JsonProperty("unique-reference")] + public string uniqueReference { get; set; } + [JsonProperty("contact-first-name")] + public string contactFirstName { get; set; } + [JsonProperty("contact-last-name")] + public string contactLastName { get; set; } + [JsonProperty("contact-mobile")] + public string contactMobile { get; set; } + [JsonProperty("contact-telephone")] + public string contactTelephone { get; set; } + [JsonProperty("contact-email")] + public string contactEmail { get; set; } + [JsonProperty("contact-fax")] + public string contactFax { get; set; } + [JsonProperty("number-of-employees")] + public string numberOfEmployees { get; set; } + [JsonProperty("year-of-formation")] + public string yearOfFormation { get; set; } + [JsonProperty("extra-business-categories")] + public JsonArray extraBusinessCategories { get; set; } + [JsonProperty("working-hours")] + public JsonArray workingHours { get; set; } + [JsonProperty("payment-methods")] + public JsonArray paymentMethods { get; set; } + [JsonProperty("short-description")] + public string shortDescription { get; set; } + [JsonProperty("long-description")] + public string longDescription { get; set; } + [JsonProperty("services-of-products")] + public JsonArray servicesOfProducts { get; set; } + } +} From caef196fd719cdada88c7cc929781fc09d4f56f1 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Sun, 1 Jan 2017 12:49:06 -0700 Subject: [PATCH 19/93] Fixes-removed unused using satatements and fixed json properties --- .../BrightLocal/Entities/BrightLocalClient.cs | 6 +- .../Entities/BrightLocalLocation.cs | 62 +++++++++++++++++-- .../Account-Methods/clientExamples.cs | 2 - .../Services/Clients/ClientOptions.cs | 6 +- .../Services/Clients/ClientService.cs | 5 +- .../Services/Locations/LocationOptions.cs | 60 ++++++++++++++++-- .../Services/Locations/LocationService.cs | 4 +- .../Locations/UpdateLocationOptions.cs | 2 + 8 files changed, 121 insertions(+), 26 deletions(-) diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalClient.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalClient.cs index 968c6f0..895063f 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalClient.cs +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalClient.cs @@ -1,8 +1,4 @@ using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; namespace BrightLocal { @@ -18,5 +14,7 @@ public class BrightLocalClient public string companyUrl { get; set; } [JsonProperty("business-category-id")] public int businessCategoryId { get; set; } + [JsonProperty("reference-number")] + public string referenceNumber { get; set; } } } diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalLocation.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalLocation.cs index 76b03de..611b657 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalLocation.cs +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalLocation.cs @@ -1,11 +1,63 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; +using Newtonsoft.Json; +using RestSharp; -namespace BrightLocal.Entities +namespace BrightLocal { public class BrightLocalLocation { + [JsonProperty("location-id")] + public int locationId { get; set; } + [JsonProperty("name")] + public string name { get; set; } + [JsonProperty("client-id")] + public int clientId { get; set; } + [JsonProperty("url")] + public string url { get; set; } + [JsonProperty("business-category-id")] + public int businessCategoryId { get; set; } + [JsonProperty("country")] + public string country { get; set; } + [JsonProperty("address1")] + public string address1 { get; set; } + [JsonProperty("address2")] + public string address2 { get; set; } + [JsonProperty("region")] + public string region { get; set; } + [JsonProperty("city")] + public string city { get; set; } + [JsonProperty("postcode")] + public string postcode { get; set; } + [JsonProperty("telephone")] + public string telephone { get; set; } + [JsonProperty("unique-reference")] + public string uniqueReference { get; set; } + [JsonProperty("contact-first-name")] + public string contactFirstName { get; set; } + [JsonProperty("contact-last-name")] + public string contactLastName { get; set; } + [JsonProperty("contact-mobile")] + public string contactMobile { get; set; } + [JsonProperty("contact-telephone")] + public string contactTelephone { get; set; } + [JsonProperty("contact-email")] + public string contactEmail { get; set; } + [JsonProperty("contact-fax")] + public string contactFax { get; set; } + [JsonProperty("number-of-employees")] + public string numberOfEmployees { get; set; } + [JsonProperty("year-of-formation")] + public string yearOfFormation { get; set; } + [JsonProperty("extra-business-categories")] + public JsonArray extraBusinessCategories { get; set; } + [JsonProperty("working-hours")] + public JsonArray workingHours { get; set; } + [JsonProperty("payment-methods")] + public JsonArray paymentMethods { get; set; } + [JsonProperty("short-description")] + public string shortDescription { get; set; } + [JsonProperty("long-description")] + public string longDescription { get; set; } + [JsonProperty("services-of-products")] + public JsonArray servicesOfProducts { get; set; } } } diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs index a900deb..8f5a8af 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs @@ -1,7 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; namespace BrightLocal.Examples_version2.Account_Methods { diff --git a/BrightLocal/src/BrightLocal/Services/Clients/ClientOptions.cs b/BrightLocal/src/BrightLocal/Services/Clients/ClientOptions.cs index a9050c1..8e8e028 100644 --- a/BrightLocal/src/BrightLocal/Services/Clients/ClientOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/Clients/ClientOptions.cs @@ -1,8 +1,4 @@ using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; namespace BrightLocal { @@ -14,5 +10,7 @@ public class ClientOptions public string companyUrl { get; set; } [JsonProperty("business-category-id")] public int businessCategoryId { get; set; } + [JsonProperty("reference-number")] + public string referenceNumber { get; set; } } } diff --git a/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs b/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs index 2597a46..1063c26 100644 --- a/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs +++ b/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs @@ -1,9 +1,6 @@ - -using Newtonsoft.Json; +using Newtonsoft.Json; using System; using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; namespace BrightLocal { diff --git a/BrightLocal/src/BrightLocal/Services/Locations/LocationOptions.cs b/BrightLocal/src/BrightLocal/Services/Locations/LocationOptions.cs index 5af5542..c6c3b66 100644 --- a/BrightLocal/src/BrightLocal/Services/Locations/LocationOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/Locations/LocationOptions.cs @@ -1,11 +1,61 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; +using Newtonsoft.Json; +using RestSharp; -namespace BrightLocal.Services.Locations +namespace BrightLocal { public class LocationOptions { + [JsonProperty("name")] + public string name { get; set; } + [JsonProperty("client-id")] + public int clientId { get; set; } + [JsonProperty("url")] + public string url { get; set; } + [JsonProperty("business-category-id")] + public int businessCategoryId { get; set; } + [JsonProperty("country")] + public string country { get; set; } + [JsonProperty("address1")] + public string address1 { get; set; } + [JsonProperty("address2")] + public string address2 { get; set; } + [JsonProperty("region")] + public string region { get; set; } + [JsonProperty("city")] + public string city { get; set; } + [JsonProperty("postcode")] + public string postcode { get; set; } + [JsonProperty("telephone")] + public string telephone { get; set; } + [JsonProperty("unique-reference")] + public string uniqueReference { get; set; } + [JsonProperty("contact-first-name")] + public string contactFirstName { get; set; } + [JsonProperty("contact-last-name")] + public string contactLastName { get; set; } + [JsonProperty("contact-mobile")] + public string contactMobile { get; set; } + [JsonProperty("contact-telephone")] + public string contactTelephone { get; set; } + [JsonProperty("contact-email")] + public string contactEmail { get; set; } + [JsonProperty("contact-fax")] + public string contactFax { get; set; } + [JsonProperty("number-of-employees")] + public string numberOfEmployees { get; set; } + [JsonProperty("year-of-formation")] + public string yearOfFormation { get; set; } + [JsonProperty("extra-business-categories")] + public JsonArray extraBusinessCategories { get; set; } + [JsonProperty("working-hours")] + public JsonArray workingHours { get; set; } + [JsonProperty("payment-methods")] + public JsonArray paymentMethods { get; set; } + [JsonProperty("short-description")] + public string shortDescription { get; set; } + [JsonProperty("long-description")] + public string longDescription { get; set; } + [JsonProperty("services-of-products")] + public JsonArray servicesOfProducts { get; set; } } } diff --git a/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs b/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs index b87b06e..1cb8408 100644 --- a/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs +++ b/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs @@ -17,9 +17,9 @@ public virtual BrightLocalLocation Create(LocationOptions createOptions) return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalLocation Update(LocationOptions createOptions) + public virtual BrightLocalLocation Update(UpdateLocationOptions updateOptions) { - var parameters = Parameters.convertListToParameters(createOptions); + var parameters = Parameters.convertListToParameters(updateOptions); var success = request.Put(Urls.Locations, parameters, this.api_key, this.api_secret); return JsonConvert.DeserializeObject(success.Content); } diff --git a/BrightLocal/src/BrightLocal/Services/Locations/UpdateLocationOptions.cs b/BrightLocal/src/BrightLocal/Services/Locations/UpdateLocationOptions.cs index 6a02cac..2c0f53b 100644 --- a/BrightLocal/src/BrightLocal/Services/Locations/UpdateLocationOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/Locations/UpdateLocationOptions.cs @@ -1,10 +1,12 @@ using Newtonsoft.Json; using RestSharp; + namespace BrightLocal { public class UpdateLocationOptions { + [JsonRequired] [JsonProperty("location-id")] public int locationId { get; set; } [JsonProperty("name")] From 0ee854fe7f358e967c36664b84f117f64478c521 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Mon, 2 Jan 2017 10:38:02 -0700 Subject: [PATCH 20/93] added Location Examples and fixed LocationService --- .../Account-Methods/locationExamples.cs | 71 +++++++++++++++++++ .../src/BrightLocal/Infrastructure/Urls.cs | 3 +- .../Services/Locations/LocationService.cs | 6 +- 3 files changed, 77 insertions(+), 3 deletions(-) diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/locationExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/locationExamples.cs index 5433c6e..bf5f9ea 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/locationExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/locationExamples.cs @@ -1,7 +1,78 @@  +using System.Collections.Generic; + namespace BrightLocal.Examples_version2.Account_Methods { public class locationExamples { + public static BrightLocalLocation Create() + { + var myLocation = new LocationOptions(); + myLocation.name = "Le Bernardin"; + myLocation.url = "le-bernardin.com"; + myLocation.businessCategoryId = 791; + myLocation.country = "USA"; + myLocation.address1 = "155 Weest 51st Street"; + myLocation.address2 = ""; + myLocation.region = "NY"; // state or region + myLocation.city = "New York"; + myLocation.postcode = "10019"; + myLocation.telephone = "+1 212-554-1515"; + + var locationService = new LocationService(); + + BrightLocalLocation newLocation = locationService.Create(myLocation); + return newLocation; + } + + public static BrightLocalLocation Update() + { + var myLocation = new UpdateLocationOptions(); + myLocation.locationId = 1; + myLocation.name = "Le Bernardin"; + myLocation.url = "le-bernardin.com"; + myLocation.businessCategoryId = 791; + myLocation.country = "USA"; + myLocation.address1 = "155 Weest 51st Street"; + myLocation.address2 = ""; + myLocation.region = "NY"; // state or region + myLocation.city = "New York"; + myLocation.postcode = "10019"; + myLocation.telephone = "+1 212-554-1515"; + + var locationService = new LocationService(); + + BrightLocalLocation newLocation = locationService.Update(myLocation); + return newLocation; + } + + public static BrightLocalLocation Delete() + { + var locationId = 1; + + var locationService = new LocationService(); + + BrightLocalLocation deleteLocation = locationService.Delete(locationId); + return deleteLocation; + } + + public static BrightLocalLocation Get() + { + var locationId = 1; + + var locationService = new LocationService(); + + BrightLocalLocation getLocation = locationService.Get(locationId); + return getLocation; + } + + public static List Search() + { + var searchQuery = "le-bernardin"; + var locationService = new LocationService(); + + List results = locationService.Search(searchQuery); + return results; + } } } diff --git a/BrightLocal/src/BrightLocal/Infrastructure/Urls.cs b/BrightLocal/src/BrightLocal/Infrastructure/Urls.cs index 90058f6..4e34242 100644 --- a/BrightLocal/src/BrightLocal/Infrastructure/Urls.cs +++ b/BrightLocal/src/BrightLocal/Infrastructure/Urls.cs @@ -9,6 +9,7 @@ internal static class Urls { internal static string BaseUrl => "https://tools.brightlocal.com/seo-tools/api"; internal static string Clients => "/v1/clients-and-locations/clients/"; - + internal static string Locations => "/v1/clients-and-locations/locations/"; + } } diff --git a/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs b/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs index 1cb8408..2836618 100644 --- a/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs +++ b/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs @@ -19,15 +19,17 @@ public virtual BrightLocalLocation Create(LocationOptions createOptions) public virtual BrightLocalLocation Update(UpdateLocationOptions updateOptions) { + var url = string.Format(Urls.Locations + "/{0}", updateOptions.locationId); var parameters = Parameters.convertListToParameters(updateOptions); - var success = request.Put(Urls.Locations, parameters, this.api_key, this.api_secret); + var success = request.Put(url, parameters, this.api_key, this.api_secret); return JsonConvert.DeserializeObject(success.Content); } public virtual BrightLocalLocation Delete(int locationId) { + var url = string.Format(Urls.Locations + "/{0}", locationId); var parameters = new Parameters.requestParameters(); - var success = request.Delete(Urls.Locations + "/" + locationId, parameters, this.api_key, this.api_secret); + var success = request.Delete(locationId, parameters, this.api_key, this.api_secret); return JsonConvert.DeserializeObject(success.Content); } From dba119c6f4016da805fa173c27692fade30d0453 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Mon, 2 Jan 2017 10:43:30 -0700 Subject: [PATCH 21/93] Added Location examples to readme --- .../Account-Methods/locationExamples.cs | 6 +- README.md | 76 +++++++++++++++++++ 2 files changed, 78 insertions(+), 4 deletions(-) diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/locationExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/locationExamples.cs index bf5f9ea..4e705d2 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/locationExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/locationExamples.cs @@ -42,14 +42,13 @@ public static BrightLocalLocation Update() var locationService = new LocationService(); - BrightLocalLocation newLocation = locationService.Update(myLocation); - return newLocation; + BrightLocalLocation updateLocation = locationService.Update(myLocation); + return updateLocation; } public static BrightLocalLocation Delete() { var locationId = 1; - var locationService = new LocationService(); BrightLocalLocation deleteLocation = locationService.Delete(locationId); @@ -59,7 +58,6 @@ public static BrightLocalLocation Delete() public static BrightLocalLocation Get() { var locationId = 1; - var locationService = new LocationService(); BrightLocalLocation getLocation = locationService.Get(locationId); diff --git a/README.md b/README.md index c0122bb..a34da94 100644 --- a/README.md +++ b/README.md @@ -102,3 +102,79 @@ to a client id (or not). List results = clientService.Search(searchQuery); // returns a list of type BrightLocalClient ``` + +Locations +----- + +### Adding a location + +```csharp + var myLocation = new LocationOptions(); + myLocation.name = "Le Bernardin"; + myLocation.url = "le-bernardin.com"; + myLocation.businessCategoryId = 791; + myLocation.country = "USA"; + myLocation.address1 = "155 Weest 51st Street"; + myLocation.address2 = ""; + myLocation.region = "NY"; // state or region + myLocation.city = "New York"; + myLocation.postcode = "10019"; + myLocation.telephone = "+1 212-554-1515"; + + var locationService = new LocationService(); + + BrightLocalLocation newLocation = locationService.Create(myLocation); +``` + +The returned BrightLocalClient entity above will have a location-id. You will want to persist this for later. When you create a report you will be able to assign it +to a location id (or not). + +### Updating a location + +```csharp + var myLocation = new UpdateLocationOptions(); + myLocation.locationId = 1; + myLocation.name = "Le Bernardin"; + myLocation.url = "le-bernardin.com"; + myLocation.businessCategoryId = 791; + myLocation.country = "USA"; + myLocation.address1 = "155 Weest 51st Street"; + myLocation.address2 = ""; + myLocation.region = "NY"; // state or region + myLocation.city = "New York"; + myLocation.postcode = "10019"; + myLocation.telephone = "+1 212-554-1515"; + + var locationService = new LocationService(); + + BrightLocalLocation updateLocation = locationService.Update(myLocation); +``` + +### Deleting a location + +```csharp + var locationId = 1; + var locationService = new LocationService(); + + BrightLocalLocation deleteLocation = locationService.Delete(locationId); + +``` + +### Getting a location + +```csharp + var locationId = 1; + var locationService = new LocationService(); + + BrightLocalLocation getLocation = locationService.Get(locationId); +``` + +### Searching for a location + +```csharp + var searchQuery = "le-bernardin"; + var locationService = new LocationService(); + + List results = locationService.Search(searchQuery); // returns a list of type BrightLocalLocation +``` + From 4b411e1b666162a54c6ca03b41b9b172090b30be Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Mon, 2 Jan 2017 11:20:52 -0700 Subject: [PATCH 22/93] fixed url aprameter --- .../BrightLocal/Entities/BrightLocalLsrc.cs | 58 +++++++++++++++++++ .../Services/Locations/LocationService.cs | 2 +- .../Lsrc/LsrcService.cs} | 5 +- 3 files changed, 61 insertions(+), 4 deletions(-) create mode 100644 BrightLocal/src/BrightLocal/Entities/BrightLocalLsrc.cs rename BrightLocal/src/BrightLocal/{Entities/Base/EntityWithId.cs => Services/Lsrc/LsrcService.cs} (56%) diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalLsrc.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalLsrc.cs new file mode 100644 index 0000000..0e505f7 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalLsrc.cs @@ -0,0 +1,58 @@ +using Newtonsoft.Json; +using RestSharp; +using System.Collections.Generic; + +namespace BrightLocal +{ + public class BrightLocalLsrc + { + [JsonProperty("campaign-id")] + public string campaignId { get; set; } + [JsonProperty("name")] + public string name { get; set; } + [JsonProperty("schedule")] + public string schedule { get; set; } + [JsonProperty("day-of-week")] + public string dayOfWeek { get; set; } + [JsonProperty("day-of-month")] + public int dayOfMonth { get; set; } + [JsonProperty("location-id")] + public int locationId { get; set; } + [JsonProperty("white-label-profile-id")] + public int whiteLabelProfileId { get; set; } + [JsonProperty("tags")] + public string tags { get; set; } + [JsonProperty("search-terms")] + public string searchTerms { get; set; } + [JsonProperty("website-addresses")] + public List websiteAddresses { get; set; } + [JsonProperty("website-address")] + public string websiteAddress { get; set; } + [JsonProperty("website-address-2")] + public string websiteAddress2 { get; set; } + [JsonProperty("website-address-3")] + public string websiteAddress3 { get; set; } + [JsonProperty("country")] + public string country { get; set; } + [JsonProperty("google-location")] + public string googleLocation { get; set; } + [JsonProperty("bing-location")] + public string bingLocation { get; set; } + [JsonProperty("business-names")] + public string businessNames { get; set; } + [JsonProperty("postcode")] + public string postcode { get; set; } + [JsonProperty("telephone")] + public string telephone { get; set; } + [JsonProperty("search-engines")] + public List searchEngines { get; set; } + [JsonProperty("include-local-directory-results")] + public string includeLocalDirectoryResults { get; set; } + [JsonProperty("notify")] + public string notify { get; set; } + [JsonProperty("emailAddresses")] + public string emailAddresses { get; set; } + [JsonProperty("is-public")] + public JsonArray isPublic { get; set; } + } +} diff --git a/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs b/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs index 2836618..eaab595 100644 --- a/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs +++ b/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs @@ -29,7 +29,7 @@ public virtual BrightLocalLocation Delete(int locationId) { var url = string.Format(Urls.Locations + "/{0}", locationId); var parameters = new Parameters.requestParameters(); - var success = request.Delete(locationId, parameters, this.api_key, this.api_secret); + var success = request.Delete(url, parameters, this.api_key, this.api_secret); return JsonConvert.DeserializeObject(success.Content); } diff --git a/BrightLocal/src/BrightLocal/Entities/Base/EntityWithId.cs b/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs similarity index 56% rename from BrightLocal/src/BrightLocal/Entities/Base/EntityWithId.cs rename to BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs index 43f2dfd..816540c 100644 --- a/BrightLocal/src/BrightLocal/Entities/Base/EntityWithId.cs +++ b/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs @@ -3,10 +3,9 @@ using System.Linq; using System.Threading.Tasks; -namespace BrightLocal +namespace BrightLocal.Services.Lsrc { - public class EntityWithId + public class LsrcService { - public string id { get; set; } } } From 5ba5be30ae6c6ae5b276324790bdbe9f66100592 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Mon, 2 Jan 2017 13:29:18 -0700 Subject: [PATCH 23/93] Added lsrc options objects --- .../src/BrightLocal/Services/Lsrc/LsrcOptions.cs | 11 +++++++++++ .../BrightLocal/Services/Lsrc/UpdateLsrcOptions.cs | 11 +++++++++++ 2 files changed, 22 insertions(+) create mode 100644 BrightLocal/src/BrightLocal/Services/Lsrc/LsrcOptions.cs create mode 100644 BrightLocal/src/BrightLocal/Services/Lsrc/UpdateLsrcOptions.cs diff --git a/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcOptions.cs b/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcOptions.cs new file mode 100644 index 0000000..c57f370 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcOptions.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace BrightLocal.Services.Lsrc +{ + public class LsrcOptions + { + } +} diff --git a/BrightLocal/src/BrightLocal/Services/Lsrc/UpdateLsrcOptions.cs b/BrightLocal/src/BrightLocal/Services/Lsrc/UpdateLsrcOptions.cs new file mode 100644 index 0000000..9bdd4a8 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Services/Lsrc/UpdateLsrcOptions.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace BrightLocal.Services.Lsrc +{ + public class UpdateLsrcOptions + { + } +} From dd09e072d90d17e2673dec3de0d37a6c8277f917 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Mon, 2 Jan 2017 14:25:44 -0700 Subject: [PATCH 24/93] added lsrc objects added object for history results; added method in parameters for converting comma separated string to newline; added url endpoint for lsrc --- .../BrightLocal/Entities/BrightLocalLsrc.cs | 9 +++- .../Entities/BrightLocalLsrcHistory.cs | 22 ++++++++ .../src/BrightLocal/Infrastructure/Urls.cs | 1 + .../BrightLocal/Services/Lsrc/LsrcOptions.cs | 53 ++++++++++++++++-- .../Services/Lsrc/UpdateLsrcOptions.cs | 54 +++++++++++++++++-- .../src/BrightLocal/Services/Parameters.cs | 5 ++ 6 files changed, 134 insertions(+), 10 deletions(-) create mode 100644 BrightLocal/src/BrightLocal/Entities/BrightLocalLsrcHistory.cs diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalLsrc.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalLsrc.cs index 0e505f7..2cbe29a 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalLsrc.cs +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalLsrc.cs @@ -45,7 +45,7 @@ public class BrightLocalLsrc [JsonProperty("telephone")] public string telephone { get; set; } [JsonProperty("search-engines")] - public List searchEngines { get; set; } + public string searchEngines { get; set; } [JsonProperty("include-local-directory-results")] public string includeLocalDirectoryResults { get; set; } [JsonProperty("notify")] @@ -53,6 +53,11 @@ public class BrightLocalLsrc [JsonProperty("emailAddresses")] public string emailAddresses { get; set; } [JsonProperty("is-public")] - public JsonArray isPublic { get; set; } + public string isPublic { get; set; } + [JsonProperty("status")] + public string status { get; set; } + [JsonProperty("credits")] + public string credits { get; set; } + } } diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalLsrcHistory.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalLsrcHistory.cs new file mode 100644 index 0000000..65d55f6 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalLsrcHistory.cs @@ -0,0 +1,22 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace BrightLocal +{ + public class BrightLocalLsrcHistory + { + [JsonProperty("campaign_history_id")] + public string campaignHistoryId { get; set; } + [JsonProperty("campaign_id")] + public string campaignId { get; set; } + [JsonProperty("location_id")] + public string locationId { get; set; } + [JsonProperty("hystory_type")] + public string historyType { get; set; } + [JsonProperty("generation_date")] + public string genrationDate { get; set; } + } +} diff --git a/BrightLocal/src/BrightLocal/Infrastructure/Urls.cs b/BrightLocal/src/BrightLocal/Infrastructure/Urls.cs index 4e34242..56a73ff 100644 --- a/BrightLocal/src/BrightLocal/Infrastructure/Urls.cs +++ b/BrightLocal/src/BrightLocal/Infrastructure/Urls.cs @@ -10,6 +10,7 @@ internal static class Urls internal static string BaseUrl => "https://tools.brightlocal.com/seo-tools/api"; internal static string Clients => "/v1/clients-and-locations/clients/"; internal static string Locations => "/v1/clients-and-locations/locations/"; + internal static string Lsrc => "/v2/lsrc/"; } } diff --git a/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcOptions.cs b/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcOptions.cs index c57f370..e6917dd 100644 --- a/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcOptions.cs @@ -1,11 +1,56 @@ -using System; +using Newtonsoft.Json; using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -namespace BrightLocal.Services.Lsrc +namespace BrightLocal { public class LsrcOptions { + [JsonProperty("name")] + public string name { get; set; } + [JsonProperty("schedule")] + public string schedule { get; set; } + [JsonProperty("day-of-week")] + public string dayOfWeek { get; set; } + [JsonProperty("day-of-month")] + public int dayOfMonth { get; set; } + [JsonProperty("location-id")] + public int locationId { get; set; } + [JsonProperty("white-label-profile-id")] + public int whiteLabelProfileId { get; set; } + [JsonProperty("tags")] + public string tags { get; set; } + [JsonProperty("search-terms")] + public string searchTerms { get; set; } + [JsonProperty("website-addresses")] + public List websiteAddresses { get; set; } + [JsonProperty("website-address")] + public string websiteAddress { get; set; } + [JsonProperty("website-address-2")] + public string websiteAddress2 { get; set; } + [JsonProperty("website-address-3")] + public string websiteAddress3 { get; set; } + [JsonProperty("country")] + public string country { get; set; } + [JsonProperty("google-location")] + public string googleLocation { get; set; } + [JsonProperty("bing-location")] + public string bingLocation { get; set; } + [JsonProperty("business-names")] + public string businessNames { get; set; } + [JsonProperty("postcode")] + public string postcode { get; set; } + [JsonProperty("telephone")] + public string telephone { get; set; } + [JsonProperty("search-engines")] + public string searchEngines { get; set; } + [JsonProperty("include-local-directory-results")] + public string includeLocalDirectoryResults { get; set; } + [JsonProperty("notify")] + public string notify { get; set; } + [JsonProperty("emailAddresses")] + public string emailAddresses { get; set; } + [JsonProperty("is-public")] + public string isPublic { get; set; } } } +} diff --git a/BrightLocal/src/BrightLocal/Services/Lsrc/UpdateLsrcOptions.cs b/BrightLocal/src/BrightLocal/Services/Lsrc/UpdateLsrcOptions.cs index 9bdd4a8..cfaf104 100644 --- a/BrightLocal/src/BrightLocal/Services/Lsrc/UpdateLsrcOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/Lsrc/UpdateLsrcOptions.cs @@ -1,11 +1,57 @@ -using System; +using Newtonsoft.Json; using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -namespace BrightLocal.Services.Lsrc +namespace BrightLocal { public class UpdateLsrcOptions { + [JsonProperty("campaign-id")] + public string campaignId { get; set; } + [JsonProperty("name")] + public string name { get; set; } + [JsonProperty("schedule")] + public string schedule { get; set; } + [JsonProperty("day-of-week")] + public string dayOfWeek { get; set; } + [JsonProperty("day-of-month")] + public int dayOfMonth { get; set; } + [JsonProperty("location-id")] + public int locationId { get; set; } + [JsonProperty("white-label-profile-id")] + public int whiteLabelProfileId { get; set; } + [JsonProperty("tags")] + public string tags { get; set; } + [JsonProperty("search-terms")] + public string searchTerms { get; set; } + [JsonProperty("website-addresses")] + public List websiteAddresses { get; set; } + [JsonProperty("website-address")] + public string websiteAddress { get; set; } + [JsonProperty("website-address-2")] + public string websiteAddress2 { get; set; } + [JsonProperty("website-address-3")] + public string websiteAddress3 { get; set; } + [JsonProperty("country")] + public string country { get; set; } + [JsonProperty("google-location")] + public string googleLocation { get; set; } + [JsonProperty("bing-location")] + public string bingLocation { get; set; } + [JsonProperty("business-names")] + public string businessNames { get; set; } + [JsonProperty("postcode")] + public string postcode { get; set; } + [JsonProperty("telephone")] + public string telephone { get; set; } + [JsonProperty("search-engines")] + public string searchEngines { get; set; } + [JsonProperty("include-local-directory-results")] + public string includeLocalDirectoryResults { get; set; } + [JsonProperty("notify")] + public string notify { get; set; } + [JsonProperty("emailAddresses")] + public string emailAddresses { get; set; } + [JsonProperty("is-public")] + public string isPublic { get; set; } } } diff --git a/BrightLocal/src/BrightLocal/Services/Parameters.cs b/BrightLocal/src/BrightLocal/Services/Parameters.cs index 4a6ca45..519b3de 100644 --- a/BrightLocal/src/BrightLocal/Services/Parameters.cs +++ b/BrightLocal/src/BrightLocal/Services/Parameters.cs @@ -25,6 +25,11 @@ public static requestParameters convertListToParameters(Object item) return parameters; } + public static string convertToNewline(string item) + { + return item.Replace(',', '\n'); + } + public class requestParameters : Dictionary { From 3798e379bb8583fd9c6825fc176f7675a2ee562b Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Tue, 3 Jan 2017 09:55:35 -0700 Subject: [PATCH 25/93] Added lsrc service methods and lsrc examples --- .../Account-Methods/lsrcExamples.cs | 26 ++++ .../BrightLocal/Services/Lsrc/LsrcOptions.cs | 2 +- .../BrightLocal/Services/Lsrc/LsrcService.cs | 118 +++++++++++++++++- 3 files changed, 142 insertions(+), 4 deletions(-) create mode 100644 BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs new file mode 100644 index 0000000..ff02c78 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace BrightLocal.Examples_version2.Account_Methods +{ + public class lsrcExamples + { + public static BrightLocalLsrc Create() + { + var myLsrc = new LsrcOptions(); + myLsrc.name = "Le Bernardin"; + myLsrc.websiteAddresses = new List() {"le-bernardin.com", "www.le-bernadin.com"}; + myLsrc.searchTerms = "Restaurant, food+nyc, delivery+midtown+manhattan"; + myLsrc.schedule = "Adhoc"; + myLsrc.searchEngines = "google, google-mobile, google-local, yahoo, yahoo-local, bing, bing-local"; + + var lsrcService = new LsrcService(); + + BrightLocalLsrc newLsrc = lsrcService.Create(myLsrc); + return newLsrc; + } + + } +} diff --git a/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcOptions.cs b/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcOptions.cs index e6917dd..0fb009c 100644 --- a/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcOptions.cs @@ -53,4 +53,4 @@ public class LsrcOptions public string isPublic { get; set; } } } -} + diff --git a/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs b/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs index 816540c..fecb48c 100644 --- a/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs +++ b/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs @@ -1,11 +1,123 @@ -using System; +using Newtonsoft.Json; +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using RestSharp; -namespace BrightLocal.Services.Lsrc +namespace BrightLocal { - public class LsrcService + public class LsrcService: BrightLocalService { + public LsrcService(string apiKey = null, string apiSecret = null) : base(apiKey, apiSecret) { } + + BrightLocalRequestor request = new BrightLocalRequestor(); + + public virtual BrightLocalLsrc Create(LsrcOptions createOptions) + { + var url = string.Format(Urls.Lsrc + "{0}", "add"); + createOptions.searchTerms = Parameters.convertToNewline(createOptions.searchTerms); + if(createOptions.businessNames != null) + { + createOptions.businessNames = Parameters.convertToNewline(createOptions.businessNames); + } + if (createOptions.emailAddresses != null) + { + createOptions.emailAddresses = Parameters.convertToNewline(createOptions.emailAddresses); + } + var parameters = Parameters.convertListToParameters(createOptions); + var success = request.Post(Urls.Lsrc, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual BrightLocalLsrc Update(UpdateLsrcOptions updateOptions) + { + var url = string.Format(Urls.Lsrc + "{0}", "update"); + if (updateOptions.searchTerms != null) + { + updateOptions.searchTerms = Parameters.convertToNewline(updateOptions.searchTerms); + } + if (updateOptions.businessNames != null) + { + updateOptions.businessNames = Parameters.convertToNewline(updateOptions.businessNames); + } + if (updateOptions.emailAddresses != null) + { + updateOptions.emailAddresses = Parameters.convertToNewline(updateOptions.emailAddresses); + } + var parameters = Parameters.convertListToParameters(updateOptions); + var success = request.Post(url, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual BrightLocalLsrc Delete(string campaignId) + { + var url = string.Format(Urls.Lsrc + "{0}", "delete"); + var parameters = new Parameters.requestParameters(); + parameters.Add("campaign-id", campaignId); + var success = request.Post(url, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual List GetAll(int? locationId) + { + var url = string.Format(Urls.Lsrc + "{0}", "get-all"); + var parameters = new Parameters.requestParameters(); + if (locationId != null) + { + parameters.Add("location-id", locationId); + } + var results = request.Get(url, parameters, this.api_key, this.api_secret); + + List reports = new List(); + foreach (var report in results.Content[0].ToString()) + { + reports.Add(JsonConvert.DeserializeObject(report.ToString())); + } + return reports; + } + + public virtual BrightLocalLsrc Get(string campaignId) + { + var url = string.Format(Urls.Lsrc + "{0}", "get"); + var parameters = new Parameters.requestParameters(); + parameters.Add("campaign-id", campaignId); + var success = request.Get(url, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual BrightLocalLsrc Run(string campaignId) + { + var url = string.Format(Urls.Lsrc + "{0}", "run"); + var parameters = new Parameters.requestParameters(); + parameters.Add("campaign-id", campaignId); + var success = request.Post(url, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual List GetHistory(string campaignId) + { + var url = string.Format(Urls.Lsrc + "{0}", "history/get"); + var parameters = new Parameters.requestParameters(); + parameters.Add("campaign-id", campaignId); + var results = request.Post(url, parameters, this.api_key, this.api_secret); + + List history = new List(); + foreach (var item in results.Content[0].ToString()) + { + history.Add(JsonConvert.DeserializeObject(item.ToString())); + } + return history; + } + + public virtual IRestResponse GetResults(string campaignId) + { + var url = string.Format(Urls.Lsrc + "{0}", "results/get"); + var parameters = new Parameters.requestParameters(); + parameters.Add("campaign-id", campaignId); + var results = request.Get(url, parameters, this.api_key, this.api_secret); + + return results; + } } } From 15fb6bd8416d7460584e5d574dc7dc8f774cbee1 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Tue, 3 Jan 2017 09:56:48 -0700 Subject: [PATCH 26/93] removed if result.success= true check Get report methods don;t return status, will put check somewhere else. --- .../Infrastructure/BrightLocalRequestor.cs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalRequestor.cs b/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalRequestor.cs index 9436980..d2ea295 100644 --- a/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalRequestor.cs +++ b/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalRequestor.cs @@ -62,19 +62,21 @@ public IRestResponse Call(Method method, string endPoint, Dictionary Date: Tue, 3 Jan 2017 09:57:27 -0700 Subject: [PATCH 27/93] removed forward slash from urls --- .../src/BrightLocal/Services/Clients/ClientService.cs | 4 ++-- .../src/BrightLocal/Services/Locations/LocationService.cs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs b/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs index 1063c26..bb8a819 100644 --- a/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs +++ b/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs @@ -35,7 +35,7 @@ public virtual BrightLocalClient Delete(int clientId) public virtual BrightLocalClient Get(int clientId) { - var url = string.Format(Urls.Clients + "/{0}", clientId); + var url = string.Format(Urls.Clients + "{0}", clientId); var parameters = new Parameters.requestParameters(); var success = request.Get(url, parameters, this.api_key, this.api_secret); return JsonConvert.DeserializeObject(success.Content); @@ -43,7 +43,7 @@ public virtual BrightLocalClient Get(int clientId) public virtual List Search(string query) { - var url = string.Format(Urls.Clients + "/search"); + var url = string.Format(Urls.Clients + "search"); var parameters = new Parameters.requestParameters(); parameters.Add("q", query); var results = request.Get(url, parameters, this.api_key, this.api_secret); diff --git a/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs b/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs index eaab595..2a5c08e 100644 --- a/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs +++ b/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs @@ -19,7 +19,7 @@ public virtual BrightLocalLocation Create(LocationOptions createOptions) public virtual BrightLocalLocation Update(UpdateLocationOptions updateOptions) { - var url = string.Format(Urls.Locations + "/{0}", updateOptions.locationId); + var url = string.Format(Urls.Locations + "{0}", updateOptions.locationId); var parameters = Parameters.convertListToParameters(updateOptions); var success = request.Put(url, parameters, this.api_key, this.api_secret); return JsonConvert.DeserializeObject(success.Content); @@ -27,7 +27,7 @@ public virtual BrightLocalLocation Update(UpdateLocationOptions updateOptions) public virtual BrightLocalLocation Delete(int locationId) { - var url = string.Format(Urls.Locations + "/{0}", locationId); + var url = string.Format(Urls.Locations + "{0}", locationId); var parameters = new Parameters.requestParameters(); var success = request.Delete(url, parameters, this.api_key, this.api_secret); return JsonConvert.DeserializeObject(success.Content); @@ -35,7 +35,7 @@ public virtual BrightLocalLocation Delete(int locationId) public virtual BrightLocalLocation Get(int locationId) { - var url = string.Format(Urls.Locations + "/{0}", locationId); + var url = string.Format(Urls.Locations + "{0}", locationId); var parameters = new Parameters.requestParameters(); var success = request.Get(url, parameters, this.api_key, this.api_secret); return JsonConvert.DeserializeObject(success.Content); @@ -43,7 +43,7 @@ public virtual BrightLocalLocation Get(int locationId) public virtual List Search(string query) { - var url = string.Format(Urls.Locations + "/search"); + var url = string.Format(Urls.Locations + "search"); var parameters = new Parameters.requestParameters(); parameters.Add("q", query); var results = request.Get(url, parameters, this.api_key, this.api_secret); From 07a8470565aeddb17802d39800ef85a0373f0495 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Tue, 3 Jan 2017 09:58:43 -0700 Subject: [PATCH 28/93] added Location link to readme version 2 --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a34da94..a690d63 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ For version 1.0 [Click Here](Documentation/README.md) **BrightLocal API Services** [Clients](#clients) +[Locations](#locations) Quick Start ----------- From fdeade4616b3162175902a14a7fca9022662689c Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Tue, 3 Jan 2017 13:19:12 -0700 Subject: [PATCH 29/93] added lsrc examples and GetResults entity --- .../Account-Methods/lsrcExamples.cs | 71 +++++++++++++++++++ .../Services/Lsrc/GetResultsLsrcOptions.cs | 15 ++++ .../BrightLocal/Services/Lsrc/LsrcService.cs | 39 ++++++---- .../Services/Lsrc/UpdateLsrcOptions.cs | 2 +- 4 files changed, 113 insertions(+), 14 deletions(-) create mode 100644 BrightLocal/src/BrightLocal/Services/Lsrc/GetResultsLsrcOptions.cs diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs index ff02c78..95ff51a 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs @@ -22,5 +22,76 @@ public static BrightLocalLsrc Create() return newLsrc; } + public static BrightLocalLsrc Update() + { + var myLsrc = new UpdateLsrcOptions(); + myLsrc.campaignId = 1; + myLsrc.name = "Le Bernardin"; + myLsrc.websiteAddresses = new List() { "le-bernardin.com", "www.le-bernadin.com" }; + myLsrc.searchTerms = "Restaurant, food+nyc, delivery+midtown+manhattan"; + myLsrc.schedule = "Adhoc"; + myLsrc.searchEngines = "google, google-mobile, google-local, yahoo, yahoo-local, bing, bing-local"; + + var lsrcService = new LsrcService(); + + BrightLocalLsrc updatedLsrc = lsrcService.Update(myLsrc); + return updatedLsrc; + } + + public static BrightLocalLsrc Delete() + { + var campaignId = 1; + + var lsrcService = new LsrcService(); + + BrightLocalLsrc deletedLsrc = lsrcService.Delete(campaignId); + return deletedLsrc; + } + + public static List GetAll() + { + var lsrcService = new LsrcService(); + + List lsrcList = lsrcService.GetAll(); + return lsrcList; + } + + public static BrightLocalLsrc GetReport() + { + var campaignId = 1; + var lsrcService = new LsrcService(); + + BrightLocalLsrc myLsrc = lsrcService.Get(campaignId); + return myLsrc; + } + + public static BrightLocalLsrc Run() + { + var campaignId = 1; + var lsrcService = new LsrcService(); + + BrightLocalLsrc myLsrc = lsrcService.Run(campaignId); + return myLsrc; + } + + public static List GetHistory() + { + var campaignId = 1; + var lsrcService = new LsrcService(); + + List lsrcHistory = lsrcService.GetHistory(campaignId); + return lsrcHistory; + } + + public static Object GetReportResults() + { + var myLsrc = new GetResultsLsrcOptions(); + myLsrc.campaignId = 1; + + var lsrcService = new LsrcService(); + + var lsrcResults = lsrcService.GetResults(myLsrc); + return lsrcResults; + } } } diff --git a/BrightLocal/src/BrightLocal/Services/Lsrc/GetResultsLsrcOptions.cs b/BrightLocal/src/BrightLocal/Services/Lsrc/GetResultsLsrcOptions.cs new file mode 100644 index 0000000..6fe6fe0 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Services/Lsrc/GetResultsLsrcOptions.cs @@ -0,0 +1,15 @@ +using Newtonsoft.Json; + + +namespace BrightLocal +{ + public class GetResultsLsrcOptions + { + [JsonProperty("campaign-id")] + public int campaignId { get; set; } + [JsonProperty("campaign-history-id")] + public int campaignHistoryId { get; set; } + [JsonProperty("previous-campaign-history-id")] + public int previousCampaignHistoryId { get; set; } + } +} diff --git a/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs b/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs index fecb48c..90dc1bd 100644 --- a/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs +++ b/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs @@ -50,7 +50,7 @@ public virtual BrightLocalLsrc Update(UpdateLsrcOptions updateOptions) return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalLsrc Delete(string campaignId) + public virtual BrightLocalLsrc Delete(int campaignId) { var url = string.Format(Urls.Lsrc + "{0}", "delete"); var parameters = new Parameters.requestParameters(); @@ -59,14 +59,27 @@ public virtual BrightLocalLsrc Delete(string campaignId) return JsonConvert.DeserializeObject(success.Content); } - public virtual List GetAll(int? locationId) + public virtual List GetAll(int locationId) { var url = string.Format(Urls.Lsrc + "{0}", "get-all"); - var parameters = new Parameters.requestParameters(); - if (locationId != null) + var parameters = new Parameters.requestParameters(); + parameters.Add("location-id", locationId); + + var results = request.Get(url, parameters, this.api_key, this.api_secret); + + List reports = new List(); + foreach (var report in results.Content[0].ToString()) { - parameters.Add("location-id", locationId); + reports.Add(JsonConvert.DeserializeObject(report.ToString())); } + return reports; + } + + public virtual List GetAll() + { + var url = string.Format(Urls.Lsrc + "{0}", "get-all"); + var parameters = new Parameters.requestParameters(); + var results = request.Get(url, parameters, this.api_key, this.api_secret); List reports = new List(); @@ -77,7 +90,7 @@ public virtual List GetAll(int? locationId) return reports; } - public virtual BrightLocalLsrc Get(string campaignId) + public virtual BrightLocalLsrc Get(int campaignId) { var url = string.Format(Urls.Lsrc + "{0}", "get"); var parameters = new Parameters.requestParameters(); @@ -86,7 +99,7 @@ public virtual BrightLocalLsrc Get(string campaignId) return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalLsrc Run(string campaignId) + public virtual BrightLocalLsrc Run(int campaignId) { var url = string.Format(Urls.Lsrc + "{0}", "run"); var parameters = new Parameters.requestParameters(); @@ -95,7 +108,7 @@ public virtual BrightLocalLsrc Run(string campaignId) return JsonConvert.DeserializeObject(success.Content); } - public virtual List GetHistory(string campaignId) + public virtual List GetHistory(int campaignId) { var url = string.Format(Urls.Lsrc + "{0}", "history/get"); var parameters = new Parameters.requestParameters(); @@ -110,14 +123,14 @@ public virtual List GetHistory(string campaignId) return history; } - public virtual IRestResponse GetResults(string campaignId) + public virtual Object GetResults(GetResultsLsrcOptions lsrcOptions) { var url = string.Format(Urls.Lsrc + "{0}", "results/get"); - var parameters = new Parameters.requestParameters(); - parameters.Add("campaign-id", campaignId); + var parameters = Parameters.convertListToParameters(lsrcOptions); + var results = request.Get(url, parameters, this.api_key, this.api_secret); - - return results; + var report = JsonConvert.DeserializeObject(results.Content); + return report; } } } diff --git a/BrightLocal/src/BrightLocal/Services/Lsrc/UpdateLsrcOptions.cs b/BrightLocal/src/BrightLocal/Services/Lsrc/UpdateLsrcOptions.cs index cfaf104..01169fc 100644 --- a/BrightLocal/src/BrightLocal/Services/Lsrc/UpdateLsrcOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/Lsrc/UpdateLsrcOptions.cs @@ -6,7 +6,7 @@ namespace BrightLocal public class UpdateLsrcOptions { [JsonProperty("campaign-id")] - public string campaignId { get; set; } + public int campaignId { get; set; } [JsonProperty("name")] public string name { get; set; } [JsonProperty("schedule")] From bde6faa354c706dcfaebe2831733f81e4d0cd705 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Tue, 3 Jan 2017 13:35:33 -0700 Subject: [PATCH 30/93] added lsrc examples to readme version 2 --- .../Account-Methods/lsrcExamples.cs | 3 +- README.md | 95 +++++++++++++++++++ 2 files changed, 96 insertions(+), 2 deletions(-) diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs index 95ff51a..019bc0d 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs @@ -40,8 +40,7 @@ public static BrightLocalLsrc Update() public static BrightLocalLsrc Delete() { - var campaignId = 1; - + var campaignId = 1; var lsrcService = new LsrcService(); BrightLocalLsrc deletedLsrc = lsrcService.Delete(campaignId); diff --git a/README.md b/README.md index a690d63..38bec15 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ For version 1.0 [Click Here](Documentation/README.md) [Clients](#clients) [Locations](#locations) +[Local Search Rank Checker ](#Local Search Rank Checker) Quick Start ----------- @@ -179,3 +180,97 @@ to a location id (or not). List results = locationService.Search(searchQuery); // returns a list of type BrightLocalLocation ``` +Local Search Rank Checker +----- + +### Adding a report + +```csharp + var myLsrc = new LsrcOptions(); + myLsrc.name = "Le Bernardin"; + myLsrc.websiteAddresses = new List() {"le-bernardin.com", "www.le-bernadin.com"}; + myLsrc.searchTerms = "Restaurant, food+nyc, delivery+midtown+manhattan"; + myLsrc.schedule = "Adhoc"; + myLsrc.searchEngines = "google, google-mobile, google-local, yahoo, yahoo-local, bing, bing-local"; + + var lsrcService = new LsrcService(); + + BrightLocalLsrc newLsrc = lsrcService.Create(myLsrc); +``` + +The returned BrightLocalClient entity above will have a campaign-id. You will want to persist this for later in order to run and get the report. + +### Updating a report + +```csharp + var myLsrc = new UpdateLsrcOptions(); + myLsrc.campaignId = 1; + myLsrc.name = "Le Bernardin"; + myLsrc.websiteAddresses = new List() { "le-bernardin.com", "www.le-bernadin.com" }; + myLsrc.searchTerms = "Restaurant, food+nyc, delivery+midtown+manhattan"; + myLsrc.schedule = "Adhoc"; + myLsrc.searchEngines = "google, google-mobile, google-local, yahoo, yahoo-local, bing, bing-local"; + + var lsrcService = new LsrcService(); + + BrightLocalLsrc updatedLsrc = lsrcService.Update(myLsrc); +``` + +### Deleting a report + +```csharp + var campaignId = 1; + var lsrcService = new LsrcService(); + + BrightLocalLsrc deletedLsrc = lsrcService.Delete(campaignId); +``` + +### Getting all reports + +```csharp + var lsrcService = new LsrcService(); + + List lsrcList = lsrcService.GetAll(); +``` + +### Getting a report + +```csharp + var campaignId = 1; + var lsrcService = new LsrcService(); + + BrightLocalLsrc myLsrc = lsrcService.Get(campaignId); +``` + +### Running a report + +```csharp + var campaignId = 1; + var lsrcService = new LsrcService(); + + BrightLocalLsrc myLsrc = lsrcService.Run(campaignId); +``` + +### Get report history + +```csharp + var campaignId = 1; + var lsrcService = new LsrcService(); + + List lsrcHistory = lsrcService.GetHistory(campaignId); +``` + +### Get report results + +```csharp + var myLsrc = new GetResultsLsrcOptions(); + myLsrc.campaignId = 1; + + var lsrcService = new LsrcService(); + + var lsrcResults = lsrcService.GetResults(myLsrc); +``` + +The LsrcService.GetResults method above currently returns a json object. In future releases we will have a entity BrightLocalLsrcResults. + + From 1b6d9c73dff0139c6706674ab29a7f9c41c4078a Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Tue, 3 Jan 2017 13:39:49 -0700 Subject: [PATCH 31/93] ficed link in docs for lsrc --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 38bec15..cfe9f43 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ For version 1.0 [Click Here](Documentation/README.md) [Clients](#clients) [Locations](#locations) -[Local Search Rank Checker ](#Local Search Rank Checker) +[Local Search Rank Checker](#local-search-rank-checker) Quick Start ----------- From ff563e1755598e5e0d25f8230cb55169ffe071bc Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Tue, 3 Jan 2017 13:42:06 -0700 Subject: [PATCH 32/93] added trailing spaces after link for link break --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index cfe9f43..86d60d6 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,9 @@ For version 1.0 [Click Here](Documentation/README.md) **BrightLocal API Services** -[Clients](#clients) -[Locations](#locations) -[Local Search Rank Checker](#local-search-rank-checker) +[Clients](#clients) +[Locations](#locations) +[Local Search Rank Checker](#local-search-rank-checker) Quick Start ----------- From e56e07a619ca1a8bef72f6a887619f035894adbc Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Tue, 3 Jan 2017 14:01:13 -0700 Subject: [PATCH 33/93] fixed jsonproperty for email-addresses --- BrightLocal/src/BrightLocal/Services/Lsrc/LsrcOptions.cs | 2 +- BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcOptions.cs b/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcOptions.cs index 0fb009c..acae9ec 100644 --- a/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcOptions.cs @@ -47,7 +47,7 @@ public class LsrcOptions public string includeLocalDirectoryResults { get; set; } [JsonProperty("notify")] public string notify { get; set; } - [JsonProperty("emailAddresses")] + [JsonProperty("email-addresses")] public string emailAddresses { get; set; } [JsonProperty("is-public")] public string isPublic { get; set; } diff --git a/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs b/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs index 90dc1bd..a241e9c 100644 --- a/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs +++ b/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs @@ -1,9 +1,7 @@ using Newtonsoft.Json; using System; using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using RestSharp; + namespace BrightLocal { From 8454c76728c9c3f8959805a99bcb2b5e2f91a7ea Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Wed, 4 Jan 2017 10:12:34 -0700 Subject: [PATCH 34/93] Added all Lscu entities and services --- .../BrightLocal/Entities/BrightLocalLscu.cs | 61 ++++++++++++++ .../Entities/BrightLocalLscuReport.cs | 54 ++++++++++++ .../Entities/BrightLocalLscuSearch.cs | 24 ++++++ .../src/BrightLocal/Infrastructure/Urls.cs | 1 + .../BrightLocal/Services/Lscu/LscuOptions.cs | 72 ++++++++++++++++ .../BrightLocal/Services/Lscu/LscuService.cs | 84 +++++++++++++++++++ .../Services/Lscu/UpdateLscuOptions.cs | 62 ++++++++++++++ 7 files changed, 358 insertions(+) create mode 100644 BrightLocal/src/BrightLocal/Entities/BrightLocalLscu.cs create mode 100644 BrightLocal/src/BrightLocal/Entities/BrightLocalLscuReport.cs create mode 100644 BrightLocal/src/BrightLocal/Entities/BrightLocalLscuSearch.cs create mode 100644 BrightLocal/src/BrightLocal/Services/Lscu/LscuOptions.cs create mode 100644 BrightLocal/src/BrightLocal/Services/Lscu/LscuService.cs create mode 100644 BrightLocal/src/BrightLocal/Services/Lscu/UpdateLscuOptions.cs diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalLscu.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalLscu.cs new file mode 100644 index 0000000..1cdd666 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalLscu.cs @@ -0,0 +1,61 @@ +using Newtonsoft.Json; +using System.Collections.Generic; + +namespace BrightLocal +{ + public class BrightLocalLscu + { + [JsonProperty("report-id")] + public string reportId { get; set; } + [JsonProperty("report-name")] + public string reportName { get; set; } + [JsonProperty("location-id")] + public int locationId { get; set; } + [JsonProperty("white-label-profile-id")] + public int whiteLabelProfileId { get; set; } + [JsonProperty("business-names")] + public List businessNames { get; set; } + [JsonProperty("website-address")] + public string websiteAddress { get; set; } + [JsonProperty("address1")] + public string address1 { get; set; } + [JsonProperty("address2")] + public string address2 { get; set; } + [JsonProperty("area")] + public string area { get; set; } + [JsonProperty("city")] + public string city { get; set; } + [JsonProperty("state-code")] + public string stateCode { get; set; } + [JsonProperty("postcode")] + public string postcode { get; set; } + [JsonProperty("telephone")] + public string telephone { get; set; } + [JsonProperty("country")] + public string country { get; set; } + [JsonProperty("business-category")] + public string businessCategory { get; set; } + [JsonProperty("primary-business-location")] + public string primaryBusinessLocation { get; set; } + [JsonProperty("search-terms")] + public List searchTerms { get; set; } + [JsonProperty("google-location")] + public string googleLocation { get; set; } + [JsonProperty("bing-location")] + public string bingLocation { get; set; } + [JsonProperty("notify")] + public string notify { get; set; } + [JsonProperty("email-addresses")] + public string emailAddresses { get; set; } + [JsonProperty("facebook-url")] + public string facebookUrl { get; set; } + [JsonProperty("twitter-url")] + public string twitterUrl { get; set; } + [JsonProperty("is-public")] + public string isPublic { get; set; } + [JsonProperty("local-directory-urls")] + public LocalDirectoryUrls localDirectoryUrls { get; set; } + [JsonProperty("run-report")] + public string runReport { get; set; } + } +} diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalLscuReport.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalLscuReport.cs new file mode 100644 index 0000000..d96e679 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalLscuReport.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace BrightLocal +{ + public class BrightLocalLscuReport + { + public string report_id { get; set; } + public string customer_id { get; set; } + public string location_id { get; set; } + public string company_name { get; set; } + public string name { get; set; } + public string white_label_profile_id { get; set; } + public string business_names { get; set; } + public string website_address { get; set; } + public string telephone { get; set; } + public string address_1 { get; set; } + public string address_2 { get; set; } + public string area { get; set; } + public string city { get; set; } + public string state_code { get; set; } + public string postcode { get; set; } + public string country { get; set; } + public string business_category { get; set; } + public string primary_business_location { get; set; } + public string search_terms { get; set; } + public string notify { get; set; } + public string email_addresses { get; set; } + public string date_added { get; set; } + public string last_start_time { get; set; } + public string last_end_time { get; set; } + public string last_message { get; set; } + public string generation_error { get; set; } + public string currently_running { get; set; } + public string facebook { get; set; } + public string twitter { get; set; } + public string google_location { get; set; } + public string bing_location { get; set; } + public object previous_bing_location { get; set; } + public string is_public { get; set; } + public string public_key { get; set; } + public LatestRun latest_run { get; set; } + } + + public class LatestRun + { + public string interactive_url { get; set; } + public string pdf_url { get; set; } + public string public_interactive_url { get; set; } + public string public_pdf_url { get; set; } + } +} diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalLscuSearch.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalLscuSearch.cs new file mode 100644 index 0000000..ad93527 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalLscuSearch.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace BrightLocal +{ + public class BrightLocalLscuSearch + { + public bool success { get; set; } + public List reports { get; set; } + } + + public class Report + { + public string report_id { get; set; } + public string report_name { get; set; } + public string location_id { get; set; } + public string date_added { get; set; } + public string last_run_date { get; set; } + public string last_message { get; set; } + public string currently_running { get; set; } + } +} diff --git a/BrightLocal/src/BrightLocal/Infrastructure/Urls.cs b/BrightLocal/src/BrightLocal/Infrastructure/Urls.cs index 56a73ff..cc7a77b 100644 --- a/BrightLocal/src/BrightLocal/Infrastructure/Urls.cs +++ b/BrightLocal/src/BrightLocal/Infrastructure/Urls.cs @@ -11,6 +11,7 @@ internal static class Urls internal static string Clients => "/v1/clients-and-locations/clients/"; internal static string Locations => "/v1/clients-and-locations/locations/"; internal static string Lsrc => "/v2/lsrc/"; + internal static string Lscu => "/v4/lscu"; } } diff --git a/BrightLocal/src/BrightLocal/Services/Lscu/LscuOptions.cs b/BrightLocal/src/BrightLocal/Services/Lscu/LscuOptions.cs new file mode 100644 index 0000000..7a5aaee --- /dev/null +++ b/BrightLocal/src/BrightLocal/Services/Lscu/LscuOptions.cs @@ -0,0 +1,72 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; + + +namespace BrightLocal +{ + public class LscuOptions + { + [JsonProperty("report-name")] + public string reportName { get; set; } + [JsonProperty("location-id")] + public int locationId { get; set; } + [JsonProperty("white-label-profile-id")] + public int whiteLabelProfileId { get; set; } + [JsonProperty("business-names")] + public List businessNames { get; set; } + [JsonProperty("website-address")] + public string websiteAddress { get; set; } + [JsonProperty("address1")] + public string address1 { get; set; } + [JsonProperty("address2")] + public string address2 { get; set; } + [JsonProperty("area")] + public string area { get; set; } + [JsonProperty("city")] + public string city { get; set; } + [JsonProperty("state-code")] + public string stateCode { get; set; } + [JsonProperty("postcode")] + public string postcode { get; set; } + [JsonProperty("telephone")] + public string telephone { get; set; } + [JsonProperty("country")] + public string country { get; set; } + [JsonProperty("business-category")] + public string businessCategory { get; set; } + [JsonProperty("primary-business-location")] + public string primaryBusinessLocation { get; set; } + [JsonProperty("search-terms")] + public List searchTerms { get; set; } + [JsonProperty("google-location")] + public string googleLocation { get; set; } + [JsonProperty("bing-location")] + public string bingLocation { get; set; } + [JsonProperty("notify")] + public string notify { get; set; } + [JsonProperty("email-addresses")] + public string emailAddresses { get; set; } + [JsonProperty("facebook-url")] + public string facebookUrl { get; set; } + [JsonProperty("twitter-url")] + public string twitterUrl { get; set; } + [JsonProperty("is-public")] + public string isPublic { get; set; } + [JsonProperty("local-directory-urls")] + public LocalDirectoryUrls localDirectoryUrls { get; set; } + [JsonProperty("run-report")] + public string runReport { get; set; } + } + + public class LocalDirectoryUrls: Dictionary + { + + } + + public class DirectoryUrls + { + public string url { get; set; } + public string include { get; set; } + } +} diff --git a/BrightLocal/src/BrightLocal/Services/Lscu/LscuService.cs b/BrightLocal/src/BrightLocal/Services/Lscu/LscuService.cs new file mode 100644 index 0000000..ed3cb79 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Services/Lscu/LscuService.cs @@ -0,0 +1,84 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; + + +namespace BrightLocal +{ + public class LscuService: BrightLocalService + { + public LscuService(string apiKey = null, string apiSecret = null) : base(apiKey, apiSecret) { } + + BrightLocalRequestor request = new BrightLocalRequestor(); + + public virtual BrightLocalLscu Create(LscuOptions createOptions) + { + var parameters = Parameters.convertListToParameters(createOptions); + var success = request.Post(Urls.Lscu, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual BrightLocalLscu Update(UpdateLscuOptions updateOptions) + { + var parameters = Parameters.convertListToParameters(updateOptions); + var success = request.Put(Urls.Lscu, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual BrightLocalLscuReport Get(int reportId) + { + var parameters = new Parameters.requestParameters(); + parameters.Add("report-id", reportId); + var success = request.Get(Urls.Lscu, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + // returns success or failed as a string message + public virtual string Run(int reportId) + { + string response; + var url = string.Format(Urls.Lscu + "{0}", "run"); + var parameters = new Parameters.requestParameters(); + parameters.Add("report-id", reportId); + var success = request.Post(Urls.Lscu, parameters, this.api_key, this.api_secret); + if(JsonConvert.DeserializeObject(success.Content)) + { + response = "Success, your report is running"; + } + else + { + response = "Falied, " + success.Content; + } + + return response; + } + + // returns success or failed as a string message + public virtual string Delete(int reportId) + { + string response; + var parameters = new Parameters.requestParameters(); + parameters.Add("report-id", reportId); + var success = request.Delete(Urls.Lscu, parameters, this.api_key, this.api_secret); + if (JsonConvert.DeserializeObject(success.Content)) + { + response = "Success, your report has been deleted"; + } + else + { + response = "Falied, " + success.Content; + } + + return response; + } + + public virtual BrightLocalLscuSearch Search(string query) + { + var url = string.Format(Urls.Lscu + "{0}", "search"); + var parameters = new Parameters.requestParameters(); + parameters.Add("q", query); + var success = request.Get(Urls.Lscu, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + } +} diff --git a/BrightLocal/src/BrightLocal/Services/Lscu/UpdateLscuOptions.cs b/BrightLocal/src/BrightLocal/Services/Lscu/UpdateLscuOptions.cs new file mode 100644 index 0000000..d9d8f7a --- /dev/null +++ b/BrightLocal/src/BrightLocal/Services/Lscu/UpdateLscuOptions.cs @@ -0,0 +1,62 @@ +using Newtonsoft.Json; +using System.Collections.Generic; + + +namespace BrightLocal +{ + public class UpdateLscuOptions + { + [JsonProperty("report-id")] + public string reportId { get; set; } + [JsonProperty("report-name")] + public string reportName { get; set; } + [JsonProperty("location-id")] + public int locationId { get; set; } + [JsonProperty("white-label-profile-id")] + public int whiteLabelProfileId { get; set; } + [JsonProperty("business-names")] + public List businessNames { get; set; } + [JsonProperty("website-address")] + public string websiteAddress { get; set; } + [JsonProperty("address1")] + public string address1 { get; set; } + [JsonProperty("address2")] + public string address2 { get; set; } + [JsonProperty("area")] + public string area { get; set; } + [JsonProperty("city")] + public string city { get; set; } + [JsonProperty("state-code")] + public string stateCode { get; set; } + [JsonProperty("postcode")] + public string postcode { get; set; } + [JsonProperty("telephone")] + public string telephone { get; set; } + [JsonProperty("country")] + public string country { get; set; } + [JsonProperty("business-category")] + public string businessCategory { get; set; } + [JsonProperty("primary-business-location")] + public string primaryBusinessLocation { get; set; } + [JsonProperty("search-terms")] + public List searchTerms { get; set; } + [JsonProperty("google-location")] + public string googleLocation { get; set; } + [JsonProperty("bing-location")] + public string bingLocation { get; set; } + [JsonProperty("notify")] + public string notify { get; set; } + [JsonProperty("email-addresses")] + public string emailAddresses { get; set; } + [JsonProperty("facebook-url")] + public string facebookUrl { get; set; } + [JsonProperty("twitter-url")] + public string twitterUrl { get; set; } + [JsonProperty("is-public")] + public string isPublic { get; set; } + [JsonProperty("local-directory-urls")] + public LocalDirectoryUrls localDirectoryUrls { get; set; } + [JsonProperty("run-report")] + public string runReport { get; set; } + } +} From bcfed31810609c3f3a76ff67f7fca08fb8862cd2 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Wed, 4 Jan 2017 10:13:36 -0700 Subject: [PATCH 35/93] Replaced check with if result.success == false --- .../Infrastructure/BrightLocalRequestor.cs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalRequestor.cs b/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalRequestor.cs index d2ea295..7c77dea 100644 --- a/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalRequestor.cs +++ b/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalRequestor.cs @@ -61,16 +61,15 @@ public IRestResponse Call(Method method, string endPoint, Dictionary Date: Wed, 4 Jan 2017 10:29:03 -0700 Subject: [PATCH 36/93] added json properties to entity --- .../BrightLocal/Entities/BrightLocalLscuSearch.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalLscuSearch.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalLscuSearch.cs index ad93527..6422eb5 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalLscuSearch.cs +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalLscuSearch.cs @@ -1,4 +1,5 @@ -using System; +using Newtonsoft.Json; +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; @@ -7,18 +8,27 @@ namespace BrightLocal { public class BrightLocalLscuSearch { + [JsonProperty("success")] public bool success { get; set; } + [JsonProperty("reports")] public List reports { get; set; } } public class Report { + [JsonProperty("report_id")] public string report_id { get; set; } + [JsonProperty("report_name")] public string report_name { get; set; } + [JsonProperty("location_id")] public string location_id { get; set; } + [JsonProperty("date_added")] public string date_added { get; set; } + [JsonProperty("last_run_date")] public string last_run_date { get; set; } + [JsonProperty("last_message")] public string last_message { get; set; } + [JsonProperty("currently_running")] public string currently_running { get; set; } } } From 22e5a309b46d491511eb235c86ac20bf1de80b05 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Wed, 4 Jan 2017 10:52:56 -0700 Subject: [PATCH 37/93] added lscuExamples --- .../Account-Methods/lscuExamples.cs | 116 ++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lscuExamples.cs diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lscuExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lscuExamples.cs new file mode 100644 index 0000000..a344cf0 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lscuExamples.cs @@ -0,0 +1,116 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace BrightLocal.Examples_version2.Account_Methods +{ + public class lscuExamples + { + public static BrightLocalLscu Create() + { + LscuOptions myLscu = new LscuOptions(); + myLscu.reportName = "Sample SEO Chek-Up Report"; + myLscu.businessNames = new List() {"Le Bernardin", "Le Bernardin Cafe"}; + myLscu.websiteAddress = "le-bernardin.com"; + myLscu.address1 = "155 Weest 51st Street"; + myLscu.address2 = ""; + myLscu.city = "New York"; + myLscu.stateCode = "NY"; + myLscu.postcode = "10019"; + myLscu.telephone = "+1 212-554-1515"; + myLscu.country = "USA"; + myLscu.businessCategory = "Restaurant"; + myLscu.primaryBusinessLocation = "NY, New York"; + myLscu.searchTerms = new List() { "restaurant manhattan", "cafe new york" }; + + + // Example for supplying Local Directory URLs (see local-directory-urls parameter) + myLscu.localDirectoryUrls.Add( + "citysearch", + new DirectoryUrls + { + url = "http://www.yelp.co.uk/biz/greens-restaurant-san-francisco-3", + include = "yes" + }); + myLscu.localDirectoryUrls.Add( + "dexknows", + new DirectoryUrls + { + url = "", + include = "yes" + }); + + var lscuService = new LscuService(); + + BrightLocalLscu newLscu = lscuService.Create(myLscu); + + return newLscu; + } + + public static BrightLocalLscu Update() + { + UpdateLscuOptions myLscu = new UpdateLscuOptions(); + myLscu.reportName = "Sample SEO Chek-Up Report"; + myLscu.businessNames = new List() { "Le Bernardin", "Le Bernardin Cafe" }; + myLscu.websiteAddress = "le-bernardin.com"; + myLscu.address1 = "155 Weest 51st Street"; + myLscu.address2 = ""; + myLscu.city = "New York"; + myLscu.stateCode = "NY"; + myLscu.postcode = "10019"; + myLscu.telephone = "+1 212-554-1515"; + myLscu.country = "USA"; + myLscu.businessCategory = "Restaurant"; + myLscu.primaryBusinessLocation = "NY, New York"; + myLscu.searchTerms = new List() { "restaurant manhattan", "cafe new york" }; + + var lscuService = new LscuService(); + + BrightLocalLscu updateLscu = lscuService.Update(myLscu); + + return updateLscu; + } + + public static BrightLocalLscuReport Get() + { + var reportId = 1; + + var lscuService = new LscuService(); + + BrightLocalLscuReport lscuReport = lscuService.Get(reportId); + return lscuReport; + + } + + public static string Run() + { + var reportId = 1; + + var lscuService = new LscuService(); + + var success = lscuService.Run(reportId); + return success; + } + + public static string Delete() + { + var reportId = 1; + + var lscuService = new LscuService(); + + var success = lscuService.Delete(reportId); + return success; + } + + public static BrightLocalLscuSearch Search() + { + var searchQuery = "Bodega Wine Bar"; + + var lscuService = new LscuService(); + + BrightLocalLscuSearch lscuSearch = lscuService.Search(searchQuery); + return lscuSearch; + } + } +} From 4592fa6147f7cfd04e5b736b56615cbc68e26e9e Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Wed, 4 Jan 2017 11:06:53 -0700 Subject: [PATCH 38/93] added lscu examples to git readme --- .../Account-Methods/lscuExamples.cs | 4 - README.md | 109 ++++++++++++++++++ 2 files changed, 109 insertions(+), 4 deletions(-) diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lscuExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lscuExamples.cs index a344cf0..d478682 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lscuExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lscuExamples.cs @@ -75,7 +75,6 @@ public static BrightLocalLscu Update() public static BrightLocalLscuReport Get() { var reportId = 1; - var lscuService = new LscuService(); BrightLocalLscuReport lscuReport = lscuService.Get(reportId); @@ -86,7 +85,6 @@ public static BrightLocalLscuReport Get() public static string Run() { var reportId = 1; - var lscuService = new LscuService(); var success = lscuService.Run(reportId); @@ -96,7 +94,6 @@ public static string Run() public static string Delete() { var reportId = 1; - var lscuService = new LscuService(); var success = lscuService.Delete(reportId); @@ -106,7 +103,6 @@ public static string Delete() public static BrightLocalLscuSearch Search() { var searchQuery = "Bodega Wine Bar"; - var lscuService = new LscuService(); BrightLocalLscuSearch lscuSearch = lscuService.Search(searchQuery); diff --git a/README.md b/README.md index 86d60d6..729c605 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ For version 1.0 [Click Here](Documentation/README.md) [Clients](#clients) [Locations](#locations) [Local Search Rank Checker](#local-search-rank-checker) +[Local SEO Check-up](#local-seo-check-up) Quick Start ----------- @@ -273,4 +274,112 @@ The returned BrightLocalClient entity above will have a campaign-id. You will wa The LsrcService.GetResults method above currently returns a json object. In future releases we will have a entity BrightLocalLsrcResults. +Local SEO Check-up +----- + +### Adding a report + +```csharp + LscuOptions myLscu = new LscuOptions(); + myLscu.reportName = "Sample SEO Chek-Up Report"; + myLscu.businessNames = new List() {"Le Bernardin", "Le Bernardin Cafe"}; + myLscu.websiteAddress = "le-bernardin.com"; + myLscu.address1 = "155 Weest 51st Street"; + myLscu.address2 = ""; + myLscu.city = "New York"; + myLscu.stateCode = "NY"; + myLscu.postcode = "10019"; + myLscu.telephone = "+1 212-554-1515"; + myLscu.country = "USA"; + myLscu.businessCategory = "Restaurant"; + myLscu.primaryBusinessLocation = "NY, New York"; + myLscu.searchTerms = new List() { "restaurant manhattan", "cafe new york" }; + + var lscuService = new LscuService(); + + BrightLocalLscu newLscu = lscuService.Create(myLscu); +``` + +The returned BrightLocalLscu entity above will have a report-id. You will want to persist this for later when you get and run a report. + +### Supplying Local Directory URLs (see local-directory-urls parameter) + +```csharp + LscuOptions myLscu = new LscuOptions(); + myLscu.localDirectoryUrls.Add( + "citysearch", + new DirectoryUrls + { + url = "http://www.yelp.co.uk/biz/greens-restaurant-san-francisco-3", + include = "yes" + }); + myLscu.localDirectoryUrls.Add( + "dexknows", + new DirectoryUrls + { + url = "", + include = "yes" + }); +``` + +### Updating a report + +```csharp + UpdateLscuOptions myLscu = new UpdateLscuOptions(); + myLscu.reportName = "Sample SEO Chek-Up Report"; + myLscu.businessNames = new List() { "Le Bernardin", "Le Bernardin Cafe" }; + myLscu.websiteAddress = "le-bernardin.com"; + myLscu.address1 = "155 Weest 51st Street"; + myLscu.address2 = ""; + myLscu.city = "New York"; + myLscu.stateCode = "NY"; + myLscu.postcode = "10019"; + myLscu.telephone = "+1 212-554-1515"; + myLscu.country = "USA"; + myLscu.businessCategory = "Restaurant"; + myLscu.primaryBusinessLocation = "NY, New York"; + myLscu.searchTerms = new List() { "restaurant manhattan", "cafe new york" }; + + var lscuService = new LscuService(); + + BrightLocalLscu updateLscu = lscuService.Update(myLscu); +``` + +### Getting a report + +```csharp + var reportId = 1; + var lscuService = new LscuService(); + + BrightLocalLscuReport lscuReport = lscuService.Get(reportId); +``` + +### Running a report + +```csharp + var reportId = 1; + var lscuService = new LscuService(); + + var success = lscuService.Run(reportId); +``` +The returned success entity above is of type string. Success or Failure with errors. + +### Deleting a report + +```csharp + var reportId = 1; + var lscuService = new LscuService(); + + var success = lscuService.Delete(reportId); +``` +The returned success entity above is of type string. Success or Failure with errors. + +### Searching for a report + +```csharp + var searchQuery = "Bodega Wine Bar"; + var lscuService = new LscuService(); + + BrightLocalLscuSearch lscuSearch = lscuService.Search(searchQuery); +``` From 9c678c44a8dbce4ab1c597600f022b5350e1bedc Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Wed, 4 Jan 2017 13:17:21 -0700 Subject: [PATCH 39/93] added Citation tracker entities and services --- .../Entities/BrightLocalCitationTracker.cs | 53 ++++++++++++++ .../BrightLocalCitationTrackerGetAll.cs | 20 ++++++ .../BrightLocalCitationTrackerReport.cs | 60 ++++++++++++++++ .../Entities/BrightLocalLscuSearch.cs | 4 +- .../src/BrightLocal/Infrastructure/Urls.cs | 3 +- .../CitationTracker/CitationTrackerOptions.cs | 53 ++++++++++++++ .../CitationTracker/CitationTrackerService.cs | 72 +++++++++++++++++++ .../UpdateCitationTrackerOptions.cs | 55 ++++++++++++++ .../BrightLocal/Services/Lsrc/LsrcService.cs | 1 + 9 files changed, 318 insertions(+), 3 deletions(-) create mode 100644 BrightLocal/src/BrightLocal/Entities/BrightLocalCitationTracker.cs create mode 100644 BrightLocal/src/BrightLocal/Entities/BrightLocalCitationTrackerGetAll.cs create mode 100644 BrightLocal/src/BrightLocal/Entities/BrightLocalCitationTrackerReport.cs create mode 100644 BrightLocal/src/BrightLocal/Services/CitationTracker/CitationTrackerOptions.cs create mode 100644 BrightLocal/src/BrightLocal/Services/CitationTracker/CitationTrackerService.cs create mode 100644 BrightLocal/src/BrightLocal/Services/CitationTracker/UpdateCitationTrackerOptions.cs diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalCitationTracker.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalCitationTracker.cs new file mode 100644 index 0000000..d4b7090 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalCitationTracker.cs @@ -0,0 +1,53 @@ +using Newtonsoft.Json; + +namespace BrightLocal +{ + public class BrightLocalCitationTracker + { + [JsonProperty("report-id")] + public int reportId { get; set; } + [JsonProperty("location-id")] + public int locationId { get; set; } + [JsonProperty("report-name")] + public string reportName { get; set; } + [JsonProperty("business-name")] + public string businessName { get; set; } + [JsonProperty("business-location")] + public string businessLocation { get; set; } + [JsonProperty("old-business-name-1")] + public string oldBusinessName1 { get; set; } + [JsonProperty("old-business-name-2")] + public string oldBusinessName2 { get; set; } + [JsonProperty("postcode")] + public string postcode { get; set; } + [JsonProperty("old-postcode-1")] + public string oldPostcode1 { get; set; } + [JsonProperty("old-postcode-2")] + public string oldPostcode2 { get; set; } + [JsonProperty("country")] + public string country { get; set; } + [JsonProperty("phone")] + public string phone { get; set; } + [JsonProperty("website")] + public string website { get; set; } + [JsonProperty("business-type")] + public string businessType { get; set; } + [JsonProperty("state-code")] + public string stateCode { get; set; } + [JsonProperty("monthly-run")] + public int monthlyRun { get; set; } + [JsonProperty("weekly-run")] + public int weeklyRun { get; set; } + [JsonProperty("white-label-profile-id")] + public int whiteLabelProfileId { get; set; } + [JsonProperty("active-only")] + public string activeOnly { get; set; } + public string notify { get; set; } + [JsonProperty("email-addresses")] + public string emailAddresses { get; set; } + [JsonProperty("is-public")] + public string isPublic { get; set; } + [JsonProperty("status")] + public string status { get; set; } + } +} diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalCitationTrackerGetAll.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalCitationTrackerGetAll.cs new file mode 100644 index 0000000..fb8d3ed --- /dev/null +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalCitationTrackerGetAll.cs @@ -0,0 +1,20 @@ +using System.Collections.Generic; + +namespace BrightLocal +{ + public class BrightLocalCitationTrackerGetAll + { + public List results { get; set; } + } + + public class CitationTrackerAll + { + public string campaign_id { get; set; } + public string name { get; set; } + public string schedule { get; set; } + public string day_of_week { get; set; } + public string day_of_month { get; set; } + public string location_id { get; set; } + } + +} diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalCitationTrackerReport.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalCitationTrackerReport.cs new file mode 100644 index 0000000..c17e760 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalCitationTrackerReport.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace BrightLocal +{ + public class BrightLocalCitationTrackerReport + { + public bool success { get; set; } + public CtReport report { get; set; } + } + + public class CtReport + { + public string report_id { get; set; } + public string customer_id { get; set; } + public string location_id { get; set; } + public string weekly_run { get; set; } + public string monthly_run { get; set; } + public string report_name { get; set; } + public string website_address { get; set; } + public string business_name { get; set; } + public string business_location { get; set; } + public string postcode { get; set; } + public string country { get; set; } + public object state_code { get; set; } + public string address1 { get; set; } + public string address2 { get; set; } + public string telephone { get; set; } + public string business_type { get; set; } + public string primary_location { get; set; } + public string last_run_id { get; set; } + public string old_business_name_1 { get; set; } + public string old_postcode_1 { get; set; } + public string old_business_name_2 { get; set; } + public string old_postcode_2 { get; set; } + public string last_run { get; set; } + public string company_name { get; set; } + public string white_label_profile_id { get; set; } + public string notify { get; set; } + public string email_addresses { get; set; } + public string active_only { get; set; } + public string is_public { get; set; } + public string public_key { get; set; } + public string created { get; set; } + public string status { get; set; } + public CtUrls urls { get; set; } + } + + public class CtUrls + { + public string interactive_url { get; set; } + public string pdf_url { get; set; } + public string csv_url { get; set; } + public string public_interactive_url { get; set; } + public string public_pdf_url { get; set; } + public string public_csv_url { get; set; } + } +} diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalLscuSearch.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalLscuSearch.cs index 6422eb5..d8bc55e 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalLscuSearch.cs +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalLscuSearch.cs @@ -11,10 +11,10 @@ public class BrightLocalLscuSearch [JsonProperty("success")] public bool success { get; set; } [JsonProperty("reports")] - public List reports { get; set; } + public List reports { get; set; } } - public class Report + public class LscuReport { [JsonProperty("report_id")] public string report_id { get; set; } diff --git a/BrightLocal/src/BrightLocal/Infrastructure/Urls.cs b/BrightLocal/src/BrightLocal/Infrastructure/Urls.cs index cc7a77b..086b876 100644 --- a/BrightLocal/src/BrightLocal/Infrastructure/Urls.cs +++ b/BrightLocal/src/BrightLocal/Infrastructure/Urls.cs @@ -11,7 +11,8 @@ internal static class Urls internal static string Clients => "/v1/clients-and-locations/clients/"; internal static string Locations => "/v1/clients-and-locations/locations/"; internal static string Lsrc => "/v2/lsrc/"; - internal static string Lscu => "/v4/lscu"; + internal static string Lscu => "/v4/lscu/"; + internal static string CitationTracker => "/v2/ct/"; } } diff --git a/BrightLocal/src/BrightLocal/Services/CitationTracker/CitationTrackerOptions.cs b/BrightLocal/src/BrightLocal/Services/CitationTracker/CitationTrackerOptions.cs new file mode 100644 index 0000000..9202310 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Services/CitationTracker/CitationTrackerOptions.cs @@ -0,0 +1,53 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace BrightLocal +{ + public class CitationTrackerOptions + { + [JsonProperty("location-id")] + public int locationId { get; set; } + [JsonProperty("report-name")] + public string reportName { get; set; } + [JsonProperty("business-name")] + public string businessName { get; set; } + [JsonProperty("business-location")] + public string businessLocation { get; set; } + [JsonProperty("old-business-name-1")] + public string oldBusinessName1 { get; set; } + [JsonProperty("old-business-name-2")] + public string oldBusinessName2 { get; set; } + [JsonProperty("postcode")] + public string postcode { get; set; } + [JsonProperty("old-postcode-1")] + public string oldPostcode1 { get; set; } + [JsonProperty("old-postcode-2")] + public string oldPostcode2 { get; set; } + [JsonProperty("country")] + public string country { get; set; } + [JsonProperty("phone")] + public string phone { get; set; } + [JsonProperty("website")] + public string website { get; set; } + [JsonProperty("business-type")] + public string businessType { get; set; } + [JsonProperty("state-code")] + public string stateCode { get; set; } + [JsonProperty("monthly-run")] + public int monthlyRun { get; set; } + [JsonProperty("weekly-run")] + public int weeklyRun { get; set; } + [JsonProperty("white-label-profile-id")] + public int whiteLabelProfileId { get; set; } + [JsonProperty("active-only")] + public string activeOnly {get;set;} + public string notify { get; set; } + [JsonProperty("email-addresses")] + public string emailAddresses { get; set; } + [JsonProperty("is-public")] + public string isPublic { get; set; } + } +} diff --git a/BrightLocal/src/BrightLocal/Services/CitationTracker/CitationTrackerService.cs b/BrightLocal/src/BrightLocal/Services/CitationTracker/CitationTrackerService.cs new file mode 100644 index 0000000..62e0cc0 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Services/CitationTracker/CitationTrackerService.cs @@ -0,0 +1,72 @@ +using Newtonsoft.Json; + +namespace BrightLocal +{ + public class CitationTrackerService: BrightLocalService + { + public CitationTrackerService(string apiKey = null, string apiSecret = null) : base(apiKey, apiSecret) { } + + BrightLocalRequestor request = new BrightLocalRequestor(); + + public virtual BrightLocalCitationTracker Create(CitationTrackerOptions createOptions) + { + var url = string.Format(Urls.CitationTracker + "{0}", "add"); + var parameters = Parameters.convertListToParameters(createOptions); + var success = request.Post(url, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual BrightLocalCitationTracker Update(UpdateCitationTrackerOptions updateOptions) + { + var url = string.Format(Urls.CitationTracker + "{0}", "update"); + var parameters = Parameters.convertListToParameters(updateOptions); + var success = request.Post(url, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual BrightLocalCitationTrackerReport Get(int reportId) + { + var url = string.Format(Urls.CitationTracker + "{0}", "get"); + var parameters = new Parameters.requestParameters(); + parameters.Add("report-id", reportId); + var success = request.Post(url, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual BrightLocalCitationTracker Run(int reportId) + { + var url = string.Format(Urls.CitationTracker + "{0}", "run"); + var parameters = new Parameters.requestParameters(); + parameters.Add("report-id", reportId); + var success = request.Post(url, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual BrightLocalCitationTracker Delete(int reportId) + { + var url = string.Format(Urls.CitationTracker + "{0}", "delete"); + var parameters = new Parameters.requestParameters(); + parameters.Add("report-id", reportId); + var success = request.Post(url, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + //method overlaod for supplying the location-id parameter + public virtual BrightLocalCitationTrackerGetAll GetAll(int locationId) + { + var url = string.Format(Urls.CitationTracker + "{0}", "get-all"); + var parameters = new Parameters.requestParameters(); + parameters.Add("location-id", locationId); + var success = request.Post(url, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual BrightLocalCitationTrackerGetAll GetAll() + { + var url = string.Format(Urls.CitationTracker + "{0}", "get-all"); + var parameters = new Parameters.requestParameters(); + var success = request.Post(url, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + } +} diff --git a/BrightLocal/src/BrightLocal/Services/CitationTracker/UpdateCitationTrackerOptions.cs b/BrightLocal/src/BrightLocal/Services/CitationTracker/UpdateCitationTrackerOptions.cs new file mode 100644 index 0000000..9aeb9b7 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Services/CitationTracker/UpdateCitationTrackerOptions.cs @@ -0,0 +1,55 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace BrightLocal +{ + public class UpdateCitationTrackerOptions + { + [JsonProperty("report-id")] + public int reportId { get; set; } + [JsonProperty("location-id")] + public int locationId { get; set; } + [JsonProperty("report-name")] + public string reportName { get; set; } + [JsonProperty("business-name")] + public string businessName { get; set; } + [JsonProperty("business-location")] + public string businessLocation { get; set; } + [JsonProperty("old-business-name-1")] + public string oldBusinessName1 { get; set; } + [JsonProperty("old-business-name-2")] + public string oldBusinessName2 { get; set; } + [JsonProperty("postcode")] + public string postcode { get; set; } + [JsonProperty("old-postcode-1")] + public string oldPostcode1 { get; set; } + [JsonProperty("old-postcode-2")] + public string oldPostcode2 { get; set; } + [JsonProperty("country")] + public string country { get; set; } + [JsonProperty("phone")] + public string phone { get; set; } + [JsonProperty("website")] + public string website { get; set; } + [JsonProperty("business-type")] + public string businessType { get; set; } + [JsonProperty("state-code")] + public string stateCode { get; set; } + [JsonProperty("monthly-run")] + public int monthlyRun { get; set; } + [JsonProperty("weekly-run")] + public int weeklyRun { get; set; } + [JsonProperty("white-label-profile-id")] + public int whiteLabelProfileId { get; set; } + [JsonProperty("active-only")] + public string activeOnly { get; set; } + public string notify { get; set; } + [JsonProperty("email-addresses")] + public string emailAddresses { get; set; } + [JsonProperty("is-public")] + public string isPublic { get; set; } + } +} diff --git a/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs b/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs index a241e9c..0a5d032 100644 --- a/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs +++ b/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs @@ -57,6 +57,7 @@ public virtual BrightLocalLsrc Delete(int campaignId) return JsonConvert.DeserializeObject(success.Content); } + //method overlaod for supplying the location-id parameter public virtual List GetAll(int locationId) { var url = string.Format(Urls.Lsrc + "{0}", "get-all"); From 6fc09c5744251cc8d2e44dd54254b448931e9ac2 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Wed, 4 Jan 2017 14:03:47 -0700 Subject: [PATCH 40/93] Added lsrc history & lsrc report entitities and fixed lsrc service and doc examples --- .../Entities/BrightLocalLsrcHistory.cs | 5 ++ .../Entities/BrightLocalLsrcReport.cs | 77 +++++++++++++++++++ .../Account-Methods/lsrcExamples.cs | 12 +-- .../BrightLocal/Services/Lsrc/LsrcService.cs | 34 +++----- README.md | 6 +- 5 files changed, 101 insertions(+), 33 deletions(-) create mode 100644 BrightLocal/src/BrightLocal/Entities/BrightLocalLsrcReport.cs diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalLsrcHistory.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalLsrcHistory.cs index 65d55f6..67e1dd2 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalLsrcHistory.cs +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalLsrcHistory.cs @@ -7,6 +7,11 @@ namespace BrightLocal { public class BrightLocalLsrcHistory + { + public List reports { get; set; } + } + + public class LsrcHistory { [JsonProperty("campaign_history_id")] public string campaignHistoryId { get; set; } diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalLsrcReport.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalLsrcReport.cs new file mode 100644 index 0000000..8e395c4 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalLsrcReport.cs @@ -0,0 +1,77 @@ +using Newtonsoft.Json; +using System.Collections.Generic; + +namespace BrightLocal +{ + public class BrightLocalLsrcReport + { + [JsonProperty("campaign_id")] + public string campaign_id { get; set; } + [JsonProperty("customer_id")] + public string customer_id { get; set; } + [JsonProperty("white_label_profile_id")] + public string white_label_profile_id { get; set; } + [JsonProperty("location_id")] + public string location_id { get; set; } + [JsonProperty("name")] + public string name { get; set; } + [JsonProperty("schedule")] + public string schedule { get; set; } + [JsonProperty("day_of_week")] + public string day_of_week { get; set; } + [JsonProperty("day_of_month")] + public object day_of_month { get; set; } + [JsonProperty("search_terms")] + public List search_terms { get; set; } + [JsonProperty("ppc_search_terms")] + public object ppc_search_terms { get; set; } + [JsonProperty("lookup_ppc")] + public string lookup_ppc { get; set; } + [JsonProperty("website-addresses")] + public List websiteAddresses { get; set; } + [JsonProperty("website_address")] + public string website_address { get; set; } + [JsonProperty("website_address_2")] + public object website_address_2 { get; set; } + [JsonProperty("website_address_3")] + public object website_address_3 { get; set; } + [JsonProperty("country")] + public string country { get; set; } + [JsonProperty("google_location")] + public string google_location { get; set; } + [JsonProperty("bing_location")] + public object bing_location { get; set; } + [JsonProperty("business_names")] + public List business_names { get; set; } + [JsonProperty("postcode")] + public string postcode { get; set; } + [JsonProperty("telephone")] + public string telephone { get; set; } + [JsonProperty("search_engines")] + public List search_engines { get; set; } + [JsonProperty("include_local_directory_results")] + public string include_local_directory_results { get; set; } + [JsonProperty("notify")] + public string notify { get; set; } + [JsonProperty("email_addresses")] + public List email_addresses { get; set; } + [JsonProperty("created")] + public string created { get; set; } + [JsonProperty("last_processed")] + public string last_processed { get; set; } + [JsonProperty("last_message")] + public string last_message { get; set; } + [JsonProperty("currently_running")] + public string currently_running { get; set; } + [JsonProperty("status")] + public string status { get; set; } + [JsonProperty("red_flag")] + public string red_flag { get; set; } + [JsonProperty("is_public")] + public string is_public { get; set; } + [JsonProperty("public_key")] + public object public_key { get; set; } + [JsonProperty("tags")] + public List tags { get; set; } + } +} diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs index 019bc0d..ade0ae0 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs @@ -47,20 +47,20 @@ public static BrightLocalLsrc Delete() return deletedLsrc; } - public static List GetAll() + public static BrightLocalGetAllResults GetAll() { var lsrcService = new LsrcService(); - List lsrcList = lsrcService.GetAll(); + BrightLocalGetAllResults lsrcList = lsrcService.GetAll(); return lsrcList; } - public static BrightLocalLsrc GetReport() + public static BrightLocalLsrcReport GetReport() { var campaignId = 1; var lsrcService = new LsrcService(); - BrightLocalLsrc myLsrc = lsrcService.Get(campaignId); + BrightLocalLsrcReport myLsrc = lsrcService.Get(campaignId); return myLsrc; } @@ -73,12 +73,12 @@ public static BrightLocalLsrc Run() return myLsrc; } - public static List GetHistory() + public static BrightLocalLsrcHistory GetHistory() { var campaignId = 1; var lsrcService = new LsrcService(); - List lsrcHistory = lsrcService.GetHistory(campaignId); + BrightLocalLsrcHistory lsrcHistory = lsrcService.GetHistory(campaignId); return lsrcHistory; } diff --git a/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs b/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs index 0a5d032..67089ba 100644 --- a/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs +++ b/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs @@ -58,44 +58,35 @@ public virtual BrightLocalLsrc Delete(int campaignId) } //method overlaod for supplying the location-id parameter - public virtual List GetAll(int locationId) + public virtual BrightLocalGetAllResults GetAll(int locationId) { var url = string.Format(Urls.Lsrc + "{0}", "get-all"); var parameters = new Parameters.requestParameters(); parameters.Add("location-id", locationId); var results = request.Get(url, parameters, this.api_key, this.api_secret); - - List reports = new List(); - foreach (var report in results.Content[0].ToString()) - { - reports.Add(JsonConvert.DeserializeObject(report.ToString())); - } - return reports; + + return JsonConvert.DeserializeObject(results.Content); + } - public virtual List GetAll() + public virtual BrightLocalGetAllResults GetAll() { var url = string.Format(Urls.Lsrc + "{0}", "get-all"); var parameters = new Parameters.requestParameters(); var results = request.Get(url, parameters, this.api_key, this.api_secret); - List reports = new List(); - foreach (var report in results.Content[0].ToString()) - { - reports.Add(JsonConvert.DeserializeObject(report.ToString())); - } - return reports; + return JsonConvert.DeserializeObject(results.Content); } - public virtual BrightLocalLsrc Get(int campaignId) + public virtual BrightLocalLsrcReport Get(int campaignId) { var url = string.Format(Urls.Lsrc + "{0}", "get"); var parameters = new Parameters.requestParameters(); parameters.Add("campaign-id", campaignId); var success = request.Get(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } public virtual BrightLocalLsrc Run(int campaignId) @@ -107,19 +98,14 @@ public virtual BrightLocalLsrc Run(int campaignId) return JsonConvert.DeserializeObject(success.Content); } - public virtual List GetHistory(int campaignId) + public virtual BrightLocalLsrcHistory GetHistory(int campaignId) { var url = string.Format(Urls.Lsrc + "{0}", "history/get"); var parameters = new Parameters.requestParameters(); parameters.Add("campaign-id", campaignId); var results = request.Post(url, parameters, this.api_key, this.api_secret); - List history = new List(); - foreach (var item in results.Content[0].ToString()) - { - history.Add(JsonConvert.DeserializeObject(item.ToString())); - } - return history; + return JsonConvert.DeserializeObject(results.Content); } public virtual Object GetResults(GetResultsLsrcOptions lsrcOptions) diff --git a/README.md b/README.md index 729c605..5161c53 100644 --- a/README.md +++ b/README.md @@ -231,7 +231,7 @@ The returned BrightLocalClient entity above will have a campaign-id. You will wa ```csharp var lsrcService = new LsrcService(); - List lsrcList = lsrcService.GetAll(); + BrightLocalGetAllResults lsrcList = lsrcService.GetAll();; ``` ### Getting a report @@ -240,7 +240,7 @@ The returned BrightLocalClient entity above will have a campaign-id. You will wa var campaignId = 1; var lsrcService = new LsrcService(); - BrightLocalLsrc myLsrc = lsrcService.Get(campaignId); + BrightLocalLsrcReport myLsrc = lsrcService.Get(campaignId); ``` ### Running a report @@ -258,7 +258,7 @@ The returned BrightLocalClient entity above will have a campaign-id. You will wa var campaignId = 1; var lsrcService = new LsrcService(); - List lsrcHistory = lsrcService.GetHistory(campaignId); + BrightLocalLsrcHistory lsrcHistory = lsrcService.GetHistory(campaignId); ``` ### Get report results From 84bd34c24d5008a92626cadbb2dcb2ed662e9450 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Wed, 4 Jan 2017 14:04:28 -0700 Subject: [PATCH 41/93] Removed citationtrackergetall entity and made a genereic get all entity for all services --- ...tationTrackerGetAll.cs => BrightLocalGetAllResults.cs} | 6 +++--- .../Services/CitationTracker/CitationTrackerService.cs | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) rename BrightLocal/src/BrightLocal/Entities/{BrightLocalCitationTrackerGetAll.cs => BrightLocalGetAllResults.cs} (71%) diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalCitationTrackerGetAll.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalGetAllResults.cs similarity index 71% rename from BrightLocal/src/BrightLocal/Entities/BrightLocalCitationTrackerGetAll.cs rename to BrightLocal/src/BrightLocal/Entities/BrightLocalGetAllResults.cs index fb8d3ed..39badf8 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalCitationTrackerGetAll.cs +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalGetAllResults.cs @@ -2,12 +2,12 @@ namespace BrightLocal { - public class BrightLocalCitationTrackerGetAll + public class BrightLocalGetAllResults { - public List results { get; set; } + public List results { get; set; } } - public class CitationTrackerAll + public class ResultsList { public string campaign_id { get; set; } public string name { get; set; } diff --git a/BrightLocal/src/BrightLocal/Services/CitationTracker/CitationTrackerService.cs b/BrightLocal/src/BrightLocal/Services/CitationTracker/CitationTrackerService.cs index 62e0cc0..89499c3 100644 --- a/BrightLocal/src/BrightLocal/Services/CitationTracker/CitationTrackerService.cs +++ b/BrightLocal/src/BrightLocal/Services/CitationTracker/CitationTrackerService.cs @@ -52,21 +52,21 @@ public virtual BrightLocalCitationTracker Delete(int reportId) } //method overlaod for supplying the location-id parameter - public virtual BrightLocalCitationTrackerGetAll GetAll(int locationId) + public virtual BrightLocalGetAllResults GetAll(int locationId) { var url = string.Format(Urls.CitationTracker + "{0}", "get-all"); var parameters = new Parameters.requestParameters(); parameters.Add("location-id", locationId); var success = request.Post(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalCitationTrackerGetAll GetAll() + public virtual BrightLocalGetAllResults GetAll() { var url = string.Format(Urls.CitationTracker + "{0}", "get-all"); var parameters = new Parameters.requestParameters(); var success = request.Post(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } } } From 4c78e98b76d3d519b583eabbe4c9776ac91abc87 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Thu, 5 Jan 2017 10:38:26 -0700 Subject: [PATCH 42/93] Fixed client service methods, added entity for client search results --- .../BrightLocal/Entities/BrightLocalClient.cs | 6 ++-- .../Entities/BrightLocalClientSearch.cs | 30 +++++++++++++++++++ .../Account-Methods/clientExamples.cs | 4 +-- .../Services/Clients/ClientService.cs | 13 ++++---- README.md | 2 +- 5 files changed, 41 insertions(+), 14 deletions(-) create mode 100644 BrightLocal/src/BrightLocal/Entities/BrightLocalClientSearch.cs diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalClient.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalClient.cs index 895063f..bfedd7f 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalClient.cs +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalClient.cs @@ -6,14 +6,14 @@ public class BrightLocalClient { [JsonProperty("client-id")] public int clientId { get; set; } - [JsonProperty("succecss")] - public bool success { get; set; } + [JsonProperty("success")] + public bool? success { get; set; } [JsonProperty("company-name")] public string companyName { get; set; } [JsonProperty("company-url")] public string companyUrl { get; set; } [JsonProperty("business-category-id")] - public int businessCategoryId { get; set; } + public int? businessCategoryId { get; set; } [JsonProperty("reference-number")] public string referenceNumber { get; set; } } diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalClientSearch.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalClientSearch.cs new file mode 100644 index 0000000..89bdc7a --- /dev/null +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalClientSearch.cs @@ -0,0 +1,30 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace BrightLocal +{ + public class BrightLocalClientSearch + { + [JsonProperty("success")] + public bool success { get; set; } + [JsonProperty("clients")] + public List clients { get; set; } + } + + public class Client + { + [JsonProperty("client-id")] + public int clientId { get; set; } + [JsonProperty("company-name")] + public string companyName { get; set; } + [JsonProperty("status")] + public string status { get; set; } + [JsonProperty("client-reference")] + public string clientReference { get; set; } + [JsonProperty("business-category-id")] + public int businessCategoryId { get; set; } + } +} diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs index 8f5a8af..77c20f9 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs @@ -50,12 +50,12 @@ public static BrightLocalClient Get() return client; } - public static List Search() + public static BrightLocalClientSearch Search() { var searchQuery = "le-bernardin"; var clientService = new ClientService(); - List results = clientService.Search(searchQuery); + BrightLocalClientSearch results = clientService.Search(searchQuery); return results; } } diff --git a/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs b/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs index bb8a819..581ceff 100644 --- a/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs +++ b/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs @@ -1,4 +1,5 @@ using Newtonsoft.Json; +using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; @@ -38,22 +39,18 @@ public virtual BrightLocalClient Get(int clientId) var url = string.Format(Urls.Clients + "{0}", clientId); var parameters = new Parameters.requestParameters(); var success = request.Get(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + JObject o = JObject.Parse(success.Content); + return JsonConvert.DeserializeObject(o.SelectToken("client").ToString()); } - public virtual List Search(string query) + public virtual BrightLocalClientSearch Search(string query) { var url = string.Format(Urls.Clients + "search"); var parameters = new Parameters.requestParameters(); parameters.Add("q", query); var results = request.Get(url, parameters, this.api_key, this.api_secret); - List clients = new List(); - foreach (var client in results.Content[0].ToString()) - { - clients.Add(JsonConvert.DeserializeObject(client.ToString())); - } - return clients; + return JsonConvert.DeserializeObject(results.Content); } } } diff --git a/README.md b/README.md index 5161c53..69aec0e 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,7 @@ to a client id (or not). var searchQuery = "le-bernardin"; var clientService = new ClientService(); - List results = clientService.Search(searchQuery); // returns a list of type BrightLocalClient + BrightLocalClientSearch results = clientService.Search(searchQuery); ``` From dfdb47d69caddf4a59c035791cd2d1c17787934a Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Thu, 5 Jan 2017 12:20:30 -0700 Subject: [PATCH 43/93] fixed properties on location entity and added location search entity --- .../Entities/BrightLocalLocation.cs | 43 +++++++++++++------ .../Entities/BrightLocalLocationSearch.cs | 26 +++++++++++ .../Account-Methods/locationExamples.cs | 4 +- .../Services/Locations/LocationService.cs | 14 +++--- README.md | 2 +- 5 files changed, 65 insertions(+), 24 deletions(-) create mode 100644 BrightLocal/src/BrightLocal/Entities/BrightLocalLocationSearch.cs diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalLocation.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalLocation.cs index 611b657..7c349f9 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalLocation.cs +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalLocation.cs @@ -1,5 +1,6 @@ using Newtonsoft.Json; using RestSharp; +using System.Collections.Generic; namespace BrightLocal { @@ -7,12 +8,12 @@ public class BrightLocalLocation { [JsonProperty("location-id")] public int locationId { get; set; } - [JsonProperty("name")] - public string name { get; set; } + [JsonProperty("location-name")] + public string locationName { get; set; } [JsonProperty("client-id")] public int clientId { get; set; } - [JsonProperty("url")] - public string url { get; set; } + [JsonProperty("location-url")] + public string locationUrl { get; set; } [JsonProperty("business-category-id")] public int businessCategoryId { get; set; } [JsonProperty("country")] @@ -23,14 +24,14 @@ public class BrightLocalLocation public string address2 { get; set; } [JsonProperty("region")] public string region { get; set; } - [JsonProperty("city")] - public string city { get; set; } + [JsonProperty("town")] + public string town { get; set; } [JsonProperty("postcode")] public string postcode { get; set; } [JsonProperty("telephone")] public string telephone { get; set; } - [JsonProperty("unique-reference")] - public string uniqueReference { get; set; } + [JsonProperty("location-reference")] + public string locationReference { get; set; } [JsonProperty("contact-first-name")] public string contactFirstName { get; set; } [JsonProperty("contact-last-name")] @@ -48,16 +49,34 @@ public class BrightLocalLocation [JsonProperty("year-of-formation")] public string yearOfFormation { get; set; } [JsonProperty("extra-business-categories")] - public JsonArray extraBusinessCategories { get; set; } + public List extraBusinessCategories { get; set; } [JsonProperty("working-hours")] - public JsonArray workingHours { get; set; } + public WorkingHours workingHours { get; set; } [JsonProperty("payment-methods")] - public JsonArray paymentMethods { get; set; } + public List paymentMethods { get; set; } [JsonProperty("short-description")] public string shortDescription { get; set; } [JsonProperty("long-description")] public string longDescription { get; set; } [JsonProperty("services-of-products")] - public JsonArray servicesOfProducts { get; set; } + public List servicesOfProducts { get; set; } + } + + public class WorkingHours + { + public string mon_start { get; set; } + public string mon_end { get; set; } + public string tue_start { get; set; } + public string tue_end { get; set; } + public string wed_start { get; set; } + public string wed_end { get; set; } + public string thu_start { get; set; } + public string thu_end { get; set; } + public string fri_start { get; set; } + public string fri_end { get; set; } + public string sat_start { get; set; } + public string sat_end { get; set; } + public string sun_start { get; set; } + public string sun_end { get; set; } } } diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalLocationSearch.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalLocationSearch.cs new file mode 100644 index 0000000..4633fdf --- /dev/null +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalLocationSearch.cs @@ -0,0 +1,26 @@ + +using Newtonsoft.Json; +using System.Collections.Generic; + +namespace BrightLocal +{ + public class BrightLocalLocationSearch + { + [JsonProperty("success")] + public bool success { get; set; } + [JsonProperty("locations")] + public List locations { get; set; } + } + + public class Location + { + [JsonProperty("location-id")] + public int locationId { get; set; } + [JsonProperty("location-name")] + public string locationName { get; set; } + [JsonProperty("client-id")] + public int clientId { get; set; } + [JsonProperty("location-reference")] + public string locationReference { get; set; } + } +} diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/locationExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/locationExamples.cs index 4e705d2..2f3a6b9 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/locationExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/locationExamples.cs @@ -64,12 +64,12 @@ public static BrightLocalLocation Get() return getLocation; } - public static List Search() + public static BrightLocalLocationSearch Search() { var searchQuery = "le-bernardin"; var locationService = new LocationService(); - List results = locationService.Search(searchQuery); + BrightLocalLocationSearch results = locationService.Search(searchQuery); return results; } } diff --git a/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs b/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs index 2a5c08e..59a4bbc 100644 --- a/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs +++ b/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs @@ -1,4 +1,5 @@ using Newtonsoft.Json; +using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; @@ -38,22 +39,17 @@ public virtual BrightLocalLocation Get(int locationId) var url = string.Format(Urls.Locations + "{0}", locationId); var parameters = new Parameters.requestParameters(); var success = request.Get(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + JObject o = JObject.Parse(success.Content); + return JsonConvert.DeserializeObject(o.SelectToken("location").ToString()); } - public virtual List Search(string query) + public virtual BrightLocalLocationSearch Search(string query) { var url = string.Format(Urls.Locations + "search"); var parameters = new Parameters.requestParameters(); parameters.Add("q", query); var results = request.Get(url, parameters, this.api_key, this.api_secret); - - List locations = new List(); - foreach (var location in results.Content[0].ToString()) - { - locations.Add(JsonConvert.DeserializeObject(location.ToString())); - } - return locations; + return JsonConvert.DeserializeObject(results.Content); } } } diff --git a/README.md b/README.md index 69aec0e..07894e8 100644 --- a/README.md +++ b/README.md @@ -178,7 +178,7 @@ to a location id (or not). var searchQuery = "le-bernardin"; var locationService = new LocationService(); - List results = locationService.Search(searchQuery); // returns a list of type BrightLocalLocation + BrightLocalLocationSearch results = locationService.Search(searchQuery); ``` Local Search Rank Checker From 532f0d8d65b90f3c65d348d5388194392fb31172 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Mon, 9 Jan 2017 11:54:32 -0700 Subject: [PATCH 44/93] Changed return type for create update and delete to BrightLocalSuccess entity --- .../BrightLocal/Entities/BrightLocalSuccess.cs | 12 ++++++++++++ .../Account-Methods/clientExamples.cs | 12 ++++++------ .../Account-Methods/locationExamples.cs | 12 ++++++------ .../Account-Methods/lscuExamples.cs | 8 ++++---- .../Account-Methods/lsrcExamples.cs | 12 ++++++------ .../Services/Clients/ClientService.cs | 12 ++++++------ .../Services/Locations/LocationService.cs | 13 +++++++------ .../BrightLocal/Services/Lscu/LscuService.cs | 8 ++++---- .../BrightLocal/Services/Lsrc/LsrcService.cs | 12 ++++++------ README.md | 17 ++++++++--------- 10 files changed, 65 insertions(+), 53 deletions(-) create mode 100644 BrightLocal/src/BrightLocal/Entities/BrightLocalSuccess.cs diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalSuccess.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalSuccess.cs new file mode 100644 index 0000000..cfbbd85 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalSuccess.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace BrightLocal +{ + public class BrightLocalSuccess: Dictionary + { + + } +} diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs index 77c20f9..942cf3c 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs @@ -5,7 +5,7 @@ namespace BrightLocal.Examples_version2.Account_Methods { public class clientExamples { - public static BrightLocalClient Create() + public static BrightLocalSuccess Create() { var myClient = new ClientOptions(); myClient.name = "Le Bernardin"; @@ -14,11 +14,11 @@ public static BrightLocalClient Create() var clientService = new ClientService(); - BrightLocalClient newClient = clientService.Create(myClient); + BrightLocalSuccess newClient = clientService.Create(myClient); return newClient; } - public static BrightLocalClient Update() + public static BrightLocalSuccess Update() { var myClient = new UpdateClientOptions(); myClient.clientId = 36447; @@ -28,16 +28,16 @@ public static BrightLocalClient Update() var clientService = new ClientService(); - BrightLocalClient updateClient = clientService.Update(myClient); + BrightLocalSuccess updateClient = clientService.Update(myClient); return updateClient; } - public static BrightLocalClient Delete() + public static BrightLocalSuccess Delete() { var clientId = 1; var clientService = new ClientService(); - BrightLocalClient deleteClient = clientService.Delete(clientId); + BrightLocalSuccess deleteClient = clientService.Delete(clientId); return deleteClient; } diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/locationExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/locationExamples.cs index 2f3a6b9..1d0c5d7 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/locationExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/locationExamples.cs @@ -5,7 +5,7 @@ namespace BrightLocal.Examples_version2.Account_Methods { public class locationExamples { - public static BrightLocalLocation Create() + public static BrightLocalSuccess Create() { var myLocation = new LocationOptions(); myLocation.name = "Le Bernardin"; @@ -21,11 +21,11 @@ public static BrightLocalLocation Create() var locationService = new LocationService(); - BrightLocalLocation newLocation = locationService.Create(myLocation); + BrightLocalSuccess newLocation = locationService.Create(myLocation); return newLocation; } - public static BrightLocalLocation Update() + public static BrightLocalSuccess Update() { var myLocation = new UpdateLocationOptions(); myLocation.locationId = 1; @@ -42,16 +42,16 @@ public static BrightLocalLocation Update() var locationService = new LocationService(); - BrightLocalLocation updateLocation = locationService.Update(myLocation); + BrightLocalSuccess updateLocation = locationService.Update(myLocation); return updateLocation; } - public static BrightLocalLocation Delete() + public static BrightLocalSuccess Delete() { var locationId = 1; var locationService = new LocationService(); - BrightLocalLocation deleteLocation = locationService.Delete(locationId); + BrightLocalSuccess deleteLocation = locationService.Delete(locationId); return deleteLocation; } diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lscuExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lscuExamples.cs index d478682..cd8af6a 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lscuExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lscuExamples.cs @@ -7,7 +7,7 @@ namespace BrightLocal.Examples_version2.Account_Methods { public class lscuExamples { - public static BrightLocalLscu Create() + public static BrightLocalSuccess Create() { LscuOptions myLscu = new LscuOptions(); myLscu.reportName = "Sample SEO Chek-Up Report"; @@ -43,12 +43,12 @@ public static BrightLocalLscu Create() var lscuService = new LscuService(); - BrightLocalLscu newLscu = lscuService.Create(myLscu); + BrightLocalSuccess newLscu = lscuService.Create(myLscu); return newLscu; } - public static BrightLocalLscu Update() + public static BrightLocalSuccess Update() { UpdateLscuOptions myLscu = new UpdateLscuOptions(); myLscu.reportName = "Sample SEO Chek-Up Report"; @@ -67,7 +67,7 @@ public static BrightLocalLscu Update() var lscuService = new LscuService(); - BrightLocalLscu updateLscu = lscuService.Update(myLscu); + BrightLocalSuccess updateLscu = lscuService.Update(myLscu); return updateLscu; } diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs index ade0ae0..5249e60 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs @@ -7,7 +7,7 @@ namespace BrightLocal.Examples_version2.Account_Methods { public class lsrcExamples { - public static BrightLocalLsrc Create() + public static BrightLocalSuccess Create() { var myLsrc = new LsrcOptions(); myLsrc.name = "Le Bernardin"; @@ -18,11 +18,11 @@ public static BrightLocalLsrc Create() var lsrcService = new LsrcService(); - BrightLocalLsrc newLsrc = lsrcService.Create(myLsrc); + BrightLocalSuccess newLsrc = lsrcService.Create(myLsrc); return newLsrc; } - public static BrightLocalLsrc Update() + public static BrightLocalSuccess Update() { var myLsrc = new UpdateLsrcOptions(); myLsrc.campaignId = 1; @@ -34,16 +34,16 @@ public static BrightLocalLsrc Update() var lsrcService = new LsrcService(); - BrightLocalLsrc updatedLsrc = lsrcService.Update(myLsrc); + BrightLocalSuccess updatedLsrc = lsrcService.Update(myLsrc); return updatedLsrc; } - public static BrightLocalLsrc Delete() + public static BrightLocalSuccess Delete() { var campaignId = 1; var lsrcService = new LsrcService(); - BrightLocalLsrc deletedLsrc = lsrcService.Delete(campaignId); + BrightLocalSuccess deletedLsrc = lsrcService.Delete(campaignId); return deletedLsrc; } diff --git a/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs b/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs index 581ceff..9f7830e 100644 --- a/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs +++ b/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs @@ -12,26 +12,26 @@ public ClientService(string apiKey = null, string apiSecret = null) : base(apiKe BrightLocalRequestor request = new BrightLocalRequestor(); - public virtual BrightLocalClient Create(ClientOptions createOptions) + public virtual BrightLocalSuccess Create(ClientOptions createOptions) { var parameters = Parameters.convertListToParameters(createOptions); var success = request.Post(Urls.Clients, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalClient Update(UpdateClientOptions updateOptions) + public virtual BrightLocalSuccess Update(UpdateClientOptions updateOptions) { var parameters = Parameters.convertListToParameters(updateOptions); var success = request.Put(Urls.Clients, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalClient Delete(int clientId) + public virtual BrightLocalSuccess Delete(int clientId) { var parameters = new Parameters.requestParameters(); parameters.Add("client-id", clientId); var success = request.Delete(Urls.Clients, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } public virtual BrightLocalClient Get(int clientId) diff --git a/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs b/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs index 59a4bbc..0f2d9dd 100644 --- a/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs +++ b/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs @@ -11,27 +11,28 @@ public LocationService(string apiKey = null, string apiSecret = null) : base(api BrightLocalRequestor request = new BrightLocalRequestor(); - public virtual BrightLocalLocation Create(LocationOptions createOptions) + public virtual BrightLocalSuccess Create(LocationOptions createOptions) { var parameters = Parameters.convertListToParameters(createOptions); var success = request.Post(Urls.Locations, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); + } - public virtual BrightLocalLocation Update(UpdateLocationOptions updateOptions) + public virtual BrightLocalSuccess Update(UpdateLocationOptions updateOptions) { var url = string.Format(Urls.Locations + "{0}", updateOptions.locationId); var parameters = Parameters.convertListToParameters(updateOptions); var success = request.Put(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalLocation Delete(int locationId) + public virtual BrightLocalSuccess Delete(int locationId) { var url = string.Format(Urls.Locations + "{0}", locationId); var parameters = new Parameters.requestParameters(); var success = request.Delete(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } public virtual BrightLocalLocation Get(int locationId) diff --git a/BrightLocal/src/BrightLocal/Services/Lscu/LscuService.cs b/BrightLocal/src/BrightLocal/Services/Lscu/LscuService.cs index ed3cb79..4741a1e 100644 --- a/BrightLocal/src/BrightLocal/Services/Lscu/LscuService.cs +++ b/BrightLocal/src/BrightLocal/Services/Lscu/LscuService.cs @@ -11,18 +11,18 @@ public LscuService(string apiKey = null, string apiSecret = null) : base(apiKey, BrightLocalRequestor request = new BrightLocalRequestor(); - public virtual BrightLocalLscu Create(LscuOptions createOptions) + public virtual BrightLocalSuccess Create(LscuOptions createOptions) { var parameters = Parameters.convertListToParameters(createOptions); var success = request.Post(Urls.Lscu, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalLscu Update(UpdateLscuOptions updateOptions) + public virtual BrightLocalSuccess Update(UpdateLscuOptions updateOptions) { var parameters = Parameters.convertListToParameters(updateOptions); var success = request.Put(Urls.Lscu, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } public virtual BrightLocalLscuReport Get(int reportId) diff --git a/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs b/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs index 67089ba..917090c 100644 --- a/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs +++ b/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs @@ -11,7 +11,7 @@ public LsrcService(string apiKey = null, string apiSecret = null) : base(apiKey, BrightLocalRequestor request = new BrightLocalRequestor(); - public virtual BrightLocalLsrc Create(LsrcOptions createOptions) + public virtual BrightLocalSuccess Create(LsrcOptions createOptions) { var url = string.Format(Urls.Lsrc + "{0}", "add"); createOptions.searchTerms = Parameters.convertToNewline(createOptions.searchTerms); @@ -25,10 +25,10 @@ public virtual BrightLocalLsrc Create(LsrcOptions createOptions) } var parameters = Parameters.convertListToParameters(createOptions); var success = request.Post(Urls.Lsrc, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalLsrc Update(UpdateLsrcOptions updateOptions) + public virtual BrightLocalSuccess Update(UpdateLsrcOptions updateOptions) { var url = string.Format(Urls.Lsrc + "{0}", "update"); if (updateOptions.searchTerms != null) @@ -45,16 +45,16 @@ public virtual BrightLocalLsrc Update(UpdateLsrcOptions updateOptions) } var parameters = Parameters.convertListToParameters(updateOptions); var success = request.Post(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalLsrc Delete(int campaignId) + public virtual BrightLocalSuccess Delete(int campaignId) { var url = string.Format(Urls.Lsrc + "{0}", "delete"); var parameters = new Parameters.requestParameters(); parameters.Add("campaign-id", campaignId); var success = request.Post(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } //method overlaod for supplying the location-id parameter diff --git a/README.md b/README.md index 07894e8..b5fe509 100644 --- a/README.md +++ b/README.md @@ -58,10 +58,10 @@ Clients var clientService = new ClientService(); - BrightLocalClient newClient = clientService.Create(myClient); + BrightLocalSuccess newClient = clientService.Create(myClient); ``` -The returned BrightLocalClient entity above will have a client-id. You will want to persist this for later. When you create a location you will be able to assign it +The returned BrightLocalSuccess entity above will have a client-id. You will want to persist this for later. When you create a location you will be able to assign it to a client id (or not). ### Updating a client @@ -75,7 +75,7 @@ to a client id (or not). var clientService = new ClientService(); - BrightLocalClient updateClient = clientService.Update(myClient); + BrightLocalSuccess updateClient = clientService.Update(myClient); ``` ### Deleting a client @@ -84,7 +84,7 @@ to a client id (or not). var clientId = 1; var clientService = new ClientService(); - BrightLocalClient deleteClient = clientService.Delete(clientId); + BrightLocalSuccess deleteClient = clientService.Delete(clientId); ``` ### Getting a client @@ -126,10 +126,10 @@ Locations var locationService = new LocationService(); - BrightLocalLocation newLocation = locationService.Create(myLocation); + var BrightLocalSuccess = locationService.Create(myLocation); ``` -The returned BrightLocalClient entity above will have a location-id. You will want to persist this for later. When you create a report you will be able to assign it +The returned BrightLocalSuccess entity above will have a location-id. You will want to persist this for later. When you create a report you will be able to assign it to a location id (or not). ### Updating a location @@ -150,7 +150,7 @@ to a location id (or not). var locationService = new LocationService(); - BrightLocalLocation updateLocation = locationService.Update(myLocation); + BrightLocalSuccess updateLocation = locationService.Update(myLocation); ``` ### Deleting a location @@ -159,8 +159,7 @@ to a location id (or not). var locationId = 1; var locationService = new LocationService(); - BrightLocalLocation deleteLocation = locationService.Delete(locationId); - + BrightLocalSuccess deleteLocation = locationService.Delete(locationId); ``` ### Getting a location From 7e4ad11cdcc5983366aa22e60d20bf99732b940d Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Tue, 10 Jan 2017 12:39:13 -0700 Subject: [PATCH 45/93] added entity for GetAll and for GetReport added examples for CT --- .../BrightLocalCitationTrackerResults.cs | 181 ++++++++++++++++++ .../Entities/BrightLocalCtGetAllResults.cs | 63 ++++++ .../citationTrackerExamples.cs | 102 ++++++++++ .../CitationTracker/CitationTrackerService.cs | 32 ++-- 4 files changed, 366 insertions(+), 12 deletions(-) create mode 100644 BrightLocal/src/BrightLocal/Entities/BrightLocalCitationTrackerResults.cs create mode 100644 BrightLocal/src/BrightLocal/Entities/BrightLocalCtGetAllResults.cs create mode 100644 BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationTrackerExamples.cs diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalCitationTrackerResults.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalCitationTrackerResults.cs new file mode 100644 index 0000000..05d26bc --- /dev/null +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalCitationTrackerResults.cs @@ -0,0 +1,181 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace BrightLocal +{ + public class BrightLocalCitationTrackerResults + { + public CtResponse response { get; set; } + } + + public class CtResponse + { + public CtResults results { get; set; } + } + + public class CtResults + { + public List active { get; set; } + + [JsonProperty("possible")] + public PossibleCitations possible { get; set; } + public List pending { get; set; } + public Domains activeDomains { get; set; } + public List pendingDomains { get; set; } + public Dictionary possibleDomains { get; set; } + public List topDirectories { get; set; } + public Flags flags { get; set; } + public List competitors { get; set; } + public CtUrls urls { get; set; } + } + + public class Active + { + public string id { get; set; } + public string citation_id { get; set; } + public string customer_id { get; set; } + public string report_id { get; set; } + [JsonProperty("citation-status")] + public string citationStatus { get; set; } + public string source { get; set; } + public string url { get; set; } + [JsonProperty("citation-notes")] + public string citationNotes { get; set; } + public object status_smile { get; set; } + public object need_to_fix { get; set; } + public string status { get; set; } + [JsonProperty("date-identified-sorting")] + public string dateIdentifiedSorting { get; set; } + [JsonProperty("date-identified")] + public string dateIdentified { get; set; } + [JsonProperty("domain-authority")] + public string domainAuthority { get; set; } + [JsonProperty("citation-value")] + public string citationValue { get; set; } + [JsonProperty("moz-rank")] + public string mozRank { get; set; } + [JsonProperty("site-type")] + public string siteType { get; set; } + [JsonProperty("listing-type")] + public string listingType { get; set; } + [JsonProperty("seomoz-lookup-complete")] + public string seomozLookupComplete { get; set; } + [JsonProperty("business-name")] + public string businessName { get; set; } + public string postcode { get; set; } + } + + public class PossibleCitations : Dictionary + { + + } + + public class Possible + { + public string id { get; set; } + public string citation_id { get; set; } + public string customer_id { get; set; } + public string report_id { get; set; } + [JsonProperty("citation-status")] + public string citationStatus { get; set; } + public string source { get; set; } + public string url { get; set; } + [JsonProperty("citation-notes")] + public string citationNotes { get; set; } + public string status_smile { get; set; } + public string need_to_fix { get; set; } + public string status { get; set; } + [JsonProperty("date-identified-sorting")] + public string dateIdentifiedSorting { get; set; } + [JsonProperty("date-identified")] + public string dateIdentified { get; set; } + [JsonProperty("domain-authority")] + public string domainAuthority { get; set; } + [JsonProperty("citation-value")] + public string citationValue { get; set; } + [JsonProperty("moz-rank")] + public string mozRank { get; set; } + [JsonProperty("site-type")] + public string siteType { get; set; } + [JsonProperty("listing-type")] + public string listingType { get; set; } + [JsonProperty("seomoz-lookup-complete")] + public string seomozLookupComplete { get; set; } + [JsonProperty("business-name")] + public string businessName { get; set; } + [JsonProperty("is-citation-burst-available")] + public bool isCitationBurstAvailable { get; set; } + [JsonProperty("get-citation-url")] + public string getCitationUrl { get; set; } + } + + + public class Domains : Dictionary + { + + } + + public class TopDirectory + { + public string citation_id { get; set; } + public string customer_id { get; set; } + public string report_id { get; set; } + [JsonProperty("citation-status")] + public string citationStatus { get; set; } + public string source { get; set; } + public string url { get; set; } + [JsonProperty("citation-notes")] + public string citationNotes { get; set; } + public string status_smile { get; set; } + public string need_to_fix { get; set; } + public string status { get; set; } + public string dateIdentifiedSorting { get; set; } + [JsonProperty("date-identified")] + public string dateIdentified { get; set; } + [JsonProperty("domain-authority")] + public string domainAuthority { get; set; } + [JsonProperty("citation-value")] + public string citationValue { get; set; } + [JsonProperty("moz-rank")] + public string mozRank { get; set; } + [JsonProperty("site-type")] + public string siteType { get; set; } + [JsonProperty("listing-type")] + public string listingType { get; set; } + [JsonProperty("seomoz-lookup-complete")] + public string seomozLookupComplete { get; set; } + [JsonProperty("business-name")] + public string businessName { get; set; } + public string address { get; set; } + public string postcode { get; set; } + public string telephone { get; set; } + } + + public class Flags + { + public Customer customer { get; set; } + public Competitor competitor { get; set; } + } + + public class Customer + { + public List @new { get; set; } + public List disappeared { get; set; } + } + + public class Competitor + { + public List @new { get; set; } + public List disappeared { get; set; } + } + + public class Competitors + { + public string business_name { get; set; } + public Domains domains { get; set; } + } + +} diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalCtGetAllResults.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalCtGetAllResults.cs new file mode 100644 index 0000000..150c534 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalCtGetAllResults.cs @@ -0,0 +1,63 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace BrightLocal +{ + public class BrightLocalCtGetAllResults + { + public Response response { get; set; } + } + public class Response + { + public List results { get; set; } + } + + public class CtResult + { + public string report_id { get; set; } + public string customer_id { get; set; } + public string location_id { get; set; } + public string report_run_id { get; set; } + public string report_name { get; set; } + public string website_address { get; set; } + public string business_name { get; set; } + public string business_location { get; set; } + public string postcode { get; set; } + public string country { get; set; } + public string state_code { get; set; } + public string cancel_run { get; set; } + public string address1 { get; set; } + public string address2 { get; set; } + public string telephone { get; set; } + public string business_type { get; set; } + public string primary_location { get; set; } + public string old_business_name_1 { get; set; } + public string old_postcode_1 { get; set; } + public string old_business_name_2 { get; set; } + public string old_postcode_2 { get; set; } + public string currently_running { get; set; } + public string generation_error { get; set; } + public string terminal_fail { get; set; } + public string last_run { get; set; } + public object report_status { get; set; } + public string your_ct_count { get; set; } + public string your_ct_count_up { get; set; } + public string your_ct_count_down { get; set; } + public string total_ct_sources { get; set; } + public string total_ct_sources_up { get; set; } + public string competitor_ct_count { get; set; } + public string competitor_ct_count_diff { get; set; } + public string old_ct_count { get; set; } + public object company_name { get; set; } + public object branding_profile_id { get; set; } + public string notify { get; set; } + public string email_addresses { get; set; } + public int your_ct_count_diff { get; set; } + public int competitor_ct_count_up { get; set; } + public int competitor_ct_count_down { get; set; } + public int total_ct_sources_diff { get; set; } + public string successful_runs { get; set; } + } +} diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationTrackerExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationTrackerExamples.cs new file mode 100644 index 0000000..830304d --- /dev/null +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationTrackerExamples.cs @@ -0,0 +1,102 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace BrightLocal.Examples_version2.Account_Methods +{ + public class citationTrackerExamples + { + public static BrightLocalSuccess Create() + { + CitationTrackerOptions myCt = new CitationTrackerOptions(); + myCt.reportName = "Sample Citation Tracker Report"; + myCt.businessName = "Le Bernardin"; + myCt.website = "le-bernardin.com"; + myCt.businessType = "Restaurant"; + myCt.stateCode = "NY"; + myCt.postcode = "10019"; + myCt.phone = "+1 212-554-1515"; + myCt.country = "USA"; + + var citationTrackerService = new CitationTrackerService(); + + BrightLocalSuccess newCt = citationTrackerService.Create(myCt); + + return newCt; + } + + public static BrightLocalSuccess Update() + { + UpdateCitationTrackerOptions myCt = new UpdateCitationTrackerOptions(); + myCt.reportId = 682; + myCt.reportName = "Sample Citation Tracker Report"; + myCt.businessName = "Le Bernardin"; + myCt.website = "le-bernardin.com"; + myCt.businessType = "Restaurant"; + myCt.stateCode = "NY"; + myCt.postcode = "10019"; + myCt.phone = "+1 212-554-1515"; + myCt.country = "USA"; + + var citationTrackerService = new CitationTrackerService(); + + BrightLocalSuccess updateCt = citationTrackerService.Update(myCt); + + return updateCt; + } + + public static BrightLocalCitationTrackerReport Get() + { + int reportId = 682; + + var citationTrackerService = new CitationTrackerService(); + + BrightLocalCitationTrackerReport myCt = citationTrackerService.Get(reportId); + + return myCt; + } + + public static BrightLocalSuccess Run() + { + int reportId = 682; + + var citationTrackerService = new CitationTrackerService(); + + BrightLocalSuccess myCt = citationTrackerService.Run(reportId); + + return myCt; + } + + public static BrightLocalSuccess Delete() + { + int reportId = 682; + + var citationTrackerService = new CitationTrackerService(); + + BrightLocalSuccess myCt = citationTrackerService.Delete(reportId); + + return myCt; + } + + public static BrightLocalCtGetAllResults GetAll() + { + + var citationTrackerService = new CitationTrackerService(); + + BrightLocalCtGetAllResults ctResults = citationTrackerService.GetAll(); + + return ctResults; + } + + public static BrightLocalCitationTrackerResults GetReportResults() + { + var reportId = 1; + var citationTrackerService = new CitationTrackerService(); + + BrightLocalCitationTrackerResults ctResults = citationTrackerService.GetReportResults(reportId); + + return ctResults; + } + } +} diff --git a/BrightLocal/src/BrightLocal/Services/CitationTracker/CitationTrackerService.cs b/BrightLocal/src/BrightLocal/Services/CitationTracker/CitationTrackerService.cs index 89499c3..49114f9 100644 --- a/BrightLocal/src/BrightLocal/Services/CitationTracker/CitationTrackerService.cs +++ b/BrightLocal/src/BrightLocal/Services/CitationTracker/CitationTrackerService.cs @@ -8,20 +8,20 @@ public CitationTrackerService(string apiKey = null, string apiSecret = null) : b BrightLocalRequestor request = new BrightLocalRequestor(); - public virtual BrightLocalCitationTracker Create(CitationTrackerOptions createOptions) + public virtual BrightLocalSuccess Create(CitationTrackerOptions createOptions) { var url = string.Format(Urls.CitationTracker + "{0}", "add"); var parameters = Parameters.convertListToParameters(createOptions); var success = request.Post(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalCitationTracker Update(UpdateCitationTrackerOptions updateOptions) + public virtual BrightLocalSuccess Update(UpdateCitationTrackerOptions updateOptions) { var url = string.Format(Urls.CitationTracker + "{0}", "update"); var parameters = Parameters.convertListToParameters(updateOptions); var success = request.Post(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } public virtual BrightLocalCitationTrackerReport Get(int reportId) @@ -33,40 +33,48 @@ public virtual BrightLocalCitationTrackerReport Get(int reportId) return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalCitationTracker Run(int reportId) + public virtual BrightLocalSuccess Run(int reportId) { var url = string.Format(Urls.CitationTracker + "{0}", "run"); var parameters = new Parameters.requestParameters(); parameters.Add("report-id", reportId); var success = request.Post(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalCitationTracker Delete(int reportId) + public virtual BrightLocalSuccess Delete(int reportId) { var url = string.Format(Urls.CitationTracker + "{0}", "delete"); var parameters = new Parameters.requestParameters(); parameters.Add("report-id", reportId); var success = request.Post(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } //method overlaod for supplying the location-id parameter - public virtual BrightLocalGetAllResults GetAll(int locationId) + public virtual BrightLocalCtGetAllResults GetAll(int locationId) { var url = string.Format(Urls.CitationTracker + "{0}", "get-all"); var parameters = new Parameters.requestParameters(); parameters.Add("location-id", locationId); var success = request.Post(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalGetAllResults GetAll() + public virtual BrightLocalCtGetAllResults GetAll() { var url = string.Format(Urls.CitationTracker + "{0}", "get-all"); var parameters = new Parameters.requestParameters(); var success = request.Post(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); + } + public virtual BrightLocalCitationTrackerResults GetReportResults(int reportId) + { + var url = string.Format(Urls.CitationTracker + "{0}", "get-results"); + var parameters = new Parameters.requestParameters(); + parameters.Add("report-id", reportId); + var success = request.Post(url, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); } } } From 351500982cb7ac36f1d3eade7a113c380cce877b Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Tue, 10 Jan 2017 13:24:16 -0700 Subject: [PATCH 46/93] Added CT examples --- README.md | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 96 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index b5fe509..12fbe40 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ For version 1.0 [Click Here](Documentation/README.md) [Locations](#locations) [Local Search Rank Checker](#local-search-rank-checker) [Local SEO Check-up](#local-seo-check-up) +[Citation Tracker](#citation-tracker) Quick Start ----------- @@ -195,10 +196,10 @@ Local Search Rank Checker var lsrcService = new LsrcService(); - BrightLocalLsrc newLsrc = lsrcService.Create(myLsrc); + BrightLocalSuccess newLsrc = lsrcService.Create(myLsrc); ``` -The returned BrightLocalClient entity above will have a campaign-id. You will want to persist this for later in order to run and get the report. +The returned BrightLocalSuccess entity above will have a campaign-id. You will want to persist this for later in order to run and get the report. ### Updating a report @@ -213,7 +214,7 @@ The returned BrightLocalClient entity above will have a campaign-id. You will wa var lsrcService = new LsrcService(); - BrightLocalLsrc updatedLsrc = lsrcService.Update(myLsrc); + BrightLocalSuccess updatedLsrc = lsrcService.Update(myLsrc); ``` ### Deleting a report @@ -222,7 +223,7 @@ The returned BrightLocalClient entity above will have a campaign-id. You will wa var campaignId = 1; var lsrcService = new LsrcService(); - BrightLocalLsrc deletedLsrc = lsrcService.Delete(campaignId); + BrightLoBrightLocalSuccesscalLsrc deletedLsrc = lsrcService.Delete(campaignId); ``` ### Getting all reports @@ -273,6 +274,7 @@ The returned BrightLocalClient entity above will have a campaign-id. You will wa The LsrcService.GetResults method above currently returns a json object. In future releases we will have a entity BrightLocalLsrcResults. + Local SEO Check-up ----- @@ -296,10 +298,10 @@ Local SEO Check-up var lscuService = new LscuService(); - BrightLocalLscu newLscu = lscuService.Create(myLscu); + BrightLocalSuccess newLscu = lscuService.Create(myLscu); ``` -The returned BrightLocalLscu entity above will have a report-id. You will want to persist this for later when you get and run a report. +The returned BrightLocalSuccess entity above will have a report-id. You will want to persist this for later when you get and run a report. ### Supplying Local Directory URLs (see local-directory-urls parameter) @@ -341,7 +343,7 @@ The returned BrightLocalLscu entity above will have a report-id. You will want t var lscuService = new LscuService(); - BrightLocalLscu updateLscu = lscuService.Update(myLscu); + BrightLocalSuccess updateLscu = lscuService.Update(myLscu); ``` ### Getting a report @@ -382,3 +384,90 @@ The returned success entity above is of type string. Success or Failure with err BrightLocalLscuSearch lscuSearch = lscuService.Search(searchQuery); ``` +Citation Tracker +----- + +### Adding a report + +```csharp + CitationTrackerOptions myCt = new CitationTrackerOptions(); + myCt.reportName = "Sample Citation Tracker Report"; + myCt.businessName = "Le Bernardin"; + myCt.website = "le-bernardin.com"; + myCt.businessType = "Restaurant"; + myCt.stateCode = "NY"; + myCt.postcode = "10019"; + myCt.phone = "+1 212-554-1515"; + myCt.country = "USA"; + + var citationTrackerService = new CitationTrackerService(); + + BrightLocalSuccess newCt = citationTrackerService.Create(myCt); +``` +The returned BrightLocalSuccess entity above will have a report-id. You will want to persist this for later in order to run and get the report. + +### Updating a report + +```csharp + UpdateCitationTrackerOptions myCt = new UpdateCitationTrackerOptions(); + myCt.reportId = 682; + myCt.reportName = "Sample Citation Tracker Report"; + myCt.businessName = "Le Bernardin"; + myCt.website = "le-bernardin.com"; + myCt.businessType = "Restaurant"; + myCt.stateCode = "NY"; + myCt.postcode = "10019"; + myCt.phone = "+1 212-554-1515"; + myCt.country = "USA"; + + var citationTrackerService = new CitationTrackerService(); + + BrightLocalSuccess updateCt = citationTrackerService.Update(myCt); +``` + +### Getting a report + +```csharp + int reportId = 682; + + var citationTrackerService = new CitationTrackerService(); + + BrightLocalCitationTrackerReport myCt = citationTrackerService.Get(reportId); +``` + +### Running a report + +```csharp + int reportId = 682; + + var citationTrackerService = new CitationTrackerService(); + + BrightLocalSuccess myCt = citationTrackerService.Run(reportId); +``` + +### Deleting a report + +```csharp + int reportId = 682; + + var citationTrackerService = new CitationTrackerService(); + + BrightLocalSuccess myCt = citationTrackerService.Delete(reportId); +``` + +### Getting all reports + +```csharp + var citationTrackerService = new CitationTrackerService(); + + BrightLocalCtGetAllResults ctResults = citationTrackerService.GetAll(); +``` + +### Getting report results + +```csharp + var reportId = 1; + var citationTrackerService = new CitationTrackerService(); + + BrightLocalCitationTrackerResults ctResults = citationTrackerService.GetReportResults(reportId); +``` \ No newline at end of file From 6f3103bfda829d41f3cb99d94742b78ed1969574 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Tue, 10 Jan 2017 13:55:06 -0700 Subject: [PATCH 47/93] Added CitationBurstOption Class --- .../Services/CitationBurst/CitationBurstOptions.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 BrightLocal/src/BrightLocal/Services/CitationBurst/CitationBurstOptions.cs diff --git a/BrightLocal/src/BrightLocal/Services/CitationBurst/CitationBurstOptions.cs b/BrightLocal/src/BrightLocal/Services/CitationBurst/CitationBurstOptions.cs new file mode 100644 index 0000000..548dbce --- /dev/null +++ b/BrightLocal/src/BrightLocal/Services/CitationBurst/CitationBurstOptions.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace BrightLocal.Services.CitationBurst +{ + public class CitationBurstOptions + { + } +} From d4681fbd9adaac47622e8780da14960272954a9b Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Tue, 10 Jan 2017 14:49:17 -0700 Subject: [PATCH 48/93] Added Cb Entities and Service Classes --- .../Entities/BrightLocalCbAllCampaigns.cs | 51 +++++++++ .../Entities/BrightLocalCbCampaign.cs | 67 +++++++++++ .../Entities/BrightLocalCitations.cs | 49 ++++++++ .../src/BrightLocal/Infrastructure/Urls.cs | 1 + .../CitationBurst/BrightLocalCbPayOptions.cs | 18 +++ .../CitationBurst/CitationBurstOptions.cs | 103 ++++++++++++++++- .../CitationBurst/CitationBurstService.cs | 70 ++++++++++++ .../UpdateCitationBurstOptions.cs | 108 ++++++++++++++++++ 8 files changed, 465 insertions(+), 2 deletions(-) create mode 100644 BrightLocal/src/BrightLocal/Entities/BrightLocalCbAllCampaigns.cs create mode 100644 BrightLocal/src/BrightLocal/Entities/BrightLocalCbCampaign.cs create mode 100644 BrightLocal/src/BrightLocal/Entities/BrightLocalCitations.cs create mode 100644 BrightLocal/src/BrightLocal/Services/CitationBurst/BrightLocalCbPayOptions.cs create mode 100644 BrightLocal/src/BrightLocal/Services/CitationBurst/CitationBurstService.cs create mode 100644 BrightLocal/src/BrightLocal/Services/CitationBurst/UpdateCitationBurstOptions.cs diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalCbAllCampaigns.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalCbAllCampaigns.cs new file mode 100644 index 0000000..38ec739 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalCbAllCampaigns.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace BrightLocal +{ + public class BrightLocalCbAllCampaigns + { + public CbResponse response { get; set; } + } + + public class CbResponse + { + public List results { get; set; } + } + + public class CampaignsCitation + { + public string name { get; set; } + public string status { get; set; } + public string site_type { get; set; } + public string citation_url { get; set; } + public string domain_authority { get; set; } + public string citation_value { get; set; } + } + + public class Aggregator + { + public string name { get; set; } + public string status { get; set; } + public string site_type { get; set; } + public string citation_url { get; set; } + public string domain_authority { get; set; } + public string citation_value { get; set; } + } + + public class CbResult + { + public string campaign_id { get; set; } + public string location_id { get; set; } + public string campaign_name { get; set; } + public string date_purchased { get; set; } + public string date_completed { get; set; } + public string email { get; set; } + public string username { get; set; } + public string password { get; set; } + public List citations { get; set; } + public List aggregators { get; set; } + } +} diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalCbCampaign.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalCbCampaign.cs new file mode 100644 index 0000000..cfc7ac3 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalCbCampaign.cs @@ -0,0 +1,67 @@ +using System.Collections.Generic; + +namespace BrightLocal +{ + public class BrightLocalCbCampaign + { + public CampaignResponse response { get; set; } + } + + public class CampaignResponse + { + public CampaignResults results { get; set; } + } + + public class CampaignResults + { + public string campaign_id { get; set; } + public string purchase_date { get; set; } + public string completion_date { get; set; } + public string username { get; set; } + public string email { get; set; } + public string password { get; set; } + public List stats { get; set; } + public List citations { get; set; } + public List aggregators { get; set; } + public int location_id { get; set; } + public CampaignUrls urls { get; set; } + } + + public class Stat + { + public string start_date { get; set; } + public int citations_count { get; set; } + public int scheduled { get; set; } + public int submitted { get; set; } + public int live { get; set; } + public int updated { get; set; } + public int replaced { get; set; } + } + + public class CampaignCitation + { + public string site { get; set; } + public string type { get; set; } + public string domain_authority { get; set; } + public string status { get; set; } + public string link { get; set; } + public string notes { get; set; } + } + + public class CampaignAggregator + { + public string site { get; set; } + public string type { get; set; } + public string domain_authority { get; set; } + public string status { get; set; } + public string link { get; set; } + public string notes { get; set; } + } + + public class CampaignUrls + { + public string interactive_url { get; set; } + public string pdf_url { get; set; } + public string csv_url { get; set; } + } +} diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalCitations.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalCitations.cs new file mode 100644 index 0000000..3bd3307 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalCitations.cs @@ -0,0 +1,49 @@ +using System.Collections.Generic; + +namespace BrightLocal +{ + public class BrightLocalCitations + { + public bool error { get; set; } + public int campaignId { get; set; } + public Citations citations { get; set; } + public List aggregators { get; set; } + } + + public class Citations : Dictionary + { + + } + + public class Citation + { + public string citation_value { get; set; } + public string domain_authority { get; set; } + public string type { get; set; } + public string phone_verification { get; set; } + public string client_verification { get; set; } + public string notes { get; set; } + public string no_update { get; set; } + public string no_photos { get; set; } + public string part_of_yext_network { get; set; } + public string quick_listing { get; set; } + public string secondary_campaign_id { get; set; } + public string status { get; set; } + } + + public class Aggregator + { + public string citation { get; set; } + public string domain_authority { get; set; } + public string type { get; set; } + public string phone_verification { get; set; } + public string client_verification { get; set; } + public string notes { get; set; } + public string no_update { get; set; } + public string no_photos { get; set; } + public string part_of_yext_network { get; set; } + public string quick_listing { get; set; } + public string secondary_campaign_id { get; set; } + public string status { get; set; } + } +} diff --git a/BrightLocal/src/BrightLocal/Infrastructure/Urls.cs b/BrightLocal/src/BrightLocal/Infrastructure/Urls.cs index 086b876..8640696 100644 --- a/BrightLocal/src/BrightLocal/Infrastructure/Urls.cs +++ b/BrightLocal/src/BrightLocal/Infrastructure/Urls.cs @@ -13,6 +13,7 @@ internal static class Urls internal static string Lsrc => "/v2/lsrc/"; internal static string Lscu => "/v4/lscu/"; internal static string CitationTracker => "/v2/ct/"; + internal static string CitationBurst => "/v2/cb/"; } } diff --git a/BrightLocal/src/BrightLocal/Services/CitationBurst/BrightLocalCbPayOptions.cs b/BrightLocal/src/BrightLocal/Services/CitationBurst/BrightLocalCbPayOptions.cs new file mode 100644 index 0000000..454fe1b --- /dev/null +++ b/BrightLocal/src/BrightLocal/Services/CitationBurst/BrightLocalCbPayOptions.cs @@ -0,0 +1,18 @@ +using Newtonsoft.Json; +using System.Collections.Generic; + +namespace BrightLocal +{ + public class BrightLocalCbPayOptions + { + public int campaign_id { get; set; } + public string package_id { get; set; } + public string aurtoselect { get; set; } + public List citations { get; set; } + [JsonProperty("remove-duplicates")] + public string removeDuplicates { get; set; } + public List aggregators { get; set; } + public string notes { get; set; } + + } +} diff --git a/BrightLocal/src/BrightLocal/Services/CitationBurst/CitationBurstOptions.cs b/BrightLocal/src/BrightLocal/Services/CitationBurst/CitationBurstOptions.cs index 548dbce..5071679 100644 --- a/BrightLocal/src/BrightLocal/Services/CitationBurst/CitationBurstOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/CitationBurst/CitationBurstOptions.cs @@ -1,11 +1,110 @@ -using System; +using Newtonsoft.Json; +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -namespace BrightLocal.Services.CitationBurst +namespace BrightLocal { public class CitationBurstOptions { + [JsonProperty("location_id")] + public int locationId { get; set; } + [JsonProperty("business_name")] + public string businessName { get; set; } + [JsonProperty("campaign_name")] + public string campaignName { get; set; } + [JsonProperty("website_address")] + public string websiteAddress { get; set; } + [JsonProperty("campaign_country")] + public string campaignCountry { get; set; } + [JsonProperty("campaign_state")] + public string campaignState { get; set; } + [JsonProperty("campaign_city")] + public string campaignCity { get; set; } + [JsonProperty("business_category_id")] + public int businessCategoryId { get; set; } + [JsonProperty("business_categories")] + public List businessCategories { get; set; } + [JsonProperty("address1")] + public string address1 { get; set; } + [JsonProperty("address2")] + public string address2 { get; set; } + [JsonProperty("postcode")] + public string postcode { get; set; } + [JsonProperty("contact_name")] + public string contactName { get; set; } + [JsonProperty("contact_telephone")] + public string contactTelephone { get; set; } + [JsonProperty("mobile_number")] + public string mobileNumber { get; set; } + [JsonProperty("fax_number")] + public string faxNumber { get; set; } + [JsonProperty("brief_description")] + public string briefDescription { get; set; } + [JsonProperty("full_description")] + public string fullDescription { get; set; } + [JsonProperty("employees_number")] + public int employeesNumber { get; set; } + [JsonProperty("start_year")] + public int startYear { get; set; } + [JsonProperty("service_name_1")] + public string serviceName1 { get; set; } + [JsonProperty("service_name_2")] + public string serviceName2 { get; set; } + [JsonProperty("service_name_3")] + public string serviceName3 { get; set; } + [JsonProperty("service_name_4")] + public string serviceName4 { get; set; } + [JsonProperty("service_name_5")] + public string serviceName5 { get; set; } + [JsonProperty("working_hours_apply_to_all")] + public string workingHoursApplyToAll { get; set; } + [JsonProperty("working_hours_mon_start")] + public int workingHoursMonStart { get; set; } + [JsonProperty("working_hours_mon_end")] + public int workingHoursMonEnd { get; set; } + [JsonProperty("working_hours_tue_start")] + public int workingHoursTueStart { get; set; } + [JsonProperty("working_hours_tue_end")] + public int workingHoursTueEnd { get; set; } + [JsonProperty("working_hours_wed_start")] + public int workingHoursWedStart { get; set; } + [JsonProperty("working_hours_Wed_end")] + public int workingHoursWedEnd { get; set; } + [JsonProperty("working_hours_thu_start")] + public int workingHoursThuStart { get; set; } + [JsonProperty("working_hours_thu_end")] + public int workingHoursthuEnd { get; set; } + [JsonProperty("working_hours_fri_start")] + public int workingHoursFriStart { get; set; } + [JsonProperty("working_hours_fri_end")] + public int workingHoursFriEnd { get; set; } + [JsonProperty("working_hours_sat_start")] + public int workingHoursSatStart { get; set; } + [JsonProperty("working_hours_sat_end")] + public int workingHoursSatEnd { get; set; } + [JsonProperty("working_hours_mon_start")] + public int workingHoursSunStart { get; set; } + [JsonProperty("working_hours_mon_end")] + public int workingHoursSunEnd { get; set; } + [JsonProperty("special_offer")] + public string specialOffer { get; set; } + [JsonProperty("special_offer_description")] + public string specialOfferDescription { get; set; } + [JsonProperty("special_offer_expiration_date")] + public string specialOfferExpirationDate { get; set; } + [JsonProperty("payment_methods")] + public string paymentMethods { get; set; } + [JsonProperty("receive-email-alerts")] + public string receiveEmailAlerts { get; set; } + [JsonProperty("alert-email-addresses")] + public string alertEmailAddresses { get; set; } + [JsonProperty("old_business_name")] + public string oldBusinessName { get; set; } + [JsonProperty("old_lookup_data")] + public string oldLookUpData { get; set; } + [JsonProperty("is_public")] + public string isPublic { get; set; } } } diff --git a/BrightLocal/src/BrightLocal/Services/CitationBurst/CitationBurstService.cs b/BrightLocal/src/BrightLocal/Services/CitationBurst/CitationBurstService.cs new file mode 100644 index 0000000..045aa30 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Services/CitationBurst/CitationBurstService.cs @@ -0,0 +1,70 @@ +using Newtonsoft.Json; + +namespace BrightLocal +{ + public class CitationBurstService : BrightLocalService + { + public CitationBurstService(string apiKey = null, string apiSecret = null) : base(apiKey, apiSecret) { } + + BrightLocalRequestor request = new BrightLocalRequestor(); + + public virtual BrightLocalSuccess Create(CitationBurstOptions createOptions) + { + var url = string.Format(Urls.CitationBurst + "{0}", "create"); + var parameters = Parameters.convertListToParameters(createOptions); + var success = request.Post(url, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual BrightLocalSuccess Update(UpdateCitationBurstOptions updateOptions) + { + var url = string.Format(Urls.CitationBurst + "{0}", updateOptions.campaignId); + var parameters = Parameters.convertListToParameters(updateOptions); + var success = request.Put(url, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual BrightLocalCitations GetCitations(int campaignId) + { + var url = string.Format(Urls.CitationBurst + "{0}", "citations"); + var parameters = new Parameters.requestParameters(); + parameters.Add("campaign-id", campaignId); + var success = request.Get(url, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual BrightLocalSuccess ConfirmAndPay(BrightLocalCbPayOptions payOptions) + { + var url = string.Format(Urls.CitationBurst + "{0}", "confirm-and-pay"); + var parameters = Parameters.convertListToParameters(payOptions); + var success = request.Post(url, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual BrightLocalCbAllCampaigns GetCampaigns() + { + var url = string.Format(Urls.CitationBurst + "{0}", "get-all"); + var parameters = new Parameters.requestParameters(); + var success = request.Get(url, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual BrightLocalCbAllCampaigns GetCampaigns(int locationId) + { + var url = string.Format(Urls.CitationBurst + "{0}", "get-all"); + var parameters = new Parameters.requestParameters(); + parameters.Add("location-id", locationId); + var success = request.Get(url, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual BrightLocalCbCampaign GetCampaign(int campaignId) + { + var url = string.Format(Urls.CitationBurst + "{0}", "get"); + var parameters = new Parameters.requestParameters(); + parameters.Add("campaign-id", campaignId); + var success = request.Get(url, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + } +} diff --git a/BrightLocal/src/BrightLocal/Services/CitationBurst/UpdateCitationBurstOptions.cs b/BrightLocal/src/BrightLocal/Services/CitationBurst/UpdateCitationBurstOptions.cs new file mode 100644 index 0000000..5e17835 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Services/CitationBurst/UpdateCitationBurstOptions.cs @@ -0,0 +1,108 @@ +using Newtonsoft.Json; + +namespace BrightLocal +{ + public class UpdateCitationBurstOptions + { + + public int campaignId { get; set; } + [JsonProperty("location_id")] + public int locationId { get; set; } + [JsonProperty("business_name")] + public string businessName { get; set; } + [JsonProperty("campaign_name")] + public string campaignName { get; set; } + [JsonProperty("website_address")] + public string websiteAddress { get; set; } + [JsonProperty("campaign_country")] + public string campaignCountry { get; set; } + [JsonProperty("campaign_state")] + public string campaignState { get; set; } + [JsonProperty("campaign_city")] + public string campaignCity { get; set; } + [JsonProperty("business_category_id")] + public int businessCategoryId { get; set; } + [JsonProperty("business_categories")] + public List businessCategories { get; set; } + [JsonProperty("address1")] + public string address1 { get; set; } + [JsonProperty("address2")] + public string address2 { get; set; } + [JsonProperty("postcode")] + public string postcode { get; set; } + [JsonProperty("contact_name")] + public string contactName { get; set; } + [JsonProperty("contact_telephone")] + public string contactTelephone { get; set; } + [JsonProperty("mobile_number")] + public string mobileNumber { get; set; } + [JsonProperty("fax_number")] + public string faxNumber { get; set; } + [JsonProperty("brief_description")] + public string briefDescription { get; set; } + [JsonProperty("full_description")] + public string fullDescription { get; set; } + [JsonProperty("employees_number")] + public int employeesNumber { get; set; } + [JsonProperty("start_year")] + public int startYear { get; set; } + [JsonProperty("service_name_1")] + public string serviceName1 { get; set; } + [JsonProperty("service_name_2")] + public string serviceName2 { get; set; } + [JsonProperty("service_name_3")] + public string serviceName3 { get; set; } + [JsonProperty("service_name_4")] + public string serviceName4 { get; set; } + [JsonProperty("service_name_5")] + public string serviceName5 { get; set; } + [JsonProperty("working_hours_apply_to_all")] + public string workingHoursApplyToAll { get; set; } + [JsonProperty("working_hours_mon_start")] + public int workingHoursMonStart { get; set; } + [JsonProperty("working_hours_mon_end")] + public int workingHoursMonEnd { get; set; } + [JsonProperty("working_hours_tue_start")] + public int workingHoursTueStart { get; set; } + [JsonProperty("working_hours_tue_end")] + public int workingHoursTueEnd { get; set; } + [JsonProperty("working_hours_wed_start")] + public int workingHoursWedStart { get; set; } + [JsonProperty("working_hours_Wed_end")] + public int workingHoursWedEnd { get; set; } + [JsonProperty("working_hours_thu_start")] + public int workingHoursThuStart { get; set; } + [JsonProperty("working_hours_thu_end")] + public int workingHoursthuEnd { get; set; } + [JsonProperty("working_hours_fri_start")] + public int workingHoursFriStart { get; set; } + [JsonProperty("working_hours_fri_end")] + public int workingHoursFriEnd { get; set; } + [JsonProperty("working_hours_sat_start")] + public int workingHoursSatStart { get; set; } + [JsonProperty("working_hours_sat_end")] + public int workingHoursSatEnd { get; set; } + [JsonProperty("working_hours_mon_start")] + public int workingHoursSunStart { get; set; } + [JsonProperty("working_hours_mon_end")] + public int workingHoursSunEnd { get; set; } + [JsonProperty("special_offer")] + public string specialOffer { get; set; } + [JsonProperty("special_offer_description")] + public string specialOfferDescription { get; set; } + [JsonProperty("special_offer_expiration_date")] + public string specialOfferExpirationDate { get; set; } + [JsonProperty("payment_methods")] + public string paymentMethods { get; set; } + [JsonProperty("receive-email-alerts")] + public string receiveEmailAlerts { get; set; } + [JsonProperty("alert-email-addresses")] + public string alertEmailAddresses { get; set; } + [JsonProperty("old_business_name")] + public string oldBusinessName { get; set; } + [JsonProperty("old_lookup_data")] + public string oldLookUpData { get; set; } + [JsonProperty("is_public")] + public string isPublic { get; set; } + } +} From d88af2621ccd2a1d1da5ed393dcffdd489352a6b Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Tue, 10 Jan 2017 14:55:06 -0700 Subject: [PATCH 49/93] fixed duplicate class names --- .../src/BrightLocal/Entities/BrightLocalCbAllCampaigns.cs | 4 ++-- .../Services/CitationBurst/UpdateCitationBurstOptions.cs | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalCbAllCampaigns.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalCbAllCampaigns.cs index 38ec739..da3a450 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalCbAllCampaigns.cs +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalCbAllCampaigns.cs @@ -25,7 +25,7 @@ public class CampaignsCitation public string citation_value { get; set; } } - public class Aggregator + public class CbAggregator { public string name { get; set; } public string status { get; set; } @@ -46,6 +46,6 @@ public class CbResult public string username { get; set; } public string password { get; set; } public List citations { get; set; } - public List aggregators { get; set; } + public List aggregators { get; set; } } } diff --git a/BrightLocal/src/BrightLocal/Services/CitationBurst/UpdateCitationBurstOptions.cs b/BrightLocal/src/BrightLocal/Services/CitationBurst/UpdateCitationBurstOptions.cs index 5e17835..48a3ef8 100644 --- a/BrightLocal/src/BrightLocal/Services/CitationBurst/UpdateCitationBurstOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/CitationBurst/UpdateCitationBurstOptions.cs @@ -1,4 +1,5 @@ using Newtonsoft.Json; +using System.Collections.Generic; namespace BrightLocal { From 800f7664aed231858292caea7b33d2b518eb6b39 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Wed, 11 Jan 2017 11:25:46 -0700 Subject: [PATCH 50/93] added review flow services and entities --- .../Entities/BrightLocalRfGetAll.cs | 24 +++++ .../Entities/BrightLocalRfReport.cs | 62 +++++++++++++ .../Entities/BrightLocalRfReviews.cs | 27 ++++++ .../src/BrightLocal/Infrastructure/Urls.cs | 2 +- .../Services/ReviewFlow/ReviewFlowOptions.cs | 54 +++++++++++ .../Services/ReviewFlow/ReviewFlowService.cs | 93 +++++++++++++++++++ .../ReviewFlow/RfGetReviewsOptions.cs | 20 ++++ .../ReviewFlow/UpdateReviewFlowOptions.cs | 47 ++++++++++ BrightLocal/src/BrightLocal/project.json | 2 +- 9 files changed, 329 insertions(+), 2 deletions(-) create mode 100644 BrightLocal/src/BrightLocal/Entities/BrightLocalRfGetAll.cs create mode 100644 BrightLocal/src/BrightLocal/Entities/BrightLocalRfReport.cs create mode 100644 BrightLocal/src/BrightLocal/Entities/BrightLocalRfReviews.cs create mode 100644 BrightLocal/src/BrightLocal/Services/ReviewFlow/ReviewFlowOptions.cs create mode 100644 BrightLocal/src/BrightLocal/Services/ReviewFlow/ReviewFlowService.cs create mode 100644 BrightLocal/src/BrightLocal/Services/ReviewFlow/RfGetReviewsOptions.cs create mode 100644 BrightLocal/src/BrightLocal/Services/ReviewFlow/UpdateReviewFlowOptions.cs diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalRfGetAll.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalRfGetAll.cs new file mode 100644 index 0000000..ca69457 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalRfGetAll.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; + +namespace BrightLocal +{ + public class BrightLocalRfGetAll + { + public bool success { get; set; } + public List reports { get; set; } + } + + public class RfReports + { + public string report_id { get; set; } + public string report_name { get; set; } + public string location_id { get; set; } + public string created_at { get; set; } + public string last_update { get; set; } + public bool is_running { get; set; } + public string running_message { get; set; } + public bool fetching { get; set; } + public bool complete { get; set; } + } +} diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalRfReport.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalRfReport.cs new file mode 100644 index 0000000..f357a0b --- /dev/null +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalRfReport.cs @@ -0,0 +1,62 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace BrightLocal +{ + public class BrightLocalRfReport + { + public bool success { get; set; } + public RfReport report { get; set; } + } + + public class RfReport + { + public string report_id { get; set; } + public string report_name { get; set; } + public string location_id { get; set; } + public string customer_id { get; set; } + public string business_name { get; set; } + public string contact_telephone { get; set; } + public string address1 { get; set; } + public string address2 { get; set; } + public string city { get; set; } + public string postcode { get; set; } + public string country { get; set; } + public bool receive_email_alerts { get; set; } + public List alert_email_addresses { get; set; } + public string last_update { get; set; } + public string created_at { get; set; } + public string schedule { get; set; } + public string run_on { get; set; } + public string reviews_count { get; set; } + public string rating { get; set; } + public bool is_running { get; set; } + public string white_label_profile_id { get; set; } + public bool is_public { get; set; } + public string public_key { get; set; } + public RfDirectories directories { get; set; } + public RfUrls urls { get; set; } + } + + public class RfUrls + { + public string interactive_url { get; set; } + public string pdf_url { get; set; } + public string public_interactive_url { get; set; } + public string public_pdf_url { get; set; } + } + + public class RfDirectories : Dictionary + { + + } + + public class RfDirectoryUrls + { + public string url { get; set; } + public bool searched { get; set; } + public bool include { get; set; } + } +} diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalRfReviews.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalRfReviews.cs new file mode 100644 index 0000000..610edbd --- /dev/null +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalRfReviews.cs @@ -0,0 +1,27 @@ +using System.Collections.Generic; + +namespace BrightLocal +{ + public class BrightLocalRfReviews + { + public bool success { get; set; } + public List reviews { get; set; } + } + + public class Review + { + public string dt { get; set; } + public string report_id { get; set; } + public string directory { get; set; } + public string timestamp { get; set; } + public string rating { get; set; } + public string title { get; set; } + public string author { get; set; } + public string text { get; set; } + public string link { get; set; } + public string url { get; set; } + public string source { get; set; } + public string name { get; set; } + public string report_run_id { get; set; } + } +} diff --git a/BrightLocal/src/BrightLocal/Infrastructure/Urls.cs b/BrightLocal/src/BrightLocal/Infrastructure/Urls.cs index 8640696..8101757 100644 --- a/BrightLocal/src/BrightLocal/Infrastructure/Urls.cs +++ b/BrightLocal/src/BrightLocal/Infrastructure/Urls.cs @@ -14,6 +14,6 @@ internal static class Urls internal static string Lscu => "/v4/lscu/"; internal static string CitationTracker => "/v2/ct/"; internal static string CitationBurst => "/v2/cb/"; - + internal static string ReviewFlow => "/v4/rf/"; } } diff --git a/BrightLocal/src/BrightLocal/Services/ReviewFlow/ReviewFlowOptions.cs b/BrightLocal/src/BrightLocal/Services/ReviewFlow/ReviewFlowOptions.cs new file mode 100644 index 0000000..f049d32 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Services/ReviewFlow/ReviewFlowOptions.cs @@ -0,0 +1,54 @@ +using Newtonsoft.Json; +using System.Collections.Generic; + +namespace BrightLocal +{ + public class ReviewFlowOptions + { + [JsonProperty("report-name")] + public string reportName { get; set; } + [JsonProperty("location-id")] + public int locationId { get; set; } + [JsonProperty("white-label-profile-id")] + public int whiteLabelProfileId { get; set; } + [JsonProperty("business-name")] + public string businessName { get; set; } + [JsonProperty("contact-telephone")] + public string contactTelephone { get; set; } + [JsonProperty("address1")] + public string address1 { get; set; } + [JsonProperty("address2")] + public string address2 { get; set; } + [JsonProperty("city")] + public string city { get; set; } + [JsonProperty("postcode")] + public string postcode { get; set; } + [JsonProperty("country")] + public string country { get; set; } + [JsonProperty("schedule")] + public string schedule { get; set; } + [JsonProperty("run-on")] + public int runOn { get; set; } + [JsonProperty("receive-email-alerts")] + public string receiveEmailAlerts { get; set; } + [JsonProperty("email-addresses")] + public List emailAddresses { get; set; } + [JsonProperty("is-public")] + public string isPublic { get; set; } + [JsonProperty("directories")] + public RFDirectoryUrls directories { get; set; } + [JsonProperty("run-report")] + public string runReport { get; set; } + } + + public class RFDirectoryUrls : Dictionary + { + + } + + public class Directories + { + public string url { get; set; } + public bool include { get; set; } + } +} diff --git a/BrightLocal/src/BrightLocal/Services/ReviewFlow/ReviewFlowService.cs b/BrightLocal/src/BrightLocal/Services/ReviewFlow/ReviewFlowService.cs new file mode 100644 index 0000000..7f5c195 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Services/ReviewFlow/ReviewFlowService.cs @@ -0,0 +1,93 @@ +using Newtonsoft.Json; + +namespace BrightLocal +{ + public class ReviewFlowService : BrightLocalService + { + public ReviewFlowService(string apiKey = null, string apiSecret = null) : base(apiKey, apiSecret) { } + + BrightLocalRequestor request = new BrightLocalRequestor(); + + public virtual BrightLocalSuccess Create(ReviewFlowOptions createOptions) + { + var url = string.Format(Urls.ReviewFlow + "{0}", "create"); + var parameters = Parameters.convertListToParameters(createOptions); + var success = request.Post(url, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual BrightLocalSuccess Update(UpdateReviewFlowOptions updateOptions) + { + var url = string.Format(Urls.ReviewFlow + "{0}", updateOptions.reportId); + var parameters = Parameters.convertListToParameters(updateOptions); + var success = request.Put(url, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual BrightLocalRfReport Get(int reportId) + { + var url = string.Format(Urls.ReviewFlow + "{0}", reportId); + var parameters = new Parameters.requestParameters(); + var success = request.Get(url, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual BrightLocalSuccess Delete(int reportId) + { + var url = string.Format(Urls.ReviewFlow + "{0}", reportId); + var parameters = new Parameters.requestParameters(); + var success = request.Delete(url, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual BrightLocalRfGetAll GetAll() + { + var url = string.Format(Urls.ReviewFlow); + var parameters = new Parameters.requestParameters(); + var success = request.Get(url, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual BrightLocalRfGetAll GetAll(int locationId) + { + var url = string.Format(Urls.ReviewFlow); + var parameters = new Parameters.requestParameters(); + parameters.Add("location-id", locationId); + var success = request.Get(url, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual BrightLocalRfGetAll Search(string query) + { + var url = string.Format(Urls.ReviewFlow + "{0}", "search"); + var parameters = new Parameters.requestParameters(); + parameters.Add("q", query); + var success = request.Get(url, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual BrightLocalRfGetAll GetReviews(RfGetReviewsOptions getReviews) + { + var url = string.Format(Urls.ReviewFlow + "{0}" + "/reviews", getReviews.reportId); + var parameters = Parameters.convertListToParameters(getReviews); + var success = request.Get(url, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual BrightLocalSuccess GetReviewCount(int reportId) + { + var url = string.Format(Urls.ReviewFlow + "{0}" + "/reviews/count", reportId); + var parameters = new Parameters.requestParameters(); + var success = request.Get(url, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual BrightLocalSuccess GetGrowth(int reportId) + { + var url = string.Format(Urls.ReviewFlow + "{0}" + "/reviews/growth", reportId); + var parameters = new Parameters.requestParameters(); + var success = request.Get(url, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + } +} diff --git a/BrightLocal/src/BrightLocal/Services/ReviewFlow/RfGetReviewsOptions.cs b/BrightLocal/src/BrightLocal/Services/ReviewFlow/RfGetReviewsOptions.cs new file mode 100644 index 0000000..aea293f --- /dev/null +++ b/BrightLocal/src/BrightLocal/Services/ReviewFlow/RfGetReviewsOptions.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Threading.Tasks; + +namespace BrightLocal +{ + public class RfGetReviewsOptions + { + public int reportId { get; set; } + public string directory { get; set; } + public int stars { get; set; } + public string sort { get; set; } + public string from { get; set; } + public string to { get; set; } + public int offset { get; set; } + public int limit { get; set; } + } +} diff --git a/BrightLocal/src/BrightLocal/Services/ReviewFlow/UpdateReviewFlowOptions.cs b/BrightLocal/src/BrightLocal/Services/ReviewFlow/UpdateReviewFlowOptions.cs new file mode 100644 index 0000000..2188a61 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Services/ReviewFlow/UpdateReviewFlowOptions.cs @@ -0,0 +1,47 @@ +using Newtonsoft.Json; +using System.Collections.Generic; + +namespace BrightLocal +{ + public class UpdateReviewFlowOptions + { + [JsonProperty("report-id")] + public string reportId { get; set; } + [JsonProperty("report-name")] + public string reportName { get; set; } + [JsonProperty("location-id")] + public int locationId { get; set; } + [JsonProperty("white-label-profile-id")] + public int whiteLabelProfileId { get; set; } + [JsonProperty("business-name")] + public string businessName { get; set; } + [JsonProperty("contact-telephone")] + public string contactTelephone { get; set; } + [JsonProperty("address1")] + public string address1 { get; set; } + [JsonProperty("address2")] + public string address2 { get; set; } + [JsonProperty("city")] + public string city { get; set; } + [JsonProperty("postcode")] + public string postcode { get; set; } + [JsonProperty("country")] + public string country { get; set; } + [JsonProperty("schedule")] + public string schedule { get; set; } + [JsonProperty("run-on")] + public int runOn { get; set; } + [JsonProperty("receive-email-alerts")] + public string receiveEmailAlerts { get; set; } + [JsonProperty("email-addresses")] + public List emailAddresses { get; set; } + [JsonProperty("is-public")] + public string isPublic { get; set; } + [JsonProperty("directories")] + public RFDirectoryUrls directories { get; set; } + [JsonProperty("run-report")] + public string runReport { get; set; } + } + +} + diff --git a/BrightLocal/src/BrightLocal/project.json b/BrightLocal/src/BrightLocal/project.json index 7558eb8..a53d5b6 100644 --- a/BrightLocal/src/BrightLocal/project.json +++ b/BrightLocal/src/BrightLocal/project.json @@ -3,7 +3,7 @@ "id": "BrightLocal", "description": "A c# wrapper class for consuming The Bright Local api. Automatically generates the proper authentication, with the siganture and expires parameter. Avoid the need to generate your own authentication signature. See documentation for examples.", "dependencies": { - "Newtonsoft.Json": "9.0.1" + "Newtonsoft.Json": "9.0.1" }, "frameworks": { From 81ca90123c5492863d63385f966ead332f5f088e Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Fri, 13 Jan 2017 11:06:25 -0700 Subject: [PATCH 51/93] Finished Review FLow ENtities and added examples --- .../Entities/BrightLocalRfDirectories.cs | 58 +++++++ .../Account-Methods/rFExamples.cs | 161 ++++++++++++++++++ .../Services/ReviewFlow/ReviewFlowService.cs | 28 ++- .../ReviewFlow/UpdateReviewFlowOptions.cs | 2 +- .../examples/{rfRxamples.cs => rFExamples.cs} | 2 +- 5 files changed, 247 insertions(+), 4 deletions(-) create mode 100644 BrightLocal/src/BrightLocal/Entities/BrightLocalRfDirectories.cs create mode 100644 BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/rFExamples.cs rename BrightLocal/src/BrightLocal/examples/{rfRxamples.cs => rFExamples.cs} (99%) diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalRfDirectories.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalRfDirectories.cs new file mode 100644 index 0000000..9bf3cc8 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalRfDirectories.cs @@ -0,0 +1,58 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace BrightLocal +{ + public class BrightLocalRfDirectories + { + public bool success { get; set; } + public RflowDirectories directories { get; set; } + } + + public class BrightLocalRfDirectoryStats + { + public bool success { get; set; } + public RflowDirectories stats { get; set; } + } + + public class BrightLocalRfStarCounts + { + public bool success { get; set; } + public StarCounts counts { get; set; } + } + + public class RflowDirectories : Dictionary + { + + } + + public class ReviewfDirectories + { + public string directory { get; set; } + public string name { get; set; } + public bool use { get; set; } + public string url { get; set; } + public bool searched { get; set; } + public int reviews { get; set; } + } + + public class StarCounts + { + [JsonProperty("0star")] + public string star0 { get; set; } + [JsonProperty("1star")] + public string star1 { get; set; } + [JsonProperty("2star")] + public string star2 { get; set; } + [JsonProperty("3star")] + public string star3 { get; set; } + [JsonProperty("4star")] + public string star4 { get; set; } + [JsonProperty("5star")] + public string star5 { get; set; } + + } +} diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/rFExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/rFExamples.cs new file mode 100644 index 0000000..c6cbc1d --- /dev/null +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/rFExamples.cs @@ -0,0 +1,161 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace BrightLocal.Examples_version2.Account_Methods +{ + public class rFExamples + { + public static BrightLocalSuccess Create() + { + var myReviewReport = new ReviewFlowOptions(); + myReviewReport.reportName = "Sample Citation Tracker Report"; + myReviewReport.businessName = "Le Bernardin"; + myReviewReport.contactTelephone = "+1 212-554-1515"; + myReviewReport.address1 = "155 Weest 51st Street"; + myReviewReport.address2 = ""; + myReviewReport.city = "NYC"; + myReviewReport.postcode = "10019"; + myReviewReport.country = "USA"; + + // Example for supplying Local Directory URLs (see local-directory-urls parameter) + myReviewReport.directories.Add( + "citysearch", + new Directories + { + url = "http://www.yelp.co.uk/biz/greens-restaurant-san-francisco-3", + include = true + }); + myReviewReport.directories.Add( + "dexknows", + new Directories + { + url = "", + include = true + }); + + var rfService = new ReviewFlowService(); + + BrightLocalSuccess newReviewReport = rfService.Create(myReviewReport); + return newReviewReport; + } + + public static BrightLocalSuccess Update() + { + var myReviewReport = new UpdateReviewFlowOptions(); + myReviewReport.reportId = 1; + myReviewReport.reportName = "Sample Citation Tracker Report"; + myReviewReport.businessName = "Le Bernardin"; + myReviewReport.contactTelephone = "+1 212-554-1515"; + myReviewReport.address1 = "155 Weest 51st Street"; + myReviewReport.address2 = ""; + myReviewReport.city = "NYC"; + myReviewReport.postcode = "10019"; + myReviewReport.country = "USA"; + + // Example for supplying Local Directory URLs (see local-directory-urls parameter) + myReviewReport.directories.Add( + "citysearch", + new Directories + { + url = "http://www.yelp.co.uk/biz/greens-restaurant-san-francisco-3", + include = true + }); + myReviewReport.directories.Add( + "dexknows", + new Directories + { + url = "", + include = true + }); + + var rfService = new ReviewFlowService(); + + BrightLocalSuccess updateReviewReport = rfService.Update(myReviewReport); + return updateReviewReport; + } + + public static BrightLocalRfReport GetReport() + { + int reportId = 1; + var rfService = new ReviewFlowService(); + + BrightLocalRfReport reviewReport = rfService.Get(reportId); + return reviewReport; + } + + public static BrightLocalSuccess DeleteReport() + { + int reportId = 1; + var rfService = new ReviewFlowService(); + + BrightLocalSuccess deleteReport = rfService.Delete(reportId); + return deleteReport; + } + + public static BrightLocalRfGetAll SearchReport() + { + string query = "New York"; + var rfService = new ReviewFlowService(); + + BrightLocalRfGetAll results = rfService.Search(query); + return results; + } + + public static BrightLocalRfReviews GetReviews() + { + var myReviewReport = new RfGetReviewsOptions(); + myReviewReport.reportId = 1; + var rfService = new ReviewFlowService(); + + BrightLocalRfReviews reviews = rfService.GetReviews(myReviewReport); + return reviews; + } + + public static BrightLocalSuccess GetReviewCount() + { + int reportId = 1; + var rfService = new ReviewFlowService(); + + BrightLocalSuccess reviewCount = rfService.GetReviewCount(reportId); + return reviewCount; + } + + public static BrightLocalSuccess GetGrowth() + { + int reportId = 1; + var rfService = new ReviewFlowService(); + + BrightLocalSuccess reviewCount = rfService.GetGrowth(reportId); + return reviewCount; + } + + public static BrightLocalRfDirectories GetDirectories() + { + int reportId = 1; + var rfService = new ReviewFlowService(); + + BrightLocalRfDirectories reviewDirectories = rfService.GetDirectories(reportId); + return reviewDirectories; + } + + public static BrightLocalRfDirectoryStats GetDirectoryStats() + { + int reportId = 1; + var rfService = new ReviewFlowService(); + + BrightLocalRfDirectoryStats reviewDirectoryStats = rfService.GetDirectoryStats(reportId); + return reviewDirectoryStats; + } + + public static BrightLocalRfStarCounts GetStarCount() + { + int reportId = 1; + var rfService = new ReviewFlowService(); + + BrightLocalRfStarCounts reviewStarCount = rfService.GetStarCount(reportId); + return reviewStarCount; + } + } +} diff --git a/BrightLocal/src/BrightLocal/Services/ReviewFlow/ReviewFlowService.cs b/BrightLocal/src/BrightLocal/Services/ReviewFlow/ReviewFlowService.cs index 7f5c195..9771b9d 100644 --- a/BrightLocal/src/BrightLocal/Services/ReviewFlow/ReviewFlowService.cs +++ b/BrightLocal/src/BrightLocal/Services/ReviewFlow/ReviewFlowService.cs @@ -66,12 +66,12 @@ public virtual BrightLocalRfGetAll Search(string query) return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalRfGetAll GetReviews(RfGetReviewsOptions getReviews) + public virtual BrightLocalRfReviews GetReviews(RfGetReviewsOptions getReviews) { var url = string.Format(Urls.ReviewFlow + "{0}" + "/reviews", getReviews.reportId); var parameters = Parameters.convertListToParameters(getReviews); var success = request.Get(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } public virtual BrightLocalSuccess GetReviewCount(int reportId) @@ -89,5 +89,29 @@ public virtual BrightLocalSuccess GetGrowth(int reportId) var success = request.Get(url, parameters, this.api_key, this.api_secret); return JsonConvert.DeserializeObject(success.Content); } + + public virtual BrightLocalRfDirectories GetDirectories(int reportId) + { + var url = string.Format(Urls.ReviewFlow + "{0}" + "/directories", reportId); + var parameters = new Parameters.requestParameters(); + var success = request.Get(url, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual BrightLocalRfDirectoryStats GetDirectoryStats(int reportId) + { + var url = string.Format(Urls.ReviewFlow + "{0}" + "/directories/stats", reportId); + var parameters = new Parameters.requestParameters(); + var success = request.Get(url, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual BrightLocalRfStarCounts GetStarCount(int reportId) + { + var url = string.Format(Urls.ReviewFlow + "{0}" + "/stars/count", reportId); + var parameters = new Parameters.requestParameters(); + var success = request.Get(url, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } } } diff --git a/BrightLocal/src/BrightLocal/Services/ReviewFlow/UpdateReviewFlowOptions.cs b/BrightLocal/src/BrightLocal/Services/ReviewFlow/UpdateReviewFlowOptions.cs index 2188a61..6670794 100644 --- a/BrightLocal/src/BrightLocal/Services/ReviewFlow/UpdateReviewFlowOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/ReviewFlow/UpdateReviewFlowOptions.cs @@ -6,7 +6,7 @@ namespace BrightLocal public class UpdateReviewFlowOptions { [JsonProperty("report-id")] - public string reportId { get; set; } + public int reportId { get; set; } [JsonProperty("report-name")] public string reportName { get; set; } [JsonProperty("location-id")] diff --git a/BrightLocal/src/BrightLocal/examples/rfRxamples.cs b/BrightLocal/src/BrightLocal/examples/rFExamples.cs similarity index 99% rename from BrightLocal/src/BrightLocal/examples/rfRxamples.cs rename to BrightLocal/src/BrightLocal/examples/rFExamples.cs index c42c2f9..e4d5a30 100644 --- a/BrightLocal/src/BrightLocal/examples/rfRxamples.cs +++ b/BrightLocal/src/BrightLocal/examples/rFExamples.cs @@ -6,7 +6,7 @@ namespace BrightLocal.examples { - public class rfRxamples + public class rFExamples { public static IRestResponse addReport() { From 0362866b1d40940a8d5e2d4f31e2ea51fa66820c Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Fri, 13 Jan 2017 11:33:20 -0700 Subject: [PATCH 52/93] fixed typos --- .../Examples-version2/Account-Methods/rFExamples.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/rFExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/rFExamples.cs index c6cbc1d..8f27345 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/rFExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/rFExamples.cs @@ -94,6 +94,14 @@ public static BrightLocalSuccess DeleteReport() return deleteReport; } + public static BrightLocalRfGetAll GetAllReports() + { + var rfService = new ReviewFlowService(); + + BrightLocalRfGetAll results = rfService.GetAll(); + return results; + } + public static BrightLocalRfGetAll SearchReport() { string query = "New York"; @@ -127,8 +135,8 @@ public static BrightLocalSuccess GetGrowth() int reportId = 1; var rfService = new ReviewFlowService(); - BrightLocalSuccess reviewCount = rfService.GetGrowth(reportId); - return reviewCount; + BrightLocalSuccess reviewGrowth = rfService.GetGrowth(reportId); + return reviewGrowth; } public static BrightLocalRfDirectories GetDirectories() From b07b7cf819ef933ef154fe71ee05b8e13921e21a Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Fri, 13 Jan 2017 11:33:31 -0700 Subject: [PATCH 53/93] added review flow to docs --- README.md | 166 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 166 insertions(+) diff --git a/README.md b/README.md index 12fbe40..0b38045 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ For version 1.0 [Click Here](Documentation/README.md) [Local Search Rank Checker](#local-search-rank-checker) [Local SEO Check-up](#local-seo-check-up) [Citation Tracker](#citation-tracker) +[ReviewFlow Reports](#reviewflow-reports) Quick Start ----------- @@ -470,4 +471,169 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan var citationTrackerService = new CitationTrackerService(); BrightLocalCitationTrackerResults ctResults = citationTrackerService.GetReportResults(reportId); +``` + +ReviewFLow Reports +----- + +### Adding a report + +```csharp + var myReviewReport = new ReviewFlowOptions(); + myReviewReport.reportName = "Sample Citation Tracker Report"; + myReviewReport.businessName = "Le Bernardin"; + myReviewReport.contactTelephone = "+1 212-554-1515"; + myReviewReport.address1 = "155 Weest 51st Street"; + myReviewReport.address2 = ""; + myReviewReport.city = "NYC"; + myReviewReport.postcode = "10019"; + myReviewReport.country = "USA"; + + // Example for supplying Local Directory URLs (see local-directory-urls parameter) + myReviewReport.directories.Add( + "citysearch", + new Directories + { + url = "http://www.yelp.co.uk/biz/greens-restaurant-san-francisco-3", + include = true + }); + myReviewReport.directories.Add( + "dexknows", + new Directories + { + url = "", + include = true + }); + + var rfService = new ReviewFlowService(); + + BrightLocalSuccess newReviewReport = rfService.Create(myReviewReport); + return newReviewReport; +``` + +The returned BrightLocalSuccess entity above will have a report-id. You will want to persist this for later when you get a report. + +### Updating a report + +```csharp + var myReviewReport = new UpdateReviewFlowOptions(); + myReviewReport.reportId = 1; + myReviewReport.reportName = "Sample Citation Tracker Report"; + myReviewReport.businessName = "Le Bernardin"; + myReviewReport.contactTelephone = "+1 212-554-1515"; + myReviewReport.address1 = "155 Weest 51st Street"; + myReviewReport.address2 = ""; + myReviewReport.city = "NYC"; + myReviewReport.postcode = "10019"; + myReviewReport.country = "USA"; + + // Example for supplying Local Directory URLs (see local-directory-urls parameter) + myReviewReport.directories.Add( + "citysearch", + new Directories + { + url = "http://www.yelp.co.uk/biz/greens-restaurant-san-francisco-3", + include = true + }); + myReviewReport.directories.Add( + "dexknows", + new Directories + { + url = "", + include = true + }); + + var rfService = new ReviewFlowService(); + + BrightLocalSuccess updateReviewReport = rfService.Update(myReviewReport); +``` + +### Getting a report + +```csharp + int reportId = 1; + var rfService = new ReviewFlowService(); + + BrightLocalRfReport reviewReport = rfService.Get(reportId); +``` + +### Deleting a report + +```csharp + int reportId = 1; + var rfService = new ReviewFlowService(); + + BrightLocalSuccess deleteReport = rfService.Delete(reportId); +``` + +### Getting all reports + +```csharp + var rfService = new ReviewFlowService(); + + BrightLocalRfGetAll results = rfService.GetAll(); +``` + +### Searching for a report + +```csharp + string query = "New York"; + var rfService = new ReviewFlowService(); + + BrightLocalRfGetAll results = rfService.Search(query); +``` + +### Getting Reviews + +```csharp + var myReviewReport = new RfGetReviewsOptions(); + myReviewReport.reportId = 1; + var rfService = new ReviewFlowService(); + + BrightLocalRfReviews reviews = rfService.GetReviews(myReviewReport); +``` + +### Getting Reviews Count + +```csharp + int reportId = 1; + var rfService = new ReviewFlowService(); + + BrightLocalSuccess reviewCount = rfService.GetReviewCount(reportId); +``` + +### Getting Growth + +```csharp + int reportId = 1; + var rfService = new ReviewFlowService(); + + BrightLocalSuccess reviewGrowth = rfService.GetGrowth(reportId); +``` + +### Getting Directories + +```csharp + int reportId = 1; + var rfService = new ReviewFlowService(); + + BrightLocalRfDirectories reviewDirectories = rfService.GetDirectories(reportId); +``` + +### Getting Directory Stats + +```csharp + int reportId = 1; + var rfService = new ReviewFlowService(); + + BrightLocalRfDirectoryStats reviewDirectoryStats = rfService.GetDirectoryStats(reportId); +``` + +### Getting Star Counts + +```csharp + int reportId = 1; + var rfService = new ReviewFlowService(); + + BrightLocalRfStarCounts reviewStarCount = rfService.GetStarCount(reportId); ``` \ No newline at end of file From f92fb3b1083af196a68ac59b83b6fce4d8935282 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Mon, 16 Jan 2017 09:42:28 -0700 Subject: [PATCH 54/93] Added GPW entities and services --- .../Entities/BrightLocalCtGetAllResults.cs | 4 +- .../Entities/BrightLocalGpwGetAllResults.cs | 26 +++++ .../Entities/BrightLocalGpwReport.cs | 40 +++++++ .../Entities/BrightLocalGpwReportResults.cs | 103 ++++++++++++++++++ .../src/BrightLocal/Infrastructure/Urls.cs | 1 + .../Services/GpwReports/GpwOptions.cs | 51 +++++++++ .../Services/GpwReports/GpwService.cs | 76 +++++++++++++ .../Services/GpwReports/UpdateGpwOptions.cs | 53 +++++++++ 8 files changed, 352 insertions(+), 2 deletions(-) create mode 100644 BrightLocal/src/BrightLocal/Entities/BrightLocalGpwGetAllResults.cs create mode 100644 BrightLocal/src/BrightLocal/Entities/BrightLocalGpwReport.cs create mode 100644 BrightLocal/src/BrightLocal/Entities/BrightLocalGpwReportResults.cs create mode 100644 BrightLocal/src/BrightLocal/Services/GpwReports/GpwOptions.cs create mode 100644 BrightLocal/src/BrightLocal/Services/GpwReports/GpwService.cs create mode 100644 BrightLocal/src/BrightLocal/Services/GpwReports/UpdateGpwOptions.cs diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalCtGetAllResults.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalCtGetAllResults.cs index 150c534..801a2dd 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalCtGetAllResults.cs +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalCtGetAllResults.cs @@ -7,9 +7,9 @@ namespace BrightLocal { public class BrightLocalCtGetAllResults { - public Response response { get; set; } + public CtGetAllResponse response { get; set; } } - public class Response + public class CtGetAllResponse { public List results { get; set; } } diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalGpwGetAllResults.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalGpwGetAllResults.cs new file mode 100644 index 0000000..1c717b1 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalGpwGetAllResults.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace BrightLocal +{ + public class BrightLocalGpwGetAllResults + { + public GpwResponse response { get; set; } + } + + public class GpwResponse + { + public List results { get; set; } + } + + public class GpwGetAllResult + { + public string report_id { get; set; } + public string report_name { get; set; } + public string schedule { get; set; } + public string is_running { get; set; } + public string running_message { get; set; } + } +} diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalGpwReport.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalGpwReport.cs new file mode 100644 index 0000000..059aa0c --- /dev/null +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalGpwReport.cs @@ -0,0 +1,40 @@ +using System.Collections.Generic; + + +namespace BrightLocal +{ + public class BrightLocalGpwReport + { + public bool success { get; set; } + public GpwReport report { get; set; } + } + + public class GpwReport + { + public string report_id { get; set; } + public string report_name { get; set; } + public string customer_id { get; set; } + public string location_id { get; set; } + public string schedule { get; set; } + public string day_of_month { get; set; } + public string white_label_profile_id { get; set; } + public string report_type { get; set; } + public List business_names { get; set; } + public string postcode { get; set; } + public string country { get; set; } + public string state_code { get; set; } + public string address1 { get; set; } + public string address2 { get; set; } + public string city { get; set; } + public string telephone { get; set; } + public string profile_url { get; set; } + public List search_terms { get; set; } + public string google_location { get; set; } + public string notify { get; set; } + public List email_addresses { get; set; } + public string last_run_id { get; set; } + public string is_public { get; set; } + public string public_key { get; set; } + public string status { get; set; } + } +} diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalGpwReportResults.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalGpwReportResults.cs new file mode 100644 index 0000000..e120b99 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalGpwReportResults.cs @@ -0,0 +1,103 @@ +using System.Collections.Generic; + +namespace BrightLocal +{ + public class BrightLocalGpwReportResults + { + public bool success { get; set; } + public GpwReportResults results { get; set; } + } + + public class GpwReportResults + { + public GpwSummary summary { get; set; } + public GpwKeywords keywords { get; set; } + public GpwReportUrls urls { get; set; } + } + + public class GpwSummary + { + public string business_name { get; set; } + public string address { get; set; } + public string telephone { get; set; } + public string website_address { get; set; } + public List opening_hours { get; set; } + public string profile_url { get; set; } + public bool claimed { get; set; } + public int citations_count { get; set; } + public double domain_authority { get; set; } + public int backlinks { get; set; } + public int num_reviews { get; set; } + public int star_rating { get; set; } + public string review_content { get; set; } + public int num_photos { get; set; } + public List categories { get; set; } + } + + public class GpwKeywords : Dictionary + { + + } + + public class GpwKeywordsResults + { + public int client_rank { get; set; } + public List top_10 { get; set; } + public List citations_matrix { get; set; } + public List nap_comparison { get; set; } + public TopCategories top_categories { get; set; } + public List other_ranking_factors { get; set; } + } + + public class GpwTop10 + { + public string business_name { get; set; } + public string rank { get; set; } + public bool client_business { get; set; } + public string profile_url { get; set; } + public bool claimed { get; set; } + public int citations_count { get; set; } + public string domain_authority { get; set; } + public int backlinks { get; set; } + public int num_reviews { get; set; } + public string star_rating { get; set; } + public int num_photos { get; set; } + public List categories { get; set; } + } + + public class CitationsMatrix + { + public string domain { get; set; } + public string authority { get; set; } + public int count { get; set; } + public List businesses { get; set; } + } + + public class GpwBusiness + { + public string business_name { get; set; } + public string citations_count { get; set; } + public string url { get; set; } + } + + public class NapComparison + { + public string taken_from { get; set; } + public string business_name { get; set; } + public string address { get; set; } + public string postcode { get; set; } + public string telephone { get; set; } + } + + public class TopCategories : Dictionary + { + + } + + public class GpwReportUrls + { + public string report_url { get; set; } + public string wl_url { get; set; } + } + +} diff --git a/BrightLocal/src/BrightLocal/Infrastructure/Urls.cs b/BrightLocal/src/BrightLocal/Infrastructure/Urls.cs index 8101757..d149f6e 100644 --- a/BrightLocal/src/BrightLocal/Infrastructure/Urls.cs +++ b/BrightLocal/src/BrightLocal/Infrastructure/Urls.cs @@ -15,5 +15,6 @@ internal static class Urls internal static string CitationTracker => "/v2/ct/"; internal static string CitationBurst => "/v2/cb/"; internal static string ReviewFlow => "/v4/rf/"; + internal static string Gpw => "/v4/gpw/"; } } diff --git a/BrightLocal/src/BrightLocal/Services/GpwReports/GpwOptions.cs b/BrightLocal/src/BrightLocal/Services/GpwReports/GpwOptions.cs new file mode 100644 index 0000000..96545d7 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Services/GpwReports/GpwOptions.cs @@ -0,0 +1,51 @@ +using Newtonsoft.Json; +using System.Collections.Generic; + +namespace BrightLocal +{ + public class GpwOptions + { + [JsonProperty("report_name")] + public string reportName { get; set; } + [JsonProperty("location_id")] + public int locationId { get; set; } + [JsonProperty("white_label_profile_id")] + public int whiteLabelProfileId { get; set; } + [JsonProperty("business_names")] + public string businessNames { get; set; } + [JsonProperty("schedule")] + public string schedule { get; set; } + [JsonProperty("day_of_month")] + public string dayOfMonth { get; set; } + [JsonProperty("report_type")] + public string reportType { get; set; } + [JsonProperty("address1")] + public string address1 { get; set; } + [JsonProperty("address2")] + public string address2 { get; set; } + [JsonProperty("profile_url")] + public string profileUrl { get; set; } + [JsonProperty("city")] + public string city { get; set; } + [JsonProperty("state_code")] + public string stateCode { get; set; } + [JsonProperty("postcode")] + public string postcode { get; set; } + [JsonProperty("phone_number")] + public string phoneNumber { get; set; } + [JsonProperty("country")] + public string country { get; set; } + [JsonProperty("search_terms")] + public List searchTerms { get; set; } + [JsonProperty("notify")] + public string notify { get; set; } + [JsonProperty("email-addresses")] + public List emailAddresses { get; set; } + [JsonProperty("google_location")] + public string googleLocation { get; set; } + [JsonProperty("is_public")] + public string isPublic { get; set; } + [JsonProperty("run")] + public string run { get; set; } + } +} diff --git a/BrightLocal/src/BrightLocal/Services/GpwReports/GpwService.cs b/BrightLocal/src/BrightLocal/Services/GpwReports/GpwService.cs new file mode 100644 index 0000000..8d55ce1 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Services/GpwReports/GpwService.cs @@ -0,0 +1,76 @@ + +using Newtonsoft.Json; + +namespace BrightLocal +{ + public class GpwService : BrightLocalService + { + public GpwService(string apiKey = null, string apiSecret = null) : base(apiKey, apiSecret) { } + + BrightLocalRequestor request = new BrightLocalRequestor(); + + public virtual BrightLocalSuccess Create(GpwOptions createOptions) + { + var url = string.Format(Urls.Gpw + "{0}", "add"); + var parameters = Parameters.convertListToParameters(createOptions); + var success = request.Post(url, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual BrightLocalSuccess Update(UpdateGpwOptions updateOptions) + { + var url = string.Format(Urls.Gpw + "{0}", updateOptions.reportId); + var parameters = Parameters.convertListToParameters(updateOptions); + var success = request.Put(url, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual BrightLocalGpwReport Get(int reportId) + { + var url = string.Format(Urls.Gpw + "{0}", reportId); + var parameters = new Parameters.requestParameters(); + var success = request.Get(url, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual BrightLocalSuccess Delete(int reportId) + { + var url = string.Format(Urls.Gpw + "{0}", reportId); + var parameters = new Parameters.requestParameters(); + var success = request.Delete(url, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual BrightLocalGpwGetAllResults GetAll() + { + var parameters = new Parameters.requestParameters(); + var success = request.Get(Urls.Gpw, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual BrightLocalGpwGetAllResults GetAll(int locationId) + { + var parameters = new Parameters.requestParameters(); + parameters.Add("location-id", locationId); + var success = request.Get(Urls.Gpw, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual BrightLocalSuccess Run(int reportId) + { + var url = string.Format(Urls.Gpw + "{0}", "run"); + var parameters = new Parameters.requestParameters(); + parameters.Add("report-id", reportId); + var success = request.Put(Urls.Gpw, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + + public virtual BrightLocalGpwReportResults GetReportResults(int reportId) + { + var url = string.Format(Urls.Gpw + "{0}", reportId + "/results"); + var parameters = new Parameters.requestParameters(); + var success = request.Get(Urls.Gpw, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + } +} diff --git a/BrightLocal/src/BrightLocal/Services/GpwReports/UpdateGpwOptions.cs b/BrightLocal/src/BrightLocal/Services/GpwReports/UpdateGpwOptions.cs new file mode 100644 index 0000000..1649fef --- /dev/null +++ b/BrightLocal/src/BrightLocal/Services/GpwReports/UpdateGpwOptions.cs @@ -0,0 +1,53 @@ +using Newtonsoft.Json; +using System.Collections.Generic; + +namespace BrightLocal +{ + public class UpdateGpwOptions + { + [JsonProperty("report-ID")] + public string reportId { get; set; } + [JsonProperty("report_name")] + public string reportName { get; set; } + [JsonProperty("location_id")] + public int locationId { get; set; } + [JsonProperty("white_label_profile_id")] + public int whiteLabelProfileId { get; set; } + [JsonProperty("business_names")] + public string businessNames { get; set; } + [JsonProperty("schedule")] + public string schedule { get; set; } + [JsonProperty("day_of_month")] + public string dayOfMonth { get; set; } + [JsonProperty("report_type")] + public string reportType { get; set; } + [JsonProperty("address1")] + public string address1 { get; set; } + [JsonProperty("address2")] + public string address2 { get; set; } + [JsonProperty("profile_url")] + public string profileUrl { get; set; } + [JsonProperty("city")] + public string city { get; set; } + [JsonProperty("state_code")] + public string stateCode { get; set; } + [JsonProperty("postcode")] + public string postcode { get; set; } + [JsonProperty("phone_number")] + public string phoneNumber { get; set; } + [JsonProperty("country")] + public string country { get; set; } + [JsonProperty("search_terms")] + public List searchTerms { get; set; } + [JsonProperty("notify")] + public string notify { get; set; } + [JsonProperty("email-addresses")] + public List emailAddresses { get; set; } + [JsonProperty("google_location")] + public string googleLocation { get; set; } + [JsonProperty("is_public")] + public string isPublic { get; set; } + [JsonProperty("run")] + public string run { get; set; } + } +} From d95ca357375b38ca976429900479cb9742dbbffa Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Mon, 16 Jan 2017 12:23:48 -0700 Subject: [PATCH 55/93] added gpw examples --- .../Account-Methods/gpwExamples.cs | 101 ++++++++++++++++++ .../Services/GpwReports/UpdateGpwOptions.cs | 2 +- 2 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/gpwExamples.cs diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/gpwExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/gpwExamples.cs new file mode 100644 index 0000000..ce49a8f --- /dev/null +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/gpwExamples.cs @@ -0,0 +1,101 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace BrightLocal.Examples_version2.Account_Methods +{ + public class gpwExamples + { + public static BrightLocalSuccess Create() + { + var myGpwReport = new GpwOptions(); + myGpwReport.reportName = "Sample Citation Tracker Report"; + myGpwReport.businessNames = "Le Bernardin"; + myGpwReport.schedule = "Adhoc"; + myGpwReport.dayOfMonth = "2"; + myGpwReport.reportType = "with"; + myGpwReport.address1 = "155 Weest 51st Street"; + myGpwReport.address2 = ""; + myGpwReport.city = "NYC"; + myGpwReport.stateCode = "NY"; + myGpwReport.postcode = "10019"; + myGpwReport.phoneNumber = "+1 212-554-1515"; + myGpwReport.country = "USA"; + myGpwReport.searchTerms = new List() { "restaurant manhattan", "cafe new york" }; + + var gpwService = new GpwService(); + + BrightLocalSuccess gpwReport = gpwService.Create(myGpwReport); + return gpwReport; + } + + public static BrightLocalSuccess Update() + { + var myGpwReport = new UpdateGpwOptions(); + myGpwReport.reportId = 1; + myGpwReport.reportName = "Sample Citation Tracker Report"; + myGpwReport.businessNames = "Le Bernardin"; + myGpwReport.schedule = "Adhoc"; + myGpwReport.dayOfMonth = "2"; + myGpwReport.reportType = "with"; + myGpwReport.address1 = "155 Weest 51st Street"; + myGpwReport.address2 = ""; + myGpwReport.city = "NYC"; + myGpwReport.stateCode = "NY"; + myGpwReport.postcode = "10019"; + myGpwReport.phoneNumber = "+1 212-554-1515"; + myGpwReport.country = "USA"; + myGpwReport.searchTerms = new List() { "restaurant manhattan", "cafe new york" }; + + var gpwService = new GpwService(); + + BrightLocalSuccess gpwReport = gpwService.Update(myGpwReport); + return gpwReport; + } + + public static BrightLocalGpwReport Get() + { + var reportId = 1; + var gpwService = new GpwService(); + + BrightLocalGpwReport gpwReport = gpwService.Get(reportId); + return gpwReport; + } + + public static BrightLocalSuccess Delete() + { + var reportId = 1; + var gpwService = new GpwService(); + + BrightLocalSuccess gpwReport = gpwService.Delete(reportId); + return gpwReport; + } + + public static BrightLocalGpwGetAllResults GetAll() + { + var gpwService = new GpwService(); + + BrightLocalGpwGetAllResults gpwGetAllResults = gpwService.GetAll(); + return gpwGetAllResults; + } + + public static BrightLocalSuccess Run() + { + var reportId = 1; + var gpwService = new GpwService(); + + BrightLocalSuccess gpwReport = gpwService.Run(reportId); + return gpwReport; + } + + public static BrightLocalGpwReportResults GetResults() + { + var reportId = 1; + var gpwService = new GpwService(); + + BrightLocalGpwReportResults gpwReport = gpwService.GetReportResults(reportId); + return gpwReport; + } + } +} diff --git a/BrightLocal/src/BrightLocal/Services/GpwReports/UpdateGpwOptions.cs b/BrightLocal/src/BrightLocal/Services/GpwReports/UpdateGpwOptions.cs index 1649fef..da4c25b 100644 --- a/BrightLocal/src/BrightLocal/Services/GpwReports/UpdateGpwOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/GpwReports/UpdateGpwOptions.cs @@ -6,7 +6,7 @@ namespace BrightLocal public class UpdateGpwOptions { [JsonProperty("report-ID")] - public string reportId { get; set; } + public int reportId { get; set; } [JsonProperty("report_name")] public string reportName { get; set; } [JsonProperty("location_id")] From 872ff89e46f34d9178005dcf014740d1a1c34fad Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Mon, 16 Jan 2017 12:30:57 -0700 Subject: [PATCH 56/93] added GPW examples to git docs --- README.md | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) diff --git a/README.md b/README.md index 0b38045..1cf4339 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ For version 1.0 [Click Here](Documentation/README.md) [Local SEO Check-up](#local-seo-check-up) [Citation Tracker](#citation-tracker) [ReviewFlow Reports](#reviewflow-reports) +[Google+ Local Wizard Reports](#google+-local-wizard-reports) Quick Start ----------- @@ -636,4 +637,99 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan var rfService = new ReviewFlowService(); BrightLocalRfStarCounts reviewStarCount = rfService.GetStarCount(reportId); +``` + +Google+ Local Wizard Reports +----- + +### Adding a report + +```csharp + var myGpwReport = new GpwOptions(); + myGpwReport.reportName = "Sample Citation Tracker Report"; + myGpwReport.businessNames = "Le Bernardin"; + myGpwReport.schedule = "Adhoc"; + myGpwReport.dayOfMonth = "2"; + myGpwReport.reportType = "with"; + myGpwReport.address1 = "155 Weest 51st Street"; + myGpwReport.address2 = ""; + myGpwReport.city = "NYC"; + myGpwReport.stateCode = "NY"; + myGpwReport.postcode = "10019"; + myGpwReport.phoneNumber = "+1 212-554-1515"; + myGpwReport.country = "USA"; + myGpwReport.searchTerms = new List() { "restaurant manhattan", "cafe new york" }; + + var gpwService = new GpwService(); + + BrightLocalSuccess gpwReport = gpwService.Create(myGpwReport); +``` +The returned BrightLocalSuccess entity above will have a report-id. You will want to persist this for later in order to run and get the report. + +### Updating a report + +```csharp + var myGpwReport = new UpdateGpwOptions(); + myGpwReport.reportId = 1; + myGpwReport.reportName = "Sample Citation Tracker Report"; + myGpwReport.businessNames = "Le Bernardin"; + myGpwReport.schedule = "Adhoc"; + myGpwReport.dayOfMonth = "2"; + myGpwReport.reportType = "with"; + myGpwReport.address1 = "155 Weest 51st Street"; + myGpwReport.address2 = ""; + myGpwReport.city = "NYC"; + myGpwReport.stateCode = "NY"; + myGpwReport.postcode = "10019"; + myGpwReport.phoneNumber = "+1 212-554-1515"; + myGpwReport.country = "USA"; + myGpwReport.searchTerms = new List() { "restaurant manhattan", "cafe new york" }; + + var gpwService = new GpwService(); + + BrightLocalSuccess gpwReport = gpwService.Update(myGpwReport); +``` + +### Getting a report + +```csharp + var reportId = 1; + var gpwService = new GpwService(); + + BrightLocalGpwReport gpwReport = gpwService.Get(reportId); +``` + +### Deleting a report + +```csharp + var reportId = 1; + var gpwService = new GpwService(); + + BrightLocalSuccess gpwReport = gpwService.Delete(reportId); +``` + +### Getting all reports + +```csharp + var gpwService = new GpwService(); + + BrightLocalGpwGetAllResults gpwGetAllResults = gpwService.GetAll(); +``` + +### Running a report + +```csharp + var reportId = 1; + var gpwService = new GpwService(); + + BrightLocalSuccess gpwReport = gpwService.Run(reportId); +``` + +### Getting report results + +```csharp + var reportId = 1; + var gpwService = new GpwService(); + + BrightLocalGpwReportResults gpwReport = gpwService.GetReportResults(reportId); ``` \ No newline at end of file From daa9bd8e257c4ea57f6062a81f836fc509d41753 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Tue, 24 Jan 2017 09:01:49 -0700 Subject: [PATCH 57/93] Fixed spacing for service menu in docs --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1cf4339..1989079 100644 --- a/README.md +++ b/README.md @@ -9,10 +9,10 @@ For version 1.0 [Click Here](Documentation/README.md) [Clients](#clients) [Locations](#locations) [Local Search Rank Checker](#local-search-rank-checker) -[Local SEO Check-up](#local-seo-check-up) -[Citation Tracker](#citation-tracker) -[ReviewFlow Reports](#reviewflow-reports) -[Google+ Local Wizard Reports](#google+-local-wizard-reports) +[Local SEO Check-up](#local-seo-check-up) +[Citation Tracker](#citation-tracker) +[ReviewFlow Reports](#reviewflow-reports) +[Google+ Local Wizard Reports](#google+-local-wizard-reports) Quick Start ----------- From f88e2637d6e43f24c47b64e589ad378defd34d52 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Tue, 24 Jan 2017 09:02:56 -0700 Subject: [PATCH 58/93] Fixed spacing for docs menu --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1989079..574c42f 100644 --- a/README.md +++ b/README.md @@ -9,10 +9,10 @@ For version 1.0 [Click Here](Documentation/README.md) [Clients](#clients) [Locations](#locations) [Local Search Rank Checker](#local-search-rank-checker) -[Local SEO Check-up](#local-seo-check-up) -[Citation Tracker](#citation-tracker) -[ReviewFlow Reports](#reviewflow-reports) -[Google+ Local Wizard Reports](#google+-local-wizard-reports) +[Local SEO Check-up](#local-seo-check-up) +[Citation Tracker](#citation-tracker) +[ReviewFlow Reports](#reviewflow-reports) +[Google+ Local Wizard Reports](#google+-local-wizard-reports) Quick Start ----------- From c016e77ca3a1b9d2b2ddae9a535201efb7de50e8 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Tue, 24 Jan 2017 09:04:56 -0700 Subject: [PATCH 59/93] Fixed link for gpw --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 574c42f..ff5e3c6 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ For version 1.0 [Click Here](Documentation/README.md) [Local SEO Check-up](#local-seo-check-up) [Citation Tracker](#citation-tracker) [ReviewFlow Reports](#reviewflow-reports) -[Google+ Local Wizard Reports](#google+-local-wizard-reports) +[Google+ Local Wizard Reports](#google-plus-local-wizard-reports) Quick Start ----------- @@ -639,7 +639,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan BrightLocalRfStarCounts reviewStarCount = rfService.GetStarCount(reportId); ``` -Google+ Local Wizard Reports +Google Plus Local Wizard Reports ----- ### Adding a report From a5717606b2ee328a7009de8a262cbd2eade728d0 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Tue, 24 Jan 2017 09:36:51 -0700 Subject: [PATCH 60/93] fixed CbCampaignDetails entity --- .../Entities/BrightLocalCbCampaign.cs | 80 ++++++++++++++++++- 1 file changed, 79 insertions(+), 1 deletion(-) diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalCbCampaign.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalCbCampaign.cs index cfc7ac3..d40435d 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalCbCampaign.cs +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalCbCampaign.cs @@ -15,15 +15,48 @@ public class CampaignResponse public class CampaignResults { public string campaign_id { get; set; } + public int location_id { get; set; } + public string campaign_name { get; set; } + public string creation_date { get; set; } + public string package_id { get; set; } + public string selection_type { get; set; } + public string paid { get; set; } + public string status { get; set; } + public string submission_date { get; set; } public string purchase_date { get; set; } public string completion_date { get; set; } public string username { get; set; } public string email { get; set; } public string password { get; set; } + public string campaign_note { get; set; } + public string customer_note { get; set; } + public string white_label_profile_id { get; set; } + public string num_citations { get; set; } + public string package_price { get; set; } + public string website_address { get; set; } + public string campaign_country { get; set; } + public string campaign_state { get; set; } + public string campaign_city { get; set; } + public string business_category_id { get; set; } + public string business_category_name { get; set; } + public CampaignAddress address { get; set; } + public CampaignContact contact { get; set; } + public string mobile_number { get; set; } + public string fax_number { get; set; } + public CampaignDescriptions descriptions { get; set; } + public string num_employees { get; set; } + public string start_year { get; set; } + public ServiceNames service_names { get; set; } + public WorkingHours working_hours { get; set; } + public PaymentMethods payment_methods { get; set; } + public object company_logo { get; set; } + public CampaignPhotos photos { get; set; } + public CbEmailAlerts email_alerts { get; set; } + public string old_business_name { get; set; } + public List specialist_info { get; set; } public List stats { get; set; } public List citations { get; set; } public List aggregators { get; set; } - public int location_id { get; set; } public CampaignUrls urls { get; set; } } @@ -64,4 +97,49 @@ public class CampaignUrls public string pdf_url { get; set; } public string csv_url { get; set; } } + + public class CbEmailAlerts + { + public string enabled { get; set; } + public List addresses { get; set; } + } + + public class CampaignPhotos : Dictionary + { + + } + + public class PaymentMethods : Dictionary + { + + } + + public class ServiceNames : Dictionary + { + + } + + public class CampaignDescriptions + { + public string brief { get; set; } + public string full { get; set; } + } + + public class CampaignContact + { + public string last_name { get; set; } + public string first_name { get; set; } + public string email { get; set; } + public string telephone { get; set; } + } + + public class CampaignAddress + { + public string street_address_1 { get; set; } + public object street_address_2 { get; set; } + public object city { get; set; } + public object region { get; set; } + public string postcode { get; set; } + } + } From 3d5b7af0f4a26419ec91ec763b7793bc7178b3c4 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Tue, 24 Jan 2017 10:29:56 -0700 Subject: [PATCH 61/93] Added CB examples and corrected CB entities --- .../Account-Methods/citationBurstExamples.cs | 170 ++++++++++++++++++ .../citationTrackerExamples.cs | 7 +- .../Services/CitationBurst/CbUploadImage.cs | 9 + .../CitationBurst/CitationBurstOptions.cs | 6 +- .../CitationBurst/CitationBurstService.cs | 17 ++ .../UpdateCitationBurstOptions.cs | 6 +- 6 files changed, 205 insertions(+), 10 deletions(-) create mode 100644 BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationBurstExamples.cs create mode 100644 BrightLocal/src/BrightLocal/Services/CitationBurst/CbUploadImage.cs diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationBurstExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationBurstExamples.cs new file mode 100644 index 0000000..f75d5e9 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationBurstExamples.cs @@ -0,0 +1,170 @@ +using System.Collections.Generic; + +namespace BrightLocal.Examples_version2.Account_Methods +{ + public class citationBurstExamples + { + public static BrightLocalSuccess Create() + { + string brief_description = "Born in Paris in 1972 by sibling duo Maguy and Gilbert Le Coze, Le Bernardin only served fish: Fresh, simple and prepared with respect. After receiving its first Michelin star in 1976, and two more in 1980, the Le Coze’s set to open Le Bernardin in New York in 1986."; + string full_description = "The restaurant has held three stars from the Michelin Guide since its 2005 New York launch and currently ranks 24 on the World’s 50 Best Restaurants list. The New York Zagat Guide has recognized Le Bernardin as top rated in the category of “Best Food” for the last nine consecutive years, and in 2015 was rated by the guide as New York City’s top restaurant for food and service. Le Bernardin has earned seven James Beard Awards since 1998 including “Outstanding Restaurant of the Year,” “Top Chef in New York City,” “Outstanding Service,” “Outstanding Chef in the United States,” “Outstanding Pastry Chef,” “Outstanding Wine Service,” and “Best Restaurant Design” in 2012. Most recently, the Foundation named Maguy Le Coze as Outstanding."; + + CitationBurstOptions myCb = new CitationBurstOptions(); + myCb.businessName = "Le Bernardin"; + myCb.campaignName = "Sample Citation Burst Campaign"; + myCb.websiteAddress = "le-bernardin.com"; + myCb.campaignCountry = "USA"; + myCb.campaignState = "NY"; + myCb.campaignCity = "New York"; + myCb.businessCategoryId = 605; + myCb.businessCategories = new List() { "restaurant", "cafe" }; + myCb.address1 = "155 Weest 51st Street"; + myCb.address2 = ""; + myCb.postcode = "10019"; + myCb.contactName = "Hanane Moshe"; + myCb.contactFirstName = "Hanane"; + myCb.contactTelephone = "+1 212-554-1515"; + myCb.briefDescription = brief_description; + myCb.fullDescription = full_description; + myCb.employeesNumber = 35; + myCb.startYear = 1976; + myCb.workingHoursApplyToAll = 0; + myCb.workingHoursMonStart = 0800; + myCb.workingHoursMonEnd = 2200; + myCb.workingHoursTueStart = 0800; + myCb.workingHoursTueEnd = 2200; + myCb.workingHoursWedStart = 0800; + myCb.workingHoursWedEnd = 2200; + myCb.workingHoursThuStart = 0800; + myCb.workingHoursThuEnd = 2200; + myCb.workingHoursFriStart = 0800; + myCb.workingHoursFriEnd = 2200; + myCb.workingHoursSatStart = 1000; + myCb.workingHoursSatEnd = 2400; + myCb.workingHoursSunStart = 1000; + myCb.workingHoursSunEnd = 2400; + myCb.paymentMethods = "Cash|Visa"; + + var citationBurstService = new CitationBurstService(); + + BrightLocalSuccess newCb = citationBurstService.Create(myCb); + + return newCb; + } + + public static BrightLocalSuccess Update() + { + string brief_description = "Born in Paris in 1972 by sibling duo Maguy and Gilbert Le Coze, Le Bernardin only served fish: Fresh, simple and prepared with respect. After receiving its first Michelin star in 1976, and two more in 1980, the Le Coze’s set to open Le Bernardin in New York in 1986."; + string full_description = "The restaurant has held three stars from the Michelin Guide since its 2005 New York launch and currently ranks 24 on the World’s 50 Best Restaurants list. The New York Zagat Guide has recognized Le Bernardin as top rated in the category of “Best Food” for the last nine consecutive years, and in 2015 was rated by the guide as New York City’s top restaurant for food and service. Le Bernardin has earned seven James Beard Awards since 1998 including “Outstanding Restaurant of the Year,” “Top Chef in New York City,” “Outstanding Service,” “Outstanding Chef in the United States,” “Outstanding Pastry Chef,” “Outstanding Wine Service,” and “Best Restaurant Design” in 2012. Most recently, the Foundation named Maguy Le Coze as Outstanding."; + + UpdateCitationBurstOptions myCb = new UpdateCitationBurstOptions(); + myCb.campaignId = 1; + myCb.businessName = "Le Bernardin"; + myCb.campaignName = "Sample Citation Burst Campaign"; + myCb.websiteAddress = "le-bernardin.com"; + myCb.campaignCountry = "USA"; + myCb.campaignState = "NY"; + myCb.campaignCity = "New York"; + myCb.businessCategoryId = 605; + myCb.businessCategories = new List() { "restaurant", "cafe" }; + myCb.address1 = "155 Weest 51st Street"; + myCb.address2 = ""; + myCb.postcode = "10019"; + myCb.contactName = "Hanane Moshe"; + myCb.contactFirstName = "Hanane"; + myCb.contactTelephone = "+1 212-554-1515"; + myCb.briefDescription = brief_description; + myCb.fullDescription = full_description; + myCb.employeesNumber = 35; + myCb.startYear = 1976; + myCb.workingHoursApplyToAll = 0; + myCb.workingHoursMonStart = 0800; + myCb.workingHoursMonEnd = 2200; + myCb.workingHoursTueStart = 0800; + myCb.workingHoursTueEnd = 2200; + myCb.workingHoursWedStart = 0800; + myCb.workingHoursWedEnd = 2200; + myCb.workingHoursThuStart = 0800; + myCb.workingHoursThuEnd = 2200; + myCb.workingHoursFriStart = 0800; + myCb.workingHoursFriEnd = 2200; + myCb.workingHoursSatStart = 1000; + myCb.workingHoursSatEnd = 2400; + myCb.workingHoursSunStart = 1000; + myCb.workingHoursSunEnd = 2400; + myCb.paymentMethods = "Cash|Visa"; + + var citationBurstService = new CitationBurstService(); + + BrightLocalSuccess newCb = citationBurstService.Update(myCb); + + return newCb; + } + + public static BrightLocalSuccess UploadImage() + { + CbUploadImage image = new CbUploadImage(); + image.campaignId = 1; + image.file = "/path/to/image.jpg"; + image.imageType = "logo"; + + var citationBurstService = new CitationBurstService(); + + BrightLocalSuccess cbImage = citationBurstService.UploadImage(image); + + return cbImage; + } + + public static BrightLocalCitations GetCitations() + { + int campaingId = 1; + + var citationBurstService = new CitationBurstService(); + + BrightLocalCitations citations = citationBurstService.GetCitations(campaingId); + + return citations; + } + + public static BrightLocalSuccess ConfirmAndPay() + { + BrightLocalCbPayOptions confirmPay = new BrightLocalCbPayOptions(); + confirmPay.campaign_id = 1; + confirmPay.package_id = "cb15"; + + var citationBurstService = new CitationBurstService(); + + BrightLocalSuccess confirm = citationBurstService.ConfirmAndPay(confirmPay); + + return confirm; + } + + public static BrightLocalCbAllCampaigns GetAll() + { + var citationBurstService = new CitationBurstService(); + + BrightLocalCbAllCampaigns results = citationBurstService.GetCampaigns(); + + return results; + } + + public static BrightLocalCbCampaign GetCampaign() + { + int campaignId = 1; + var citationBurstService = new CitationBurstService(); + + BrightLocalCbCampaign results = citationBurstService.GetCampaign(campaignId); + + return results; + } + + public static BrightLocalSuccess GetCredits() + { + var citationBurstService = new CitationBurstService(); + + BrightLocalSuccess credits = citationBurstService.GetCredits(); + + return credits; + } + } +} diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationTrackerExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationTrackerExamples.cs index 830304d..f3fa645 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationTrackerExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationTrackerExamples.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace BrightLocal.Examples_version2.Account_Methods +namespace BrightLocal.Examples_version2.Account_Methods { public class citationTrackerExamples { diff --git a/BrightLocal/src/BrightLocal/Services/CitationBurst/CbUploadImage.cs b/BrightLocal/src/BrightLocal/Services/CitationBurst/CbUploadImage.cs new file mode 100644 index 0000000..da30740 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Services/CitationBurst/CbUploadImage.cs @@ -0,0 +1,9 @@ +namespace BrightLocal +{ + public class CbUploadImage + { + public int campaignId { get; set; } + public string file { get; set; } + public string imageType { get; set; } + } +} diff --git a/BrightLocal/src/BrightLocal/Services/CitationBurst/CitationBurstOptions.cs b/BrightLocal/src/BrightLocal/Services/CitationBurst/CitationBurstOptions.cs index 5071679..ef8de63 100644 --- a/BrightLocal/src/BrightLocal/Services/CitationBurst/CitationBurstOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/CitationBurst/CitationBurstOptions.cs @@ -34,6 +34,8 @@ public class CitationBurstOptions public string postcode { get; set; } [JsonProperty("contact_name")] public string contactName { get; set; } + [JsonProperty("contact_firstname")] + public string contactFirstName { get; set; } [JsonProperty("contact_telephone")] public string contactTelephone { get; set; } [JsonProperty("mobile_number")] @@ -59,7 +61,7 @@ public class CitationBurstOptions [JsonProperty("service_name_5")] public string serviceName5 { get; set; } [JsonProperty("working_hours_apply_to_all")] - public string workingHoursApplyToAll { get; set; } + public int workingHoursApplyToAll { get; set; } [JsonProperty("working_hours_mon_start")] public int workingHoursMonStart { get; set; } [JsonProperty("working_hours_mon_end")] @@ -75,7 +77,7 @@ public class CitationBurstOptions [JsonProperty("working_hours_thu_start")] public int workingHoursThuStart { get; set; } [JsonProperty("working_hours_thu_end")] - public int workingHoursthuEnd { get; set; } + public int workingHoursThuEnd { get; set; } [JsonProperty("working_hours_fri_start")] public int workingHoursFriStart { get; set; } [JsonProperty("working_hours_fri_end")] diff --git a/BrightLocal/src/BrightLocal/Services/CitationBurst/CitationBurstService.cs b/BrightLocal/src/BrightLocal/Services/CitationBurst/CitationBurstService.cs index 045aa30..db80af1 100644 --- a/BrightLocal/src/BrightLocal/Services/CitationBurst/CitationBurstService.cs +++ b/BrightLocal/src/BrightLocal/Services/CitationBurst/CitationBurstService.cs @@ -24,6 +24,14 @@ public virtual BrightLocalSuccess Update(UpdateCitationBurstOptions updateOption return JsonConvert.DeserializeObject(success.Content); } + public virtual BrightLocalSuccess UploadImage(CbUploadImage imageOptions) + { + var url = string.Format(Urls.CitationBurst + "{0}" + "/{1}", imageOptions.campaignId, imageOptions.imageType); + var parameters = Parameters.convertListToParameters(imageOptions.file); + var success = request.Post(url, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(success.Content); + } + public virtual BrightLocalCitations GetCitations(int campaignId) { var url = string.Format(Urls.CitationBurst + "{0}", "citations"); @@ -66,5 +74,14 @@ public virtual BrightLocalCbCampaign GetCampaign(int campaignId) var success = request.Get(url, parameters, this.api_key, this.api_secret); return JsonConvert.DeserializeObject(success.Content); } + + public virtual BrightLocalSuccess GetCredits() + { + var url = string.Format(Urls.CitationBurst + "{0}", "credits"); + var parameters = new Parameters.requestParameters(); + + var credits = request.Get(url, parameters, this.api_key, this.api_secret); + return JsonConvert.DeserializeObject(credits.Content); + } } } diff --git a/BrightLocal/src/BrightLocal/Services/CitationBurst/UpdateCitationBurstOptions.cs b/BrightLocal/src/BrightLocal/Services/CitationBurst/UpdateCitationBurstOptions.cs index 48a3ef8..5917ca2 100644 --- a/BrightLocal/src/BrightLocal/Services/CitationBurst/UpdateCitationBurstOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/CitationBurst/UpdateCitationBurstOptions.cs @@ -33,6 +33,8 @@ public class UpdateCitationBurstOptions public string postcode { get; set; } [JsonProperty("contact_name")] public string contactName { get; set; } + [JsonProperty("contact_firstname")] + public string contactFirstName { get; set; } [JsonProperty("contact_telephone")] public string contactTelephone { get; set; } [JsonProperty("mobile_number")] @@ -58,7 +60,7 @@ public class UpdateCitationBurstOptions [JsonProperty("service_name_5")] public string serviceName5 { get; set; } [JsonProperty("working_hours_apply_to_all")] - public string workingHoursApplyToAll { get; set; } + public int workingHoursApplyToAll { get; set; } [JsonProperty("working_hours_mon_start")] public int workingHoursMonStart { get; set; } [JsonProperty("working_hours_mon_end")] @@ -74,7 +76,7 @@ public class UpdateCitationBurstOptions [JsonProperty("working_hours_thu_start")] public int workingHoursThuStart { get; set; } [JsonProperty("working_hours_thu_end")] - public int workingHoursthuEnd { get; set; } + public int workingHoursThuEnd { get; set; } [JsonProperty("working_hours_fri_start")] public int workingHoursFriStart { get; set; } [JsonProperty("working_hours_fri_end")] From c375dac727c71867f523837c8cd19f0855e443c7 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Tue, 24 Jan 2017 10:48:04 -0700 Subject: [PATCH 62/93] Added Cb examples to readme doc --- README.md | 159 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 159 insertions(+) diff --git a/README.md b/README.md index ff5e3c6..2a48ff1 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ For version 1.0 [Click Here](Documentation/README.md) [Local Search Rank Checker](#local-search-rank-checker) [Local SEO Check-up](#local-seo-check-up) [Citation Tracker](#citation-tracker) +[Citation Burst](#citation-burst) [ReviewFlow Reports](#reviewflow-reports) [Google+ Local Wizard Reports](#google-plus-local-wizard-reports) @@ -474,6 +475,164 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan BrightLocalCitationTrackerResults ctResults = citationTrackerService.GetReportResults(reportId); ``` +Citation Burst +----- + +### Creating a campaign + +```csharp + string brief_description = "Born in Paris in 1972 by sibling duo Maguy and Gilbert Le Coze, Le Bernardin only served fish: Fresh, simple and prepared with respect. After receiving its first Michelin star in 1976, and two more in 1980, the Le Cozes set to open Le Bernardin in New York in 1986."; + string full_description = "The restaurant has held three stars from the Michelin Guide since its 2005 New York launch and currently ranks 24 on the Worlds 50 Best Restaurants list. The New York Zagat Guide has recognized Le Bernardin as top rated in the category of Best Food for the last nine consecutive years, and in 2015 was rated by the guide as New York Citys top restaurant for food and service. Le Bernardin has earned seven James Beard Awards since 1998 including Outstanding Restaurant of the Year, Top Chef in New York City, Outstanding Service, Outstanding Chef in the United States, Outstanding Pastry Chef, Outstanding Wine Service, and Best Restaurant Design in 2012. Most recently, the Foundation named Maguy Le Coze as Outstanding."; + + CitationBurstOptions myCb = new CitationBurstOptions(); + myCb.businessName = "Le Bernardin"; + myCb.campaignName = "Sample Citation Burst Campaign"; + myCb.websiteAddress = "le-bernardin.com"; + myCb.campaignCountry = "USA"; + myCb.campaignState = "NY"; + myCb.campaignCity = "New York"; + myCb.businessCategoryId = 605; + myCb.businessCategories = new List() { "restaurant", "cafe" }; + myCb.address1 = "155 Weest 51st Street"; + myCb.address2 = ""; + myCb.postcode = "10019"; + myCb.contactName = "Hanane Moshe"; + myCb.contactFirstName = "Hanane"; + myCb.contactTelephone = "+1 212-554-1515"; + myCb.briefDescription = brief_description; + myCb.fullDescription = full_description; + myCb.employeesNumber = 35; + myCb.startYear = 1976; + myCb.workingHoursApplyToAll = 0; + myCb.workingHoursMonStart = 0800; + myCb.workingHoursMonEnd = 2200; + myCb.workingHoursTueStart = 0800; + myCb.workingHoursTueEnd = 2200; + myCb.workingHoursWedStart = 0800; + myCb.workingHoursWedEnd = 2200; + myCb.workingHoursThuStart = 0800; + myCb.workingHoursThuEnd = 2200; + myCb.workingHoursFriStart = 0800; + myCb.workingHoursFriEnd = 2200; + myCb.workingHoursSatStart = 1000; + myCb.workingHoursSatEnd = 2400; + myCb.workingHoursSunStart = 1000; + myCb.workingHoursSunEnd = 2400; + myCb.paymentMethods = "Cash|Visa"; + + var citationBurstService = new CitationBurstService(); + + BrightLocalSuccess newCb = citationBurstService.Create(myCb); +``` +The returned BrightLocalSuccess entity above will have a campaign-id. You will want to persist this for later in order to get citations, confirm & pay, etc. + +### Updating a campaign + +```csharp + string brief_description = "Born in Paris in 1972 by sibling duo Maguy and Gilbert Le Coze, Le Bernardin only served fish: Fresh, simple and prepared with respect. After receiving its first Michelin star in 1976, and two more in 1980, the Le Cozes set to open Le Bernardin in New York in 1986."; + string full_description = "The restaurant has held three stars from the Michelin Guide since its 2005 New York launch and currently ranks 24 on the Worlds 50 Best Restaurants list. The New York Zagat Guide has recognized Le Bernardin as top rated in the category of Best Food for the last nine consecutive years, and in 2015 was rated by the guide as New York Citys top restaurant for food and service. Le Bernardin has earned seven James Beard Awards since 1998 including Outstanding Restaurant of the Year, Top Chef in New York City, Outstanding Service, Outstanding Chef in the United States, Outstanding Pastry Chef, Outstanding Wine Service, and Best Restaurant Design in 2012. Most recently, the Foundation named Maguy Le Coze as Outstanding."; + + UpdateCitationBurstOptions myCb = new UpdateCitationBurstOptions(); + myCb.campaignId = 1; + myCb.businessName = "Le Bernardin"; + myCb.campaignName = "Sample Citation Burst Campaign"; + myCb.websiteAddress = "le-bernardin.com"; + myCb.campaignCountry = "USA"; + myCb.campaignState = "NY"; + myCb.campaignCity = "New York"; + myCb.businessCategoryId = 605; + myCb.businessCategories = new List() { "restaurant", "cafe" }; + myCb.address1 = "155 Weest 51st Street"; + myCb.address2 = ""; + myCb.postcode = "10019"; + myCb.contactName = "Hanane Moshe"; + myCb.contactFirstName = "Hanane"; + myCb.contactTelephone = "+1 212-554-1515"; + myCb.briefDescription = brief_description; + myCb.fullDescription = full_description; + myCb.employeesNumber = 35; + myCb.startYear = 1976; + myCb.workingHoursApplyToAll = 0; + myCb.workingHoursMonStart = 0800; + myCb.workingHoursMonEnd = 2200; + myCb.workingHoursTueStart = 0800; + myCb.workingHoursTueEnd = 2200; + myCb.workingHoursWedStart = 0800; + myCb.workingHoursWedEnd = 2200; + myCb.workingHoursThuStart = 0800; + myCb.workingHoursThuEnd = 2200; + myCb.workingHoursFriStart = 0800; + myCb.workingHoursFriEnd = 2200; + myCb.workingHoursSatStart = 1000; + myCb.workingHoursSatEnd = 2400; + myCb.workingHoursSunStart = 1000; + myCb.workingHoursSunEnd = 2400; + myCb.paymentMethods = "Cash|Visa"; + + var citationBurstService = new CitationBurstService(); + + BrightLocalSuccess newCb = citationBurstService.Update(myCb); +``` + +### Uploading an image + +```csharp + CbUploadImage image = new CbUploadImage(); + image.campaignId = 1; + image.file = "/path/to/image.jpg"; + image.imageType = "logo"; + + var citationBurstService = new CitationBurstService(); + + BrightLocalSuccess cbImage = citationBurstService.UploadImage(image); +``` + +### Getting citations + +```csharp + int campaingId = 1; + var citationBurstService = new CitationBurstService(); + + BrightLocalCitations citations = citationBurstService.GetCitations(campaingId); +``` + +### Confirm & Pay for citation Campaign + +```csharp + BrightLocalCbPayOptions confirmPay = new BrightLocalCbPayOptions(); + confirmPay.campaign_id = 1; + confirmPay.package_id = "cb15"; + + var citationBurstService = new CitationBurstService(); + + BrightLocalSuccess confirm = citationBurstService.ConfirmAndPay(confirmPay); +``` + +### Getting all campaigns + +```csharp + var citationBurstService = new CitationBurstService(); + + BrightLocalCbAllCampaigns results = citationBurstService.GetCampaigns(); +``` + +### Getting campaign details + +```csharp + int campaignId = 1; + var citationBurstService = new CitationBurstService(); + + BrightLocalCbCampaign results = citationBurstService.GetCampaign(campaignId); +``` + +### Getting credits balance + +```csharp + var citationBurstService = new CitationBurstService(); + + BrightLocalSuccess credits = citationBurstService.GetCredits(); +``` + ReviewFLow Reports ----- From ab0dd529e4251e7dc3932384d2cf0e958f0367b8 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Tue, 24 Jan 2017 14:43:36 -0700 Subject: [PATCH 63/93] Fixed errors in return entities --- .../BrightLocal/Entities/BrightLocalClient.cs | 4 +-- .../Entities/BrightLocalLocation.cs | 32 +++++++++---------- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalClient.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalClient.cs index bfedd7f..8383039 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalClient.cs +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalClient.cs @@ -5,9 +5,7 @@ namespace BrightLocal public class BrightLocalClient { [JsonProperty("client-id")] - public int clientId { get; set; } - [JsonProperty("success")] - public bool? success { get; set; } + public int clientId { get; set; } [JsonProperty("company-name")] public string companyName { get; set; } [JsonProperty("company-url")] diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalLocation.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalLocation.cs index 7c349f9..0818eae 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalLocation.cs +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalLocation.cs @@ -51,7 +51,7 @@ public class BrightLocalLocation [JsonProperty("extra-business-categories")] public List extraBusinessCategories { get; set; } [JsonProperty("working-hours")] - public WorkingHours workingHours { get; set; } + public List workingHours { get; set; } [JsonProperty("payment-methods")] public List paymentMethods { get; set; } [JsonProperty("short-description")] @@ -62,21 +62,21 @@ public class BrightLocalLocation public List servicesOfProducts { get; set; } } - public class WorkingHours + public class WorkingHours : Dictionary { - public string mon_start { get; set; } - public string mon_end { get; set; } - public string tue_start { get; set; } - public string tue_end { get; set; } - public string wed_start { get; set; } - public string wed_end { get; set; } - public string thu_start { get; set; } - public string thu_end { get; set; } - public string fri_start { get; set; } - public string fri_end { get; set; } - public string sat_start { get; set; } - public string sat_end { get; set; } - public string sun_start { get; set; } - public string sun_end { get; set; } + //public string mon_start { get; set; } + //public string mon_end { get; set; } + //public string tue_start { get; set; } + //public string tue_end { get; set; } + //public string wed_start { get; set; } + //public string wed_end { get; set; } + //public string thu_start { get; set; } + //public string thu_end { get; set; } + //public string fri_start { get; set; } + //public string fri_end { get; set; } + //public string sat_start { get; set; } + //public string sat_end { get; set; } + //public string sun_start { get; set; } + //public string sun_end { get; set; } } } From 183023d6b26848bcd44618c75c7d38d92fd927da Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Tue, 24 Jan 2017 15:39:15 -0700 Subject: [PATCH 64/93] Ficed getallresults object --- .../src/BrightLocal/Entities/BrightLocalGetAllResults.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalGetAllResults.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalGetAllResults.cs index 39badf8..da6eb32 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalGetAllResults.cs +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalGetAllResults.cs @@ -3,10 +3,13 @@ namespace BrightLocal { public class BrightLocalGetAllResults + { + public LsrcGetAllResponse response { get; set; } + } + public class LsrcGetAllResponse { public List results { get; set; } } - public class ResultsList { public string campaign_id { get; set; } From e06420454c63ae8c5b217c2db4306b39afcb9a6b Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Tue, 24 Jan 2017 15:39:42 -0700 Subject: [PATCH 65/93] removed locationId from response object --- BrightLocal/src/BrightLocal/Entities/BrightLocalLocation.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalLocation.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalLocation.cs index 0818eae..77e2fa9 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalLocation.cs +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalLocation.cs @@ -6,8 +6,6 @@ namespace BrightLocal { public class BrightLocalLocation { - [JsonProperty("location-id")] - public int locationId { get; set; } [JsonProperty("location-name")] public string locationName { get; set; } [JsonProperty("client-id")] From 221530d65ab468d4b0120136b162a15fe69b8c49 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Tue, 24 Jan 2017 15:40:11 -0700 Subject: [PATCH 66/93] fixed url parameter --- BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs b/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs index 917090c..524e1b7 100644 --- a/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs +++ b/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs @@ -24,7 +24,7 @@ public virtual BrightLocalSuccess Create(LsrcOptions createOptions) createOptions.emailAddresses = Parameters.convertToNewline(createOptions.emailAddresses); } var parameters = Parameters.convertListToParameters(createOptions); - var success = request.Post(Urls.Lsrc, parameters, this.api_key, this.api_secret); + var success = request.Post(url, parameters, this.api_key, this.api_secret); return JsonConvert.DeserializeObject(success.Content); } From c9e13b70c91e4a524201991f0b23d86488086233 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Tue, 24 Jan 2017 15:48:06 -0700 Subject: [PATCH 67/93] fixed return type for run method --- BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs b/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs index 524e1b7..eb53a80 100644 --- a/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs +++ b/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs @@ -89,13 +89,13 @@ public virtual BrightLocalLsrcReport Get(int campaignId) return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalLsrc Run(int campaignId) + public virtual BrightLocalSuccess Run(int campaignId) { var url = string.Format(Urls.Lsrc + "{0}", "run"); var parameters = new Parameters.requestParameters(); parameters.Add("campaign-id", campaignId); var success = request.Post(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } public virtual BrightLocalLsrcHistory GetHistory(int campaignId) From 922086172f44292f616ac6999247f3f48b22fe9f Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Tue, 24 Jan 2017 15:51:42 -0700 Subject: [PATCH 68/93] fixed returned entitiy type for lsrcreport --- .../src/BrightLocal/Entities/BrightLocalLsrcReport.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalLsrcReport.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalLsrcReport.cs index 8e395c4..ba2d7c4 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalLsrcReport.cs +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalLsrcReport.cs @@ -4,6 +4,14 @@ namespace BrightLocal { public class BrightLocalLsrcReport + { + public LsrcResponse response { get; set; } + } + public class LsrcResponse + { + public LsrcResult result { get; set; } + } + public class LsrcResult { [JsonProperty("campaign_id")] public string campaign_id { get; set; } From 5a026ea0d1f2a7f37964185dc6734425b60d1740 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Tue, 24 Jan 2017 16:23:48 -0700 Subject: [PATCH 69/93] fixed return type --- .../Examples-version2/Account-Methods/lsrcExamples.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs index 5249e60..248c76f 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs @@ -64,12 +64,12 @@ public static BrightLocalLsrcReport GetReport() return myLsrc; } - public static BrightLocalLsrc Run() + public static BrightLocalSuccess Run() { var campaignId = 1; var lsrcService = new LsrcService(); - BrightLocalLsrc myLsrc = lsrcService.Run(campaignId); + BrightLocalSuccess myLsrc = lsrcService.Run(campaignId); return myLsrc; } From 5ea0776152a0e181904aacf4d3e2d4557679872d Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Thu, 26 Jan 2017 07:47:33 -0700 Subject: [PATCH 70/93] fixed lsrc entity --- .../src/BrightLocal/Entities/BrightLocalLsrcHistory.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalLsrcHistory.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalLsrcHistory.cs index 67e1dd2..045cb08 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalLsrcHistory.cs +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalLsrcHistory.cs @@ -8,7 +8,11 @@ namespace BrightLocal { public class BrightLocalLsrcHistory { - public List reports { get; set; } + public LsrcHistoryResponse response { get; set; } + } + public class LsrcHistoryResponse + { + public List results { get; set; } } public class LsrcHistory From 1255d5be8c8d4c45cc9106638aceae462456cb3a Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Thu, 26 Jan 2017 09:59:29 -0700 Subject: [PATCH 71/93] Added Entity for LSRC report results --- .../Entities/BrightLocalLsrcReportResults.cs | 267 ++++++++++++++++++ .../Account-Methods/lsrcExamples.cs | 2 +- .../BrightLocal/Services/Lsrc/LsrcService.cs | 4 +- 3 files changed, 270 insertions(+), 3 deletions(-) create mode 100644 BrightLocal/src/BrightLocal/Entities/BrightLocalLsrcReportResults.cs diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalLsrcReportResults.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalLsrcReportResults.cs new file mode 100644 index 0000000..2ecbe0e --- /dev/null +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalLsrcReportResults.cs @@ -0,0 +1,267 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace BrightLocal +{ + public class BrightLocalLsrcReportResults + { + public LsrcResultResponse response { get; set; } + } + + public class LsrcResultResponse + { + public LsrcReportResult result { get; set; } + } + + public class LsrcReportResult + { + public LsrcCampaignDetails campaign_details { get; set; } + public LsrcResultsUrls urls { get; set; } + public LsrcResultsRankings rankings { get; set; } + [JsonProperty("serp-screenshots")] + public List serpScreenshots { get; set; } + } + + public class LsrcCampaignDetails + { + public string campaign_id { get; set; } + public string customer_id { get; set; } + public string white_label_profile_id { get; set; } + public string location_id { get; set; } + public string name { get; set; } + public string schedule { get; set; } + public string day_of_week { get; set; } + public string day_of_month { get; set; } + public List search_terms { get; set; } + public string ppc_search_terms { get; set; } + public string lookup_ppc { get; set; } + public List website_addresses { get; set; } + public string country { get; set; } + public string google_location { get; set; } + public string bing_location { get; set; } + public object previous_bing_location { get; set; } + public List business_names { get; set; } + public string postcode { get; set; } + public string telephone { get; set; } + public List search_engines { get; set; } + public string include_local_directory_results { get; set; } + public string notify { get; set; } + public string email_addresses { get; set; } + public string created { get; set; } + public string last_processed { get; set; } + public string last_message { get; set; } + public string currently_running { get; set; } + public string status { get; set; } + public string red_flag { get; set; } + public string is_public { get; set; } + public string public_key { get; set; } + public string show_advanced_settings { get; set; } + public string last_batch_id { get; set; } + public List tags { get; set; } + } + + public class LsrcResultsUrls + { + public string interactive_url { get; set; } + public string pdf_url { get; set; } + public string csv_url { get; set; } + public string public_interactive_url { get; set; } + public string public_pdf_url { get; set; } + public string public_csv_url { get; set; } + } + + public class LsrcResultsRankings + { + public List keywords { get; set; } + public KeywordsNumRankings keywords_num_rankings { get; set; } + public List search_engines { get; set; } + public LsrcResultsRankings2 rankings { get; set; } + public LsrcHashes hashes { get; set; } + public LsrcByPosition byPosition { get; set; } + public Dictionary starred_keywords { get; set; } + public LsrcSummary summary { get; set; } + } + + public class KeywordsNumRankings: Dictionary + { + + } + + public class LsrcResultsRankings2: Dictionary + { + + } + + public class LsrcKeyword: Dictionary> + { + + } + public class LsrcEngines + { + public string id { get; set; } + public string url { get; set; } + public string orig_url { get; set; } + public string rank { get; set; } + public string page { get; set; } + public string type { get; set; } + public string match { get; set; } + public string directory { get; set; } + public string date { get; set; } + public string hash { get; set; } + public string search_url { get; set; } + public string search_engine { get; set; } + } + + public class LsrcHashes: Dictionary + { + + } + + public class HashKeyword: Dictionary> + { + + } + + public class LsrcByPosition + { + [JsonProperty("Position 1")] + public List Position1 { get; set; } + [JsonProperty("Positions 2-5")] + public List Positions2_5 { get; set; } + [JsonProperty("Positions 6-10")] + public List Positions6_10 { get; set; } + [JsonProperty("Positions 11-20")] + public List Positions11_20 { get; set; } + [JsonProperty("Positions 21-50")] + public List Positions21_50 { get; set; } + [JsonProperty("Positions 51+")] + public LsrcPositionValues Positions51Up { get; set; } + } + + public class LsrcPositions + { + + } + + public class LsrcPositionValues: Dictionary + { + + } + + public class LsrcPositionDetails + { + public string id { get; set; } + public string url { get; set; } + public string orig_url { get; set; } + public string rank { get; set; } + public string page { get; set; } + public string type { get; set; } + public string match { get; set; } + public object directory { get; set; } + public string date { get; set; } + public string hash { get; set; } + public string search_url { get; set; } + public string search_engine { get; set; } + } + + public class LsrcSummary + { + public LsrcAllSearchEngines all_search_engines { get; set; } + public LsrcGoogle google { get; set; } + [JsonProperty("google-places")] + public LsrcGooglePlaces googlePlaces { get; set; } + public LsrcYahoo yahoo { get; set; } + [JsonProperty("yahoo-local")] + public LsrcYahooLocal yahooLocal { get; set; } + public LsrcBing bing { get; set; } + [JsonProperty("bing-local")] + public LsrcBingLocal bingLocal { get; set; } + } + + public class LsrcAllSearchEngines + { + public int up { get; set; } + public int down { get; set; } + public int no_change { get; set; } + public List gained_hashes { get; set; } + public List lost_hashes { get; set; } + } + + public class LsrcGoogle + { + public int up { get; set; } + public int down { get; set; } + public int no_change { get; set; } + public List gained_hashes { get; set; } + public List lost_hashes { get; set; } + } + + public class LsrcGooglePlaces + { + public int up { get; set; } + public int down { get; set; } + public int no_change { get; set; } + public List gained_hashes { get; set; } + public List lost_hashes { get; set; } + } + + public class LsrcYahoo + { + public int up { get; set; } + public int down { get; set; } + public int no_change { get; set; } + public List gained_hashes { get; set; } + public List lost_hashes { get; set; } + } + + public class LsrcYahooLocal + { + public int up { get; set; } + public int down { get; set; } + public int no_change { get; set; } + public List gained_hashes { get; set; } + public List lost_hashes { get; set; } + } + + public class LsrcBing + { + public int up { get; set; } + public int down { get; set; } + public int no_change { get; set; } + public List gained_hashes { get; set; } + public List lost_hashes { get; set; } + } + + public class LsrcBingLocal + { + public int up { get; set; } + public int down { get; set; } + public int no_change { get; set; } + public List gained_hashes { get; set; } + public List lost_hashes { get; set; } + } + + public class LsrcSerpScreenshots: Dictionary + { + + } + + public class ScreenshotEngine: Dictionary + { + + } + + public class ScreenshotKeyword: Dictionary + { + + } + + public class ScreenshotPosition + { + public string url { get; set; } + public string expiry_date { get; set; } + } +} diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs index 248c76f..6906eef 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs @@ -82,7 +82,7 @@ public static BrightLocalLsrcHistory GetHistory() return lsrcHistory; } - public static Object GetReportResults() + public static BrightLocalLsrcReportResults GetReportResults() { var myLsrc = new GetResultsLsrcOptions(); myLsrc.campaignId = 1; diff --git a/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs b/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs index eb53a80..6f82321 100644 --- a/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs +++ b/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs @@ -108,13 +108,13 @@ public virtual BrightLocalLsrcHistory GetHistory(int campaignId) return JsonConvert.DeserializeObject(results.Content); } - public virtual Object GetResults(GetResultsLsrcOptions lsrcOptions) + public virtual BrightLocalLsrcReportResults GetResults(GetResultsLsrcOptions lsrcOptions) { var url = string.Format(Urls.Lsrc + "{0}", "results/get"); var parameters = Parameters.convertListToParameters(lsrcOptions); var results = request.Get(url, parameters, this.api_key, this.api_secret); - var report = JsonConvert.DeserializeObject(results.Content); + var report = JsonConvert.DeserializeObject(results.Content); return report; } } From 34db474e2b6812706779daf2669cb65ea583a533 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Thu, 26 Jan 2017 10:18:29 -0700 Subject: [PATCH 72/93] fixed docs to reflect new lsrcreportresults entity --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 2a48ff1..f64ed62 100644 --- a/README.md +++ b/README.md @@ -272,11 +272,9 @@ The returned BrightLocalSuccess entity above will have a campaign-id. You will w var lsrcService = new LsrcService(); - var lsrcResults = lsrcService.GetResults(myLsrc); + BrightLocalLsrcReportResults lsrcResults = lsrcService.GetResults(myLsrc); ``` -The LsrcService.GetResults method above currently returns a json object. In future releases we will have a entity BrightLocalLsrcResults. - Local SEO Check-up ----- From 7a4badf6dcefd8dbc7cd903c1571f14bdaf2a510 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Thu, 26 Jan 2017 12:09:16 -0700 Subject: [PATCH 73/93] fixed update classes and objects --- .../Examples-version2/Account-Methods/lscuExamples.cs | 4 +++- BrightLocal/src/BrightLocal/Services/Lscu/LscuOptions.cs | 2 +- .../src/BrightLocal/Services/Lscu/UpdateLscuOptions.cs | 2 +- README.md | 3 ++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lscuExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lscuExamples.cs index cd8af6a..c7df12b 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lscuExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lscuExamples.cs @@ -23,9 +23,10 @@ public static BrightLocalSuccess Create() myLscu.businessCategory = "Restaurant"; myLscu.primaryBusinessLocation = "NY, New York"; myLscu.searchTerms = new List() { "restaurant manhattan", "cafe new york" }; - + // Example for supplying Local Directory URLs (see local-directory-urls parameter) + myLscu.localDirectoryUrls = new LocalDirectoryUrls(); myLscu.localDirectoryUrls.Add( "citysearch", new DirectoryUrls @@ -51,6 +52,7 @@ public static BrightLocalSuccess Create() public static BrightLocalSuccess Update() { UpdateLscuOptions myLscu = new UpdateLscuOptions(); + myLscu.reportId = 1; myLscu.reportName = "Sample SEO Chek-Up Report"; myLscu.businessNames = new List() { "Le Bernardin", "Le Bernardin Cafe" }; myLscu.websiteAddress = "le-bernardin.com"; diff --git a/BrightLocal/src/BrightLocal/Services/Lscu/LscuOptions.cs b/BrightLocal/src/BrightLocal/Services/Lscu/LscuOptions.cs index 7a5aaee..5d740ad 100644 --- a/BrightLocal/src/BrightLocal/Services/Lscu/LscuOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/Lscu/LscuOptions.cs @@ -6,7 +6,7 @@ namespace BrightLocal { public class LscuOptions - { + { [JsonProperty("report-name")] public string reportName { get; set; } [JsonProperty("location-id")] diff --git a/BrightLocal/src/BrightLocal/Services/Lscu/UpdateLscuOptions.cs b/BrightLocal/src/BrightLocal/Services/Lscu/UpdateLscuOptions.cs index d9d8f7a..250e1f4 100644 --- a/BrightLocal/src/BrightLocal/Services/Lscu/UpdateLscuOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/Lscu/UpdateLscuOptions.cs @@ -7,7 +7,7 @@ namespace BrightLocal public class UpdateLscuOptions { [JsonProperty("report-id")] - public string reportId { get; set; } + public int reportId { get; set; } [JsonProperty("report-name")] public string reportName { get; set; } [JsonProperty("location-id")] diff --git a/README.md b/README.md index f64ed62..db159b1 100644 --- a/README.md +++ b/README.md @@ -307,7 +307,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan ### Supplying Local Directory URLs (see local-directory-urls parameter) ```csharp - LscuOptions myLscu = new LscuOptions(); + myLscu.localDirectoryUrls = new LocalDirectoryUrls(); myLscu.localDirectoryUrls.Add( "citysearch", new DirectoryUrls @@ -328,6 +328,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan ```csharp UpdateLscuOptions myLscu = new UpdateLscuOptions(); + myLscu.reportId = 1; myLscu.reportName = "Sample SEO Chek-Up Report"; myLscu.businessNames = new List() { "Le Bernardin", "Le Bernardin Cafe" }; myLscu.websiteAddress = "le-bernardin.com"; From f97607f840db12342092c9322157d2fab6220a5a Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Fri, 27 Jan 2017 09:11:44 -0700 Subject: [PATCH 74/93] Fixed lscu response entities --- .../Entities/BrightLocalLscuReport.cs | 25 +++++++++++-------- .../Entities/BrightLocalLscuSearch.cs | 4 +-- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalLscuReport.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalLscuReport.cs index d96e679..aace9bc 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalLscuReport.cs +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalLscuReport.cs @@ -1,33 +1,35 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; +using System.Collections.Generic; namespace BrightLocal { public class BrightLocalLscuReport + { + public bool success { get; set; } + public LscuReport report { get; set; } + } + + public class LscuReport { public string report_id { get; set; } public string customer_id { get; set; } - public string location_id { get; set; } + public string client_id { get; set; } public string company_name { get; set; } - public string name { get; set; } + public string report_name { get; set; } public string white_label_profile_id { get; set; } - public string business_names { get; set; } + public List business_names { get; set; } public string website_address { get; set; } public string telephone { get; set; } public string address_1 { get; set; } public string address_2 { get; set; } - public string area { get; set; } public string city { get; set; } public string state_code { get; set; } public string postcode { get; set; } public string country { get; set; } public string business_category { get; set; } public string primary_business_location { get; set; } - public string search_terms { get; set; } + public List search_terms { get; set; } public string notify { get; set; } - public string email_addresses { get; set; } + public List email_addresses { get; set; } public string date_added { get; set; } public string last_start_time { get; set; } public string last_end_time { get; set; } @@ -38,9 +40,10 @@ public class BrightLocalLscuReport public string twitter { get; set; } public string google_location { get; set; } public string bing_location { get; set; } - public object previous_bing_location { get; set; } + public string previous_bing_location { get; set; } public string is_public { get; set; } public string public_key { get; set; } + public LocalDirectoryUrls local_directory_urls { get; set; } public LatestRun latest_run { get; set; } } diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalLscuSearch.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalLscuSearch.cs index d8bc55e..18c6d93 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalLscuSearch.cs +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalLscuSearch.cs @@ -11,10 +11,10 @@ public class BrightLocalLscuSearch [JsonProperty("success")] public bool success { get; set; } [JsonProperty("reports")] - public List reports { get; set; } + public List reports { get; set; } } - public class LscuReport + public class LscuReports { [JsonProperty("report_id")] public string report_id { get; set; } From 19ea3a7704e39e4d4def016cca06e1bc252219f9 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Fri, 27 Jan 2017 09:12:04 -0700 Subject: [PATCH 75/93] fixed return type --- .../Account-Methods/lscuExamples.cs | 4 +-- .../BrightLocal/Services/Lscu/LscuService.cs | 31 ++++--------------- README.md | 4 +-- 3 files changed, 10 insertions(+), 29 deletions(-) diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lscuExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lscuExamples.cs index c7df12b..6e52b05 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lscuExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lscuExamples.cs @@ -84,7 +84,7 @@ public static BrightLocalLscuReport Get() } - public static string Run() + public static BrightLocalSuccess Run() { var reportId = 1; var lscuService = new LscuService(); @@ -93,7 +93,7 @@ public static string Run() return success; } - public static string Delete() + public static BrightLocalSuccess Delete() { var reportId = 1; var lscuService = new LscuService(); diff --git a/BrightLocal/src/BrightLocal/Services/Lscu/LscuService.cs b/BrightLocal/src/BrightLocal/Services/Lscu/LscuService.cs index 4741a1e..a61b608 100644 --- a/BrightLocal/src/BrightLocal/Services/Lscu/LscuService.cs +++ b/BrightLocal/src/BrightLocal/Services/Lscu/LscuService.cs @@ -34,42 +34,23 @@ public virtual BrightLocalLscuReport Get(int reportId) } // returns success or failed as a string message - public virtual string Run(int reportId) + public virtual BrightLocalSuccess Run(int reportId) { - string response; var url = string.Format(Urls.Lscu + "{0}", "run"); var parameters = new Parameters.requestParameters(); parameters.Add("report-id", reportId); - var success = request.Post(Urls.Lscu, parameters, this.api_key, this.api_secret); - if(JsonConvert.DeserializeObject(success.Content)) - { - response = "Success, your report is running"; - } - else - { - response = "Falied, " + success.Content; - } + var success = request.Put(url, parameters, this.api_key, this.api_secret); - return response; + return JsonConvert.DeserializeObject(success.Content); } // returns success or failed as a string message - public virtual string Delete(int reportId) + public virtual BrightLocalSuccess Delete(int reportId) { - string response; var parameters = new Parameters.requestParameters(); parameters.Add("report-id", reportId); var success = request.Delete(Urls.Lscu, parameters, this.api_key, this.api_secret); - if (JsonConvert.DeserializeObject(success.Content)) - { - response = "Success, your report has been deleted"; - } - else - { - response = "Falied, " + success.Content; - } - - return response; + return JsonConvert.DeserializeObject(success.Content); } public virtual BrightLocalLscuSearch Search(string query) @@ -77,7 +58,7 @@ public virtual BrightLocalLscuSearch Search(string query) var url = string.Format(Urls.Lscu + "{0}", "search"); var parameters = new Parameters.requestParameters(); parameters.Add("q", query); - var success = request.Get(Urls.Lscu, parameters, this.api_key, this.api_secret); + var success = request.Get(url, parameters, this.api_key, this.api_secret); return JsonConvert.DeserializeObject(success.Content); } } diff --git a/README.md b/README.md index db159b1..436017d 100644 --- a/README.md +++ b/README.md @@ -363,7 +363,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan var reportId = 1; var lscuService = new LscuService(); - var success = lscuService.Run(reportId); + BrightLocalSuccess success = lscuService.Run(reportId); ``` The returned success entity above is of type string. Success or Failure with errors. @@ -373,7 +373,7 @@ The returned success entity above is of type string. Success or Failure with err var reportId = 1; var lscuService = new LscuService(); - var success = lscuService.Delete(reportId); + BrightLocalSuccess success = lscuService.Delete(reportId); ``` The returned success entity above is of type string. Success or Failure with errors. From dd69c5906b547bddd9efcbdeb1c1e34eaf4020b6 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Mon, 30 Jan 2017 08:25:47 -0700 Subject: [PATCH 76/93] fixed url aprameter --- .../src/BrightLocal/Services/ReviewFlow/ReviewFlowService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BrightLocal/src/BrightLocal/Services/ReviewFlow/ReviewFlowService.cs b/BrightLocal/src/BrightLocal/Services/ReviewFlow/ReviewFlowService.cs index 9771b9d..0824dc6 100644 --- a/BrightLocal/src/BrightLocal/Services/ReviewFlow/ReviewFlowService.cs +++ b/BrightLocal/src/BrightLocal/Services/ReviewFlow/ReviewFlowService.cs @@ -10,7 +10,7 @@ public ReviewFlowService(string apiKey = null, string apiSecret = null) : base(a public virtual BrightLocalSuccess Create(ReviewFlowOptions createOptions) { - var url = string.Format(Urls.ReviewFlow + "{0}", "create"); + var url = string.Format(Urls.ReviewFlow + "{0}", "add"); var parameters = Parameters.convertListToParameters(createOptions); var success = request.Post(url, parameters, this.api_key, this.api_secret); return JsonConvert.DeserializeObject(success.Content); From 9d0929cb885eb8fa59e47eeb5fbb179df6d9fe31 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Mon, 30 Jan 2017 08:26:20 -0700 Subject: [PATCH 77/93] added constructor for rfdirectoryurls --- .../src/BrightLocal/Services/ReviewFlow/ReviewFlowOptions.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/BrightLocal/src/BrightLocal/Services/ReviewFlow/ReviewFlowOptions.cs b/BrightLocal/src/BrightLocal/Services/ReviewFlow/ReviewFlowOptions.cs index f049d32..662fe89 100644 --- a/BrightLocal/src/BrightLocal/Services/ReviewFlow/ReviewFlowOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/ReviewFlow/ReviewFlowOptions.cs @@ -5,6 +5,11 @@ namespace BrightLocal { public class ReviewFlowOptions { + public ReviewFlowOptions() + { + directories = new RFDirectoryUrls(); + } + [JsonProperty("report-name")] public string reportName { get; set; } [JsonProperty("location-id")] From 2e98a0a115648b4f4bedfe666e10cdaad585cdbc Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Mon, 30 Jan 2017 10:44:12 -0700 Subject: [PATCH 78/93] added json serialization List parameters --- .../BrightLocal/Entities/BrightLocalLscuReport.cs | 2 +- .../Account-Methods/lscuExamples.cs | 15 ++++++++------- .../src/BrightLocal/Services/Lscu/LscuOptions.cs | 4 ++-- .../Services/Lscu/UpdateLscuOptions.cs | 4 ++-- .../src/BrightLocal/examples/lscuExamples.cs | 6 +++--- README.md | 8 ++++---- 6 files changed, 20 insertions(+), 19 deletions(-) diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalLscuReport.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalLscuReport.cs index aace9bc..ba7b185 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalLscuReport.cs +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalLscuReport.cs @@ -43,7 +43,7 @@ public class LscuReport public string previous_bing_location { get; set; } public string is_public { get; set; } public string public_key { get; set; } - public LocalDirectoryUrls local_directory_urls { get; set; } + public List local_directory_urls { get; set; } public LatestRun latest_run { get; set; } } diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lscuExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lscuExamples.cs index 6e52b05..0cf31fd 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lscuExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lscuExamples.cs @@ -1,4 +1,5 @@ -using System; +using Newtonsoft.Json; +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; @@ -11,7 +12,7 @@ public static BrightLocalSuccess Create() { LscuOptions myLscu = new LscuOptions(); myLscu.reportName = "Sample SEO Chek-Up Report"; - myLscu.businessNames = new List() {"Le Bernardin", "Le Bernardin Cafe"}; + myLscu.businessNames = JsonConvert.SerializeObject(new List() {"Le Bernardin", "Le Bernardin Cafe"}); myLscu.websiteAddress = "le-bernardin.com"; myLscu.address1 = "155 Weest 51st Street"; myLscu.address2 = ""; @@ -22,7 +23,7 @@ public static BrightLocalSuccess Create() myLscu.country = "USA"; myLscu.businessCategory = "Restaurant"; myLscu.primaryBusinessLocation = "NY, New York"; - myLscu.searchTerms = new List() { "restaurant manhattan", "cafe new york" }; + myLscu.searchTerms = JsonConvert.SerializeObject(new List() { "restaurant manhattan", "cafe new york" }); // Example for supplying Local Directory URLs (see local-directory-urls parameter) @@ -31,14 +32,14 @@ public static BrightLocalSuccess Create() "citysearch", new DirectoryUrls { - url = "http://www.yelp.co.uk/biz/greens-restaurant-san-francisco-3", + url = null, include = "yes" }); myLscu.localDirectoryUrls.Add( "dexknows", new DirectoryUrls { - url = "", + url = null, include = "yes" }); @@ -54,7 +55,7 @@ public static BrightLocalSuccess Update() UpdateLscuOptions myLscu = new UpdateLscuOptions(); myLscu.reportId = 1; myLscu.reportName = "Sample SEO Chek-Up Report"; - myLscu.businessNames = new List() { "Le Bernardin", "Le Bernardin Cafe" }; + myLscu.businessNames = JsonConvert.SerializeObject(new List() { "Le Bernardin", "Le Bernardin Cafe" }); myLscu.websiteAddress = "le-bernardin.com"; myLscu.address1 = "155 Weest 51st Street"; myLscu.address2 = ""; @@ -65,7 +66,7 @@ public static BrightLocalSuccess Update() myLscu.country = "USA"; myLscu.businessCategory = "Restaurant"; myLscu.primaryBusinessLocation = "NY, New York"; - myLscu.searchTerms = new List() { "restaurant manhattan", "cafe new york" }; + myLscu.searchTerms = JsonConvert.SerializeObject(new List() { "restaurant manhattan", "cafe new york" }); var lscuService = new LscuService(); diff --git a/BrightLocal/src/BrightLocal/Services/Lscu/LscuOptions.cs b/BrightLocal/src/BrightLocal/Services/Lscu/LscuOptions.cs index 5d740ad..dae4099 100644 --- a/BrightLocal/src/BrightLocal/Services/Lscu/LscuOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/Lscu/LscuOptions.cs @@ -14,7 +14,7 @@ public class LscuOptions [JsonProperty("white-label-profile-id")] public int whiteLabelProfileId { get; set; } [JsonProperty("business-names")] - public List businessNames { get; set; } + public string businessNames { get; set; } [JsonProperty("website-address")] public string websiteAddress { get; set; } [JsonProperty("address1")] @@ -38,7 +38,7 @@ public class LscuOptions [JsonProperty("primary-business-location")] public string primaryBusinessLocation { get; set; } [JsonProperty("search-terms")] - public List searchTerms { get; set; } + public string searchTerms { get; set; } [JsonProperty("google-location")] public string googleLocation { get; set; } [JsonProperty("bing-location")] diff --git a/BrightLocal/src/BrightLocal/Services/Lscu/UpdateLscuOptions.cs b/BrightLocal/src/BrightLocal/Services/Lscu/UpdateLscuOptions.cs index 250e1f4..19ead72 100644 --- a/BrightLocal/src/BrightLocal/Services/Lscu/UpdateLscuOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/Lscu/UpdateLscuOptions.cs @@ -15,7 +15,7 @@ public class UpdateLscuOptions [JsonProperty("white-label-profile-id")] public int whiteLabelProfileId { get; set; } [JsonProperty("business-names")] - public List businessNames { get; set; } + public string businessNames { get; set; } [JsonProperty("website-address")] public string websiteAddress { get; set; } [JsonProperty("address1")] @@ -39,7 +39,7 @@ public class UpdateLscuOptions [JsonProperty("primary-business-location")] public string primaryBusinessLocation { get; set; } [JsonProperty("search-terms")] - public List searchTerms { get; set; } + public string searchTerms { get; set; } [JsonProperty("google-location")] public string googleLocation { get; set; } [JsonProperty("bing-location")] diff --git a/BrightLocal/src/BrightLocal/examples/lscuExamples.cs b/BrightLocal/src/BrightLocal/examples/lscuExamples.cs index 1d17a84..7b9d565 100644 --- a/BrightLocal/src/BrightLocal/examples/lscuExamples.cs +++ b/BrightLocal/src/BrightLocal/examples/lscuExamples.cs @@ -15,7 +15,7 @@ public static IRestResponse addReport() var parameters = new api.Parameters(); parameters.Add("report-name", "Sample SEO Check-Up Report"); - parameters.Add("business-names", "['Le Bernardin']"); + parameters.Add("business-names", JsonConvert.SerializeObject("['Le Bernardin']")); parameters.Add("website-address", "le-bernardin.com"); parameters.Add("address1", "155 Weest 51st Street"); parameters.Add("address2", ""); @@ -26,7 +26,7 @@ public static IRestResponse addReport() parameters.Add("country", "USA"); parameters.Add("business-category", "Restaurant"); parameters.Add("primary-business-location", "NY, New York"); - parameters.Add("search-terms", "['restaurant manhattan', 'cafe new york']"); + parameters.Add("search-terms", JsonConvert.SerializeObject("['restaurant manhattan', 'cafe new york']")); var success = request.Post("v4/lscu", parameters); @@ -44,7 +44,7 @@ public static IRestResponse updateReport() parameters.Add("country", "USA"); parameters.Add("business-category", "Restaurant"); parameters.Add("primary-business-location", "NY, New York"); - parameters.Add("search-terms", "['restaurant manhattan', 'cafe new york']"); + parameters.Add("search-terms", JsonConvert.SerializeObject("['restaurant manhattan', 'cafe new york']")); var success = request.Put("v4/lscu", parameters); diff --git a/README.md b/README.md index 436017d..7ede864 100644 --- a/README.md +++ b/README.md @@ -284,7 +284,7 @@ Local SEO Check-up ```csharp LscuOptions myLscu = new LscuOptions(); myLscu.reportName = "Sample SEO Chek-Up Report"; - myLscu.businessNames = new List() {"Le Bernardin", "Le Bernardin Cafe"}; + myLscu.businessNames = JsonConvert.SerializeObject(new List() {"Le Bernardin", "Le Bernardin Cafe"}); myLscu.websiteAddress = "le-bernardin.com"; myLscu.address1 = "155 Weest 51st Street"; myLscu.address2 = ""; @@ -295,7 +295,7 @@ Local SEO Check-up myLscu.country = "USA"; myLscu.businessCategory = "Restaurant"; myLscu.primaryBusinessLocation = "NY, New York"; - myLscu.searchTerms = new List() { "restaurant manhattan", "cafe new york" }; + myLscu.searchTerms = JsonConvert.SerializeObject(new List() { "restaurant manhattan", "cafe new york" }); var lscuService = new LscuService(); @@ -330,7 +330,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan UpdateLscuOptions myLscu = new UpdateLscuOptions(); myLscu.reportId = 1; myLscu.reportName = "Sample SEO Chek-Up Report"; - myLscu.businessNames = new List() { "Le Bernardin", "Le Bernardin Cafe" }; + myLscu.businessNames = JsonConvert.SerializeObject(new List() { "Le Bernardin", "Le Bernardin Cafe" }); myLscu.websiteAddress = "le-bernardin.com"; myLscu.address1 = "155 Weest 51st Street"; myLscu.address2 = ""; @@ -341,7 +341,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan myLscu.country = "USA"; myLscu.businessCategory = "Restaurant"; myLscu.primaryBusinessLocation = "NY, New York"; - myLscu.searchTerms = new List() { "restaurant manhattan", "cafe new york" }; + myLscu.searchTerms = JsonConvert.SerializeObject(new List() { "restaurant manhattan", "cafe new york" }); var lscuService = new LscuService(); From 6f5b01b015c0c2f0a766b78fecd366b63d0aee00 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Mon, 30 Jan 2017 10:44:29 -0700 Subject: [PATCH 79/93] added check for null parameter --- .../src/BrightLocal/Services/Parameters.cs | 30 +++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/BrightLocal/src/BrightLocal/Services/Parameters.cs b/BrightLocal/src/BrightLocal/Services/Parameters.cs index 519b3de..4b85396 100644 --- a/BrightLocal/src/BrightLocal/Services/Parameters.cs +++ b/BrightLocal/src/BrightLocal/Services/Parameters.cs @@ -13,18 +13,38 @@ public static requestParameters convertListToParameters(Object item) var parameters = new requestParameters(); foreach (var directoryinfo in item.GetType().GetProperties()) { - foreach (CustomAttributeData att in directoryinfo.CustomAttributes) + var prpType = directoryinfo.GetType(); + if(directoryinfo != null) { - foreach (CustomAttributeTypedArgument arg in att.ConstructorArguments) + foreach (CustomAttributeData att in directoryinfo.CustomAttributes) { - parameters.Add(arg.Value.ToString(), directoryinfo.GetValue(item, null)); - + foreach (CustomAttributeTypedArgument arg in att.ConstructorArguments) + { + parameters.Add(arg.Value.ToString(), directoryinfo.GetValue(item, null)); + } } } + } return parameters; } - + //public static Dictionary ObjectToDictionary(object value) + //{ + // Dictionary dictionary = new Dictionary(); + // if (value != null) + // { + // foreach (System.ComponentModel.PropertyDescriptor descriptor in System.ComponentModel.TypeDescriptor.GetProperties(value)) + // { + // if (descriptor != null && descriptor.Name != null) + // { + // object propValue = descriptor.GetValue(value); + // if (propValue != null) + // dictionary.Add(descriptor.Name, String.Format("{0}", propValue)); + // } + // } + // } + // return dictionary; + //} public static string convertToNewline(string item) { return item.Replace(',', '\n'); From dac01e9e97691c52068d98a0ee7c38ddb0a96c2e Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Mon, 30 Jan 2017 13:47:55 -0700 Subject: [PATCH 80/93] serialize list parameters --- .../Examples-version2/Account-Methods/gpwExamples.cs | 7 ++++--- .../src/BrightLocal/Services/GpwReports/GpwOptions.cs | 4 ++-- .../BrightLocal/Services/GpwReports/UpdateGpwOptions.cs | 4 ++-- BrightLocal/src/BrightLocal/Services/Parameters.cs | 3 +-- BrightLocal/src/BrightLocal/examples/gpwExamples.cs | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/gpwExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/gpwExamples.cs index ce49a8f..deaad98 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/gpwExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/gpwExamples.cs @@ -1,4 +1,5 @@ -using System; +using Newtonsoft.Json; +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; @@ -22,7 +23,7 @@ public static BrightLocalSuccess Create() myGpwReport.postcode = "10019"; myGpwReport.phoneNumber = "+1 212-554-1515"; myGpwReport.country = "USA"; - myGpwReport.searchTerms = new List() { "restaurant manhattan", "cafe new york" }; + myGpwReport.searchTerms = JsonConvert.SerializeObject(new List() { "restaurant manhattan", "cafe new york" }); var gpwService = new GpwService(); @@ -46,7 +47,7 @@ public static BrightLocalSuccess Update() myGpwReport.postcode = "10019"; myGpwReport.phoneNumber = "+1 212-554-1515"; myGpwReport.country = "USA"; - myGpwReport.searchTerms = new List() { "restaurant manhattan", "cafe new york" }; + myGpwReport.searchTerms = JsonConvert.SerializeObject(new List() { "restaurant manhattan", "cafe new york" }); var gpwService = new GpwService(); diff --git a/BrightLocal/src/BrightLocal/Services/GpwReports/GpwOptions.cs b/BrightLocal/src/BrightLocal/Services/GpwReports/GpwOptions.cs index 96545d7..f689bd4 100644 --- a/BrightLocal/src/BrightLocal/Services/GpwReports/GpwOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/GpwReports/GpwOptions.cs @@ -36,11 +36,11 @@ public class GpwOptions [JsonProperty("country")] public string country { get; set; } [JsonProperty("search_terms")] - public List searchTerms { get; set; } + public string searchTerms { get; set; } [JsonProperty("notify")] public string notify { get; set; } [JsonProperty("email-addresses")] - public List emailAddresses { get; set; } + public string emailAddresses { get; set; } [JsonProperty("google_location")] public string googleLocation { get; set; } [JsonProperty("is_public")] diff --git a/BrightLocal/src/BrightLocal/Services/GpwReports/UpdateGpwOptions.cs b/BrightLocal/src/BrightLocal/Services/GpwReports/UpdateGpwOptions.cs index da4c25b..42788ef 100644 --- a/BrightLocal/src/BrightLocal/Services/GpwReports/UpdateGpwOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/GpwReports/UpdateGpwOptions.cs @@ -38,11 +38,11 @@ public class UpdateGpwOptions [JsonProperty("country")] public string country { get; set; } [JsonProperty("search_terms")] - public List searchTerms { get; set; } + public string searchTerms { get; set; } [JsonProperty("notify")] public string notify { get; set; } [JsonProperty("email-addresses")] - public List emailAddresses { get; set; } + public string emailAddresses { get; set; } [JsonProperty("google_location")] public string googleLocation { get; set; } [JsonProperty("is_public")] diff --git a/BrightLocal/src/BrightLocal/Services/Parameters.cs b/BrightLocal/src/BrightLocal/Services/Parameters.cs index 4b85396..56a780d 100644 --- a/BrightLocal/src/BrightLocal/Services/Parameters.cs +++ b/BrightLocal/src/BrightLocal/Services/Parameters.cs @@ -13,8 +13,7 @@ public static requestParameters convertListToParameters(Object item) var parameters = new requestParameters(); foreach (var directoryinfo in item.GetType().GetProperties()) { - var prpType = directoryinfo.GetType(); - if(directoryinfo != null) + if(directoryinfo.GetValue(item) != null) { foreach (CustomAttributeData att in directoryinfo.CustomAttributes) { diff --git a/BrightLocal/src/BrightLocal/examples/gpwExamples.cs b/BrightLocal/src/BrightLocal/examples/gpwExamples.cs index e163bcf..317f66a 100644 --- a/BrightLocal/src/BrightLocal/examples/gpwExamples.cs +++ b/BrightLocal/src/BrightLocal/examples/gpwExamples.cs @@ -25,7 +25,7 @@ public static IRestResponse addReport() parameters.Add("postcode", "10019"); parameters.Add("phone_number", "+1 212-554-1515"); parameters.Add("country", "USA"); - parameters.Add("business-category", "Restaurant"); + parameters.Add("search-terms", "['restaurant manhattan', 'cafe new york']"); var success = request.Post("v4/gpw/add", parameters); From 241cdd22fe79151348dce6bfaf07744df576ca3c Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Mon, 30 Jan 2017 13:49:11 -0700 Subject: [PATCH 81/93] serialize List objects --- .../Account-Methods/citationTrackerExamples.cs | 2 +- .../Examples-version2/Account-Methods/lsrcExamples.cs | 7 ++++--- BrightLocal/src/BrightLocal/Services/Lsrc/LsrcOptions.cs | 2 +- .../src/BrightLocal/Services/Lsrc/UpdateLsrcOptions.cs | 2 +- BrightLocal/src/BrightLocal/examples/lscuExamples.cs | 4 ++-- BrightLocal/src/BrightLocal/examples/lsrcExamples.cs | 7 ++++--- README.md | 4 ++-- 7 files changed, 15 insertions(+), 13 deletions(-) diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationTrackerExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationTrackerExamples.cs index f3fa645..57681d9 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationTrackerExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationTrackerExamples.cs @@ -8,7 +8,7 @@ public static BrightLocalSuccess Create() myCt.reportName = "Sample Citation Tracker Report"; myCt.businessName = "Le Bernardin"; myCt.website = "le-bernardin.com"; - myCt.businessType = "Restaurant"; + myCt.businessType = "Restaurant"; myCt.stateCode = "NY"; myCt.postcode = "10019"; myCt.phone = "+1 212-554-1515"; diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs index 6906eef..d111905 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs @@ -1,4 +1,5 @@ -using System; +using Newtonsoft.Json; +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; @@ -11,7 +12,7 @@ public static BrightLocalSuccess Create() { var myLsrc = new LsrcOptions(); myLsrc.name = "Le Bernardin"; - myLsrc.websiteAddresses = new List() {"le-bernardin.com", "www.le-bernadin.com"}; + myLsrc.websiteAddresses = JsonConvert.SerializeObject(new List() {"le-bernardin.com", "www.le-bernadin.com"}); myLsrc.searchTerms = "Restaurant, food+nyc, delivery+midtown+manhattan"; myLsrc.schedule = "Adhoc"; myLsrc.searchEngines = "google, google-mobile, google-local, yahoo, yahoo-local, bing, bing-local"; @@ -27,7 +28,7 @@ public static BrightLocalSuccess Update() var myLsrc = new UpdateLsrcOptions(); myLsrc.campaignId = 1; myLsrc.name = "Le Bernardin"; - myLsrc.websiteAddresses = new List() { "le-bernardin.com", "www.le-bernadin.com" }; + myLsrc.websiteAddresses = JsonConvert.SerializeObject(new List() { "le-bernardin.com", "www.le-bernadin.com" }); myLsrc.searchTerms = "Restaurant, food+nyc, delivery+midtown+manhattan"; myLsrc.schedule = "Adhoc"; myLsrc.searchEngines = "google, google-mobile, google-local, yahoo, yahoo-local, bing, bing-local"; diff --git a/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcOptions.cs b/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcOptions.cs index acae9ec..aef52a6 100644 --- a/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcOptions.cs @@ -22,7 +22,7 @@ public class LsrcOptions [JsonProperty("search-terms")] public string searchTerms { get; set; } [JsonProperty("website-addresses")] - public List websiteAddresses { get; set; } + public string websiteAddresses { get; set; } [JsonProperty("website-address")] public string websiteAddress { get; set; } [JsonProperty("website-address-2")] diff --git a/BrightLocal/src/BrightLocal/Services/Lsrc/UpdateLsrcOptions.cs b/BrightLocal/src/BrightLocal/Services/Lsrc/UpdateLsrcOptions.cs index 01169fc..a38959e 100644 --- a/BrightLocal/src/BrightLocal/Services/Lsrc/UpdateLsrcOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/Lsrc/UpdateLsrcOptions.cs @@ -24,7 +24,7 @@ public class UpdateLsrcOptions [JsonProperty("search-terms")] public string searchTerms { get; set; } [JsonProperty("website-addresses")] - public List websiteAddresses { get; set; } + public string websiteAddresses { get; set; } [JsonProperty("website-address")] public string websiteAddress { get; set; } [JsonProperty("website-address-2")] diff --git a/BrightLocal/src/BrightLocal/examples/lscuExamples.cs b/BrightLocal/src/BrightLocal/examples/lscuExamples.cs index 7b9d565..3bdb736 100644 --- a/BrightLocal/src/BrightLocal/examples/lscuExamples.cs +++ b/BrightLocal/src/BrightLocal/examples/lscuExamples.cs @@ -26,7 +26,7 @@ public static IRestResponse addReport() parameters.Add("country", "USA"); parameters.Add("business-category", "Restaurant"); parameters.Add("primary-business-location", "NY, New York"); - parameters.Add("search-terms", JsonConvert.SerializeObject("['restaurant manhattan', 'cafe new york']")); + parameters.Add("search_terms", JsonConvert.SerializeObject("['restaurant manhattan', 'cafe new york']")); var success = request.Post("v4/lscu", parameters); @@ -44,7 +44,7 @@ public static IRestResponse updateReport() parameters.Add("country", "USA"); parameters.Add("business-category", "Restaurant"); parameters.Add("primary-business-location", "NY, New York"); - parameters.Add("search-terms", JsonConvert.SerializeObject("['restaurant manhattan', 'cafe new york']")); + parameters.Add("search_terms", JsonConvert.SerializeObject("['restaurant manhattan', 'cafe new york']")); var success = request.Put("v4/lscu", parameters); diff --git a/BrightLocal/src/BrightLocal/examples/lsrcExamples.cs b/BrightLocal/src/BrightLocal/examples/lsrcExamples.cs index ffa158d..f8ea93f 100644 --- a/BrightLocal/src/BrightLocal/examples/lsrcExamples.cs +++ b/BrightLocal/src/BrightLocal/examples/lsrcExamples.cs @@ -1,4 +1,5 @@ -using RestSharp; +using Newtonsoft.Json; +using RestSharp; using System; using System.Collections.Generic; using System.Linq; @@ -16,7 +17,7 @@ public static IRestResponse addReport() parameters.Add("name", "Le Bernardin"); parameters.Add("schedule", "Adhoc"); parameters.Add("search-terms", "Restaurant\nfood+nyc\ndelivery+midtown+manhattan"); - parameters.Add("website-addresses", "['le-bernardin.com', 'le-bernardin2.com']"); + parameters.Add("website-addresses", JsonConvert.SerializeObject("['le-bernardin.com', 'le-bernardin2.com']")); parameters.Add("search-engines", "google, google-mobile, google-local, yahoo, yahoo-local, bing, bing-local"); var success = request.Post("v2/lsrc/add", parameters); @@ -32,7 +33,7 @@ public static IRestResponse updateReport() parameters.Add("name", "Le Bernardin"); parameters.Add("schedule", "Adhoc"); parameters.Add("search-terms", "Restaurant\nfood+nyc\ndelivery+midtown+manhattan"); - parameters.Add("website-addresses", "['le-bernardin.com', 'le-bernardin2.com']"); + parameters.Add("website-addresses", JsonConvert.SerializeObject("['le-bernardin.com', 'le-bernardin2.com']")); parameters.Add("search-engines", "google, google-mobile, google-local, yahoo, yahoo-local, bing, bing-local"); var success = request.Post("v2/lsrc/add", parameters); diff --git a/README.md b/README.md index 7ede864..32efafe 100644 --- a/README.md +++ b/README.md @@ -192,7 +192,7 @@ Local Search Rank Checker ```csharp var myLsrc = new LsrcOptions(); myLsrc.name = "Le Bernardin"; - myLsrc.websiteAddresses = new List() {"le-bernardin.com", "www.le-bernadin.com"}; + myLsrc.websiteAddresses = JsonConvert.SerializeObject(new List() {"le-bernardin.com", "www.le-bernadin.com"}); myLsrc.searchTerms = "Restaurant, food+nyc, delivery+midtown+manhattan"; myLsrc.schedule = "Adhoc"; myLsrc.searchEngines = "google, google-mobile, google-local, yahoo, yahoo-local, bing, bing-local"; @@ -210,7 +210,7 @@ The returned BrightLocalSuccess entity above will have a campaign-id. You will w var myLsrc = new UpdateLsrcOptions(); myLsrc.campaignId = 1; myLsrc.name = "Le Bernardin"; - myLsrc.websiteAddresses = new List() { "le-bernardin.com", "www.le-bernadin.com" }; + myLsrc.websiteAddresses = JsonConvert.SerializeObject(new List() { "le-bernardin.com", "www.le-bernadin.com" }); myLsrc.searchTerms = "Restaurant, food+nyc, delivery+midtown+manhattan"; myLsrc.schedule = "Adhoc"; myLsrc.searchEngines = "google, google-mobile, google-local, yahoo, yahoo-local, bing, bing-local"; From ca10a9426203aabe86e3014311a0a0d70cd25800 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Mon, 30 Jan 2017 14:01:23 -0700 Subject: [PATCH 82/93] changed url to new logo image --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 32efafe..bc8b8eb 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![BrightLocal](https://github.com/BrightLocal/C-Sharp-Api-Wrapper/blob/master/Documentation/logo.png) +![BrightLocal](https://github.com/BrightLocal/C-Sharp-Api-Wrapper/blob/master/Documentation/logo1.png) **BrightLocal API Wrapper Version 2.0** From f768f1526c61ea5243c517fc36831b676d98da23 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Tue, 7 Feb 2017 14:43:59 -0700 Subject: [PATCH 83/93] added BatchRequestor Class --- .../BrightLocalBatchRequestor.cs | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 BrightLocal/src/BrightLocal/Infrastructure/BrightLocalBatchRequestor.cs diff --git a/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalBatchRequestor.cs b/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalBatchRequestor.cs new file mode 100644 index 0000000..c1bd09c --- /dev/null +++ b/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalBatchRequestor.cs @@ -0,0 +1,115 @@ +using Newtonsoft.Json; +using RestSharp; +using System; +using System.Collections.Generic; +using System.Dynamic; +using System.Linq; +using System.Threading.Tasks; + +namespace BrightLocal +{ + public class BrightLocalBatchRequestor + { + private static readonly System.Uri baseUrl = new System.Uri(Urls.BaseUrl); + private static readonly string url = "/v4/batch"; + // create an instance of restsharp client + RestClient client = new RestClient(); + + public int Create(string apiKey) + { + Method method = Method.POST; + var parameters = new Parameters.requestParameters(); + var response = this.Call(method, apiKey, parameters); + dynamic obj = JsonConvert.DeserializeObject(response.Content); + if (obj.success != "true") + { + const string message = "Error creating Batch "; + var batchException = new ApplicationException(message + obj.errors, obj.ErrorException); + throw batchException; + } + return obj["batch-id"]; + } + + public IRestResponse Commit(int batchId, string apiKey) + { + Method method = Method.PUT; + var parameters = new Parameters.requestParameters(); + parameters.Add("batch-id", batchId); + var request = this.Call(method, apiKey, parameters); + + return request; + } + + public IRestResponse GetResults(int batchId, string apiKey) + { + Method method = Method.GET; + var parameters = new Parameters.requestParameters(); + parameters.Add("batch-id", batchId); + var results = this.Call(method, apiKey, parameters); + + return results; + } + + public IRestResponse Call(Method method, string apiKey, Parameters.requestParameters apiParameters) + { + apiKey = apiKey ?? BrightLocalConfiguration.GetApiKey(); + + // create sxpires variable + + // set base url + client.BaseUrl = baseUrl; + // Generate encoded signature + + // Generate the request + var request = GetApiRequest(method, apiKey, apiParameters); + // execure the request + var response = client.Execute(request); + // check for a succesful response from server + if (response.ResponseStatus == ResponseStatus.Completed) + { + dynamic result = JsonConvert.DeserializeObject(response.Content); + if (result.success == "false") + { + string message = "Error: "; + var batchException = new ApplicationException(message + result.errors, result.ErrorException); + throw batchException; + } + return response; + } + else + { + throw new ApplicationException(response.ErrorMessage); + } + + } + + private static RestRequest GetApiRequest(Method method, string api_key, Parameters.requestParameters apiParameters) + { + // Create a new restsharp request + RestRequest request = new RestRequest(url, method); + // Add appropriate headers to request + request.AddHeader("Content-Type", "application/json"); + request.AddHeader("Accept", "application/json"); + + // Add key, sig and expires to request + request.AddParameter("api-key", api_key); + // Loop through the parameters passed in as a dictionary and add each one to a dynamic object + var eo = new ExpandoObject(); + var eoColl = (ICollection>)eo; + foreach (var kvp in apiParameters) + { + eoColl.Add(kvp); + } + dynamic eoDynamic = eo; + + // Add each parameter to restsharp request + foreach (var prop in eoDynamic) + { + request.AddParameter(prop.Key, prop.Value); + } + + return request; + + } + } +} From 08cc6ebdca20947c6df95d094718ad38f41ed3d6 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Tue, 7 Feb 2017 14:44:49 -0700 Subject: [PATCH 84/93] added batch ranking service and options entity --- .../src/BrightLocal/Infrastructure/Urls.cs | 2 + .../BatchRankings/BatchRankingsService.cs | 50 +++++++++++++++++++ .../BatchRankings/RankingsSearchOptions.cs | 46 +++++++++++++++++ 3 files changed, 98 insertions(+) create mode 100644 BrightLocal/src/BrightLocal/Services/BatchRankings/BatchRankingsService.cs create mode 100644 BrightLocal/src/BrightLocal/Services/BatchRankings/RankingsSearchOptions.cs diff --git a/BrightLocal/src/BrightLocal/Infrastructure/Urls.cs b/BrightLocal/src/BrightLocal/Infrastructure/Urls.cs index d149f6e..0851559 100644 --- a/BrightLocal/src/BrightLocal/Infrastructure/Urls.cs +++ b/BrightLocal/src/BrightLocal/Infrastructure/Urls.cs @@ -16,5 +16,7 @@ internal static class Urls internal static string CitationBurst => "/v2/cb/"; internal static string ReviewFlow => "/v4/rf/"; internal static string Gpw => "/v4/gpw/"; + + internal static string Rankings => "/v4/rankings/"; } } diff --git a/BrightLocal/src/BrightLocal/Services/BatchRankings/BatchRankingsService.cs b/BrightLocal/src/BrightLocal/Services/BatchRankings/BatchRankingsService.cs new file mode 100644 index 0000000..6f97a4d --- /dev/null +++ b/BrightLocal/src/BrightLocal/Services/BatchRankings/BatchRankingsService.cs @@ -0,0 +1,50 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace BrightLocal +{ + public class BatchRankingsService : BrightLocalService + { + public BatchRankingsService(string apiKey = null, string apiSecret = null) : base(apiKey, apiSecret) { } + + BrightLocalBatchRequestor batchRequest = new BrightLocalBatchRequestor(); + + BrightLocalRequestor request = new BrightLocalRequestor(); + public virtual BrightLocalBatchSuccess Search(RankingsSearchOptions searchOptions) + { + BrightLocalBatchSuccess ids = new BrightLocalBatchSuccess(); + var batchId = batchRequest.Create(this.api_key); + var url = string.Format(Urls.Rankings + "{0}", "search"); + foreach(var search in searchOptions.searches) + { + var parameters = Parameters.convertListToParameters(search); + parameters.Add("batch-id", batchId); + var success = request.Post(url, parameters, this.api_key, this.api_secret); + dynamic job = JsonConvert.DeserializeObject(success.Content); + ids.jobids.Add("Job-Id", job["job-id"]); + } + + var commit = batchRequest.Commit(batchId, this.api_key); + dynamic obj = JsonConvert.DeserializeObject(commit.Content); + if(obj.success == true) + { + ids.jobids.Add("success", true); + ids.batchId = batchId; + } + else + { + throw new ApplicationException(obj); + } + return ids; + } + + public virtual BrightLocalSuccess GetSearchResults(int batchId) + { + var results = batchRequest.GetResults(batchId, this.api_key); + return JsonConvert.DeserializeObject(results.Content); + } + } +} diff --git a/BrightLocal/src/BrightLocal/Services/BatchRankings/RankingsSearchOptions.cs b/BrightLocal/src/BrightLocal/Services/BatchRankings/RankingsSearchOptions.cs new file mode 100644 index 0000000..bca16c6 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Services/BatchRankings/RankingsSearchOptions.cs @@ -0,0 +1,46 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace BrightLocal +{ + public class RankingsSearchOptions + { + public RankingsSearchOptions() + { + searches = new List(); + } + + public List searches { get; set; } + } + public class SearchOptions + { + + [JsonProperty("search-engine")] + public string searchEngine {get;set;} + [JsonProperty("country")] + public string country { get; set; } + [JsonProperty("google-location")] + public string googleLocation { get; set; } + [JsonProperty("bing-location")] + public string bingLocation { get; set; } + [JsonProperty("search-term")] + public string searchTerm { get; set; } + public string urls { get; set; } + [JsonProperty("business-names")] + public string businessNames { get; set; } + [JsonProperty("postcode")] + public string postcode { get; set; } + [JsonProperty("telephone")] + public string telephone { get; set; } + [JsonProperty("include-secondary-matches")] + public string includeSecondaryMatches { get; set; } + [JsonProperty("listings")] + public string listings { get; set; } + [JsonProperty("screenshots")] + public string screenshots { get; set; } + + } +} From 4fd3e312d1f831228c85ff1790a66803aa129cd2 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Tue, 7 Feb 2017 14:45:17 -0700 Subject: [PATCH 85/93] added entity for Succesful Batch commit --- .../Entities/BrightLocalBatchSuccess.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 BrightLocal/src/BrightLocal/Entities/BrightLocalBatchSuccess.cs diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalBatchSuccess.cs b/BrightLocal/src/BrightLocal/Entities/BrightLocalBatchSuccess.cs new file mode 100644 index 0000000..2d24210 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Entities/BrightLocalBatchSuccess.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace BrightLocal +{ + public class BrightLocalBatchSuccess + { + public int batchId { get; set; } + public JobIds jobids { get; set; } + } + + public class JobIds : Dictionary + { + + } +} From 16978448f9bd83341dc6eeb03cf1688437bf59c3 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Tue, 7 Feb 2017 14:45:35 -0700 Subject: [PATCH 86/93] added example for batch rankings search --- .../Batch-Methods/rankingsExamples.cs | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 BrightLocal/src/BrightLocal/Examples-version2/Batch-Methods/rankingsExamples.cs diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Batch-Methods/rankingsExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Batch-Methods/rankingsExamples.cs new file mode 100644 index 0000000..5bf4637 --- /dev/null +++ b/BrightLocal/src/BrightLocal/Examples-version2/Batch-Methods/rankingsExamples.cs @@ -0,0 +1,59 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace BrightLocal.Examples_version2.Batch_Methods +{ + public class rankingsExamples + { + public static BrightLocalSuccess Create() + { + RankingsSearchOptions searchOptions = new RankingsSearchOptions(); + searchOptions.searches.Add(new SearchOptions() + { + searchEngine = "google", + country = "USA", + googleLocation = "New York, NY", + searchTerm = "restaurant new york", + urls = JsonConvert.SerializeObject(new List() { "le-bernardin.com" }), + businessNames = JsonConvert.SerializeObject(new List { "Le Bernardin" }) + }); + searchOptions.searches.Add(new SearchOptions() + { + searchEngine = "yahoo", + country = "USA", + googleLocation = "New York, NY", + searchTerm = "restaurant new york", + urls = JsonConvert.SerializeObject(new List() { "le-bernardin.com" }), + businessNames = JsonConvert.SerializeObject(new List { "Le Bernardin" }) + }); + + var batchRankingService = new BatchRankingsService(); + BrightLocalBatchSuccess newBatchRankings = batchRankingService.Search(searchOptions); + + var rankingsResults = batchRankingService.GetSearchResults(newBatchRankings.batchId); + + //if (rankingsResults.success) + //{ + // while (rankingResults.status != "Stopped" || rankingResults.status != "Finished") + // { + // Thread.Sleep(10000); + + // rankingsResults = batchRankingService.GetSearchResults(newBatchRankings.batchId); + // } + // return rankingsResults; + //} + //else + //{ + // const string message = "Error Retrieving batch results "; + // var batchException = new ApplicationException(message + rankingResults.errors, results.ErrorException); + // throw batchException; + //} + + return rankingsResults; + } + } +} From b050691d8b3790aed214972b3545e7f1f3a150ba Mon Sep 17 00:00:00 2001 From: Ed Eliot Date: Thu, 9 Feb 2017 15:35:01 +0000 Subject: [PATCH 87/93] Tweaked text. --- README.md | 165 ++++++++++++++++++++++++++---------------------------- 1 file changed, 80 insertions(+), 85 deletions(-) diff --git a/README.md b/README.md index bc8b8eb..cf8448e 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,29 @@ -![BrightLocal](https://github.com/BrightLocal/C-Sharp-Api-Wrapper/blob/master/Documentation/logo1.png) - - **BrightLocal API Wrapper Version 2.0** For version 1.0 [Click Here](Documentation/README.md) **BrightLocal API Services** -[Clients](#clients) -[Locations](#locations) -[Local Search Rank Checker](#local-search-rank-checker) -[Local SEO Check-up](#local-seo-check-up) -[Citation Tracker](#citation-tracker) -[Citation Burst](#citation-burst) -[ReviewFlow Reports](#reviewflow-reports) -[Google+ Local Wizard Reports](#google-plus-local-wizard-reports) +* [Clients](#clients) +* [Locations](#locations) +* [Local Search Rank Checker](#local-search-rank-checker) +* [Local SEO Check-up](#local-seo-check-up) +* [Citation Tracker](#citation-tracker) +* [Citation Burst](#citation-burst) +* [ReviewFlow Reports](#reviewflow-reports) +* [Google+ Local Wizard Reports](#google-plus-local-wizard-reports) Quick Start ----------- -It is recommended that you install BrightLocal via NuGet ` nuget Install-Package BrightLocal`. | https://www.nuget.org/packages/BrightLocal/1.0.0/ +We recommend that you install BrightLocal via NuGet ` nuget Install-Package BrightLocal` (https://www.nuget.org/packages/BrightLocal/1.0.0/). ```csharp nuget Install-Package BrightLocal ``` -Next you will need to provide BrightLocal with your api key & api secret. There are currently 2 ways to do this: +Next you will need to provide BrightLocal with your API key & API secret. There are currently three ways to do this: -a) Add an AppSetting with your api key to your config (this is the easiest way and will work throughout the app on every request) +1) Add an AppSetting with your API key to your config (this is the easiest way and will work throughout the app on every request) ```xml @@ -37,13 +34,13 @@ a) Add an AppSetting with your api key to your config (this is the easiest way a ``` -b) In your application initialization, call this method (this is a programmatic way, but you only have to do it once during startup) +2) In your application initialization, call this method (this is a programmatic way, but you only have to do it once during startup) ```csharp - BrightLocalConfiguration.SetApiCredentials("[your api key here]", "[your api secret here]"); + BrightLocalConfiguration.SetApiCredentials("[your API key here]", "[your api secret here]"); ``` -c) In any of the service constructors, you can optionally pass the api key & api secret (will be assigned that apikey for the life of the service instance). +3) In any of the service constructors, you can optionally pass the API key & API secret (will be assigned that apikey for the life of the service instance). ```csharp var clientService = new ClientService("[your api key here]", "[your api secret here]"); @@ -52,7 +49,7 @@ c) In any of the service constructors, you can optionally pass the api key & api Clients ----- -### Adding a client +### Add Client ```csharp var myClient = new ClientOptions(); @@ -65,10 +62,9 @@ Clients BrightLocalSuccess newClient = clientService.Create(myClient); ``` -The returned BrightLocalSuccess entity above will have a client-id. You will want to persist this for later. When you create a location you will be able to assign it -to a client id (or not). +The returned BrightLocalSuccess entity above will have a client-id. You will want to persist this for later. When you create a location you will be able to optionally assign it to a client ID. -### Updating a client +### Update Client ```csharp var myClient = new UpdateClientOptions(); @@ -82,7 +78,7 @@ to a client id (or not). BrightLocalSuccess updateClient = clientService.Update(myClient); ``` -### Deleting a client +### Delete Client ```csharp var clientId = 1; @@ -91,7 +87,7 @@ to a client id (or not). BrightLocalSuccess deleteClient = clientService.Delete(clientId); ``` -### Getting a client +### Get Client ```csharp var clientId = 1; @@ -100,7 +96,7 @@ to a client id (or not). BrightLocalClient client = clientService.Get(clientId); ``` -### Searching for a client +### Search Clients ```csharp var searchQuery = "le-bernardin"; @@ -113,7 +109,7 @@ to a client id (or not). Locations ----- -### Adding a location +### Add Location ```csharp var myLocation = new LocationOptions(); @@ -133,10 +129,9 @@ Locations var BrightLocalSuccess = locationService.Create(myLocation); ``` -The returned BrightLocalSuccess entity above will have a location-id. You will want to persist this for later. When you create a report you will be able to assign it -to a location id (or not). +The returned BrightLocalSuccess entity above will have a location-id. You will want to persist this for later. When you create a report you will be able to optionally assign it to a location id. -### Updating a location +### Update Location ```csharp var myLocation = new UpdateLocationOptions(); @@ -157,7 +152,7 @@ to a location id (or not). BrightLocalSuccess updateLocation = locationService.Update(myLocation); ``` -### Deleting a location +### Delete Location ```csharp var locationId = 1; @@ -166,7 +161,7 @@ to a location id (or not). BrightLocalSuccess deleteLocation = locationService.Delete(locationId); ``` -### Getting a location +### Get Location ```csharp var locationId = 1; @@ -175,7 +170,7 @@ to a location id (or not). BrightLocalLocation getLocation = locationService.Get(locationId); ``` -### Searching for a location +### Search Locations ```csharp var searchQuery = "le-bernardin"; @@ -187,7 +182,7 @@ to a location id (or not). Local Search Rank Checker ----- -### Adding a report +### Add Report ```csharp var myLsrc = new LsrcOptions(); @@ -202,9 +197,9 @@ Local Search Rank Checker BrightLocalSuccess newLsrc = lsrcService.Create(myLsrc); ``` -The returned BrightLocalSuccess entity above will have a campaign-id. You will want to persist this for later in order to run and get the report. +The returned BrightLocalSuccess entity above will have a campaign-id. You will want to persist this for later in order to run and fetch the report. -### Updating a report +### Update Report ```csharp var myLsrc = new UpdateLsrcOptions(); @@ -220,7 +215,7 @@ The returned BrightLocalSuccess entity above will have a campaign-id. You will w BrightLocalSuccess updatedLsrc = lsrcService.Update(myLsrc); ``` -### Deleting a report +### Delete Report ```csharp var campaignId = 1; @@ -229,7 +224,7 @@ The returned BrightLocalSuccess entity above will have a campaign-id. You will w BrightLoBrightLocalSuccesscalLsrc deletedLsrc = lsrcService.Delete(campaignId); ``` -### Getting all reports +### Get Reports ```csharp var lsrcService = new LsrcService(); @@ -237,7 +232,7 @@ The returned BrightLocalSuccess entity above will have a campaign-id. You will w BrightLocalGetAllResults lsrcList = lsrcService.GetAll();; ``` -### Getting a report +### Get Report ```csharp var campaignId = 1; @@ -246,7 +241,7 @@ The returned BrightLocalSuccess entity above will have a campaign-id. You will w BrightLocalLsrcReport myLsrc = lsrcService.Get(campaignId); ``` -### Running a report +### Run Report ```csharp var campaignId = 1; @@ -255,7 +250,7 @@ The returned BrightLocalSuccess entity above will have a campaign-id. You will w BrightLocalLsrc myLsrc = lsrcService.Run(campaignId); ``` -### Get report history +### Get Report History ```csharp var campaignId = 1; @@ -264,7 +259,7 @@ The returned BrightLocalSuccess entity above will have a campaign-id. You will w BrightLocalLsrcHistory lsrcHistory = lsrcService.GetHistory(campaignId); ``` -### Get report results +### Get Report Results ```csharp var myLsrc = new GetResultsLsrcOptions(); @@ -279,7 +274,7 @@ The returned BrightLocalSuccess entity above will have a campaign-id. You will w Local SEO Check-up ----- -### Adding a report +### Add Report ```csharp LscuOptions myLscu = new LscuOptions(); @@ -324,7 +319,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan }); ``` -### Updating a report +### Update Report ```csharp UpdateLscuOptions myLscu = new UpdateLscuOptions(); @@ -348,7 +343,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan BrightLocalSuccess updateLscu = lscuService.Update(myLscu); ``` -### Getting a report +### Get Report ```csharp var reportId = 1; @@ -357,7 +352,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan BrightLocalLscuReport lscuReport = lscuService.Get(reportId); ``` -### Running a report +### Run Report ```csharp var reportId = 1; @@ -367,7 +362,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan ``` The returned success entity above is of type string. Success or Failure with errors. -### Deleting a report +### Delete Report ```csharp var reportId = 1; @@ -377,7 +372,7 @@ The returned success entity above is of type string. Success or Failure with err ``` The returned success entity above is of type string. Success or Failure with errors. -### Searching for a report +### Search Reports ```csharp var searchQuery = "Bodega Wine Bar"; @@ -389,7 +384,7 @@ The returned success entity above is of type string. Success or Failure with err Citation Tracker ----- -### Adding a report +### Add Report ```csharp CitationTrackerOptions myCt = new CitationTrackerOptions(); @@ -408,7 +403,7 @@ Citation Tracker ``` The returned BrightLocalSuccess entity above will have a report-id. You will want to persist this for later in order to run and get the report. -### Updating a report +### Update Report ```csharp UpdateCitationTrackerOptions myCt = new UpdateCitationTrackerOptions(); @@ -427,7 +422,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan BrightLocalSuccess updateCt = citationTrackerService.Update(myCt); ``` -### Getting a report +### Get Report ```csharp int reportId = 682; @@ -437,7 +432,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan BrightLocalCitationTrackerReport myCt = citationTrackerService.Get(reportId); ``` -### Running a report +### Run Report ```csharp int reportId = 682; @@ -447,7 +442,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan BrightLocalSuccess myCt = citationTrackerService.Run(reportId); ``` -### Deleting a report +### Delete Report ```csharp int reportId = 682; @@ -457,7 +452,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan BrightLocalSuccess myCt = citationTrackerService.Delete(reportId); ``` -### Getting all reports +### Get Reports ```csharp var citationTrackerService = new CitationTrackerService(); @@ -465,7 +460,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan BrightLocalCtGetAllResults ctResults = citationTrackerService.GetAll(); ``` -### Getting report results +### Get Report Results ```csharp var reportId = 1; @@ -477,11 +472,11 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan Citation Burst ----- -### Creating a campaign +### Create Campaign ```csharp - string brief_description = "Born in Paris in 1972 by sibling duo Maguy and Gilbert Le Coze, Le Bernardin only served fish: Fresh, simple and prepared with respect. After receiving its first Michelin star in 1976, and two more in 1980, the Le Cozes set to open Le Bernardin in New York in 1986."; - string full_description = "The restaurant has held three stars from the Michelin Guide since its 2005 New York launch and currently ranks 24 on the Worlds 50 Best Restaurants list. The New York Zagat Guide has recognized Le Bernardin as top rated in the category of Best Food for the last nine consecutive years, and in 2015 was rated by the guide as New York Citys top restaurant for food and service. Le Bernardin has earned seven James Beard Awards since 1998 including Outstanding Restaurant of the Year, Top Chef in New York City, Outstanding Service, Outstanding Chef in the United States, Outstanding Pastry Chef, Outstanding Wine Service, and Best Restaurant Design in 2012. Most recently, the Foundation named Maguy Le Coze as Outstanding."; + string brief_description = "Born in Paris in 1972 by sibling duo Maguy and Gilbert Le Coze, Le Bernardin only served fish: Fresh, simple and prepared with respect. After receiving its first Michelin star in 1976, and two more in 1980, the Le Coze’s set to open Le Bernardin in New York in 1986."; + string full_description = "The restaurant has held three stars from the Michelin Guide since its 2005 New York launch and currently ranks 24 on the World’s 50 Best Restaurants list. The New York Zagat Guide has recognized Le Bernardin as top rated in the category of “Best Food” for the last nine consecutive years, and in 2015 was rated by the guide as New York City’s top restaurant for food and service. Le Bernardin has earned seven James Beard Awards since 1998 including “Outstanding Restaurant of the Year,” “Top Chef in New York City,” “Outstanding Service,” “Outstanding Chef in the United States,” “Outstanding Pastry Chef,” “Outstanding Wine Service,” and “Best Restaurant Design” in 2012. Most recently, the Foundation named Maguy Le Coze as Outstanding."; CitationBurstOptions myCb = new CitationBurstOptions(); myCb.businessName = "Le Bernardin"; @@ -525,11 +520,11 @@ Citation Burst ``` The returned BrightLocalSuccess entity above will have a campaign-id. You will want to persist this for later in order to get citations, confirm & pay, etc. -### Updating a campaign +### Update Campaign ```csharp - string brief_description = "Born in Paris in 1972 by sibling duo Maguy and Gilbert Le Coze, Le Bernardin only served fish: Fresh, simple and prepared with respect. After receiving its first Michelin star in 1976, and two more in 1980, the Le Cozes set to open Le Bernardin in New York in 1986."; - string full_description = "The restaurant has held three stars from the Michelin Guide since its 2005 New York launch and currently ranks 24 on the Worlds 50 Best Restaurants list. The New York Zagat Guide has recognized Le Bernardin as top rated in the category of Best Food for the last nine consecutive years, and in 2015 was rated by the guide as New York Citys top restaurant for food and service. Le Bernardin has earned seven James Beard Awards since 1998 including Outstanding Restaurant of the Year, Top Chef in New York City, Outstanding Service, Outstanding Chef in the United States, Outstanding Pastry Chef, Outstanding Wine Service, and Best Restaurant Design in 2012. Most recently, the Foundation named Maguy Le Coze as Outstanding."; + string brief_description = "Born in Paris in 1972 by sibling duo Maguy and Gilbert Le Coze, Le Bernardin only served fish: Fresh, simple and prepared with respect. After receiving its first Michelin star in 1976, and two more in 1980, the Le Coze’s set to open Le Bernardin in New York in 1986."; + string full_description = "The restaurant has held three stars from the Michelin Guide since its 2005 New York launch and currently ranks 24 on the World’s 50 Best Restaurants list. The New York Zagat Guide has recognized Le Bernardin as top rated in the category of “Best Food” for the last nine consecutive years, and in 2015 was rated by the guide as New York City’s top restaurant for food and service. Le Bernardin has earned seven James Beard Awards since 1998 including “Outstanding Restaurant of the Year,” “Top Chef in New York City,” “Outstanding Service,” “Outstanding Chef in the United States,” “Outstanding Pastry Chef,” “Outstanding Wine Service,” and “Best Restaurant Design” in 2012. Most recently, the Foundation named Maguy Le Coze as Outstanding."; UpdateCitationBurstOptions myCb = new UpdateCitationBurstOptions(); myCb.campaignId = 1; @@ -573,7 +568,7 @@ The returned BrightLocalSuccess entity above will have a campaign-id. You will w BrightLocalSuccess newCb = citationBurstService.Update(myCb); ``` -### Uploading an image +### Upload Image ```csharp CbUploadImage image = new CbUploadImage(); @@ -586,7 +581,7 @@ The returned BrightLocalSuccess entity above will have a campaign-id. You will w BrightLocalSuccess cbImage = citationBurstService.UploadImage(image); ``` -### Getting citations +### Get Citations ```csharp int campaingId = 1; @@ -595,7 +590,7 @@ The returned BrightLocalSuccess entity above will have a campaign-id. You will w BrightLocalCitations citations = citationBurstService.GetCitations(campaingId); ``` -### Confirm & Pay for citation Campaign +### Confirm & Pay for Citation Campaign ```csharp BrightLocalCbPayOptions confirmPay = new BrightLocalCbPayOptions(); @@ -607,7 +602,7 @@ The returned BrightLocalSuccess entity above will have a campaign-id. You will w BrightLocalSuccess confirm = citationBurstService.ConfirmAndPay(confirmPay); ``` -### Getting all campaigns +### Getting All Campaigns ```csharp var citationBurstService = new CitationBurstService(); @@ -615,7 +610,7 @@ The returned BrightLocalSuccess entity above will have a campaign-id. You will w BrightLocalCbAllCampaigns results = citationBurstService.GetCampaigns(); ``` -### Getting campaign details +### Get Campaign Details ```csharp int campaignId = 1; @@ -624,7 +619,7 @@ The returned BrightLocalSuccess entity above will have a campaign-id. You will w BrightLocalCbCampaign results = citationBurstService.GetCampaign(campaignId); ``` -### Getting credits balance +### Get Credits Balance ```csharp var citationBurstService = new CitationBurstService(); @@ -635,7 +630,7 @@ The returned BrightLocalSuccess entity above will have a campaign-id. You will w ReviewFLow Reports ----- -### Adding a report +### Add Report ```csharp var myReviewReport = new ReviewFlowOptions(); @@ -672,7 +667,7 @@ ReviewFLow Reports The returned BrightLocalSuccess entity above will have a report-id. You will want to persist this for later when you get a report. -### Updating a report +### Update Report ```csharp var myReviewReport = new UpdateReviewFlowOptions(); @@ -707,7 +702,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan BrightLocalSuccess updateReviewReport = rfService.Update(myReviewReport); ``` -### Getting a report +### Get Report ```csharp int reportId = 1; @@ -716,7 +711,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan BrightLocalRfReport reviewReport = rfService.Get(reportId); ``` -### Deleting a report +### Delete Report ```csharp int reportId = 1; @@ -725,7 +720,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan BrightLocalSuccess deleteReport = rfService.Delete(reportId); ``` -### Getting all reports +### Get All Reports ```csharp var rfService = new ReviewFlowService(); @@ -733,7 +728,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan BrightLocalRfGetAll results = rfService.GetAll(); ``` -### Searching for a report +### Search Reports ```csharp string query = "New York"; @@ -742,7 +737,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan BrightLocalRfGetAll results = rfService.Search(query); ``` -### Getting Reviews +### Get Reviews ```csharp var myReviewReport = new RfGetReviewsOptions(); @@ -752,7 +747,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan BrightLocalRfReviews reviews = rfService.GetReviews(myReviewReport); ``` -### Getting Reviews Count +### Get Review Counts ```csharp int reportId = 1; @@ -761,7 +756,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan BrightLocalSuccess reviewCount = rfService.GetReviewCount(reportId); ``` -### Getting Growth +### Get Growth ```csharp int reportId = 1; @@ -770,7 +765,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan BrightLocalSuccess reviewGrowth = rfService.GetGrowth(reportId); ``` -### Getting Directories +### Get Directories ```csharp int reportId = 1; @@ -779,7 +774,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan BrightLocalRfDirectories reviewDirectories = rfService.GetDirectories(reportId); ``` -### Getting Directory Stats +### Get Directory Stats ```csharp int reportId = 1; @@ -788,7 +783,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan BrightLocalRfDirectoryStats reviewDirectoryStats = rfService.GetDirectoryStats(reportId); ``` -### Getting Star Counts +### Get Star Counts ```csharp int reportId = 1; @@ -800,7 +795,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan Google Plus Local Wizard Reports ----- -### Adding a report +### Add Report ```csharp var myGpwReport = new GpwOptions(); @@ -824,7 +819,7 @@ Google Plus Local Wizard Reports ``` The returned BrightLocalSuccess entity above will have a report-id. You will want to persist this for later in order to run and get the report. -### Updating a report +### Update Report ```csharp var myGpwReport = new UpdateGpwOptions(); @@ -848,7 +843,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan BrightLocalSuccess gpwReport = gpwService.Update(myGpwReport); ``` -### Getting a report +### Get Report ```csharp var reportId = 1; @@ -857,7 +852,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan BrightLocalGpwReport gpwReport = gpwService.Get(reportId); ``` -### Deleting a report +### Delete Report ```csharp var reportId = 1; @@ -866,7 +861,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan BrightLocalSuccess gpwReport = gpwService.Delete(reportId); ``` -### Getting all reports +### Get All Reports ```csharp var gpwService = new GpwService(); @@ -874,7 +869,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan BrightLocalGpwGetAllResults gpwGetAllResults = gpwService.GetAll(); ``` -### Running a report +### Run Report ```csharp var reportId = 1; @@ -883,11 +878,11 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan BrightLocalSuccess gpwReport = gpwService.Run(reportId); ``` -### Getting report results +### Get Report Results ```csharp var reportId = 1; var gpwService = new GpwService(); BrightLocalGpwReportResults gpwReport = gpwService.GetReportResults(reportId); -``` \ No newline at end of file +``` From 4f58f214a77b7008e976cdc397dca3f4e4485bcf Mon Sep 17 00:00:00 2001 From: Ed Eliot Date: Thu, 9 Feb 2017 15:35:34 +0000 Subject: [PATCH 88/93] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cf8448e..ca02ebe 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ **BrightLocal API Wrapper Version 2.0** -For version 1.0 [Click Here](Documentation/README.md) + +For documentation for version 1.0 [click nere](Documentation/README.md). **BrightLocal API Services** From 917759e54dfb4d31a67277e5dbc0e94a17e4711f Mon Sep 17 00:00:00 2001 From: Ed Eliot Date: Thu, 9 Feb 2017 15:35:46 +0000 Subject: [PATCH 89/93] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ca02ebe..8bc5e67 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ **BrightLocal API Wrapper Version 2.0** -For documentation for version 1.0 [click nere](Documentation/README.md). +For documentation for version 1.0 [click here](Documentation/README.md). **BrightLocal API Services** From c5c32993f8ca527348689bc00bee0883956bde6a Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Thu, 9 Feb 2017 12:53:49 -0700 Subject: [PATCH 90/93] changed naming convention from BrightLocal to Bl --- .../BrightLocal/Entities/BlBatchRankings.cs | 27 ++++++++++++++ ...LocalBatchSuccess.cs => BlBatchSuccess.cs} | 2 +- ...lCbAllCampaigns.cs => BlCbAllCampaigns.cs} | 2 +- ...ightLocalCbCampaign.cs => BlCbCampaign.cs} | 2 +- ...BrightLocalCitations.cs => BlCitations.cs} | 2 +- .../{BrightLocalSuccess.cs => BlSuccess.cs} | 2 +- .../Account-Methods/citationBurstExamples.cs | 32 ++++++++--------- .../citationTrackerExamples.cs | 16 ++++----- .../Account-Methods/clientExamples.cs | 12 +++---- .../Account-Methods/gpwExamples.cs | 16 ++++----- .../Account-Methods/locationExamples.cs | 12 +++---- .../Account-Methods/lscuExamples.cs | 12 +++---- .../Account-Methods/lsrcExamples.cs | 16 ++++----- .../Account-Methods/rFExamples.cs | 20 +++++------ .../Batch-Methods/rankingsExamples.cs | 4 +-- .../BatchRankings/BatchRankingsService.cs | 8 ++--- .../CitationBurst/CitationBurstService.cs | 36 +++++++++---------- .../CitationTracker/CitationTrackerService.cs | 16 ++++----- .../Services/Clients/ClientService.cs | 12 +++---- .../Services/GpwReports/GpwService.cs | 16 ++++----- .../Services/Locations/LocationService.cs | 12 +++---- .../BrightLocal/Services/Lscu/LscuService.cs | 16 ++++----- .../BrightLocal/Services/Lsrc/LsrcService.cs | 16 ++++----- .../Services/ReviewFlow/ReviewFlowService.cs | 20 +++++------ 24 files changed, 178 insertions(+), 151 deletions(-) create mode 100644 BrightLocal/src/BrightLocal/Entities/BlBatchRankings.cs rename BrightLocal/src/BrightLocal/Entities/{BrightLocalBatchSuccess.cs => BlBatchSuccess.cs} (87%) rename BrightLocal/src/BrightLocal/Entities/{BrightLocalCbAllCampaigns.cs => BlCbAllCampaigns.cs} (97%) rename BrightLocal/src/BrightLocal/Entities/{BrightLocalCbCampaign.cs => BlCbCampaign.cs} (99%) rename BrightLocal/src/BrightLocal/Entities/{BrightLocalCitations.cs => BlCitations.cs} (97%) rename BrightLocal/src/BrightLocal/Entities/{BrightLocalSuccess.cs => BlSuccess.cs} (68%) diff --git a/BrightLocal/src/BrightLocal/Entities/BlBatchRankings.cs b/BrightLocal/src/BrightLocal/Entities/BlBatchRankings.cs new file mode 100644 index 0000000..cf5b9cf --- /dev/null +++ b/BrightLocal/src/BrightLocal/Entities/BlBatchRankings.cs @@ -0,0 +1,27 @@ + +//using System.Collections.Generic; + +//namespace BrightLocal +//{ +// public class BrightLocalBatchRankings +// { +// public bool success { get; set; } +// public RankingsResults results { get; set; } +// public RankingsStatuses statuses { get; set; } +// public string status { get; set; } +// } + +// public class RankingsResults +// { +// public List SearchRankV2Api { get; set; } +// } + +// public class SearchRankV2Api +// { +// public List results { get; set; } +// public Payload payload { get; set; } +// public string status { get; set; } +// public int __invalid_name__job-id { get; set; } +//} + +//} diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalBatchSuccess.cs b/BrightLocal/src/BrightLocal/Entities/BlBatchSuccess.cs similarity index 87% rename from BrightLocal/src/BrightLocal/Entities/BrightLocalBatchSuccess.cs rename to BrightLocal/src/BrightLocal/Entities/BlBatchSuccess.cs index 2d24210..5843b5c 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalBatchSuccess.cs +++ b/BrightLocal/src/BrightLocal/Entities/BlBatchSuccess.cs @@ -5,7 +5,7 @@ namespace BrightLocal { - public class BrightLocalBatchSuccess + public class BlBatchSuccess { public int batchId { get; set; } public JobIds jobids { get; set; } diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalCbAllCampaigns.cs b/BrightLocal/src/BrightLocal/Entities/BlCbAllCampaigns.cs similarity index 97% rename from BrightLocal/src/BrightLocal/Entities/BrightLocalCbAllCampaigns.cs rename to BrightLocal/src/BrightLocal/Entities/BlCbAllCampaigns.cs index da3a450..0f4b9e4 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalCbAllCampaigns.cs +++ b/BrightLocal/src/BrightLocal/Entities/BlCbAllCampaigns.cs @@ -5,7 +5,7 @@ namespace BrightLocal { - public class BrightLocalCbAllCampaigns + public class BlCbAllCampaigns { public CbResponse response { get; set; } } diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalCbCampaign.cs b/BrightLocal/src/BrightLocal/Entities/BlCbCampaign.cs similarity index 99% rename from BrightLocal/src/BrightLocal/Entities/BrightLocalCbCampaign.cs rename to BrightLocal/src/BrightLocal/Entities/BlCbCampaign.cs index d40435d..c396a4b 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalCbCampaign.cs +++ b/BrightLocal/src/BrightLocal/Entities/BlCbCampaign.cs @@ -2,7 +2,7 @@ namespace BrightLocal { - public class BrightLocalCbCampaign + public class BlCbCampaign { public CampaignResponse response { get; set; } } diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalCitations.cs b/BrightLocal/src/BrightLocal/Entities/BlCitations.cs similarity index 97% rename from BrightLocal/src/BrightLocal/Entities/BrightLocalCitations.cs rename to BrightLocal/src/BrightLocal/Entities/BlCitations.cs index 3bd3307..b78b73c 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalCitations.cs +++ b/BrightLocal/src/BrightLocal/Entities/BlCitations.cs @@ -2,7 +2,7 @@ namespace BrightLocal { - public class BrightLocalCitations + public class BlCitations { public bool error { get; set; } public int campaignId { get; set; } diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalSuccess.cs b/BrightLocal/src/BrightLocal/Entities/BlSuccess.cs similarity index 68% rename from BrightLocal/src/BrightLocal/Entities/BrightLocalSuccess.cs rename to BrightLocal/src/BrightLocal/Entities/BlSuccess.cs index cfbbd85..6edc739 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalSuccess.cs +++ b/BrightLocal/src/BrightLocal/Entities/BlSuccess.cs @@ -5,7 +5,7 @@ namespace BrightLocal { - public class BrightLocalSuccess: Dictionary + public class BlSuccess: Dictionary { } diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationBurstExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationBurstExamples.cs index f75d5e9..95aab9c 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationBurstExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationBurstExamples.cs @@ -4,7 +4,7 @@ namespace BrightLocal.Examples_version2.Account_Methods { public class citationBurstExamples { - public static BrightLocalSuccess Create() + public static BlSuccess Create() { string brief_description = "Born in Paris in 1972 by sibling duo Maguy and Gilbert Le Coze, Le Bernardin only served fish: Fresh, simple and prepared with respect. After receiving its first Michelin star in 1976, and two more in 1980, the Le Coze’s set to open Le Bernardin in New York in 1986."; string full_description = "The restaurant has held three stars from the Michelin Guide since its 2005 New York launch and currently ranks 24 on the World’s 50 Best Restaurants list. The New York Zagat Guide has recognized Le Bernardin as top rated in the category of “Best Food” for the last nine consecutive years, and in 2015 was rated by the guide as New York City’s top restaurant for food and service. Le Bernardin has earned seven James Beard Awards since 1998 including “Outstanding Restaurant of the Year,” “Top Chef in New York City,” “Outstanding Service,” “Outstanding Chef in the United States,” “Outstanding Pastry Chef,” “Outstanding Wine Service,” and “Best Restaurant Design” in 2012. Most recently, the Foundation named Maguy Le Coze as Outstanding."; @@ -47,12 +47,12 @@ public static BrightLocalSuccess Create() var citationBurstService = new CitationBurstService(); - BrightLocalSuccess newCb = citationBurstService.Create(myCb); + BlSuccess newCb = citationBurstService.Create(myCb); return newCb; } - public static BrightLocalSuccess Update() + public static BlSuccess Update() { string brief_description = "Born in Paris in 1972 by sibling duo Maguy and Gilbert Le Coze, Le Bernardin only served fish: Fresh, simple and prepared with respect. After receiving its first Michelin star in 1976, and two more in 1980, the Le Coze’s set to open Le Bernardin in New York in 1986."; string full_description = "The restaurant has held three stars from the Michelin Guide since its 2005 New York launch and currently ranks 24 on the World’s 50 Best Restaurants list. The New York Zagat Guide has recognized Le Bernardin as top rated in the category of “Best Food” for the last nine consecutive years, and in 2015 was rated by the guide as New York City’s top restaurant for food and service. Le Bernardin has earned seven James Beard Awards since 1998 including “Outstanding Restaurant of the Year,” “Top Chef in New York City,” “Outstanding Service,” “Outstanding Chef in the United States,” “Outstanding Pastry Chef,” “Outstanding Wine Service,” and “Best Restaurant Design” in 2012. Most recently, the Foundation named Maguy Le Coze as Outstanding."; @@ -96,12 +96,12 @@ public static BrightLocalSuccess Update() var citationBurstService = new CitationBurstService(); - BrightLocalSuccess newCb = citationBurstService.Update(myCb); + BlSuccess newCb = citationBurstService.Update(myCb); return newCb; } - public static BrightLocalSuccess UploadImage() + public static BlSuccess UploadImage() { CbUploadImage image = new CbUploadImage(); image.campaignId = 1; @@ -110,23 +110,23 @@ public static BrightLocalSuccess UploadImage() var citationBurstService = new CitationBurstService(); - BrightLocalSuccess cbImage = citationBurstService.UploadImage(image); + BlSuccess cbImage = citationBurstService.UploadImage(image); return cbImage; } - public static BrightLocalCitations GetCitations() + public static BlCitations GetCitations() { int campaingId = 1; var citationBurstService = new CitationBurstService(); - BrightLocalCitations citations = citationBurstService.GetCitations(campaingId); + BlCitations citations = citationBurstService.GetCitations(campaingId); return citations; } - public static BrightLocalSuccess ConfirmAndPay() + public static BlSuccess ConfirmAndPay() { BrightLocalCbPayOptions confirmPay = new BrightLocalCbPayOptions(); confirmPay.campaign_id = 1; @@ -134,35 +134,35 @@ public static BrightLocalSuccess ConfirmAndPay() var citationBurstService = new CitationBurstService(); - BrightLocalSuccess confirm = citationBurstService.ConfirmAndPay(confirmPay); + BlSuccess confirm = citationBurstService.ConfirmAndPay(confirmPay); return confirm; } - public static BrightLocalCbAllCampaigns GetAll() + public static BlCbAllCampaigns GetAll() { var citationBurstService = new CitationBurstService(); - BrightLocalCbAllCampaigns results = citationBurstService.GetCampaigns(); + BlCbAllCampaigns results = citationBurstService.GetCampaigns(); return results; } - public static BrightLocalCbCampaign GetCampaign() + public static BlCbCampaign GetCampaign() { int campaignId = 1; var citationBurstService = new CitationBurstService(); - BrightLocalCbCampaign results = citationBurstService.GetCampaign(campaignId); + BlCbCampaign results = citationBurstService.GetCampaign(campaignId); return results; } - public static BrightLocalSuccess GetCredits() + public static BlSuccess GetCredits() { var citationBurstService = new CitationBurstService(); - BrightLocalSuccess credits = citationBurstService.GetCredits(); + BlSuccess credits = citationBurstService.GetCredits(); return credits; } diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationTrackerExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationTrackerExamples.cs index 57681d9..e54a4d4 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationTrackerExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationTrackerExamples.cs @@ -2,7 +2,7 @@ { public class citationTrackerExamples { - public static BrightLocalSuccess Create() + public static BlSuccess Create() { CitationTrackerOptions myCt = new CitationTrackerOptions(); myCt.reportName = "Sample Citation Tracker Report"; @@ -16,12 +16,12 @@ public static BrightLocalSuccess Create() var citationTrackerService = new CitationTrackerService(); - BrightLocalSuccess newCt = citationTrackerService.Create(myCt); + BlSuccess newCt = citationTrackerService.Create(myCt); return newCt; } - public static BrightLocalSuccess Update() + public static BlSuccess Update() { UpdateCitationTrackerOptions myCt = new UpdateCitationTrackerOptions(); myCt.reportId = 682; @@ -36,7 +36,7 @@ public static BrightLocalSuccess Update() var citationTrackerService = new CitationTrackerService(); - BrightLocalSuccess updateCt = citationTrackerService.Update(myCt); + BlSuccess updateCt = citationTrackerService.Update(myCt); return updateCt; } @@ -52,24 +52,24 @@ public static BrightLocalCitationTrackerReport Get() return myCt; } - public static BrightLocalSuccess Run() + public static BlSuccess Run() { int reportId = 682; var citationTrackerService = new CitationTrackerService(); - BrightLocalSuccess myCt = citationTrackerService.Run(reportId); + BlSuccess myCt = citationTrackerService.Run(reportId); return myCt; } - public static BrightLocalSuccess Delete() + public static BlSuccess Delete() { int reportId = 682; var citationTrackerService = new CitationTrackerService(); - BrightLocalSuccess myCt = citationTrackerService.Delete(reportId); + BlSuccess myCt = citationTrackerService.Delete(reportId); return myCt; } diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs index 942cf3c..84d7f72 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs @@ -5,7 +5,7 @@ namespace BrightLocal.Examples_version2.Account_Methods { public class clientExamples { - public static BrightLocalSuccess Create() + public static BlSuccess Create() { var myClient = new ClientOptions(); myClient.name = "Le Bernardin"; @@ -14,11 +14,11 @@ public static BrightLocalSuccess Create() var clientService = new ClientService(); - BrightLocalSuccess newClient = clientService.Create(myClient); + BlSuccess newClient = clientService.Create(myClient); return newClient; } - public static BrightLocalSuccess Update() + public static BlSuccess Update() { var myClient = new UpdateClientOptions(); myClient.clientId = 36447; @@ -28,16 +28,16 @@ public static BrightLocalSuccess Update() var clientService = new ClientService(); - BrightLocalSuccess updateClient = clientService.Update(myClient); + BlSuccess updateClient = clientService.Update(myClient); return updateClient; } - public static BrightLocalSuccess Delete() + public static BlSuccess Delete() { var clientId = 1; var clientService = new ClientService(); - BrightLocalSuccess deleteClient = clientService.Delete(clientId); + BlSuccess deleteClient = clientService.Delete(clientId); return deleteClient; } diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/gpwExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/gpwExamples.cs index deaad98..4582c9f 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/gpwExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/gpwExamples.cs @@ -8,7 +8,7 @@ namespace BrightLocal.Examples_version2.Account_Methods { public class gpwExamples { - public static BrightLocalSuccess Create() + public static BlSuccess Create() { var myGpwReport = new GpwOptions(); myGpwReport.reportName = "Sample Citation Tracker Report"; @@ -27,11 +27,11 @@ public static BrightLocalSuccess Create() var gpwService = new GpwService(); - BrightLocalSuccess gpwReport = gpwService.Create(myGpwReport); + BlSuccess gpwReport = gpwService.Create(myGpwReport); return gpwReport; } - public static BrightLocalSuccess Update() + public static BlSuccess Update() { var myGpwReport = new UpdateGpwOptions(); myGpwReport.reportId = 1; @@ -51,7 +51,7 @@ public static BrightLocalSuccess Update() var gpwService = new GpwService(); - BrightLocalSuccess gpwReport = gpwService.Update(myGpwReport); + BlSuccess gpwReport = gpwService.Update(myGpwReport); return gpwReport; } @@ -64,12 +64,12 @@ public static BrightLocalGpwReport Get() return gpwReport; } - public static BrightLocalSuccess Delete() + public static BlSuccess Delete() { var reportId = 1; var gpwService = new GpwService(); - BrightLocalSuccess gpwReport = gpwService.Delete(reportId); + BlSuccess gpwReport = gpwService.Delete(reportId); return gpwReport; } @@ -81,12 +81,12 @@ public static BrightLocalGpwGetAllResults GetAll() return gpwGetAllResults; } - public static BrightLocalSuccess Run() + public static BlSuccess Run() { var reportId = 1; var gpwService = new GpwService(); - BrightLocalSuccess gpwReport = gpwService.Run(reportId); + BlSuccess gpwReport = gpwService.Run(reportId); return gpwReport; } diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/locationExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/locationExamples.cs index 1d0c5d7..75e9dd3 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/locationExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/locationExamples.cs @@ -5,7 +5,7 @@ namespace BrightLocal.Examples_version2.Account_Methods { public class locationExamples { - public static BrightLocalSuccess Create() + public static BlSuccess Create() { var myLocation = new LocationOptions(); myLocation.name = "Le Bernardin"; @@ -21,11 +21,11 @@ public static BrightLocalSuccess Create() var locationService = new LocationService(); - BrightLocalSuccess newLocation = locationService.Create(myLocation); + BlSuccess newLocation = locationService.Create(myLocation); return newLocation; } - public static BrightLocalSuccess Update() + public static BlSuccess Update() { var myLocation = new UpdateLocationOptions(); myLocation.locationId = 1; @@ -42,16 +42,16 @@ public static BrightLocalSuccess Update() var locationService = new LocationService(); - BrightLocalSuccess updateLocation = locationService.Update(myLocation); + BlSuccess updateLocation = locationService.Update(myLocation); return updateLocation; } - public static BrightLocalSuccess Delete() + public static BlSuccess Delete() { var locationId = 1; var locationService = new LocationService(); - BrightLocalSuccess deleteLocation = locationService.Delete(locationId); + BlSuccess deleteLocation = locationService.Delete(locationId); return deleteLocation; } diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lscuExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lscuExamples.cs index 0cf31fd..bc1ca96 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lscuExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lscuExamples.cs @@ -8,7 +8,7 @@ namespace BrightLocal.Examples_version2.Account_Methods { public class lscuExamples { - public static BrightLocalSuccess Create() + public static BlSuccess Create() { LscuOptions myLscu = new LscuOptions(); myLscu.reportName = "Sample SEO Chek-Up Report"; @@ -45,12 +45,12 @@ public static BrightLocalSuccess Create() var lscuService = new LscuService(); - BrightLocalSuccess newLscu = lscuService.Create(myLscu); + BlSuccess newLscu = lscuService.Create(myLscu); return newLscu; } - public static BrightLocalSuccess Update() + public static BlSuccess Update() { UpdateLscuOptions myLscu = new UpdateLscuOptions(); myLscu.reportId = 1; @@ -70,7 +70,7 @@ public static BrightLocalSuccess Update() var lscuService = new LscuService(); - BrightLocalSuccess updateLscu = lscuService.Update(myLscu); + BlSuccess updateLscu = lscuService.Update(myLscu); return updateLscu; } @@ -85,7 +85,7 @@ public static BrightLocalLscuReport Get() } - public static BrightLocalSuccess Run() + public static BlSuccess Run() { var reportId = 1; var lscuService = new LscuService(); @@ -94,7 +94,7 @@ public static BrightLocalSuccess Run() return success; } - public static BrightLocalSuccess Delete() + public static BlSuccess Delete() { var reportId = 1; var lscuService = new LscuService(); diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs index d111905..33516db 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs @@ -8,7 +8,7 @@ namespace BrightLocal.Examples_version2.Account_Methods { public class lsrcExamples { - public static BrightLocalSuccess Create() + public static BlSuccess Create() { var myLsrc = new LsrcOptions(); myLsrc.name = "Le Bernardin"; @@ -19,11 +19,11 @@ public static BrightLocalSuccess Create() var lsrcService = new LsrcService(); - BrightLocalSuccess newLsrc = lsrcService.Create(myLsrc); + BlSuccess newLsrc = lsrcService.Create(myLsrc); return newLsrc; } - public static BrightLocalSuccess Update() + public static BlSuccess Update() { var myLsrc = new UpdateLsrcOptions(); myLsrc.campaignId = 1; @@ -35,16 +35,16 @@ public static BrightLocalSuccess Update() var lsrcService = new LsrcService(); - BrightLocalSuccess updatedLsrc = lsrcService.Update(myLsrc); + BlSuccess updatedLsrc = lsrcService.Update(myLsrc); return updatedLsrc; } - public static BrightLocalSuccess Delete() + public static BlSuccess Delete() { var campaignId = 1; var lsrcService = new LsrcService(); - BrightLocalSuccess deletedLsrc = lsrcService.Delete(campaignId); + BlSuccess deletedLsrc = lsrcService.Delete(campaignId); return deletedLsrc; } @@ -65,12 +65,12 @@ public static BrightLocalLsrcReport GetReport() return myLsrc; } - public static BrightLocalSuccess Run() + public static BlSuccess Run() { var campaignId = 1; var lsrcService = new LsrcService(); - BrightLocalSuccess myLsrc = lsrcService.Run(campaignId); + BlSuccess myLsrc = lsrcService.Run(campaignId); return myLsrc; } diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/rFExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/rFExamples.cs index 8f27345..d91d6fd 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/rFExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/rFExamples.cs @@ -7,7 +7,7 @@ namespace BrightLocal.Examples_version2.Account_Methods { public class rFExamples { - public static BrightLocalSuccess Create() + public static BlSuccess Create() { var myReviewReport = new ReviewFlowOptions(); myReviewReport.reportName = "Sample Citation Tracker Report"; @@ -37,11 +37,11 @@ public static BrightLocalSuccess Create() var rfService = new ReviewFlowService(); - BrightLocalSuccess newReviewReport = rfService.Create(myReviewReport); + BlSuccess newReviewReport = rfService.Create(myReviewReport); return newReviewReport; } - public static BrightLocalSuccess Update() + public static BlSuccess Update() { var myReviewReport = new UpdateReviewFlowOptions(); myReviewReport.reportId = 1; @@ -72,7 +72,7 @@ public static BrightLocalSuccess Update() var rfService = new ReviewFlowService(); - BrightLocalSuccess updateReviewReport = rfService.Update(myReviewReport); + BlSuccess updateReviewReport = rfService.Update(myReviewReport); return updateReviewReport; } @@ -85,12 +85,12 @@ public static BrightLocalRfReport GetReport() return reviewReport; } - public static BrightLocalSuccess DeleteReport() + public static BlSuccess DeleteReport() { int reportId = 1; var rfService = new ReviewFlowService(); - BrightLocalSuccess deleteReport = rfService.Delete(reportId); + BlSuccess deleteReport = rfService.Delete(reportId); return deleteReport; } @@ -121,21 +121,21 @@ public static BrightLocalRfReviews GetReviews() return reviews; } - public static BrightLocalSuccess GetReviewCount() + public static BlSuccess GetReviewCount() { int reportId = 1; var rfService = new ReviewFlowService(); - BrightLocalSuccess reviewCount = rfService.GetReviewCount(reportId); + BlSuccess reviewCount = rfService.GetReviewCount(reportId); return reviewCount; } - public static BrightLocalSuccess GetGrowth() + public static BlSuccess GetGrowth() { int reportId = 1; var rfService = new ReviewFlowService(); - BrightLocalSuccess reviewGrowth = rfService.GetGrowth(reportId); + BlSuccess reviewGrowth = rfService.GetGrowth(reportId); return reviewGrowth; } diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Batch-Methods/rankingsExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Batch-Methods/rankingsExamples.cs index 5bf4637..6d1bdf0 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Batch-Methods/rankingsExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Batch-Methods/rankingsExamples.cs @@ -9,7 +9,7 @@ namespace BrightLocal.Examples_version2.Batch_Methods { public class rankingsExamples { - public static BrightLocalSuccess Create() + public static BlSuccess Create() { RankingsSearchOptions searchOptions = new RankingsSearchOptions(); searchOptions.searches.Add(new SearchOptions() @@ -32,7 +32,7 @@ public static BrightLocalSuccess Create() }); var batchRankingService = new BatchRankingsService(); - BrightLocalBatchSuccess newBatchRankings = batchRankingService.Search(searchOptions); + BlBatchSuccess newBatchRankings = batchRankingService.Search(searchOptions); var rankingsResults = batchRankingService.GetSearchResults(newBatchRankings.batchId); diff --git a/BrightLocal/src/BrightLocal/Services/BatchRankings/BatchRankingsService.cs b/BrightLocal/src/BrightLocal/Services/BatchRankings/BatchRankingsService.cs index 6f97a4d..8f28d64 100644 --- a/BrightLocal/src/BrightLocal/Services/BatchRankings/BatchRankingsService.cs +++ b/BrightLocal/src/BrightLocal/Services/BatchRankings/BatchRankingsService.cs @@ -13,9 +13,9 @@ public BatchRankingsService(string apiKey = null, string apiSecret = null) : bas BrightLocalBatchRequestor batchRequest = new BrightLocalBatchRequestor(); BrightLocalRequestor request = new BrightLocalRequestor(); - public virtual BrightLocalBatchSuccess Search(RankingsSearchOptions searchOptions) + public virtual BlBatchSuccess Search(RankingsSearchOptions searchOptions) { - BrightLocalBatchSuccess ids = new BrightLocalBatchSuccess(); + BlBatchSuccess ids = new BlBatchSuccess(); var batchId = batchRequest.Create(this.api_key); var url = string.Format(Urls.Rankings + "{0}", "search"); foreach(var search in searchOptions.searches) @@ -41,10 +41,10 @@ public virtual BrightLocalBatchSuccess Search(RankingsSearchOptions searchOption return ids; } - public virtual BrightLocalSuccess GetSearchResults(int batchId) + public virtual BlSuccess GetSearchResults(int batchId) { var results = batchRequest.GetResults(batchId, this.api_key); - return JsonConvert.DeserializeObject(results.Content); + return JsonConvert.DeserializeObject(results.Content); } } } diff --git a/BrightLocal/src/BrightLocal/Services/CitationBurst/CitationBurstService.cs b/BrightLocal/src/BrightLocal/Services/CitationBurst/CitationBurstService.cs index db80af1..99e484e 100644 --- a/BrightLocal/src/BrightLocal/Services/CitationBurst/CitationBurstService.cs +++ b/BrightLocal/src/BrightLocal/Services/CitationBurst/CitationBurstService.cs @@ -8,80 +8,80 @@ public CitationBurstService(string apiKey = null, string apiSecret = null) : bas BrightLocalRequestor request = new BrightLocalRequestor(); - public virtual BrightLocalSuccess Create(CitationBurstOptions createOptions) + public virtual BlSuccess Create(CitationBurstOptions createOptions) { var url = string.Format(Urls.CitationBurst + "{0}", "create"); var parameters = Parameters.convertListToParameters(createOptions); var success = request.Post(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalSuccess Update(UpdateCitationBurstOptions updateOptions) + public virtual BlSuccess Update(UpdateCitationBurstOptions updateOptions) { var url = string.Format(Urls.CitationBurst + "{0}", updateOptions.campaignId); var parameters = Parameters.convertListToParameters(updateOptions); var success = request.Put(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalSuccess UploadImage(CbUploadImage imageOptions) + public virtual BlSuccess UploadImage(CbUploadImage imageOptions) { var url = string.Format(Urls.CitationBurst + "{0}" + "/{1}", imageOptions.campaignId, imageOptions.imageType); var parameters = Parameters.convertListToParameters(imageOptions.file); var success = request.Post(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalCitations GetCitations(int campaignId) + public virtual BlCitations GetCitations(int campaignId) { var url = string.Format(Urls.CitationBurst + "{0}", "citations"); var parameters = new Parameters.requestParameters(); parameters.Add("campaign-id", campaignId); var success = request.Get(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalSuccess ConfirmAndPay(BrightLocalCbPayOptions payOptions) + public virtual BlSuccess ConfirmAndPay(BrightLocalCbPayOptions payOptions) { var url = string.Format(Urls.CitationBurst + "{0}", "confirm-and-pay"); var parameters = Parameters.convertListToParameters(payOptions); var success = request.Post(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalCbAllCampaigns GetCampaigns() + public virtual BlCbAllCampaigns GetCampaigns() { var url = string.Format(Urls.CitationBurst + "{0}", "get-all"); var parameters = new Parameters.requestParameters(); var success = request.Get(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalCbAllCampaigns GetCampaigns(int locationId) + public virtual BlCbAllCampaigns GetCampaigns(int locationId) { var url = string.Format(Urls.CitationBurst + "{0}", "get-all"); var parameters = new Parameters.requestParameters(); parameters.Add("location-id", locationId); var success = request.Get(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalCbCampaign GetCampaign(int campaignId) + public virtual BlCbCampaign GetCampaign(int campaignId) { var url = string.Format(Urls.CitationBurst + "{0}", "get"); var parameters = new Parameters.requestParameters(); parameters.Add("campaign-id", campaignId); var success = request.Get(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalSuccess GetCredits() + public virtual BlSuccess GetCredits() { var url = string.Format(Urls.CitationBurst + "{0}", "credits"); var parameters = new Parameters.requestParameters(); var credits = request.Get(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(credits.Content); + return JsonConvert.DeserializeObject(credits.Content); } } } diff --git a/BrightLocal/src/BrightLocal/Services/CitationTracker/CitationTrackerService.cs b/BrightLocal/src/BrightLocal/Services/CitationTracker/CitationTrackerService.cs index 49114f9..d7971ed 100644 --- a/BrightLocal/src/BrightLocal/Services/CitationTracker/CitationTrackerService.cs +++ b/BrightLocal/src/BrightLocal/Services/CitationTracker/CitationTrackerService.cs @@ -8,20 +8,20 @@ public CitationTrackerService(string apiKey = null, string apiSecret = null) : b BrightLocalRequestor request = new BrightLocalRequestor(); - public virtual BrightLocalSuccess Create(CitationTrackerOptions createOptions) + public virtual BlSuccess Create(CitationTrackerOptions createOptions) { var url = string.Format(Urls.CitationTracker + "{0}", "add"); var parameters = Parameters.convertListToParameters(createOptions); var success = request.Post(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalSuccess Update(UpdateCitationTrackerOptions updateOptions) + public virtual BlSuccess Update(UpdateCitationTrackerOptions updateOptions) { var url = string.Format(Urls.CitationTracker + "{0}", "update"); var parameters = Parameters.convertListToParameters(updateOptions); var success = request.Post(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } public virtual BrightLocalCitationTrackerReport Get(int reportId) @@ -33,22 +33,22 @@ public virtual BrightLocalCitationTrackerReport Get(int reportId) return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalSuccess Run(int reportId) + public virtual BlSuccess Run(int reportId) { var url = string.Format(Urls.CitationTracker + "{0}", "run"); var parameters = new Parameters.requestParameters(); parameters.Add("report-id", reportId); var success = request.Post(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalSuccess Delete(int reportId) + public virtual BlSuccess Delete(int reportId) { var url = string.Format(Urls.CitationTracker + "{0}", "delete"); var parameters = new Parameters.requestParameters(); parameters.Add("report-id", reportId); var success = request.Post(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } //method overlaod for supplying the location-id parameter diff --git a/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs b/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs index 9f7830e..163d51f 100644 --- a/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs +++ b/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs @@ -12,26 +12,26 @@ public ClientService(string apiKey = null, string apiSecret = null) : base(apiKe BrightLocalRequestor request = new BrightLocalRequestor(); - public virtual BrightLocalSuccess Create(ClientOptions createOptions) + public virtual BlSuccess Create(ClientOptions createOptions) { var parameters = Parameters.convertListToParameters(createOptions); var success = request.Post(Urls.Clients, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalSuccess Update(UpdateClientOptions updateOptions) + public virtual BlSuccess Update(UpdateClientOptions updateOptions) { var parameters = Parameters.convertListToParameters(updateOptions); var success = request.Put(Urls.Clients, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalSuccess Delete(int clientId) + public virtual BlSuccess Delete(int clientId) { var parameters = new Parameters.requestParameters(); parameters.Add("client-id", clientId); var success = request.Delete(Urls.Clients, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } public virtual BrightLocalClient Get(int clientId) diff --git a/BrightLocal/src/BrightLocal/Services/GpwReports/GpwService.cs b/BrightLocal/src/BrightLocal/Services/GpwReports/GpwService.cs index 8d55ce1..942d113 100644 --- a/BrightLocal/src/BrightLocal/Services/GpwReports/GpwService.cs +++ b/BrightLocal/src/BrightLocal/Services/GpwReports/GpwService.cs @@ -9,20 +9,20 @@ public GpwService(string apiKey = null, string apiSecret = null) : base(apiKey, BrightLocalRequestor request = new BrightLocalRequestor(); - public virtual BrightLocalSuccess Create(GpwOptions createOptions) + public virtual BlSuccess Create(GpwOptions createOptions) { var url = string.Format(Urls.Gpw + "{0}", "add"); var parameters = Parameters.convertListToParameters(createOptions); var success = request.Post(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalSuccess Update(UpdateGpwOptions updateOptions) + public virtual BlSuccess Update(UpdateGpwOptions updateOptions) { var url = string.Format(Urls.Gpw + "{0}", updateOptions.reportId); var parameters = Parameters.convertListToParameters(updateOptions); var success = request.Put(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } public virtual BrightLocalGpwReport Get(int reportId) @@ -33,12 +33,12 @@ public virtual BrightLocalGpwReport Get(int reportId) return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalSuccess Delete(int reportId) + public virtual BlSuccess Delete(int reportId) { var url = string.Format(Urls.Gpw + "{0}", reportId); var parameters = new Parameters.requestParameters(); var success = request.Delete(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } public virtual BrightLocalGpwGetAllResults GetAll() @@ -56,13 +56,13 @@ public virtual BrightLocalGpwGetAllResults GetAll(int locationId) return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalSuccess Run(int reportId) + public virtual BlSuccess Run(int reportId) { var url = string.Format(Urls.Gpw + "{0}", "run"); var parameters = new Parameters.requestParameters(); parameters.Add("report-id", reportId); var success = request.Put(Urls.Gpw, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } public virtual BrightLocalGpwReportResults GetReportResults(int reportId) diff --git a/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs b/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs index 0f2d9dd..f5b5f65 100644 --- a/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs +++ b/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs @@ -11,28 +11,28 @@ public LocationService(string apiKey = null, string apiSecret = null) : base(api BrightLocalRequestor request = new BrightLocalRequestor(); - public virtual BrightLocalSuccess Create(LocationOptions createOptions) + public virtual BlSuccess Create(LocationOptions createOptions) { var parameters = Parameters.convertListToParameters(createOptions); var success = request.Post(Urls.Locations, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalSuccess Update(UpdateLocationOptions updateOptions) + public virtual BlSuccess Update(UpdateLocationOptions updateOptions) { var url = string.Format(Urls.Locations + "{0}", updateOptions.locationId); var parameters = Parameters.convertListToParameters(updateOptions); var success = request.Put(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalSuccess Delete(int locationId) + public virtual BlSuccess Delete(int locationId) { var url = string.Format(Urls.Locations + "{0}", locationId); var parameters = new Parameters.requestParameters(); var success = request.Delete(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } public virtual BrightLocalLocation Get(int locationId) diff --git a/BrightLocal/src/BrightLocal/Services/Lscu/LscuService.cs b/BrightLocal/src/BrightLocal/Services/Lscu/LscuService.cs index a61b608..8497cda 100644 --- a/BrightLocal/src/BrightLocal/Services/Lscu/LscuService.cs +++ b/BrightLocal/src/BrightLocal/Services/Lscu/LscuService.cs @@ -11,18 +11,18 @@ public LscuService(string apiKey = null, string apiSecret = null) : base(apiKey, BrightLocalRequestor request = new BrightLocalRequestor(); - public virtual BrightLocalSuccess Create(LscuOptions createOptions) + public virtual BlSuccess Create(LscuOptions createOptions) { var parameters = Parameters.convertListToParameters(createOptions); var success = request.Post(Urls.Lscu, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalSuccess Update(UpdateLscuOptions updateOptions) + public virtual BlSuccess Update(UpdateLscuOptions updateOptions) { var parameters = Parameters.convertListToParameters(updateOptions); var success = request.Put(Urls.Lscu, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } public virtual BrightLocalLscuReport Get(int reportId) @@ -34,23 +34,23 @@ public virtual BrightLocalLscuReport Get(int reportId) } // returns success or failed as a string message - public virtual BrightLocalSuccess Run(int reportId) + public virtual BlSuccess Run(int reportId) { var url = string.Format(Urls.Lscu + "{0}", "run"); var parameters = new Parameters.requestParameters(); parameters.Add("report-id", reportId); var success = request.Put(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } // returns success or failed as a string message - public virtual BrightLocalSuccess Delete(int reportId) + public virtual BlSuccess Delete(int reportId) { var parameters = new Parameters.requestParameters(); parameters.Add("report-id", reportId); var success = request.Delete(Urls.Lscu, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } public virtual BrightLocalLscuSearch Search(string query) diff --git a/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs b/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs index 6f82321..8f29745 100644 --- a/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs +++ b/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs @@ -11,7 +11,7 @@ public LsrcService(string apiKey = null, string apiSecret = null) : base(apiKey, BrightLocalRequestor request = new BrightLocalRequestor(); - public virtual BrightLocalSuccess Create(LsrcOptions createOptions) + public virtual BlSuccess Create(LsrcOptions createOptions) { var url = string.Format(Urls.Lsrc + "{0}", "add"); createOptions.searchTerms = Parameters.convertToNewline(createOptions.searchTerms); @@ -25,10 +25,10 @@ public virtual BrightLocalSuccess Create(LsrcOptions createOptions) } var parameters = Parameters.convertListToParameters(createOptions); var success = request.Post(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalSuccess Update(UpdateLsrcOptions updateOptions) + public virtual BlSuccess Update(UpdateLsrcOptions updateOptions) { var url = string.Format(Urls.Lsrc + "{0}", "update"); if (updateOptions.searchTerms != null) @@ -45,16 +45,16 @@ public virtual BrightLocalSuccess Update(UpdateLsrcOptions updateOptions) } var parameters = Parameters.convertListToParameters(updateOptions); var success = request.Post(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalSuccess Delete(int campaignId) + public virtual BlSuccess Delete(int campaignId) { var url = string.Format(Urls.Lsrc + "{0}", "delete"); var parameters = new Parameters.requestParameters(); parameters.Add("campaign-id", campaignId); var success = request.Post(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } //method overlaod for supplying the location-id parameter @@ -89,13 +89,13 @@ public virtual BrightLocalLsrcReport Get(int campaignId) return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalSuccess Run(int campaignId) + public virtual BlSuccess Run(int campaignId) { var url = string.Format(Urls.Lsrc + "{0}", "run"); var parameters = new Parameters.requestParameters(); parameters.Add("campaign-id", campaignId); var success = request.Post(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } public virtual BrightLocalLsrcHistory GetHistory(int campaignId) diff --git a/BrightLocal/src/BrightLocal/Services/ReviewFlow/ReviewFlowService.cs b/BrightLocal/src/BrightLocal/Services/ReviewFlow/ReviewFlowService.cs index 0824dc6..85173d1 100644 --- a/BrightLocal/src/BrightLocal/Services/ReviewFlow/ReviewFlowService.cs +++ b/BrightLocal/src/BrightLocal/Services/ReviewFlow/ReviewFlowService.cs @@ -8,20 +8,20 @@ public ReviewFlowService(string apiKey = null, string apiSecret = null) : base(a BrightLocalRequestor request = new BrightLocalRequestor(); - public virtual BrightLocalSuccess Create(ReviewFlowOptions createOptions) + public virtual BlSuccess Create(ReviewFlowOptions createOptions) { var url = string.Format(Urls.ReviewFlow + "{0}", "add"); var parameters = Parameters.convertListToParameters(createOptions); var success = request.Post(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalSuccess Update(UpdateReviewFlowOptions updateOptions) + public virtual BlSuccess Update(UpdateReviewFlowOptions updateOptions) { var url = string.Format(Urls.ReviewFlow + "{0}", updateOptions.reportId); var parameters = Parameters.convertListToParameters(updateOptions); var success = request.Put(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } public virtual BrightLocalRfReport Get(int reportId) @@ -32,12 +32,12 @@ public virtual BrightLocalRfReport Get(int reportId) return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalSuccess Delete(int reportId) + public virtual BlSuccess Delete(int reportId) { var url = string.Format(Urls.ReviewFlow + "{0}", reportId); var parameters = new Parameters.requestParameters(); var success = request.Delete(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } public virtual BrightLocalRfGetAll GetAll() @@ -74,20 +74,20 @@ public virtual BrightLocalRfReviews GetReviews(RfGetReviewsOptions getReviews) return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalSuccess GetReviewCount(int reportId) + public virtual BlSuccess GetReviewCount(int reportId) { var url = string.Format(Urls.ReviewFlow + "{0}" + "/reviews/count", reportId); var parameters = new Parameters.requestParameters(); var success = request.Get(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalSuccess GetGrowth(int reportId) + public virtual BlSuccess GetGrowth(int reportId) { var url = string.Format(Urls.ReviewFlow + "{0}" + "/reviews/growth", reportId); var parameters = new Parameters.requestParameters(); var success = request.Get(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } public virtual BrightLocalRfDirectories GetDirectories(int reportId) From c844763b9c40534205e55a61d9d9ed3e919cb8e5 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Sat, 18 Feb 2017 11:58:41 -0700 Subject: [PATCH 91/93] Changed naming convention from BrightLocal to Bl --- .../{BrightLocalService.cs => BlService.cs} | 4 +- ...itationTracker.cs => BlCitationTracker.cs} | 2 +- ...erReport.cs => BlCitationTrackerReport.cs} | 2 +- ...Results.cs => BlCitationTrackerResults.cs} | 2 +- .../{BrightLocalClient.cs => BlClient.cs} | 2 +- ...LocalClientSearch.cs => BlClientSearch.cs} | 2 +- ...tGetAllResults.cs => BlCtGetAllResults.cs} | 2 +- ...calGetAllResults.cs => BlGetAllResults.cs} | 2 +- ...GetAllResults.cs => BlGpwGetAllResults.cs} | 2 +- ...BrightLocalGpwReport.cs => BlGpwReport.cs} | 2 +- ...ReportResults.cs => BlGpwReportResults.cs} | 2 +- .../{BrightLocalLocation.cs => BlLocation.cs} | 2 +- ...lLocationSearch.cs => BlLocationSearch.cs} | 2 +- .../{BrightLocalLscu.cs => BlLscu.cs} | 2 +- ...ightLocalLscuReport.cs => BlLscuReport.cs} | 2 +- ...ightLocalLscuSearch.cs => BlLscuSearch.cs} | 2 +- .../{BrightLocalLsrc.cs => BlLsrc.cs} | 2 +- ...htLocalLsrcHistory.cs => BlLsrcHistory.cs} | 2 +- ...ightLocalLsrcReport.cs => BlLsrcReport.cs} | 2 +- ...eportResults.cs => BlLsrcReportResults.cs} | 2 +- ...calRfDirectories.cs => BlRfDirectories.cs} | 2 +- .../{BrightLocalRfGetAll.cs => BlRfGetAll.cs} | 2 +- .../{BrightLocalRfReport.cs => BlRfReport.cs} | 2 +- ...BrightLocalRfReviews.cs => BlRfReviews.cs} | 2 +- .../citationTrackerExamples.cs | 12 +- .../Account-Methods/clientExamples.cs | 8 +- .../Account-Methods/gpwExamples.cs | 12 +- .../Account-Methods/locationExamples.cs | 8 +- .../Account-Methods/lscuExamples.cs | 8 +- .../Account-Methods/lsrcExamples.cs | 14 +- .../Account-Methods/rFExamples.cs | 20 +-- ...lBatchRequestor.cs => BlBatchRequestor.cs} | 4 +- ...calConfiguration.cs => BlConfiguration.cs} | 2 +- ...BrightLocalRequestor.cs => BlRequestor.cs} | 6 +- .../BatchRankings/BatchRankingsService.cs | 6 +- .../CitationBurst/CitationBurstService.cs | 4 +- .../CitationTracker/CitationTrackerService.cs | 20 +-- .../Services/Clients/ClientService.cs | 12 +- .../Services/GpwReports/GpwService.cs | 20 +-- .../Services/Locations/LocationService.cs | 12 +- .../BrightLocal/Services/Lscu/LscuService.cs | 12 +- .../BrightLocal/Services/Lsrc/LsrcService.cs | 24 ++-- .../Services/ReviewFlow/ReviewFlowService.cs | 28 ++-- README.md | 136 +++++++++--------- 44 files changed, 209 insertions(+), 209 deletions(-) rename BrightLocal/src/BrightLocal/{BrightLocalService.cs => BlService.cs} (67%) rename BrightLocal/src/BrightLocal/Entities/{BrightLocalCitationTracker.cs => BlCitationTracker.cs} (97%) rename BrightLocal/src/BrightLocal/Entities/{BrightLocalCitationTrackerReport.cs => BlCitationTrackerReport.cs} (97%) rename BrightLocal/src/BrightLocal/Entities/{BrightLocalCitationTrackerResults.cs => BlCitationTrackerResults.cs} (99%) rename BrightLocal/src/BrightLocal/Entities/{BrightLocalClient.cs => BlClient.cs} (93%) rename BrightLocal/src/BrightLocal/Entities/{BrightLocalClientSearch.cs => BlClientSearch.cs} (95%) rename BrightLocal/src/BrightLocal/Entities/{BrightLocalCtGetAllResults.cs => BlCtGetAllResults.cs} (98%) rename BrightLocal/src/BrightLocal/Entities/{BrightLocalGetAllResults.cs => BlGetAllResults.cs} (93%) rename BrightLocal/src/BrightLocal/Entities/{BrightLocalGpwGetAllResults.cs => BlGpwGetAllResults.cs} (92%) rename BrightLocal/src/BrightLocal/Entities/{BrightLocalGpwReport.cs => BlGpwReport.cs} (97%) rename BrightLocal/src/BrightLocal/Entities/{BrightLocalGpwReportResults.cs => BlGpwReportResults.cs} (98%) rename BrightLocal/src/BrightLocal/Entities/{BrightLocalLocation.cs => BlLocation.cs} (98%) rename BrightLocal/src/BrightLocal/Entities/{BrightLocalLocationSearch.cs => BlLocationSearch.cs} (93%) rename BrightLocal/src/BrightLocal/Entities/{BrightLocalLscu.cs => BlLscu.cs} (98%) rename BrightLocal/src/BrightLocal/Entities/{BrightLocalLscuReport.cs => BlLscuReport.cs} (98%) rename BrightLocal/src/BrightLocal/Entities/{BrightLocalLscuSearch.cs => BlLscuSearch.cs} (96%) rename BrightLocal/src/BrightLocal/Entities/{BrightLocalLsrc.cs => BlLsrc.cs} (98%) rename BrightLocal/src/BrightLocal/Entities/{BrightLocalLsrcHistory.cs => BlLsrcHistory.cs} (95%) rename BrightLocal/src/BrightLocal/Entities/{BrightLocalLsrcReport.cs => BlLsrcReport.cs} (98%) rename BrightLocal/src/BrightLocal/Entities/{BrightLocalLsrcReportResults.cs => BlLsrcReportResults.cs} (99%) rename BrightLocal/src/BrightLocal/Entities/{BrightLocalRfDirectories.cs => BlRfDirectories.cs} (97%) rename BrightLocal/src/BrightLocal/Entities/{BrightLocalRfGetAll.cs => BlRfGetAll.cs} (94%) rename BrightLocal/src/BrightLocal/Entities/{BrightLocalRfReport.cs => BlRfReport.cs} (98%) rename BrightLocal/src/BrightLocal/Entities/{BrightLocalRfReviews.cs => BlRfReviews.cs} (95%) rename BrightLocal/src/BrightLocal/Infrastructure/{BrightLocalBatchRequestor.cs => BlBatchRequestor.cs} (97%) rename BrightLocal/src/BrightLocal/Infrastructure/{BrightLocalConfiguration.cs => BlConfiguration.cs} (95%) rename BrightLocal/src/BrightLocal/Infrastructure/{BrightLocalRequestor.cs => BlRequestor.cs} (96%) diff --git a/BrightLocal/src/BrightLocal/BrightLocalService.cs b/BrightLocal/src/BrightLocal/BlService.cs similarity index 67% rename from BrightLocal/src/BrightLocal/BrightLocalService.cs rename to BrightLocal/src/BrightLocal/BlService.cs index 5d8bb51..bfaaa23 100644 --- a/BrightLocal/src/BrightLocal/BrightLocalService.cs +++ b/BrightLocal/src/BrightLocal/BlService.cs @@ -1,12 +1,12 @@ namespace BrightLocal { - public class BrightLocalService + public class BlService { // Decalre Variables public string api_key; public string api_secret; - protected BrightLocalService(string apiKey, string apiSecret) + protected BlService(string apiKey, string apiSecret) { api_key = apiKey; api_secret = apiSecret; diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalCitationTracker.cs b/BrightLocal/src/BrightLocal/Entities/BlCitationTracker.cs similarity index 97% rename from BrightLocal/src/BrightLocal/Entities/BrightLocalCitationTracker.cs rename to BrightLocal/src/BrightLocal/Entities/BlCitationTracker.cs index d4b7090..1005273 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalCitationTracker.cs +++ b/BrightLocal/src/BrightLocal/Entities/BlCitationTracker.cs @@ -2,7 +2,7 @@ namespace BrightLocal { - public class BrightLocalCitationTracker + public class BlCitationTracker { [JsonProperty("report-id")] public int reportId { get; set; } diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalCitationTrackerReport.cs b/BrightLocal/src/BrightLocal/Entities/BlCitationTrackerReport.cs similarity index 97% rename from BrightLocal/src/BrightLocal/Entities/BrightLocalCitationTrackerReport.cs rename to BrightLocal/src/BrightLocal/Entities/BlCitationTrackerReport.cs index c17e760..3b549dc 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalCitationTrackerReport.cs +++ b/BrightLocal/src/BrightLocal/Entities/BlCitationTrackerReport.cs @@ -5,7 +5,7 @@ namespace BrightLocal { - public class BrightLocalCitationTrackerReport + public class BlCitationTrackerReport { public bool success { get; set; } public CtReport report { get; set; } diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalCitationTrackerResults.cs b/BrightLocal/src/BrightLocal/Entities/BlCitationTrackerResults.cs similarity index 99% rename from BrightLocal/src/BrightLocal/Entities/BrightLocalCitationTrackerResults.cs rename to BrightLocal/src/BrightLocal/Entities/BlCitationTrackerResults.cs index 05d26bc..acd3709 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalCitationTrackerResults.cs +++ b/BrightLocal/src/BrightLocal/Entities/BlCitationTrackerResults.cs @@ -6,7 +6,7 @@ namespace BrightLocal { - public class BrightLocalCitationTrackerResults + public class BlCitationTrackerResults { public CtResponse response { get; set; } } diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalClient.cs b/BrightLocal/src/BrightLocal/Entities/BlClient.cs similarity index 93% rename from BrightLocal/src/BrightLocal/Entities/BrightLocalClient.cs rename to BrightLocal/src/BrightLocal/Entities/BlClient.cs index 8383039..7bedbbf 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalClient.cs +++ b/BrightLocal/src/BrightLocal/Entities/BlClient.cs @@ -2,7 +2,7 @@ namespace BrightLocal { - public class BrightLocalClient + public class BlClient { [JsonProperty("client-id")] public int clientId { get; set; } diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalClientSearch.cs b/BrightLocal/src/BrightLocal/Entities/BlClientSearch.cs similarity index 95% rename from BrightLocal/src/BrightLocal/Entities/BrightLocalClientSearch.cs rename to BrightLocal/src/BrightLocal/Entities/BlClientSearch.cs index 89bdc7a..7aee7a1 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalClientSearch.cs +++ b/BrightLocal/src/BrightLocal/Entities/BlClientSearch.cs @@ -6,7 +6,7 @@ namespace BrightLocal { - public class BrightLocalClientSearch + public class BlClientSearch { [JsonProperty("success")] public bool success { get; set; } diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalCtGetAllResults.cs b/BrightLocal/src/BrightLocal/Entities/BlCtGetAllResults.cs similarity index 98% rename from BrightLocal/src/BrightLocal/Entities/BrightLocalCtGetAllResults.cs rename to BrightLocal/src/BrightLocal/Entities/BlCtGetAllResults.cs index 801a2dd..5cf01c5 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalCtGetAllResults.cs +++ b/BrightLocal/src/BrightLocal/Entities/BlCtGetAllResults.cs @@ -5,7 +5,7 @@ namespace BrightLocal { - public class BrightLocalCtGetAllResults + public class BlCtGetAllResults { public CtGetAllResponse response { get; set; } } diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalGetAllResults.cs b/BrightLocal/src/BrightLocal/Entities/BlGetAllResults.cs similarity index 93% rename from BrightLocal/src/BrightLocal/Entities/BrightLocalGetAllResults.cs rename to BrightLocal/src/BrightLocal/Entities/BlGetAllResults.cs index da6eb32..44887c2 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalGetAllResults.cs +++ b/BrightLocal/src/BrightLocal/Entities/BlGetAllResults.cs @@ -2,7 +2,7 @@ namespace BrightLocal { - public class BrightLocalGetAllResults + public class BlGetAllResults { public LsrcGetAllResponse response { get; set; } } diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalGpwGetAllResults.cs b/BrightLocal/src/BrightLocal/Entities/BlGpwGetAllResults.cs similarity index 92% rename from BrightLocal/src/BrightLocal/Entities/BrightLocalGpwGetAllResults.cs rename to BrightLocal/src/BrightLocal/Entities/BlGpwGetAllResults.cs index 1c717b1..2549067 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalGpwGetAllResults.cs +++ b/BrightLocal/src/BrightLocal/Entities/BlGpwGetAllResults.cs @@ -5,7 +5,7 @@ namespace BrightLocal { - public class BrightLocalGpwGetAllResults + public class BlGpwGetAllResults { public GpwResponse response { get; set; } } diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalGpwReport.cs b/BrightLocal/src/BrightLocal/Entities/BlGpwReport.cs similarity index 97% rename from BrightLocal/src/BrightLocal/Entities/BrightLocalGpwReport.cs rename to BrightLocal/src/BrightLocal/Entities/BlGpwReport.cs index 059aa0c..9f0f995 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalGpwReport.cs +++ b/BrightLocal/src/BrightLocal/Entities/BlGpwReport.cs @@ -3,7 +3,7 @@ namespace BrightLocal { - public class BrightLocalGpwReport + public class BlGpwReport { public bool success { get; set; } public GpwReport report { get; set; } diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalGpwReportResults.cs b/BrightLocal/src/BrightLocal/Entities/BlGpwReportResults.cs similarity index 98% rename from BrightLocal/src/BrightLocal/Entities/BrightLocalGpwReportResults.cs rename to BrightLocal/src/BrightLocal/Entities/BlGpwReportResults.cs index e120b99..8d263a3 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalGpwReportResults.cs +++ b/BrightLocal/src/BrightLocal/Entities/BlGpwReportResults.cs @@ -2,7 +2,7 @@ namespace BrightLocal { - public class BrightLocalGpwReportResults + public class BlGpwReportResults { public bool success { get; set; } public GpwReportResults results { get; set; } diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalLocation.cs b/BrightLocal/src/BrightLocal/Entities/BlLocation.cs similarity index 98% rename from BrightLocal/src/BrightLocal/Entities/BrightLocalLocation.cs rename to BrightLocal/src/BrightLocal/Entities/BlLocation.cs index 77e2fa9..d2f0e53 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalLocation.cs +++ b/BrightLocal/src/BrightLocal/Entities/BlLocation.cs @@ -4,7 +4,7 @@ namespace BrightLocal { - public class BrightLocalLocation + public class BlLocation { [JsonProperty("location-name")] public string locationName { get; set; } diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalLocationSearch.cs b/BrightLocal/src/BrightLocal/Entities/BlLocationSearch.cs similarity index 93% rename from BrightLocal/src/BrightLocal/Entities/BrightLocalLocationSearch.cs rename to BrightLocal/src/BrightLocal/Entities/BlLocationSearch.cs index 4633fdf..8efe7a5 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalLocationSearch.cs +++ b/BrightLocal/src/BrightLocal/Entities/BlLocationSearch.cs @@ -4,7 +4,7 @@ namespace BrightLocal { - public class BrightLocalLocationSearch + public class BlLocationSearch { [JsonProperty("success")] public bool success { get; set; } diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalLscu.cs b/BrightLocal/src/BrightLocal/Entities/BlLscu.cs similarity index 98% rename from BrightLocal/src/BrightLocal/Entities/BrightLocalLscu.cs rename to BrightLocal/src/BrightLocal/Entities/BlLscu.cs index 1cdd666..1be1954 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalLscu.cs +++ b/BrightLocal/src/BrightLocal/Entities/BlLscu.cs @@ -3,7 +3,7 @@ namespace BrightLocal { - public class BrightLocalLscu + public class BlLscu { [JsonProperty("report-id")] public string reportId { get; set; } diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalLscuReport.cs b/BrightLocal/src/BrightLocal/Entities/BlLscuReport.cs similarity index 98% rename from BrightLocal/src/BrightLocal/Entities/BrightLocalLscuReport.cs rename to BrightLocal/src/BrightLocal/Entities/BlLscuReport.cs index ba7b185..f004fc9 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalLscuReport.cs +++ b/BrightLocal/src/BrightLocal/Entities/BlLscuReport.cs @@ -2,7 +2,7 @@ namespace BrightLocal { - public class BrightLocalLscuReport + public class BlLscuReport { public bool success { get; set; } public LscuReport report { get; set; } diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalLscuSearch.cs b/BrightLocal/src/BrightLocal/Entities/BlLscuSearch.cs similarity index 96% rename from BrightLocal/src/BrightLocal/Entities/BrightLocalLscuSearch.cs rename to BrightLocal/src/BrightLocal/Entities/BlLscuSearch.cs index 18c6d93..529b2be 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalLscuSearch.cs +++ b/BrightLocal/src/BrightLocal/Entities/BlLscuSearch.cs @@ -6,7 +6,7 @@ namespace BrightLocal { - public class BrightLocalLscuSearch + public class BlLscuSearch { [JsonProperty("success")] public bool success { get; set; } diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalLsrc.cs b/BrightLocal/src/BrightLocal/Entities/BlLsrc.cs similarity index 98% rename from BrightLocal/src/BrightLocal/Entities/BrightLocalLsrc.cs rename to BrightLocal/src/BrightLocal/Entities/BlLsrc.cs index 2cbe29a..aa6b45f 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalLsrc.cs +++ b/BrightLocal/src/BrightLocal/Entities/BlLsrc.cs @@ -4,7 +4,7 @@ namespace BrightLocal { - public class BrightLocalLsrc + public class BlLsrc { [JsonProperty("campaign-id")] public string campaignId { get; set; } diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalLsrcHistory.cs b/BrightLocal/src/BrightLocal/Entities/BlLsrcHistory.cs similarity index 95% rename from BrightLocal/src/BrightLocal/Entities/BrightLocalLsrcHistory.cs rename to BrightLocal/src/BrightLocal/Entities/BlLsrcHistory.cs index 045cb08..92b5ade 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalLsrcHistory.cs +++ b/BrightLocal/src/BrightLocal/Entities/BlLsrcHistory.cs @@ -6,7 +6,7 @@ namespace BrightLocal { - public class BrightLocalLsrcHistory + public class BlLsrcHistory { public LsrcHistoryResponse response { get; set; } } diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalLsrcReport.cs b/BrightLocal/src/BrightLocal/Entities/BlLsrcReport.cs similarity index 98% rename from BrightLocal/src/BrightLocal/Entities/BrightLocalLsrcReport.cs rename to BrightLocal/src/BrightLocal/Entities/BlLsrcReport.cs index ba2d7c4..9511191 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalLsrcReport.cs +++ b/BrightLocal/src/BrightLocal/Entities/BlLsrcReport.cs @@ -3,7 +3,7 @@ namespace BrightLocal { - public class BrightLocalLsrcReport + public class BlLsrcReport { public LsrcResponse response { get; set; } } diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalLsrcReportResults.cs b/BrightLocal/src/BrightLocal/Entities/BlLsrcReportResults.cs similarity index 99% rename from BrightLocal/src/BrightLocal/Entities/BrightLocalLsrcReportResults.cs rename to BrightLocal/src/BrightLocal/Entities/BlLsrcReportResults.cs index 2ecbe0e..2492c45 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalLsrcReportResults.cs +++ b/BrightLocal/src/BrightLocal/Entities/BlLsrcReportResults.cs @@ -6,7 +6,7 @@ namespace BrightLocal { - public class BrightLocalLsrcReportResults + public class BlLsrcReportResults { public LsrcResultResponse response { get; set; } } diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalRfDirectories.cs b/BrightLocal/src/BrightLocal/Entities/BlRfDirectories.cs similarity index 97% rename from BrightLocal/src/BrightLocal/Entities/BrightLocalRfDirectories.cs rename to BrightLocal/src/BrightLocal/Entities/BlRfDirectories.cs index 9bf3cc8..923e934 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalRfDirectories.cs +++ b/BrightLocal/src/BrightLocal/Entities/BlRfDirectories.cs @@ -6,7 +6,7 @@ namespace BrightLocal { - public class BrightLocalRfDirectories + public class BlRfDirectories { public bool success { get; set; } public RflowDirectories directories { get; set; } diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalRfGetAll.cs b/BrightLocal/src/BrightLocal/Entities/BlRfGetAll.cs similarity index 94% rename from BrightLocal/src/BrightLocal/Entities/BrightLocalRfGetAll.cs rename to BrightLocal/src/BrightLocal/Entities/BlRfGetAll.cs index ca69457..e81c779 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalRfGetAll.cs +++ b/BrightLocal/src/BrightLocal/Entities/BlRfGetAll.cs @@ -3,7 +3,7 @@ namespace BrightLocal { - public class BrightLocalRfGetAll + public class BlRfGetAll { public bool success { get; set; } public List reports { get; set; } diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalRfReport.cs b/BrightLocal/src/BrightLocal/Entities/BlRfReport.cs similarity index 98% rename from BrightLocal/src/BrightLocal/Entities/BrightLocalRfReport.cs rename to BrightLocal/src/BrightLocal/Entities/BlRfReport.cs index f357a0b..678cc13 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalRfReport.cs +++ b/BrightLocal/src/BrightLocal/Entities/BlRfReport.cs @@ -5,7 +5,7 @@ namespace BrightLocal { - public class BrightLocalRfReport + public class BlRfReport { public bool success { get; set; } public RfReport report { get; set; } diff --git a/BrightLocal/src/BrightLocal/Entities/BrightLocalRfReviews.cs b/BrightLocal/src/BrightLocal/Entities/BlRfReviews.cs similarity index 95% rename from BrightLocal/src/BrightLocal/Entities/BrightLocalRfReviews.cs rename to BrightLocal/src/BrightLocal/Entities/BlRfReviews.cs index 610edbd..4b2fef4 100644 --- a/BrightLocal/src/BrightLocal/Entities/BrightLocalRfReviews.cs +++ b/BrightLocal/src/BrightLocal/Entities/BlRfReviews.cs @@ -2,7 +2,7 @@ namespace BrightLocal { - public class BrightLocalRfReviews + public class BlRfReviews { public bool success { get; set; } public List reviews { get; set; } diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationTrackerExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationTrackerExamples.cs index e54a4d4..fea1790 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationTrackerExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationTrackerExamples.cs @@ -41,13 +41,13 @@ public static BlSuccess Update() return updateCt; } - public static BrightLocalCitationTrackerReport Get() + public static BlCitationTrackerReport Get() { int reportId = 682; var citationTrackerService = new CitationTrackerService(); - BrightLocalCitationTrackerReport myCt = citationTrackerService.Get(reportId); + BlCitationTrackerReport myCt = citationTrackerService.Get(reportId); return myCt; } @@ -74,22 +74,22 @@ public static BlSuccess Delete() return myCt; } - public static BrightLocalCtGetAllResults GetAll() + public static BlCtGetAllResults GetAll() { var citationTrackerService = new CitationTrackerService(); - BrightLocalCtGetAllResults ctResults = citationTrackerService.GetAll(); + BlCtGetAllResults ctResults = citationTrackerService.GetAll(); return ctResults; } - public static BrightLocalCitationTrackerResults GetReportResults() + public static BlCitationTrackerResults GetReportResults() { var reportId = 1; var citationTrackerService = new CitationTrackerService(); - BrightLocalCitationTrackerResults ctResults = citationTrackerService.GetReportResults(reportId); + BlCitationTrackerResults ctResults = citationTrackerService.GetReportResults(reportId); return ctResults; } diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs index 84d7f72..743515a 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs @@ -41,21 +41,21 @@ public static BlSuccess Delete() return deleteClient; } - public static BrightLocalClient Get() + public static BlClient Get() { var clientId = 1; var clientService = new ClientService(); - BrightLocalClient client = clientService.Get(clientId); + BlClient client = clientService.Get(clientId); return client; } - public static BrightLocalClientSearch Search() + public static BlClientSearch Search() { var searchQuery = "le-bernardin"; var clientService = new ClientService(); - BrightLocalClientSearch results = clientService.Search(searchQuery); + BlClientSearch results = clientService.Search(searchQuery); return results; } } diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/gpwExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/gpwExamples.cs index 4582c9f..a8f6f81 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/gpwExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/gpwExamples.cs @@ -55,12 +55,12 @@ public static BlSuccess Update() return gpwReport; } - public static BrightLocalGpwReport Get() + public static BlGpwReport Get() { var reportId = 1; var gpwService = new GpwService(); - BrightLocalGpwReport gpwReport = gpwService.Get(reportId); + BlGpwReport gpwReport = gpwService.Get(reportId); return gpwReport; } @@ -73,11 +73,11 @@ public static BlSuccess Delete() return gpwReport; } - public static BrightLocalGpwGetAllResults GetAll() + public static BlGpwGetAllResults GetAll() { var gpwService = new GpwService(); - BrightLocalGpwGetAllResults gpwGetAllResults = gpwService.GetAll(); + BlGpwGetAllResults gpwGetAllResults = gpwService.GetAll(); return gpwGetAllResults; } @@ -90,12 +90,12 @@ public static BlSuccess Run() return gpwReport; } - public static BrightLocalGpwReportResults GetResults() + public static BlGpwReportResults GetResults() { var reportId = 1; var gpwService = new GpwService(); - BrightLocalGpwReportResults gpwReport = gpwService.GetReportResults(reportId); + BlGpwReportResults gpwReport = gpwService.GetReportResults(reportId); return gpwReport; } } diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/locationExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/locationExamples.cs index 75e9dd3..6ca5033 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/locationExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/locationExamples.cs @@ -55,21 +55,21 @@ public static BlSuccess Delete() return deleteLocation; } - public static BrightLocalLocation Get() + public static BlLocation Get() { var locationId = 1; var locationService = new LocationService(); - BrightLocalLocation getLocation = locationService.Get(locationId); + BlLocation getLocation = locationService.Get(locationId); return getLocation; } - public static BrightLocalLocationSearch Search() + public static BlLocationSearch Search() { var searchQuery = "le-bernardin"; var locationService = new LocationService(); - BrightLocalLocationSearch results = locationService.Search(searchQuery); + BlLocationSearch results = locationService.Search(searchQuery); return results; } } diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lscuExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lscuExamples.cs index bc1ca96..cf2526f 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lscuExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lscuExamples.cs @@ -75,12 +75,12 @@ public static BlSuccess Update() return updateLscu; } - public static BrightLocalLscuReport Get() + public static BlLscuReport Get() { var reportId = 1; var lscuService = new LscuService(); - BrightLocalLscuReport lscuReport = lscuService.Get(reportId); + BlLscuReport lscuReport = lscuService.Get(reportId); return lscuReport; } @@ -103,12 +103,12 @@ public static BlSuccess Delete() return success; } - public static BrightLocalLscuSearch Search() + public static BlLscuSearch Search() { var searchQuery = "Bodega Wine Bar"; var lscuService = new LscuService(); - BrightLocalLscuSearch lscuSearch = lscuService.Search(searchQuery); + BlLscuSearch lscuSearch = lscuService.Search(searchQuery); return lscuSearch; } } diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs index 33516db..7df1e43 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs @@ -48,20 +48,20 @@ public static BlSuccess Delete() return deletedLsrc; } - public static BrightLocalGetAllResults GetAll() + public static BlGetAllResults GetAll() { var lsrcService = new LsrcService(); - BrightLocalGetAllResults lsrcList = lsrcService.GetAll(); + BlGetAllResults lsrcList = lsrcService.GetAll(); return lsrcList; } - public static BrightLocalLsrcReport GetReport() + public static BlLsrcReport GetReport() { var campaignId = 1; var lsrcService = new LsrcService(); - BrightLocalLsrcReport myLsrc = lsrcService.Get(campaignId); + BlLsrcReport myLsrc = lsrcService.Get(campaignId); return myLsrc; } @@ -74,16 +74,16 @@ public static BlSuccess Run() return myLsrc; } - public static BrightLocalLsrcHistory GetHistory() + public static BlLsrcHistory GetHistory() { var campaignId = 1; var lsrcService = new LsrcService(); - BrightLocalLsrcHistory lsrcHistory = lsrcService.GetHistory(campaignId); + BlLsrcHistory lsrcHistory = lsrcService.GetHistory(campaignId); return lsrcHistory; } - public static BrightLocalLsrcReportResults GetReportResults() + public static BlLsrcReportResults GetReportResults() { var myLsrc = new GetResultsLsrcOptions(); myLsrc.campaignId = 1; diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/rFExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/rFExamples.cs index d91d6fd..be0aa5c 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/rFExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/rFExamples.cs @@ -76,12 +76,12 @@ public static BlSuccess Update() return updateReviewReport; } - public static BrightLocalRfReport GetReport() + public static BlRfReport GetReport() { int reportId = 1; var rfService = new ReviewFlowService(); - BrightLocalRfReport reviewReport = rfService.Get(reportId); + BlRfReport reviewReport = rfService.Get(reportId); return reviewReport; } @@ -94,30 +94,30 @@ public static BlSuccess DeleteReport() return deleteReport; } - public static BrightLocalRfGetAll GetAllReports() + public static BlRfGetAll GetAllReports() { var rfService = new ReviewFlowService(); - BrightLocalRfGetAll results = rfService.GetAll(); + BlRfGetAll results = rfService.GetAll(); return results; } - public static BrightLocalRfGetAll SearchReport() + public static BlRfGetAll SearchReport() { string query = "New York"; var rfService = new ReviewFlowService(); - BrightLocalRfGetAll results = rfService.Search(query); + BlRfGetAll results = rfService.Search(query); return results; } - public static BrightLocalRfReviews GetReviews() + public static BlRfReviews GetReviews() { var myReviewReport = new RfGetReviewsOptions(); myReviewReport.reportId = 1; var rfService = new ReviewFlowService(); - BrightLocalRfReviews reviews = rfService.GetReviews(myReviewReport); + BlRfReviews reviews = rfService.GetReviews(myReviewReport); return reviews; } @@ -139,12 +139,12 @@ public static BlSuccess GetGrowth() return reviewGrowth; } - public static BrightLocalRfDirectories GetDirectories() + public static BlRfDirectories GetDirectories() { int reportId = 1; var rfService = new ReviewFlowService(); - BrightLocalRfDirectories reviewDirectories = rfService.GetDirectories(reportId); + BlRfDirectories reviewDirectories = rfService.GetDirectories(reportId); return reviewDirectories; } diff --git a/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalBatchRequestor.cs b/BrightLocal/src/BrightLocal/Infrastructure/BlBatchRequestor.cs similarity index 97% rename from BrightLocal/src/BrightLocal/Infrastructure/BrightLocalBatchRequestor.cs rename to BrightLocal/src/BrightLocal/Infrastructure/BlBatchRequestor.cs index c1bd09c..11ee820 100644 --- a/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalBatchRequestor.cs +++ b/BrightLocal/src/BrightLocal/Infrastructure/BlBatchRequestor.cs @@ -8,7 +8,7 @@ namespace BrightLocal { - public class BrightLocalBatchRequestor + public class BlBatchRequestor { private static readonly System.Uri baseUrl = new System.Uri(Urls.BaseUrl); private static readonly string url = "/v4/batch"; @@ -52,7 +52,7 @@ public IRestResponse GetResults(int batchId, string apiKey) public IRestResponse Call(Method method, string apiKey, Parameters.requestParameters apiParameters) { - apiKey = apiKey ?? BrightLocalConfiguration.GetApiKey(); + apiKey = apiKey ?? BlConfiguration.GetApiKey(); // create sxpires variable diff --git a/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalConfiguration.cs b/BrightLocal/src/BrightLocal/Infrastructure/BlConfiguration.cs similarity index 95% rename from BrightLocal/src/BrightLocal/Infrastructure/BrightLocalConfiguration.cs rename to BrightLocal/src/BrightLocal/Infrastructure/BlConfiguration.cs index 6cd5d92..676bbdc 100644 --- a/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalConfiguration.cs +++ b/BrightLocal/src/BrightLocal/Infrastructure/BlConfiguration.cs @@ -6,7 +6,7 @@ namespace BrightLocal { - public static class BrightLocalConfiguration + public static class BlConfiguration { // Decalre Variables private static string api_key; diff --git a/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalRequestor.cs b/BrightLocal/src/BrightLocal/Infrastructure/BlRequestor.cs similarity index 96% rename from BrightLocal/src/BrightLocal/Infrastructure/BrightLocalRequestor.cs rename to BrightLocal/src/BrightLocal/Infrastructure/BlRequestor.cs index 7c77dea..55679ed 100644 --- a/BrightLocal/src/BrightLocal/Infrastructure/BrightLocalRequestor.cs +++ b/BrightLocal/src/BrightLocal/Infrastructure/BlRequestor.cs @@ -10,7 +10,7 @@ namespace BrightLocal { - public class BrightLocalRequestor + public class BlRequestor { private static readonly System.Uri baseUrl = new System.Uri(Urls.BaseUrl); @@ -47,8 +47,8 @@ private static double CreateExpiresParameter() // Function that creates and sends the actual request. public IRestResponse Call(Method method, string endPoint, Dictionary apiParameters, string apiKey, string apiSecret) { - apiKey = apiKey ?? BrightLocalConfiguration.GetApiKey(); - apiSecret = apiSecret ?? BrightLocalConfiguration.GetApiSecret(); + apiKey = apiKey ?? BlConfiguration.GetApiKey(); + apiSecret = apiSecret ?? BlConfiguration.GetApiSecret(); // create sxpires variable var expires = CreateExpiresParameter(); // set base url diff --git a/BrightLocal/src/BrightLocal/Services/BatchRankings/BatchRankingsService.cs b/BrightLocal/src/BrightLocal/Services/BatchRankings/BatchRankingsService.cs index 8f28d64..f7bffe7 100644 --- a/BrightLocal/src/BrightLocal/Services/BatchRankings/BatchRankingsService.cs +++ b/BrightLocal/src/BrightLocal/Services/BatchRankings/BatchRankingsService.cs @@ -6,13 +6,13 @@ namespace BrightLocal { - public class BatchRankingsService : BrightLocalService + public class BatchRankingsService : BlService { public BatchRankingsService(string apiKey = null, string apiSecret = null) : base(apiKey, apiSecret) { } - BrightLocalBatchRequestor batchRequest = new BrightLocalBatchRequestor(); + BlBatchRequestor batchRequest = new BlBatchRequestor(); - BrightLocalRequestor request = new BrightLocalRequestor(); + BlRequestor request = new BlRequestor(); public virtual BlBatchSuccess Search(RankingsSearchOptions searchOptions) { BlBatchSuccess ids = new BlBatchSuccess(); diff --git a/BrightLocal/src/BrightLocal/Services/CitationBurst/CitationBurstService.cs b/BrightLocal/src/BrightLocal/Services/CitationBurst/CitationBurstService.cs index 99e484e..eeaf3f6 100644 --- a/BrightLocal/src/BrightLocal/Services/CitationBurst/CitationBurstService.cs +++ b/BrightLocal/src/BrightLocal/Services/CitationBurst/CitationBurstService.cs @@ -2,11 +2,11 @@ namespace BrightLocal { - public class CitationBurstService : BrightLocalService + public class CitationBurstService : BlService { public CitationBurstService(string apiKey = null, string apiSecret = null) : base(apiKey, apiSecret) { } - BrightLocalRequestor request = new BrightLocalRequestor(); + BlRequestor request = new BlRequestor(); public virtual BlSuccess Create(CitationBurstOptions createOptions) { diff --git a/BrightLocal/src/BrightLocal/Services/CitationTracker/CitationTrackerService.cs b/BrightLocal/src/BrightLocal/Services/CitationTracker/CitationTrackerService.cs index d7971ed..7eaaa3c 100644 --- a/BrightLocal/src/BrightLocal/Services/CitationTracker/CitationTrackerService.cs +++ b/BrightLocal/src/BrightLocal/Services/CitationTracker/CitationTrackerService.cs @@ -2,11 +2,11 @@ namespace BrightLocal { - public class CitationTrackerService: BrightLocalService + public class CitationTrackerService: BlService { public CitationTrackerService(string apiKey = null, string apiSecret = null) : base(apiKey, apiSecret) { } - BrightLocalRequestor request = new BrightLocalRequestor(); + BlRequestor request = new BlRequestor(); public virtual BlSuccess Create(CitationTrackerOptions createOptions) { @@ -24,13 +24,13 @@ public virtual BlSuccess Update(UpdateCitationTrackerOptions updateOptions) return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalCitationTrackerReport Get(int reportId) + public virtual BlCitationTrackerReport Get(int reportId) { var url = string.Format(Urls.CitationTracker + "{0}", "get"); var parameters = new Parameters.requestParameters(); parameters.Add("report-id", reportId); var success = request.Post(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } public virtual BlSuccess Run(int reportId) @@ -52,29 +52,29 @@ public virtual BlSuccess Delete(int reportId) } //method overlaod for supplying the location-id parameter - public virtual BrightLocalCtGetAllResults GetAll(int locationId) + public virtual BlCtGetAllResults GetAll(int locationId) { var url = string.Format(Urls.CitationTracker + "{0}", "get-all"); var parameters = new Parameters.requestParameters(); parameters.Add("location-id", locationId); var success = request.Post(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalCtGetAllResults GetAll() + public virtual BlCtGetAllResults GetAll() { var url = string.Format(Urls.CitationTracker + "{0}", "get-all"); var parameters = new Parameters.requestParameters(); var success = request.Post(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalCitationTrackerResults GetReportResults(int reportId) + public virtual BlCitationTrackerResults GetReportResults(int reportId) { var url = string.Format(Urls.CitationTracker + "{0}", "get-results"); var parameters = new Parameters.requestParameters(); parameters.Add("report-id", reportId); var success = request.Post(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } } } diff --git a/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs b/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs index 163d51f..e8b19d9 100644 --- a/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs +++ b/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs @@ -5,12 +5,12 @@ namespace BrightLocal { - public class ClientService : BrightLocalService + public class ClientService : BlService { public ClientService(string apiKey = null, string apiSecret = null) : base(apiKey, apiSecret) { } - BrightLocalRequestor request = new BrightLocalRequestor(); + BlRequestor request = new BlRequestor(); public virtual BlSuccess Create(ClientOptions createOptions) { @@ -34,23 +34,23 @@ public virtual BlSuccess Delete(int clientId) return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalClient Get(int clientId) + public virtual BlClient Get(int clientId) { var url = string.Format(Urls.Clients + "{0}", clientId); var parameters = new Parameters.requestParameters(); var success = request.Get(url, parameters, this.api_key, this.api_secret); JObject o = JObject.Parse(success.Content); - return JsonConvert.DeserializeObject(o.SelectToken("client").ToString()); + return JsonConvert.DeserializeObject(o.SelectToken("client").ToString()); } - public virtual BrightLocalClientSearch Search(string query) + public virtual BlClientSearch Search(string query) { var url = string.Format(Urls.Clients + "search"); var parameters = new Parameters.requestParameters(); parameters.Add("q", query); var results = request.Get(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(results.Content); + return JsonConvert.DeserializeObject(results.Content); } } } diff --git a/BrightLocal/src/BrightLocal/Services/GpwReports/GpwService.cs b/BrightLocal/src/BrightLocal/Services/GpwReports/GpwService.cs index 942d113..37e18ee 100644 --- a/BrightLocal/src/BrightLocal/Services/GpwReports/GpwService.cs +++ b/BrightLocal/src/BrightLocal/Services/GpwReports/GpwService.cs @@ -3,11 +3,11 @@ namespace BrightLocal { - public class GpwService : BrightLocalService + public class GpwService : BlService { public GpwService(string apiKey = null, string apiSecret = null) : base(apiKey, apiSecret) { } - BrightLocalRequestor request = new BrightLocalRequestor(); + BlRequestor request = new BlRequestor(); public virtual BlSuccess Create(GpwOptions createOptions) { @@ -25,12 +25,12 @@ public virtual BlSuccess Update(UpdateGpwOptions updateOptions) return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalGpwReport Get(int reportId) + public virtual BlGpwReport Get(int reportId) { var url = string.Format(Urls.Gpw + "{0}", reportId); var parameters = new Parameters.requestParameters(); var success = request.Get(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } public virtual BlSuccess Delete(int reportId) @@ -41,19 +41,19 @@ public virtual BlSuccess Delete(int reportId) return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalGpwGetAllResults GetAll() + public virtual BlGpwGetAllResults GetAll() { var parameters = new Parameters.requestParameters(); var success = request.Get(Urls.Gpw, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalGpwGetAllResults GetAll(int locationId) + public virtual BlGpwGetAllResults GetAll(int locationId) { var parameters = new Parameters.requestParameters(); parameters.Add("location-id", locationId); var success = request.Get(Urls.Gpw, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } public virtual BlSuccess Run(int reportId) @@ -65,12 +65,12 @@ public virtual BlSuccess Run(int reportId) return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalGpwReportResults GetReportResults(int reportId) + public virtual BlGpwReportResults GetReportResults(int reportId) { var url = string.Format(Urls.Gpw + "{0}", reportId + "/results"); var parameters = new Parameters.requestParameters(); var success = request.Get(Urls.Gpw, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } } } diff --git a/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs b/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs index f5b5f65..5ed6366 100644 --- a/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs +++ b/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs @@ -5,11 +5,11 @@ namespace BrightLocal { - public class LocationService: BrightLocalService + public class LocationService: BlService { public LocationService(string apiKey = null, string apiSecret = null) : base(apiKey, apiSecret) { } - BrightLocalRequestor request = new BrightLocalRequestor(); + BlRequestor request = new BlRequestor(); public virtual BlSuccess Create(LocationOptions createOptions) { @@ -35,22 +35,22 @@ public virtual BlSuccess Delete(int locationId) return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalLocation Get(int locationId) + public virtual BlLocation Get(int locationId) { var url = string.Format(Urls.Locations + "{0}", locationId); var parameters = new Parameters.requestParameters(); var success = request.Get(url, parameters, this.api_key, this.api_secret); JObject o = JObject.Parse(success.Content); - return JsonConvert.DeserializeObject(o.SelectToken("location").ToString()); + return JsonConvert.DeserializeObject(o.SelectToken("location").ToString()); } - public virtual BrightLocalLocationSearch Search(string query) + public virtual BlLocationSearch Search(string query) { var url = string.Format(Urls.Locations + "search"); var parameters = new Parameters.requestParameters(); parameters.Add("q", query); var results = request.Get(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(results.Content); + return JsonConvert.DeserializeObject(results.Content); } } } diff --git a/BrightLocal/src/BrightLocal/Services/Lscu/LscuService.cs b/BrightLocal/src/BrightLocal/Services/Lscu/LscuService.cs index 8497cda..8e2cc7e 100644 --- a/BrightLocal/src/BrightLocal/Services/Lscu/LscuService.cs +++ b/BrightLocal/src/BrightLocal/Services/Lscu/LscuService.cs @@ -5,11 +5,11 @@ namespace BrightLocal { - public class LscuService: BrightLocalService + public class LscuService: BlService { public LscuService(string apiKey = null, string apiSecret = null) : base(apiKey, apiSecret) { } - BrightLocalRequestor request = new BrightLocalRequestor(); + BlRequestor request = new BlRequestor(); public virtual BlSuccess Create(LscuOptions createOptions) { @@ -25,12 +25,12 @@ public virtual BlSuccess Update(UpdateLscuOptions updateOptions) return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalLscuReport Get(int reportId) + public virtual BlLscuReport Get(int reportId) { var parameters = new Parameters.requestParameters(); parameters.Add("report-id", reportId); var success = request.Get(Urls.Lscu, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } // returns success or failed as a string message @@ -53,13 +53,13 @@ public virtual BlSuccess Delete(int reportId) return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalLscuSearch Search(string query) + public virtual BlLscuSearch Search(string query) { var url = string.Format(Urls.Lscu + "{0}", "search"); var parameters = new Parameters.requestParameters(); parameters.Add("q", query); var success = request.Get(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } } } diff --git a/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs b/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs index 8f29745..3f07c59 100644 --- a/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs +++ b/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs @@ -5,11 +5,11 @@ namespace BrightLocal { - public class LsrcService: BrightLocalService + public class LsrcService: BlService { public LsrcService(string apiKey = null, string apiSecret = null) : base(apiKey, apiSecret) { } - BrightLocalRequestor request = new BrightLocalRequestor(); + BlRequestor request = new BlRequestor(); public virtual BlSuccess Create(LsrcOptions createOptions) { @@ -58,7 +58,7 @@ public virtual BlSuccess Delete(int campaignId) } //method overlaod for supplying the location-id parameter - public virtual BrightLocalGetAllResults GetAll(int locationId) + public virtual BlGetAllResults GetAll(int locationId) { var url = string.Format(Urls.Lsrc + "{0}", "get-all"); var parameters = new Parameters.requestParameters(); @@ -66,27 +66,27 @@ public virtual BrightLocalGetAllResults GetAll(int locationId) var results = request.Get(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(results.Content); + return JsonConvert.DeserializeObject(results.Content); } - public virtual BrightLocalGetAllResults GetAll() + public virtual BlGetAllResults GetAll() { var url = string.Format(Urls.Lsrc + "{0}", "get-all"); var parameters = new Parameters.requestParameters(); var results = request.Get(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(results.Content); + return JsonConvert.DeserializeObject(results.Content); } - public virtual BrightLocalLsrcReport Get(int campaignId) + public virtual BlLsrcReport Get(int campaignId) { var url = string.Format(Urls.Lsrc + "{0}", "get"); var parameters = new Parameters.requestParameters(); parameters.Add("campaign-id", campaignId); var success = request.Get(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } public virtual BlSuccess Run(int campaignId) @@ -98,23 +98,23 @@ public virtual BlSuccess Run(int campaignId) return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalLsrcHistory GetHistory(int campaignId) + public virtual BlLsrcHistory GetHistory(int campaignId) { var url = string.Format(Urls.Lsrc + "{0}", "history/get"); var parameters = new Parameters.requestParameters(); parameters.Add("campaign-id", campaignId); var results = request.Post(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(results.Content); + return JsonConvert.DeserializeObject(results.Content); } - public virtual BrightLocalLsrcReportResults GetResults(GetResultsLsrcOptions lsrcOptions) + public virtual BlLsrcReportResults GetResults(GetResultsLsrcOptions lsrcOptions) { var url = string.Format(Urls.Lsrc + "{0}", "results/get"); var parameters = Parameters.convertListToParameters(lsrcOptions); var results = request.Get(url, parameters, this.api_key, this.api_secret); - var report = JsonConvert.DeserializeObject(results.Content); + var report = JsonConvert.DeserializeObject(results.Content); return report; } } diff --git a/BrightLocal/src/BrightLocal/Services/ReviewFlow/ReviewFlowService.cs b/BrightLocal/src/BrightLocal/Services/ReviewFlow/ReviewFlowService.cs index 85173d1..8db1250 100644 --- a/BrightLocal/src/BrightLocal/Services/ReviewFlow/ReviewFlowService.cs +++ b/BrightLocal/src/BrightLocal/Services/ReviewFlow/ReviewFlowService.cs @@ -2,11 +2,11 @@ namespace BrightLocal { - public class ReviewFlowService : BrightLocalService + public class ReviewFlowService : BlService { public ReviewFlowService(string apiKey = null, string apiSecret = null) : base(apiKey, apiSecret) { } - BrightLocalRequestor request = new BrightLocalRequestor(); + BlRequestor request = new BlRequestor(); public virtual BlSuccess Create(ReviewFlowOptions createOptions) { @@ -24,12 +24,12 @@ public virtual BlSuccess Update(UpdateReviewFlowOptions updateOptions) return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalRfReport Get(int reportId) + public virtual BlRfReport Get(int reportId) { var url = string.Format(Urls.ReviewFlow + "{0}", reportId); var parameters = new Parameters.requestParameters(); var success = request.Get(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } public virtual BlSuccess Delete(int reportId) @@ -40,38 +40,38 @@ public virtual BlSuccess Delete(int reportId) return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalRfGetAll GetAll() + public virtual BlRfGetAll GetAll() { var url = string.Format(Urls.ReviewFlow); var parameters = new Parameters.requestParameters(); var success = request.Get(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalRfGetAll GetAll(int locationId) + public virtual BlRfGetAll GetAll(int locationId) { var url = string.Format(Urls.ReviewFlow); var parameters = new Parameters.requestParameters(); parameters.Add("location-id", locationId); var success = request.Get(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalRfGetAll Search(string query) + public virtual BlRfGetAll Search(string query) { var url = string.Format(Urls.ReviewFlow + "{0}", "search"); var parameters = new Parameters.requestParameters(); parameters.Add("q", query); var success = request.Get(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalRfReviews GetReviews(RfGetReviewsOptions getReviews) + public virtual BlRfReviews GetReviews(RfGetReviewsOptions getReviews) { var url = string.Format(Urls.ReviewFlow + "{0}" + "/reviews", getReviews.reportId); var parameters = Parameters.convertListToParameters(getReviews); var success = request.Get(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } public virtual BlSuccess GetReviewCount(int reportId) @@ -90,12 +90,12 @@ public virtual BlSuccess GetGrowth(int reportId) return JsonConvert.DeserializeObject(success.Content); } - public virtual BrightLocalRfDirectories GetDirectories(int reportId) + public virtual BlRfDirectories GetDirectories(int reportId) { var url = string.Format(Urls.ReviewFlow + "{0}" + "/directories", reportId); var parameters = new Parameters.requestParameters(); var success = request.Get(url, parameters, this.api_key, this.api_secret); - return JsonConvert.DeserializeObject(success.Content); + return JsonConvert.DeserializeObject(success.Content); } public virtual BrightLocalRfDirectoryStats GetDirectoryStats(int reportId) diff --git a/README.md b/README.md index 8bc5e67..0ff9e83 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ Next you will need to provide BrightLocal with your API key & API secret. There 2) In your application initialization, call this method (this is a programmatic way, but you only have to do it once during startup) ```csharp - BrightLocalConfiguration.SetApiCredentials("[your API key here]", "[your api secret here]"); + BlConfiguration.SetApiCredentials("[your API key here]", "[your api secret here]"); ``` 3) In any of the service constructors, you can optionally pass the API key & API secret (will be assigned that apikey for the life of the service instance). @@ -60,10 +60,10 @@ Clients var clientService = new ClientService(); - BrightLocalSuccess newClient = clientService.Create(myClient); + BlSuccess newClient = clientService.Create(myClient); ``` -The returned BrightLocalSuccess entity above will have a client-id. You will want to persist this for later. When you create a location you will be able to optionally assign it to a client ID. +The returned BlSuccess entity above will have a client-id. You will want to persist this for later. When you create a location you will be able to optionally assign it to a client ID. ### Update Client @@ -76,7 +76,7 @@ The returned BrightLocalSuccess entity above will have a client-id. You will wan var clientService = new ClientService(); - BrightLocalSuccess updateClient = clientService.Update(myClient); + BlSuccess updateClient = clientService.Update(myClient); ``` ### Delete Client @@ -85,7 +85,7 @@ The returned BrightLocalSuccess entity above will have a client-id. You will wan var clientId = 1; var clientService = new ClientService(); - BrightLocalSuccess deleteClient = clientService.Delete(clientId); + BlSuccess deleteClient = clientService.Delete(clientId); ``` ### Get Client @@ -94,7 +94,7 @@ The returned BrightLocalSuccess entity above will have a client-id. You will wan var clientId = 1; var clientService = new ClientService(); - BrightLocalClient client = clientService.Get(clientId); + BlClient client = clientService.Get(clientId); ``` ### Search Clients @@ -103,7 +103,7 @@ The returned BrightLocalSuccess entity above will have a client-id. You will wan var searchQuery = "le-bernardin"; var clientService = new ClientService(); - BrightLocalClientSearch results = clientService.Search(searchQuery); + BlClientSearch results = clientService.Search(searchQuery); ``` @@ -127,10 +127,10 @@ Locations var locationService = new LocationService(); - var BrightLocalSuccess = locationService.Create(myLocation); + var BlSuccess = locationService.Create(myLocation); ``` -The returned BrightLocalSuccess entity above will have a location-id. You will want to persist this for later. When you create a report you will be able to optionally assign it to a location id. +The returned BlSuccess entity above will have a location-id. You will want to persist this for later. When you create a report you will be able to optionally assign it to a location id. ### Update Location @@ -150,7 +150,7 @@ The returned BrightLocalSuccess entity above will have a location-id. You will w var locationService = new LocationService(); - BrightLocalSuccess updateLocation = locationService.Update(myLocation); + BlSuccess updateLocation = locationService.Update(myLocation); ``` ### Delete Location @@ -159,7 +159,7 @@ The returned BrightLocalSuccess entity above will have a location-id. You will w var locationId = 1; var locationService = new LocationService(); - BrightLocalSuccess deleteLocation = locationService.Delete(locationId); + BlSuccess deleteLocation = locationService.Delete(locationId); ``` ### Get Location @@ -168,7 +168,7 @@ The returned BrightLocalSuccess entity above will have a location-id. You will w var locationId = 1; var locationService = new LocationService(); - BrightLocalLocation getLocation = locationService.Get(locationId); + BlLocation getLocation = locationService.Get(locationId); ``` ### Search Locations @@ -177,7 +177,7 @@ The returned BrightLocalSuccess entity above will have a location-id. You will w var searchQuery = "le-bernardin"; var locationService = new LocationService(); - BrightLocalLocationSearch results = locationService.Search(searchQuery); + BlLocationSearch results = locationService.Search(searchQuery); ``` Local Search Rank Checker @@ -195,10 +195,10 @@ Local Search Rank Checker var lsrcService = new LsrcService(); - BrightLocalSuccess newLsrc = lsrcService.Create(myLsrc); + BlSuccess newLsrc = lsrcService.Create(myLsrc); ``` -The returned BrightLocalSuccess entity above will have a campaign-id. You will want to persist this for later in order to run and fetch the report. +The returned BlSuccess entity above will have a campaign-id. You will want to persist this for later in order to run and fetch the report. ### Update Report @@ -213,7 +213,7 @@ The returned BrightLocalSuccess entity above will have a campaign-id. You will w var lsrcService = new LsrcService(); - BrightLocalSuccess updatedLsrc = lsrcService.Update(myLsrc); + BlSuccess updatedLsrc = lsrcService.Update(myLsrc); ``` ### Delete Report @@ -222,7 +222,7 @@ The returned BrightLocalSuccess entity above will have a campaign-id. You will w var campaignId = 1; var lsrcService = new LsrcService(); - BrightLoBrightLocalSuccesscalLsrc deletedLsrc = lsrcService.Delete(campaignId); + BrightLoBlSuccesscalLsrc deletedLsrc = lsrcService.Delete(campaignId); ``` ### Get Reports @@ -230,7 +230,7 @@ The returned BrightLocalSuccess entity above will have a campaign-id. You will w ```csharp var lsrcService = new LsrcService(); - BrightLocalGetAllResults lsrcList = lsrcService.GetAll();; + BlGetAllResults lsrcList = lsrcService.GetAll();; ``` ### Get Report @@ -239,7 +239,7 @@ The returned BrightLocalSuccess entity above will have a campaign-id. You will w var campaignId = 1; var lsrcService = new LsrcService(); - BrightLocalLsrcReport myLsrc = lsrcService.Get(campaignId); + BlLsrcReport myLsrc = lsrcService.Get(campaignId); ``` ### Run Report @@ -248,7 +248,7 @@ The returned BrightLocalSuccess entity above will have a campaign-id. You will w var campaignId = 1; var lsrcService = new LsrcService(); - BrightLocalLsrc myLsrc = lsrcService.Run(campaignId); + BlLsrc myLsrc = lsrcService.Run(campaignId); ``` ### Get Report History @@ -257,7 +257,7 @@ The returned BrightLocalSuccess entity above will have a campaign-id. You will w var campaignId = 1; var lsrcService = new LsrcService(); - BrightLocalLsrcHistory lsrcHistory = lsrcService.GetHistory(campaignId); + BlLsrcHistory lsrcHistory = lsrcService.GetHistory(campaignId); ``` ### Get Report Results @@ -268,7 +268,7 @@ The returned BrightLocalSuccess entity above will have a campaign-id. You will w var lsrcService = new LsrcService(); - BrightLocalLsrcReportResults lsrcResults = lsrcService.GetResults(myLsrc); + BlLsrcReportResults lsrcResults = lsrcService.GetResults(myLsrc); ``` @@ -295,10 +295,10 @@ Local SEO Check-up var lscuService = new LscuService(); - BrightLocalSuccess newLscu = lscuService.Create(myLscu); + BlSuccess newLscu = lscuService.Create(myLscu); ``` -The returned BrightLocalSuccess entity above will have a report-id. You will want to persist this for later when you get and run a report. +The returned BlSuccess entity above will have a report-id. You will want to persist this for later when you get and run a report. ### Supplying Local Directory URLs (see local-directory-urls parameter) @@ -341,7 +341,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan var lscuService = new LscuService(); - BrightLocalSuccess updateLscu = lscuService.Update(myLscu); + BlSuccess updateLscu = lscuService.Update(myLscu); ``` ### Get Report @@ -350,7 +350,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan var reportId = 1; var lscuService = new LscuService(); - BrightLocalLscuReport lscuReport = lscuService.Get(reportId); + BlLscuReport lscuReport = lscuService.Get(reportId); ``` ### Run Report @@ -359,7 +359,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan var reportId = 1; var lscuService = new LscuService(); - BrightLocalSuccess success = lscuService.Run(reportId); + BlSuccess success = lscuService.Run(reportId); ``` The returned success entity above is of type string. Success or Failure with errors. @@ -369,7 +369,7 @@ The returned success entity above is of type string. Success or Failure with err var reportId = 1; var lscuService = new LscuService(); - BrightLocalSuccess success = lscuService.Delete(reportId); + BlSuccess success = lscuService.Delete(reportId); ``` The returned success entity above is of type string. Success or Failure with errors. @@ -379,7 +379,7 @@ The returned success entity above is of type string. Success or Failure with err var searchQuery = "Bodega Wine Bar"; var lscuService = new LscuService(); - BrightLocalLscuSearch lscuSearch = lscuService.Search(searchQuery); + BlLscuSearch lscuSearch = lscuService.Search(searchQuery); ``` Citation Tracker @@ -400,9 +400,9 @@ Citation Tracker var citationTrackerService = new CitationTrackerService(); - BrightLocalSuccess newCt = citationTrackerService.Create(myCt); + BlSuccess newCt = citationTrackerService.Create(myCt); ``` -The returned BrightLocalSuccess entity above will have a report-id. You will want to persist this for later in order to run and get the report. +The returned BlSuccess entity above will have a report-id. You will want to persist this for later in order to run and get the report. ### Update Report @@ -420,7 +420,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan var citationTrackerService = new CitationTrackerService(); - BrightLocalSuccess updateCt = citationTrackerService.Update(myCt); + BlSuccess updateCt = citationTrackerService.Update(myCt); ``` ### Get Report @@ -430,7 +430,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan var citationTrackerService = new CitationTrackerService(); - BrightLocalCitationTrackerReport myCt = citationTrackerService.Get(reportId); + BlCitationTrackerReport myCt = citationTrackerService.Get(reportId); ``` ### Run Report @@ -440,7 +440,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan var citationTrackerService = new CitationTrackerService(); - BrightLocalSuccess myCt = citationTrackerService.Run(reportId); + BlSuccess myCt = citationTrackerService.Run(reportId); ``` ### Delete Report @@ -450,7 +450,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan var citationTrackerService = new CitationTrackerService(); - BrightLocalSuccess myCt = citationTrackerService.Delete(reportId); + BlSuccess myCt = citationTrackerService.Delete(reportId); ``` ### Get Reports @@ -458,7 +458,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan ```csharp var citationTrackerService = new CitationTrackerService(); - BrightLocalCtGetAllResults ctResults = citationTrackerService.GetAll(); + BlCtGetAllResults ctResults = citationTrackerService.GetAll(); ``` ### Get Report Results @@ -467,7 +467,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan var reportId = 1; var citationTrackerService = new CitationTrackerService(); - BrightLocalCitationTrackerResults ctResults = citationTrackerService.GetReportResults(reportId); + BlCitationTrackerResults ctResults = citationTrackerService.GetReportResults(reportId); ``` Citation Burst @@ -517,9 +517,9 @@ Citation Burst var citationBurstService = new CitationBurstService(); - BrightLocalSuccess newCb = citationBurstService.Create(myCb); + BlSuccess newCb = citationBurstService.Create(myCb); ``` -The returned BrightLocalSuccess entity above will have a campaign-id. You will want to persist this for later in order to get citations, confirm & pay, etc. +The returned BlSuccess entity above will have a campaign-id. You will want to persist this for later in order to get citations, confirm & pay, etc. ### Update Campaign @@ -566,7 +566,7 @@ The returned BrightLocalSuccess entity above will have a campaign-id. You will w var citationBurstService = new CitationBurstService(); - BrightLocalSuccess newCb = citationBurstService.Update(myCb); + BlSuccess newCb = citationBurstService.Update(myCb); ``` ### Upload Image @@ -579,7 +579,7 @@ The returned BrightLocalSuccess entity above will have a campaign-id. You will w var citationBurstService = new CitationBurstService(); - BrightLocalSuccess cbImage = citationBurstService.UploadImage(image); + BlSuccess cbImage = citationBurstService.UploadImage(image); ``` ### Get Citations @@ -588,19 +588,19 @@ The returned BrightLocalSuccess entity above will have a campaign-id. You will w int campaingId = 1; var citationBurstService = new CitationBurstService(); - BrightLocalCitations citations = citationBurstService.GetCitations(campaingId); + BlCitations citations = citationBurstService.GetCitations(campaingId); ``` ### Confirm & Pay for Citation Campaign ```csharp - BrightLocalCbPayOptions confirmPay = new BrightLocalCbPayOptions(); + BlCbPayOptions confirmPay = new BlCbPayOptions(); confirmPay.campaign_id = 1; confirmPay.package_id = "cb15"; var citationBurstService = new CitationBurstService(); - BrightLocalSuccess confirm = citationBurstService.ConfirmAndPay(confirmPay); + BlSuccess confirm = citationBurstService.ConfirmAndPay(confirmPay); ``` ### Getting All Campaigns @@ -608,7 +608,7 @@ The returned BrightLocalSuccess entity above will have a campaign-id. You will w ```csharp var citationBurstService = new CitationBurstService(); - BrightLocalCbAllCampaigns results = citationBurstService.GetCampaigns(); + BlCbAllCampaigns results = citationBurstService.GetCampaigns(); ``` ### Get Campaign Details @@ -617,7 +617,7 @@ The returned BrightLocalSuccess entity above will have a campaign-id. You will w int campaignId = 1; var citationBurstService = new CitationBurstService(); - BrightLocalCbCampaign results = citationBurstService.GetCampaign(campaignId); + BlCbCampaign results = citationBurstService.GetCampaign(campaignId); ``` ### Get Credits Balance @@ -625,7 +625,7 @@ The returned BrightLocalSuccess entity above will have a campaign-id. You will w ```csharp var citationBurstService = new CitationBurstService(); - BrightLocalSuccess credits = citationBurstService.GetCredits(); + BlSuccess credits = citationBurstService.GetCredits(); ``` ReviewFLow Reports @@ -662,11 +662,11 @@ ReviewFLow Reports var rfService = new ReviewFlowService(); - BrightLocalSuccess newReviewReport = rfService.Create(myReviewReport); + BlSuccess newReviewReport = rfService.Create(myReviewReport); return newReviewReport; ``` -The returned BrightLocalSuccess entity above will have a report-id. You will want to persist this for later when you get a report. +The returned BlSuccess entity above will have a report-id. You will want to persist this for later when you get a report. ### Update Report @@ -700,7 +700,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan var rfService = new ReviewFlowService(); - BrightLocalSuccess updateReviewReport = rfService.Update(myReviewReport); + BlSuccess updateReviewReport = rfService.Update(myReviewReport); ``` ### Get Report @@ -709,7 +709,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan int reportId = 1; var rfService = new ReviewFlowService(); - BrightLocalRfReport reviewReport = rfService.Get(reportId); + BlRfReport reviewReport = rfService.Get(reportId); ``` ### Delete Report @@ -718,7 +718,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan int reportId = 1; var rfService = new ReviewFlowService(); - BrightLocalSuccess deleteReport = rfService.Delete(reportId); + BlSuccess deleteReport = rfService.Delete(reportId); ``` ### Get All Reports @@ -726,7 +726,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan ```csharp var rfService = new ReviewFlowService(); - BrightLocalRfGetAll results = rfService.GetAll(); + BlRfGetAll results = rfService.GetAll(); ``` ### Search Reports @@ -735,7 +735,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan string query = "New York"; var rfService = new ReviewFlowService(); - BrightLocalRfGetAll results = rfService.Search(query); + BlRfGetAll results = rfService.Search(query); ``` ### Get Reviews @@ -745,7 +745,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan myReviewReport.reportId = 1; var rfService = new ReviewFlowService(); - BrightLocalRfReviews reviews = rfService.GetReviews(myReviewReport); + BlRfReviews reviews = rfService.GetReviews(myReviewReport); ``` ### Get Review Counts @@ -754,7 +754,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan int reportId = 1; var rfService = new ReviewFlowService(); - BrightLocalSuccess reviewCount = rfService.GetReviewCount(reportId); + BlSuccess reviewCount = rfService.GetReviewCount(reportId); ``` ### Get Growth @@ -763,7 +763,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan int reportId = 1; var rfService = new ReviewFlowService(); - BrightLocalSuccess reviewGrowth = rfService.GetGrowth(reportId); + BlSuccess reviewGrowth = rfService.GetGrowth(reportId); ``` ### Get Directories @@ -772,7 +772,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan int reportId = 1; var rfService = new ReviewFlowService(); - BrightLocalRfDirectories reviewDirectories = rfService.GetDirectories(reportId); + BlRfDirectories reviewDirectories = rfService.GetDirectories(reportId); ``` ### Get Directory Stats @@ -781,7 +781,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan int reportId = 1; var rfService = new ReviewFlowService(); - BrightLocalRfDirectoryStats reviewDirectoryStats = rfService.GetDirectoryStats(reportId); + BlRfDirectoryStats reviewDirectoryStats = rfService.GetDirectoryStats(reportId); ``` ### Get Star Counts @@ -790,7 +790,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan int reportId = 1; var rfService = new ReviewFlowService(); - BrightLocalRfStarCounts reviewStarCount = rfService.GetStarCount(reportId); + BlRfStarCounts reviewStarCount = rfService.GetStarCount(reportId); ``` Google Plus Local Wizard Reports @@ -816,9 +816,9 @@ Google Plus Local Wizard Reports var gpwService = new GpwService(); - BrightLocalSuccess gpwReport = gpwService.Create(myGpwReport); + BlSuccess gpwReport = gpwService.Create(myGpwReport); ``` -The returned BrightLocalSuccess entity above will have a report-id. You will want to persist this for later in order to run and get the report. +The returned BlSuccess entity above will have a report-id. You will want to persist this for later in order to run and get the report. ### Update Report @@ -841,7 +841,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan var gpwService = new GpwService(); - BrightLocalSuccess gpwReport = gpwService.Update(myGpwReport); + BlSuccess gpwReport = gpwService.Update(myGpwReport); ``` ### Get Report @@ -850,7 +850,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan var reportId = 1; var gpwService = new GpwService(); - BrightLocalGpwReport gpwReport = gpwService.Get(reportId); + BlGpwReport gpwReport = gpwService.Get(reportId); ``` ### Delete Report @@ -859,7 +859,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan var reportId = 1; var gpwService = new GpwService(); - BrightLocalSuccess gpwReport = gpwService.Delete(reportId); + BlSuccess gpwReport = gpwService.Delete(reportId); ``` ### Get All Reports @@ -867,7 +867,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan ```csharp var gpwService = new GpwService(); - BrightLocalGpwGetAllResults gpwGetAllResults = gpwService.GetAll(); + BlGpwGetAllResults gpwGetAllResults = gpwService.GetAll(); ``` ### Run Report @@ -876,7 +876,7 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan var reportId = 1; var gpwService = new GpwService(); - BrightLocalSuccess gpwReport = gpwService.Run(reportId); + BlSuccess gpwReport = gpwService.Run(reportId); ``` ### Get Report Results @@ -885,5 +885,5 @@ The returned BrightLocalSuccess entity above will have a report-id. You will wan var reportId = 1; var gpwService = new GpwService(); - BrightLocalGpwReportResults gpwReport = gpwService.GetReportResults(reportId); + BlGpwReportResults gpwReport = gpwService.GetReportResults(reportId); ``` From 0549cef8aa70e217fbaf86095f7d526d3d721804 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Sat, 18 Feb 2017 12:07:24 -0700 Subject: [PATCH 92/93] removed "my" from all examples and docs --- .../Account-Methods/citationBurstExamples.cs | 146 +++--- .../citationTrackerExamples.cs | 54 +- .../Account-Methods/clientExamples.cs | 22 +- .../Account-Methods/gpwExamples.cs | 62 +-- .../Account-Methods/locationExamples.cs | 50 +- .../Account-Methods/lscuExamples.cs | 68 +-- .../Account-Methods/lsrcExamples.cs | 44 +- .../Account-Methods/rFExamples.cs | 56 +- README.md | 492 +++++++++--------- 9 files changed, 497 insertions(+), 497 deletions(-) diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationBurstExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationBurstExamples.cs index 95aab9c..69afee8 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationBurstExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationBurstExamples.cs @@ -9,45 +9,45 @@ public static BlSuccess Create() string brief_description = "Born in Paris in 1972 by sibling duo Maguy and Gilbert Le Coze, Le Bernardin only served fish: Fresh, simple and prepared with respect. After receiving its first Michelin star in 1976, and two more in 1980, the Le Coze’s set to open Le Bernardin in New York in 1986."; string full_description = "The restaurant has held three stars from the Michelin Guide since its 2005 New York launch and currently ranks 24 on the World’s 50 Best Restaurants list. The New York Zagat Guide has recognized Le Bernardin as top rated in the category of “Best Food” for the last nine consecutive years, and in 2015 was rated by the guide as New York City’s top restaurant for food and service. Le Bernardin has earned seven James Beard Awards since 1998 including “Outstanding Restaurant of the Year,” “Top Chef in New York City,” “Outstanding Service,” “Outstanding Chef in the United States,” “Outstanding Pastry Chef,” “Outstanding Wine Service,” and “Best Restaurant Design” in 2012. Most recently, the Foundation named Maguy Le Coze as Outstanding."; - CitationBurstOptions myCb = new CitationBurstOptions(); - myCb.businessName = "Le Bernardin"; - myCb.campaignName = "Sample Citation Burst Campaign"; - myCb.websiteAddress = "le-bernardin.com"; - myCb.campaignCountry = "USA"; - myCb.campaignState = "NY"; - myCb.campaignCity = "New York"; - myCb.businessCategoryId = 605; - myCb.businessCategories = new List() { "restaurant", "cafe" }; - myCb.address1 = "155 Weest 51st Street"; - myCb.address2 = ""; - myCb.postcode = "10019"; - myCb.contactName = "Hanane Moshe"; - myCb.contactFirstName = "Hanane"; - myCb.contactTelephone = "+1 212-554-1515"; - myCb.briefDescription = brief_description; - myCb.fullDescription = full_description; - myCb.employeesNumber = 35; - myCb.startYear = 1976; - myCb.workingHoursApplyToAll = 0; - myCb.workingHoursMonStart = 0800; - myCb.workingHoursMonEnd = 2200; - myCb.workingHoursTueStart = 0800; - myCb.workingHoursTueEnd = 2200; - myCb.workingHoursWedStart = 0800; - myCb.workingHoursWedEnd = 2200; - myCb.workingHoursThuStart = 0800; - myCb.workingHoursThuEnd = 2200; - myCb.workingHoursFriStart = 0800; - myCb.workingHoursFriEnd = 2200; - myCb.workingHoursSatStart = 1000; - myCb.workingHoursSatEnd = 2400; - myCb.workingHoursSunStart = 1000; - myCb.workingHoursSunEnd = 2400; - myCb.paymentMethods = "Cash|Visa"; + CitationBurstOptions cb = new CitationBurstOptions(); + cb.businessName = "Le Bernardin"; + cb.campaignName = "Sample Citation Burst Campaign"; + cb.websiteAddress = "le-bernardin.com"; + cb.campaignCountry = "USA"; + cb.campaignState = "NY"; + cb.campaignCity = "New York"; + cb.businessCategoryId = 605; + cb.businessCategories = new List() { "restaurant", "cafe" }; + cb.address1 = "155 Weest 51st Street"; + cb.address2 = ""; + cb.postcode = "10019"; + cb.contactName = "Hanane Moshe"; + cb.contactFirstName = "Hanane"; + cb.contactTelephone = "+1 212-554-1515"; + cb.briefDescription = brief_description; + cb.fullDescription = full_description; + cb.employeesNumber = 35; + cb.startYear = 1976; + cb.workingHoursApplyToAll = 0; + cb.workingHoursMonStart = 0800; + cb.workingHoursMonEnd = 2200; + cb.workingHoursTueStart = 0800; + cb.workingHoursTueEnd = 2200; + cb.workingHoursWedStart = 0800; + cb.workingHoursWedEnd = 2200; + cb.workingHoursThuStart = 0800; + cb.workingHoursThuEnd = 2200; + cb.workingHoursFriStart = 0800; + cb.workingHoursFriEnd = 2200; + cb.workingHoursSatStart = 1000; + cb.workingHoursSatEnd = 2400; + cb.workingHoursSunStart = 1000; + cb.workingHoursSunEnd = 2400; + cb.paymentMethods = "Cash|Visa"; var citationBurstService = new CitationBurstService(); - BlSuccess newCb = citationBurstService.Create(myCb); + BlSuccess newCb = citationBurstService.Create(cb); return newCb; } @@ -57,46 +57,46 @@ public static BlSuccess Update() string brief_description = "Born in Paris in 1972 by sibling duo Maguy and Gilbert Le Coze, Le Bernardin only served fish: Fresh, simple and prepared with respect. After receiving its first Michelin star in 1976, and two more in 1980, the Le Coze’s set to open Le Bernardin in New York in 1986."; string full_description = "The restaurant has held three stars from the Michelin Guide since its 2005 New York launch and currently ranks 24 on the World’s 50 Best Restaurants list. The New York Zagat Guide has recognized Le Bernardin as top rated in the category of “Best Food” for the last nine consecutive years, and in 2015 was rated by the guide as New York City’s top restaurant for food and service. Le Bernardin has earned seven James Beard Awards since 1998 including “Outstanding Restaurant of the Year,” “Top Chef in New York City,” “Outstanding Service,” “Outstanding Chef in the United States,” “Outstanding Pastry Chef,” “Outstanding Wine Service,” and “Best Restaurant Design” in 2012. Most recently, the Foundation named Maguy Le Coze as Outstanding."; - UpdateCitationBurstOptions myCb = new UpdateCitationBurstOptions(); - myCb.campaignId = 1; - myCb.businessName = "Le Bernardin"; - myCb.campaignName = "Sample Citation Burst Campaign"; - myCb.websiteAddress = "le-bernardin.com"; - myCb.campaignCountry = "USA"; - myCb.campaignState = "NY"; - myCb.campaignCity = "New York"; - myCb.businessCategoryId = 605; - myCb.businessCategories = new List() { "restaurant", "cafe" }; - myCb.address1 = "155 Weest 51st Street"; - myCb.address2 = ""; - myCb.postcode = "10019"; - myCb.contactName = "Hanane Moshe"; - myCb.contactFirstName = "Hanane"; - myCb.contactTelephone = "+1 212-554-1515"; - myCb.briefDescription = brief_description; - myCb.fullDescription = full_description; - myCb.employeesNumber = 35; - myCb.startYear = 1976; - myCb.workingHoursApplyToAll = 0; - myCb.workingHoursMonStart = 0800; - myCb.workingHoursMonEnd = 2200; - myCb.workingHoursTueStart = 0800; - myCb.workingHoursTueEnd = 2200; - myCb.workingHoursWedStart = 0800; - myCb.workingHoursWedEnd = 2200; - myCb.workingHoursThuStart = 0800; - myCb.workingHoursThuEnd = 2200; - myCb.workingHoursFriStart = 0800; - myCb.workingHoursFriEnd = 2200; - myCb.workingHoursSatStart = 1000; - myCb.workingHoursSatEnd = 2400; - myCb.workingHoursSunStart = 1000; - myCb.workingHoursSunEnd = 2400; - myCb.paymentMethods = "Cash|Visa"; + UpdateCitationBurstOptions cb = new UpdateCitationBurstOptions(); + cb.campaignId = 1; + cb.businessName = "Le Bernardin"; + cb.campaignName = "Sample Citation Burst Campaign"; + cb.websiteAddress = "le-bernardin.com"; + cb.campaignCountry = "USA"; + cb.campaignState = "NY"; + cb.campaignCity = "New York"; + cb.businessCategoryId = 605; + cb.businessCategories = new List() { "restaurant", "cafe" }; + cb.address1 = "155 Weest 51st Street"; + cb.address2 = ""; + cb.postcode = "10019"; + cb.contactName = "Hanane Moshe"; + cb.contactFirstName = "Hanane"; + cb.contactTelephone = "+1 212-554-1515"; + cb.briefDescription = brief_description; + cb.fullDescription = full_description; + cb.employeesNumber = 35; + cb.startYear = 1976; + cb.workingHoursApplyToAll = 0; + cb.workingHoursMonStart = 0800; + cb.workingHoursMonEnd = 2200; + cb.workingHoursTueStart = 0800; + cb.workingHoursTueEnd = 2200; + cb.workingHoursWedStart = 0800; + cb.workingHoursWedEnd = 2200; + cb.workingHoursThuStart = 0800; + cb.workingHoursThuEnd = 2200; + cb.workingHoursFriStart = 0800; + cb.workingHoursFriEnd = 2200; + cb.workingHoursSatStart = 1000; + cb.workingHoursSatEnd = 2400; + cb.workingHoursSunStart = 1000; + cb.workingHoursSunEnd = 2400; + cb.paymentMethods = "Cash|Visa"; var citationBurstService = new CitationBurstService(); - BlSuccess newCb = citationBurstService.Update(myCb); + BlSuccess newCb = citationBurstService.Update(cb); return newCb; } diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationTrackerExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationTrackerExamples.cs index fea1790..d6717e0 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationTrackerExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationTrackerExamples.cs @@ -4,39 +4,39 @@ public class citationTrackerExamples { public static BlSuccess Create() { - CitationTrackerOptions myCt = new CitationTrackerOptions(); - myCt.reportName = "Sample Citation Tracker Report"; - myCt.businessName = "Le Bernardin"; - myCt.website = "le-bernardin.com"; - myCt.businessType = "Restaurant"; - myCt.stateCode = "NY"; - myCt.postcode = "10019"; - myCt.phone = "+1 212-554-1515"; - myCt.country = "USA"; + CitationTrackerOptions ct = new CitationTrackerOptions(); + ct.reportName = "Sample Citation Tracker Report"; + ct.businessName = "Le Bernardin"; + ct.website = "le-bernardin.com"; + ct.businessType = "Restaurant"; + ct.stateCode = "NY"; + ct.postcode = "10019"; + ct.phone = "+1 212-554-1515"; + ct.country = "USA"; var citationTrackerService = new CitationTrackerService(); - BlSuccess newCt = citationTrackerService.Create(myCt); + BlSuccess newCt = citationTrackerService.Create(ct); return newCt; } public static BlSuccess Update() { - UpdateCitationTrackerOptions myCt = new UpdateCitationTrackerOptions(); - myCt.reportId = 682; - myCt.reportName = "Sample Citation Tracker Report"; - myCt.businessName = "Le Bernardin"; - myCt.website = "le-bernardin.com"; - myCt.businessType = "Restaurant"; - myCt.stateCode = "NY"; - myCt.postcode = "10019"; - myCt.phone = "+1 212-554-1515"; - myCt.country = "USA"; + UpdateCitationTrackerOptions ct = new UpdateCitationTrackerOptions(); + ct.reportId = 682; + ct.reportName = "Sample Citation Tracker Report"; + ct.businessName = "Le Bernardin"; + ct.website = "le-bernardin.com"; + ct.businessType = "Restaurant"; + ct.stateCode = "NY"; + ct.postcode = "10019"; + ct.phone = "+1 212-554-1515"; + ct.country = "USA"; var citationTrackerService = new CitationTrackerService(); - BlSuccess updateCt = citationTrackerService.Update(myCt); + BlSuccess updateCt = citationTrackerService.Update(ct); return updateCt; } @@ -47,9 +47,9 @@ public static BlCitationTrackerReport Get() var citationTrackerService = new CitationTrackerService(); - BlCitationTrackerReport myCt = citationTrackerService.Get(reportId); + BlCitationTrackerReport ct = citationTrackerService.Get(reportId); - return myCt; + return ct; } public static BlSuccess Run() @@ -58,9 +58,9 @@ public static BlSuccess Run() var citationTrackerService = new CitationTrackerService(); - BlSuccess myCt = citationTrackerService.Run(reportId); + BlSuccess ct = citationTrackerService.Run(reportId); - return myCt; + return ct; } public static BlSuccess Delete() @@ -69,9 +69,9 @@ public static BlSuccess Delete() var citationTrackerService = new CitationTrackerService(); - BlSuccess myCt = citationTrackerService.Delete(reportId); + BlSuccess ct = citationTrackerService.Delete(reportId); - return myCt; + return ct; } public static BlCtGetAllResults GetAll() diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs index 743515a..1722700 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs @@ -7,28 +7,28 @@ public class clientExamples { public static BlSuccess Create() { - var myClient = new ClientOptions(); - myClient.name = "Le Bernardin"; - myClient.companyUrl = "le-bernardin.com"; - myClient.businessCategoryId = 791; + var client = new ClientOptions(); + client.name = "Le Bernardin"; + client.companyUrl = "le-bernardin.com"; + client.businessCategoryId = 791; var clientService = new ClientService(); - BlSuccess newClient = clientService.Create(myClient); + BlSuccess newClient = clientService.Create(client); return newClient; } public static BlSuccess Update() { - var myClient = new UpdateClientOptions(); - myClient.clientId = 36447; - myClient.name = "Le Bernardin"; - myClient.companyUrl = "le-bernardin.com"; - myClient.businessCategoryId = 791; + var client = new UpdateClientOptions(); + client.clientId = 36447; + client.name = "Le Bernardin"; + client.companyUrl = "le-bernardin.com"; + client.businessCategoryId = 791; var clientService = new ClientService(); - BlSuccess updateClient = clientService.Update(myClient); + BlSuccess updateClient = clientService.Update(client); return updateClient; } diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/gpwExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/gpwExamples.cs index a8f6f81..c343c79 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/gpwExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/gpwExamples.cs @@ -10,48 +10,48 @@ public class gpwExamples { public static BlSuccess Create() { - var myGpwReport = new GpwOptions(); - myGpwReport.reportName = "Sample Citation Tracker Report"; - myGpwReport.businessNames = "Le Bernardin"; - myGpwReport.schedule = "Adhoc"; - myGpwReport.dayOfMonth = "2"; - myGpwReport.reportType = "with"; - myGpwReport.address1 = "155 Weest 51st Street"; - myGpwReport.address2 = ""; - myGpwReport.city = "NYC"; - myGpwReport.stateCode = "NY"; - myGpwReport.postcode = "10019"; - myGpwReport.phoneNumber = "+1 212-554-1515"; - myGpwReport.country = "USA"; - myGpwReport.searchTerms = JsonConvert.SerializeObject(new List() { "restaurant manhattan", "cafe new york" }); + var gpwReport = new GpwOptions(); + gpwReport.reportName = "Sample Citation Tracker Report"; + gpwReport.businessNames = "Le Bernardin"; + gpwReport.schedule = "Adhoc"; + gpwReport.dayOfMonth = "2"; + gpwReport.reportType = "with"; + gpwReport.address1 = "155 Weest 51st Street"; + gpwReport.address2 = ""; + gpwReport.city = "NYC"; + gpwReport.stateCode = "NY"; + gpwReport.postcode = "10019"; + gpwReport.phoneNumber = "+1 212-554-1515"; + gpwReport.country = "USA"; + gpwReport.searchTerms = JsonConvert.SerializeObject(new List() { "restaurant manhattan", "cafe new york" }); var gpwService = new GpwService(); - BlSuccess gpwReport = gpwService.Create(myGpwReport); + BlSuccess gpwReport = gpwService.Create(gpwReport); return gpwReport; } public static BlSuccess Update() { - var myGpwReport = new UpdateGpwOptions(); - myGpwReport.reportId = 1; - myGpwReport.reportName = "Sample Citation Tracker Report"; - myGpwReport.businessNames = "Le Bernardin"; - myGpwReport.schedule = "Adhoc"; - myGpwReport.dayOfMonth = "2"; - myGpwReport.reportType = "with"; - myGpwReport.address1 = "155 Weest 51st Street"; - myGpwReport.address2 = ""; - myGpwReport.city = "NYC"; - myGpwReport.stateCode = "NY"; - myGpwReport.postcode = "10019"; - myGpwReport.phoneNumber = "+1 212-554-1515"; - myGpwReport.country = "USA"; - myGpwReport.searchTerms = JsonConvert.SerializeObject(new List() { "restaurant manhattan", "cafe new york" }); + var gpwReport = new UpdateGpwOptions(); + gpwReport.reportId = 1; + gpwReport.reportName = "Sample Citation Tracker Report"; + gpwReport.businessNames = "Le Bernardin"; + gpwReport.schedule = "Adhoc"; + gpwReport.dayOfMonth = "2"; + gpwReport.reportType = "with"; + gpwReport.address1 = "155 Weest 51st Street"; + gpwReport.address2 = ""; + gpwReport.city = "NYC"; + gpwReport.stateCode = "NY"; + gpwReport.postcode = "10019"; + gpwReport.phoneNumber = "+1 212-554-1515"; + gpwReport.country = "USA"; + gpwReport.searchTerms = JsonConvert.SerializeObject(new List() { "restaurant manhattan", "cafe new york" }); var gpwService = new GpwService(); - BlSuccess gpwReport = gpwService.Update(myGpwReport); + BlSuccess gpwReport = gpwService.Update(gpwReport); return gpwReport; } diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/locationExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/locationExamples.cs index 6ca5033..77813cc 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/locationExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/locationExamples.cs @@ -7,42 +7,42 @@ public class locationExamples { public static BlSuccess Create() { - var myLocation = new LocationOptions(); - myLocation.name = "Le Bernardin"; - myLocation.url = "le-bernardin.com"; - myLocation.businessCategoryId = 791; - myLocation.country = "USA"; - myLocation.address1 = "155 Weest 51st Street"; - myLocation.address2 = ""; - myLocation.region = "NY"; // state or region - myLocation.city = "New York"; - myLocation.postcode = "10019"; - myLocation.telephone = "+1 212-554-1515"; + var location = new LocationOptions(); + location.name = "Le Bernardin"; + location.url = "le-bernardin.com"; + location.businessCategoryId = 791; + location.country = "USA"; + location.address1 = "155 Weest 51st Street"; + location.address2 = ""; + location.region = "NY"; // state or region + location.city = "New York"; + location.postcode = "10019"; + location.telephone = "+1 212-554-1515"; var locationService = new LocationService(); - BlSuccess newLocation = locationService.Create(myLocation); + BlSuccess newLocation = locationService.Create(location); return newLocation; } public static BlSuccess Update() { - var myLocation = new UpdateLocationOptions(); - myLocation.locationId = 1; - myLocation.name = "Le Bernardin"; - myLocation.url = "le-bernardin.com"; - myLocation.businessCategoryId = 791; - myLocation.country = "USA"; - myLocation.address1 = "155 Weest 51st Street"; - myLocation.address2 = ""; - myLocation.region = "NY"; // state or region - myLocation.city = "New York"; - myLocation.postcode = "10019"; - myLocation.telephone = "+1 212-554-1515"; + var location = new UpdateLocationOptions(); + location.locationId = 1; + location.name = "Le Bernardin"; + location.url = "le-bernardin.com"; + location.businessCategoryId = 791; + location.country = "USA"; + location.address1 = "155 Weest 51st Street"; + location.address2 = ""; + location.region = "NY"; // state or region + location.city = "New York"; + location.postcode = "10019"; + location.telephone = "+1 212-554-1515"; var locationService = new LocationService(); - BlSuccess updateLocation = locationService.Update(myLocation); + BlSuccess updateLocation = locationService.Update(location); return updateLocation; } diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lscuExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lscuExamples.cs index cf2526f..7b3f101 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lscuExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lscuExamples.cs @@ -10,32 +10,32 @@ public class lscuExamples { public static BlSuccess Create() { - LscuOptions myLscu = new LscuOptions(); - myLscu.reportName = "Sample SEO Chek-Up Report"; - myLscu.businessNames = JsonConvert.SerializeObject(new List() {"Le Bernardin", "Le Bernardin Cafe"}); - myLscu.websiteAddress = "le-bernardin.com"; - myLscu.address1 = "155 Weest 51st Street"; - myLscu.address2 = ""; - myLscu.city = "New York"; - myLscu.stateCode = "NY"; - myLscu.postcode = "10019"; - myLscu.telephone = "+1 212-554-1515"; - myLscu.country = "USA"; - myLscu.businessCategory = "Restaurant"; - myLscu.primaryBusinessLocation = "NY, New York"; - myLscu.searchTerms = JsonConvert.SerializeObject(new List() { "restaurant manhattan", "cafe new york" }); + LscuOptions lscu = new LscuOptions(); + lscu.reportName = "Sample SEO Chek-Up Report"; + lscu.businessNames = JsonConvert.SerializeObject(new List() {"Le Bernardin", "Le Bernardin Cafe"}); + lscu.websiteAddress = "le-bernardin.com"; + lscu.address1 = "155 Weest 51st Street"; + lscu.address2 = ""; + lscu.city = "New York"; + lscu.stateCode = "NY"; + lscu.postcode = "10019"; + lscu.telephone = "+1 212-554-1515"; + lscu.country = "USA"; + lscu.businessCategory = "Restaurant"; + lscu.primaryBusinessLocation = "NY, New York"; + lscu.searchTerms = JsonConvert.SerializeObject(new List() { "restaurant manhattan", "cafe new york" }); // Example for supplying Local Directory URLs (see local-directory-urls parameter) - myLscu.localDirectoryUrls = new LocalDirectoryUrls(); - myLscu.localDirectoryUrls.Add( + lscu.localDirectoryUrls = new LocalDirectoryUrls(); + lscu.localDirectoryUrls.Add( "citysearch", new DirectoryUrls { url = null, include = "yes" }); - myLscu.localDirectoryUrls.Add( + lscu.localDirectoryUrls.Add( "dexknows", new DirectoryUrls { @@ -45,32 +45,32 @@ public static BlSuccess Create() var lscuService = new LscuService(); - BlSuccess newLscu = lscuService.Create(myLscu); + BlSuccess newLscu = lscuService.Create(lscu); return newLscu; } public static BlSuccess Update() { - UpdateLscuOptions myLscu = new UpdateLscuOptions(); - myLscu.reportId = 1; - myLscu.reportName = "Sample SEO Chek-Up Report"; - myLscu.businessNames = JsonConvert.SerializeObject(new List() { "Le Bernardin", "Le Bernardin Cafe" }); - myLscu.websiteAddress = "le-bernardin.com"; - myLscu.address1 = "155 Weest 51st Street"; - myLscu.address2 = ""; - myLscu.city = "New York"; - myLscu.stateCode = "NY"; - myLscu.postcode = "10019"; - myLscu.telephone = "+1 212-554-1515"; - myLscu.country = "USA"; - myLscu.businessCategory = "Restaurant"; - myLscu.primaryBusinessLocation = "NY, New York"; - myLscu.searchTerms = JsonConvert.SerializeObject(new List() { "restaurant manhattan", "cafe new york" }); + UpdateLscuOptions lscu = new UpdateLscuOptions(); + lscu.reportId = 1; + lscu.reportName = "Sample SEO Chek-Up Report"; + lscu.businessNames = JsonConvert.SerializeObject(new List() { "Le Bernardin", "Le Bernardin Cafe" }); + lscu.websiteAddress = "le-bernardin.com"; + lscu.address1 = "155 Weest 51st Street"; + lscu.address2 = ""; + lscu.city = "New York"; + lscu.stateCode = "NY"; + lscu.postcode = "10019"; + lscu.telephone = "+1 212-554-1515"; + lscu.country = "USA"; + lscu.businessCategory = "Restaurant"; + lscu.primaryBusinessLocation = "NY, New York"; + lscu.searchTerms = JsonConvert.SerializeObject(new List() { "restaurant manhattan", "cafe new york" }); var lscuService = new LscuService(); - BlSuccess updateLscu = lscuService.Update(myLscu); + BlSuccess updateLscu = lscuService.Update(lscu); return updateLscu; } diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs index 7df1e43..7b07fb8 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs @@ -10,32 +10,32 @@ public class lsrcExamples { public static BlSuccess Create() { - var myLsrc = new LsrcOptions(); - myLsrc.name = "Le Bernardin"; - myLsrc.websiteAddresses = JsonConvert.SerializeObject(new List() {"le-bernardin.com", "www.le-bernadin.com"}); - myLsrc.searchTerms = "Restaurant, food+nyc, delivery+midtown+manhattan"; - myLsrc.schedule = "Adhoc"; - myLsrc.searchEngines = "google, google-mobile, google-local, yahoo, yahoo-local, bing, bing-local"; + var lsrc = new LsrcOptions(); + lsrc.name = "Le Bernardin"; + lsrc.websiteAddresses = JsonConvert.SerializeObject(new List() {"le-bernardin.com", "www.le-bernadin.com"}); + lsrc.searchTerms = "Restaurant, food+nyc, delivery+midtown+manhattan"; + lsrc.schedule = "Adhoc"; + lsrc.searchEngines = "google, google-mobile, google-local, yahoo, yahoo-local, bing, bing-local"; var lsrcService = new LsrcService(); - BlSuccess newLsrc = lsrcService.Create(myLsrc); + BlSuccess newLsrc = lsrcService.Create(lsrc); return newLsrc; } public static BlSuccess Update() { - var myLsrc = new UpdateLsrcOptions(); - myLsrc.campaignId = 1; - myLsrc.name = "Le Bernardin"; - myLsrc.websiteAddresses = JsonConvert.SerializeObject(new List() { "le-bernardin.com", "www.le-bernadin.com" }); - myLsrc.searchTerms = "Restaurant, food+nyc, delivery+midtown+manhattan"; - myLsrc.schedule = "Adhoc"; - myLsrc.searchEngines = "google, google-mobile, google-local, yahoo, yahoo-local, bing, bing-local"; + var lsrc = new UpdateLsrcOptions(); + lsrc.campaignId = 1; + lsrc.name = "Le Bernardin"; + lsrc.websiteAddresses = JsonConvert.SerializeObject(new List() { "le-bernardin.com", "www.le-bernadin.com" }); + lsrc.searchTerms = "Restaurant, food+nyc, delivery+midtown+manhattan"; + lsrc.schedule = "Adhoc"; + lsrc.searchEngines = "google, google-mobile, google-local, yahoo, yahoo-local, bing, bing-local"; var lsrcService = new LsrcService(); - BlSuccess updatedLsrc = lsrcService.Update(myLsrc); + BlSuccess updatedLsrc = lsrcService.Update(lsrc); return updatedLsrc; } @@ -61,8 +61,8 @@ public static BlLsrcReport GetReport() var campaignId = 1; var lsrcService = new LsrcService(); - BlLsrcReport myLsrc = lsrcService.Get(campaignId); - return myLsrc; + BlLsrcReport lsrc = lsrcService.Get(campaignId); + return lsrc; } public static BlSuccess Run() @@ -70,8 +70,8 @@ public static BlSuccess Run() var campaignId = 1; var lsrcService = new LsrcService(); - BlSuccess myLsrc = lsrcService.Run(campaignId); - return myLsrc; + BlSuccess lsrc = lsrcService.Run(campaignId); + return lsrc; } public static BlLsrcHistory GetHistory() @@ -85,12 +85,12 @@ public static BlLsrcHistory GetHistory() public static BlLsrcReportResults GetReportResults() { - var myLsrc = new GetResultsLsrcOptions(); - myLsrc.campaignId = 1; + var lsrc = new GetResultsLsrcOptions(); + lsrc.campaignId = 1; var lsrcService = new LsrcService(); - var lsrcResults = lsrcService.GetResults(myLsrc); + var lsrcResults = lsrcService.GetResults(lsrc); return lsrcResults; } } diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/rFExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/rFExamples.cs index be0aa5c..1d48982 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/rFExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/rFExamples.cs @@ -9,25 +9,25 @@ public class rFExamples { public static BlSuccess Create() { - var myReviewReport = new ReviewFlowOptions(); - myReviewReport.reportName = "Sample Citation Tracker Report"; - myReviewReport.businessName = "Le Bernardin"; - myReviewReport.contactTelephone = "+1 212-554-1515"; - myReviewReport.address1 = "155 Weest 51st Street"; - myReviewReport.address2 = ""; - myReviewReport.city = "NYC"; - myReviewReport.postcode = "10019"; - myReviewReport.country = "USA"; + var reviewReport = new ReviewFlowOptions(); + reviewReport.reportName = "Sample Citation Tracker Report"; + reviewReport.businessName = "Le Bernardin"; + reviewReport.contactTelephone = "+1 212-554-1515"; + reviewReport.address1 = "155 Weest 51st Street"; + reviewReport.address2 = ""; + reviewReport.city = "NYC"; + reviewReport.postcode = "10019"; + reviewReport.country = "USA"; // Example for supplying Local Directory URLs (see local-directory-urls parameter) - myReviewReport.directories.Add( + reviewReport.directories.Add( "citysearch", new Directories { url = "http://www.yelp.co.uk/biz/greens-restaurant-san-francisco-3", include = true }); - myReviewReport.directories.Add( + reviewReport.directories.Add( "dexknows", new Directories { @@ -37,32 +37,32 @@ public static BlSuccess Create() var rfService = new ReviewFlowService(); - BlSuccess newReviewReport = rfService.Create(myReviewReport); + BlSuccess newReviewReport = rfService.Create(reviewReport); return newReviewReport; } public static BlSuccess Update() { - var myReviewReport = new UpdateReviewFlowOptions(); - myReviewReport.reportId = 1; - myReviewReport.reportName = "Sample Citation Tracker Report"; - myReviewReport.businessName = "Le Bernardin"; - myReviewReport.contactTelephone = "+1 212-554-1515"; - myReviewReport.address1 = "155 Weest 51st Street"; - myReviewReport.address2 = ""; - myReviewReport.city = "NYC"; - myReviewReport.postcode = "10019"; - myReviewReport.country = "USA"; + var reviewReport = new UpdateReviewFlowOptions(); + reviewReport.reportId = 1; + reviewReport.reportName = "Sample Citation Tracker Report"; + reviewReport.businessName = "Le Bernardin"; + reviewReport.contactTelephone = "+1 212-554-1515"; + reviewReport.address1 = "155 Weest 51st Street"; + reviewReport.address2 = ""; + reviewReport.city = "NYC"; + reviewReport.postcode = "10019"; + reviewReport.country = "USA"; // Example for supplying Local Directory URLs (see local-directory-urls parameter) - myReviewReport.directories.Add( + reviewReport.directories.Add( "citysearch", new Directories { url = "http://www.yelp.co.uk/biz/greens-restaurant-san-francisco-3", include = true }); - myReviewReport.directories.Add( + reviewReport.directories.Add( "dexknows", new Directories { @@ -72,7 +72,7 @@ public static BlSuccess Update() var rfService = new ReviewFlowService(); - BlSuccess updateReviewReport = rfService.Update(myReviewReport); + BlSuccess updateReviewReport = rfService.Update(reviewReport); return updateReviewReport; } @@ -113,11 +113,11 @@ public static BlRfGetAll SearchReport() public static BlRfReviews GetReviews() { - var myReviewReport = new RfGetReviewsOptions(); - myReviewReport.reportId = 1; + var reviewReport = new RfGetReviewsOptions(); + reviewReport.reportId = 1; var rfService = new ReviewFlowService(); - BlRfReviews reviews = rfService.GetReviews(myReviewReport); + BlRfReviews reviews = rfService.GetReviews(reviewReport); return reviews; } diff --git a/README.md b/README.md index 0ff9e83..517c476 100644 --- a/README.md +++ b/README.md @@ -53,14 +53,14 @@ Clients ### Add Client ```csharp - var myClient = new ClientOptions(); - myClient.name = "Le Bernardin"; - myClient.companyUrl = "le-bernardin.com"; - myClient.businessCategoryId = 791; + var client = new ClientOptions(); + client.name = "Le Bernardin"; + client.companyUrl = "le-bernardin.com"; + client.businessCategoryId = 791; var clientService = new ClientService(); - BlSuccess newClient = clientService.Create(myClient); + BlSuccess newClient = clientService.Create(client); ``` The returned BlSuccess entity above will have a client-id. You will want to persist this for later. When you create a location you will be able to optionally assign it to a client ID. @@ -68,15 +68,15 @@ The returned BlSuccess entity above will have a client-id. You will want to pers ### Update Client ```csharp - var myClient = new UpdateClientOptions(); - myClient.clientId = 36447; - myClient.name = "Le Bernardin"; - myClient.companyUrl = "le-bernardin.com"; - myClient.businessCategoryId = 791; + var client = new UpdateClientOptions(); + client.clientId = 36447; + client.name = "Le Bernardin"; + client.companyUrl = "le-bernardin.com"; + client.businessCategoryId = 791; var clientService = new ClientService(); - BlSuccess updateClient = clientService.Update(myClient); + BlSuccess updateClient = clientService.Update(client); ``` ### Delete Client @@ -113,21 +113,21 @@ Locations ### Add Location ```csharp - var myLocation = new LocationOptions(); - myLocation.name = "Le Bernardin"; - myLocation.url = "le-bernardin.com"; - myLocation.businessCategoryId = 791; - myLocation.country = "USA"; - myLocation.address1 = "155 Weest 51st Street"; - myLocation.address2 = ""; - myLocation.region = "NY"; // state or region - myLocation.city = "New York"; - myLocation.postcode = "10019"; - myLocation.telephone = "+1 212-554-1515"; + var location = new LocationOptions(); + location.name = "Le Bernardin"; + location.url = "le-bernardin.com"; + location.businessCategoryId = 791; + location.country = "USA"; + location.address1 = "155 Weest 51st Street"; + location.address2 = ""; + location.region = "NY"; // state or region + location.city = "New York"; + location.postcode = "10019"; + location.telephone = "+1 212-554-1515"; var locationService = new LocationService(); - var BlSuccess = locationService.Create(myLocation); + var BlSuccess = locationService.Create(location); ``` The returned BlSuccess entity above will have a location-id. You will want to persist this for later. When you create a report you will be able to optionally assign it to a location id. @@ -135,22 +135,22 @@ The returned BlSuccess entity above will have a location-id. You will want to pe ### Update Location ```csharp - var myLocation = new UpdateLocationOptions(); - myLocation.locationId = 1; - myLocation.name = "Le Bernardin"; - myLocation.url = "le-bernardin.com"; - myLocation.businessCategoryId = 791; - myLocation.country = "USA"; - myLocation.address1 = "155 Weest 51st Street"; - myLocation.address2 = ""; - myLocation.region = "NY"; // state or region - myLocation.city = "New York"; - myLocation.postcode = "10019"; - myLocation.telephone = "+1 212-554-1515"; + var location = new UpdateLocationOptions(); + location.locationId = 1; + location.name = "Le Bernardin"; + location.url = "le-bernardin.com"; + location.businessCategoryId = 791; + location.country = "USA"; + location.address1 = "155 Weest 51st Street"; + location.address2 = ""; + location.region = "NY"; // state or region + location.city = "New York"; + location.postcode = "10019"; + location.telephone = "+1 212-554-1515"; var locationService = new LocationService(); - BlSuccess updateLocation = locationService.Update(myLocation); + BlSuccess updateLocation = locationService.Update(location); ``` ### Delete Location @@ -186,16 +186,16 @@ Local Search Rank Checker ### Add Report ```csharp - var myLsrc = new LsrcOptions(); - myLsrc.name = "Le Bernardin"; - myLsrc.websiteAddresses = JsonConvert.SerializeObject(new List() {"le-bernardin.com", "www.le-bernadin.com"}); - myLsrc.searchTerms = "Restaurant, food+nyc, delivery+midtown+manhattan"; - myLsrc.schedule = "Adhoc"; - myLsrc.searchEngines = "google, google-mobile, google-local, yahoo, yahoo-local, bing, bing-local"; + var lsrc = new LsrcOptions(); + lsrc.name = "Le Bernardin"; + lsrc.websiteAddresses = JsonConvert.SerializeObject(new List() {"le-bernardin.com", "www.le-bernadin.com"}); + lsrc.searchTerms = "Restaurant, food+nyc, delivery+midtown+manhattan"; + lsrc.schedule = "Adhoc"; + lsrc.searchEngines = "google, google-mobile, google-local, yahoo, yahoo-local, bing, bing-local"; var lsrcService = new LsrcService(); - BlSuccess newLsrc = lsrcService.Create(myLsrc); + BlSuccess newLsrc = lsrcService.Create(lsrc); ``` The returned BlSuccess entity above will have a campaign-id. You will want to persist this for later in order to run and fetch the report. @@ -203,17 +203,17 @@ The returned BlSuccess entity above will have a campaign-id. You will want to pe ### Update Report ```csharp - var myLsrc = new UpdateLsrcOptions(); - myLsrc.campaignId = 1; - myLsrc.name = "Le Bernardin"; - myLsrc.websiteAddresses = JsonConvert.SerializeObject(new List() { "le-bernardin.com", "www.le-bernadin.com" }); - myLsrc.searchTerms = "Restaurant, food+nyc, delivery+midtown+manhattan"; - myLsrc.schedule = "Adhoc"; - myLsrc.searchEngines = "google, google-mobile, google-local, yahoo, yahoo-local, bing, bing-local"; + var lsrc = new UpdateLsrcOptions(); + lsrc.campaignId = 1; + lsrc.name = "Le Bernardin"; + lsrc.websiteAddresses = JsonConvert.SerializeObject(new List() { "le-bernardin.com", "www.le-bernadin.com" }); + lsrc.searchTerms = "Restaurant, food+nyc, delivery+midtown+manhattan"; + lsrc.schedule = "Adhoc"; + lsrc.searchEngines = "google, google-mobile, google-local, yahoo, yahoo-local, bing, bing-local"; var lsrcService = new LsrcService(); - BlSuccess updatedLsrc = lsrcService.Update(myLsrc); + BlSuccess updatedLsrc = lsrcService.Update(lsrc); ``` ### Delete Report @@ -239,7 +239,7 @@ The returned BlSuccess entity above will have a campaign-id. You will want to pe var campaignId = 1; var lsrcService = new LsrcService(); - BlLsrcReport myLsrc = lsrcService.Get(campaignId); + BlLsrcReport lsrc = lsrcService.Get(campaignId); ``` ### Run Report @@ -248,7 +248,7 @@ The returned BlSuccess entity above will have a campaign-id. You will want to pe var campaignId = 1; var lsrcService = new LsrcService(); - BlLsrc myLsrc = lsrcService.Run(campaignId); + BlLsrc lsrc = lsrcService.Run(campaignId); ``` ### Get Report History @@ -263,12 +263,12 @@ The returned BlSuccess entity above will have a campaign-id. You will want to pe ### Get Report Results ```csharp - var myLsrc = new GetResultsLsrcOptions(); - myLsrc.campaignId = 1; + var lsrc = new GetResultsLsrcOptions(); + lsrc.campaignId = 1; var lsrcService = new LsrcService(); - BlLsrcReportResults lsrcResults = lsrcService.GetResults(myLsrc); + BlLsrcReportResults lsrcResults = lsrcService.GetResults(lsrc); ``` @@ -278,24 +278,24 @@ Local SEO Check-up ### Add Report ```csharp - LscuOptions myLscu = new LscuOptions(); - myLscu.reportName = "Sample SEO Chek-Up Report"; - myLscu.businessNames = JsonConvert.SerializeObject(new List() {"Le Bernardin", "Le Bernardin Cafe"}); - myLscu.websiteAddress = "le-bernardin.com"; - myLscu.address1 = "155 Weest 51st Street"; - myLscu.address2 = ""; - myLscu.city = "New York"; - myLscu.stateCode = "NY"; - myLscu.postcode = "10019"; - myLscu.telephone = "+1 212-554-1515"; - myLscu.country = "USA"; - myLscu.businessCategory = "Restaurant"; - myLscu.primaryBusinessLocation = "NY, New York"; - myLscu.searchTerms = JsonConvert.SerializeObject(new List() { "restaurant manhattan", "cafe new york" }); + LscuOptions lscu = new LscuOptions(); + lscu.reportName = "Sample SEO Chek-Up Report"; + lscu.businessNames = JsonConvert.SerializeObject(new List() {"Le Bernardin", "Le Bernardin Cafe"}); + lscu.websiteAddress = "le-bernardin.com"; + lscu.address1 = "155 Weest 51st Street"; + lscu.address2 = ""; + lscu.city = "New York"; + lscu.stateCode = "NY"; + lscu.postcode = "10019"; + lscu.telephone = "+1 212-554-1515"; + lscu.country = "USA"; + lscu.businessCategory = "Restaurant"; + lscu.primaryBusinessLocation = "NY, New York"; + lscu.searchTerms = JsonConvert.SerializeObject(new List() { "restaurant manhattan", "cafe new york" }); var lscuService = new LscuService(); - BlSuccess newLscu = lscuService.Create(myLscu); + BlSuccess newLscu = lscuService.Create(lscu); ``` The returned BlSuccess entity above will have a report-id. You will want to persist this for later when you get and run a report. @@ -303,15 +303,15 @@ The returned BlSuccess entity above will have a report-id. You will want to pers ### Supplying Local Directory URLs (see local-directory-urls parameter) ```csharp - myLscu.localDirectoryUrls = new LocalDirectoryUrls(); - myLscu.localDirectoryUrls.Add( + lscu.localDirectoryUrls = new LocalDirectoryUrls(); + lscu.localDirectoryUrls.Add( "citysearch", new DirectoryUrls { url = "http://www.yelp.co.uk/biz/greens-restaurant-san-francisco-3", include = "yes" }); - myLscu.localDirectoryUrls.Add( + lscu.localDirectoryUrls.Add( "dexknows", new DirectoryUrls { @@ -323,25 +323,25 @@ The returned BlSuccess entity above will have a report-id. You will want to pers ### Update Report ```csharp - UpdateLscuOptions myLscu = new UpdateLscuOptions(); - myLscu.reportId = 1; - myLscu.reportName = "Sample SEO Chek-Up Report"; - myLscu.businessNames = JsonConvert.SerializeObject(new List() { "Le Bernardin", "Le Bernardin Cafe" }); - myLscu.websiteAddress = "le-bernardin.com"; - myLscu.address1 = "155 Weest 51st Street"; - myLscu.address2 = ""; - myLscu.city = "New York"; - myLscu.stateCode = "NY"; - myLscu.postcode = "10019"; - myLscu.telephone = "+1 212-554-1515"; - myLscu.country = "USA"; - myLscu.businessCategory = "Restaurant"; - myLscu.primaryBusinessLocation = "NY, New York"; - myLscu.searchTerms = JsonConvert.SerializeObject(new List() { "restaurant manhattan", "cafe new york" }); + UpdateLscuOptions lscu = new UpdateLscuOptions(); + lscu.reportId = 1; + lscu.reportName = "Sample SEO Chek-Up Report"; + lscu.businessNames = JsonConvert.SerializeObject(new List() { "Le Bernardin", "Le Bernardin Cafe" }); + lscu.websiteAddress = "le-bernardin.com"; + lscu.address1 = "155 Weest 51st Street"; + lscu.address2 = ""; + lscu.city = "New York"; + lscu.stateCode = "NY"; + lscu.postcode = "10019"; + lscu.telephone = "+1 212-554-1515"; + lscu.country = "USA"; + lscu.businessCategory = "Restaurant"; + lscu.primaryBusinessLocation = "NY, New York"; + lscu.searchTerms = JsonConvert.SerializeObject(new List() { "restaurant manhattan", "cafe new york" }); var lscuService = new LscuService(); - BlSuccess updateLscu = lscuService.Update(myLscu); + BlSuccess updateLscu = lscuService.Update(lscu); ``` ### Get Report @@ -388,39 +388,39 @@ Citation Tracker ### Add Report ```csharp - CitationTrackerOptions myCt = new CitationTrackerOptions(); - myCt.reportName = "Sample Citation Tracker Report"; - myCt.businessName = "Le Bernardin"; - myCt.website = "le-bernardin.com"; - myCt.businessType = "Restaurant"; - myCt.stateCode = "NY"; - myCt.postcode = "10019"; - myCt.phone = "+1 212-554-1515"; - myCt.country = "USA"; + CitationTrackerOptions ct = new CitationTrackerOptions(); + ct.reportName = "Sample Citation Tracker Report"; + ct.businessName = "Le Bernardin"; + ct.website = "le-bernardin.com"; + ct.businessType = "Restaurant"; + ct.stateCode = "NY"; + ct.postcode = "10019"; + ct.phone = "+1 212-554-1515"; + ct.country = "USA"; var citationTrackerService = new CitationTrackerService(); - BlSuccess newCt = citationTrackerService.Create(myCt); + BlSuccess newCt = citationTrackerService.Create(ct); ``` The returned BlSuccess entity above will have a report-id. You will want to persist this for later in order to run and get the report. ### Update Report ```csharp - UpdateCitationTrackerOptions myCt = new UpdateCitationTrackerOptions(); - myCt.reportId = 682; - myCt.reportName = "Sample Citation Tracker Report"; - myCt.businessName = "Le Bernardin"; - myCt.website = "le-bernardin.com"; - myCt.businessType = "Restaurant"; - myCt.stateCode = "NY"; - myCt.postcode = "10019"; - myCt.phone = "+1 212-554-1515"; - myCt.country = "USA"; + UpdateCitationTrackerOptions ct = new UpdateCitationTrackerOptions(); + ct.reportId = 682; + ct.reportName = "Sample Citation Tracker Report"; + ct.businessName = "Le Bernardin"; + ct.website = "le-bernardin.com"; + ct.businessType = "Restaurant"; + ct.stateCode = "NY"; + ct.postcode = "10019"; + ct.phone = "+1 212-554-1515"; + ct.country = "USA"; var citationTrackerService = new CitationTrackerService(); - BlSuccess updateCt = citationTrackerService.Update(myCt); + BlSuccess updateCt = citationTrackerService.Update(ct); ``` ### Get Report @@ -430,7 +430,7 @@ The returned BlSuccess entity above will have a report-id. You will want to pers var citationTrackerService = new CitationTrackerService(); - BlCitationTrackerReport myCt = citationTrackerService.Get(reportId); + BlCitationTrackerReport ct = citationTrackerService.Get(reportId); ``` ### Run Report @@ -440,7 +440,7 @@ The returned BlSuccess entity above will have a report-id. You will want to pers var citationTrackerService = new CitationTrackerService(); - BlSuccess myCt = citationTrackerService.Run(reportId); + BlSuccess ct = citationTrackerService.Run(reportId); ``` ### Delete Report @@ -450,7 +450,7 @@ The returned BlSuccess entity above will have a report-id. You will want to pers var citationTrackerService = new CitationTrackerService(); - BlSuccess myCt = citationTrackerService.Delete(reportId); + BlSuccess ct = citationTrackerService.Delete(reportId); ``` ### Get Reports @@ -479,45 +479,45 @@ Citation Burst string brief_description = "Born in Paris in 1972 by sibling duo Maguy and Gilbert Le Coze, Le Bernardin only served fish: Fresh, simple and prepared with respect. After receiving its first Michelin star in 1976, and two more in 1980, the Le Coze’s set to open Le Bernardin in New York in 1986."; string full_description = "The restaurant has held three stars from the Michelin Guide since its 2005 New York launch and currently ranks 24 on the World’s 50 Best Restaurants list. The New York Zagat Guide has recognized Le Bernardin as top rated in the category of “Best Food” for the last nine consecutive years, and in 2015 was rated by the guide as New York City’s top restaurant for food and service. Le Bernardin has earned seven James Beard Awards since 1998 including “Outstanding Restaurant of the Year,” “Top Chef in New York City,” “Outstanding Service,” “Outstanding Chef in the United States,” “Outstanding Pastry Chef,” “Outstanding Wine Service,” and “Best Restaurant Design” in 2012. Most recently, the Foundation named Maguy Le Coze as Outstanding."; - CitationBurstOptions myCb = new CitationBurstOptions(); - myCb.businessName = "Le Bernardin"; - myCb.campaignName = "Sample Citation Burst Campaign"; - myCb.websiteAddress = "le-bernardin.com"; - myCb.campaignCountry = "USA"; - myCb.campaignState = "NY"; - myCb.campaignCity = "New York"; - myCb.businessCategoryId = 605; - myCb.businessCategories = new List() { "restaurant", "cafe" }; - myCb.address1 = "155 Weest 51st Street"; - myCb.address2 = ""; - myCb.postcode = "10019"; - myCb.contactName = "Hanane Moshe"; - myCb.contactFirstName = "Hanane"; - myCb.contactTelephone = "+1 212-554-1515"; - myCb.briefDescription = brief_description; - myCb.fullDescription = full_description; - myCb.employeesNumber = 35; - myCb.startYear = 1976; - myCb.workingHoursApplyToAll = 0; - myCb.workingHoursMonStart = 0800; - myCb.workingHoursMonEnd = 2200; - myCb.workingHoursTueStart = 0800; - myCb.workingHoursTueEnd = 2200; - myCb.workingHoursWedStart = 0800; - myCb.workingHoursWedEnd = 2200; - myCb.workingHoursThuStart = 0800; - myCb.workingHoursThuEnd = 2200; - myCb.workingHoursFriStart = 0800; - myCb.workingHoursFriEnd = 2200; - myCb.workingHoursSatStart = 1000; - myCb.workingHoursSatEnd = 2400; - myCb.workingHoursSunStart = 1000; - myCb.workingHoursSunEnd = 2400; - myCb.paymentMethods = "Cash|Visa"; + CitationBurstOptions cb = new CitationBurstOptions(); + cb.businessName = "Le Bernardin"; + cb.campaignName = "Sample Citation Burst Campaign"; + cb.websiteAddress = "le-bernardin.com"; + cb.campaignCountry = "USA"; + cb.campaignState = "NY"; + cb.campaignCity = "New York"; + cb.businessCategoryId = 605; + cb.businessCategories = new List() { "restaurant", "cafe" }; + cb.address1 = "155 Weest 51st Street"; + cb.address2 = ""; + cb.postcode = "10019"; + cb.contactName = "Hanane Moshe"; + cb.contactFirstName = "Hanane"; + cb.contactTelephone = "+1 212-554-1515"; + cb.briefDescription = brief_description; + cb.fullDescription = full_description; + cb.employeesNumber = 35; + cb.startYear = 1976; + cb.workingHoursApplyToAll = 0; + cb.workingHoursMonStart = 0800; + cb.workingHoursMonEnd = 2200; + cb.workingHoursTueStart = 0800; + cb.workingHoursTueEnd = 2200; + cb.workingHoursWedStart = 0800; + cb.workingHoursWedEnd = 2200; + cb.workingHoursThuStart = 0800; + cb.workingHoursThuEnd = 2200; + cb.workingHoursFriStart = 0800; + cb.workingHoursFriEnd = 2200; + cb.workingHoursSatStart = 1000; + cb.workingHoursSatEnd = 2400; + cb.workingHoursSunStart = 1000; + cb.workingHoursSunEnd = 2400; + cb.paymentMethods = "Cash|Visa"; var citationBurstService = new CitationBurstService(); - BlSuccess newCb = citationBurstService.Create(myCb); + BlSuccess newCb = citationBurstService.Create(cb); ``` The returned BlSuccess entity above will have a campaign-id. You will want to persist this for later in order to get citations, confirm & pay, etc. @@ -527,46 +527,46 @@ The returned BlSuccess entity above will have a campaign-id. You will want to pe string brief_description = "Born in Paris in 1972 by sibling duo Maguy and Gilbert Le Coze, Le Bernardin only served fish: Fresh, simple and prepared with respect. After receiving its first Michelin star in 1976, and two more in 1980, the Le Coze’s set to open Le Bernardin in New York in 1986."; string full_description = "The restaurant has held three stars from the Michelin Guide since its 2005 New York launch and currently ranks 24 on the World’s 50 Best Restaurants list. The New York Zagat Guide has recognized Le Bernardin as top rated in the category of “Best Food” for the last nine consecutive years, and in 2015 was rated by the guide as New York City’s top restaurant for food and service. Le Bernardin has earned seven James Beard Awards since 1998 including “Outstanding Restaurant of the Year,” “Top Chef in New York City,” “Outstanding Service,” “Outstanding Chef in the United States,” “Outstanding Pastry Chef,” “Outstanding Wine Service,” and “Best Restaurant Design” in 2012. Most recently, the Foundation named Maguy Le Coze as Outstanding."; - UpdateCitationBurstOptions myCb = new UpdateCitationBurstOptions(); - myCb.campaignId = 1; - myCb.businessName = "Le Bernardin"; - myCb.campaignName = "Sample Citation Burst Campaign"; - myCb.websiteAddress = "le-bernardin.com"; - myCb.campaignCountry = "USA"; - myCb.campaignState = "NY"; - myCb.campaignCity = "New York"; - myCb.businessCategoryId = 605; - myCb.businessCategories = new List() { "restaurant", "cafe" }; - myCb.address1 = "155 Weest 51st Street"; - myCb.address2 = ""; - myCb.postcode = "10019"; - myCb.contactName = "Hanane Moshe"; - myCb.contactFirstName = "Hanane"; - myCb.contactTelephone = "+1 212-554-1515"; - myCb.briefDescription = brief_description; - myCb.fullDescription = full_description; - myCb.employeesNumber = 35; - myCb.startYear = 1976; - myCb.workingHoursApplyToAll = 0; - myCb.workingHoursMonStart = 0800; - myCb.workingHoursMonEnd = 2200; - myCb.workingHoursTueStart = 0800; - myCb.workingHoursTueEnd = 2200; - myCb.workingHoursWedStart = 0800; - myCb.workingHoursWedEnd = 2200; - myCb.workingHoursThuStart = 0800; - myCb.workingHoursThuEnd = 2200; - myCb.workingHoursFriStart = 0800; - myCb.workingHoursFriEnd = 2200; - myCb.workingHoursSatStart = 1000; - myCb.workingHoursSatEnd = 2400; - myCb.workingHoursSunStart = 1000; - myCb.workingHoursSunEnd = 2400; - myCb.paymentMethods = "Cash|Visa"; + UpdateCitationBurstOptions cb = new UpdateCitationBurstOptions(); + cb.campaignId = 1; + cb.businessName = "Le Bernardin"; + cb.campaignName = "Sample Citation Burst Campaign"; + cb.websiteAddress = "le-bernardin.com"; + cb.campaignCountry = "USA"; + cb.campaignState = "NY"; + cb.campaignCity = "New York"; + cb.businessCategoryId = 605; + cb.businessCategories = new List() { "restaurant", "cafe" }; + cb.address1 = "155 Weest 51st Street"; + cb.address2 = ""; + cb.postcode = "10019"; + cb.contactName = "Hanane Moshe"; + cb.contactFirstName = "Hanane"; + cb.contactTelephone = "+1 212-554-1515"; + cb.briefDescription = brief_description; + cb.fullDescription = full_description; + cb.employeesNumber = 35; + cb.startYear = 1976; + cb.workingHoursApplyToAll = 0; + cb.workingHoursMonStart = 0800; + cb.workingHoursMonEnd = 2200; + cb.workingHoursTueStart = 0800; + cb.workingHoursTueEnd = 2200; + cb.workingHoursWedStart = 0800; + cb.workingHoursWedEnd = 2200; + cb.workingHoursThuStart = 0800; + cb.workingHoursThuEnd = 2200; + cb.workingHoursFriStart = 0800; + cb.workingHoursFriEnd = 2200; + cb.workingHoursSatStart = 1000; + cb.workingHoursSatEnd = 2400; + cb.workingHoursSunStart = 1000; + cb.workingHoursSunEnd = 2400; + cb.paymentMethods = "Cash|Visa"; var citationBurstService = new CitationBurstService(); - BlSuccess newCb = citationBurstService.Update(myCb); + BlSuccess newCb = citationBurstService.Update(cb); ``` ### Upload Image @@ -634,25 +634,25 @@ ReviewFLow Reports ### Add Report ```csharp - var myReviewReport = new ReviewFlowOptions(); - myReviewReport.reportName = "Sample Citation Tracker Report"; - myReviewReport.businessName = "Le Bernardin"; - myReviewReport.contactTelephone = "+1 212-554-1515"; - myReviewReport.address1 = "155 Weest 51st Street"; - myReviewReport.address2 = ""; - myReviewReport.city = "NYC"; - myReviewReport.postcode = "10019"; - myReviewReport.country = "USA"; + var reviewReport = new ReviewFlowOptions(); + reviewReport.reportName = "Sample Citation Tracker Report"; + reviewReport.businessName = "Le Bernardin"; + reviewReport.contactTelephone = "+1 212-554-1515"; + reviewReport.address1 = "155 Weest 51st Street"; + reviewReport.address2 = ""; + reviewReport.city = "NYC"; + reviewReport.postcode = "10019"; + reviewReport.country = "USA"; // Example for supplying Local Directory URLs (see local-directory-urls parameter) - myReviewReport.directories.Add( + reviewReport.directories.Add( "citysearch", new Directories { url = "http://www.yelp.co.uk/biz/greens-restaurant-san-francisco-3", include = true }); - myReviewReport.directories.Add( + reviewReport.directories.Add( "dexknows", new Directories { @@ -662,7 +662,7 @@ ReviewFLow Reports var rfService = new ReviewFlowService(); - BlSuccess newReviewReport = rfService.Create(myReviewReport); + BlSuccess newReviewReport = rfService.Create(reviewReport); return newReviewReport; ``` @@ -671,26 +671,26 @@ The returned BlSuccess entity above will have a report-id. You will want to pers ### Update Report ```csharp - var myReviewReport = new UpdateReviewFlowOptions(); - myReviewReport.reportId = 1; - myReviewReport.reportName = "Sample Citation Tracker Report"; - myReviewReport.businessName = "Le Bernardin"; - myReviewReport.contactTelephone = "+1 212-554-1515"; - myReviewReport.address1 = "155 Weest 51st Street"; - myReviewReport.address2 = ""; - myReviewReport.city = "NYC"; - myReviewReport.postcode = "10019"; - myReviewReport.country = "USA"; + var reviewReport = new UpdateReviewFlowOptions(); + reviewReport.reportId = 1; + reviewReport.reportName = "Sample Citation Tracker Report"; + reviewReport.businessName = "Le Bernardin"; + reviewReport.contactTelephone = "+1 212-554-1515"; + reviewReport.address1 = "155 Weest 51st Street"; + reviewReport.address2 = ""; + reviewReport.city = "NYC"; + reviewReport.postcode = "10019"; + reviewReport.country = "USA"; // Example for supplying Local Directory URLs (see local-directory-urls parameter) - myReviewReport.directories.Add( + reviewReport.directories.Add( "citysearch", new Directories { url = "http://www.yelp.co.uk/biz/greens-restaurant-san-francisco-3", include = true }); - myReviewReport.directories.Add( + reviewReport.directories.Add( "dexknows", new Directories { @@ -700,7 +700,7 @@ The returned BlSuccess entity above will have a report-id. You will want to pers var rfService = new ReviewFlowService(); - BlSuccess updateReviewReport = rfService.Update(myReviewReport); + BlSuccess updateReviewReport = rfService.Update(reviewReport); ``` ### Get Report @@ -741,11 +741,11 @@ The returned BlSuccess entity above will have a report-id. You will want to pers ### Get Reviews ```csharp - var myReviewReport = new RfGetReviewsOptions(); - myReviewReport.reportId = 1; + var reviewReport = new RfGetReviewsOptions(); + reviewReport.reportId = 1; var rfService = new ReviewFlowService(); - BlRfReviews reviews = rfService.GetReviews(myReviewReport); + BlRfReviews reviews = rfService.GetReviews(reviewReport); ``` ### Get Review Counts @@ -799,49 +799,49 @@ Google Plus Local Wizard Reports ### Add Report ```csharp - var myGpwReport = new GpwOptions(); - myGpwReport.reportName = "Sample Citation Tracker Report"; - myGpwReport.businessNames = "Le Bernardin"; - myGpwReport.schedule = "Adhoc"; - myGpwReport.dayOfMonth = "2"; - myGpwReport.reportType = "with"; - myGpwReport.address1 = "155 Weest 51st Street"; - myGpwReport.address2 = ""; - myGpwReport.city = "NYC"; - myGpwReport.stateCode = "NY"; - myGpwReport.postcode = "10019"; - myGpwReport.phoneNumber = "+1 212-554-1515"; - myGpwReport.country = "USA"; - myGpwReport.searchTerms = new List() { "restaurant manhattan", "cafe new york" }; + var gpwReport = new GpwOptions(); + gpwReport.reportName = "Sample Citation Tracker Report"; + gpwReport.businessNames = "Le Bernardin"; + gpwReport.schedule = "Adhoc"; + gpwReport.dayOfMonth = "2"; + gpwReport.reportType = "with"; + gpwReport.address1 = "155 Weest 51st Street"; + gpwReport.address2 = ""; + gpwReport.city = "NYC"; + gpwReport.stateCode = "NY"; + gpwReport.postcode = "10019"; + gpwReport.phoneNumber = "+1 212-554-1515"; + gpwReport.country = "USA"; + gpwReport.searchTerms = new List() { "restaurant manhattan", "cafe new york" }; var gpwService = new GpwService(); - BlSuccess gpwReport = gpwService.Create(myGpwReport); + BlSuccess gpwReport = gpwService.Create(gpwReport); ``` The returned BlSuccess entity above will have a report-id. You will want to persist this for later in order to run and get the report. ### Update Report ```csharp - var myGpwReport = new UpdateGpwOptions(); - myGpwReport.reportId = 1; - myGpwReport.reportName = "Sample Citation Tracker Report"; - myGpwReport.businessNames = "Le Bernardin"; - myGpwReport.schedule = "Adhoc"; - myGpwReport.dayOfMonth = "2"; - myGpwReport.reportType = "with"; - myGpwReport.address1 = "155 Weest 51st Street"; - myGpwReport.address2 = ""; - myGpwReport.city = "NYC"; - myGpwReport.stateCode = "NY"; - myGpwReport.postcode = "10019"; - myGpwReport.phoneNumber = "+1 212-554-1515"; - myGpwReport.country = "USA"; - myGpwReport.searchTerms = new List() { "restaurant manhattan", "cafe new york" }; + var gpwReport = new UpdateGpwOptions(); + gpwReport.reportId = 1; + gpwReport.reportName = "Sample Citation Tracker Report"; + gpwReport.businessNames = "Le Bernardin"; + gpwReport.schedule = "Adhoc"; + gpwReport.dayOfMonth = "2"; + gpwReport.reportType = "with"; + gpwReport.address1 = "155 Weest 51st Street"; + gpwReport.address2 = ""; + gpwReport.city = "NYC"; + gpwReport.stateCode = "NY"; + gpwReport.postcode = "10019"; + gpwReport.phoneNumber = "+1 212-554-1515"; + gpwReport.country = "USA"; + gpwReport.searchTerms = new List() { "restaurant manhattan", "cafe new york" }; var gpwService = new GpwService(); - BlSuccess gpwReport = gpwService.Update(myGpwReport); + BlSuccess gpwReport = gpwService.Update(gpwReport); ``` ### Get Report From fb9934bffcafe4c0b075de8114effedd956e54f7 Mon Sep 17 00:00:00 2001 From: Hanane Moshe Date: Sat, 18 Feb 2017 12:33:53 -0700 Subject: [PATCH 93/93] Fixed naming convention for all services removed the word "options" --- .../BrightLocal/Entities/BlClientSearch.cs | 4 +- .../BrightLocal/Entities/BlLocationSearch.cs | 4 +- .../Account-Methods/citationBurstExamples.cs | 40 +++++------ .../citationTrackerExamples.cs | 4 +- .../Account-Methods/clientExamples.cs | 4 +- .../Account-Methods/gpwExamples.cs | 12 ++-- .../Account-Methods/locationExamples.cs | 4 +- .../Account-Methods/lscuExamples.cs | 4 +- .../Account-Methods/lsrcExamples.cs | 6 +- .../Account-Methods/rFExamples.cs | 6 +- .../Batch-Methods/rankingsExamples.cs | 8 +-- .../CitationBurst/BrightLocalCbPayOptions.cs | 2 +- ...tationBurstOptions.cs => CitationBurst.cs} | 2 +- .../CitationBurst/CitationBurstService.cs | 20 +++--- ...BurstOptions.cs => UpdateCitationBurst.cs} | 2 +- ...onTrackerOptions.cs => CitationTracker.cs} | 2 +- .../CitationTracker/CitationTrackerService.cs | 8 +-- ...kerOptions.cs => UpdateCitationTracker.cs} | 2 +- .../Clients/{ClientOptions.cs => Client.cs} | 2 +- .../Services/Clients/ClientService.cs | 8 +-- ...UpdateClientOptions.cs => UpdateClient.cs} | 2 +- .../GpwReports/{GpwOptions.cs => Gpw.cs} | 2 +- .../Services/GpwReports/GpwService.cs | 10 +-- .../{UpdateGpwOptions.cs => UpdateGpw.cs} | 2 +- .../{LocationOptions.cs => Location.cs} | 2 +- .../Services/Locations/LocationService.cs | 10 +-- ...teLocationOptions.cs => UpdateLocation.cs} | 2 +- .../Services/Lscu/{LscuOptions.cs => Lscu.cs} | 2 +- .../BrightLocal/Services/Lscu/LscuService.cs | 8 +-- .../{UpdateLscuOptions.cs => UpdateLscu.cs} | 2 +- ...esultsLsrcOptions.cs => GetResultsLsrc.cs} | 2 +- .../Services/Lsrc/{LsrcOptions.cs => Lsrc.cs} | 2 +- .../BrightLocal/Services/Lsrc/LsrcService.cs | 34 ++++----- .../{UpdateLsrcOptions.cs => UpdateLsrc.cs} | 2 +- .../{ReviewFlowOptions.cs => ReviewFlow.cs} | 4 +- .../Services/ReviewFlow/ReviewFlowService.cs | 12 ++-- ...RfGetReviewsOptions.cs => RfGetReviews.cs} | 2 +- ...viewFlowOptions.cs => UpdateReviewFlow.cs} | 2 +- BrightLocal/src/BrightLocal/project.json | 2 +- README.md | 70 +++++++++---------- 40 files changed, 159 insertions(+), 159 deletions(-) rename BrightLocal/src/BrightLocal/Services/CitationBurst/{CitationBurstOptions.cs => CitationBurst.cs} (99%) rename BrightLocal/src/BrightLocal/Services/CitationBurst/{UpdateCitationBurstOptions.cs => UpdateCitationBurst.cs} (99%) rename BrightLocal/src/BrightLocal/Services/CitationTracker/{CitationTrackerOptions.cs => CitationTracker.cs} (97%) rename BrightLocal/src/BrightLocal/Services/CitationTracker/{UpdateCitationTrackerOptions.cs => UpdateCitationTracker.cs} (97%) rename BrightLocal/src/BrightLocal/Services/Clients/{ClientOptions.cs => Client.cs} (93%) rename BrightLocal/src/BrightLocal/Services/Clients/{UpdateClientOptions.cs => UpdateClient.cs} (93%) rename BrightLocal/src/BrightLocal/Services/GpwReports/{GpwOptions.cs => Gpw.cs} (98%) rename BrightLocal/src/BrightLocal/Services/GpwReports/{UpdateGpwOptions.cs => UpdateGpw.cs} (98%) rename BrightLocal/src/BrightLocal/Services/Locations/{LocationOptions.cs => Location.cs} (98%) rename BrightLocal/src/BrightLocal/Services/Locations/{UpdateLocationOptions.cs => UpdateLocation.cs} (98%) rename BrightLocal/src/BrightLocal/Services/Lscu/{LscuOptions.cs => Lscu.cs} (98%) rename BrightLocal/src/BrightLocal/Services/Lscu/{UpdateLscuOptions.cs => UpdateLscu.cs} (98%) rename BrightLocal/src/BrightLocal/Services/Lsrc/{GetResultsLsrcOptions.cs => GetResultsLsrc.cs} (90%) rename BrightLocal/src/BrightLocal/Services/Lsrc/{LsrcOptions.cs => Lsrc.cs} (98%) rename BrightLocal/src/BrightLocal/Services/Lsrc/{UpdateLsrcOptions.cs => UpdateLsrc.cs} (98%) rename BrightLocal/src/BrightLocal/Services/ReviewFlow/{ReviewFlowOptions.cs => ReviewFlow.cs} (96%) rename BrightLocal/src/BrightLocal/Services/ReviewFlow/{RfGetReviewsOptions.cs => RfGetReviews.cs} (93%) rename BrightLocal/src/BrightLocal/Services/ReviewFlow/{UpdateReviewFlowOptions.cs => UpdateReviewFlow.cs} (97%) diff --git a/BrightLocal/src/BrightLocal/Entities/BlClientSearch.cs b/BrightLocal/src/BrightLocal/Entities/BlClientSearch.cs index 7aee7a1..1d3dbca 100644 --- a/BrightLocal/src/BrightLocal/Entities/BlClientSearch.cs +++ b/BrightLocal/src/BrightLocal/Entities/BlClientSearch.cs @@ -11,10 +11,10 @@ public class BlClientSearch [JsonProperty("success")] public bool success { get; set; } [JsonProperty("clients")] - public List clients { get; set; } + public List clients { get; set; } } - public class Client + public class ClientSearch { [JsonProperty("client-id")] public int clientId { get; set; } diff --git a/BrightLocal/src/BrightLocal/Entities/BlLocationSearch.cs b/BrightLocal/src/BrightLocal/Entities/BlLocationSearch.cs index 8efe7a5..a4c8a42 100644 --- a/BrightLocal/src/BrightLocal/Entities/BlLocationSearch.cs +++ b/BrightLocal/src/BrightLocal/Entities/BlLocationSearch.cs @@ -9,10 +9,10 @@ public class BlLocationSearch [JsonProperty("success")] public bool success { get; set; } [JsonProperty("locations")] - public List locations { get; set; } + public List locations { get; set; } } - public class Location + public class LocationSearch { [JsonProperty("location-id")] public int locationId { get; set; } diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationBurstExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationBurstExamples.cs index 69afee8..aece904 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationBurstExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationBurstExamples.cs @@ -2,14 +2,14 @@ namespace BrightLocal.Examples_version2.Account_Methods { - public class citationBurstExamples + public class CitationBurstExamples { public static BlSuccess Create() { string brief_description = "Born in Paris in 1972 by sibling duo Maguy and Gilbert Le Coze, Le Bernardin only served fish: Fresh, simple and prepared with respect. After receiving its first Michelin star in 1976, and two more in 1980, the Le Coze’s set to open Le Bernardin in New York in 1986."; string full_description = "The restaurant has held three stars from the Michelin Guide since its 2005 New York launch and currently ranks 24 on the World’s 50 Best Restaurants list. The New York Zagat Guide has recognized Le Bernardin as top rated in the category of “Best Food” for the last nine consecutive years, and in 2015 was rated by the guide as New York City’s top restaurant for food and service. Le Bernardin has earned seven James Beard Awards since 1998 including “Outstanding Restaurant of the Year,” “Top Chef in New York City,” “Outstanding Service,” “Outstanding Chef in the United States,” “Outstanding Pastry Chef,” “Outstanding Wine Service,” and “Best Restaurant Design” in 2012. Most recently, the Foundation named Maguy Le Coze as Outstanding."; - CitationBurstOptions cb = new CitationBurstOptions(); + CitationBurst cb = new CitationBurst(); cb.businessName = "Le Bernardin"; cb.campaignName = "Sample Citation Burst Campaign"; cb.websiteAddress = "le-bernardin.com"; @@ -45,9 +45,9 @@ public static BlSuccess Create() cb.workingHoursSunEnd = 2400; cb.paymentMethods = "Cash|Visa"; - var citationBurstService = new CitationBurstService(); + var CitationBurstService = new CitationBurstService(); - BlSuccess newCb = citationBurstService.Create(cb); + BlSuccess newCb = CitationBurstService.Create(cb); return newCb; } @@ -57,7 +57,7 @@ public static BlSuccess Update() string brief_description = "Born in Paris in 1972 by sibling duo Maguy and Gilbert Le Coze, Le Bernardin only served fish: Fresh, simple and prepared with respect. After receiving its first Michelin star in 1976, and two more in 1980, the Le Coze’s set to open Le Bernardin in New York in 1986."; string full_description = "The restaurant has held three stars from the Michelin Guide since its 2005 New York launch and currently ranks 24 on the World’s 50 Best Restaurants list. The New York Zagat Guide has recognized Le Bernardin as top rated in the category of “Best Food” for the last nine consecutive years, and in 2015 was rated by the guide as New York City’s top restaurant for food and service. Le Bernardin has earned seven James Beard Awards since 1998 including “Outstanding Restaurant of the Year,” “Top Chef in New York City,” “Outstanding Service,” “Outstanding Chef in the United States,” “Outstanding Pastry Chef,” “Outstanding Wine Service,” and “Best Restaurant Design” in 2012. Most recently, the Foundation named Maguy Le Coze as Outstanding."; - UpdateCitationBurstOptions cb = new UpdateCitationBurstOptions(); + UpdateCitationBurst cb = new UpdateCitationBurst(); cb.campaignId = 1; cb.businessName = "Le Bernardin"; cb.campaignName = "Sample Citation Burst Campaign"; @@ -94,9 +94,9 @@ public static BlSuccess Update() cb.workingHoursSunEnd = 2400; cb.paymentMethods = "Cash|Visa"; - var citationBurstService = new CitationBurstService(); + var CitationBurstService = new CitationBurstService(); - BlSuccess newCb = citationBurstService.Update(cb); + BlSuccess newCb = CitationBurstService.Update(cb); return newCb; } @@ -108,9 +108,9 @@ public static BlSuccess UploadImage() image.file = "/path/to/image.jpg"; image.imageType = "logo"; - var citationBurstService = new CitationBurstService(); + var CitationBurstService = new CitationBurstService(); - BlSuccess cbImage = citationBurstService.UploadImage(image); + BlSuccess cbImage = CitationBurstService.UploadImage(image); return cbImage; } @@ -119,31 +119,31 @@ public static BlCitations GetCitations() { int campaingId = 1; - var citationBurstService = new CitationBurstService(); + var CitationBurstService = new CitationBurstService(); - BlCitations citations = citationBurstService.GetCitations(campaingId); + BlCitations citations = CitationBurstService.GetCitations(campaingId); return citations; } public static BlSuccess ConfirmAndPay() { - BrightLocalCbPayOptions confirmPay = new BrightLocalCbPayOptions(); + BrightLocalCbPay confirmPay = new BrightLocalCbPay(); confirmPay.campaign_id = 1; confirmPay.package_id = "cb15"; - var citationBurstService = new CitationBurstService(); + var CitationBurstService = new CitationBurstService(); - BlSuccess confirm = citationBurstService.ConfirmAndPay(confirmPay); + BlSuccess confirm = CitationBurstService.ConfirmAndPay(confirmPay); return confirm; } public static BlCbAllCampaigns GetAll() { - var citationBurstService = new CitationBurstService(); + var CitationBurstService = new CitationBurstService(); - BlCbAllCampaigns results = citationBurstService.GetCampaigns(); + BlCbAllCampaigns results = CitationBurstService.GetCampaigns(); return results; } @@ -151,18 +151,18 @@ public static BlCbAllCampaigns GetAll() public static BlCbCampaign GetCampaign() { int campaignId = 1; - var citationBurstService = new CitationBurstService(); + var CitationBurstService = new CitationBurstService(); - BlCbCampaign results = citationBurstService.GetCampaign(campaignId); + BlCbCampaign results = CitationBurstService.GetCampaign(campaignId); return results; } public static BlSuccess GetCredits() { - var citationBurstService = new CitationBurstService(); + var CitationBurstService = new CitationBurstService(); - BlSuccess credits = citationBurstService.GetCredits(); + BlSuccess credits = CitationBurstService.GetCredits(); return credits; } diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationTrackerExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationTrackerExamples.cs index d6717e0..e463c27 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationTrackerExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/citationTrackerExamples.cs @@ -4,7 +4,7 @@ public class citationTrackerExamples { public static BlSuccess Create() { - CitationTrackerOptions ct = new CitationTrackerOptions(); + CitationTracker ct = new CitationTracker(); ct.reportName = "Sample Citation Tracker Report"; ct.businessName = "Le Bernardin"; ct.website = "le-bernardin.com"; @@ -23,7 +23,7 @@ public static BlSuccess Create() public static BlSuccess Update() { - UpdateCitationTrackerOptions ct = new UpdateCitationTrackerOptions(); + UpdateCitationTracker ct = new UpdateCitationTracker(); ct.reportId = 682; ct.reportName = "Sample Citation Tracker Report"; ct.businessName = "Le Bernardin"; diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs index 1722700..be09ee4 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/clientExamples.cs @@ -7,7 +7,7 @@ public class clientExamples { public static BlSuccess Create() { - var client = new ClientOptions(); + var client = new Client(); client.name = "Le Bernardin"; client.companyUrl = "le-bernardin.com"; client.businessCategoryId = 791; @@ -20,7 +20,7 @@ public static BlSuccess Create() public static BlSuccess Update() { - var client = new UpdateClientOptions(); + var client = new UpdateClient(); client.clientId = 36447; client.name = "Le Bernardin"; client.companyUrl = "le-bernardin.com"; diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/gpwExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/gpwExamples.cs index c343c79..c98442b 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/gpwExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/gpwExamples.cs @@ -10,7 +10,7 @@ public class gpwExamples { public static BlSuccess Create() { - var gpwReport = new GpwOptions(); + var gpwReport = new Gpw(); gpwReport.reportName = "Sample Citation Tracker Report"; gpwReport.businessNames = "Le Bernardin"; gpwReport.schedule = "Adhoc"; @@ -27,13 +27,13 @@ public static BlSuccess Create() var gpwService = new GpwService(); - BlSuccess gpwReport = gpwService.Create(gpwReport); - return gpwReport; + BlSuccess gpwReportResults = gpwService.Create(gpwReport); + return gpwReportResults; } public static BlSuccess Update() { - var gpwReport = new UpdateGpwOptions(); + var gpwReport = new UpdateGpw(); gpwReport.reportId = 1; gpwReport.reportName = "Sample Citation Tracker Report"; gpwReport.businessNames = "Le Bernardin"; @@ -51,8 +51,8 @@ public static BlSuccess Update() var gpwService = new GpwService(); - BlSuccess gpwReport = gpwService.Update(gpwReport); - return gpwReport; + BlSuccess gpwReportResults = gpwService.Update(gpwReport); + return gpwReportResults; } public static BlGpwReport Get() diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/locationExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/locationExamples.cs index 77813cc..bca43c7 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/locationExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/locationExamples.cs @@ -7,7 +7,7 @@ public class locationExamples { public static BlSuccess Create() { - var location = new LocationOptions(); + var location = new Location(); location.name = "Le Bernardin"; location.url = "le-bernardin.com"; location.businessCategoryId = 791; @@ -27,7 +27,7 @@ public static BlSuccess Create() public static BlSuccess Update() { - var location = new UpdateLocationOptions(); + var location = new UpdateLocation(); location.locationId = 1; location.name = "Le Bernardin"; location.url = "le-bernardin.com"; diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lscuExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lscuExamples.cs index 7b3f101..5754876 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lscuExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lscuExamples.cs @@ -10,7 +10,7 @@ public class lscuExamples { public static BlSuccess Create() { - LscuOptions lscu = new LscuOptions(); + Lscu lscu = new Lscu(); lscu.reportName = "Sample SEO Chek-Up Report"; lscu.businessNames = JsonConvert.SerializeObject(new List() {"Le Bernardin", "Le Bernardin Cafe"}); lscu.websiteAddress = "le-bernardin.com"; @@ -52,7 +52,7 @@ public static BlSuccess Create() public static BlSuccess Update() { - UpdateLscuOptions lscu = new UpdateLscuOptions(); + UpdateLscu lscu = new UpdateLscu(); lscu.reportId = 1; lscu.reportName = "Sample SEO Chek-Up Report"; lscu.businessNames = JsonConvert.SerializeObject(new List() { "Le Bernardin", "Le Bernardin Cafe" }); diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs index 7b07fb8..e979bc4 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/lsrcExamples.cs @@ -10,7 +10,7 @@ public class lsrcExamples { public static BlSuccess Create() { - var lsrc = new LsrcOptions(); + var lsrc = new Lsrc(); lsrc.name = "Le Bernardin"; lsrc.websiteAddresses = JsonConvert.SerializeObject(new List() {"le-bernardin.com", "www.le-bernadin.com"}); lsrc.searchTerms = "Restaurant, food+nyc, delivery+midtown+manhattan"; @@ -25,7 +25,7 @@ public static BlSuccess Create() public static BlSuccess Update() { - var lsrc = new UpdateLsrcOptions(); + var lsrc = new UpdateLsrc(); lsrc.campaignId = 1; lsrc.name = "Le Bernardin"; lsrc.websiteAddresses = JsonConvert.SerializeObject(new List() { "le-bernardin.com", "www.le-bernadin.com" }); @@ -85,7 +85,7 @@ public static BlLsrcHistory GetHistory() public static BlLsrcReportResults GetReportResults() { - var lsrc = new GetResultsLsrcOptions(); + var lsrc = new GetResultsLsrc(); lsrc.campaignId = 1; var lsrcService = new LsrcService(); diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/rFExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/rFExamples.cs index 1d48982..6266ac8 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/rFExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Account-Methods/rFExamples.cs @@ -9,7 +9,7 @@ public class rFExamples { public static BlSuccess Create() { - var reviewReport = new ReviewFlowOptions(); + var reviewReport = new ReviewFlow(); reviewReport.reportName = "Sample Citation Tracker Report"; reviewReport.businessName = "Le Bernardin"; reviewReport.contactTelephone = "+1 212-554-1515"; @@ -43,7 +43,7 @@ public static BlSuccess Create() public static BlSuccess Update() { - var reviewReport = new UpdateReviewFlowOptions(); + var reviewReport = new UpdateReviewFlow(); reviewReport.reportId = 1; reviewReport.reportName = "Sample Citation Tracker Report"; reviewReport.businessName = "Le Bernardin"; @@ -113,7 +113,7 @@ public static BlRfGetAll SearchReport() public static BlRfReviews GetReviews() { - var reviewReport = new RfGetReviewsOptions(); + var reviewReport = new RfGetReviews(); reviewReport.reportId = 1; var rfService = new ReviewFlowService(); diff --git a/BrightLocal/src/BrightLocal/Examples-version2/Batch-Methods/rankingsExamples.cs b/BrightLocal/src/BrightLocal/Examples-version2/Batch-Methods/rankingsExamples.cs index 6d1bdf0..38e1157 100644 --- a/BrightLocal/src/BrightLocal/Examples-version2/Batch-Methods/rankingsExamples.cs +++ b/BrightLocal/src/BrightLocal/Examples-version2/Batch-Methods/rankingsExamples.cs @@ -11,8 +11,8 @@ public class rankingsExamples { public static BlSuccess Create() { - RankingsSearchOptions searchOptions = new RankingsSearchOptions(); - searchOptions.searches.Add(new SearchOptions() + RankingsSearchOptions search = new RankingsSearchOptions(); + search.searches.Add(new SearchOptions() { searchEngine = "google", country = "USA", @@ -21,7 +21,7 @@ public static BlSuccess Create() urls = JsonConvert.SerializeObject(new List() { "le-bernardin.com" }), businessNames = JsonConvert.SerializeObject(new List { "Le Bernardin" }) }); - searchOptions.searches.Add(new SearchOptions() + search.searches.Add(new SearchOptions() { searchEngine = "yahoo", country = "USA", @@ -32,7 +32,7 @@ public static BlSuccess Create() }); var batchRankingService = new BatchRankingsService(); - BlBatchSuccess newBatchRankings = batchRankingService.Search(searchOptions); + BlBatchSuccess newBatchRankings = batchRankingService.Search(search); var rankingsResults = batchRankingService.GetSearchResults(newBatchRankings.batchId); diff --git a/BrightLocal/src/BrightLocal/Services/CitationBurst/BrightLocalCbPayOptions.cs b/BrightLocal/src/BrightLocal/Services/CitationBurst/BrightLocalCbPayOptions.cs index 454fe1b..0f34a01 100644 --- a/BrightLocal/src/BrightLocal/Services/CitationBurst/BrightLocalCbPayOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/CitationBurst/BrightLocalCbPayOptions.cs @@ -3,7 +3,7 @@ namespace BrightLocal { - public class BrightLocalCbPayOptions + public class BrightLocalCbPay { public int campaign_id { get; set; } public string package_id { get; set; } diff --git a/BrightLocal/src/BrightLocal/Services/CitationBurst/CitationBurstOptions.cs b/BrightLocal/src/BrightLocal/Services/CitationBurst/CitationBurst.cs similarity index 99% rename from BrightLocal/src/BrightLocal/Services/CitationBurst/CitationBurstOptions.cs rename to BrightLocal/src/BrightLocal/Services/CitationBurst/CitationBurst.cs index ef8de63..638955e 100644 --- a/BrightLocal/src/BrightLocal/Services/CitationBurst/CitationBurstOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/CitationBurst/CitationBurst.cs @@ -6,7 +6,7 @@ namespace BrightLocal { - public class CitationBurstOptions + public class CitationBurst { [JsonProperty("location_id")] public int locationId { get; set; } diff --git a/BrightLocal/src/BrightLocal/Services/CitationBurst/CitationBurstService.cs b/BrightLocal/src/BrightLocal/Services/CitationBurst/CitationBurstService.cs index eeaf3f6..dd1eeb6 100644 --- a/BrightLocal/src/BrightLocal/Services/CitationBurst/CitationBurstService.cs +++ b/BrightLocal/src/BrightLocal/Services/CitationBurst/CitationBurstService.cs @@ -8,26 +8,26 @@ public CitationBurstService(string apiKey = null, string apiSecret = null) : bas BlRequestor request = new BlRequestor(); - public virtual BlSuccess Create(CitationBurstOptions createOptions) + public virtual BlSuccess Create(CitationBurst create) { var url = string.Format(Urls.CitationBurst + "{0}", "create"); - var parameters = Parameters.convertListToParameters(createOptions); + var parameters = Parameters.convertListToParameters(create); var success = request.Post(url, parameters, this.api_key, this.api_secret); return JsonConvert.DeserializeObject(success.Content); } - public virtual BlSuccess Update(UpdateCitationBurstOptions updateOptions) + public virtual BlSuccess Update(UpdateCitationBurst update) { - var url = string.Format(Urls.CitationBurst + "{0}", updateOptions.campaignId); - var parameters = Parameters.convertListToParameters(updateOptions); + var url = string.Format(Urls.CitationBurst + "{0}", update.campaignId); + var parameters = Parameters.convertListToParameters(update); var success = request.Put(url, parameters, this.api_key, this.api_secret); return JsonConvert.DeserializeObject(success.Content); } - public virtual BlSuccess UploadImage(CbUploadImage imageOptions) + public virtual BlSuccess UploadImage(CbUploadImage image) { - var url = string.Format(Urls.CitationBurst + "{0}" + "/{1}", imageOptions.campaignId, imageOptions.imageType); - var parameters = Parameters.convertListToParameters(imageOptions.file); + var url = string.Format(Urls.CitationBurst + "{0}" + "/{1}", image.campaignId, image.imageType); + var parameters = Parameters.convertListToParameters(image.file); var success = request.Post(url, parameters, this.api_key, this.api_secret); return JsonConvert.DeserializeObject(success.Content); } @@ -41,10 +41,10 @@ public virtual BlCitations GetCitations(int campaignId) return JsonConvert.DeserializeObject(success.Content); } - public virtual BlSuccess ConfirmAndPay(BrightLocalCbPayOptions payOptions) + public virtual BlSuccess ConfirmAndPay(BrightLocalCbPay pay) { var url = string.Format(Urls.CitationBurst + "{0}", "confirm-and-pay"); - var parameters = Parameters.convertListToParameters(payOptions); + var parameters = Parameters.convertListToParameters(pay); var success = request.Post(url, parameters, this.api_key, this.api_secret); return JsonConvert.DeserializeObject(success.Content); } diff --git a/BrightLocal/src/BrightLocal/Services/CitationBurst/UpdateCitationBurstOptions.cs b/BrightLocal/src/BrightLocal/Services/CitationBurst/UpdateCitationBurst.cs similarity index 99% rename from BrightLocal/src/BrightLocal/Services/CitationBurst/UpdateCitationBurstOptions.cs rename to BrightLocal/src/BrightLocal/Services/CitationBurst/UpdateCitationBurst.cs index 5917ca2..42e4159 100644 --- a/BrightLocal/src/BrightLocal/Services/CitationBurst/UpdateCitationBurstOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/CitationBurst/UpdateCitationBurst.cs @@ -3,7 +3,7 @@ namespace BrightLocal { - public class UpdateCitationBurstOptions + public class UpdateCitationBurst { public int campaignId { get; set; } diff --git a/BrightLocal/src/BrightLocal/Services/CitationTracker/CitationTrackerOptions.cs b/BrightLocal/src/BrightLocal/Services/CitationTracker/CitationTracker.cs similarity index 97% rename from BrightLocal/src/BrightLocal/Services/CitationTracker/CitationTrackerOptions.cs rename to BrightLocal/src/BrightLocal/Services/CitationTracker/CitationTracker.cs index 9202310..60c7100 100644 --- a/BrightLocal/src/BrightLocal/Services/CitationTracker/CitationTrackerOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/CitationTracker/CitationTracker.cs @@ -6,7 +6,7 @@ namespace BrightLocal { - public class CitationTrackerOptions + public class CitationTracker { [JsonProperty("location-id")] public int locationId { get; set; } diff --git a/BrightLocal/src/BrightLocal/Services/CitationTracker/CitationTrackerService.cs b/BrightLocal/src/BrightLocal/Services/CitationTracker/CitationTrackerService.cs index 7eaaa3c..a0a1973 100644 --- a/BrightLocal/src/BrightLocal/Services/CitationTracker/CitationTrackerService.cs +++ b/BrightLocal/src/BrightLocal/Services/CitationTracker/CitationTrackerService.cs @@ -8,18 +8,18 @@ public CitationTrackerService(string apiKey = null, string apiSecret = null) : b BlRequestor request = new BlRequestor(); - public virtual BlSuccess Create(CitationTrackerOptions createOptions) + public virtual BlSuccess Create(CitationTracker create) { var url = string.Format(Urls.CitationTracker + "{0}", "add"); - var parameters = Parameters.convertListToParameters(createOptions); + var parameters = Parameters.convertListToParameters(create); var success = request.Post(url, parameters, this.api_key, this.api_secret); return JsonConvert.DeserializeObject(success.Content); } - public virtual BlSuccess Update(UpdateCitationTrackerOptions updateOptions) + public virtual BlSuccess Update(UpdateCitationTracker update) { var url = string.Format(Urls.CitationTracker + "{0}", "update"); - var parameters = Parameters.convertListToParameters(updateOptions); + var parameters = Parameters.convertListToParameters(update); var success = request.Post(url, parameters, this.api_key, this.api_secret); return JsonConvert.DeserializeObject(success.Content); } diff --git a/BrightLocal/src/BrightLocal/Services/CitationTracker/UpdateCitationTrackerOptions.cs b/BrightLocal/src/BrightLocal/Services/CitationTracker/UpdateCitationTracker.cs similarity index 97% rename from BrightLocal/src/BrightLocal/Services/CitationTracker/UpdateCitationTrackerOptions.cs rename to BrightLocal/src/BrightLocal/Services/CitationTracker/UpdateCitationTracker.cs index 9aeb9b7..aff9c84 100644 --- a/BrightLocal/src/BrightLocal/Services/CitationTracker/UpdateCitationTrackerOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/CitationTracker/UpdateCitationTracker.cs @@ -6,7 +6,7 @@ namespace BrightLocal { - public class UpdateCitationTrackerOptions + public class UpdateCitationTracker { [JsonProperty("report-id")] public int reportId { get; set; } diff --git a/BrightLocal/src/BrightLocal/Services/Clients/ClientOptions.cs b/BrightLocal/src/BrightLocal/Services/Clients/Client.cs similarity index 93% rename from BrightLocal/src/BrightLocal/Services/Clients/ClientOptions.cs rename to BrightLocal/src/BrightLocal/Services/Clients/Client.cs index 8e8e028..03070c9 100644 --- a/BrightLocal/src/BrightLocal/Services/Clients/ClientOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/Clients/Client.cs @@ -2,7 +2,7 @@ namespace BrightLocal { - public class ClientOptions + public class Client { [JsonProperty("name")] public string name { get; set; } diff --git a/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs b/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs index e8b19d9..2f99dde 100644 --- a/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs +++ b/BrightLocal/src/BrightLocal/Services/Clients/ClientService.cs @@ -12,16 +12,16 @@ public ClientService(string apiKey = null, string apiSecret = null) : base(apiKe BlRequestor request = new BlRequestor(); - public virtual BlSuccess Create(ClientOptions createOptions) + public virtual BlSuccess Create(Client create) { - var parameters = Parameters.convertListToParameters(createOptions); + var parameters = Parameters.convertListToParameters(create); var success = request.Post(Urls.Clients, parameters, this.api_key, this.api_secret); return JsonConvert.DeserializeObject(success.Content); } - public virtual BlSuccess Update(UpdateClientOptions updateOptions) + public virtual BlSuccess Update(UpdateClient update) { - var parameters = Parameters.convertListToParameters(updateOptions); + var parameters = Parameters.convertListToParameters(update); var success = request.Put(Urls.Clients, parameters, this.api_key, this.api_secret); return JsonConvert.DeserializeObject(success.Content); } diff --git a/BrightLocal/src/BrightLocal/Services/Clients/UpdateClientOptions.cs b/BrightLocal/src/BrightLocal/Services/Clients/UpdateClient.cs similarity index 93% rename from BrightLocal/src/BrightLocal/Services/Clients/UpdateClientOptions.cs rename to BrightLocal/src/BrightLocal/Services/Clients/UpdateClient.cs index 208a570..5a8932a 100644 --- a/BrightLocal/src/BrightLocal/Services/Clients/UpdateClientOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/Clients/UpdateClient.cs @@ -6,7 +6,7 @@ namespace BrightLocal { - public class UpdateClientOptions + public class UpdateClient { [JsonProperty("client-id")] public int clientId { get; set; } diff --git a/BrightLocal/src/BrightLocal/Services/GpwReports/GpwOptions.cs b/BrightLocal/src/BrightLocal/Services/GpwReports/Gpw.cs similarity index 98% rename from BrightLocal/src/BrightLocal/Services/GpwReports/GpwOptions.cs rename to BrightLocal/src/BrightLocal/Services/GpwReports/Gpw.cs index f689bd4..40d6b69 100644 --- a/BrightLocal/src/BrightLocal/Services/GpwReports/GpwOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/GpwReports/Gpw.cs @@ -3,7 +3,7 @@ namespace BrightLocal { - public class GpwOptions + public class Gpw { [JsonProperty("report_name")] public string reportName { get; set; } diff --git a/BrightLocal/src/BrightLocal/Services/GpwReports/GpwService.cs b/BrightLocal/src/BrightLocal/Services/GpwReports/GpwService.cs index 37e18ee..2d24c0e 100644 --- a/BrightLocal/src/BrightLocal/Services/GpwReports/GpwService.cs +++ b/BrightLocal/src/BrightLocal/Services/GpwReports/GpwService.cs @@ -9,18 +9,18 @@ public GpwService(string apiKey = null, string apiSecret = null) : base(apiKey, BlRequestor request = new BlRequestor(); - public virtual BlSuccess Create(GpwOptions createOptions) + public virtual BlSuccess Create(Gpw create) { var url = string.Format(Urls.Gpw + "{0}", "add"); - var parameters = Parameters.convertListToParameters(createOptions); + var parameters = Parameters.convertListToParameters(create); var success = request.Post(url, parameters, this.api_key, this.api_secret); return JsonConvert.DeserializeObject(success.Content); } - public virtual BlSuccess Update(UpdateGpwOptions updateOptions) + public virtual BlSuccess Update(UpdateGpw update) { - var url = string.Format(Urls.Gpw + "{0}", updateOptions.reportId); - var parameters = Parameters.convertListToParameters(updateOptions); + var url = string.Format(Urls.Gpw + "{0}", update.reportId); + var parameters = Parameters.convertListToParameters(update); var success = request.Put(url, parameters, this.api_key, this.api_secret); return JsonConvert.DeserializeObject(success.Content); } diff --git a/BrightLocal/src/BrightLocal/Services/GpwReports/UpdateGpwOptions.cs b/BrightLocal/src/BrightLocal/Services/GpwReports/UpdateGpw.cs similarity index 98% rename from BrightLocal/src/BrightLocal/Services/GpwReports/UpdateGpwOptions.cs rename to BrightLocal/src/BrightLocal/Services/GpwReports/UpdateGpw.cs index 42788ef..53e5f41 100644 --- a/BrightLocal/src/BrightLocal/Services/GpwReports/UpdateGpwOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/GpwReports/UpdateGpw.cs @@ -3,7 +3,7 @@ namespace BrightLocal { - public class UpdateGpwOptions + public class UpdateGpw { [JsonProperty("report-ID")] public int reportId { get; set; } diff --git a/BrightLocal/src/BrightLocal/Services/Locations/LocationOptions.cs b/BrightLocal/src/BrightLocal/Services/Locations/Location.cs similarity index 98% rename from BrightLocal/src/BrightLocal/Services/Locations/LocationOptions.cs rename to BrightLocal/src/BrightLocal/Services/Locations/Location.cs index c6c3b66..1d632c1 100644 --- a/BrightLocal/src/BrightLocal/Services/Locations/LocationOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/Locations/Location.cs @@ -3,7 +3,7 @@ namespace BrightLocal { - public class LocationOptions + public class Location { [JsonProperty("name")] public string name { get; set; } diff --git a/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs b/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs index 5ed6366..e02aed8 100644 --- a/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs +++ b/BrightLocal/src/BrightLocal/Services/Locations/LocationService.cs @@ -11,18 +11,18 @@ public LocationService(string apiKey = null, string apiSecret = null) : base(api BlRequestor request = new BlRequestor(); - public virtual BlSuccess Create(LocationOptions createOptions) + public virtual BlSuccess Create(Location create) { - var parameters = Parameters.convertListToParameters(createOptions); + var parameters = Parameters.convertListToParameters(create); var success = request.Post(Urls.Locations, parameters, this.api_key, this.api_secret); return JsonConvert.DeserializeObject(success.Content); } - public virtual BlSuccess Update(UpdateLocationOptions updateOptions) + public virtual BlSuccess Update(UpdateLocation update) { - var url = string.Format(Urls.Locations + "{0}", updateOptions.locationId); - var parameters = Parameters.convertListToParameters(updateOptions); + var url = string.Format(Urls.Locations + "{0}", update.locationId); + var parameters = Parameters.convertListToParameters(update); var success = request.Put(url, parameters, this.api_key, this.api_secret); return JsonConvert.DeserializeObject(success.Content); } diff --git a/BrightLocal/src/BrightLocal/Services/Locations/UpdateLocationOptions.cs b/BrightLocal/src/BrightLocal/Services/Locations/UpdateLocation.cs similarity index 98% rename from BrightLocal/src/BrightLocal/Services/Locations/UpdateLocationOptions.cs rename to BrightLocal/src/BrightLocal/Services/Locations/UpdateLocation.cs index 2c0f53b..700d826 100644 --- a/BrightLocal/src/BrightLocal/Services/Locations/UpdateLocationOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/Locations/UpdateLocation.cs @@ -4,7 +4,7 @@ namespace BrightLocal { - public class UpdateLocationOptions + public class UpdateLocation { [JsonRequired] [JsonProperty("location-id")] diff --git a/BrightLocal/src/BrightLocal/Services/Lscu/LscuOptions.cs b/BrightLocal/src/BrightLocal/Services/Lscu/Lscu.cs similarity index 98% rename from BrightLocal/src/BrightLocal/Services/Lscu/LscuOptions.cs rename to BrightLocal/src/BrightLocal/Services/Lscu/Lscu.cs index dae4099..e0ba827 100644 --- a/BrightLocal/src/BrightLocal/Services/Lscu/LscuOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/Lscu/Lscu.cs @@ -5,7 +5,7 @@ namespace BrightLocal { - public class LscuOptions + public class Lscu { [JsonProperty("report-name")] public string reportName { get; set; } diff --git a/BrightLocal/src/BrightLocal/Services/Lscu/LscuService.cs b/BrightLocal/src/BrightLocal/Services/Lscu/LscuService.cs index 8e2cc7e..4b027e1 100644 --- a/BrightLocal/src/BrightLocal/Services/Lscu/LscuService.cs +++ b/BrightLocal/src/BrightLocal/Services/Lscu/LscuService.cs @@ -11,16 +11,16 @@ public LscuService(string apiKey = null, string apiSecret = null) : base(apiKey, BlRequestor request = new BlRequestor(); - public virtual BlSuccess Create(LscuOptions createOptions) + public virtual BlSuccess Create(Lscu create) { - var parameters = Parameters.convertListToParameters(createOptions); + var parameters = Parameters.convertListToParameters(create); var success = request.Post(Urls.Lscu, parameters, this.api_key, this.api_secret); return JsonConvert.DeserializeObject(success.Content); } - public virtual BlSuccess Update(UpdateLscuOptions updateOptions) + public virtual BlSuccess Update(UpdateLscu update) { - var parameters = Parameters.convertListToParameters(updateOptions); + var parameters = Parameters.convertListToParameters(update); var success = request.Put(Urls.Lscu, parameters, this.api_key, this.api_secret); return JsonConvert.DeserializeObject(success.Content); } diff --git a/BrightLocal/src/BrightLocal/Services/Lscu/UpdateLscuOptions.cs b/BrightLocal/src/BrightLocal/Services/Lscu/UpdateLscu.cs similarity index 98% rename from BrightLocal/src/BrightLocal/Services/Lscu/UpdateLscuOptions.cs rename to BrightLocal/src/BrightLocal/Services/Lscu/UpdateLscu.cs index 19ead72..1a105ff 100644 --- a/BrightLocal/src/BrightLocal/Services/Lscu/UpdateLscuOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/Lscu/UpdateLscu.cs @@ -4,7 +4,7 @@ namespace BrightLocal { - public class UpdateLscuOptions + public class UpdateLscu { [JsonProperty("report-id")] public int reportId { get; set; } diff --git a/BrightLocal/src/BrightLocal/Services/Lsrc/GetResultsLsrcOptions.cs b/BrightLocal/src/BrightLocal/Services/Lsrc/GetResultsLsrc.cs similarity index 90% rename from BrightLocal/src/BrightLocal/Services/Lsrc/GetResultsLsrcOptions.cs rename to BrightLocal/src/BrightLocal/Services/Lsrc/GetResultsLsrc.cs index 6fe6fe0..9984eb1 100644 --- a/BrightLocal/src/BrightLocal/Services/Lsrc/GetResultsLsrcOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/Lsrc/GetResultsLsrc.cs @@ -3,7 +3,7 @@ namespace BrightLocal { - public class GetResultsLsrcOptions + public class GetResultsLsrc { [JsonProperty("campaign-id")] public int campaignId { get; set; } diff --git a/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcOptions.cs b/BrightLocal/src/BrightLocal/Services/Lsrc/Lsrc.cs similarity index 98% rename from BrightLocal/src/BrightLocal/Services/Lsrc/LsrcOptions.cs rename to BrightLocal/src/BrightLocal/Services/Lsrc/Lsrc.cs index aef52a6..0565b0a 100644 --- a/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/Lsrc/Lsrc.cs @@ -3,7 +3,7 @@ namespace BrightLocal { - public class LsrcOptions + public class Lsrc { [JsonProperty("name")] public string name { get; set; } diff --git a/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs b/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs index 3f07c59..7435083 100644 --- a/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs +++ b/BrightLocal/src/BrightLocal/Services/Lsrc/LsrcService.cs @@ -11,39 +11,39 @@ public LsrcService(string apiKey = null, string apiSecret = null) : base(apiKey, BlRequestor request = new BlRequestor(); - public virtual BlSuccess Create(LsrcOptions createOptions) + public virtual BlSuccess Create(Lsrc create) { var url = string.Format(Urls.Lsrc + "{0}", "add"); - createOptions.searchTerms = Parameters.convertToNewline(createOptions.searchTerms); - if(createOptions.businessNames != null) + create.searchTerms = Parameters.convertToNewline(create.searchTerms); + if(create.businessNames != null) { - createOptions.businessNames = Parameters.convertToNewline(createOptions.businessNames); + create.businessNames = Parameters.convertToNewline(create.businessNames); } - if (createOptions.emailAddresses != null) + if (create.emailAddresses != null) { - createOptions.emailAddresses = Parameters.convertToNewline(createOptions.emailAddresses); + create.emailAddresses = Parameters.convertToNewline(create.emailAddresses); } - var parameters = Parameters.convertListToParameters(createOptions); + var parameters = Parameters.convertListToParameters(create); var success = request.Post(url, parameters, this.api_key, this.api_secret); return JsonConvert.DeserializeObject(success.Content); } - public virtual BlSuccess Update(UpdateLsrcOptions updateOptions) + public virtual BlSuccess Update(UpdateLsrc update) { var url = string.Format(Urls.Lsrc + "{0}", "update"); - if (updateOptions.searchTerms != null) + if (update.searchTerms != null) { - updateOptions.searchTerms = Parameters.convertToNewline(updateOptions.searchTerms); + update.searchTerms = Parameters.convertToNewline(update.searchTerms); } - if (updateOptions.businessNames != null) + if (update.businessNames != null) { - updateOptions.businessNames = Parameters.convertToNewline(updateOptions.businessNames); + update.businessNames = Parameters.convertToNewline(update.businessNames); } - if (updateOptions.emailAddresses != null) + if (update.emailAddresses != null) { - updateOptions.emailAddresses = Parameters.convertToNewline(updateOptions.emailAddresses); + update.emailAddresses = Parameters.convertToNewline(update.emailAddresses); } - var parameters = Parameters.convertListToParameters(updateOptions); + var parameters = Parameters.convertListToParameters(update); var success = request.Post(url, parameters, this.api_key, this.api_secret); return JsonConvert.DeserializeObject(success.Content); } @@ -108,10 +108,10 @@ public virtual BlLsrcHistory GetHistory(int campaignId) return JsonConvert.DeserializeObject(results.Content); } - public virtual BlLsrcReportResults GetResults(GetResultsLsrcOptions lsrcOptions) + public virtual BlLsrcReportResults GetResults(GetResultsLsrc lsrc) { var url = string.Format(Urls.Lsrc + "{0}", "results/get"); - var parameters = Parameters.convertListToParameters(lsrcOptions); + var parameters = Parameters.convertListToParameters(lsrc); var results = request.Get(url, parameters, this.api_key, this.api_secret); var report = JsonConvert.DeserializeObject(results.Content); diff --git a/BrightLocal/src/BrightLocal/Services/Lsrc/UpdateLsrcOptions.cs b/BrightLocal/src/BrightLocal/Services/Lsrc/UpdateLsrc.cs similarity index 98% rename from BrightLocal/src/BrightLocal/Services/Lsrc/UpdateLsrcOptions.cs rename to BrightLocal/src/BrightLocal/Services/Lsrc/UpdateLsrc.cs index a38959e..80b292e 100644 --- a/BrightLocal/src/BrightLocal/Services/Lsrc/UpdateLsrcOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/Lsrc/UpdateLsrc.cs @@ -3,7 +3,7 @@ namespace BrightLocal { - public class UpdateLsrcOptions + public class UpdateLsrc { [JsonProperty("campaign-id")] public int campaignId { get; set; } diff --git a/BrightLocal/src/BrightLocal/Services/ReviewFlow/ReviewFlowOptions.cs b/BrightLocal/src/BrightLocal/Services/ReviewFlow/ReviewFlow.cs similarity index 96% rename from BrightLocal/src/BrightLocal/Services/ReviewFlow/ReviewFlowOptions.cs rename to BrightLocal/src/BrightLocal/Services/ReviewFlow/ReviewFlow.cs index 662fe89..ca65869 100644 --- a/BrightLocal/src/BrightLocal/Services/ReviewFlow/ReviewFlowOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/ReviewFlow/ReviewFlow.cs @@ -3,9 +3,9 @@ namespace BrightLocal { - public class ReviewFlowOptions + public class ReviewFlow { - public ReviewFlowOptions() + public ReviewFlow() { directories = new RFDirectoryUrls(); } diff --git a/BrightLocal/src/BrightLocal/Services/ReviewFlow/ReviewFlowService.cs b/BrightLocal/src/BrightLocal/Services/ReviewFlow/ReviewFlowService.cs index 8db1250..4f814ff 100644 --- a/BrightLocal/src/BrightLocal/Services/ReviewFlow/ReviewFlowService.cs +++ b/BrightLocal/src/BrightLocal/Services/ReviewFlow/ReviewFlowService.cs @@ -8,18 +8,18 @@ public ReviewFlowService(string apiKey = null, string apiSecret = null) : base(a BlRequestor request = new BlRequestor(); - public virtual BlSuccess Create(ReviewFlowOptions createOptions) + public virtual BlSuccess Create(ReviewFlow create) { var url = string.Format(Urls.ReviewFlow + "{0}", "add"); - var parameters = Parameters.convertListToParameters(createOptions); + var parameters = Parameters.convertListToParameters(create); var success = request.Post(url, parameters, this.api_key, this.api_secret); return JsonConvert.DeserializeObject(success.Content); } - public virtual BlSuccess Update(UpdateReviewFlowOptions updateOptions) + public virtual BlSuccess Update(UpdateReviewFlow update) { - var url = string.Format(Urls.ReviewFlow + "{0}", updateOptions.reportId); - var parameters = Parameters.convertListToParameters(updateOptions); + var url = string.Format(Urls.ReviewFlow + "{0}", update.reportId); + var parameters = Parameters.convertListToParameters(update); var success = request.Put(url, parameters, this.api_key, this.api_secret); return JsonConvert.DeserializeObject(success.Content); } @@ -66,7 +66,7 @@ public virtual BlRfGetAll Search(string query) return JsonConvert.DeserializeObject(success.Content); } - public virtual BlRfReviews GetReviews(RfGetReviewsOptions getReviews) + public virtual BlRfReviews GetReviews(RfGetReviews getReviews) { var url = string.Format(Urls.ReviewFlow + "{0}" + "/reviews", getReviews.reportId); var parameters = Parameters.convertListToParameters(getReviews); diff --git a/BrightLocal/src/BrightLocal/Services/ReviewFlow/RfGetReviewsOptions.cs b/BrightLocal/src/BrightLocal/Services/ReviewFlow/RfGetReviews.cs similarity index 93% rename from BrightLocal/src/BrightLocal/Services/ReviewFlow/RfGetReviewsOptions.cs rename to BrightLocal/src/BrightLocal/Services/ReviewFlow/RfGetReviews.cs index aea293f..72f491c 100644 --- a/BrightLocal/src/BrightLocal/Services/ReviewFlow/RfGetReviewsOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/ReviewFlow/RfGetReviews.cs @@ -6,7 +6,7 @@ namespace BrightLocal { - public class RfGetReviewsOptions + public class RfGetReviews { public int reportId { get; set; } public string directory { get; set; } diff --git a/BrightLocal/src/BrightLocal/Services/ReviewFlow/UpdateReviewFlowOptions.cs b/BrightLocal/src/BrightLocal/Services/ReviewFlow/UpdateReviewFlow.cs similarity index 97% rename from BrightLocal/src/BrightLocal/Services/ReviewFlow/UpdateReviewFlowOptions.cs rename to BrightLocal/src/BrightLocal/Services/ReviewFlow/UpdateReviewFlow.cs index 6670794..248bdea 100644 --- a/BrightLocal/src/BrightLocal/Services/ReviewFlow/UpdateReviewFlowOptions.cs +++ b/BrightLocal/src/BrightLocal/Services/ReviewFlow/UpdateReviewFlow.cs @@ -3,7 +3,7 @@ namespace BrightLocal { - public class UpdateReviewFlowOptions + public class UpdateReviewFlow { [JsonProperty("report-id")] public int reportId { get; set; } diff --git a/BrightLocal/src/BrightLocal/project.json b/BrightLocal/src/BrightLocal/project.json index a53d5b6..e72c8b8 100644 --- a/BrightLocal/src/BrightLocal/project.json +++ b/BrightLocal/src/BrightLocal/project.json @@ -31,7 +31,7 @@ "dotnet pack --no-build --output bin\\Debug --configuration %compile:Configuration%" ] }, - "packOptions": { + "pack": { "summary": "A c# wrapper class for consuming The Bright Local api. Automatically generates the proper authentication, with the siganture and expires parameter. Avoid the need to generate your own authentication signature. See documentation for examples.", "tags": [ "BrightLocal.com", "Bright Local Api", "C# wrapper", "SEO Tools" ], "owners": [ "BrightLocal" ], diff --git a/README.md b/README.md index 517c476..1c979c0 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ Clients ### Add Client ```csharp - var client = new ClientOptions(); + var client = new Client(); client.name = "Le Bernardin"; client.companyUrl = "le-bernardin.com"; client.businessCategoryId = 791; @@ -68,7 +68,7 @@ The returned BlSuccess entity above will have a client-id. You will want to pers ### Update Client ```csharp - var client = new UpdateClientOptions(); + var client = new UpdateClient(); client.clientId = 36447; client.name = "Le Bernardin"; client.companyUrl = "le-bernardin.com"; @@ -113,7 +113,7 @@ Locations ### Add Location ```csharp - var location = new LocationOptions(); + var location = new Location(); location.name = "Le Bernardin"; location.url = "le-bernardin.com"; location.businessCategoryId = 791; @@ -135,7 +135,7 @@ The returned BlSuccess entity above will have a location-id. You will want to pe ### Update Location ```csharp - var location = new UpdateLocationOptions(); + var location = new UpdateLocation(); location.locationId = 1; location.name = "Le Bernardin"; location.url = "le-bernardin.com"; @@ -186,7 +186,7 @@ Local Search Rank Checker ### Add Report ```csharp - var lsrc = new LsrcOptions(); + var lsrc = new Lsrc(); lsrc.name = "Le Bernardin"; lsrc.websiteAddresses = JsonConvert.SerializeObject(new List() {"le-bernardin.com", "www.le-bernadin.com"}); lsrc.searchTerms = "Restaurant, food+nyc, delivery+midtown+manhattan"; @@ -203,7 +203,7 @@ The returned BlSuccess entity above will have a campaign-id. You will want to pe ### Update Report ```csharp - var lsrc = new UpdateLsrcOptions(); + var lsrc = new UpdateLsrc(); lsrc.campaignId = 1; lsrc.name = "Le Bernardin"; lsrc.websiteAddresses = JsonConvert.SerializeObject(new List() { "le-bernardin.com", "www.le-bernadin.com" }); @@ -263,7 +263,7 @@ The returned BlSuccess entity above will have a campaign-id. You will want to pe ### Get Report Results ```csharp - var lsrc = new GetResultsLsrcOptions(); + var lsrc = new GetResultsLsrc(); lsrc.campaignId = 1; var lsrcService = new LsrcService(); @@ -278,7 +278,7 @@ Local SEO Check-up ### Add Report ```csharp - LscuOptions lscu = new LscuOptions(); + Lscu lscu = new Lscu(); lscu.reportName = "Sample SEO Chek-Up Report"; lscu.businessNames = JsonConvert.SerializeObject(new List() {"Le Bernardin", "Le Bernardin Cafe"}); lscu.websiteAddress = "le-bernardin.com"; @@ -323,7 +323,7 @@ The returned BlSuccess entity above will have a report-id. You will want to pers ### Update Report ```csharp - UpdateLscuOptions lscu = new UpdateLscuOptions(); + UpdateLscu lscu = new UpdateLscu(); lscu.reportId = 1; lscu.reportName = "Sample SEO Chek-Up Report"; lscu.businessNames = JsonConvert.SerializeObject(new List() { "Le Bernardin", "Le Bernardin Cafe" }); @@ -388,7 +388,7 @@ Citation Tracker ### Add Report ```csharp - CitationTrackerOptions ct = new CitationTrackerOptions(); + CitationTracker ct = new CitationTracker(); ct.reportName = "Sample Citation Tracker Report"; ct.businessName = "Le Bernardin"; ct.website = "le-bernardin.com"; @@ -407,7 +407,7 @@ The returned BlSuccess entity above will have a report-id. You will want to pers ### Update Report ```csharp - UpdateCitationTrackerOptions ct = new UpdateCitationTrackerOptions(); + UpdateCitationTracker ct = new UpdateCitationTracker(); ct.reportId = 682; ct.reportName = "Sample Citation Tracker Report"; ct.businessName = "Le Bernardin"; @@ -479,7 +479,7 @@ Citation Burst string brief_description = "Born in Paris in 1972 by sibling duo Maguy and Gilbert Le Coze, Le Bernardin only served fish: Fresh, simple and prepared with respect. After receiving its first Michelin star in 1976, and two more in 1980, the Le Coze’s set to open Le Bernardin in New York in 1986."; string full_description = "The restaurant has held three stars from the Michelin Guide since its 2005 New York launch and currently ranks 24 on the World’s 50 Best Restaurants list. The New York Zagat Guide has recognized Le Bernardin as top rated in the category of “Best Food” for the last nine consecutive years, and in 2015 was rated by the guide as New York City’s top restaurant for food and service. Le Bernardin has earned seven James Beard Awards since 1998 including “Outstanding Restaurant of the Year,” “Top Chef in New York City,” “Outstanding Service,” “Outstanding Chef in the United States,” “Outstanding Pastry Chef,” “Outstanding Wine Service,” and “Best Restaurant Design” in 2012. Most recently, the Foundation named Maguy Le Coze as Outstanding."; - CitationBurstOptions cb = new CitationBurstOptions(); + CitationBurst cb = new CitationBurst(); cb.businessName = "Le Bernardin"; cb.campaignName = "Sample Citation Burst Campaign"; cb.websiteAddress = "le-bernardin.com"; @@ -515,9 +515,9 @@ Citation Burst cb.workingHoursSunEnd = 2400; cb.paymentMethods = "Cash|Visa"; - var citationBurstService = new CitationBurstService(); + var CitationBurstService = new CitationBurstService(); - BlSuccess newCb = citationBurstService.Create(cb); + BlSuccess newCb = CitationBurstService.Create(cb); ``` The returned BlSuccess entity above will have a campaign-id. You will want to persist this for later in order to get citations, confirm & pay, etc. @@ -527,7 +527,7 @@ The returned BlSuccess entity above will have a campaign-id. You will want to pe string brief_description = "Born in Paris in 1972 by sibling duo Maguy and Gilbert Le Coze, Le Bernardin only served fish: Fresh, simple and prepared with respect. After receiving its first Michelin star in 1976, and two more in 1980, the Le Coze’s set to open Le Bernardin in New York in 1986."; string full_description = "The restaurant has held three stars from the Michelin Guide since its 2005 New York launch and currently ranks 24 on the World’s 50 Best Restaurants list. The New York Zagat Guide has recognized Le Bernardin as top rated in the category of “Best Food” for the last nine consecutive years, and in 2015 was rated by the guide as New York City’s top restaurant for food and service. Le Bernardin has earned seven James Beard Awards since 1998 including “Outstanding Restaurant of the Year,” “Top Chef in New York City,” “Outstanding Service,” “Outstanding Chef in the United States,” “Outstanding Pastry Chef,” “Outstanding Wine Service,” and “Best Restaurant Design” in 2012. Most recently, the Foundation named Maguy Le Coze as Outstanding."; - UpdateCitationBurstOptions cb = new UpdateCitationBurstOptions(); + UpdateCitationBurst cb = new UpdateCitationBurst(); cb.campaignId = 1; cb.businessName = "Le Bernardin"; cb.campaignName = "Sample Citation Burst Campaign"; @@ -564,9 +564,9 @@ The returned BlSuccess entity above will have a campaign-id. You will want to pe cb.workingHoursSunEnd = 2400; cb.paymentMethods = "Cash|Visa"; - var citationBurstService = new CitationBurstService(); + var CitationBurstService = new CitationBurstService(); - BlSuccess newCb = citationBurstService.Update(cb); + BlSuccess newCb = CitationBurstService.Update(cb); ``` ### Upload Image @@ -577,55 +577,55 @@ The returned BlSuccess entity above will have a campaign-id. You will want to pe image.file = "/path/to/image.jpg"; image.imageType = "logo"; - var citationBurstService = new CitationBurstService(); + var CitationBurstService = new CitationBurstService(); - BlSuccess cbImage = citationBurstService.UploadImage(image); + BlSuccess cbImage = CitationBurstService.UploadImage(image); ``` ### Get Citations ```csharp int campaingId = 1; - var citationBurstService = new CitationBurstService(); + var CitationBurstService = new CitationBurstService(); - BlCitations citations = citationBurstService.GetCitations(campaingId); + BlCitations citations = CitationBurstService.GetCitations(campaingId); ``` ### Confirm & Pay for Citation Campaign ```csharp - BlCbPayOptions confirmPay = new BlCbPayOptions(); + BlCbPay confirmPay = new BlCbPay(); confirmPay.campaign_id = 1; confirmPay.package_id = "cb15"; - var citationBurstService = new CitationBurstService(); + var CitationBurstService = new CitationBurstService(); - BlSuccess confirm = citationBurstService.ConfirmAndPay(confirmPay); + BlSuccess confirm = CitationBurstService.ConfirmAndPay(confirmPay); ``` ### Getting All Campaigns ```csharp - var citationBurstService = new CitationBurstService(); + var CitationBurstService = new CitationBurstService(); - BlCbAllCampaigns results = citationBurstService.GetCampaigns(); + BlCbAllCampaigns results = CitationBurstService.GetCampaigns(); ``` ### Get Campaign Details ```csharp int campaignId = 1; - var citationBurstService = new CitationBurstService(); + var CitationBurstService = new CitationBurstService(); - BlCbCampaign results = citationBurstService.GetCampaign(campaignId); + BlCbCampaign results = CitationBurstService.GetCampaign(campaignId); ``` ### Get Credits Balance ```csharp - var citationBurstService = new CitationBurstService(); + var CitationBurstService = new CitationBurstService(); - BlSuccess credits = citationBurstService.GetCredits(); + BlSuccess credits = CitationBurstService.GetCredits(); ``` ReviewFLow Reports @@ -634,7 +634,7 @@ ReviewFLow Reports ### Add Report ```csharp - var reviewReport = new ReviewFlowOptions(); + var reviewReport = new ReviewFlow(); reviewReport.reportName = "Sample Citation Tracker Report"; reviewReport.businessName = "Le Bernardin"; reviewReport.contactTelephone = "+1 212-554-1515"; @@ -671,7 +671,7 @@ The returned BlSuccess entity above will have a report-id. You will want to pers ### Update Report ```csharp - var reviewReport = new UpdateReviewFlowOptions(); + var reviewReport = new UpdateReviewFlow(); reviewReport.reportId = 1; reviewReport.reportName = "Sample Citation Tracker Report"; reviewReport.businessName = "Le Bernardin"; @@ -741,7 +741,7 @@ The returned BlSuccess entity above will have a report-id. You will want to pers ### Get Reviews ```csharp - var reviewReport = new RfGetReviewsOptions(); + var reviewReport = new RfGetReviews(); reviewReport.reportId = 1; var rfService = new ReviewFlowService(); @@ -799,7 +799,7 @@ Google Plus Local Wizard Reports ### Add Report ```csharp - var gpwReport = new GpwOptions(); + var gpwReport = new Gpw(); gpwReport.reportName = "Sample Citation Tracker Report"; gpwReport.businessNames = "Le Bernardin"; gpwReport.schedule = "Adhoc"; @@ -823,7 +823,7 @@ The returned BlSuccess entity above will have a report-id. You will want to pers ### Update Report ```csharp - var gpwReport = new UpdateGpwOptions(); + var gpwReport = new UpdateGpw(); gpwReport.reportId = 1; gpwReport.reportName = "Sample Citation Tracker Report"; gpwReport.businessNames = "Le Bernardin";