From d18f812d9f3021e7e1ec3ee9c959ad300c4b5307 Mon Sep 17 00:00:00 2001 From: Dave Anderson Date: Tue, 15 Nov 2016 08:30:26 -0500 Subject: [PATCH 1/8] nuspec --- Net.Pokeshot.JiveSdk/Net.Pokeshot.JiveSdk.nuspec | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Net.Pokeshot.JiveSdk/Net.Pokeshot.JiveSdk.nuspec diff --git a/Net.Pokeshot.JiveSdk/Net.Pokeshot.JiveSdk.nuspec b/Net.Pokeshot.JiveSdk/Net.Pokeshot.JiveSdk.nuspec new file mode 100644 index 0000000..4c86381 --- /dev/null +++ b/Net.Pokeshot.JiveSdk/Net.Pokeshot.JiveSdk.nuspec @@ -0,0 +1,16 @@ + + + + JiveDotNetSDK + $version$ + $title$ + pokeshot, ryanrutan, cnorick, and doublerazr + ryanrutan + https://github.com/jivesoftware/JiveDotNetSDK + https://github.com/jivesoftware/JiveDotNetSDK + https://www.jivesoftware.com/wp-content/themes/jive2015/images/brand/favicon32.png + false + C# wrapper for Jive's Rest API + jive c# api + + \ No newline at end of file From d5eb0bfcecd658a366aa66a6ed95c1e467115001 Mon Sep 17 00:00:00 2001 From: Dave Anderson Date: Tue, 15 Nov 2016 09:01:16 -0500 Subject: [PATCH 2/8] remove EntityFramework and unused references includes dropping JiveSdkContext and unused part of SignedRequest Attribute --- Net.Pokeshot.JiveSdk/App.config | 10 - Net.Pokeshot.JiveSdk/Auth/SignedRequest.cs | 229 ++---------------- Net.Pokeshot.JiveSdk/Models/JiveSdkContext.cs | 23 -- .../Net.Pokeshot.JiveSdk.csproj | 50 ---- Net.Pokeshot.JiveSdk/Util/CultureHelper.cs | 1 - Net.Pokeshot.JiveSdk/packages.config | 9 - 6 files changed, 25 insertions(+), 297 deletions(-) delete mode 100644 Net.Pokeshot.JiveSdk/Models/JiveSdkContext.cs diff --git a/Net.Pokeshot.JiveSdk/App.config b/Net.Pokeshot.JiveSdk/App.config index ca49f51..44ccc4b 100644 --- a/Net.Pokeshot.JiveSdk/App.config +++ b/Net.Pokeshot.JiveSdk/App.config @@ -1,15 +1,5 @@  - - -
- - - - - - - diff --git a/Net.Pokeshot.JiveSdk/Auth/SignedRequest.cs b/Net.Pokeshot.JiveSdk/Auth/SignedRequest.cs index b528603..b0da544 100644 --- a/Net.Pokeshot.JiveSdk/Auth/SignedRequest.cs +++ b/Net.Pokeshot.JiveSdk/Auth/SignedRequest.cs @@ -1,10 +1,5 @@ -using Net.Pokeshot.JiveSdk.Models; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; +using System; using System.Net; -using System.Security.Cryptography; using System.Security.Principal; using System.Threading; using System.Web; @@ -13,8 +8,7 @@ namespace Net.Pokeshot.JiveSdk.Auth { - - public class SignedRequest : ActionFilterAttribute + public class SignedRequest : ActionFilterAttribute { private static readonly string PARAM_ALGORITHM = "algorithm"; private static readonly string PARAM_CLIENT_ID = "client_id"; @@ -24,220 +18,50 @@ public class SignedRequest : ActionFilterAttribute private static readonly string PARAM_SIGNATURE = "signature"; private static readonly string JIVE_EXTN = "JiveEXTN "; - private JiveSdkContext db = new JiveSdkContext(); - - private Dictionary GetParametersFromAuthHeader(string authHeader) - { - authHeader = authHeader.Substring(JIVE_EXTN.Length); - string[] parameters = authHeader.Split('&', '?'); - Dictionary parameterDictionary = new Dictionary(); - foreach (string keyValue in parameters) - { - string[] tokens = keyValue.Split('='); - if (tokens.Length != 2) - { - //Windows Azure tracing. Replace with a logging mechanism of your choice - //Trace.WriteLine("Authorization header not formatted correctly"); - throw new HttpRequestValidationException(); - } - parameterDictionary.Add(HttpUtility.UrlDecode(tokens[0]), HttpUtility.UrlDecode(tokens[1])); - - } - - return parameterDictionary; - } - - private string validateSignature(string parameterStrWithoutSignature, string clientSecret) - { - System.Text.UTF8Encoding encoding = new System.Text.UTF8Encoding(); - //byte[] secret = encoding.GetBytes(clientSecret); - byte[] secret = Convert.FromBase64String(clientSecret); - - - byte[] headerToValidate = encoding.GetBytes(parameterStrWithoutSignature); - HMACSHA256 hmacsha256 = new HMACSHA256(secret); - - byte[] calculatedSignature = hmacsha256.ComputeHash(headerToValidate); - - return Convert.ToBase64String(calculatedSignature); - } - private string ToUrlBase64String(byte[] Input) - { - return Convert.ToBase64String(Input).Replace("=", String.Empty) - .Replace('+', '-') - .Replace('/', '_'); - } - - private byte[] SignWithHmac(byte[] dataToSign, byte[] keyBody) - { - using (var hmacAlgorithm = new HMACSHA256(keyBody)) - { - hmacAlgorithm.ComputeHash(dataToSign); - return hmacAlgorithm.Hash; - } - } - public override void OnActionExecuting(HttpActionContext actionContext) { try { - //Example for retrieving config settings from the web config - //bool oauthValidationEnabled = Convert.ToBoolean(System.Configuration.ConfigurationManager.AppSettings["IsOauthValidationEnabled"]); - bool oauthValidationEnabled = false; - string uri = actionContext.Request.RequestUri.AbsolutePath; - string host = actionContext.Request.RequestUri.Host; - - - - - if (oauthValidationEnabled) + if (actionContext.Request.Headers.Authorization != null) { + var authTemp = actionContext.Request.Headers.Authorization; + string authString = authTemp.Parameter; - if (actionContext.Request.Headers.Authorization != null) + //string authString = HttpContext.Current.Request.Headers["authorization"]; + string userId = HttpContext.Current.Request.Headers["x-jive-user-id"]; + + string[] authStringArray = authString.Split('&'); + string tenantId = null; + string jiveUrl = null; + foreach (string authElement in authStringArray) { - try + string[] keyValue = authElement.Split('='); + if (keyValue[0].Equals("tenant_id")) { - var authTemp = actionContext.Request.Headers.Authorization; - - string authHeader = authTemp.ToString(); - string userId="0"; - - if (HttpContext.Current.Request.Headers["x-jive-user-id"]!=null){ - userId = HttpContext.Current.Request.Headers["x-jive-user-id"]; - } - - - - - if (authHeader.StartsWith(JIVE_EXTN) == false || authHeader.Contains(PARAM_SIGNATURE) == false) - { - Trace.WriteLine("Authorization header not formatted correctly"); - throw new HttpRequestValidationException("Authorization header not formatted correctly"); - } - - Dictionary parameterDict = GetParametersFromAuthHeader(authHeader); - string signature = parameterDict[PARAM_SIGNATURE]; - parameterDict.Remove(PARAM_SIGNATURE); - string algorithm = parameterDict[PARAM_ALGORITHM]; - string clientId = parameterDict[PARAM_CLIENT_ID]; - string jiveUrl = parameterDict[PARAM_JIVE_URL]; - string tenantId = parameterDict[PARAM_TENANT_ID]; - string timeStampStr = parameterDict[PARAM_TIMESTAMP]; - - long timestampMilliSeconds = Convert.ToInt64(timeStampStr); - DateTime timestamp = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddMilliseconds(timestampMilliSeconds); - if (timestamp > DateTime.Now.AddMinutes(5) || DateTime.Now.AddMinutes(-5) > timestamp) - { - Trace.WriteLine("Timestamp older than 5 minutes"); - int timestampDiff = timestamp.CompareTo(DateTime.Now); - throw new HttpRequestValidationException("Timestamp difference more than 5 minutes. Difference: " + timestampDiff.ToString()); - } - - var _myAddon = db.JiveAddons - .Include("JiveInstance") - .Where(a => a.JiveInstance.JiveInstanceId.Equals(tenantId)); - if (_myAddon.Count() == 0) - { - Trace.WriteLine("Jive Instance not found"); - throw new HttpRequestValidationException(); - } - JiveAddon myAddon = _myAddon.Single(); - if (myAddon.ClientId.Equals(clientId) == false) - { - Trace.WriteLine("Not the expected client id for this tenant"); - throw new HttpRequestValidationException("Not the expected client id for this tenant"); - } - - string parameterStrWithoutSignature = authHeader.Substring(JIVE_EXTN.Length, authHeader.IndexOf(PARAM_SIGNATURE) - (PARAM_SIGNATURE.Length + 1)); - - - string expectedSignature = validateSignature(parameterStrWithoutSignature, myAddon.ClientSecret); - - if (expectedSignature.Equals(signature)) - { - string ownerId = userId + "@" + tenantId; - - GenericIdentity MyIdentity = new GenericIdentity(ownerId); - - String[] MyStringArray = { "User" }; - GenericPrincipal MyPrincipal = - new GenericPrincipal(MyIdentity, MyStringArray); - Thread.CurrentPrincipal = MyPrincipal; - } - else - { - Trace.WriteLine("Signature not correctly validated"); - throw new HttpRequestValidationException("Signature not correctly validated"); - } - - + tenantId = keyValue[1]; } - catch (HttpRequestValidationException authEx) - { - Trace.WriteLine(authEx.Message, "Error"); - //NewRelic.Api.Agent.NewRelic.NoticeError(authEx); - actionContext.Response = new System.Net.Http.HttpResponseMessage(); - actionContext.Response.Content = null; - actionContext.Response.StatusCode = HttpStatusCode.Unauthorized; + if (keyValue[0].Equals("jive_url")) + { + jiveUrl = HttpUtility.UrlDecode(keyValue[1]); } } + string ownerId = userId + "@" + tenantId; + GenericIdentity MyIdentity = new GenericIdentity(ownerId); + String[] MyStringArray = { "User" }; + GenericPrincipal MyPrincipal = + new GenericPrincipal(MyIdentity, MyStringArray); + Thread.CurrentPrincipal = MyPrincipal; } else { - if (actionContext.Request.Headers.Authorization != null) - { - - var authTemp = actionContext.Request.Headers.Authorization; - - string authString = authTemp.Parameter; - - //string authString = HttpContext.Current.Request.Headers["authorization"]; - string userId = HttpContext.Current.Request.Headers["x-jive-user-id"]; - - string[] authStringArray = authString.Split('&'); - string tenantId = null; - string jiveUrl = null; - foreach (string authElement in authStringArray) - { - string[] keyValue = authElement.Split('='); - if (keyValue[0].Equals("tenant_id")) - { - tenantId = keyValue[1]; - } - - if (keyValue[0].Equals("jive_url")) - { - jiveUrl = HttpUtility.UrlDecode(keyValue[1]); - } - } - string ownerId = userId + "@" + tenantId; - - GenericIdentity MyIdentity = new GenericIdentity(ownerId); - - String[] MyStringArray = { "User" }; - GenericPrincipal MyPrincipal = - new GenericPrincipal(MyIdentity, MyStringArray); - Thread.CurrentPrincipal = MyPrincipal; - - } - - else - { - - throw new HttpRequestValidationException("Authorization header not formatted correctly"); - - - } + throw new HttpRequestValidationException("Authorization header not formatted correctly"); } - - - } catch (Exception ex) { @@ -245,10 +69,7 @@ public override void OnActionExecuting(HttpActionContext actionContext) actionContext.Response = new System.Net.Http.HttpResponseMessage(); actionContext.Response.Content = null; actionContext.Response.StatusCode = HttpStatusCode.InternalServerError; - } } - - } } diff --git a/Net.Pokeshot.JiveSdk/Models/JiveSdkContext.cs b/Net.Pokeshot.JiveSdk/Models/JiveSdkContext.cs deleted file mode 100644 index 74f942e..0000000 --- a/Net.Pokeshot.JiveSdk/Models/JiveSdkContext.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Data.Entity; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Net.Pokeshot.JiveSdk.Models -{ - public class JiveSdkContext : DbContext - { - public JiveSdkContext() - : base("name=JiveSdkContext") - { - this.Configuration.LazyLoadingEnabled = false; - } - public DbSet JiveInstances { get; set; } - public DbSet Users { get; set; } - public DbSet JiveRegistrations { get; set; } - public DbSet JiveTileRegistrations { get; set; } - public DbSet JiveAddons { get; set; } - } -} diff --git a/Net.Pokeshot.JiveSdk/Net.Pokeshot.JiveSdk.csproj b/Net.Pokeshot.JiveSdk/Net.Pokeshot.JiveSdk.csproj index b40aafc..9311079 100644 --- a/Net.Pokeshot.JiveSdk/Net.Pokeshot.JiveSdk.csproj +++ b/Net.Pokeshot.JiveSdk/Net.Pokeshot.JiveSdk.csproj @@ -44,18 +44,6 @@ MinimumRecommendedRules.ruleset - - ..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.dll - True - - - ..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.SqlServer.dll - True - - - ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - True - ..\packages\NewRelic.Agent.Api.5.20.61.0\lib\NewRelic.Api.Agent.dll True @@ -68,49 +56,12 @@ - - ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll - True - - - ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.Helpers.dll - True - ..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll True - - ..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.3\lib\net45\System.Web.Http.WebHost.dll - True - - - ..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll - True - - - ..\packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll - True - - - ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.dll - True - - - ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Deployment.dll - True - - - ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Razor.dll - True - - - - - - @@ -247,7 +198,6 @@ - diff --git a/Net.Pokeshot.JiveSdk/Util/CultureHelper.cs b/Net.Pokeshot.JiveSdk/Util/CultureHelper.cs index bdcf5fa..5494e70 100644 --- a/Net.Pokeshot.JiveSdk/Util/CultureHelper.cs +++ b/Net.Pokeshot.JiveSdk/Util/CultureHelper.cs @@ -3,7 +3,6 @@ using System.Linq; using System.Text; using System.Threading; -using System.Threading.Tasks; namespace Net.Pokeshot.JiveSdk.Util { diff --git a/Net.Pokeshot.JiveSdk/packages.config b/Net.Pokeshot.JiveSdk/packages.config index ca3d63f..ad66bdb 100644 --- a/Net.Pokeshot.JiveSdk/packages.config +++ b/Net.Pokeshot.JiveSdk/packages.config @@ -1,14 +1,5 @@  - - - - - - - - - From 2b3d58a6f135b40b0f7690cdc174755047f921d2 Mon Sep 17 00:00:00 2001 From: Dave Anderson Date: Tue, 15 Nov 2016 10:58:21 -0500 Subject: [PATCH 3/8] System.Web.Http --- Net.Pokeshot.JiveSdk/Net.Pokeshot.JiveSdk.csproj | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Net.Pokeshot.JiveSdk/Net.Pokeshot.JiveSdk.csproj b/Net.Pokeshot.JiveSdk/Net.Pokeshot.JiveSdk.csproj index 9311079..f40b003 100644 --- a/Net.Pokeshot.JiveSdk/Net.Pokeshot.JiveSdk.csproj +++ b/Net.Pokeshot.JiveSdk/Net.Pokeshot.JiveSdk.csproj @@ -58,10 +58,7 @@ - - ..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll - True - + From e6c9f89e459c31f22e1dd04015db7e8527adbf0d Mon Sep 17 00:00:00 2001 From: Dave Anderson Date: Tue, 15 Nov 2016 13:55:13 -0500 Subject: [PATCH 4/8] public class everything --- Net.Pokeshot.JiveSdk.sln | 2 +- .../Clients/AbuseReportsClient.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/AcclaimClient.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/ActionsClient.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/AddOnsClient.cs | 2 +- .../Clients/Admin_Plugins_Client.cs | 2 +- .../Clients/Admin_ProfileFields_Client.cs | 2 +- .../Clients/Admin_Properties_Client.cs | 2 +- .../Clients/AnnouncementClient.cs | 2 +- .../Clients/AttatchmentClient.cs | 2 +- .../Clients/CalendarClient.cs | 2 +- .../Clients/CheckpointsClient.cs | 2 +- .../Clients/CollaborationsClient.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/DmsClient.cs | 2 +- .../Clients/EventTypesClient.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/EventsClient.cs | 2 +- .../Clients/ExecuteBatchClient.cs | 2 +- .../Clients/ExtpropsClient.cs | 2 +- .../Clients/ExtstreamDefsClient.cs | 2 +- .../Clients/ExtstreamsClient.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/ImagesClient.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/InboxClient.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/InvitesClient.cs | 2 +- .../Clients/Invites_Event_Client.cs | 2 +- .../Clients/MentionsClient.cs | 2 +- .../Clients/Metadata_Locales_Client.cs | 2 +- .../Clients/Metadata_Objects_Client.cs | 2 +- .../Clients/Metadata_Properties_Client.cs | 2 +- .../Metadata_Properties_Public_Client.cs | 2 +- .../Clients/Metadata_Resources_Client.cs | 2 +- .../Clients/Metadata_Timezones_Client.cs | 2 +- .../Clients/ModerationClient.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/OembedClient.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/PagesClient.cs | 2 +- .../Clients/PlaceTemplateCategoriesClient.cs | 2 +- .../Clients/PlaceTemplatesClient.cs | 2 +- .../Clients/PlaceTopicsClient.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/PlacesClient.cs | 926 +++++++++--------- .../Clients/ProfileImagesClient.cs | 2 +- .../Clients/PublicationsClient.cs | 2 +- .../Clients/QuestionsClient.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/RsvpClient.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/SearchClient.cs | 2 +- .../Clients/SecurityGroupsClient.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/SharesClient.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/SlidesClient.cs | 2 +- .../Clients/Solutions_SupportCenter_Client.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/StagesClient.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/StaticsClient.cs | 2 +- .../Clients/StreamEntriesClient.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/TagsClient.cs | 2 +- .../Clients/TileDefsClient.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/TilesClient.cs | 2 +- .../Clients/Tiles_Categories_Client.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/UrlsClient.cs | 2 +- .../Clients/VersionsClient.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/VideosClient.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/VitalsClient.cs | 2 +- .../Clients/WebhooksClient.cs | 2 +- Net.Pokeshot.JiveSdk/Models/GenericContent.cs | 2 +- 60 files changed, 522 insertions(+), 522 deletions(-) diff --git a/Net.Pokeshot.JiveSdk.sln b/Net.Pokeshot.JiveSdk.sln index c43b627..53f64ad 100644 --- a/Net.Pokeshot.JiveSdk.sln +++ b/Net.Pokeshot.JiveSdk.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.24720.0 +VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Net.Pokeshot.JiveSdk", "Net.Pokeshot.JiveSdk\Net.Pokeshot.JiveSdk.csproj", "{FC8DA9F2-6C2D-4BD2-9623-F4B7E20C3AA2}" EndProject diff --git a/Net.Pokeshot.JiveSdk/Clients/AbuseReportsClient.cs b/Net.Pokeshot.JiveSdk/Clients/AbuseReportsClient.cs index ef7d624..7a6e941 100644 --- a/Net.Pokeshot.JiveSdk/Clients/AbuseReportsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/AbuseReportsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class AbuseReportsClient : JiveClient + public class AbuseReportsClient : JiveClient { public AbuseReportsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/AcclaimClient.cs b/Net.Pokeshot.JiveSdk/Clients/AcclaimClient.cs index bb99a93..7d08cf3 100644 --- a/Net.Pokeshot.JiveSdk/Clients/AcclaimClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/AcclaimClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class AcclaimClient : JiveClient + public class AcclaimClient : JiveClient { public AcclaimClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/ActionsClient.cs b/Net.Pokeshot.JiveSdk/Clients/ActionsClient.cs index 2c5a91a..fef5c7a 100644 --- a/Net.Pokeshot.JiveSdk/Clients/ActionsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/ActionsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class ActionsClient: JiveClient + public class ActionsClient: JiveClient { public ActionsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/AddOnsClient.cs b/Net.Pokeshot.JiveSdk/Clients/AddOnsClient.cs index 761fae1..103da2a 100644 --- a/Net.Pokeshot.JiveSdk/Clients/AddOnsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/AddOnsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class AddOnsClient : JiveClient + public class AddOnsClient : JiveClient { public AddOnsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/Admin_Plugins_Client.cs b/Net.Pokeshot.JiveSdk/Clients/Admin_Plugins_Client.cs index 566bf56..8bcc3b9 100644 --- a/Net.Pokeshot.JiveSdk/Clients/Admin_Plugins_Client.cs +++ b/Net.Pokeshot.JiveSdk/Clients/Admin_Plugins_Client.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class Admin_Plugins_Client : JiveClient + public class Admin_Plugins_Client : JiveClient { public Admin_Plugins_Client(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/Admin_ProfileFields_Client.cs b/Net.Pokeshot.JiveSdk/Clients/Admin_ProfileFields_Client.cs index 3569177..ecf0e05 100644 --- a/Net.Pokeshot.JiveSdk/Clients/Admin_ProfileFields_Client.cs +++ b/Net.Pokeshot.JiveSdk/Clients/Admin_ProfileFields_Client.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class Admin_ProfileFields_Client : JiveClient + public class Admin_ProfileFields_Client : JiveClient { public Admin_ProfileFields_Client(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/Admin_Properties_Client.cs b/Net.Pokeshot.JiveSdk/Clients/Admin_Properties_Client.cs index 99ebbfb..26004b2 100644 --- a/Net.Pokeshot.JiveSdk/Clients/Admin_Properties_Client.cs +++ b/Net.Pokeshot.JiveSdk/Clients/Admin_Properties_Client.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class Admin_Properties_Client : JiveClient + public class Admin_Properties_Client : JiveClient { public Admin_Properties_Client(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/AnnouncementClient.cs b/Net.Pokeshot.JiveSdk/Clients/AnnouncementClient.cs index f2c133f..656507e 100644 --- a/Net.Pokeshot.JiveSdk/Clients/AnnouncementClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/AnnouncementClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class AnnouncementRetriever : JiveClient + public class AnnouncementRetriever : JiveClient { public AnnouncementRetriever(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/AttatchmentClient.cs b/Net.Pokeshot.JiveSdk/Clients/AttatchmentClient.cs index d57aeb0..44bc0c2 100644 --- a/Net.Pokeshot.JiveSdk/Clients/AttatchmentClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/AttatchmentClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class AttatchmentRetriever : JiveClient + public class AttatchmentRetriever : JiveClient { public AttatchmentRetriever(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/CalendarClient.cs b/Net.Pokeshot.JiveSdk/Clients/CalendarClient.cs index 85a08e3..b7ee98d 100644 --- a/Net.Pokeshot.JiveSdk/Clients/CalendarClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/CalendarClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class CalendarClient : JiveClient + public class CalendarClient : JiveClient { public CalendarClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/CheckpointsClient.cs b/Net.Pokeshot.JiveSdk/Clients/CheckpointsClient.cs index 032fc32..9cb689d 100644 --- a/Net.Pokeshot.JiveSdk/Clients/CheckpointsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/CheckpointsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class CheckpointsClient : JiveClient + public class CheckpointsClient : JiveClient { public CheckpointsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/CollaborationsClient.cs b/Net.Pokeshot.JiveSdk/Clients/CollaborationsClient.cs index 8f3e0cb..69f1ad6 100644 --- a/Net.Pokeshot.JiveSdk/Clients/CollaborationsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/CollaborationsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class CollaborationsClient : JiveClient + public class CollaborationsClient : JiveClient { public CollaborationsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/DmsClient.cs b/Net.Pokeshot.JiveSdk/Clients/DmsClient.cs index 6af2020..142fdb2 100644 --- a/Net.Pokeshot.JiveSdk/Clients/DmsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/DmsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class DmsClient : JiveClient + public class DmsClient : JiveClient { public DmsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/EventTypesClient.cs b/Net.Pokeshot.JiveSdk/Clients/EventTypesClient.cs index 874e6e1..2ebd46e 100644 --- a/Net.Pokeshot.JiveSdk/Clients/EventTypesClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/EventTypesClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class EventTypesClient : JiveClient + public class EventTypesClient : JiveClient { public EventTypesClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/EventsClient.cs b/Net.Pokeshot.JiveSdk/Clients/EventsClient.cs index a8f8fe9..3c2f509 100644 --- a/Net.Pokeshot.JiveSdk/Clients/EventsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/EventsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class EventsClient : JiveClient + public class EventsClient : JiveClient { public EventsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/ExecuteBatchClient.cs b/Net.Pokeshot.JiveSdk/Clients/ExecuteBatchClient.cs index 63e8fb6..559e5a8 100644 --- a/Net.Pokeshot.JiveSdk/Clients/ExecuteBatchClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/ExecuteBatchClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class ExecuteBatchClient : JiveClient + public class ExecuteBatchClient : JiveClient { public ExecuteBatchClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/ExtpropsClient.cs b/Net.Pokeshot.JiveSdk/Clients/ExtpropsClient.cs index 202f307..dafb4b6 100644 --- a/Net.Pokeshot.JiveSdk/Clients/ExtpropsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/ExtpropsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class ExtpropsClient : JiveClient + public class ExtpropsClient : JiveClient { public ExtpropsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/ExtstreamDefsClient.cs b/Net.Pokeshot.JiveSdk/Clients/ExtstreamDefsClient.cs index cbe0de2..d2ebef5 100644 --- a/Net.Pokeshot.JiveSdk/Clients/ExtstreamDefsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/ExtstreamDefsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class ExtstreamDefsClient : JiveClient + public class ExtstreamDefsClient : JiveClient { public ExtstreamDefsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/ExtstreamsClient.cs b/Net.Pokeshot.JiveSdk/Clients/ExtstreamsClient.cs index 50ec2c6..bf35e13 100644 --- a/Net.Pokeshot.JiveSdk/Clients/ExtstreamsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/ExtstreamsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class ExtstreamsClient : JiveClient + public class ExtstreamsClient : JiveClient { public ExtstreamsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/ImagesClient.cs b/Net.Pokeshot.JiveSdk/Clients/ImagesClient.cs index 5112257..dd029b5 100644 --- a/Net.Pokeshot.JiveSdk/Clients/ImagesClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/ImagesClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class ImagesClient : JiveClient + public class ImagesClient : JiveClient { public ImagesClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/InboxClient.cs b/Net.Pokeshot.JiveSdk/Clients/InboxClient.cs index 4a8bc9e..0176c82 100644 --- a/Net.Pokeshot.JiveSdk/Clients/InboxClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/InboxClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class InboxClient : JiveClient + public class InboxClient : JiveClient { public InboxClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/InvitesClient.cs b/Net.Pokeshot.JiveSdk/Clients/InvitesClient.cs index 57e484f..7494c2a 100644 --- a/Net.Pokeshot.JiveSdk/Clients/InvitesClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/InvitesClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class InvitesClient : JiveClient + public class InvitesClient : JiveClient { public InvitesClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/Invites_Event_Client.cs b/Net.Pokeshot.JiveSdk/Clients/Invites_Event_Client.cs index ad1301c..892a57b 100644 --- a/Net.Pokeshot.JiveSdk/Clients/Invites_Event_Client.cs +++ b/Net.Pokeshot.JiveSdk/Clients/Invites_Event_Client.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class Invites_Event_Client : JiveClient + public class Invites_Event_Client : JiveClient { public Invites_Event_Client(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/MentionsClient.cs b/Net.Pokeshot.JiveSdk/Clients/MentionsClient.cs index 8a62939..484e82e 100644 --- a/Net.Pokeshot.JiveSdk/Clients/MentionsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/MentionsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class MentionsClient : JiveClient + public class MentionsClient : JiveClient { public MentionsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/Metadata_Locales_Client.cs b/Net.Pokeshot.JiveSdk/Clients/Metadata_Locales_Client.cs index c7cdf57..2934f81 100644 --- a/Net.Pokeshot.JiveSdk/Clients/Metadata_Locales_Client.cs +++ b/Net.Pokeshot.JiveSdk/Clients/Metadata_Locales_Client.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class Metadata_Locales_Client: JiveClient + public class Metadata_Locales_Client: JiveClient { public Metadata_Locales_Client(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/Metadata_Objects_Client.cs b/Net.Pokeshot.JiveSdk/Clients/Metadata_Objects_Client.cs index 3b3e040..06bef6e 100644 --- a/Net.Pokeshot.JiveSdk/Clients/Metadata_Objects_Client.cs +++ b/Net.Pokeshot.JiveSdk/Clients/Metadata_Objects_Client.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class Metadata_Objects_Client : JiveClient + public class Metadata_Objects_Client : JiveClient { public Metadata_Objects_Client(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/Metadata_Properties_Client.cs b/Net.Pokeshot.JiveSdk/Clients/Metadata_Properties_Client.cs index 88e814c..adf49b4 100644 --- a/Net.Pokeshot.JiveSdk/Clients/Metadata_Properties_Client.cs +++ b/Net.Pokeshot.JiveSdk/Clients/Metadata_Properties_Client.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class Metadata_Properties_Client: JiveClient + public class Metadata_Properties_Client: JiveClient { public Metadata_Properties_Client(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/Metadata_Properties_Public_Client.cs b/Net.Pokeshot.JiveSdk/Clients/Metadata_Properties_Public_Client.cs index e129857..0a72951 100644 --- a/Net.Pokeshot.JiveSdk/Clients/Metadata_Properties_Public_Client.cs +++ b/Net.Pokeshot.JiveSdk/Clients/Metadata_Properties_Public_Client.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class Metadata_Properties_Public_Client : JiveClient + public class Metadata_Properties_Public_Client : JiveClient { public Metadata_Properties_Public_Client(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/Metadata_Resources_Client.cs b/Net.Pokeshot.JiveSdk/Clients/Metadata_Resources_Client.cs index 1253a70..4b998c3 100644 --- a/Net.Pokeshot.JiveSdk/Clients/Metadata_Resources_Client.cs +++ b/Net.Pokeshot.JiveSdk/Clients/Metadata_Resources_Client.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class Metadata_Resources_Client : JiveClient + public class Metadata_Resources_Client : JiveClient { public Metadata_Resources_Client(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/Metadata_Timezones_Client.cs b/Net.Pokeshot.JiveSdk/Clients/Metadata_Timezones_Client.cs index 708896b..e442959 100644 --- a/Net.Pokeshot.JiveSdk/Clients/Metadata_Timezones_Client.cs +++ b/Net.Pokeshot.JiveSdk/Clients/Metadata_Timezones_Client.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class Metadata_Timezones_Client : JiveClient + public class Metadata_Timezones_Client : JiveClient { public Metadata_Timezones_Client(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/ModerationClient.cs b/Net.Pokeshot.JiveSdk/Clients/ModerationClient.cs index 5676136..122cadb 100644 --- a/Net.Pokeshot.JiveSdk/Clients/ModerationClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/ModerationClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class ModerationClient : JiveClient + public class ModerationClient : JiveClient { public ModerationClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/OembedClient.cs b/Net.Pokeshot.JiveSdk/Clients/OembedClient.cs index a1f49f8..a3790ee 100644 --- a/Net.Pokeshot.JiveSdk/Clients/OembedClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/OembedClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class OembedClient : JiveClient + public class OembedClient : JiveClient { public OembedClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/PagesClient.cs b/Net.Pokeshot.JiveSdk/Clients/PagesClient.cs index 4fb3fe6..6757b41 100644 --- a/Net.Pokeshot.JiveSdk/Clients/PagesClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/PagesClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class PagesClient : JiveClient + public class PagesClient : JiveClient { public PagesClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/PlaceTemplateCategoriesClient.cs b/Net.Pokeshot.JiveSdk/Clients/PlaceTemplateCategoriesClient.cs index 25fd0a1..ffa3e1c 100644 --- a/Net.Pokeshot.JiveSdk/Clients/PlaceTemplateCategoriesClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/PlaceTemplateCategoriesClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class PlaceTemplateCategoriesClient : JiveClient + public class PlaceTemplateCategoriesClient : JiveClient { public PlaceTemplateCategoriesClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/PlaceTemplatesClient.cs b/Net.Pokeshot.JiveSdk/Clients/PlaceTemplatesClient.cs index b38adf2..741d588 100644 --- a/Net.Pokeshot.JiveSdk/Clients/PlaceTemplatesClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/PlaceTemplatesClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class PlaceTemplatesClient : JiveClient + public class PlaceTemplatesClient : JiveClient { public PlaceTemplatesClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/PlaceTopicsClient.cs b/Net.Pokeshot.JiveSdk/Clients/PlaceTopicsClient.cs index cd79267..fe64784 100644 --- a/Net.Pokeshot.JiveSdk/Clients/PlaceTopicsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/PlaceTopicsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class PlaceTopicsClient : JiveClient + public class PlaceTopicsClient : JiveClient { public PlaceTopicsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/PlacesClient.cs b/Net.Pokeshot.JiveSdk/Clients/PlacesClient.cs index 7e5be73..49d8377 100644 --- a/Net.Pokeshot.JiveSdk/Clients/PlacesClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/PlacesClient.cs @@ -14,15 +14,15 @@ namespace Net.Pokeshot.JiveSdk.Clients public class PlacesClient : JiveClient { string placesUrl { get { return JiveCommunityUrl + "/api/core/v3/places"; } } - public PlacesClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } - - /// - /// Checks for the presence of the given categories in the given Place, and creates any that are not present. - /// Note: will throw an HttpException if the max number of categories has been reached. - /// - /// ID of the Place the categories are supposed to be found or created - /// a list of the categories to be found or created - /// a string List of the categories that were successfully created + public PlacesClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } + + /// + /// Checks for the presence of the given categories in the given Place, and creates any that are not present. + /// Note: will throw an HttpException if the max number of categories has been reached. + /// + /// ID of the Place the categories are supposed to be found or created + /// a list of the categories to be found or created + /// a string List of the categories that were successfully created public List CheckAndCreateCategories(int placeID, List categories) { //pulls all of the current categories for the defined Place @@ -33,191 +33,191 @@ public List CheckAndCreateCategories(int placeID, List categorie bool found; Category newCategory; - foreach (var category in categories) - { - found = false; - foreach (var oldCategory in categoryList) - { - if (category == oldCategory.name) found = true; - } - if (!found) - { - newCategory = new Category(); - newCategory.name = category; - newCategory.type = "category"; - try - { - CreatePlaceCategory(placeID, newCategory); - addedList.Add(category); - } - catch (HttpException e) - { - if (e.GetHttpCode() != 400) throw; - else - { - Console.WriteLine("max number of categories reached for placeID: " + placeID + ", some categories omitted from result"); - throw; - } - } - } + foreach (var category in categories) + { + found = false; + foreach (var oldCategory in categoryList) + { + if (category == oldCategory.name) found = true; + } + if (!found) + { + newCategory = new Category(); + newCategory.name = category; + newCategory.type = "category"; + try + { + CreatePlaceCategory(placeID, newCategory); + addedList.Add(category); + } + catch (HttpException e) + { + if (e.GetHttpCode() != 400) throw; + else + { + Console.WriteLine("max number of categories reached for placeID: " + placeID + ", some categories omitted from result"); + throw; + } + } + } } return addedList; } - /// - /// Create a new content object with specified characteristics, and return an entity representing the newly created content object. - /// - /// ID of the place the content should be added to - /// a GenericContent object describing the content object to be created - /// a DateTime of when this content object was originally created. Set 'updated' param as well. Only set this field when importing content. - /// a DateTime of when this content object was most recently updated. Set 'published' param as well. Only set this field when importing content. - /// The fields to include in the returned entity + /// + /// Create a new content object with specified characteristics, and return an entity representing the newly created content object. + /// + /// ID of the place the content should be added to + /// a GenericContent object describing the content object to be created + /// a DateTime of when this content object was originally created. Set 'updated' param as well. Only set this field when importing content. + /// a DateTime of when this content object was most recently updated. Set 'published' param as well. Only set this field when importing content. + /// The fields to include in the returned entity /// a GenericContent object representing the newly created content - public GenericContent CreateContent(int placeID, GenericContent content, DateTime? published = null, DateTime? updated = null, List fields = null) - { - //constructs the url for the HTTP request based on the user specifications - bool first = true; - string url = placesUrl + "/" + placeID.ToString() + "/contents"; - if (published != null) - { - url += "?published=" + jiveDateFormat((DateTime)published); - first = false; - } - if (updated != null) - { - if (first) url += "?updated="; - else url += "&updated="; - url += jiveDateFormat((DateTime)updated); - first = false; - } - if (fields != null && fields.Count > 0) - { - if (first == true) - { - url += "?fields="; - first = false; - } - else url += "&fields="; - - foreach (var field in fields) - { - url += field + ","; - } - //remove last comma - url = url.Remove(url.Length - 1); - } - - //converts the content to be added into JSON format and makes the HTTP request - string json = JsonConvert.SerializeObject(content, new JsonSerializerSettings { DefaultValueHandling = DefaultValueHandling.Ignore, Formatting = Formatting.Indented }); - string result; - try - { - result = PostAbsolute(url, json); - } - catch (HttpException e) - { - switch (e.GetHttpCode()) - { - case 400: - throw new HttpException(e.WebEventCode, "An input field is malformed", e); - case 403: - throw new HttpException(e.WebEventCode, "You are not allowed to access the specified content or place", e); - case 409: - throw new HttpException(e.WebEventCode, "The new entity would conflict with system restrictions (such as two contents of the same type with the same name", e); - default: - throw; - } - } - - //converts the returned JSON into a GenericContent object and returns it to the user - JObject Json = JObject.Parse(result); - return Json.ToObject(); + public GenericContent CreateContent(int placeID, GenericContent content, DateTime? published = null, DateTime? updated = null, List fields = null) + { + //constructs the url for the HTTP request based on the user specifications + bool first = true; + string url = placesUrl + "/" + placeID.ToString() + "/contents"; + if (published != null) + { + url += "?published=" + jiveDateFormat((DateTime)published); + first = false; + } + if (updated != null) + { + if (first) url += "?updated="; + else url += "&updated="; + url += jiveDateFormat((DateTime)updated); + first = false; + } + if (fields != null && fields.Count > 0) + { + if (first == true) + { + url += "?fields="; + first = false; + } + else url += "&fields="; + + foreach (var field in fields) + { + url += field + ","; + } + //remove last comma + url = url.Remove(url.Length - 1); + } + + //converts the content to be added into JSON format and makes the HTTP request + string json = JsonConvert.SerializeObject(content, new JsonSerializerSettings { DefaultValueHandling = DefaultValueHandling.Ignore, Formatting = Formatting.Indented }); + string result; + try + { + result = PostAbsolute(url, json); + } + catch (HttpException e) + { + switch (e.GetHttpCode()) + { + case 400: + throw new HttpException(e.WebEventCode, "An input field is malformed", e); + case 403: + throw new HttpException(e.WebEventCode, "You are not allowed to access the specified content or place", e); + case 409: + throw new HttpException(e.WebEventCode, "The new entity would conflict with system restrictions (such as two contents of the same type with the same name", e); + default: + throw; + } + } + + //converts the returned JSON into a GenericContent object and returns it to the user + JObject Json = JObject.Parse(result); + return Json.ToObject(); } - /// - /// Create a new place with specified characteristics, and return an entity representing the newly created place. - /// Note: type of input Place must match generic type of method call and must be a subtype of Place - /// - /// Place object describing the place to be created - /// Note: the displayName and name fields are required, and must be unique within the parent place. - /// Note: if the parent field is not included, the root space will be the default parent of the new place. - /// Date and time when this place was originally created. Set 'updated' param as well. Only set this field when importing content. - /// Date and time when this place was most recently updated. Set 'published' param as well. Only set this field when importing content. - /// Fields to include in the returned entity + /// + /// Create a new place with specified characteristics, and return an entity representing the newly created place. + /// Note: type of input Place must match generic type of method call and must be a subtype of Place + /// + /// Place object describing the place to be created + /// Note: the displayName and name fields are required, and must be unique within the parent place. + /// Note: if the parent field is not included, the root space will be the default parent of the new place. + /// Date and time when this place was originally created. Set 'updated' param as well. Only set this field when importing content. + /// Date and time when this place was most recently updated. Set 'published' param as well. Only set this field when importing content. + /// Fields to include in the returned entity /// Place object representing the newly created place - public T CreatePlace(T new_place, DateTime? published = null, DateTime? updated = null, List fields = null) - { - //constructs the url for the HTTP request based on the user specifications - bool first = true; - string url = placesUrl; - if (published != null) - { - url += "?published=" + jiveDateFormat((DateTime)published); - first = false; - } - if (updated != null) - { - if (first) url += "?updated=" + jiveDateFormat((DateTime)updated); - else url += "&updated=" + jiveDateFormat((DateTime)updated); - first = false; - } - if (fields != null && fields.Count > 0) - { - if (first == true) - { - url += "?fields="; - first = false; - } - else url += "&fields="; - - foreach (var field in fields) - { - url += field + ","; - } - //remove last comma - url = url.Remove(url.Length - 1); - } - - //converts the place to be added into JSON format and makes the HTTP request - string json = JsonConvert.SerializeObject(new_place, new JsonSerializerSettings { DefaultValueHandling = DefaultValueHandling.Ignore, Formatting = Formatting.Indented }); - string result; - try - { - result = PostAbsolute(url, json); - } - catch (HttpException e) - { - switch (e.GetHttpCode()) - { - case 400: - throw new HttpException(e.WebEventCode, "An input field is malformed", e); - case 403: - throw new HttpException(e.WebEventCode, "You are not allowed to access the specified place", e); - case 409: - throw new HttpException(e.WebEventCode, "The new entity would conflict with system restrictions (such as two places of the same type with the same name", e); - default: - throw; - } - } - - //converts the returned JSON into a Place object and returns it to the user - JObject Json = JObject.Parse(result); - return Json.ToObject(); + public T CreatePlace(T new_place, DateTime? published = null, DateTime? updated = null, List fields = null) + { + //constructs the url for the HTTP request based on the user specifications + bool first = true; + string url = placesUrl; + if (published != null) + { + url += "?published=" + jiveDateFormat((DateTime)published); + first = false; + } + if (updated != null) + { + if (first) url += "?updated=" + jiveDateFormat((DateTime)updated); + else url += "&updated=" + jiveDateFormat((DateTime)updated); + first = false; + } + if (fields != null && fields.Count > 0) + { + if (first == true) + { + url += "?fields="; + first = false; + } + else url += "&fields="; + + foreach (var field in fields) + { + url += field + ","; + } + //remove last comma + url = url.Remove(url.Length - 1); + } + + //converts the place to be added into JSON format and makes the HTTP request + string json = JsonConvert.SerializeObject(new_place, new JsonSerializerSettings { DefaultValueHandling = DefaultValueHandling.Ignore, Formatting = Formatting.Indented }); + string result; + try + { + result = PostAbsolute(url, json); + } + catch (HttpException e) + { + switch (e.GetHttpCode()) + { + case 400: + throw new HttpException(e.WebEventCode, "An input field is malformed", e); + case 403: + throw new HttpException(e.WebEventCode, "You are not allowed to access the specified place", e); + case 409: + throw new HttpException(e.WebEventCode, "The new entity would conflict with system restrictions (such as two places of the same type with the same name", e); + default: + throw; + } + } + + //converts the returned JSON into a Place object and returns it to the user + JObject Json = JObject.Parse(result); + return Json.ToObject(); } - /// - /// Create a new announcement associated with this place. An appropriate parent field will be calculated and injected automatically. - /// - /// ID of the place for which to create an announcement - /// Announcement object describing the announcement to be created - /// Fields to include in the returned Announcement object + /// + /// Create a new announcement associated with this place. An appropriate parent field will be calculated and injected automatically. + /// + /// ID of the place for which to create an announcement + /// Announcement object describing the announcement to be created + /// Fields to include in the returned Announcement object /// Announcement object representing the newly created announcement - public Announcement CreatePlaceAnnouncement(int placeID, Announcement announcement, List fields = null) - { - //constructs the url for the HTTP request based on the user specifications - string url = placesUrl + "/" + placeID.ToString() + "/announcements"; + public Announcement CreatePlaceAnnouncement(int placeID, Announcement announcement, List fields = null) + { + //constructs the url for the HTTP request based on the user specifications + string url = placesUrl + "/" + placeID.ToString() + "/announcements"; if (fields != null && fields.Count > 0) { url += "?fields="; @@ -227,48 +227,48 @@ public Announcement CreatePlaceAnnouncement(int placeID, Announcement announceme } // remove last comma url = url.Remove(url.Length - 1); - } - - //converts the announcement to be added into JSON format and makes the HTTP request - string json = JsonConvert.SerializeObject(announcement, new JsonSerializerSettings { DefaultValueHandling = DefaultValueHandling.Ignore, Formatting = Formatting.Indented }); - string result; - try - { - result = PostAbsolute(url, json); - } - catch (HttpException e) - { - switch (e.GetHttpCode()) - { - case 400: - throw new HttpException(e.WebEventCode, "An input field is missing or malformed", e); - case 403: - throw new HttpException(e.WebEventCode, "You are not allowed to create announcements in the specified place", e); - case 404: - throw new HttpException(e.WebEventCode, "The specified parent place cannot be found", e); - default: - throw; - } - } - - //converts the returned JSON into an Announcement object and returns it to the user - JObject Json = JObject.Parse(result); - return Json.ToObject(); + } + + //converts the announcement to be added into JSON format and makes the HTTP request + string json = JsonConvert.SerializeObject(announcement, new JsonSerializerSettings { DefaultValueHandling = DefaultValueHandling.Ignore, Formatting = Formatting.Indented }); + string result; + try + { + result = PostAbsolute(url, json); + } + catch (HttpException e) + { + switch (e.GetHttpCode()) + { + case 400: + throw new HttpException(e.WebEventCode, "An input field is missing or malformed", e); + case 403: + throw new HttpException(e.WebEventCode, "You are not allowed to create announcements in the specified place", e); + case 404: + throw new HttpException(e.WebEventCode, "The specified parent place cannot be found", e); + default: + throw; + } + } + + //converts the returned JSON into an Announcement object and returns it to the user + JObject Json = JObject.Parse(result); + return Json.ToObject(); } - /// - /// Create a new category for a place with specified characteristics, and return an entity representing the newly created category. - /// - /// ID of the place for which to create a category - /// Category object describing the category to be created - /// Flag indicating whether existing content of the place will be categorized under the new category - /// Fields to be returned (default is @all) + /// + /// Create a new category for a place with specified characteristics, and return an entity representing the newly created category. + /// + /// ID of the place for which to create a category + /// Category object describing the category to be created + /// Flag indicating whether existing content of the place will be categorized under the new category + /// Fields to be returned (default is @all) /// Category object representing the newly created category - public Category CreatePlaceCategory(int placeID, Category new_category, bool autoCategorize = false, List fields = null) - { - //construct the url for the HTTP request based on the user specifications - string url = placesUrl + "/" + placeID.ToString() + "/categories"; - url += "?autoCategorize=" + autoCategorize.ToString(); + public Category CreatePlaceCategory(int placeID, Category new_category, bool autoCategorize = false, List fields = null) + { + //construct the url for the HTTP request based on the user specifications + string url = placesUrl + "/" + placeID.ToString() + "/categories"; + url += "?autoCategorize=" + autoCategorize.ToString(); if (fields != null && fields.Count > 0) { url += "&fields="; @@ -278,122 +278,122 @@ public Category CreatePlaceCategory(int placeID, Category new_category, bool aut } // remove last comma url = url.Remove(url.Length - 1); - } - - //convert the Category object to JSON format and post via HTTP - string json = JsonConvert.SerializeObject(new_category, new JsonSerializerSettings { DefaultValueHandling = DefaultValueHandling.Ignore, Formatting = Formatting.Indented }); - string result; - try - { - result = PostAbsolute(url, json); - } - catch (HttpException e) - { - switch (e.GetHttpCode()) - { - case 400: - throw new HttpException(e.WebEventCode, "An input field is malformed or max number of categories has been reached", e); - case 403: - throw new HttpException(e.WebEventCode, "You are not allowed to manage categories for the place", e); - case 409: - throw new HttpException(e.WebEventCode, "The new entity would conflict with system restrictions (such as two categories with the same name", e); - default: - throw; - } - } - - //convert the returned JSON into a Category object and return to the user - JObject Json = JObject.Parse(result); - return Json.ToObject(); + } + + //convert the Category object to JSON format and post via HTTP + string json = JsonConvert.SerializeObject(new_category, new JsonSerializerSettings { DefaultValueHandling = DefaultValueHandling.Ignore, Formatting = Formatting.Indented }); + string result; + try + { + result = PostAbsolute(url, json); + } + catch (HttpException e) + { + switch (e.GetHttpCode()) + { + case 400: + throw new HttpException(e.WebEventCode, "An input field is malformed or max number of categories has been reached", e); + case 403: + throw new HttpException(e.WebEventCode, "You are not allowed to manage categories for the place", e); + case 409: + throw new HttpException(e.WebEventCode, "The new entity would conflict with system restrictions (such as two categories with the same name", e); + default: + throw; + } + } + + //convert the returned JSON into a Category object and return to the user + JObject Json = JObject.Parse(result); + return Json.ToObject(); } - /// - /// Delete the specified place. - /// + /// + /// Delete the specified place. + /// /// ID of the place to be deleted - public void DestroyPlace(int placeID) - { - string url = placesUrl + "/" + placeID.ToString(); - - try - { - DeleteAbsolute(url); - } - catch (HttpException e) - { - switch (e.GetHttpCode()) - { - case 400: - throw new HttpException(e.WebEventCode, "An input field is malformed", e); - case 403: - throw new HttpException(e.WebEventCode, "You are not allowed to access the specified place", e); - case 404: - throw new HttpException(e.WebEventCode, "The specified place does not exist", e); - default: - throw; - } - } + public void DestroyPlace(int placeID) + { + string url = placesUrl + "/" + placeID.ToString(); + + try + { + DeleteAbsolute(url); + } + catch (HttpException e) + { + switch (e.GetHttpCode()) + { + case 400: + throw new HttpException(e.WebEventCode, "An input field is malformed", e); + case 403: + throw new HttpException(e.WebEventCode, "You are not allowed to access the specified place", e); + case 404: + throw new HttpException(e.WebEventCode, "The specified place does not exist", e); + default: + throw; + } + } } - /// - /// Delete the existing category for the specified place. Only admins of the place can manage place categories. - /// - /// ID of the place for which the category is to be deleted + /// + /// Delete the existing category for the specified place. Only admins of the place can manage place categories. + /// + /// ID of the place for which the category is to be deleted /// ID of the category to delete - public void DestroyPlaceCategory(int placeID, int categoryID) - { - string url = placesUrl + "/" + placeID.ToString() + "/categories/" + categoryID.ToString(); - - try - { - DeleteAbsolute(url); //makes the HTTP DELETE call - } - catch (HttpException e) - { - switch (e.GetHttpCode()) - { - case 400: - throw new HttpException(e.WebEventCode, "An input field is malformed", e); - case 403: - throw new HttpException(e.WebEventCode, "You are not allowed to delete this image", e); - case 404: - throw new HttpException(e.WebEventCode, "The specified place or image does not exist", e); - default: - throw; - } - } - - return; - } - - //GetActivity() - //GetAppliedEntitlements() - - /// - /// Return a list of featured content objects in the specified place. - /// - /// ID of the place the objects are being retrieved from + public void DestroyPlaceCategory(int placeID, int categoryID) + { + string url = placesUrl + "/" + placeID.ToString() + "/categories/" + categoryID.ToString(); + + try + { + DeleteAbsolute(url); //makes the HTTP DELETE call + } + catch (HttpException e) + { + switch (e.GetHttpCode()) + { + case 400: + throw new HttpException(e.WebEventCode, "An input field is malformed", e); + case 403: + throw new HttpException(e.WebEventCode, "You are not allowed to delete this image", e); + case 404: + throw new HttpException(e.WebEventCode, "The specified place or image does not exist", e); + default: + throw; + } + } + + return; + } + + //GetActivity() + //GetAppliedEntitlements() + + /// + /// Return a list of featured content objects in the specified place. + /// + /// ID of the place the objects are being retrieved from /// Requested sort order. /// Possible strings: /// dateCreatedAsc - Sort by the date this place was created, in ascending order. /// dateCreatedDesc - Sort by the date this place was created, in descending order. Default if none was specified. /// latestActivityAsc - Sort by the date this place had the most recent activity, in ascending order. /// latestActivityDesc - Sort by the date this place had the most recent activity, in descending order. - /// titleAsc - Sort by place name, in ascending order. - /// one or more object types of desired contained content objects (document, discussion, post, poll) separated by commas - /// The fields to be returned on each content - /// The zero-relative index of the first matching content to be returned - /// The maximum number of contents to be returned per Jive HTTP request - /// Flag indicating that if content.text is requested, it will be abridged (length shortened, HTML tags removed) - /// a GenericContent object list of the matched content objects - public List GetContents(int placeID, string sort = "dateCreatedDesc", List type = null, List fields = null, int startIndex = 0, int count = 25, bool abridged = false) - { - //construct url for the HTTP request with the user specifications - string url = placesUrl + "/" + placeID.ToString() + "/contents"; - url += "?sort=" + sort; - url += "&abridged=" + abridged.ToString(); - url += "&count=" + (count > 100 ? 100 : count).ToString(); - if (startIndex != 0) url += "&startIndex=" + startIndex.ToString(); + /// titleAsc - Sort by place name, in ascending order. + /// one or more object types of desired contained content objects (document, discussion, post, poll) separated by commas + /// The fields to be returned on each content + /// The zero-relative index of the first matching content to be returned + /// The maximum number of contents to be returned per Jive HTTP request + /// Flag indicating that if content.text is requested, it will be abridged (length shortened, HTML tags removed) + /// a GenericContent object list of the matched content objects + public List GetContents(int placeID, string sort = "dateCreatedDesc", List type = null, List fields = null, int startIndex = 0, int count = 25, bool abridged = false) + { + //construct url for the HTTP request with the user specifications + string url = placesUrl + "/" + placeID.ToString() + "/contents"; + url += "?sort=" + sort; + url += "&abridged=" + abridged.ToString(); + url += "&count=" + (count > 100 ? 100 : count).ToString(); + if (startIndex != 0) url += "&startIndex=" + startIndex.ToString(); if (type != null && type.Count > 0) { url += "&filter=type("; @@ -405,7 +405,7 @@ public List GetContents(int placeID, string sort = "dateCreatedD url.Remove(url.Length - 1); url += ")"; - } + } if (fields != null && fields.Count > 0) { url += "&fields="; @@ -415,8 +415,8 @@ public List GetContents(int placeID, string sort = "dateCreatedD } // remove last comma url = url.Remove(url.Length - 1); - } - + } + // jive returns a paginated list, so we have to loop through all of the pages. string json; JObject results; @@ -450,8 +450,8 @@ public List GetContents(int placeID, string sort = "dateCreatedD else url = results["links"]["next"].ToString(); } - return contentList; - + return contentList; + } //GetExtProps() @@ -503,26 +503,26 @@ public GenericPlace GetPlace(int placeID, List fields = null) JObject results = JObject.Parse(json); return results.ToObject(); - } - - /// - /// Return a paginated list of announcements related to the specified place. - /// - /// ID of the place for which to return announcements - /// Maximum number of elements to be returned per Jive HTTP request - /// Zero-relative index of the first announcement to be returned - /// True if only active (non-expired) announcements should be returned - /// Fields to be included in returned announcements - /// an Announcement object list of the announcements for the specified place - public List GetPlaceAnnouncements(int placeID, int count = 25, int startIndex = 0, bool activeOnly = true, List fields = null) - { - List announcementList = new List(); - - //construct the url for the HTTP request based on the user specifications - string url = placesUrl + "/" + placeID.ToString() + "/announcements"; - url += "?count=" + count.ToString(); - url += "&startIndex=" + startIndex.ToString(); - url += "&activeOnly=" + activeOnly.ToString(); + } + + /// + /// Return a paginated list of announcements related to the specified place. + /// + /// ID of the place for which to return announcements + /// Maximum number of elements to be returned per Jive HTTP request + /// Zero-relative index of the first announcement to be returned + /// True if only active (non-expired) announcements should be returned + /// Fields to be included in returned announcements + /// an Announcement object list of the announcements for the specified place + public List GetPlaceAnnouncements(int placeID, int count = 25, int startIndex = 0, bool activeOnly = true, List fields = null) + { + List announcementList = new List(); + + //construct the url for the HTTP request based on the user specifications + string url = placesUrl + "/" + placeID.ToString() + "/announcements"; + url += "?count=" + count.ToString(); + url += "&startIndex=" + startIndex.ToString(); + url += "&activeOnly=" + activeOnly.ToString(); if (fields != null && fields.Count > 0) { url += "&fields="; @@ -532,17 +532,17 @@ public List GetPlaceAnnouncements(int placeID, int count = 25, int } // remove last comma url = url.Remove(url.Length - 1); - } - - // jive returns a paginated list, so we have to loop through all of the pages. - string json; - JObject results; - while (true) - { - try - { - json = GetAbsolute(url); - } + } + + // jive returns a paginated list, so we have to loop through all of the pages. + string json; + JObject results; + while (true) + { + try + { + json = GetAbsolute(url); + } catch (HttpException e) { switch (e.GetHttpCode()) @@ -554,8 +554,8 @@ public List GetPlaceAnnouncements(int placeID, int count = 25, int default: throw; } - } - + } + results = JObject.Parse(json); announcementList.AddRange(results["list"].ToObject>()); @@ -563,26 +563,26 @@ public List GetPlaceAnnouncements(int placeID, int count = 25, int if (results["links"] == null || results["links"]["next"] == null) break; else - url = results["links"]["next"].ToString(); - } - - return announcementList; - } - - //GetPlaceAvatar() - - /// - /// Return categories associated to the specified place. - /// - /// ID of the place to return the categories of - /// Fields to be returned (default is @all) + url = results["links"]["next"].ToString(); + } + + return announcementList; + } + + //GetPlaceAvatar() + + /// + /// Return categories associated to the specified place. + /// + /// ID of the place to return the categories of + /// Fields to be returned (default is @all) /// a Category object list of the categories for the given place - public List GetPlaceCategories(int placeID, List fields = null) - { - List categoryList = new List(); - - //creates the url for the HTTP request based on the user specifications - string url = placesUrl + "/" + placeID.ToString() + "/categories"; + public List GetPlaceCategories(int placeID, List fields = null) + { + List categoryList = new List(); + + //creates the url for the HTTP request based on the user specifications + string url = placesUrl + "/" + placeID.ToString() + "/categories"; if (fields != null && fields.Count > 0) { url += "?fields="; @@ -592,8 +592,8 @@ public List GetPlaceCategories(int placeID, List fields = null } // remove last comma url = url.Remove(url.Length - 1); - } - + } + // jive returns a paginated list, so we have to loop through all of the pages. string json; JObject results; @@ -623,20 +623,20 @@ public List GetPlaceCategories(int placeID, List fields = null url = results["links"]["next"].ToString(); } - return categoryList; - } - - /// - /// Return the specified category of a place. - /// - /// ID of the place that is associated to the category - /// ID of the category to return - /// Fields to be returned (default is @all) + return categoryList; + } + + /// + /// Return the specified category of a place. + /// + /// ID of the place that is associated to the category + /// ID of the category to return + /// Fields to be returned (default is @all) /// a Category object containing the specified category - public Category GetPlaceCategory(int placeID, int categoryID, List fields = null) - { - //creates the url for the HTTP request based on the user specifications - string url = placesUrl + "/" + placeID.ToString() + "/categories/" + categoryID.ToString(); + public Category GetPlaceCategory(int placeID, int categoryID, List fields = null) + { + //creates the url for the HTTP request based on the user specifications + string url = placesUrl + "/" + placeID.ToString() + "/categories/" + categoryID.ToString(); if (fields != null && fields.Count > 0) { url += "?fields="; @@ -646,28 +646,28 @@ public Category GetPlaceCategory(int placeID, int categoryID, List field } // remove last comma url = url.Remove(url.Length - 1); - } - - //makes the HTTP GET request and parses the result into a Category object before returning - string result; - try - { - result = GetAbsolute(url); - } - catch (HttpException e) - { - switch (e.GetHttpCode()) - { - case 400: - throw new HttpException(e.WebEventCode, "An input field is malformed", e); - case 404: - throw new HttpException(e.WebEventCode, "If the specified category does not exist", e); - default: - throw; - } - } - JObject Json = JObject.Parse(result); - return Json.ToObject(); + } + + //makes the HTTP GET request and parses the result into a Category object before returning + string result; + try + { + result = GetAbsolute(url); + } + catch (HttpException e) + { + switch (e.GetHttpCode()) + { + case 400: + throw new HttpException(e.WebEventCode, "An input field is malformed", e); + case 404: + throw new HttpException(e.WebEventCode, "If the specified category does not exist", e); + default: + throw; + } + } + JObject Json = JObject.Parse(result); + return Json.ToObject(); } //GetPlaceFollowers() @@ -953,51 +953,51 @@ public Space GetRootSpace() //GetTrendingPlaces() - public GenericPlace UpdatePlace(int placeID, GenericPlace place, DateTime? updated = null, List fields = null) - { - string url = placesUrl + "/" + placeID.ToString(); - if (updated != null) - { - url += "?updated=" + jiveDateFormat((DateTime)updated); - } - if (fields != null && fields.Count > 0) - { - if(updated != null) - url += "&fields="; - else - url += "?fields="; - - foreach (var field in fields) - { - url += field + ","; - } - // remove last comma - url = url.Remove(url.Length - 1); - } - - string json = JsonConvert.SerializeObject(place, new JsonSerializerSettings { DefaultValueHandling = DefaultValueHandling.Ignore, Formatting = Formatting.Indented }); - string result; - try - { - result = PutAbsolute(url, json); - } - catch (HttpException e) - { - switch (e.GetHttpCode()) - { - case 400: - throw new HttpException(e.WebEventCode, "An input field is malformed", e); - case 403: - throw new HttpException(e.WebEventCode, "You are not allowed to access the specified place, or to make the requested change in place state", e); - case 409: - throw new HttpException(e.WebEventCode, "The new entity would conflict with system restrictions (such as two places of the same type with the same name)", e); - default: - throw; - } - } - - JObject Json = JObject.Parse(result); - return Json.ToObject(); + public GenericPlace UpdatePlace(int placeID, GenericPlace place, DateTime? updated = null, List fields = null) + { + string url = placesUrl + "/" + placeID.ToString(); + if (updated != null) + { + url += "?updated=" + jiveDateFormat((DateTime)updated); + } + if (fields != null && fields.Count > 0) + { + if(updated != null) + url += "&fields="; + else + url += "?fields="; + + foreach (var field in fields) + { + url += field + ","; + } + // remove last comma + url = url.Remove(url.Length - 1); + } + + string json = JsonConvert.SerializeObject(place, new JsonSerializerSettings { DefaultValueHandling = DefaultValueHandling.Ignore, Formatting = Formatting.Indented }); + string result; + try + { + result = PutAbsolute(url, json); + } + catch (HttpException e) + { + switch (e.GetHttpCode()) + { + case 400: + throw new HttpException(e.WebEventCode, "An input field is malformed", e); + case 403: + throw new HttpException(e.WebEventCode, "You are not allowed to access the specified place, or to make the requested change in place state", e); + case 409: + throw new HttpException(e.WebEventCode, "The new entity would conflict with system restrictions (such as two places of the same type with the same name)", e); + default: + throw; + } + } + + JObject Json = JObject.Parse(result); + return Json.ToObject(); } } } diff --git a/Net.Pokeshot.JiveSdk/Clients/ProfileImagesClient.cs b/Net.Pokeshot.JiveSdk/Clients/ProfileImagesClient.cs index 88c106b..dfaca41 100644 --- a/Net.Pokeshot.JiveSdk/Clients/ProfileImagesClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/ProfileImagesClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class ProfileImagesClient : JiveClient + public class ProfileImagesClient : JiveClient { public ProfileImagesClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/PublicationsClient.cs b/Net.Pokeshot.JiveSdk/Clients/PublicationsClient.cs index 6722e8e..110852a 100644 --- a/Net.Pokeshot.JiveSdk/Clients/PublicationsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/PublicationsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class PublicationsClient : JiveClient + public class PublicationsClient : JiveClient { public PublicationsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/QuestionsClient.cs b/Net.Pokeshot.JiveSdk/Clients/QuestionsClient.cs index 0067f65..226fc18 100644 --- a/Net.Pokeshot.JiveSdk/Clients/QuestionsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/QuestionsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class QuestionsClient : JiveClient + public class QuestionsClient : JiveClient { public QuestionsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/RsvpClient.cs b/Net.Pokeshot.JiveSdk/Clients/RsvpClient.cs index 5ddaf1f..28a3f62 100644 --- a/Net.Pokeshot.JiveSdk/Clients/RsvpClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/RsvpClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class RsvpClient : JiveClient + public class RsvpClient : JiveClient { public RsvpClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/SearchClient.cs b/Net.Pokeshot.JiveSdk/Clients/SearchClient.cs index 7638cfb..aa73df6 100644 --- a/Net.Pokeshot.JiveSdk/Clients/SearchClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/SearchClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class SearchClient : JiveClient + public class SearchClient : JiveClient { public SearchClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/SecurityGroupsClient.cs b/Net.Pokeshot.JiveSdk/Clients/SecurityGroupsClient.cs index 8f5efba..0571402 100644 --- a/Net.Pokeshot.JiveSdk/Clients/SecurityGroupsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/SecurityGroupsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class SecurityGroupsClient : JiveClient + public class SecurityGroupsClient : JiveClient { public SecurityGroupsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/SharesClient.cs b/Net.Pokeshot.JiveSdk/Clients/SharesClient.cs index 682efda..bed84a7 100644 --- a/Net.Pokeshot.JiveSdk/Clients/SharesClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/SharesClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class SharesClient : JiveClient + public class SharesClient : JiveClient { public SharesClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/SlidesClient.cs b/Net.Pokeshot.JiveSdk/Clients/SlidesClient.cs index 8daaa24..6fed9b9 100644 --- a/Net.Pokeshot.JiveSdk/Clients/SlidesClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/SlidesClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class SlidesClient : JiveClient + public class SlidesClient : JiveClient { public SlidesClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/Solutions_SupportCenter_Client.cs b/Net.Pokeshot.JiveSdk/Clients/Solutions_SupportCenter_Client.cs index 27f522d..8c39b4c 100644 --- a/Net.Pokeshot.JiveSdk/Clients/Solutions_SupportCenter_Client.cs +++ b/Net.Pokeshot.JiveSdk/Clients/Solutions_SupportCenter_Client.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class Solutions_SupportCenter_Client : JiveClient + public class Solutions_SupportCenter_Client : JiveClient { public Solutions_SupportCenter_Client(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/StagesClient.cs b/Net.Pokeshot.JiveSdk/Clients/StagesClient.cs index 12f5c92..5fa862f 100644 --- a/Net.Pokeshot.JiveSdk/Clients/StagesClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/StagesClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class StagesClient : JiveClient + public class StagesClient : JiveClient { public StagesClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/StaticsClient.cs b/Net.Pokeshot.JiveSdk/Clients/StaticsClient.cs index db91a39..ac56302 100644 --- a/Net.Pokeshot.JiveSdk/Clients/StaticsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/StaticsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class StaticsClient : JiveClient + public class StaticsClient : JiveClient { public StaticsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/StreamEntriesClient.cs b/Net.Pokeshot.JiveSdk/Clients/StreamEntriesClient.cs index 44dc762..71e6a4f 100644 --- a/Net.Pokeshot.JiveSdk/Clients/StreamEntriesClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/StreamEntriesClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class StreamEntriesClient : JiveClient + public class StreamEntriesClient : JiveClient { public StreamEntriesClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/TagsClient.cs b/Net.Pokeshot.JiveSdk/Clients/TagsClient.cs index 2d481a7..615dbe6 100644 --- a/Net.Pokeshot.JiveSdk/Clients/TagsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/TagsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class TagsClient : JiveClient + public class TagsClient : JiveClient { public TagsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/TileDefsClient.cs b/Net.Pokeshot.JiveSdk/Clients/TileDefsClient.cs index d459d2e..5063a61 100644 --- a/Net.Pokeshot.JiveSdk/Clients/TileDefsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/TileDefsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class TileDefsClient : JiveClient + public class TileDefsClient : JiveClient { public TileDefsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/TilesClient.cs b/Net.Pokeshot.JiveSdk/Clients/TilesClient.cs index 6362618..5472bc9 100644 --- a/Net.Pokeshot.JiveSdk/Clients/TilesClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/TilesClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class TilesClient : JiveClient + public class TilesClient : JiveClient { public TilesClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/Tiles_Categories_Client.cs b/Net.Pokeshot.JiveSdk/Clients/Tiles_Categories_Client.cs index 7510a12..454d3f7 100644 --- a/Net.Pokeshot.JiveSdk/Clients/Tiles_Categories_Client.cs +++ b/Net.Pokeshot.JiveSdk/Clients/Tiles_Categories_Client.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class Tiles_Categories_Client : JiveClient + public class Tiles_Categories_Client : JiveClient { public Tiles_Categories_Client(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/UrlsClient.cs b/Net.Pokeshot.JiveSdk/Clients/UrlsClient.cs index 2ed65c7..a2e7f8e 100644 --- a/Net.Pokeshot.JiveSdk/Clients/UrlsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/UrlsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class UrlsClient : JiveClient + public class UrlsClient : JiveClient { public UrlsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/VersionsClient.cs b/Net.Pokeshot.JiveSdk/Clients/VersionsClient.cs index 07adc4d..1b993cf 100644 --- a/Net.Pokeshot.JiveSdk/Clients/VersionsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/VersionsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class VersionsClient : JiveClient + public class VersionsClient : JiveClient { public VersionsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/VideosClient.cs b/Net.Pokeshot.JiveSdk/Clients/VideosClient.cs index 5516aad..286f8ae 100644 --- a/Net.Pokeshot.JiveSdk/Clients/VideosClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/VideosClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class VideosClient : JiveClient + public class VideosClient : JiveClient { public VideosClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/VitalsClient.cs b/Net.Pokeshot.JiveSdk/Clients/VitalsClient.cs index 7bb27fd..422d4d6 100644 --- a/Net.Pokeshot.JiveSdk/Clients/VitalsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/VitalsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class VitalsClient : JiveClient + public class VitalsClient : JiveClient { public VitalsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/WebhooksClient.cs b/Net.Pokeshot.JiveSdk/Clients/WebhooksClient.cs index 5f413bd..86ae5a9 100644 --- a/Net.Pokeshot.JiveSdk/Clients/WebhooksClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/WebhooksClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - class WebhooksClient : JiveClient + public class WebhooksClient : JiveClient { public WebhooksClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Models/GenericContent.cs b/Net.Pokeshot.JiveSdk/Models/GenericContent.cs index 1b31af0..4de633e 100644 --- a/Net.Pokeshot.JiveSdk/Models/GenericContent.cs +++ b/Net.Pokeshot.JiveSdk/Models/GenericContent.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Models { /// - /// Contains the properties of all Content subclasses. Can be used when the type of content is unknown. + /// Contains the properties of all Content subpublic classes. Can be used when the type of content is unknown. /// public class GenericContent : Content { From 890b17caf6e2b9fc3505da3f2a567eac41d8ddcc Mon Sep 17 00:00:00 2001 From: Dave Anderson Date: Wed, 16 Nov 2016 10:58:55 -0500 Subject: [PATCH 5/8] remove System.Net.Http package --- Net.Pokeshot.JiveSdk/packages.config | 1 - 1 file changed, 1 deletion(-) diff --git a/Net.Pokeshot.JiveSdk/packages.config b/Net.Pokeshot.JiveSdk/packages.config index ad66bdb..86ab5d5 100644 --- a/Net.Pokeshot.JiveSdk/packages.config +++ b/Net.Pokeshot.JiveSdk/packages.config @@ -2,5 +2,4 @@ - \ No newline at end of file From ba8738815161307e03ebd119b5da46a694910818 Mon Sep 17 00:00:00 2001 From: Dave Anderson Date: Wed, 16 Nov 2016 11:20:46 -0500 Subject: [PATCH 6/8] Revert "public class everything" This reverts commit e6c9f89e459c31f22e1dd04015db7e8527adbf0d. --- Net.Pokeshot.JiveSdk.sln | 2 +- .../Clients/AbuseReportsClient.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/AcclaimClient.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/ActionsClient.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/AddOnsClient.cs | 2 +- .../Clients/Admin_Plugins_Client.cs | 2 +- .../Clients/Admin_ProfileFields_Client.cs | 2 +- .../Clients/Admin_Properties_Client.cs | 2 +- .../Clients/AnnouncementClient.cs | 2 +- .../Clients/AttatchmentClient.cs | 2 +- .../Clients/CalendarClient.cs | 2 +- .../Clients/CheckpointsClient.cs | 2 +- .../Clients/CollaborationsClient.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/DmsClient.cs | 2 +- .../Clients/EventTypesClient.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/EventsClient.cs | 2 +- .../Clients/ExecuteBatchClient.cs | 2 +- .../Clients/ExtpropsClient.cs | 2 +- .../Clients/ExtstreamDefsClient.cs | 2 +- .../Clients/ExtstreamsClient.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/ImagesClient.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/InboxClient.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/InvitesClient.cs | 2 +- .../Clients/Invites_Event_Client.cs | 2 +- .../Clients/MentionsClient.cs | 2 +- .../Clients/Metadata_Locales_Client.cs | 2 +- .../Clients/Metadata_Objects_Client.cs | 2 +- .../Clients/Metadata_Properties_Client.cs | 2 +- .../Metadata_Properties_Public_Client.cs | 2 +- .../Clients/Metadata_Resources_Client.cs | 2 +- .../Clients/Metadata_Timezones_Client.cs | 2 +- .../Clients/ModerationClient.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/OembedClient.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/PagesClient.cs | 2 +- .../Clients/PlaceTemplateCategoriesClient.cs | 2 +- .../Clients/PlaceTemplatesClient.cs | 2 +- .../Clients/PlaceTopicsClient.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/PlacesClient.cs | 926 +++++++++--------- .../Clients/ProfileImagesClient.cs | 2 +- .../Clients/PublicationsClient.cs | 2 +- .../Clients/QuestionsClient.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/RsvpClient.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/SearchClient.cs | 2 +- .../Clients/SecurityGroupsClient.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/SharesClient.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/SlidesClient.cs | 2 +- .../Clients/Solutions_SupportCenter_Client.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/StagesClient.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/StaticsClient.cs | 2 +- .../Clients/StreamEntriesClient.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/TagsClient.cs | 2 +- .../Clients/TileDefsClient.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/TilesClient.cs | 2 +- .../Clients/Tiles_Categories_Client.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/UrlsClient.cs | 2 +- .../Clients/VersionsClient.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/VideosClient.cs | 2 +- Net.Pokeshot.JiveSdk/Clients/VitalsClient.cs | 2 +- .../Clients/WebhooksClient.cs | 2 +- Net.Pokeshot.JiveSdk/Models/GenericContent.cs | 2 +- 60 files changed, 522 insertions(+), 522 deletions(-) diff --git a/Net.Pokeshot.JiveSdk.sln b/Net.Pokeshot.JiveSdk.sln index 53f64ad..c43b627 100644 --- a/Net.Pokeshot.JiveSdk.sln +++ b/Net.Pokeshot.JiveSdk.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 +VisualStudioVersion = 14.0.24720.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Net.Pokeshot.JiveSdk", "Net.Pokeshot.JiveSdk\Net.Pokeshot.JiveSdk.csproj", "{FC8DA9F2-6C2D-4BD2-9623-F4B7E20C3AA2}" EndProject diff --git a/Net.Pokeshot.JiveSdk/Clients/AbuseReportsClient.cs b/Net.Pokeshot.JiveSdk/Clients/AbuseReportsClient.cs index 7a6e941..ef7d624 100644 --- a/Net.Pokeshot.JiveSdk/Clients/AbuseReportsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/AbuseReportsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class AbuseReportsClient : JiveClient + class AbuseReportsClient : JiveClient { public AbuseReportsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/AcclaimClient.cs b/Net.Pokeshot.JiveSdk/Clients/AcclaimClient.cs index 7d08cf3..bb99a93 100644 --- a/Net.Pokeshot.JiveSdk/Clients/AcclaimClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/AcclaimClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class AcclaimClient : JiveClient + class AcclaimClient : JiveClient { public AcclaimClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/ActionsClient.cs b/Net.Pokeshot.JiveSdk/Clients/ActionsClient.cs index fef5c7a..2c5a91a 100644 --- a/Net.Pokeshot.JiveSdk/Clients/ActionsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/ActionsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class ActionsClient: JiveClient + class ActionsClient: JiveClient { public ActionsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/AddOnsClient.cs b/Net.Pokeshot.JiveSdk/Clients/AddOnsClient.cs index 103da2a..761fae1 100644 --- a/Net.Pokeshot.JiveSdk/Clients/AddOnsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/AddOnsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class AddOnsClient : JiveClient + class AddOnsClient : JiveClient { public AddOnsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/Admin_Plugins_Client.cs b/Net.Pokeshot.JiveSdk/Clients/Admin_Plugins_Client.cs index 8bcc3b9..566bf56 100644 --- a/Net.Pokeshot.JiveSdk/Clients/Admin_Plugins_Client.cs +++ b/Net.Pokeshot.JiveSdk/Clients/Admin_Plugins_Client.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class Admin_Plugins_Client : JiveClient + class Admin_Plugins_Client : JiveClient { public Admin_Plugins_Client(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/Admin_ProfileFields_Client.cs b/Net.Pokeshot.JiveSdk/Clients/Admin_ProfileFields_Client.cs index ecf0e05..3569177 100644 --- a/Net.Pokeshot.JiveSdk/Clients/Admin_ProfileFields_Client.cs +++ b/Net.Pokeshot.JiveSdk/Clients/Admin_ProfileFields_Client.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class Admin_ProfileFields_Client : JiveClient + class Admin_ProfileFields_Client : JiveClient { public Admin_ProfileFields_Client(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/Admin_Properties_Client.cs b/Net.Pokeshot.JiveSdk/Clients/Admin_Properties_Client.cs index 26004b2..99ebbfb 100644 --- a/Net.Pokeshot.JiveSdk/Clients/Admin_Properties_Client.cs +++ b/Net.Pokeshot.JiveSdk/Clients/Admin_Properties_Client.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class Admin_Properties_Client : JiveClient + class Admin_Properties_Client : JiveClient { public Admin_Properties_Client(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/AnnouncementClient.cs b/Net.Pokeshot.JiveSdk/Clients/AnnouncementClient.cs index 656507e..f2c133f 100644 --- a/Net.Pokeshot.JiveSdk/Clients/AnnouncementClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/AnnouncementClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class AnnouncementRetriever : JiveClient + class AnnouncementRetriever : JiveClient { public AnnouncementRetriever(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/AttatchmentClient.cs b/Net.Pokeshot.JiveSdk/Clients/AttatchmentClient.cs index 44bc0c2..d57aeb0 100644 --- a/Net.Pokeshot.JiveSdk/Clients/AttatchmentClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/AttatchmentClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class AttatchmentRetriever : JiveClient + class AttatchmentRetriever : JiveClient { public AttatchmentRetriever(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/CalendarClient.cs b/Net.Pokeshot.JiveSdk/Clients/CalendarClient.cs index b7ee98d..85a08e3 100644 --- a/Net.Pokeshot.JiveSdk/Clients/CalendarClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/CalendarClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class CalendarClient : JiveClient + class CalendarClient : JiveClient { public CalendarClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/CheckpointsClient.cs b/Net.Pokeshot.JiveSdk/Clients/CheckpointsClient.cs index 9cb689d..032fc32 100644 --- a/Net.Pokeshot.JiveSdk/Clients/CheckpointsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/CheckpointsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class CheckpointsClient : JiveClient + class CheckpointsClient : JiveClient { public CheckpointsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/CollaborationsClient.cs b/Net.Pokeshot.JiveSdk/Clients/CollaborationsClient.cs index 69f1ad6..8f3e0cb 100644 --- a/Net.Pokeshot.JiveSdk/Clients/CollaborationsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/CollaborationsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class CollaborationsClient : JiveClient + class CollaborationsClient : JiveClient { public CollaborationsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/DmsClient.cs b/Net.Pokeshot.JiveSdk/Clients/DmsClient.cs index 142fdb2..6af2020 100644 --- a/Net.Pokeshot.JiveSdk/Clients/DmsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/DmsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class DmsClient : JiveClient + class DmsClient : JiveClient { public DmsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/EventTypesClient.cs b/Net.Pokeshot.JiveSdk/Clients/EventTypesClient.cs index 2ebd46e..874e6e1 100644 --- a/Net.Pokeshot.JiveSdk/Clients/EventTypesClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/EventTypesClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class EventTypesClient : JiveClient + class EventTypesClient : JiveClient { public EventTypesClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/EventsClient.cs b/Net.Pokeshot.JiveSdk/Clients/EventsClient.cs index 3c2f509..a8f8fe9 100644 --- a/Net.Pokeshot.JiveSdk/Clients/EventsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/EventsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class EventsClient : JiveClient + class EventsClient : JiveClient { public EventsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/ExecuteBatchClient.cs b/Net.Pokeshot.JiveSdk/Clients/ExecuteBatchClient.cs index 559e5a8..63e8fb6 100644 --- a/Net.Pokeshot.JiveSdk/Clients/ExecuteBatchClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/ExecuteBatchClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class ExecuteBatchClient : JiveClient + class ExecuteBatchClient : JiveClient { public ExecuteBatchClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/ExtpropsClient.cs b/Net.Pokeshot.JiveSdk/Clients/ExtpropsClient.cs index dafb4b6..202f307 100644 --- a/Net.Pokeshot.JiveSdk/Clients/ExtpropsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/ExtpropsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class ExtpropsClient : JiveClient + class ExtpropsClient : JiveClient { public ExtpropsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/ExtstreamDefsClient.cs b/Net.Pokeshot.JiveSdk/Clients/ExtstreamDefsClient.cs index d2ebef5..cbe0de2 100644 --- a/Net.Pokeshot.JiveSdk/Clients/ExtstreamDefsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/ExtstreamDefsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class ExtstreamDefsClient : JiveClient + class ExtstreamDefsClient : JiveClient { public ExtstreamDefsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/ExtstreamsClient.cs b/Net.Pokeshot.JiveSdk/Clients/ExtstreamsClient.cs index bf35e13..50ec2c6 100644 --- a/Net.Pokeshot.JiveSdk/Clients/ExtstreamsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/ExtstreamsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class ExtstreamsClient : JiveClient + class ExtstreamsClient : JiveClient { public ExtstreamsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/ImagesClient.cs b/Net.Pokeshot.JiveSdk/Clients/ImagesClient.cs index dd029b5..5112257 100644 --- a/Net.Pokeshot.JiveSdk/Clients/ImagesClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/ImagesClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class ImagesClient : JiveClient + class ImagesClient : JiveClient { public ImagesClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/InboxClient.cs b/Net.Pokeshot.JiveSdk/Clients/InboxClient.cs index 0176c82..4a8bc9e 100644 --- a/Net.Pokeshot.JiveSdk/Clients/InboxClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/InboxClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class InboxClient : JiveClient + class InboxClient : JiveClient { public InboxClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/InvitesClient.cs b/Net.Pokeshot.JiveSdk/Clients/InvitesClient.cs index 7494c2a..57e484f 100644 --- a/Net.Pokeshot.JiveSdk/Clients/InvitesClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/InvitesClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class InvitesClient : JiveClient + class InvitesClient : JiveClient { public InvitesClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/Invites_Event_Client.cs b/Net.Pokeshot.JiveSdk/Clients/Invites_Event_Client.cs index 892a57b..ad1301c 100644 --- a/Net.Pokeshot.JiveSdk/Clients/Invites_Event_Client.cs +++ b/Net.Pokeshot.JiveSdk/Clients/Invites_Event_Client.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class Invites_Event_Client : JiveClient + class Invites_Event_Client : JiveClient { public Invites_Event_Client(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/MentionsClient.cs b/Net.Pokeshot.JiveSdk/Clients/MentionsClient.cs index 484e82e..8a62939 100644 --- a/Net.Pokeshot.JiveSdk/Clients/MentionsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/MentionsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class MentionsClient : JiveClient + class MentionsClient : JiveClient { public MentionsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/Metadata_Locales_Client.cs b/Net.Pokeshot.JiveSdk/Clients/Metadata_Locales_Client.cs index 2934f81..c7cdf57 100644 --- a/Net.Pokeshot.JiveSdk/Clients/Metadata_Locales_Client.cs +++ b/Net.Pokeshot.JiveSdk/Clients/Metadata_Locales_Client.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class Metadata_Locales_Client: JiveClient + class Metadata_Locales_Client: JiveClient { public Metadata_Locales_Client(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/Metadata_Objects_Client.cs b/Net.Pokeshot.JiveSdk/Clients/Metadata_Objects_Client.cs index 06bef6e..3b3e040 100644 --- a/Net.Pokeshot.JiveSdk/Clients/Metadata_Objects_Client.cs +++ b/Net.Pokeshot.JiveSdk/Clients/Metadata_Objects_Client.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class Metadata_Objects_Client : JiveClient + class Metadata_Objects_Client : JiveClient { public Metadata_Objects_Client(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/Metadata_Properties_Client.cs b/Net.Pokeshot.JiveSdk/Clients/Metadata_Properties_Client.cs index adf49b4..88e814c 100644 --- a/Net.Pokeshot.JiveSdk/Clients/Metadata_Properties_Client.cs +++ b/Net.Pokeshot.JiveSdk/Clients/Metadata_Properties_Client.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class Metadata_Properties_Client: JiveClient + class Metadata_Properties_Client: JiveClient { public Metadata_Properties_Client(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/Metadata_Properties_Public_Client.cs b/Net.Pokeshot.JiveSdk/Clients/Metadata_Properties_Public_Client.cs index 0a72951..e129857 100644 --- a/Net.Pokeshot.JiveSdk/Clients/Metadata_Properties_Public_Client.cs +++ b/Net.Pokeshot.JiveSdk/Clients/Metadata_Properties_Public_Client.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class Metadata_Properties_Public_Client : JiveClient + class Metadata_Properties_Public_Client : JiveClient { public Metadata_Properties_Public_Client(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/Metadata_Resources_Client.cs b/Net.Pokeshot.JiveSdk/Clients/Metadata_Resources_Client.cs index 4b998c3..1253a70 100644 --- a/Net.Pokeshot.JiveSdk/Clients/Metadata_Resources_Client.cs +++ b/Net.Pokeshot.JiveSdk/Clients/Metadata_Resources_Client.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class Metadata_Resources_Client : JiveClient + class Metadata_Resources_Client : JiveClient { public Metadata_Resources_Client(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/Metadata_Timezones_Client.cs b/Net.Pokeshot.JiveSdk/Clients/Metadata_Timezones_Client.cs index e442959..708896b 100644 --- a/Net.Pokeshot.JiveSdk/Clients/Metadata_Timezones_Client.cs +++ b/Net.Pokeshot.JiveSdk/Clients/Metadata_Timezones_Client.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class Metadata_Timezones_Client : JiveClient + class Metadata_Timezones_Client : JiveClient { public Metadata_Timezones_Client(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/ModerationClient.cs b/Net.Pokeshot.JiveSdk/Clients/ModerationClient.cs index 122cadb..5676136 100644 --- a/Net.Pokeshot.JiveSdk/Clients/ModerationClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/ModerationClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class ModerationClient : JiveClient + class ModerationClient : JiveClient { public ModerationClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/OembedClient.cs b/Net.Pokeshot.JiveSdk/Clients/OembedClient.cs index a3790ee..a1f49f8 100644 --- a/Net.Pokeshot.JiveSdk/Clients/OembedClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/OembedClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class OembedClient : JiveClient + class OembedClient : JiveClient { public OembedClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/PagesClient.cs b/Net.Pokeshot.JiveSdk/Clients/PagesClient.cs index 6757b41..4fb3fe6 100644 --- a/Net.Pokeshot.JiveSdk/Clients/PagesClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/PagesClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class PagesClient : JiveClient + class PagesClient : JiveClient { public PagesClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/PlaceTemplateCategoriesClient.cs b/Net.Pokeshot.JiveSdk/Clients/PlaceTemplateCategoriesClient.cs index ffa3e1c..25fd0a1 100644 --- a/Net.Pokeshot.JiveSdk/Clients/PlaceTemplateCategoriesClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/PlaceTemplateCategoriesClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class PlaceTemplateCategoriesClient : JiveClient + class PlaceTemplateCategoriesClient : JiveClient { public PlaceTemplateCategoriesClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/PlaceTemplatesClient.cs b/Net.Pokeshot.JiveSdk/Clients/PlaceTemplatesClient.cs index 741d588..b38adf2 100644 --- a/Net.Pokeshot.JiveSdk/Clients/PlaceTemplatesClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/PlaceTemplatesClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class PlaceTemplatesClient : JiveClient + class PlaceTemplatesClient : JiveClient { public PlaceTemplatesClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/PlaceTopicsClient.cs b/Net.Pokeshot.JiveSdk/Clients/PlaceTopicsClient.cs index fe64784..cd79267 100644 --- a/Net.Pokeshot.JiveSdk/Clients/PlaceTopicsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/PlaceTopicsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class PlaceTopicsClient : JiveClient + class PlaceTopicsClient : JiveClient { public PlaceTopicsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/PlacesClient.cs b/Net.Pokeshot.JiveSdk/Clients/PlacesClient.cs index 49d8377..7e5be73 100644 --- a/Net.Pokeshot.JiveSdk/Clients/PlacesClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/PlacesClient.cs @@ -14,15 +14,15 @@ namespace Net.Pokeshot.JiveSdk.Clients public class PlacesClient : JiveClient { string placesUrl { get { return JiveCommunityUrl + "/api/core/v3/places"; } } - public PlacesClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } - - /// - /// Checks for the presence of the given categories in the given Place, and creates any that are not present. - /// Note: will throw an HttpException if the max number of categories has been reached. - /// - /// ID of the Place the categories are supposed to be found or created - /// a list of the categories to be found or created - /// a string List of the categories that were successfully created + public PlacesClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } + + /// + /// Checks for the presence of the given categories in the given Place, and creates any that are not present. + /// Note: will throw an HttpException if the max number of categories has been reached. + /// + /// ID of the Place the categories are supposed to be found or created + /// a list of the categories to be found or created + /// a string List of the categories that were successfully created public List CheckAndCreateCategories(int placeID, List categories) { //pulls all of the current categories for the defined Place @@ -33,191 +33,191 @@ public List CheckAndCreateCategories(int placeID, List categorie bool found; Category newCategory; - foreach (var category in categories) - { - found = false; - foreach (var oldCategory in categoryList) - { - if (category == oldCategory.name) found = true; - } - if (!found) - { - newCategory = new Category(); - newCategory.name = category; - newCategory.type = "category"; - try - { - CreatePlaceCategory(placeID, newCategory); - addedList.Add(category); - } - catch (HttpException e) - { - if (e.GetHttpCode() != 400) throw; - else - { - Console.WriteLine("max number of categories reached for placeID: " + placeID + ", some categories omitted from result"); - throw; - } - } - } + foreach (var category in categories) + { + found = false; + foreach (var oldCategory in categoryList) + { + if (category == oldCategory.name) found = true; + } + if (!found) + { + newCategory = new Category(); + newCategory.name = category; + newCategory.type = "category"; + try + { + CreatePlaceCategory(placeID, newCategory); + addedList.Add(category); + } + catch (HttpException e) + { + if (e.GetHttpCode() != 400) throw; + else + { + Console.WriteLine("max number of categories reached for placeID: " + placeID + ", some categories omitted from result"); + throw; + } + } + } } return addedList; } - /// - /// Create a new content object with specified characteristics, and return an entity representing the newly created content object. - /// - /// ID of the place the content should be added to - /// a GenericContent object describing the content object to be created - /// a DateTime of when this content object was originally created. Set 'updated' param as well. Only set this field when importing content. - /// a DateTime of when this content object was most recently updated. Set 'published' param as well. Only set this field when importing content. - /// The fields to include in the returned entity + /// + /// Create a new content object with specified characteristics, and return an entity representing the newly created content object. + /// + /// ID of the place the content should be added to + /// a GenericContent object describing the content object to be created + /// a DateTime of when this content object was originally created. Set 'updated' param as well. Only set this field when importing content. + /// a DateTime of when this content object was most recently updated. Set 'published' param as well. Only set this field when importing content. + /// The fields to include in the returned entity /// a GenericContent object representing the newly created content - public GenericContent CreateContent(int placeID, GenericContent content, DateTime? published = null, DateTime? updated = null, List fields = null) - { - //constructs the url for the HTTP request based on the user specifications - bool first = true; - string url = placesUrl + "/" + placeID.ToString() + "/contents"; - if (published != null) - { - url += "?published=" + jiveDateFormat((DateTime)published); - first = false; - } - if (updated != null) - { - if (first) url += "?updated="; - else url += "&updated="; - url += jiveDateFormat((DateTime)updated); - first = false; - } - if (fields != null && fields.Count > 0) - { - if (first == true) - { - url += "?fields="; - first = false; - } - else url += "&fields="; - - foreach (var field in fields) - { - url += field + ","; - } - //remove last comma - url = url.Remove(url.Length - 1); - } - - //converts the content to be added into JSON format and makes the HTTP request - string json = JsonConvert.SerializeObject(content, new JsonSerializerSettings { DefaultValueHandling = DefaultValueHandling.Ignore, Formatting = Formatting.Indented }); - string result; - try - { - result = PostAbsolute(url, json); - } - catch (HttpException e) - { - switch (e.GetHttpCode()) - { - case 400: - throw new HttpException(e.WebEventCode, "An input field is malformed", e); - case 403: - throw new HttpException(e.WebEventCode, "You are not allowed to access the specified content or place", e); - case 409: - throw new HttpException(e.WebEventCode, "The new entity would conflict with system restrictions (such as two contents of the same type with the same name", e); - default: - throw; - } - } - - //converts the returned JSON into a GenericContent object and returns it to the user - JObject Json = JObject.Parse(result); - return Json.ToObject(); + public GenericContent CreateContent(int placeID, GenericContent content, DateTime? published = null, DateTime? updated = null, List fields = null) + { + //constructs the url for the HTTP request based on the user specifications + bool first = true; + string url = placesUrl + "/" + placeID.ToString() + "/contents"; + if (published != null) + { + url += "?published=" + jiveDateFormat((DateTime)published); + first = false; + } + if (updated != null) + { + if (first) url += "?updated="; + else url += "&updated="; + url += jiveDateFormat((DateTime)updated); + first = false; + } + if (fields != null && fields.Count > 0) + { + if (first == true) + { + url += "?fields="; + first = false; + } + else url += "&fields="; + + foreach (var field in fields) + { + url += field + ","; + } + //remove last comma + url = url.Remove(url.Length - 1); + } + + //converts the content to be added into JSON format and makes the HTTP request + string json = JsonConvert.SerializeObject(content, new JsonSerializerSettings { DefaultValueHandling = DefaultValueHandling.Ignore, Formatting = Formatting.Indented }); + string result; + try + { + result = PostAbsolute(url, json); + } + catch (HttpException e) + { + switch (e.GetHttpCode()) + { + case 400: + throw new HttpException(e.WebEventCode, "An input field is malformed", e); + case 403: + throw new HttpException(e.WebEventCode, "You are not allowed to access the specified content or place", e); + case 409: + throw new HttpException(e.WebEventCode, "The new entity would conflict with system restrictions (such as two contents of the same type with the same name", e); + default: + throw; + } + } + + //converts the returned JSON into a GenericContent object and returns it to the user + JObject Json = JObject.Parse(result); + return Json.ToObject(); } - /// - /// Create a new place with specified characteristics, and return an entity representing the newly created place. - /// Note: type of input Place must match generic type of method call and must be a subtype of Place - /// - /// Place object describing the place to be created - /// Note: the displayName and name fields are required, and must be unique within the parent place. - /// Note: if the parent field is not included, the root space will be the default parent of the new place. - /// Date and time when this place was originally created. Set 'updated' param as well. Only set this field when importing content. - /// Date and time when this place was most recently updated. Set 'published' param as well. Only set this field when importing content. - /// Fields to include in the returned entity + /// + /// Create a new place with specified characteristics, and return an entity representing the newly created place. + /// Note: type of input Place must match generic type of method call and must be a subtype of Place + /// + /// Place object describing the place to be created + /// Note: the displayName and name fields are required, and must be unique within the parent place. + /// Note: if the parent field is not included, the root space will be the default parent of the new place. + /// Date and time when this place was originally created. Set 'updated' param as well. Only set this field when importing content. + /// Date and time when this place was most recently updated. Set 'published' param as well. Only set this field when importing content. + /// Fields to include in the returned entity /// Place object representing the newly created place - public T CreatePlace(T new_place, DateTime? published = null, DateTime? updated = null, List fields = null) - { - //constructs the url for the HTTP request based on the user specifications - bool first = true; - string url = placesUrl; - if (published != null) - { - url += "?published=" + jiveDateFormat((DateTime)published); - first = false; - } - if (updated != null) - { - if (first) url += "?updated=" + jiveDateFormat((DateTime)updated); - else url += "&updated=" + jiveDateFormat((DateTime)updated); - first = false; - } - if (fields != null && fields.Count > 0) - { - if (first == true) - { - url += "?fields="; - first = false; - } - else url += "&fields="; - - foreach (var field in fields) - { - url += field + ","; - } - //remove last comma - url = url.Remove(url.Length - 1); - } - - //converts the place to be added into JSON format and makes the HTTP request - string json = JsonConvert.SerializeObject(new_place, new JsonSerializerSettings { DefaultValueHandling = DefaultValueHandling.Ignore, Formatting = Formatting.Indented }); - string result; - try - { - result = PostAbsolute(url, json); - } - catch (HttpException e) - { - switch (e.GetHttpCode()) - { - case 400: - throw new HttpException(e.WebEventCode, "An input field is malformed", e); - case 403: - throw new HttpException(e.WebEventCode, "You are not allowed to access the specified place", e); - case 409: - throw new HttpException(e.WebEventCode, "The new entity would conflict with system restrictions (such as two places of the same type with the same name", e); - default: - throw; - } - } - - //converts the returned JSON into a Place object and returns it to the user - JObject Json = JObject.Parse(result); - return Json.ToObject(); + public T CreatePlace(T new_place, DateTime? published = null, DateTime? updated = null, List fields = null) + { + //constructs the url for the HTTP request based on the user specifications + bool first = true; + string url = placesUrl; + if (published != null) + { + url += "?published=" + jiveDateFormat((DateTime)published); + first = false; + } + if (updated != null) + { + if (first) url += "?updated=" + jiveDateFormat((DateTime)updated); + else url += "&updated=" + jiveDateFormat((DateTime)updated); + first = false; + } + if (fields != null && fields.Count > 0) + { + if (first == true) + { + url += "?fields="; + first = false; + } + else url += "&fields="; + + foreach (var field in fields) + { + url += field + ","; + } + //remove last comma + url = url.Remove(url.Length - 1); + } + + //converts the place to be added into JSON format and makes the HTTP request + string json = JsonConvert.SerializeObject(new_place, new JsonSerializerSettings { DefaultValueHandling = DefaultValueHandling.Ignore, Formatting = Formatting.Indented }); + string result; + try + { + result = PostAbsolute(url, json); + } + catch (HttpException e) + { + switch (e.GetHttpCode()) + { + case 400: + throw new HttpException(e.WebEventCode, "An input field is malformed", e); + case 403: + throw new HttpException(e.WebEventCode, "You are not allowed to access the specified place", e); + case 409: + throw new HttpException(e.WebEventCode, "The new entity would conflict with system restrictions (such as two places of the same type with the same name", e); + default: + throw; + } + } + + //converts the returned JSON into a Place object and returns it to the user + JObject Json = JObject.Parse(result); + return Json.ToObject(); } - /// - /// Create a new announcement associated with this place. An appropriate parent field will be calculated and injected automatically. - /// - /// ID of the place for which to create an announcement - /// Announcement object describing the announcement to be created - /// Fields to include in the returned Announcement object + /// + /// Create a new announcement associated with this place. An appropriate parent field will be calculated and injected automatically. + /// + /// ID of the place for which to create an announcement + /// Announcement object describing the announcement to be created + /// Fields to include in the returned Announcement object /// Announcement object representing the newly created announcement - public Announcement CreatePlaceAnnouncement(int placeID, Announcement announcement, List fields = null) - { - //constructs the url for the HTTP request based on the user specifications - string url = placesUrl + "/" + placeID.ToString() + "/announcements"; + public Announcement CreatePlaceAnnouncement(int placeID, Announcement announcement, List fields = null) + { + //constructs the url for the HTTP request based on the user specifications + string url = placesUrl + "/" + placeID.ToString() + "/announcements"; if (fields != null && fields.Count > 0) { url += "?fields="; @@ -227,48 +227,48 @@ public Announcement CreatePlaceAnnouncement(int placeID, Announcement announceme } // remove last comma url = url.Remove(url.Length - 1); - } - - //converts the announcement to be added into JSON format and makes the HTTP request - string json = JsonConvert.SerializeObject(announcement, new JsonSerializerSettings { DefaultValueHandling = DefaultValueHandling.Ignore, Formatting = Formatting.Indented }); - string result; - try - { - result = PostAbsolute(url, json); - } - catch (HttpException e) - { - switch (e.GetHttpCode()) - { - case 400: - throw new HttpException(e.WebEventCode, "An input field is missing or malformed", e); - case 403: - throw new HttpException(e.WebEventCode, "You are not allowed to create announcements in the specified place", e); - case 404: - throw new HttpException(e.WebEventCode, "The specified parent place cannot be found", e); - default: - throw; - } - } - - //converts the returned JSON into an Announcement object and returns it to the user - JObject Json = JObject.Parse(result); - return Json.ToObject(); + } + + //converts the announcement to be added into JSON format and makes the HTTP request + string json = JsonConvert.SerializeObject(announcement, new JsonSerializerSettings { DefaultValueHandling = DefaultValueHandling.Ignore, Formatting = Formatting.Indented }); + string result; + try + { + result = PostAbsolute(url, json); + } + catch (HttpException e) + { + switch (e.GetHttpCode()) + { + case 400: + throw new HttpException(e.WebEventCode, "An input field is missing or malformed", e); + case 403: + throw new HttpException(e.WebEventCode, "You are not allowed to create announcements in the specified place", e); + case 404: + throw new HttpException(e.WebEventCode, "The specified parent place cannot be found", e); + default: + throw; + } + } + + //converts the returned JSON into an Announcement object and returns it to the user + JObject Json = JObject.Parse(result); + return Json.ToObject(); } - /// - /// Create a new category for a place with specified characteristics, and return an entity representing the newly created category. - /// - /// ID of the place for which to create a category - /// Category object describing the category to be created - /// Flag indicating whether existing content of the place will be categorized under the new category - /// Fields to be returned (default is @all) + /// + /// Create a new category for a place with specified characteristics, and return an entity representing the newly created category. + /// + /// ID of the place for which to create a category + /// Category object describing the category to be created + /// Flag indicating whether existing content of the place will be categorized under the new category + /// Fields to be returned (default is @all) /// Category object representing the newly created category - public Category CreatePlaceCategory(int placeID, Category new_category, bool autoCategorize = false, List fields = null) - { - //construct the url for the HTTP request based on the user specifications - string url = placesUrl + "/" + placeID.ToString() + "/categories"; - url += "?autoCategorize=" + autoCategorize.ToString(); + public Category CreatePlaceCategory(int placeID, Category new_category, bool autoCategorize = false, List fields = null) + { + //construct the url for the HTTP request based on the user specifications + string url = placesUrl + "/" + placeID.ToString() + "/categories"; + url += "?autoCategorize=" + autoCategorize.ToString(); if (fields != null && fields.Count > 0) { url += "&fields="; @@ -278,122 +278,122 @@ public Category CreatePlaceCategory(int placeID, Category new_category, bool aut } // remove last comma url = url.Remove(url.Length - 1); - } - - //convert the Category object to JSON format and post via HTTP - string json = JsonConvert.SerializeObject(new_category, new JsonSerializerSettings { DefaultValueHandling = DefaultValueHandling.Ignore, Formatting = Formatting.Indented }); - string result; - try - { - result = PostAbsolute(url, json); - } - catch (HttpException e) - { - switch (e.GetHttpCode()) - { - case 400: - throw new HttpException(e.WebEventCode, "An input field is malformed or max number of categories has been reached", e); - case 403: - throw new HttpException(e.WebEventCode, "You are not allowed to manage categories for the place", e); - case 409: - throw new HttpException(e.WebEventCode, "The new entity would conflict with system restrictions (such as two categories with the same name", e); - default: - throw; - } - } - - //convert the returned JSON into a Category object and return to the user - JObject Json = JObject.Parse(result); - return Json.ToObject(); + } + + //convert the Category object to JSON format and post via HTTP + string json = JsonConvert.SerializeObject(new_category, new JsonSerializerSettings { DefaultValueHandling = DefaultValueHandling.Ignore, Formatting = Formatting.Indented }); + string result; + try + { + result = PostAbsolute(url, json); + } + catch (HttpException e) + { + switch (e.GetHttpCode()) + { + case 400: + throw new HttpException(e.WebEventCode, "An input field is malformed or max number of categories has been reached", e); + case 403: + throw new HttpException(e.WebEventCode, "You are not allowed to manage categories for the place", e); + case 409: + throw new HttpException(e.WebEventCode, "The new entity would conflict with system restrictions (such as two categories with the same name", e); + default: + throw; + } + } + + //convert the returned JSON into a Category object and return to the user + JObject Json = JObject.Parse(result); + return Json.ToObject(); } - /// - /// Delete the specified place. - /// + /// + /// Delete the specified place. + /// /// ID of the place to be deleted - public void DestroyPlace(int placeID) - { - string url = placesUrl + "/" + placeID.ToString(); - - try - { - DeleteAbsolute(url); - } - catch (HttpException e) - { - switch (e.GetHttpCode()) - { - case 400: - throw new HttpException(e.WebEventCode, "An input field is malformed", e); - case 403: - throw new HttpException(e.WebEventCode, "You are not allowed to access the specified place", e); - case 404: - throw new HttpException(e.WebEventCode, "The specified place does not exist", e); - default: - throw; - } - } + public void DestroyPlace(int placeID) + { + string url = placesUrl + "/" + placeID.ToString(); + + try + { + DeleteAbsolute(url); + } + catch (HttpException e) + { + switch (e.GetHttpCode()) + { + case 400: + throw new HttpException(e.WebEventCode, "An input field is malformed", e); + case 403: + throw new HttpException(e.WebEventCode, "You are not allowed to access the specified place", e); + case 404: + throw new HttpException(e.WebEventCode, "The specified place does not exist", e); + default: + throw; + } + } } - /// - /// Delete the existing category for the specified place. Only admins of the place can manage place categories. - /// - /// ID of the place for which the category is to be deleted + /// + /// Delete the existing category for the specified place. Only admins of the place can manage place categories. + /// + /// ID of the place for which the category is to be deleted /// ID of the category to delete - public void DestroyPlaceCategory(int placeID, int categoryID) - { - string url = placesUrl + "/" + placeID.ToString() + "/categories/" + categoryID.ToString(); - - try - { - DeleteAbsolute(url); //makes the HTTP DELETE call - } - catch (HttpException e) - { - switch (e.GetHttpCode()) - { - case 400: - throw new HttpException(e.WebEventCode, "An input field is malformed", e); - case 403: - throw new HttpException(e.WebEventCode, "You are not allowed to delete this image", e); - case 404: - throw new HttpException(e.WebEventCode, "The specified place or image does not exist", e); - default: - throw; - } - } - - return; - } - - //GetActivity() - //GetAppliedEntitlements() - - /// - /// Return a list of featured content objects in the specified place. - /// - /// ID of the place the objects are being retrieved from + public void DestroyPlaceCategory(int placeID, int categoryID) + { + string url = placesUrl + "/" + placeID.ToString() + "/categories/" + categoryID.ToString(); + + try + { + DeleteAbsolute(url); //makes the HTTP DELETE call + } + catch (HttpException e) + { + switch (e.GetHttpCode()) + { + case 400: + throw new HttpException(e.WebEventCode, "An input field is malformed", e); + case 403: + throw new HttpException(e.WebEventCode, "You are not allowed to delete this image", e); + case 404: + throw new HttpException(e.WebEventCode, "The specified place or image does not exist", e); + default: + throw; + } + } + + return; + } + + //GetActivity() + //GetAppliedEntitlements() + + /// + /// Return a list of featured content objects in the specified place. + /// + /// ID of the place the objects are being retrieved from /// Requested sort order. /// Possible strings: /// dateCreatedAsc - Sort by the date this place was created, in ascending order. /// dateCreatedDesc - Sort by the date this place was created, in descending order. Default if none was specified. /// latestActivityAsc - Sort by the date this place had the most recent activity, in ascending order. /// latestActivityDesc - Sort by the date this place had the most recent activity, in descending order. - /// titleAsc - Sort by place name, in ascending order. - /// one or more object types of desired contained content objects (document, discussion, post, poll) separated by commas - /// The fields to be returned on each content - /// The zero-relative index of the first matching content to be returned - /// The maximum number of contents to be returned per Jive HTTP request - /// Flag indicating that if content.text is requested, it will be abridged (length shortened, HTML tags removed) - /// a GenericContent object list of the matched content objects - public List GetContents(int placeID, string sort = "dateCreatedDesc", List type = null, List fields = null, int startIndex = 0, int count = 25, bool abridged = false) - { - //construct url for the HTTP request with the user specifications - string url = placesUrl + "/" + placeID.ToString() + "/contents"; - url += "?sort=" + sort; - url += "&abridged=" + abridged.ToString(); - url += "&count=" + (count > 100 ? 100 : count).ToString(); - if (startIndex != 0) url += "&startIndex=" + startIndex.ToString(); + /// titleAsc - Sort by place name, in ascending order. + /// one or more object types of desired contained content objects (document, discussion, post, poll) separated by commas + /// The fields to be returned on each content + /// The zero-relative index of the first matching content to be returned + /// The maximum number of contents to be returned per Jive HTTP request + /// Flag indicating that if content.text is requested, it will be abridged (length shortened, HTML tags removed) + /// a GenericContent object list of the matched content objects + public List GetContents(int placeID, string sort = "dateCreatedDesc", List type = null, List fields = null, int startIndex = 0, int count = 25, bool abridged = false) + { + //construct url for the HTTP request with the user specifications + string url = placesUrl + "/" + placeID.ToString() + "/contents"; + url += "?sort=" + sort; + url += "&abridged=" + abridged.ToString(); + url += "&count=" + (count > 100 ? 100 : count).ToString(); + if (startIndex != 0) url += "&startIndex=" + startIndex.ToString(); if (type != null && type.Count > 0) { url += "&filter=type("; @@ -405,7 +405,7 @@ public List GetContents(int placeID, string sort = "dateCreatedD url.Remove(url.Length - 1); url += ")"; - } + } if (fields != null && fields.Count > 0) { url += "&fields="; @@ -415,8 +415,8 @@ public List GetContents(int placeID, string sort = "dateCreatedD } // remove last comma url = url.Remove(url.Length - 1); - } - + } + // jive returns a paginated list, so we have to loop through all of the pages. string json; JObject results; @@ -450,8 +450,8 @@ public List GetContents(int placeID, string sort = "dateCreatedD else url = results["links"]["next"].ToString(); } - return contentList; - + return contentList; + } //GetExtProps() @@ -503,26 +503,26 @@ public GenericPlace GetPlace(int placeID, List fields = null) JObject results = JObject.Parse(json); return results.ToObject(); - } - - /// - /// Return a paginated list of announcements related to the specified place. - /// - /// ID of the place for which to return announcements - /// Maximum number of elements to be returned per Jive HTTP request - /// Zero-relative index of the first announcement to be returned - /// True if only active (non-expired) announcements should be returned - /// Fields to be included in returned announcements - /// an Announcement object list of the announcements for the specified place - public List GetPlaceAnnouncements(int placeID, int count = 25, int startIndex = 0, bool activeOnly = true, List fields = null) - { - List announcementList = new List(); - - //construct the url for the HTTP request based on the user specifications - string url = placesUrl + "/" + placeID.ToString() + "/announcements"; - url += "?count=" + count.ToString(); - url += "&startIndex=" + startIndex.ToString(); - url += "&activeOnly=" + activeOnly.ToString(); + } + + /// + /// Return a paginated list of announcements related to the specified place. + /// + /// ID of the place for which to return announcements + /// Maximum number of elements to be returned per Jive HTTP request + /// Zero-relative index of the first announcement to be returned + /// True if only active (non-expired) announcements should be returned + /// Fields to be included in returned announcements + /// an Announcement object list of the announcements for the specified place + public List GetPlaceAnnouncements(int placeID, int count = 25, int startIndex = 0, bool activeOnly = true, List fields = null) + { + List announcementList = new List(); + + //construct the url for the HTTP request based on the user specifications + string url = placesUrl + "/" + placeID.ToString() + "/announcements"; + url += "?count=" + count.ToString(); + url += "&startIndex=" + startIndex.ToString(); + url += "&activeOnly=" + activeOnly.ToString(); if (fields != null && fields.Count > 0) { url += "&fields="; @@ -532,17 +532,17 @@ public List GetPlaceAnnouncements(int placeID, int count = 25, int } // remove last comma url = url.Remove(url.Length - 1); - } - - // jive returns a paginated list, so we have to loop through all of the pages. - string json; - JObject results; - while (true) - { - try - { - json = GetAbsolute(url); - } + } + + // jive returns a paginated list, so we have to loop through all of the pages. + string json; + JObject results; + while (true) + { + try + { + json = GetAbsolute(url); + } catch (HttpException e) { switch (e.GetHttpCode()) @@ -554,8 +554,8 @@ public List GetPlaceAnnouncements(int placeID, int count = 25, int default: throw; } - } - + } + results = JObject.Parse(json); announcementList.AddRange(results["list"].ToObject>()); @@ -563,26 +563,26 @@ public List GetPlaceAnnouncements(int placeID, int count = 25, int if (results["links"] == null || results["links"]["next"] == null) break; else - url = results["links"]["next"].ToString(); - } - - return announcementList; - } - - //GetPlaceAvatar() - - /// - /// Return categories associated to the specified place. - /// - /// ID of the place to return the categories of - /// Fields to be returned (default is @all) + url = results["links"]["next"].ToString(); + } + + return announcementList; + } + + //GetPlaceAvatar() + + /// + /// Return categories associated to the specified place. + /// + /// ID of the place to return the categories of + /// Fields to be returned (default is @all) /// a Category object list of the categories for the given place - public List GetPlaceCategories(int placeID, List fields = null) - { - List categoryList = new List(); - - //creates the url for the HTTP request based on the user specifications - string url = placesUrl + "/" + placeID.ToString() + "/categories"; + public List GetPlaceCategories(int placeID, List fields = null) + { + List categoryList = new List(); + + //creates the url for the HTTP request based on the user specifications + string url = placesUrl + "/" + placeID.ToString() + "/categories"; if (fields != null && fields.Count > 0) { url += "?fields="; @@ -592,8 +592,8 @@ public List GetPlaceCategories(int placeID, List fields = null } // remove last comma url = url.Remove(url.Length - 1); - } - + } + // jive returns a paginated list, so we have to loop through all of the pages. string json; JObject results; @@ -623,20 +623,20 @@ public List GetPlaceCategories(int placeID, List fields = null url = results["links"]["next"].ToString(); } - return categoryList; - } - - /// - /// Return the specified category of a place. - /// - /// ID of the place that is associated to the category - /// ID of the category to return - /// Fields to be returned (default is @all) + return categoryList; + } + + /// + /// Return the specified category of a place. + /// + /// ID of the place that is associated to the category + /// ID of the category to return + /// Fields to be returned (default is @all) /// a Category object containing the specified category - public Category GetPlaceCategory(int placeID, int categoryID, List fields = null) - { - //creates the url for the HTTP request based on the user specifications - string url = placesUrl + "/" + placeID.ToString() + "/categories/" + categoryID.ToString(); + public Category GetPlaceCategory(int placeID, int categoryID, List fields = null) + { + //creates the url for the HTTP request based on the user specifications + string url = placesUrl + "/" + placeID.ToString() + "/categories/" + categoryID.ToString(); if (fields != null && fields.Count > 0) { url += "?fields="; @@ -646,28 +646,28 @@ public Category GetPlaceCategory(int placeID, int categoryID, List field } // remove last comma url = url.Remove(url.Length - 1); - } - - //makes the HTTP GET request and parses the result into a Category object before returning - string result; - try - { - result = GetAbsolute(url); - } - catch (HttpException e) - { - switch (e.GetHttpCode()) - { - case 400: - throw new HttpException(e.WebEventCode, "An input field is malformed", e); - case 404: - throw new HttpException(e.WebEventCode, "If the specified category does not exist", e); - default: - throw; - } - } - JObject Json = JObject.Parse(result); - return Json.ToObject(); + } + + //makes the HTTP GET request and parses the result into a Category object before returning + string result; + try + { + result = GetAbsolute(url); + } + catch (HttpException e) + { + switch (e.GetHttpCode()) + { + case 400: + throw new HttpException(e.WebEventCode, "An input field is malformed", e); + case 404: + throw new HttpException(e.WebEventCode, "If the specified category does not exist", e); + default: + throw; + } + } + JObject Json = JObject.Parse(result); + return Json.ToObject(); } //GetPlaceFollowers() @@ -953,51 +953,51 @@ public Space GetRootSpace() //GetTrendingPlaces() - public GenericPlace UpdatePlace(int placeID, GenericPlace place, DateTime? updated = null, List fields = null) - { - string url = placesUrl + "/" + placeID.ToString(); - if (updated != null) - { - url += "?updated=" + jiveDateFormat((DateTime)updated); - } - if (fields != null && fields.Count > 0) - { - if(updated != null) - url += "&fields="; - else - url += "?fields="; - - foreach (var field in fields) - { - url += field + ","; - } - // remove last comma - url = url.Remove(url.Length - 1); - } - - string json = JsonConvert.SerializeObject(place, new JsonSerializerSettings { DefaultValueHandling = DefaultValueHandling.Ignore, Formatting = Formatting.Indented }); - string result; - try - { - result = PutAbsolute(url, json); - } - catch (HttpException e) - { - switch (e.GetHttpCode()) - { - case 400: - throw new HttpException(e.WebEventCode, "An input field is malformed", e); - case 403: - throw new HttpException(e.WebEventCode, "You are not allowed to access the specified place, or to make the requested change in place state", e); - case 409: - throw new HttpException(e.WebEventCode, "The new entity would conflict with system restrictions (such as two places of the same type with the same name)", e); - default: - throw; - } - } - - JObject Json = JObject.Parse(result); - return Json.ToObject(); + public GenericPlace UpdatePlace(int placeID, GenericPlace place, DateTime? updated = null, List fields = null) + { + string url = placesUrl + "/" + placeID.ToString(); + if (updated != null) + { + url += "?updated=" + jiveDateFormat((DateTime)updated); + } + if (fields != null && fields.Count > 0) + { + if(updated != null) + url += "&fields="; + else + url += "?fields="; + + foreach (var field in fields) + { + url += field + ","; + } + // remove last comma + url = url.Remove(url.Length - 1); + } + + string json = JsonConvert.SerializeObject(place, new JsonSerializerSettings { DefaultValueHandling = DefaultValueHandling.Ignore, Formatting = Formatting.Indented }); + string result; + try + { + result = PutAbsolute(url, json); + } + catch (HttpException e) + { + switch (e.GetHttpCode()) + { + case 400: + throw new HttpException(e.WebEventCode, "An input field is malformed", e); + case 403: + throw new HttpException(e.WebEventCode, "You are not allowed to access the specified place, or to make the requested change in place state", e); + case 409: + throw new HttpException(e.WebEventCode, "The new entity would conflict with system restrictions (such as two places of the same type with the same name)", e); + default: + throw; + } + } + + JObject Json = JObject.Parse(result); + return Json.ToObject(); } } } diff --git a/Net.Pokeshot.JiveSdk/Clients/ProfileImagesClient.cs b/Net.Pokeshot.JiveSdk/Clients/ProfileImagesClient.cs index dfaca41..88c106b 100644 --- a/Net.Pokeshot.JiveSdk/Clients/ProfileImagesClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/ProfileImagesClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class ProfileImagesClient : JiveClient + class ProfileImagesClient : JiveClient { public ProfileImagesClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/PublicationsClient.cs b/Net.Pokeshot.JiveSdk/Clients/PublicationsClient.cs index 110852a..6722e8e 100644 --- a/Net.Pokeshot.JiveSdk/Clients/PublicationsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/PublicationsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class PublicationsClient : JiveClient + class PublicationsClient : JiveClient { public PublicationsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/QuestionsClient.cs b/Net.Pokeshot.JiveSdk/Clients/QuestionsClient.cs index 226fc18..0067f65 100644 --- a/Net.Pokeshot.JiveSdk/Clients/QuestionsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/QuestionsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class QuestionsClient : JiveClient + class QuestionsClient : JiveClient { public QuestionsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/RsvpClient.cs b/Net.Pokeshot.JiveSdk/Clients/RsvpClient.cs index 28a3f62..5ddaf1f 100644 --- a/Net.Pokeshot.JiveSdk/Clients/RsvpClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/RsvpClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class RsvpClient : JiveClient + class RsvpClient : JiveClient { public RsvpClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/SearchClient.cs b/Net.Pokeshot.JiveSdk/Clients/SearchClient.cs index aa73df6..7638cfb 100644 --- a/Net.Pokeshot.JiveSdk/Clients/SearchClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/SearchClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class SearchClient : JiveClient + class SearchClient : JiveClient { public SearchClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/SecurityGroupsClient.cs b/Net.Pokeshot.JiveSdk/Clients/SecurityGroupsClient.cs index 0571402..8f5efba 100644 --- a/Net.Pokeshot.JiveSdk/Clients/SecurityGroupsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/SecurityGroupsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class SecurityGroupsClient : JiveClient + class SecurityGroupsClient : JiveClient { public SecurityGroupsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/SharesClient.cs b/Net.Pokeshot.JiveSdk/Clients/SharesClient.cs index bed84a7..682efda 100644 --- a/Net.Pokeshot.JiveSdk/Clients/SharesClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/SharesClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class SharesClient : JiveClient + class SharesClient : JiveClient { public SharesClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/SlidesClient.cs b/Net.Pokeshot.JiveSdk/Clients/SlidesClient.cs index 6fed9b9..8daaa24 100644 --- a/Net.Pokeshot.JiveSdk/Clients/SlidesClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/SlidesClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class SlidesClient : JiveClient + class SlidesClient : JiveClient { public SlidesClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/Solutions_SupportCenter_Client.cs b/Net.Pokeshot.JiveSdk/Clients/Solutions_SupportCenter_Client.cs index 8c39b4c..27f522d 100644 --- a/Net.Pokeshot.JiveSdk/Clients/Solutions_SupportCenter_Client.cs +++ b/Net.Pokeshot.JiveSdk/Clients/Solutions_SupportCenter_Client.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class Solutions_SupportCenter_Client : JiveClient + class Solutions_SupportCenter_Client : JiveClient { public Solutions_SupportCenter_Client(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/StagesClient.cs b/Net.Pokeshot.JiveSdk/Clients/StagesClient.cs index 5fa862f..12f5c92 100644 --- a/Net.Pokeshot.JiveSdk/Clients/StagesClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/StagesClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class StagesClient : JiveClient + class StagesClient : JiveClient { public StagesClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/StaticsClient.cs b/Net.Pokeshot.JiveSdk/Clients/StaticsClient.cs index ac56302..db91a39 100644 --- a/Net.Pokeshot.JiveSdk/Clients/StaticsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/StaticsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class StaticsClient : JiveClient + class StaticsClient : JiveClient { public StaticsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/StreamEntriesClient.cs b/Net.Pokeshot.JiveSdk/Clients/StreamEntriesClient.cs index 71e6a4f..44dc762 100644 --- a/Net.Pokeshot.JiveSdk/Clients/StreamEntriesClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/StreamEntriesClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class StreamEntriesClient : JiveClient + class StreamEntriesClient : JiveClient { public StreamEntriesClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/TagsClient.cs b/Net.Pokeshot.JiveSdk/Clients/TagsClient.cs index 615dbe6..2d481a7 100644 --- a/Net.Pokeshot.JiveSdk/Clients/TagsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/TagsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class TagsClient : JiveClient + class TagsClient : JiveClient { public TagsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/TileDefsClient.cs b/Net.Pokeshot.JiveSdk/Clients/TileDefsClient.cs index 5063a61..d459d2e 100644 --- a/Net.Pokeshot.JiveSdk/Clients/TileDefsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/TileDefsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class TileDefsClient : JiveClient + class TileDefsClient : JiveClient { public TileDefsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/TilesClient.cs b/Net.Pokeshot.JiveSdk/Clients/TilesClient.cs index 5472bc9..6362618 100644 --- a/Net.Pokeshot.JiveSdk/Clients/TilesClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/TilesClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class TilesClient : JiveClient + class TilesClient : JiveClient { public TilesClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/Tiles_Categories_Client.cs b/Net.Pokeshot.JiveSdk/Clients/Tiles_Categories_Client.cs index 454d3f7..7510a12 100644 --- a/Net.Pokeshot.JiveSdk/Clients/Tiles_Categories_Client.cs +++ b/Net.Pokeshot.JiveSdk/Clients/Tiles_Categories_Client.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class Tiles_Categories_Client : JiveClient + class Tiles_Categories_Client : JiveClient { public Tiles_Categories_Client(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/UrlsClient.cs b/Net.Pokeshot.JiveSdk/Clients/UrlsClient.cs index a2e7f8e..2ed65c7 100644 --- a/Net.Pokeshot.JiveSdk/Clients/UrlsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/UrlsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class UrlsClient : JiveClient + class UrlsClient : JiveClient { public UrlsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/VersionsClient.cs b/Net.Pokeshot.JiveSdk/Clients/VersionsClient.cs index 1b993cf..07adc4d 100644 --- a/Net.Pokeshot.JiveSdk/Clients/VersionsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/VersionsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class VersionsClient : JiveClient + class VersionsClient : JiveClient { public VersionsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/VideosClient.cs b/Net.Pokeshot.JiveSdk/Clients/VideosClient.cs index 286f8ae..5516aad 100644 --- a/Net.Pokeshot.JiveSdk/Clients/VideosClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/VideosClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class VideosClient : JiveClient + class VideosClient : JiveClient { public VideosClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/VitalsClient.cs b/Net.Pokeshot.JiveSdk/Clients/VitalsClient.cs index 422d4d6..7bb27fd 100644 --- a/Net.Pokeshot.JiveSdk/Clients/VitalsClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/VitalsClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class VitalsClient : JiveClient + class VitalsClient : JiveClient { public VitalsClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Clients/WebhooksClient.cs b/Net.Pokeshot.JiveSdk/Clients/WebhooksClient.cs index 86ae5a9..5f413bd 100644 --- a/Net.Pokeshot.JiveSdk/Clients/WebhooksClient.cs +++ b/Net.Pokeshot.JiveSdk/Clients/WebhooksClient.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Clients { - public class WebhooksClient : JiveClient + class WebhooksClient : JiveClient { public WebhooksClient(string communityUrl, NetworkCredential credentials) : base(communityUrl, credentials) { } } diff --git a/Net.Pokeshot.JiveSdk/Models/GenericContent.cs b/Net.Pokeshot.JiveSdk/Models/GenericContent.cs index 4de633e..1b31af0 100644 --- a/Net.Pokeshot.JiveSdk/Models/GenericContent.cs +++ b/Net.Pokeshot.JiveSdk/Models/GenericContent.cs @@ -7,7 +7,7 @@ namespace Net.Pokeshot.JiveSdk.Models { /// - /// Contains the properties of all Content subpublic classes. Can be used when the type of content is unknown. + /// Contains the properties of all Content subclasses. Can be used when the type of content is unknown. /// public class GenericContent : Content { From 7307202f7968ef8827f1f22bbfd5bdd7cd28b139 Mon Sep 17 00:00:00 2001 From: Dave Anderson Date: Thu, 17 Nov 2016 12:24:44 -0500 Subject: [PATCH 7/8] Newtonsoft.Json 8.0.1 --- Net.Pokeshot.JiveSdk/App.config | 2 +- Net.Pokeshot.JiveSdk/Net.Pokeshot.JiveSdk.csproj | 4 ++-- Net.Pokeshot.JiveSdk/packages.config | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Net.Pokeshot.JiveSdk/App.config b/Net.Pokeshot.JiveSdk/App.config index 44ccc4b..ac2586a 100644 --- a/Net.Pokeshot.JiveSdk/App.config +++ b/Net.Pokeshot.JiveSdk/App.config @@ -4,7 +4,7 @@ - + diff --git a/Net.Pokeshot.JiveSdk/Net.Pokeshot.JiveSdk.csproj b/Net.Pokeshot.JiveSdk/Net.Pokeshot.JiveSdk.csproj index f40b003..d514aca 100644 --- a/Net.Pokeshot.JiveSdk/Net.Pokeshot.JiveSdk.csproj +++ b/Net.Pokeshot.JiveSdk/Net.Pokeshot.JiveSdk.csproj @@ -48,8 +48,8 @@ ..\packages\NewRelic.Agent.Api.5.20.61.0\lib\NewRelic.Api.Agent.dll True - - ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll + + ..\packages\Newtonsoft.Json.8.0.1\lib\net45\Newtonsoft.Json.dll True diff --git a/Net.Pokeshot.JiveSdk/packages.config b/Net.Pokeshot.JiveSdk/packages.config index 86ab5d5..ba8d673 100644 --- a/Net.Pokeshot.JiveSdk/packages.config +++ b/Net.Pokeshot.JiveSdk/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file From 88475cb5974c8932ee98f147032adcfe6478f613 Mon Sep 17 00:00:00 2001 From: Dave Anderson Date: Thu, 17 Nov 2016 13:00:22 -0500 Subject: [PATCH 8/8] Microsoft.AspNet.WebApi.Client --- Net.Pokeshot.JiveSdk/App.config | 4 ++++ Net.Pokeshot.JiveSdk/Net.Pokeshot.JiveSdk.csproj | 4 ++++ Net.Pokeshot.JiveSdk/packages.config | 1 + 3 files changed, 9 insertions(+) diff --git a/Net.Pokeshot.JiveSdk/App.config b/Net.Pokeshot.JiveSdk/App.config index ac2586a..9d49ea2 100644 --- a/Net.Pokeshot.JiveSdk/App.config +++ b/Net.Pokeshot.JiveSdk/App.config @@ -6,6 +6,10 @@ + + + + \ No newline at end of file diff --git a/Net.Pokeshot.JiveSdk/Net.Pokeshot.JiveSdk.csproj b/Net.Pokeshot.JiveSdk/Net.Pokeshot.JiveSdk.csproj index d514aca..6cb7ca6 100644 --- a/Net.Pokeshot.JiveSdk/Net.Pokeshot.JiveSdk.csproj +++ b/Net.Pokeshot.JiveSdk/Net.Pokeshot.JiveSdk.csproj @@ -56,6 +56,10 @@ + + ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll + True + diff --git a/Net.Pokeshot.JiveSdk/packages.config b/Net.Pokeshot.JiveSdk/packages.config index ba8d673..4a8c5dc 100644 --- a/Net.Pokeshot.JiveSdk/packages.config +++ b/Net.Pokeshot.JiveSdk/packages.config @@ -1,5 +1,6 @@  + \ No newline at end of file