-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8915de4
commit 101b526
Showing
323 changed files
with
34,333 additions
and
9,550 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 14 | ||
VisualStudioVersion = 14.0.25420.1 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LoginRadiusSDK.V2", "LoginRadiusSDK.V2\LoginRadiusSDK.V2.csproj", "{89A00BD2-25AD-41FD-B859-D780CB817CD2}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{89A00BD2-25AD-41FD-B859-D780CB817CD2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{89A00BD2-25AD-41FD-B859-D780CB817CD2}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{89A00BD2-25AD-41FD-B859-D780CB817CD2}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{89A00BD2-25AD-41FD-B859-D780CB817CD2}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
81 changes: 81 additions & 0 deletions
81
LoginRadiusSDK.V2/LoginRadiusSDK.V2/Api/AdvancedSocial/AdvancedSocialEntity.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
using System.Collections; | ||
using LoginRadiusSDK.V2.Entity; | ||
using LoginRadiusSDK.V2.Models; | ||
using LoginRadiusSDK.V2.Models.UserProfile; | ||
using LoginRadiusSDK.V2.Util; | ||
using static LoginRadiusSDK.V2.Util.LoginRadiusArgumentValidator; | ||
using LoginRadiusSDK.V2.Models.CustomerManagement.Identity; | ||
|
||
namespace LoginRadiusSDK.V2.Api.AdvancedSocial | ||
{ | ||
public class AdvancedSocialEntity : LoginRadiusResource | ||
{ | ||
public ApiResponse<LoginRadiusAccessToken> GetFacebookAccessToken(string facebookToken) | ||
{ | ||
Validate(new ArrayList {facebookToken}); | ||
var additionalQueryParams = new QueryParameters {["fb_access_token"] = facebookToken}; | ||
return ConfigureAndExecute<LoginRadiusAccessToken>(RequestType.AdvancedSocial, | ||
HttpMethod.Get, "access_token/facebook", additionalQueryParams); | ||
} | ||
|
||
public ApiResponse<LoginRadiusAccessToken> GetTwitterAccessToken(string twitterToken, string twitterTokenSecret) | ||
{ | ||
Validate(new ArrayList {twitterToken, twitterTokenSecret}); | ||
var additionalQueryParams = | ||
new QueryParameters {["tw_access_token"] = twitterToken, ["tw_token_secret"] = twitterTokenSecret}; | ||
return ConfigureAndExecute<LoginRadiusAccessToken>(RequestType.AdvancedSocial, | ||
HttpMethod.Get, "access_token/twitter", additionalQueryParams); | ||
} | ||
|
||
public ApiResponse<LoginRadiusSocialUserProfile> GetRefreshUserProfile(string accessToken) | ||
{ | ||
Validate(new ArrayList {accessToken}); | ||
var additionalQueryParams = new QueryParameters {["access_token"] = accessToken}; | ||
return ConfigureAndExecute<LoginRadiusSocialUserProfile>(RequestType.AdvancedSocial, HttpMethod.Get, | ||
"userprofile/refresh", additionalQueryParams); | ||
} | ||
|
||
public ApiResponse<AccessTokenResponse> GetRefreshToken(string accessToken) | ||
{ | ||
Validate(new ArrayList {accessToken}); | ||
var additionalQueryParams = new QueryParameters {["access_token"] = accessToken}; | ||
return ConfigureAndExecute<AccessTokenResponse>(RequestType.AdvancedSocial, HttpMethod.Get, | ||
"access_token/refresh", additionalQueryParams); | ||
} | ||
|
||
public ApiResponse<ShortUrlResponse> GetShortenUri(string uri) | ||
{ | ||
Validate(new ArrayList {uri}); | ||
var additionalQueryParams = new QueryParameters {["url"] = uri}; | ||
return ConfigureAndExecute<ShortUrlResponse>(RequestType.AdvancedSharing, HttpMethod.Get, null, | ||
additionalQueryParams); | ||
} | ||
|
||
public ApiResponse<LoginRadiusStatusStats> GetTrackableStatus(string postId) | ||
{ | ||
Validate(new ArrayList {postId}); | ||
var additionalQueryParams = new QueryParameters {["postid"] = postId}; | ||
return ConfigureAndExecute<LoginRadiusStatusStats>(RequestType.AdvancedSocial, HttpMethod.Get, | ||
"status/trackable", additionalQueryParams); | ||
} | ||
|
||
//public ApiResponse<TrackableStatusPostResponse> GetUpdateTrackableStatus(string accessToken, | ||
// TrackableStatusUpdateModel trackableStatusUpdate) | ||
//{ | ||
// Validate(new ArrayList {accessToken, trackableStatusUpdate}); | ||
// var additionalQueryParams = new QueryParameters {["access_token"] = accessToken}; | ||
// //.AddRange(additionalQueryParams, trackableStatusUpdate.ConvertToJson()); | ||
// return ConfigureAndExecute<TrackableStatusPostResponse>(RequestType.AdvancedSocial, HttpMethod.Post, | ||
// "status/trackable", additionalQueryParams, trackableStatusUpdate.ConvertToJson()); | ||
//} | ||
|
||
public ApiResponse<TrackableStatusPostResponse> PostUpdateTrackableStatus(string accessToken, | ||
TrackableStatusUpdateModel trackableStatusUpdate) | ||
{ | ||
Validate(new ArrayList {accessToken, trackableStatusUpdate}); | ||
var additionalQueryParams = new QueryParameters {["access_token"] = accessToken}; | ||
return ConfigureAndExecute<TrackableStatusPostResponse>(RequestType.AdvancedSocial, HttpMethod.Post, | ||
"status/trackable", additionalQueryParams, trackableStatusUpdate.ConvertToJson()); | ||
} | ||
} | ||
} |
78 changes: 78 additions & 0 deletions
78
LoginRadiusSDK.V2/LoginRadiusSDK.V2/Api/AppSettings/LoginRadiusAppSettings.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using System.IO; | ||
using System.Configuration; | ||
|
||
|
||
// For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860 | ||
|
||
namespace LoginradiusSdk.Entity.AppSettings | ||
{ | ||
public static class LoginRadiusAppSettings | ||
{ | ||
private static string _AppKey; | ||
private static string _AppSecret; | ||
private static string _AppName; | ||
|
||
public static void AppSettingInitialization(string AppKey, string AppSecret, string AppName) | ||
{ | ||
_AppKey = AppKey; | ||
_AppSecret = AppSecret; | ||
_AppName = AppName; | ||
} | ||
|
||
public static string AppKey | ||
{ | ||
get | ||
{ | ||
if (string.IsNullOrEmpty(_AppKey)) | ||
{ | ||
_AppKey = ConfigurationManager.AppSettings["loginradius:apikey"]; | ||
if (string.IsNullOrEmpty(_AppKey)) | ||
{ | ||
throw new Exception("apikey not found in application.json"); | ||
} | ||
} | ||
return _AppKey; | ||
} | ||
set { _AppKey = value; } | ||
} | ||
|
||
public static string AppSecret | ||
{ | ||
get | ||
{ | ||
if (string.IsNullOrEmpty(_AppSecret)) | ||
{ | ||
_AppSecret = ConfigurationManager.AppSettings["loginradius:apisecret"]; | ||
if (string.IsNullOrEmpty(_AppSecret)) | ||
{ | ||
throw new Exception("apisecret not found in application.json"); | ||
} | ||
} | ||
return _AppSecret; | ||
} | ||
set { _AppSecret = value; } | ||
} | ||
|
||
public static string AppName | ||
{ | ||
get | ||
{ | ||
if (string.IsNullOrEmpty(_AppName)) | ||
{ | ||
_AppName = ConfigurationManager.AppSettings["loginradius:appname"]; | ||
if (string.IsNullOrEmpty(_AppName)) | ||
{ | ||
throw new Exception("appname not found in application.json"); | ||
} | ||
} | ||
return _AppName; | ||
} | ||
|
||
set { _AppName = value; } | ||
} | ||
} | ||
} |
81 changes: 81 additions & 0 deletions
81
LoginRadiusSDK.V2/LoginRadiusSDK.V2/Api/CloudStorage/CloudStorageEntity.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using LoginRadiusSDK.V2.Models; | ||
using LoginRadiusSDK.V2.Util; | ||
|
||
namespace LoginRadiusSDK.V2.Api | ||
{ | ||
public class CloudStorageEntity : LoginRadiusResource | ||
{ | ||
|
||
/// <summary> | ||
/// This API allows you to query your LoginRadius Cloud Storage and retrieve up to 20 user records. | ||
/// </summary> | ||
/// <param name="select"> Fields included in the Query, default all fields, Optional: can be null or empty string</param> | ||
/// <param name="from">LoginRadius Table that details are being retrieved from, for now users only supported </param> | ||
/// <param name="where">Filter for data based on condition,Optional: can be null or empty string </param> | ||
/// <param name="orderBy">Determines ascending order of returned data,Optional: can be null or empty string</param> | ||
/// <param name="skip">Ignores the specified amount of values used to page through responses, value must be positive and default value is 0, Optional: can be null or empty string</param> | ||
/// <param name="limit">Determines size of dataset returned. default value is 20 and max value is 20, Optional: can be null or empty string</param> | ||
/// <returns></returns> | ||
public ApiResponse<LoginRadiusIdentityUserList> GetUserList(string select = "", string from = "", string where = "", | ||
string orderBy = "", string skip = "", | ||
string limit = "") | ||
{ | ||
var postRequest = new BodyParameters | ||
{ | ||
{"From", string.IsNullOrWhiteSpace(from) ? "users" : from} | ||
}; | ||
if (!string.IsNullOrWhiteSpace(select)) | ||
{ | ||
postRequest.Add("Select", select); | ||
} | ||
if (!string.IsNullOrWhiteSpace(where)) | ||
{ | ||
postRequest.Add("Where", where); | ||
} | ||
if (!string.IsNullOrWhiteSpace(orderBy)) | ||
{ | ||
postRequest.Add("OrderBy", orderBy); | ||
} | ||
if (!string.IsNullOrWhiteSpace(skip)) | ||
{ | ||
postRequest.Add("Skip", skip); | ||
} | ||
if (!string.IsNullOrWhiteSpace(limit)) | ||
{ | ||
postRequest.Add("Limit", limit); | ||
} | ||
return ConfigureAndExecute<LoginRadiusIdentityUserList>(RequestType.Cloud, HttpMethod.Post, | ||
"identity", | ||
postRequest.ConvertToJson()); | ||
} | ||
|
||
/// <summary> | ||
/// This API is used to query the aggregation data from your LoginRadius cloud storage. | ||
/// </summary> | ||
/// <param name="from">From Date in format of (mm/dd/yyyy).</param> | ||
/// <param name="to">To Date in format of (mm/dd/yyyy).</param> | ||
/// <param name="firstDatapoint">Aggregation Field, supported are: os, browser, device, country, city, provider, emailType, friendsCount </param> | ||
/// <param name="statsType">Type of users should apply to i.e. NewUser, ActiveUser, Login</param> | ||
/// <returns></returns> | ||
public ApiResponse<LoginRadiusQueryDataModel> GetQueryAggregationData(string from, string to, string firstDatapoint, | ||
string statsType) | ||
{ | ||
LoginRadiusArgumentValidator.Validate(new ArrayList {from, to, firstDatapoint, statsType}); | ||
var additionalQueryParams = new QueryParameters | ||
{ | ||
{"from", from}, | ||
{"to", to} | ||
}; | ||
var postRequest = new BodyParameters | ||
{ | ||
{"firstDatapoint", firstDatapoint}, | ||
{"statsType", statsType} | ||
}; | ||
return ConfigureAndExecute<LoginRadiusQueryDataModel>(RequestType.Cloud, HttpMethod.Post, | ||
"insights", additionalQueryParams, | ||
postRequest.ConvertToJson()); | ||
} | ||
} | ||
} |
Oops, something went wrong.