diff --git a/CHANGELOG.md b/CHANGELOG.md index 9481584..b78db35 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,16 +1,42 @@ > **LoginRadius .NET SDK Change Log** provides information regarding what has changed, more specifically what changes, improvements and bug fix has been made to the SDK. For more details please refer to the [LoginRadius API Documention](https://docs.loginradius.com/api/v2/sdk-libraries/aspnet) -### Version 5.2.2 -Release on **April 12, 2019** +### Version 10.0.0-beta +Release on **August 5, 2019** -##### Bug Fixes - - Fixed Dictionary concurrency error in ConfigManager. +##### Enhancements -### Version 5.2.1 -Release on **March 19, 2019** +This beta version release includes major changes with several improvements and optimizations : -##### Enhancements - - Added gzip Accept-Encoding HTTPS header in requests sent to LoginRadius server +- Enhanced the coding standards of SDK to follow industry programming styles and best practices. +- Enhanced security standards of SDK. +- Reduced code between the business layer and persistence layer for optimization of SDK performance. +- Added internal parameter validations in the API function. +- ApiKey and ApiSecret usage redundancy removed. +- All LoginRadius related features need to be defined once only and SDK will handle them automatically. +- Improved the naming conventions of API functions for better readability. +- Better Error and Exception Handling for LoginRadius API Response in SDK. +- Revamped complete SDK and restructured it with latest API function names and parameters. +- Added detailed description to API functions and parameters for better understanding. +- Updated the demo according to latest SDK changes. +- Implemented API Region Feature. + + +##### Added new multiple APIs for better user experience + +- Update Phone ID by UID +- Upsert Email +- Role Context profile +- MFA Resend OTP +- User Registration By Captcha +- Get Access Token via Linkedin Token +- Get Access Token By Foursquare Access Token +- Get Active Session By Account Id +- Get Active Session By Profile Id + + +##### Removed APIs: + +- GetCompanies API ### Version 5.2.0 Release on **January 15, 2019** diff --git a/README.md b/README.md index 4d14228..e313a66 100755 --- a/README.md +++ b/README.md @@ -20,6 +20,3224 @@ Please visit [here](http://www.loginradius.com/) for more information. * .NET 4.0 or later / .NetStandard 1.3 or later -## Getting Started +## Installation +This documentation presumes you have worked through the client-side implementation to setup your LoginRadius User Registration interfaces that will serve the initial registration and login process. Details on this can be found in the [getting started guide](/api/v2/getting-started/introduction). + +**Note: **LoginRadius uses the industry standard TLS 1.2 protocol, designed to help protect the privacy of information communicated over the Internet. In order to use the LoginRadius .Net SDK, add the following code before instantiating your web service in your project's `Global.asax` file. + +``` +ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12; +``` + +## Importing Required Libraries +- Download the User Registration .Net SDK from [Github](https://github.com/LoginRadius/dot-net-sdk) + +- Copy LoginRadiusSDK.V2.dll and LoginRadiusSDK.V2.pdb files into the References directory of your ASP.NET project. + +OR + +- Run the following command in the NuGet Package Manager Console: + +``` +PM> Install-Package LoginRadiusSDK.NET +``` + +OR + +- Open the solution using Visual Studio 2019. + +- Build the project and note where the .nupkg file is located. + +- Access the NuGet Package Manager Settings and import the directory where the .nupkg file is located. + +- Access the "Manage NuGet Packages for Solutions..." tool change the source to the newly created source and select and install the LoginRadius SDK + +Next, include the following namespaces in your project: + + +``` +using LoginRadiusSDK.V2.Api; +using LoginRadiusSDK.V2.Models; +``` +##Quickstart Guide + +Set your [app credentials](/api/v2/getting-started/get-api-key-and-secret): + +``` +LoginRadiusSdkGlobalConfig.ApiKey = "__API_KEY__"; +LoginRadiusSdkGlobalConfig.ApiSecret = "__API_SECRET__"; +LoginRadiusSdkGlobalConfig.AppName = "__LoginRadius_APP_NAME__"; +LoginRadiusSdkGlobalConfig.ApiRequestSigning ="false"; +LoginRadiusSdkGlobalConfig.ConnectionTimeout = 30000; // Connection Timeout (milliseconds) +LoginRadiusSdkGlobalConfig.ProxyAddress = "__HTTP_PROXY_ADDRESS__"; // Absolute Proxy URI +LoginRadiusSdkGlobalConfig.ProxyCredentials = "__HTTP_PROXY_CREDENTIALS__"; // Proxy Credentials in the format 'USERNAME:PASSWORD' +LoginRadiusSdkGlobalConfig.RequestRetries = 3; +LoginRadiusSdkGlobalConfig.ApiRegion = "_region_"; +LoginRadiusSdkGlobalConfig.DomainName = "https://api.loginradius.com/"; +``` + +OR + +For ASP.NET. in `web.config`: +``` + +
+ + + + + + + + + + + + + + + + + +``` +OR + +For .NET Core, in `appsettings.json`: + +**JSON** +``` +"loginradius": { + "apiKey": "__API_KEY__", + "apiSecret": "__API_SECRET__", + "appName" : "__LoginRadius_APP_NAME__", + "ApiRequestSigning" : "false", + "proxyAddress" : "__HTTP_PROXY_ADDRESS__", + "proxyCredentials" : "__HTTP_PROXY_CREDENTIAL__", + "connectionTimeout" : "__HTTP_CONNECTION_TIMEOUT__", + "requestRetries" : "__HTTP_CONNECTION_RETRY__", + "apiRegion": "_region_", + "domainName" : "https://api.loginradius.com/" + } + + ``` + + ### Custom Domain +When initializing the SDK, optionally specify a custom domain. +Example : In appsettings.json, add following statement - + +``` +"domainName" : "https://api.loginradius.com/" +``` + + + +### API Request Signing +When initializing the SDK, you can optionally specify enabling this feature. Enabling this feature means the customer does not need to pass an API secret in an API request. Instead, they can pass a dynamically generated hash value. This feature will also make sure that the message is not tampered during transit when someone calls our APIs. +Example : In appsettings.json, add following statement - + +``` +"ApiRequestSigning" : "false" +``` + + + +## APIs + + + +### Authentication API + + +List of APIs in this Section:
+[PUT : Auth Update Profile by Token](#UpdateProfileByAccessToken-put-)
+[PUT : Auth Unlock Account by Access Token](#UnlockAccountByToken-put-)
+[PUT : Auth Verify Email By OTP](#VerifyEmailByOTP-put-)
+[PUT : Auth Reset Password by Security Answer and Email](#ResetPasswordBySecurityAnswerAndEmail-put-)
+[PUT : Auth Reset Password by Security Answer and Phone](#ResetPasswordBySecurityAnswerAndPhone-put-)
+[PUT : Auth Reset Password by Security Answer and UserName](#ResetPasswordBySecurityAnswerAndUserName-put-)
+[PUT : Auth Reset Password by Reset Token](#ResetPasswordByResetToken-put-)
+[PUT : Auth Reset Password by OTP](#ResetPasswordByEmailOTP-put-)
+[PUT : Auth Reset Password by OTP and UserName](#ResetPasswordByOTPAndUserName-put-)
+[PUT : Auth Change Password](#ChangePassword-put-)
+[PUT : Auth Link Social Identities](#LinkSocialIdentities-put-)
+[PUT : Auth Set or Change UserName](#SetOrChangeUserName-put-)
+[PUT : Auth Resend Email Verification](#AuthResendEmailVerification-put-)
+[POST : Auth Add Email](#AddEmail-post-)
+[POST : Auth Login by Email](#LoginByEmail-post-)
+[POST : Auth Login by Username](#LoginByUserName-post-)
+[POST : Auth Forgot Password](#ForgotPassword-post-)
+[POST : Auth User Registration by Email](#UserRegistrationByEmail-post-)
+[POST : Phone User Registration by SMS](#UserRegistrationByPhone-post-)
+[POST : Auth User Registration By Captcha](#UserRegistrationByCaptcha-post-)
+[GET : Get Security Questions By Email](#GetSecurityQuestionsByEmail-get-)
+[GET : Get Security Questions By UserName](#GetSecurityQuestionsByUserName-get-)
+[GET : Get Security Questions By Phone](#GetSecurityQuestionsByPhone-get-)
+[GET : Get Security Questions By Access Token](#GetSecurityQuestionsByAccessToken-get-)
+[GET : Auth Validate Access token](#AuthValidateAccessToken-get-)
+[GET : Access Token Invalidate](#AuthInValidateAccessToken-get-)
+[GET : Access Token Info](#GetAccessTokenInfo-get-)
+[GET : Auth Read all Profiles by Token](#GetProfileByAccessToken-get-)
+[GET : Auth Send Welcome Email](#SendWelcomeEmail-get-)
+[GET : Auth Delete Account](#DeleteAccountByDeleteToken-get-)
+[GET : Auth Check Email Availability](#CheckEmailAvailability-get-)
+[GET : Auth Verify Email](#VerifyEmail-get-)
+[GET : Auth Social Identity](#GetSocialIdentity-get-)
+[GET : Auth Check UserName Availability](#CheckUserNameAvailability-get-)
+[GET : Auth Privacy Policy Accept](#AcceptPrivacyPolicy-get-)
+[GET : Auth Privacy Policy History By Access Token](#GetPrivacyPolicyHistoryByAccessToken-get-)
+[DELETE : Auth Delete Account with Email Confirmation](#DeleteAccountWithEmailConfirmation-delete-)
+[DELETE : Auth Remove Email](#RemoveEmail-delete-)
+[DELETE : Auth Unlink Social Identities](#UnlinkSocialIdentities-delete-)
+ + + +
Auth Update Profile by Token (PUT)
+This API is used to update the user's profile by passing the access_token. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-update-profile-by-token/) + + + +``` + +var accessToken = "accessToken"; //Required +UserProfileUpdateModel userProfileUpdateModel = new UserProfileUpdateModel{ +FirstName ="", +LastName ="" +}; //Required +var emailTemplate = "emailTemplate"; //Optional +string fields = null; //Optional +; //Optional +var smsTemplate = "smsTemplate"; //Optional +var verificationUrl = "verificationUrl"; //Optional +var apiResponse = new AuthenticationApi().UpdateProfileByAccessToken(accessToken, userProfileUpdateModel, emailTemplate, fields, smsTemplate, verificationUrl); +``` + + +
Auth Unlock Account by Access Token (PUT)
+This API is used to allow a customer with a valid access_token to unlock their account provided that they successfully pass the prompted Bot Protection challenges. The Block or Suspend block types are not applicable for this API. For additional details see our Auth Security Configuration documentation.You are only required to pass the Post Parameters that correspond to the prompted challenges. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-unlock-account-by-access-token/) + + + +``` + +var accessToken = "accessToken"; //Required +UnlockProfileModel unlockProfileModel = new UnlockProfileModel{ +G_recaptcha_response ="" +}; //Required +var apiResponse = new AuthenticationApi().UnlockAccountByToken(accessToken, unlockProfileModel); +``` + + +
Auth Verify Email By OTP (PUT)
+This API is used to verify the email of user when the OTP Email verification flow is enabled, please note that you must contact LoginRadius to have this feature enabled. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-verify-email-by-otp/) + + + +``` + +EmailVerificationByOtpModel emailVerificationByOtpModel = new EmailVerificationByOtpModel{ +Email ="", +Otp ="" +}; //Required +string fields = null; //Optional +var url = "url"; //Optional +var welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional +var apiResponse = new AuthenticationApi().VerifyEmailByOTP(emailVerificationByOtpModel, fields, url, welcomeEmailTemplate); +``` + + +
Auth Reset Password by Security Answer and Email (PUT)
+This API is used to reset password for the specified account by security question [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-reset-password-by-email) + + + +``` + +ResetPasswordBySecurityAnswerAndEmailModel resetPasswordBySecurityAnswerAndEmailModel = new ResetPasswordBySecurityAnswerAndEmailModel{ +Email ="", +Password ="", +SecurityAnswer = new Dictionary{ +["QuestionID"] = "Answer" +} +}; //Required +var apiResponse = new AuthenticationApi().ResetPasswordBySecurityAnswerAndEmail(resetPasswordBySecurityAnswerAndEmailModel); +``` + + +
Auth Reset Password by Security Answer and Phone (PUT)
+This API is used to reset password for the specified account by security question [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-reset-password-by-phone) + + + +``` + +ResetPasswordBySecurityAnswerAndPhoneModel resetPasswordBySecurityAnswerAndPhoneModel = new ResetPasswordBySecurityAnswerAndPhoneModel{ +Password ="", +Phone ="", +SecurityAnswer = new Dictionary{ +["QuestionID"] = "Answer" +} +}; //Required +var apiResponse = new AuthenticationApi().ResetPasswordBySecurityAnswerAndPhone(resetPasswordBySecurityAnswerAndPhoneModel); +``` + + +
Auth Reset Password by Security Answer and UserName (PUT)
+This API is used to reset password for the specified account by security question [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-reset-password-by-username) + + + +``` + +ResetPasswordBySecurityAnswerAndUserNameModel resetPasswordBySecurityAnswerAndUserNameModel = new ResetPasswordBySecurityAnswerAndUserNameModel{ +Password ="", +SecurityAnswer = new Dictionary{ +["QuestionID"] = "Answer" +}, +UserName ="" +}; //Required +var apiResponse = new AuthenticationApi().ResetPasswordBySecurityAnswerAndUserName(resetPasswordBySecurityAnswerAndUserNameModel); +``` + + +
Auth Reset Password by Reset Token (PUT)
+This API is used to set a new password for the specified account. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-reset-password-by-reset-token) + + + +``` + +ResetPasswordByResetTokenModel resetPasswordByResetTokenModel = new ResetPasswordByResetTokenModel{ +Password ="", +ResetToken ="" +}; //Required +var apiResponse = new AuthenticationApi().ResetPasswordByResetToken(resetPasswordByResetTokenModel); +``` + + +
Auth Reset Password by OTP (PUT)
+This API is used to set a new password for the specified account. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-reset-password-by-otp) + + + +``` + +ResetPasswordByEmailAndOtpModel resetPasswordByEmailAndOtpModel = new ResetPasswordByEmailAndOtpModel{ +Email ="", +Otp ="", +Password ="" +}; //Required +var apiResponse = new AuthenticationApi().ResetPasswordByEmailOTP(resetPasswordByEmailAndOtpModel); +``` + + +
Auth Reset Password by OTP and UserName (PUT)
+This API is used to set a new password for the specified account if you are using the username as the unique identifier in your workflow [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-reset-password-by-otp-and-username/) + + + +``` + +ResetPasswordByUserNameModel resetPasswordByUserNameModel = new ResetPasswordByUserNameModel{ +Otp ="", +Password ="", +UserName ="" +}; //Required +var apiResponse = new AuthenticationApi().ResetPasswordByOTPAndUserName(resetPasswordByUserNameModel); +``` + + +
Auth Change Password (PUT)
+This API is used to change the accounts password based on the previous password [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-change-password) + + + +``` + +var accessToken = "accessToken"; //Required +var newPassword = "newPassword"; //Required +var oldPassword = "oldPassword"; //Required +var apiResponse = new AuthenticationApi().ChangePassword(accessToken, newPassword, oldPassword); +``` + + +
Auth Link Social Identities (PUT)
+This API is used to link up a social provider account with the specified account based on the access token and the social providers user access token. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-link-social-identities) + + + +``` + +var accessToken = "accessToken"; //Required +var candidateToken = "candidateToken"; //Required +var apiResponse = new AuthenticationApi().LinkSocialIdentities(accessToken, candidateToken); +``` + + +
Auth Set or Change UserName (PUT)
+This API is used to set or change UserName by access token. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-set-or-change-user-name/) + + + +``` + +var accessToken = "accessToken"; //Required +var username = "username"; //Required +var apiResponse = new AuthenticationApi().SetOrChangeUserName(accessToken, username); +``` + + +
Auth Resend Email Verification (PUT)
+This API resends the verification email to the user. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-resend-email-verification/) + + + +``` + +var email = "email"; //Required +var emailTemplate = "emailTemplate"; //Optional +var verificationUrl = "verificationUrl"; //Optional +var apiResponse = new AuthenticationApi().AuthResendEmailVerification(email, emailTemplate, verificationUrl); +``` + + +
Auth Add Email (POST)
+This API is used to add additional emails to a user's account. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-add-email) + + + +``` + +var accessToken = "accessToken"; //Required +var email = "email"; //Required +var type = "type"; //Required +var emailTemplate = "emailTemplate"; //Optional +var verificationUrl = "verificationUrl"; //Optional +var apiResponse = new AuthenticationApi().AddEmail(accessToken, email, type, emailTemplate, verificationUrl); +``` + + +
Auth Login by Email (POST)
+This API retrieves a copy of the user data based on the Email [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-login-by-email) + + + +``` + +EmailAuthenticationModel emailAuthenticationModel = new EmailAuthenticationModel{ +Email ="", +Password ="" +}; //Required +var emailTemplate = "emailTemplate"; //Optional +string fields = null; //Optional +var loginUrl = "loginUrl"; //Optional +var verificationUrl = "verificationUrl"; //Optional +var apiResponse = new AuthenticationApi().LoginByEmail(emailAuthenticationModel, emailTemplate, fields, loginUrl, verificationUrl); +``` + + +
Auth Login by Username (POST)
+This API retrieves a copy of the user data based on the Username [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-login-by-username) + + + +``` + +UserNameAuthenticationModel userNameAuthenticationModel = new UserNameAuthenticationModel{ +Password ="", +Username ="" +}; //Required +var emailTemplate = "emailTemplate"; //Optional +string fields = null; //Optional +var loginUrl = "loginUrl"; //Optional +var verificationUrl = "verificationUrl"; //Optional +var apiResponse = new AuthenticationApi().LoginByUserName(userNameAuthenticationModel, emailTemplate, fields, loginUrl, verificationUrl); +``` + + +
Auth Forgot Password (POST)
+This API is used to send the reset password url to a specified account. Note: If you have the UserName workflow enabled, you may replace the 'email' parameter with 'username' [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-forgot-password) + + + +``` + +var email = "email"; //Required +var resetPasswordUrl = "resetPasswordUrl"; //Required +var emailTemplate = "emailTemplate"; //Optional +var apiResponse = new AuthenticationApi().ForgotPassword(email, resetPasswordUrl, emailTemplate); +``` + + +
Auth User Registration by Email (POST)
+This API creates a user in the database as well as sends a verification email to the user. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-user-registration-by-email) + + + +``` + +AuthUserRegistrationModel authUserRegistrationModel = new AuthUserRegistrationModel{ +Email = new List{ +new EmailModel{ +Type ="", +Value ="" +}}, +FirstName ="", +LastName ="", +Password ="" +}; //Required +var sott = "sott"; //Required +var emailTemplate = "emailTemplate"; //Optional +string fields = null; //Optional +var options = "options"; //Optional +var verificationUrl = "verificationUrl"; //Optional +var welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional +var apiResponse = new AuthenticationApi().UserRegistrationByEmail(authUserRegistrationModel, sott, emailTemplate, fields, options, verificationUrl, welcomeEmailTemplate); +``` + + +
Phone User Registration by SMS (POST)
+This API registers the new users into your Cloud Storage and triggers the phone verification process. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-user-registration-by-sms) + + + +``` + +AuthUserRegistrationModel authUserRegistrationModel = new AuthUserRegistrationModel{ +FirstName ="", +LastName ="", +Password ="", +PhoneId ="" +}; //Required +var sott = "sott"; //Required +string fields = null; //Optional +var options = "options"; //Optional +var smsTemplate = "smsTemplate"; //Optional +var verificationUrl = "verificationUrl"; //Optional +var welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional +var apiResponse = new AuthenticationApi().UserRegistrationByPhone(authUserRegistrationModel, sott, fields, options, smsTemplate, verificationUrl, welcomeEmailTemplate); +``` + + +
Auth User Registration By Captcha (POST)
+This API creates a user in the database as well as sends a verification email to the user. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-user-registration-by-recaptcha) + + + +``` + +AuthUserRegistrationModelWithCaptcha authUserRegistrationModelWithCaptcha = new AuthUserRegistrationModelWithCaptcha{ +Email = new List{ +new EmailModel{ +Type ="", +Value ="" +}}, +FirstName ="", +G_recaptcha_response ="", +LastName ="", +Password ="" +}; //Required +var emailTemplate = "emailTemplate"; //Optional +string fields = null; //Optional +var options = "options"; //Optional +var smsTemplate = "smsTemplate"; //Optional +var verificationUrl = "verificationUrl"; //Optional +var welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional +var apiResponse = new AuthenticationApi().UserRegistrationByCaptcha(authUserRegistrationModelWithCaptcha, emailTemplate, fields, options, smsTemplate, verificationUrl, welcomeEmailTemplate); +``` + + +
Get Security Questions By Email (GET)
+This API is used to retrieve the list of questions that are configured on the respective LoginRadius site. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/security-questions-by-email/) + + + +``` + +var email = "email"; //Required +var apiResponse = new AuthenticationApi().GetSecurityQuestionsByEmail(email); +``` + + +
Get Security Questions By UserName (GET)
+This API is used to retrieve the list of questions that are configured on the respective LoginRadius site. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/security-questions-by-user-name/) + + + +``` + +var userName = "userName"; //Required +var apiResponse = new AuthenticationApi().GetSecurityQuestionsByUserName(userName); +``` + + +
Get Security Questions By Phone (GET)
+This API is used to retrieve the list of questions that are configured on the respective LoginRadius site. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/security-questions-by-phone/) + + + +``` + +var phone = "phone"; //Required +var apiResponse = new AuthenticationApi().GetSecurityQuestionsByPhone(phone); +``` + + +
Get Security Questions By Access Token (GET)
+This API is used to retrieve the list of questions that are configured on the respective LoginRadius site. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/security-questions-by-access-token/) + + + +``` + +var accessToken = "accessToken"; //Required +var apiResponse = new AuthenticationApi().GetSecurityQuestionsByAccessToken(accessToken); +``` + + +
Auth Validate Access token (GET)
+This api validates access token, if valid then returns a response with its expiry otherwise error. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-validate-access-token/) + + + +``` + +var accessToken = "accessToken"; //Required +var apiResponse = new AuthenticationApi().AuthValidateAccessToken(accessToken); +``` + + +
Access Token Invalidate (GET)
+This api call invalidates the active access token or expires an access token's validity. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-invalidate-access-token/) + + + +``` + +var accessToken = "accessToken"; //Required +var preventRefresh = true; //Optional +var apiResponse = new AuthenticationApi().AuthInValidateAccessToken(accessToken, preventRefresh); +``` + + +
Access Token Info (GET)
+This api call provide the active access token Information [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-access-token-info/) + + + +``` + +var accessToken = "accessToken"; //Required +var apiResponse = new AuthenticationApi().GetAccessTokenInfo(accessToken); +``` + + +
Auth Read all Profiles by Token (GET)
+This API retrieves a copy of the user data based on the access_token. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-read-profiles-by-token/) + + + +``` + +var accessToken = "accessToken"; //Required +string fields = null; //Optional +var apiResponse = new AuthenticationApi().GetProfileByAccessToken(accessToken, fields); +``` + + +
Auth Send Welcome Email (GET)
+This API sends a welcome email [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-send-welcome-email/) + + + +``` + +var accessToken = "accessToken"; //Required +var welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional +var apiResponse = new AuthenticationApi().SendWelcomeEmail(accessToken, welcomeEmailTemplate); +``` + + +
Auth Delete Account (GET)
+This API is used to delete an account by passing it a delete token. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-delete-account/) + + + +``` + +var deleteToken = "deleteToken"; //Required +var apiResponse = new AuthenticationApi().DeleteAccountByDeleteToken(deleteToken); +``` + + +
Auth Check Email Availability (GET)
+This API is used to check the email exists or not on your site. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-email-availability/) + + + +``` + +var email = "email"; //Required +var apiResponse = new AuthenticationApi().CheckEmailAvailability(email); +``` + + +
Auth Verify Email (GET)
+This API is used to verify the email of user. Note: This API will only return the full profile if you have 'Enable auto login after email verification' set in your LoginRadius Admin Console's Email Workflow settings under 'Verification Email'. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-verify-email/) + + + +``` + +var verificationToken = "verificationToken"; //Required +string fields = null; //Optional +var url = "url"; //Optional +var welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional +var apiResponse = new AuthenticationApi().VerifyEmail(verificationToken, fields, url, welcomeEmailTemplate); +``` + + +
Auth Social Identity (GET)
+This API is called just after account linking API and it prevents the raas profile of the second account from getting created. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-social-identity) + + + +``` + +var accessToken = "accessToken"; //Required +string fields = null; //Optional +var apiResponse = new AuthenticationApi().GetSocialIdentity(accessToken, fields); +``` + + +
Auth Check UserName Availability (GET)
+This API is used to check the UserName exists or not on your site. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-username-availability/) + + + +``` + +var username = "username"; //Required +var apiResponse = new AuthenticationApi().CheckUserNameAvailability(username); +``` + + +
Auth Privacy Policy Accept (GET)
+This API is used to update the privacy policy stored in the user's profile by providing the access_token of the user accepting the privacy policy [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-privacy-policy-accept) + + + +``` + +var accessToken = "accessToken"; //Required +string fields = null; //Optional +var apiResponse = new AuthenticationApi().AcceptPrivacyPolicy(accessToken, fields); +``` + + +
Auth Privacy Policy History By Access Token (GET)
+This API will return all the accepted privacy policies for the user by providing the access_token of that user. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/privacy-policy-history-by-access-token/) + + + +``` + +var accessToken = "accessToken"; //Required +var apiResponse = new AuthenticationApi().GetPrivacyPolicyHistoryByAccessToken(accessToken); +``` + + +
Auth Delete Account with Email Confirmation (DELETE)
+This API will send a confirmation email for account deletion to the customer's email when passed the customer's access token [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-delete-account-with-email-confirmation/) + + + +``` + +var accessToken = "accessToken"; //Required +var deleteUrl = "deleteUrl"; //Optional +var emailTemplate = "emailTemplate"; //Optional +var apiResponse = new AuthenticationApi().DeleteAccountWithEmailConfirmation(accessToken, deleteUrl, emailTemplate); +``` + + +
Auth Remove Email (DELETE)
+This API is used to remove additional emails from a user's account. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-remove-email) + + + +``` + +var accessToken = "accessToken"; //Required +var email = "email"; //Required +var apiResponse = new AuthenticationApi().RemoveEmail(accessToken, email); +``` + + +
Auth Unlink Social Identities (DELETE)
+This API is used to unlink up a social provider account with the specified account based on the access token and the social providers user access token. The unlinked account will automatically get removed from your database. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-unlink-social-identities) + + + +``` + +var accessToken = "accessToken"; //Required +var provider = "provider"; //Required +var providerId = "providerId"; //Required +var apiResponse = new AuthenticationApi().UnlinkSocialIdentities(accessToken, provider, providerId); +``` + + + + + + + +### Account API + + +List of APIs in this Section:
+[PUT : Account Update](#UpdateAccountByUid-put-)
+[PUT : Update Phone ID by UID](#UpdatePhoneIDByUid-put-)
+[PUT : Account Set Password](#SetAccountPasswordByUid-put-)
+[PUT : Account Invalidate Verification Email](#InvalidateAccountEmailVerification-put-)
+[PUT : Reset phone ID verification](#ResetPhoneIDVerificationByUid-put-)
+[PUT : Upsert Email](#UpsertEmail-put-)
+[POST : Account Create](#CreateAccount-post-)
+[POST : Forgot Password token](#GetForgotPasswordToken-post-)
+[POST : Email Verification token](#GetEmailVerificationToken-post-)
+[GET : Get Privacy Policy History By Uid](#GetPrivacyPolicyHistoryByUid-get-)
+[GET : Account Profiles by Email](#GetAccountProfileByEmail-get-)
+[GET : Account Profiles by Username](#GetAccountProfileByUserName-get-)
+[GET : Account Profile by Phone ID](#GetAccountProfileByPhone-get-)
+[GET : Account Profiles by UID](#GetAccountProfileByUid-get-)
+[GET : Account Password](#GetAccountPasswordHashByUid-get-)
+[GET : Access Token based on UID or User impersonation API](#GetAccessTokenByUid-get-)
+[GET : Refresh Access Token by Refresh Token](#RefreshAccessTokenByRefreshToken-get-)
+[GET : Revoke Refresh Token](#RevokeRefreshToken-get-)
+[GET : Account Identities by Email](#GetAccountIdentitiesByEmail-get-)
+[DELETE : Account Delete](#DeleteAccountByUid-delete-)
+[DELETE : Account Remove Email](#RemoveEmail-delete-)
+ + + +
Account Update (PUT)
+This API is used to update the information of existing accounts in your Cloud Storage. See our Advanced API Usage section Here for more capabilities. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-update) + + + +``` + +AccountUserProfileUpdateModel accountUserProfileUpdateModel = new AccountUserProfileUpdateModel{ +FirstName ="", +LastName ="" +}; //Required +var uid = "uid"; //Required +string fields = null; //Optional +; //Optional +var apiResponse = new AccountApi().UpdateAccountByUid(accountUserProfileUpdateModel, uid, fields); +``` + + +
Update Phone ID by UID (PUT)
+This API is used to update the PhoneId by using the Uid's. Admin can update the PhoneId's for both the verified and unverified profiles. It will directly replace the PhoneId and bypass the OTP verification process. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/update-phoneid-by-uid) + + + +``` + +var phone = "phone"; //Required +var uid = "uid"; //Required +string fields = null; //Optional +var apiResponse = new AccountApi().UpdatePhoneIDByUid(phone, uid, fields); +``` + + +
Account Set Password (PUT)
+This API is used to set the password of an account in Cloud Storage. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-set-password) + + + +``` + +var password = "password"; //Required +var uid = "uid"; //Required +var apiResponse = new AccountApi().SetAccountPasswordByUid(password, uid); +``` + + +
Account Invalidate Verification Email (PUT)
+This API is used to invalidate the Email Verification status on an account. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-invalidate-verification-email) + + + +``` + +var uid = "uid"; //Required +var emailTemplate = "emailTemplate"; //Optional +var verificationUrl = "verificationUrl"; //Optional +var apiResponse = new AccountApi().InvalidateAccountEmailVerification(uid, emailTemplate, verificationUrl); +``` + + +
Reset phone ID verification (PUT)
+This API Allows you to reset the phone no verification of an end user’s account. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/reset-phone-id-verification) + + + +``` + +var uid = "uid"; //Required +var smsTemplate = "smsTemplate"; //Optional +var apiResponse = new AccountApi().ResetPhoneIDVerificationByUid(uid, smsTemplate); +``` + + +
Upsert Email (PUT)
+This API is used to add/upsert another emails in account profile by different-different email types. If the email type is same then it will simply update the existing email, otherwise it will add a new email in Email array. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/upsert-email) + + + +``` + +UpsertEmailModel upsertEmailModel = new UpsertEmailModel{ +Email = new List{ +new EmailModel{ +Type ="", +Value ="" +}} +}; //Required +var uid = "uid"; //Required +string fields = null; //Optional +var apiResponse = new AccountApi().UpsertEmail(upsertEmailModel, uid, fields); +``` + + +
Account Create (POST)
+This API is used to create an account in Cloud Storage. This API bypass the normal email verification process and manually creates the user.

In order to use this API, you need to format a JSON request body with all of the mandatory fields [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-create) + + + +``` + +AccountCreateModel accountCreateModel = new AccountCreateModel{ +Email = new List{ +new EmailModel{ +Type ="", +Value ="" +}}, +FirstName ="", +LastName ="", +Password ="" +}; //Required +string fields = null; //Optional +var apiResponse = new AccountApi().CreateAccount(accountCreateModel, fields); +``` + + +
Forgot Password token (POST)
+This API Returns a Forgot Password Token it can also be used to send a Forgot Password email to the customer. Note: If you have the UserName workflow enabled, you may replace the 'email' parameter with 'username' in the body. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/get-forgot-password-token) + + + +``` + +var email = "email"; //Required +var emailTemplate = "emailTemplate"; //Optional +var resetPasswordUrl = "resetPasswordUrl"; //Optional +var sendEmail = true; //Optional +var apiResponse = new AccountApi().GetForgotPasswordToken(email, emailTemplate, resetPasswordUrl, sendEmail); +``` + + +
Email Verification token (POST)
+This API Returns an Email Verification token. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/get-email-verification-token) + + + +``` + +var email = "email"; //Required +var apiResponse = new AccountApi().GetEmailVerificationToken(email); +``` + + +
Get Privacy Policy History By Uid (GET)
+This API is used to retrieve all of the accepted Policies by the user, associated with their UID. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/privacy-policy-history-by-uid/) + + + +``` + +var uid = "uid"; //Required +var apiResponse = new AccountApi().GetPrivacyPolicyHistoryByUid(uid); +``` + + +
Account Profiles by Email (GET)
+This API is used to retrieve all of the profile data, associated with the specified account by email in Cloud Storage. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-profiles-by-email) + + + +``` + +var email = "email"; //Required +string fields = null; //Optional +var apiResponse = new AccountApi().GetAccountProfileByEmail(email, fields); +``` + + +
Account Profiles by Username (GET)
+This API is used to retrieve all of the profile data associated with the specified account by user name in Cloud Storage. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-profiles-by-user-name) + + + +``` + +var userName = "userName"; //Required +string fields = null; //Optional +var apiResponse = new AccountApi().GetAccountProfileByUserName(userName, fields); +``` + + +
Account Profile by Phone ID (GET)
+This API is used to retrieve all of the profile data, associated with the account by phone number in Cloud Storage. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-profiles-by-phone-id/) + + + +``` + +var phone = "phone"; //Required +string fields = null; //Optional +var apiResponse = new AccountApi().GetAccountProfileByPhone(phone, fields); +``` + + +
Account Profiles by UID (GET)
+This API is used to retrieve all of the profile data, associated with the account by uid in Cloud Storage. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-profiles-by-uid) + + + +``` + +var uid = "uid"; //Required +string fields = null; //Optional +var apiResponse = new AccountApi().GetAccountProfileByUid(uid, fields); +``` + + +
Account Password (GET)
+This API use to retrive the hashed password of a specified account in Cloud Storage. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-password) + + + +``` + +var uid = "uid"; //Required +var apiResponse = new AccountApi().GetAccountPasswordHashByUid(uid); +``` + + +
Access Token based on UID or User impersonation API (GET)
+The API is used to get LoginRadius access token based on UID. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-impersonation-api) + + + +``` + +var uid = "uid"; //Required +var apiResponse = new AccountApi().GetAccessTokenByUid(uid); +``` + + +
Refresh Access Token by Refresh Token (GET)
+This API is used to refresh an access_token via it's associated refresh_token. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/refresh-token/refresh-access-token-by-refresh-token) + + + +``` + +var refreshToken = "refreshToken"; //Required +var apiResponse = new AccountApi().RefreshAccessTokenByRefreshToken(refreshToken); +``` + + +
Revoke Refresh Token (GET)
+The Revoke Refresh Access Token API is used to revoke a refresh token or the Provider Access Token, revoking an existing refresh token will invalidate the refresh token but the associated access token will work until the expiry. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/refresh-token/revoke-refresh-token) + + + +``` + +var refreshToken = "refreshToken"; //Required +var apiResponse = new AccountApi().RevokeRefreshToken(refreshToken); +``` + + +
Account Identities by Email (GET)
+Note: This is intended for specific workflows where an email may be associated to multiple UIDs. This API is used to retrieve all of the identities (UID and Profiles), associated with a specified email in Cloud Storage. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-identities-by-email) + + + +``` + +var email = "email"; //Required +string fields = null; //Optional +var apiResponse = new AccountApi().GetAccountIdentitiesByEmail(email, fields); +``` + + +
Account Delete (DELETE)
+This API deletes the Users account and allows them to re-register for a new account. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-delete) + + + +``` + +var uid = "uid"; //Required +var apiResponse = new AccountApi().DeleteAccountByUid(uid); +``` + + +
Account Remove Email (DELETE)
+Use this API to Remove emails from a user Account [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-email-delete) + + + +``` + +var email = "email"; //Required +var uid = "uid"; //Required +string fields = null; //Optional +var apiResponse = new AccountApi().RemoveEmail(email, uid, fields); +``` + + + + + + + +### Social API + + +List of APIs in this Section:
+[POST : Post Message API](#PostMessage-post-)
+[POST : Status Posting ](#StatusPosting-post-)
+[POST : Trackable Status Posting](#TrackableStatusPosting-post-)
+[GET : Access Token](#ExchangeAccessToken-get-)
+[GET : Refresh Token](#RefreshAccessToken-get-)
+[GET : Token Validate](#ValidateAccessToken-get-)
+[GET : Access Token Invalidate](#InValidateAccessToken-get-)
+[GET : Get Active Session Details](#GetActiveSession-get-)
+[GET : Get Active Session By Account Id](#GetActiveSessionByAccountID-get-)
+[GET : Get Active Session By Profile Id](#GetActiveSessionByProfileID-get-)
+[GET : Album](#GetAlbums-get-)
+[GET : Audio](#GetAudios-get-)
+[GET : Check In](#GetCheckIns-get-)
+[GET : Contact](#GetContacts-get-)
+[GET : Event](#GetEvents-get-)
+[GET : Following](#GetFollowings-get-)
+[GET : Group](#GetGroups-get-)
+[GET : Like](#GetLikes-get-)
+[GET : Mention](#GetMentions-get-)
+[GET : Page](#GetPage-get-)
+[GET : Photo](#GetPhotos-get-)
+[GET : Get Post](#GetPosts-get-)
+[GET : Get Status](#GetStatus-get-)
+[GET : Get Trackable Status Stats](#GetTrackableStatusStats-get-)
+[GET : Trackable Status Fetching](#TrackableStatusFetching-get-)
+[GET : User Profile](#GetSocialUserProfile-get-)
+[GET : Refresh User Profile](#GetRefreshedSocialUserProfile-get-)
+[GET : Video](#GetVideos-get-)
+ + + +
Post Message API (POST)
+Post Message API is used to post messages to the user’s contacts.

Supported Providers: Twitter, LinkedIn

The Message API is used to post messages to the user’s contacts. This is one of the APIs that makes up the LoginRadius Friend Invite System. After using the Contact API, you can send messages to the retrieved contacts. This API requires setting permissions in your LoginRadius Dashboard.

GET & POST Message API work the same way except the API method is different [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/post-message-api) + + + +``` + +var accessToken = "accessToken"; //Required +var message = "message"; //Required +var subject = "subject"; //Required +var to = "to"; //Required +var apiResponse = new SocialApi().PostMessage(accessToken, message, subject, to); +``` + + +
Status Posting (POST)
+The Status API is used to update the status on the user’s wall.

Supported Providers: Facebook, Twitter, LinkedIn [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/status-posting/) + + + +``` + +var accessToken = "accessToken"; //Required +var caption = "caption"; //Required +var description = "description"; //Required +var imageUrl = "imageUrl"; //Required +var status = "status"; //Required +var title = "title"; //Required +var url = "url"; //Required +var shorturl = "shorturl"; //Optional +var apiResponse = new SocialApi().StatusPosting(accessToken, caption, description, imageUrl, status, title, url, shorturl); +``` + + +
Trackable Status Posting (POST)
+The Trackable status API works very similar to the Status API but it returns a Post id that you can use to track the stats(shares, likes, comments) for a specific share/post/status update. This API requires setting permissions in your LoginRadius Dashboard.

The Trackable Status API is used to update the status on the user’s wall and return an Post ID value. It is commonly referred to as Permission based sharing or Push notifications.

POST Input Parameter Format: application/x-www-form-urlencoded [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/trackable-status-posting/) + + + +``` + +var accessToken = "accessToken"; //Required +StatusModel statusModel = new StatusModel{ +Caption ="", +Description ="", +Imageurl ="", +Status ="", +Title ="", +Url ="<Url>" +}; //Required +var apiResponse = new SocialApi().TrackableStatusPosting(accessToken, statusModel); +``` + + +<h6 id="ExchangeAccessToken-get-">Access Token (GET)</h6> +This API Is used to translate the Request Token returned during authentication into an Access Token that can be used with other API calls. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/access-token) + + + +``` + +var token = "token"; //Required +var apiResponse = new SocialApi().ExchangeAccessToken(token); +``` + + +<h6 id="RefreshAccessToken-get-">Refresh Token (GET)</h6> +The Refresh Access Token API is used to refresh the provider access token after authentication. It will be valid for up to 60 days on LoginRadius depending on the provider. In order to use the access token in other APIs, always refresh the token using this API.<br><br><b>Supported Providers :</b> Facebook,Yahoo,Google,Twitter, Linkedin.<br><br> Contact LoginRadius support team to enable this API. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/refresh-token/refresh-token) + + + +``` + +var accessToken = "accessToken"; //Required +var expiresIn = 0; //Optional +var apiResponse = new SocialApi().RefreshAccessToken(accessToken, expiresIn); +``` + + +<h6 id="ValidateAccessToken-get-">Token Validate (GET)</h6> +This API validates access token, if valid then returns a response with its expiry otherwise error. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/validate-access-token) + + + +``` + +var accessToken = "accessToken"; //Required +var apiResponse = new SocialApi().ValidateAccessToken(accessToken); +``` + + +<h6 id="InValidateAccessToken-get-">Access Token Invalidate (GET)</h6> +This api invalidates the active access token or expires an access token validity. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/invalidate-access-token) + + + +``` + +var accessToken = "accessToken"; //Required +var apiResponse = new SocialApi().InValidateAccessToken(accessToken); +``` + + +<h6 id="GetActiveSession-get-">Get Active Session Details (GET)</h6> +This api is use to get all active session by Access Token. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/get-active-session-details) + + + +``` + +var token = "token"; //Required +var apiResponse = new SocialApi().GetActiveSession(token); +``` + + +<h6 id="GetActiveSessionByAccountID-get-">Get Active Session By Account Id (GET)</h6> +This api is used to get all active sessions by AccountID(UID). [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/active-session-by-account-id/) + + + +``` + +var accountId = "accountId"; //Required +var apiResponse = new SocialApi().GetActiveSessionByAccountID(accountId); +``` + + +<h6 id="GetActiveSessionByProfileID-get-">Get Active Session By Profile Id (GET)</h6> +This api is used to get all active sessions by ProfileId. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/active-session-by-profile-id/) + + + +``` + +var profileId = "profileId"; //Required +var apiResponse = new SocialApi().GetActiveSessionByProfileID(profileId); +``` + + +<h6 id="GetAlbums-get-">Album (GET)</h6> +<b>Supported Providers:</b> Facebook, Google, Live, Vkontakte.<br><br> This API returns the photo albums associated with the passed in access tokens Social Profile. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/album/) + + + +``` + +var accessToken = "accessToken"; //Required +var apiResponse = new SocialApi().GetAlbums(accessToken); +``` + + +<h6 id="GetAudios-get-">Audio (GET)</h6> +The Audio API is used to get audio files data from the user’s social account.<br><br><b>Supported Providers:</b> Live, Vkontakte [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/audio) + + + +``` + +var accessToken = "accessToken"; //Required +var apiResponse = new SocialApi().GetAudios(accessToken); +``` + + +<h6 id="GetCheckIns-get-">Check In (GET)</h6> +The Check In API is used to get check Ins data from the user’s social account.<br><br><b>Supported Providers:</b> Facebook, Foursquare, Vkontakte [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/check-in) + + + +``` + +var accessToken = "accessToken"; //Required +var apiResponse = new SocialApi().GetCheckIns(accessToken); +``` + + +<h6 id="GetContacts-get-">Contact (GET)</h6> +The Contact API is used to get contacts/friends/connections data from the user’s social account.This is one of the APIs that makes up the LoginRadius Friend Invite System. The data will normalized into LoginRadius’ standard data format. This API requires setting permissions in your LoginRadius Dashboard. <br><br><b>Note:</b> Facebook restricts access to the list of friends that is returned. When using the Contacts API with Facebook you will only receive friends that have accepted some permissions with your app. <br><br><b>Supported Providers:</b> Facebook, Foursquare, Google, LinkedIn, Live, Twitter, Vkontakte, Yahoo [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/contact) + + + +``` + +var accessToken = "accessToken"; //Required +var nextCursor = "nextCursor"; //Optional +var apiResponse = new SocialApi().GetContacts(accessToken, nextCursor); +``` + + +<h6 id="GetEvents-get-">Event (GET)</h6> +The Event API is used to get the event data from the user’s social account.<br><br><b>Supported Providers:</b> Facebook, Live [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/event) + + + +``` + +var accessToken = "accessToken"; //Required +var apiResponse = new SocialApi().GetEvents(accessToken); +``` + + +<h6 id="GetFollowings-get-">Following (GET)</h6> +Get the following user list from the user’s social account.<br><br><b>Supported Providers:</b> Twitter [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/following) + + + +``` + +var accessToken = "accessToken"; //Required +var apiResponse = new SocialApi().GetFollowings(accessToken); +``` + + +<h6 id="GetGroups-get-">Group (GET)</h6> +The Group API is used to get group data from the user’s social account.<br><br><b>Supported Providers:</b> Facebook, Vkontakte [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/group) + + + +``` + +var accessToken = "accessToken"; //Required +var apiResponse = new SocialApi().GetGroups(accessToken); +``` + + +<h6 id="GetLikes-get-">Like (GET)</h6> +The Like API is used to get likes data from the user’s social account.<br><br><b>Supported Providers:</b> Facebook [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/like) + + + +``` + +var accessToken = "accessToken"; //Required +var apiResponse = new SocialApi().GetLikes(accessToken); +``` + + +<h6 id="GetMentions-get-">Mention (GET)</h6> +The Mention API is used to get mentions data from the user’s social account.<br><br><b>Supported Providers:</b> Twitter [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/mention) + + + +``` + +var accessToken = "accessToken"; //Required +var apiResponse = new SocialApi().GetMentions(accessToken); +``` + + +<h6 id="GetPage-get-">Page (GET)</h6> +The Page API is used to get the page data from the user’s social account.<br><br><b>Supported Providers:</b> Facebook, LinkedIn [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/page) + + + +``` + +var accessToken = "accessToken"; //Required +var pageName = "pageName"; //Required +var apiResponse = new SocialApi().GetPage(accessToken, pageName); +``` + + +<h6 id="GetPhotos-get-">Photo (GET)</h6> +The Photo API is used to get photo data from the user’s social account.<br><br><b>Supported Providers:</b> Facebook, Foursquare, Google, Live, Vkontakte [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/photo) + + + +``` + +var accessToken = "accessToken"; //Required +var albumId = "albumId"; //Required +var apiResponse = new SocialApi().GetPhotos(accessToken, albumId); +``` + + +<h6 id="GetPosts-get-">Get Post (GET)</h6> +The Post API is used to get post message data from the user’s social account.<br><br><b>Supported Providers:</b> Facebook [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/post) + + + +``` + +var accessToken = "accessToken"; //Required +var apiResponse = new SocialApi().GetPosts(accessToken); +``` + + +<h6 id="GetStatus-get-">Get Status (GET)</h6> +The Status API is used to get the status messages from the user’s social account. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/status-fetching) + + + +``` + +var accessToken = "accessToken"; //Required +var apiResponse = new SocialApi().GetStatus(accessToken); +``` + + +<h6 id="GetTrackableStatusStats-get-">Get Trackable Status Stats (GET)</h6> +The Trackable status API works very similar to the Status API but it returns a Post id that you can use to track the stats(shares, likes, comments) for a specific share/post/status update. This API requires setting permissions in your LoginRadius Dashboard.<br><br> The Trackable Status API is used to update the status on the user’s wall and return an Post ID value. It is commonly referred to as Permission based sharing or Push notifications. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/get-trackable-status-stats/) + + + +``` + +var accessToken = "accessToken"; //Required +var caption = "caption"; //Required +var description = "description"; //Required +var imageUrl = "imageUrl"; //Required +var status = "status"; //Required +var title = "title"; //Required +var url = "url"; //Required +var apiResponse = new SocialApi().GetTrackableStatusStats(accessToken, caption, description, imageUrl, status, title, url); +``` + + +<h6 id="TrackableStatusFetching-get-">Trackable Status Fetching (GET)</h6> +The Trackable status API works very similar to the Status API but it returns a Post id that you can use to track the stats(shares, likes, comments) for a specific share/post/status update. This API requires setting permissions in your LoginRadius Dashboard.<br><br> This API is used to retrieve a tracked post based on the passed in post ID value. This API requires setting permissions in your LoginRadius Dashboard.<br><br> <b>Note:</b> To utilize this API you need to find the ID for the post you want to track, which might require using Trackable Status Posting API first. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/trackable-status-fetching/) + + + +``` + +var postId = "postId"; //Required +var apiResponse = new SocialApi().TrackableStatusFetching(postId); +``` + + +<h6 id="GetSocialUserProfile-get-">User Profile (GET)</h6> +The User Profile API is used to get social profile data from the user’s social account after authentication.<br><br><b>Supported Providers:</b> All [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/user-profile) + + + +``` + +var accessToken = "accessToken"; //Required +string fields = null; //Optional +var apiResponse = new SocialApi().GetSocialUserProfile(accessToken, fields); +``` + + +<h6 id="GetRefreshedSocialUserProfile-get-">Refresh User Profile (GET)</h6> +The User Profile API is used to get the latest updated social profile data from the user’s social account after authentication. The social profile will be retrieved via oAuth and OpenID protocols. The data is normalized into LoginRadius’ standard data format. This API should be called using the access token retrieved from the refresh access token API. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/refresh-token/refresh-user-profile) + + + +``` + +var accessToken = "accessToken"; //Required +string fields = null; //Optional +var apiResponse = new SocialApi().GetRefreshedSocialUserProfile(accessToken, fields); +``` + + +<h6 id="GetVideos-get-">Video (GET)</h6> +The Video API is used to get video files data from the user’s social account.<br><br><b>Supported Providers:</b> Facebook, Google, Live, Vkontakte [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/video) + + + +``` + +var accessToken = "accessToken"; //Required +var nextCursor = "nextCursor"; //Required +var apiResponse = new SocialApi().GetVideos(accessToken, nextCursor); +``` + + + + + + + +### CustomObject API + + +List of APIs in this Section:<br> +[PUT : Custom Object Update by Access Token](#UpdateCustomObjectByToken-put-)<br> +[PUT : Custom Object Update by UID](#UpdateCustomObjectByUid-put-)<br> +[POST : Create Custom Object by Token](#CreateCustomObjectByToken-post-)<br> +[POST : Create Custom Object by UID](#CreateCustomObjectByUid-post-)<br> +[GET : Custom Object by Token](#GetCustomObjectByToken-get-)<br> +[GET : Custom Object by ObjectRecordId and Token](#GetCustomObjectByRecordIDAndToken-get-)<br> +[GET : Custom Object By UID](#GetCustomObjectByUid-get-)<br> +[GET : Custom Object by ObjectRecordId and UID](#GetCustomObjectByRecordID-get-)<br> +[DELETE : Custom Object Delete by Record Id And Token](#DeleteCustomObjectByToken-delete-)<br> +[DELETE : Account Delete Custom Object by ObjectRecordId](#DeleteCustomObjectByRecordID-delete-)<br> + +>**Note:** `CustomObject` must be valid JSON. For example: + +``` +public class cobj + { + public string field1 { get; set; } + public string field2 { get; set; } + } +``` +``` +cobj customObject = new cobj(); +customObject.field1 = "XXXX"; +customObject.field2 = "YYYY"; +``` + + + +<h6 id="UpdateCustomObjectByToken-put-">Custom Object Update by Access Token (PUT)</h6> +This API is used to update the specified custom object data of the specified account. If the value of updatetype is 'replace' then it will fully replace custom object with the new custom object and if the value of updatetype is 'partialreplace' then it will perform an upsert type operation [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/custom-object-update-by-objectrecordid-and-token) + + + +``` + +var accessToken = "accessToken"; //Required +var objectName = "objectName"; //Required +var objectRecordId = "objectRecordId"; //Required + +CustomObjectUpdateOperationType updateType = CustomObjectUpdateOperationType.Default; //Optional +var apiResponse = new CustomObjectApi().UpdateCustomObjectByToken(accessToken, objectName, objectRecordId, customObject, updateType); +``` + + +<h6 id="UpdateCustomObjectByUid-put-">Custom Object Update by UID (PUT)</h6> +This API is used to update the specified custom object data of a specified account. If the value of updatetype is 'replace' then it will fully replace custom object with new custom object and if the value of updatetype is partialreplace then it will perform an upsert type operation. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/custom-object-update-by-objectrecordid-and-uid) + + + +``` + +var objectName = "objectName"; //Required +var objectRecordId = "objectRecordId"; //Required + +var uid = "uid"; //Required +CustomObjectUpdateOperationType updateType = CustomObjectUpdateOperationType.Default; //Optional +var apiResponse = new CustomObjectApi().UpdateCustomObjectByUid(objectName, objectRecordId, customObject, uid, updateType); +``` + + +<h6 id="CreateCustomObjectByToken-post-">Create Custom Object by Token (POST)</h6> +This API is used to write information in JSON format to the custom object for the specified account. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/create-custom-object-by-token) + + + +``` + +var accessToken = "accessToken"; //Required +var objectName = "objectName"; //Required + +var apiResponse = new CustomObjectApi().CreateCustomObjectByToken(accessToken, objectName, customObject); +``` + + +<h6 id="CreateCustomObjectByUid-post-">Create Custom Object by UID (POST)</h6> +This API is used to write information in JSON format to the custom object for the specified account. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/create-custom-object-by-uid) + + + +``` + +var objectName = "objectName"; //Required + +var uid = "uid"; //Required +var apiResponse = new CustomObjectApi().CreateCustomObjectByUid(objectName, customObject, uid); +``` + + +<h6 id="GetCustomObjectByToken-get-">Custom Object by Token (GET)</h6> +This API is used to retrieve the specified Custom Object data for the specified account. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/custom-object-by-token) + + + +``` + +var accessToken = "accessToken"; //Required +var objectName = "objectName"; //Required +var apiResponse = new CustomObjectApi().GetCustomObjectByToken(accessToken, objectName); +``` + + +<h6 id="GetCustomObjectByRecordIDAndToken-get-">Custom Object by ObjectRecordId and Token (GET)</h6> +This API is used to retrieve the Custom Object data for the specified account. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/custom-object-by-objectrecordid-and-token) + + + +``` + +var accessToken = "accessToken"; //Required +var objectName = "objectName"; //Required +var objectRecordId = "objectRecordId"; //Required +var apiResponse = new CustomObjectApi().GetCustomObjectByRecordIDAndToken(accessToken, objectName, objectRecordId); +``` + + +<h6 id="GetCustomObjectByUid-get-">Custom Object By UID (GET)</h6> +This API is used to retrieve all the custom objects by UID from cloud storage. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/custom-object-by-uid) + + + +``` + +var objectName = "objectName"; //Required +var uid = "uid"; //Required +var apiResponse = new CustomObjectApi().GetCustomObjectByUid(objectName, uid); +``` + + +<h6 id="GetCustomObjectByRecordID-get-">Custom Object by ObjectRecordId and UID (GET)</h6> +This API is used to retrieve the Custom Object data for the specified account. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/custom-object-by-objectrecordid-and-uid) + + + +``` + +var objectName = "objectName"; //Required +var objectRecordId = "objectRecordId"; //Required +var uid = "uid"; //Required +var apiResponse = new CustomObjectApi().GetCustomObjectByRecordID(objectName, objectRecordId, uid); +``` + + +<h6 id="DeleteCustomObjectByToken-delete-">Custom Object Delete by Record Id And Token (DELETE)</h6> +This API is used to remove the specified Custom Object data using ObjectRecordId of a specified account. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/custom-object-delete-by-objectrecordid-and-token) + + + +``` + +var accessToken = "accessToken"; //Required +var objectName = "objectName"; //Required +var objectRecordId = "objectRecordId"; //Required +var apiResponse = new CustomObjectApi().DeleteCustomObjectByToken(accessToken, objectName, objectRecordId); +``` + + +<h6 id="DeleteCustomObjectByRecordID-delete-">Account Delete Custom Object by ObjectRecordId (DELETE)</h6> +This API is used to remove the specified Custom Object data using ObjectRecordId of specified account. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/custom-object-delete-by-objectrecordid-and-uid) + + + +``` + +var objectName = "objectName"; //Required +var objectRecordId = "objectRecordId"; //Required +var uid = "uid"; //Required +var apiResponse = new CustomObjectApi().DeleteCustomObjectByRecordID(objectName, objectRecordId, uid); +``` + + + + + + + +### PhoneAuthentication API + + +List of APIs in this Section:<br> +[PUT : Phone Reset Password by OTP](#ResetPasswordByPhoneOTP-put-)<br> +[PUT : Phone Verification OTP](#PhoneVerificationByOTP-put-)<br> +[PUT : Phone Verification OTP by Token](#PhoneVerificationOTPByAccessToken-put-)<br> +[PUT : Phone Number Update](#UpdatePhoneNumber-put-)<br> +[POST : Phone Login](#LoginByPhone-post-)<br> +[POST : Phone Forgot Password by OTP](#ForgotPasswordByPhoneOTP-post-)<br> +[POST : Phone Resend Verification OTP](#PhoneResendVerificationOTP-post-)<br> +[POST : Phone Resend Verification OTP By Token](#PhoneResendVerificationOTPByToken-post-)<br> +[GET : Phone Number Availability](#CheckPhoneNumberAvailability-get-)<br> +[DELETE : Remove Phone ID by Access Token](#RemovePhoneIDByAccessToken-delete-)<br> + + + +<h6 id="ResetPasswordByPhoneOTP-put-">Phone Reset Password by OTP (PUT)</h6> +This API is used to reset the password [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-reset-password-by-otp) + + + +``` + +ResetPasswordByOTPModel resetPasswordByOTPModel = new ResetPasswordByOTPModel{ +Otp ="<Otp>", +Password ="<Password>", +Phone ="<Phone>" +}; //Required +var apiResponse = new PhoneAuthenticationApi().ResetPasswordByPhoneOTP(resetPasswordByOTPModel); +``` + + +<h6 id="PhoneVerificationByOTP-put-">Phone Verification OTP (PUT)</h6> +This API is used to validate the verification code sent to verify a user's phone number [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-verify-otp) + + + +``` + +var otp = "otp"; //Required +var phone = "phone"; //Required +string fields = null; //Optional +var smsTemplate = "smsTemplate"; //Optional +var apiResponse = new PhoneAuthenticationApi().PhoneVerificationByOTP(otp, phone, fields, smsTemplate); +``` + + +<h6 id="PhoneVerificationOTPByAccessToken-put-">Phone Verification OTP by Token (PUT)</h6> +This API is used to consume the verification code sent to verify a user's phone number. Use this call for front-end purposes in cases where the user is already logged in by passing the user's access token. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-verify-otp-by-token) + + + +``` + +var accessToken = "accessToken"; //Required +var otp = "otp"; //Required +var smsTemplate = "smsTemplate"; //Optional +var apiResponse = new PhoneAuthenticationApi().PhoneVerificationOTPByAccessToken(accessToken, otp, smsTemplate); +``` + + +<h6 id="UpdatePhoneNumber-put-">Phone Number Update (PUT)</h6> +This API is used to update the login Phone Number of users [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-number-update) + + + +``` + +var accessToken = "accessToken"; //Required +var phone = "phone"; //Required +var smsTemplate = "smsTemplate"; //Optional +var apiResponse = new PhoneAuthenticationApi().UpdatePhoneNumber(accessToken, phone, smsTemplate); +``` + + +<h6 id="LoginByPhone-post-">Phone Login (POST)</h6> +This API retrieves a copy of the user data based on the Phone [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-login) + + + +``` + +PhoneAuthenticationModel phoneAuthenticationModel = new PhoneAuthenticationModel{ +Password ="<Password>", +Phone ="<Phone>" +}; //Required +string fields = null; //Optional +var loginUrl = "loginUrl"; //Optional +var smsTemplate = "smsTemplate"; //Optional +var apiResponse = new PhoneAuthenticationApi().LoginByPhone(phoneAuthenticationModel, fields, loginUrl, smsTemplate); +``` + + +<h6 id="ForgotPasswordByPhoneOTP-post-">Phone Forgot Password by OTP (POST)</h6> +This API is used to send the OTP to reset the account password. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-forgot-password-by-otp) + + + +``` + +var phone = "phone"; //Required +var smsTemplate = "smsTemplate"; //Optional +var apiResponse = new PhoneAuthenticationApi().ForgotPasswordByPhoneOTP(phone, smsTemplate); +``` + + +<h6 id="PhoneResendVerificationOTP-post-">Phone Resend Verification OTP (POST)</h6> +This API is used to resend a verification OTP to verify a user's Phone Number. The user will receive a verification code that they will need to input [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-resend-otp) + + + +``` + +var phone = "phone"; //Required +var smsTemplate = "smsTemplate"; //Optional +var apiResponse = new PhoneAuthenticationApi().PhoneResendVerificationOTP(phone, smsTemplate); +``` + + +<h6 id="PhoneResendVerificationOTPByToken-post-">Phone Resend Verification OTP By Token (POST)</h6> +This API is used to resend a verification OTP to verify a user's Phone Number in cases in which an active token already exists [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-resend-otp-by-token) + + + +``` + +var accessToken = "accessToken"; //Required +var phone = "phone"; //Required +var smsTemplate = "smsTemplate"; //Optional +var apiResponse = new PhoneAuthenticationApi().PhoneResendVerificationOTPByToken(accessToken, phone, smsTemplate); +``` + + +<h6 id="CheckPhoneNumberAvailability-get-">Phone Number Availability (GET)</h6> +This API is used to check the Phone Number exists or not on your site. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-number-availability) + + + +``` + +var phone = "phone"; //Required +var apiResponse = new PhoneAuthenticationApi().CheckPhoneNumberAvailability(phone); +``` + + +<h6 id="RemovePhoneIDByAccessToken-delete-">Remove Phone ID by Access Token (DELETE)</h6> +This API is used to delete the Phone ID on a user's account via the access_token [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/remove-phone-id-by-access-token) + + + +``` + +var accessToken = "accessToken"; //Required +var apiResponse = new PhoneAuthenticationApi().RemovePhoneIDByAccessToken(accessToken); +``` + + + + + + + +### MultiFactorAuthentication API + + +List of APIs in this Section:<br> +[PUT : Update MFA Setting](#MFAUpdateSetting-put-)<br> +[PUT : Update MFA by Access Token](#MFAUpdateByAccessToken-put-)<br> +[PUT : MFA Update Phone Number by Token](#MFAUpdatePhoneNumberByToken-put-)<br> +[PUT : MFA Validate OTP](#MFAValidateOTPByPhone-put-)<br> +[PUT : MFA Validate Google Auth Code](#MFAValidateGoogleAuthCode-put-)<br> +[PUT : MFA Validate Backup code](#MFAValidateBackupCode-put-)<br> +[PUT : MFA Update Phone Number](#MFAUpdatePhoneNumber-put-)<br> +[PUT : Validate MFA by OTP](#MFAReAuthenticateByOTP-put-)<br> +[PUT : Validate MFA by Backup Code](#MFAReAuthenticateByBackupCode-put-)<br> +[PUT : Validate MFA by Google Authenticator Code](#MFAReAuthenticateByGoogleAuth-put-)<br> +[PUT : Validate MFA by Password](#MFAReAuthenticateByPassword-put-)<br> +[POST : MFA Email Login](#MFALoginByEmail-post-)<br> +[POST : MFA UserName Login](#MFALoginByUserName-post-)<br> +[POST : MFA Phone Login](#MFALoginByPhone-post-)<br> +[GET : MFA Validate Access Token](#MFAConfigureByAccessToken-get-)<br> +[GET : MFA Backup Code by Access Token](#MFABackupCodeByAccessToken-get-)<br> +[GET : Reset Backup Code by Access Token](#MFAResetBackupCodeByAccessToken-get-)<br> +[GET : MFA Resend Otp](#MFAResendOTP-get-)<br> +[GET : Multi Factor Re-Authenticate](#MFAReAuthenticate-get-)<br> +[GET : MFA Backup Code by UID](#MFABackupCodeByUid-get-)<br> +[GET : MFA Reset Backup Code by UID](#MFAResetBackupCodeByUid-get-)<br> +[DELETE : MFA Reset Google Authenticator by Token](#MFAResetGoogleAuthByToken-delete-)<br> +[DELETE : MFA Reset SMS Authenticator by Token](#MFAResetSMSAuthByToken-delete-)<br> +[DELETE : MFA Reset SMS Authenticator By UID](#MFAResetSMSAuthenticatorByUid-delete-)<br> +[DELETE : MFA Reset Google Authenticator By UID](#MFAResetGoogleAuthenticatorByUid-delete-)<br> + + + +<h6 id="MFAUpdateSetting-put-">Update MFA Setting (PUT)</h6> +This API is used to trigger the Multi-factor authentication settings after login for secure actions [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/sms-authenticator/update-mfa-setting/) + + + +``` + +var accessToken = "accessToken"; //Required +MultiFactorAuthModelWithLockout multiFactorAuthModelWithLockout = new MultiFactorAuthModelWithLockout{ +Otp ="<Otp>" +}; //Required +string fields = null; //Optional +var apiResponse = new MultiFactorAuthenticationApi().MFAUpdateSetting(accessToken, multiFactorAuthModelWithLockout, fields); +``` + + +<h6 id="MFAUpdateByAccessToken-put-">Update MFA by Access Token (PUT)</h6> +This API is used to Enable Multi-factor authentication by access token on user login [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/google-authenticator/update-mfa-by-access-token/) + + + +``` + +var accessToken = "accessToken"; //Required +MultiFactorAuthModelByGoogleAuthenticatorCode multiFactorAuthModelByGoogleAuthenticatorCode = new MultiFactorAuthModelByGoogleAuthenticatorCode{ +GoogleAuthenticatorCode ="<GoogleAuthenticatorCode>" +}; //Required +string fields = null; //Optional +var smsTemplate = "smsTemplate"; //Optional +var apiResponse = new MultiFactorAuthenticationApi().MFAUpdateByAccessToken(accessToken, multiFactorAuthModelByGoogleAuthenticatorCode, fields, smsTemplate); +``` + + +<h6 id="MFAUpdatePhoneNumberByToken-put-">MFA Update Phone Number by Token (PUT)</h6> +This API is used to update the Multi-factor authentication phone number by sending the verification OTP to the provided phone number [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/sms-authenticator/mfa-update-phone-number-by-token/) + + + +``` + +var accessToken = "accessToken"; //Required +var phoneNo2FA = "phoneNo2FA"; //Required +var smsTemplate2FA = "smsTemplate2FA"; //Optional +var apiResponse = new MultiFactorAuthenticationApi().MFAUpdatePhoneNumberByToken(accessToken, phoneNo2FA, smsTemplate2FA); +``` + + +<h6 id="MFAValidateOTPByPhone-put-">MFA Validate OTP (PUT)</h6> +This API is used to login via Multi-factor authentication by passing the One Time Password received via SMS [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/sms-authenticator/mfa-validate-otp/) + + + +``` + +MultiFactorAuthModelWithLockout multiFactorAuthModelWithLockout = new MultiFactorAuthModelWithLockout{ +Otp ="<Otp>" +}; //Required +var secondFactorAuthenticationToken = "secondFactorAuthenticationToken"; //Required +string fields = null; //Optional +var smsTemplate2FA = "smsTemplate2FA"; //Optional +var apiResponse = new MultiFactorAuthenticationApi().MFAValidateOTPByPhone(multiFactorAuthModelWithLockout, secondFactorAuthenticationToken, fields, smsTemplate2FA); +``` + + +<h6 id="MFAValidateGoogleAuthCode-put-">MFA Validate Google Auth Code (PUT)</h6> +This API is used to login via Multi-factor-authentication by passing the google authenticator code. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/google-authenticator/mfa-validate-google-auth-code/) + + + +``` + +var googleAuthenticatorCode = "googleAuthenticatorCode"; //Required +var secondFactorAuthenticationToken = "secondFactorAuthenticationToken"; //Required +string fields = null; //Optional +var smsTemplate2FA = "smsTemplate2FA"; //Optional +var apiResponse = new MultiFactorAuthenticationApi().MFAValidateGoogleAuthCode(googleAuthenticatorCode, secondFactorAuthenticationToken, fields, smsTemplate2FA); +``` + + +<h6 id="MFAValidateBackupCode-put-">MFA Validate Backup code (PUT)</h6> +This API is used to validate the backup code provided by the user and if valid, we return an access_token allowing the user to login incases where Multi-factor authentication (MFA) is enabled and the secondary factor is unavailable. When a user initially downloads the Backup codes, We generate 10 codes, each code can only be consumed once. if any user attempts to go over the number of invalid login attempts configured in the Dashboard then the account gets blocked automatically [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/backup-codes/mfa-validate-backup-code/) + + + +``` + +MultiFactorAuthModelByBackupCode multiFactorAuthModelByBackupCode = new MultiFactorAuthModelByBackupCode{ +BackupCode ="<BackupCode>" +}; //Required +var secondFactorAuthenticationToken = "secondFactorAuthenticationToken"; //Required +string fields = null; //Optional +var apiResponse = new MultiFactorAuthenticationApi().MFAValidateBackupCode(multiFactorAuthModelByBackupCode, secondFactorAuthenticationToken, fields); +``` + + +<h6 id="MFAUpdatePhoneNumber-put-">MFA Update Phone Number (PUT)</h6> +This API is used to update (if configured) the phone number used for Multi-factor authentication by sending the verification OTP to the provided phone number [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/sms-authenticator/mfa-update-phone-number/) + + + +``` + +var phoneNo2FA = "phoneNo2FA"; //Required +var secondFactorAuthenticationToken = "secondFactorAuthenticationToken"; //Required +var smsTemplate2FA = "smsTemplate2FA"; //Optional +var apiResponse = new MultiFactorAuthenticationApi().MFAUpdatePhoneNumber(phoneNo2FA, secondFactorAuthenticationToken, smsTemplate2FA); +``` + + +<h6 id="MFAReAuthenticateByOTP-put-">Validate MFA by OTP (PUT)</h6> +This API is used to re-authenticate via Multi-factor authentication by passing the One Time Password received via SMS [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/re-authentication/re-auth-by-otp) + + + +``` + +var accessToken = "accessToken"; //Required +ReauthByOtpModel reauthByOtpModel = new ReauthByOtpModel{ +Otp ="<Otp>" +}; //Required +var apiResponse = new MultiFactorAuthenticationApi().MFAReAuthenticateByOTP(accessToken, reauthByOtpModel); +``` + + +<h6 id="MFAReAuthenticateByBackupCode-put-">Validate MFA by Backup Code (PUT)</h6> +This API is used to re-authenticate by set of backup codes via access_token on the site that has Multi-factor authentication enabled in re-authentication for the user that does not have the device [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/re-authentication/re-auth-by-backup-code) + + + +``` + +var accessToken = "accessToken"; //Required +ReauthByBackupCodeModel reauthByBackupCodeModel = new ReauthByBackupCodeModel{ +BackupCode ="<BackupCode>" +}; //Required +var apiResponse = new MultiFactorAuthenticationApi().MFAReAuthenticateByBackupCode(accessToken, reauthByBackupCodeModel); +``` + + +<h6 id="MFAReAuthenticateByGoogleAuth-put-">Validate MFA by Google Authenticator Code (PUT)</h6> +This API is used to re-authenticate via Multi-factor-authentication by passing the google authenticator code [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/re-authentication/re-auth-by-google-authenticator-code) + + + +``` + +var accessToken = "accessToken"; //Required +ReauthByGoogleAuthenticatorCodeModel reauthByGoogleAuthenticatorCodeModel = new ReauthByGoogleAuthenticatorCodeModel{ +GoogleAuthenticatorCode ="<GoogleAuthenticatorCode>" +}; //Required +var apiResponse = new MultiFactorAuthenticationApi().MFAReAuthenticateByGoogleAuth(accessToken, reauthByGoogleAuthenticatorCodeModel); +``` + + +<h6 id="MFAReAuthenticateByPassword-put-">Validate MFA by Password (PUT)</h6> +This API is used to re-authenticate via Multi-factor-authentication by passing the password [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/re-authentication/re-auth-by-password) + + + +``` + +var accessToken = "accessToken"; //Required +PasswordEventBasedAuthModelWithLockout passwordEventBasedAuthModelWithLockout = new PasswordEventBasedAuthModelWithLockout{ +Password ="<Password>" +}; //Required +var smsTemplate2FA = "smsTemplate2FA"; //Optional +var apiResponse = new MultiFactorAuthenticationApi().MFAReAuthenticateByPassword(accessToken, passwordEventBasedAuthModelWithLockout, smsTemplate2FA); +``` + + +<h6 id="MFALoginByEmail-post-">MFA Email Login (POST)</h6> +This API can be used to login by emailid on a Multi-factor authentication enabled LoginRadius site. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/mfa-email-login) + + + +``` + +var email = "email"; //Required +var password = "password"; //Required +var emailTemplate = "emailTemplate"; //Optional +string fields = null; //Optional +var loginUrl = "loginUrl"; //Optional +var smsTemplate = "smsTemplate"; //Optional +var smsTemplate2FA = "smsTemplate2FA"; //Optional +var verificationUrl = "verificationUrl"; //Optional +var apiResponse = new MultiFactorAuthenticationApi().MFALoginByEmail(email, password, emailTemplate, fields, loginUrl, smsTemplate, smsTemplate2FA, verificationUrl); +``` + + +<h6 id="MFALoginByUserName-post-">MFA UserName Login (POST)</h6> +This API can be used to login by username on a Multi-factor authentication enabled LoginRadius site. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/mfa-user-name-login) + + + +``` + +var password = "password"; //Required +var username = "username"; //Required +var emailTemplate = "emailTemplate"; //Optional +string fields = null; //Optional +var loginUrl = "loginUrl"; //Optional +var smsTemplate = "smsTemplate"; //Optional +var smsTemplate2FA = "smsTemplate2FA"; //Optional +var verificationUrl = "verificationUrl"; //Optional +var apiResponse = new MultiFactorAuthenticationApi().MFALoginByUserName(password, username, emailTemplate, fields, loginUrl, smsTemplate, smsTemplate2FA, verificationUrl); +``` + + +<h6 id="MFALoginByPhone-post-">MFA Phone Login (POST)</h6> +This API can be used to login by Phone on a Multi-factor authentication enabled LoginRadius site. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/mfa-phone-login) + + + +``` + +var password = "password"; //Required +var phone = "phone"; //Required +var emailTemplate = "emailTemplate"; //Optional +string fields = null; //Optional +var loginUrl = "loginUrl"; //Optional +var smsTemplate = "smsTemplate"; //Optional +var smsTemplate2FA = "smsTemplate2FA"; //Optional +var verificationUrl = "verificationUrl"; //Optional +var apiResponse = new MultiFactorAuthenticationApi().MFALoginByPhone(password, phone, emailTemplate, fields, loginUrl, smsTemplate, smsTemplate2FA, verificationUrl); +``` + + +<h6 id="MFAConfigureByAccessToken-get-">MFA Validate Access Token (GET)</h6> +This API is used to configure the Multi-factor authentication after login by using the access_token when MFA is set as optional on the LoginRadius site. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/mfa-validate-access-token/) + + + +``` + +var accessToken = "accessToken"; //Required +var smsTemplate2FA = "smsTemplate2FA"; //Optional +var apiResponse = new MultiFactorAuthenticationApi().MFAConfigureByAccessToken(accessToken, smsTemplate2FA); +``` + + +<h6 id="MFABackupCodeByAccessToken-get-">MFA Backup Code by Access Token (GET)</h6> +This API is used to get a set of backup codes via access_token to allow the user login on a site that has Multi-factor Authentication enabled in the event that the user does not have a secondary factor available. We generate 10 codes, each code can only be consumed once. If any user attempts to go over the number of invalid login attempts configured in the Dashboard then the account gets blocked automatically [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/backup-codes/mfa-backup-code-by-access-token/) + + + +``` + +var accessToken = "accessToken"; //Required +var apiResponse = new MultiFactorAuthenticationApi().MFABackupCodeByAccessToken(accessToken); +``` + + +<h6 id="MFAResetBackupCodeByAccessToken-get-">Reset Backup Code by Access Token (GET)</h6> +API is used to reset the backup codes on a given account via the access_token. This API call will generate 10 new codes, each code can only be consumed once [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/backup-codes/mfa-reset-backup-code-by-access-token/) + + + +``` + +var accessToken = "accessToken"; //Required +var apiResponse = new MultiFactorAuthenticationApi().MFAResetBackupCodeByAccessToken(accessToken); +``` + + +<h6 id="MFAResendOTP-get-">MFA Resend Otp (GET)</h6> +This API is used to resending the verification OTP to the provided phone number [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/resend-twofactorauthentication-otp/) + + + +``` + +var secondFactorAuthenticationToken = "secondFactorAuthenticationToken"; //Required +var smsTemplate2FA = "smsTemplate2FA"; //Optional +var apiResponse = new MultiFactorAuthenticationApi().MFAResendOTP(secondFactorAuthenticationToken, smsTemplate2FA); +``` + + +<h6 id="MFAReAuthenticate-get-">Multi Factor Re-Authenticate (GET)</h6> +This API is used to trigger the Multi-Factor Autentication workflow for the provided access_token [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/re-authentication/re-auth-trigger/) + + + +``` + +var accessToken = "accessToken"; //Required +var smsTemplate2FA = "smsTemplate2FA"; //Optional +var apiResponse = new MultiFactorAuthenticationApi().MFAReAuthenticate(accessToken, smsTemplate2FA); +``` + + +<h6 id="MFABackupCodeByUid-get-">MFA Backup Code by UID (GET)</h6> +This API is used to reset the backup codes on a given account via the UID. This API call will generate 10 new codes, each code can only be consumed once. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/backup-codes/mfa-backup-code-by-uid/) + + + +``` + +var uid = "uid"; //Required +var apiResponse = new MultiFactorAuthenticationApi().MFABackupCodeByUid(uid); +``` + + +<h6 id="MFAResetBackupCodeByUid-get-">MFA Reset Backup Code by UID (GET)</h6> +This API is used to reset the backup codes on a given account via the UID. This API call will generate 10 new codes, each code can only be consumed once. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/backup-codes/mfa-reset-backup-code-by-uid/) + + + +``` + +var uid = "uid"; //Required +var apiResponse = new MultiFactorAuthenticationApi().MFAResetBackupCodeByUid(uid); +``` + + +<h6 id="MFAResetGoogleAuthByToken-delete-">MFA Reset Google Authenticator by Token (DELETE)</h6> +This API Resets the Google Authenticator configurations on a given account via the access_token [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/google-authenticator/mfa-reset-google-authenticator-by-token/) + + + +``` + +var accessToken = "accessToken"; //Required +var googleAuthenticator = true; //Required +var apiResponse = new MultiFactorAuthenticationApi().MFAResetGoogleAuthByToken(accessToken, googleAuthenticator); +``` + + +<h6 id="MFAResetSMSAuthByToken-delete-">MFA Reset SMS Authenticator by Token (DELETE)</h6> +This API resets the SMS Authenticator configurations on a given account via the access_token. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/sms-authenticator/mfa-reset-sms-authenticator-by-token/) + + + +``` + +var accessToken = "accessToken"; //Required +var otpAuthenticator = true; //Required +var apiResponse = new MultiFactorAuthenticationApi().MFAResetSMSAuthByToken(accessToken, otpAuthenticator); +``` + + +<h6 id="MFAResetSMSAuthenticatorByUid-delete-">MFA Reset SMS Authenticator By UID (DELETE)</h6> +This API resets the SMS Authenticator configurations on a given account via the UID. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/sms-authenticator/mfa-reset-sms-authenticator-by-uid/) + + + +``` + +var otpAuthenticator = true; //Required +var uid = "uid"; //Required +var apiResponse = new MultiFactorAuthenticationApi().MFAResetSMSAuthenticatorByUid(otpAuthenticator, uid); +``` + + +<h6 id="MFAResetGoogleAuthenticatorByUid-delete-">MFA Reset Google Authenticator By UID (DELETE)</h6> +This API resets the Google Authenticator configurations on a given account via the UID. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/google-authenticator/mfa-reset-google-authenticator-by-uid/) + + + +``` + +var googleAuthenticator = true; //Required +var uid = "uid"; //Required +var apiResponse = new MultiFactorAuthenticationApi().MFAResetGoogleAuthenticatorByUid(googleAuthenticator, uid); +``` + + + + + + + +### SmartLogin API + + +List of APIs in this Section:<br> +[GET : Smart Login Verify Token](#SmartLoginTokenVerification-get-)<br> +[GET : Smart Login By Email](#SmartLoginByEmail-get-)<br> +[GET : Smart Login By Username](#SmartLoginByUserName-get-)<br> +[GET : Smart Login Ping](#SmartLoginPing-get-)<br> + + + +<h6 id="SmartLoginTokenVerification-get-">Smart Login Verify Token (GET)</h6> +This API verifies the provided token for Smart Login [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/smart-login/smart-login-verify-token/) + + + +``` + +var verificationToken = "verificationToken"; //Required +var welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional +var apiResponse = new SmartLoginApi().SmartLoginTokenVerification(verificationToken, welcomeEmailTemplate); +``` + + +<h6 id="SmartLoginByEmail-get-">Smart Login By Email (GET)</h6> +This API sends a Smart Login link to the user's Email Id. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/smart-login/smart-login-by-email) + + + +``` + +var clientGuid = "clientGuid"; //Required +var email = "email"; //Required +var redirectUrl = "redirectUrl"; //Optional +var smartLoginEmailTemplate = "smartLoginEmailTemplate"; //Optional +var welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional +var apiResponse = new SmartLoginApi().SmartLoginByEmail(clientGuid, email, redirectUrl, smartLoginEmailTemplate, welcomeEmailTemplate); +``` + + +<h6 id="SmartLoginByUserName-get-">Smart Login By Username (GET)</h6> +This API sends a Smart Login link to the user's Email Id. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/smart-login/smart-login-by-username) + + + +``` + +var clientGuid = "clientGuid"; //Required +var username = "username"; //Required +var redirectUrl = "redirectUrl"; //Optional +var smartLoginEmailTemplate = "smartLoginEmailTemplate"; //Optional +var welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional +var apiResponse = new SmartLoginApi().SmartLoginByUserName(clientGuid, username, redirectUrl, smartLoginEmailTemplate, welcomeEmailTemplate); +``` + + +<h6 id="SmartLoginPing-get-">Smart Login Ping (GET)</h6> +This API is used to check if the Smart Login link has been clicked or not [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/smart-login/smart-login-ping) + + + +``` + +var clientGuid = "clientGuid"; //Required +string fields = null; //Optional +var apiResponse = new SmartLoginApi().SmartLoginPing(clientGuid, fields); +``` + + + + + + + +### OneTouchLogin API + + +List of APIs in this Section:<br> +[PUT : One Touch OTP Verification](#OneTouchLoginOTPVerification-put-)<br> +[POST : One Touch Login by Email](#OneTouchLoginByEmail-post-)<br> +[POST : One Touch Login by Phone](#OneTouchLoginByPhone-post-)<br> +[GET : One Touch Email Verification](#OneTouchEmailVerification-get-)<br> +[GET : One Touch Login Ping](#OneTouchLoginPing-get-)<br> + + + +<h6 id="OneTouchLoginOTPVerification-put-">One Touch OTP Verification (PUT)</h6> +This API is used to verify the otp for One Touch Login. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/one-touch-login/one-touch-otp-verification/) + + + +``` + +var otp = "otp"; //Required +var phone = "phone"; //Required +string fields = null; //Optional +var smsTemplate = "smsTemplate"; //Optional +var apiResponse = new OneTouchLoginApi().OneTouchLoginOTPVerification(otp, phone, fields, smsTemplate); +``` + + +<h6 id="OneTouchLoginByEmail-post-">One Touch Login by Email (POST)</h6> +This API is used to send a link to a specified email for a frictionless login/registration [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/one-touch-login/one-touch-login-by-email-captcha/) + + + +``` + +OneTouchLoginByEmailModel oneTouchLoginByEmailModel = new OneTouchLoginByEmailModel{ +Clientguid ="<Clientguid>", +Email ="<Email>", +G_recaptcha_response ="<G-recaptcha-response>" +}; //Required +var oneTouchLoginEmailTemplate = "oneTouchLoginEmailTemplate"; //Optional +var redirecturl = "redirecturl"; //Optional +var welcomeemailtemplate = "welcomeemailtemplate"; //Optional +var apiResponse = new OneTouchLoginApi().OneTouchLoginByEmail(oneTouchLoginByEmailModel, oneTouchLoginEmailTemplate, redirecturl, welcomeemailtemplate); +``` + + +<h6 id="OneTouchLoginByPhone-post-">One Touch Login by Phone (POST)</h6> +This API is used to send one time password to a given phone number for a frictionless login/registration. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/one-touch-login/one-touch-login-by-phone-captcha/) + + + +``` + +OneTouchLoginByPhoneModel oneTouchLoginByPhoneModel = new OneTouchLoginByPhoneModel{ +G_recaptcha_response ="<G-recaptcha-response>", +Phone ="<Phone>" +}; //Required +var smsTemplate = "smsTemplate"; //Optional +var apiResponse = new OneTouchLoginApi().OneTouchLoginByPhone(oneTouchLoginByPhoneModel, smsTemplate); +``` + + +<h6 id="OneTouchEmailVerification-get-">One Touch Email Verification (GET)</h6> +This API verifies the provided token for One Touch Login [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/one-touch-login/one-touch-email-verification) + + + +``` + +var verificationToken = "verificationToken"; //Required +var welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional +var apiResponse = new OneTouchLoginApi().OneTouchEmailVerification(verificationToken, welcomeEmailTemplate); +``` + + +<h6 id="OneTouchLoginPing-get-">One Touch Login Ping (GET)</h6> +This API is used to check if the One Touch Login link has been clicked or not. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/one-touch-login/one-touch-login-ping/) + + + +``` + +var clientGuid = "clientGuid"; //Required +string fields = null; //Optional +var apiResponse = new OneTouchLoginApi().OneTouchLoginPing(clientGuid, fields); +``` + + + + + + + +### PasswordLessLogin API + + +List of APIs in this Section:<br> +[PUT : Passwordless Login Phone Verification](#PasswordlessLoginPhoneVerification-put-)<br> +[GET : Passwordless Login by Phone](#PasswordlessLoginByPhone-get-)<br> +[GET : Passwordless Login By Email](#PasswordlessLoginByEmail-get-)<br> +[GET : Passwordless Login By UserName](#PasswordlessLoginByUserName-get-)<br> +[GET : Passwordless Login Verification](#PasswordlessLoginVerification-get-)<br> + + + +<h6 id="PasswordlessLoginPhoneVerification-put-">Passwordless Login Phone Verification (PUT)</h6> +This API verifies an account by OTP and allows the customer to login. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/passwordless-login/passwordless-login-phone-verification) + + + +``` + +PasswordLessLoginOtpModel passwordLessLoginOtpModel = new PasswordLessLoginOtpModel{ +Otp ="<Otp>", +Phone ="<Phone>" +}; //Required +string fields = null; //Optional +var smsTemplate = "smsTemplate"; //Optional +var apiResponse = new PasswordLessLoginApi().PasswordlessLoginPhoneVerification(passwordLessLoginOtpModel, fields, smsTemplate); +``` + + +<h6 id="PasswordlessLoginByPhone-get-">Passwordless Login by Phone (GET)</h6> +API can be used to send a One-time Passcode (OTP) provided that the account has a verified PhoneID [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/passwordless-login/passwordless-login-by-phone) + + + +``` + +var phone = "phone"; //Required +var smsTemplate = "smsTemplate"; //Optional +var apiResponse = new PasswordLessLoginApi().PasswordlessLoginByPhone(phone, smsTemplate); +``` + + +<h6 id="PasswordlessLoginByEmail-get-">Passwordless Login By Email (GET)</h6> +This API is used to send a Passwordless Login verification link to the provided Email ID [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/passwordless-login/passwordless-login-by-email) + + + +``` + +var email = "email"; //Required +var passwordLessLoginTemplate = "passwordLessLoginTemplate"; //Optional +var verificationUrl = "verificationUrl"; //Optional +var apiResponse = new PasswordLessLoginApi().PasswordlessLoginByEmail(email, passwordLessLoginTemplate, verificationUrl); +``` + + +<h6 id="PasswordlessLoginByUserName-get-">Passwordless Login By UserName (GET)</h6> +This API is used to send a Passwordless Login Verification Link to a customer by providing their UserName [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/passwordless-login/passwordless-login-by-username) + + + +``` + +var username = "username"; //Required +var passwordLessLoginTemplate = "passwordLessLoginTemplate"; //Optional +var verificationUrl = "verificationUrl"; //Optional +var apiResponse = new PasswordLessLoginApi().PasswordlessLoginByUserName(username, passwordLessLoginTemplate, verificationUrl); +``` + + +<h6 id="PasswordlessLoginVerification-get-">Passwordless Login Verification (GET)</h6> +This API is used to verify the Passwordless Login verification link. Note: If you are using Passwordless Login by Phone you will need to use the Passwordless Login Phone Verification API [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/passwordless-login/passwordless-login-verification) + + + +``` + +var verificationToken = "verificationToken"; //Required +string fields = null; //Optional +var welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional +var apiResponse = new PasswordLessLoginApi().PasswordlessLoginVerification(verificationToken, fields, welcomeEmailTemplate); +``` + + + + + + + +### Configuration API + + +List of APIs in this Section:<br>[GET : Get Configurations](#getConfigurations-get-)<br> +[GET : Get Server Time](#GetServerInfo-get-)<br> + +<h6 id="getConfigurations-get-">Get Configurations (GET)</h6> +This API is used to get the configurations which are set in the LoginRadius Dashboard for a particular LoginRadius site/environment [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/configuration/get-configurations/) + + + +``` +var apiResponse = new ConfigurationApi().GetConfigurations(); +``` + +<h6 id="GetServerInfo-get-">Get Server Time (GET)</h6> +This API allows you to query your LoginRadius account for basic server information and server time information which is useful when generating an SOTT token. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/configuration/get-server-time/) + + + +``` + +var timeDifference = 0; //Optional +var apiResponse = new ConfigurationApi().GetServerInfo(timeDifference); +``` + + + + + + + +### Role API + + +List of APIs in this Section:<br> +[PUT : Assign Roles by UID](#AssignRolesByUid-put-)<br> +[PUT : Upsert Context](#UpdateRoleContextByUid-put-)<br> +[PUT : Add Permissions to Role](#AddRolePermissions-put-)<br> +[POST : Roles Create](#CreateRoles-post-)<br> +[GET : Roles by UID](#GetRolesByUid-get-)<br> +[GET : Get Context with Roles and Permissions](#GetRoleContextByUid-get-)<br> +[GET : Role Context profile](#GetRoleContextByContextName-get-)<br> +[GET : Roles List](#GetRolesList-get-)<br> +[DELETE : Unassign Roles by UID](#UnassignRolesByUid-delete-)<br> +[DELETE : Delete Role Context](#DeleteRoleContextByUid-delete-)<br> +[DELETE : Delete Role from Context](#DeleteRolesFromRoleContextByUid-delete-)<br> +[DELETE : Delete Additional Permission from Context](#DeleteAdditionalPermissionFromRoleContextByUid-delete-)<br> +[DELETE : Account Delete Role](#DeleteRole-delete-)<br> +[DELETE : Remove Permissions](#RemoveRolePermissions-delete-)<br> + + + +<h6 id="AssignRolesByUid-put-">Assign Roles by UID (PUT)</h6> +This API is used to assign your desired roles to a given user. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/assign-roles-by-uid/) + + + +``` + +AccountRolesModel accountRolesModel = new AccountRolesModel{ +Roles = new List<String>{"Roles"} +}; //Required +var uid = "uid"; //Required +var apiResponse = new RoleApi().AssignRolesByUid(accountRolesModel, uid); +``` + + +<h6 id="UpdateRoleContextByUid-put-">Upsert Context (PUT)</h6> +This API creates a Context with a set of Roles [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/upsert-context) + + + +``` + +AccountRoleContextModel accountRoleContextModel = new AccountRoleContextModel{ +RoleContext = new List<RoleContextRoleModel>{ +new RoleContextRoleModel{ +AdditionalPermissions = new List<String>{"AdditionalPermissions"}, +Context ="<Context>", +Expiration ="<Expiration>", +Roles = new List<String>{"Roles"} +}} +}; //Required +var uid = "uid"; //Required +var apiResponse = new RoleApi().UpdateRoleContextByUid(accountRoleContextModel, uid); +``` + + +<h6 id="AddRolePermissions-put-">Add Permissions to Role (PUT)</h6> +This API is used to add permissions to a given role. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/add-permissions-to-role) + + + +``` + +PermissionsModel permissionsModel = new PermissionsModel{ +Permissions = new List<String>{"Permissions"} +}; //Required +var role = "role"; //Required +var apiResponse = new RoleApi().AddRolePermissions(permissionsModel, role); +``` + + +<h6 id="CreateRoles-post-">Roles Create (POST)</h6> +This API creates a role with permissions. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/roles-create) + + + +``` + +RolesModel rolesModel = new RolesModel{ +Roles = new List<RoleModel>{ +new RoleModel{ +Name ="<Name>", +Permissions = new Dictionary<String,Boolean>{ +["Permission_name"] = true +} +}} +}; //Required +var apiResponse = new RoleApi().CreateRoles(rolesModel); +``` + + +<h6 id="GetRolesByUid-get-">Roles by UID (GET)</h6> +API is used to retrieve all the assigned roles of a particular User. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/get-roles-by-uid) + + + +``` + +var uid = "uid"; //Required +var apiResponse = new RoleApi().GetRolesByUid(uid); +``` + + +<h6 id="GetRoleContextByUid-get-">Get Context with Roles and Permissions (GET)</h6> +This API Gets the contexts that have been configured and the associated roles and permissions. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/get-context) + + + +``` + +var uid = "uid"; //Required +var apiResponse = new RoleApi().GetRoleContextByUid(uid); +``` + + +<h6 id="GetRoleContextByContextName-get-">Role Context profile (GET)</h6> +The API is used to retrieve role context by the context name. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/role-context-profile/) + + + +``` + +var contextName = "contextName"; //Required +var apiResponse = new RoleApi().GetRoleContextByContextName(contextName); +``` + + +<h6 id="GetRolesList-get-">Roles List (GET)</h6> +This API retrieves the complete list of created roles with permissions of your app. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/roles-list) + + + +``` + +var apiResponse = new RoleApi().GetRolesList(); +``` + + +<h6 id="UnassignRolesByUid-delete-">Unassign Roles by UID (DELETE)</h6> +This API is used to unassign roles from a user. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/unassign-roles-by-uid) + + + +``` + +AccountRolesModel accountRolesModel = new AccountRolesModel{ +Roles = new List<String>{"Roles"} +}; //Required +var uid = "uid"; //Required +var apiResponse = new RoleApi().UnassignRolesByUid(accountRolesModel, uid); +``` + + +<h6 id="DeleteRoleContextByUid-delete-">Delete Role Context (DELETE)</h6> +This API Deletes the specified Role Context [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/delete-context) + + + +``` + +var contextName = "contextName"; //Required +var uid = "uid"; //Required +var apiResponse = new RoleApi().DeleteRoleContextByUid(contextName, uid); +``` + + +<h6 id="DeleteRolesFromRoleContextByUid-delete-">Delete Role from Context (DELETE)</h6> +This API Deletes the specified Role from a Context. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/delete-role-from-context/) + + + +``` + +var contextName = "contextName"; //Required +RoleContextRemoveRoleModel roleContextRemoveRoleModel = new RoleContextRemoveRoleModel{ +Roles = new List<String>{"Roles"} +}; //Required +var uid = "uid"; //Required +var apiResponse = new RoleApi().DeleteRolesFromRoleContextByUid(contextName, roleContextRemoveRoleModel, uid); +``` + + +<h6 id="DeleteAdditionalPermissionFromRoleContextByUid-delete-">Delete Additional Permission from Context (DELETE)</h6> +This API Deletes Additional Permissions from Context. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/delete-permissions-from-context) + + + +``` + +var contextName = "contextName"; //Required +RoleContextAdditionalPermissionRemoveRoleModel roleContextAdditionalPermissionRemoveRoleModel = new RoleContextAdditionalPermissionRemoveRoleModel{ +AdditionalPermissions = new List<String>{"AdditionalPermissions"} +}; //Required +var uid = "uid"; //Required +var apiResponse = new RoleApi().DeleteAdditionalPermissionFromRoleContextByUid(contextName, roleContextAdditionalPermissionRemoveRoleModel, uid); +``` + + +<h6 id="DeleteRole-delete-">Account Delete Role (DELETE)</h6> +This API is used to delete the role. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/delete-role) + + + +``` + +var role = "role"; //Required +var apiResponse = new RoleApi().DeleteRole(role); +``` + + +<h6 id="RemoveRolePermissions-delete-">Remove Permissions (DELETE)</h6> +API is used to remove permissions from a role. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/remove-permissions) + + + +``` + +PermissionsModel permissionsModel = new PermissionsModel{ +Permissions = new List<String>{"Permissions"} +}; //Required +var role = "role"; //Required +var apiResponse = new RoleApi().RemoveRolePermissions(permissionsModel, role); +``` + + + + + + + +### CustomRegistrationData API + + +List of APIs in this Section:<br> +[PUT : Update Registration Data](#UpdateRegistrationData-put-)<br> +[POST : Validate secret code](#ValidateRegistrationDataCode-post-)<br> +[POST : Add Registration Data](#AddRegistrationData-post-)<br> +[GET : Auth Get Registration Data Server](#AuthGetRegistrationData-get-)<br> +[GET : Get Registration Data](#GetRegistrationData-get-)<br> +[DELETE : Delete Registration Data](#DeleteRegistrationData-delete-)<br> +[DELETE : Delete All Records by Datasource](#DeleteAllRecordsByDataSource-delete-)<br> + + + +<h6 id="UpdateRegistrationData-put-">Update Registration Data (PUT)</h6> +This API allows you to update a dropdown item [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-registration-data/update-registration-data) + + + +``` + +RegistrationDataUpdateModel registrationDataUpdateModel = new RegistrationDataUpdateModel{ +IsActive = true, +Key ="<Key>", +Type ="<Type>", +Value ="<Value>" +}; //Required +var recordId = "recordId"; //Required +var apiResponse = new CustomRegistrationDataApi().UpdateRegistrationData(registrationDataUpdateModel, recordId); +``` + + +<h6 id="ValidateRegistrationDataCode-post-">Validate secret code (POST)</h6> +This API allows you to validate code for a particular dropdown member. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-registration-data/validate-code) + + + +``` + +var code = "code"; //Required +var recordId = "recordId"; //Required +var apiResponse = new CustomRegistrationDataApi().ValidateRegistrationDataCode(code, recordId); +``` + + +<h6 id="AddRegistrationData-post-">Add Registration Data (POST)</h6> +This API allows you to fill data into a dropdown list which you have created for user Registeration. For more details on how to use this API please see our Custom Registration Data Overview [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-registration-data/add-registration-data) + + + +``` + +RegistrationDataCreateModelList registrationDataCreateModelList = new RegistrationDataCreateModelList{ +Data = new List<RegistrationDataCreateModel>{ +new RegistrationDataCreateModel{ +Code ="<Code>", +IsActive = true, +Key ="<Key>", +ParentId ="<ParentId>", +Type ="<Type>", +Value ="<Value>" +}} +}; //Required +var apiResponse = new CustomRegistrationDataApi().AddRegistrationData(registrationDataCreateModelList); +``` + + +<h6 id="AuthGetRegistrationData-get-">Auth Get Registration Data Server (GET)</h6> +This API is used to retrieve dropdown data. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-registration-data/auth-get-registration-data) + + + +``` + +var type = "type"; //Required +var limit = 0; //Optional +var parentId = "parentId"; //Optional +var skip = 0; //Optional +var apiResponse = new CustomRegistrationDataApi().AuthGetRegistrationData(type, limit, parentId, skip); +``` + + +<h6 id="GetRegistrationData-get-">Get Registration Data (GET)</h6> +This API is used to retrieve dropdown data. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-registration-data/get-registration-data) + + + +``` + +var type = "type"; //Required +var limit = 0; //Optional +var parentId = "parentId"; //Optional +var skip = 0; //Optional +var apiResponse = new CustomRegistrationDataApi().GetRegistrationData(type, limit, parentId, skip); +``` + + +<h6 id="DeleteRegistrationData-delete-">Delete Registration Data (DELETE)</h6> +This API allows you to delete an item from a dropdown list. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-registration-data/delete-registration-data) + + + +``` + +var recordId = "recordId"; //Required +var apiResponse = new CustomRegistrationDataApi().DeleteRegistrationData(recordId); +``` + + +<h6 id="DeleteAllRecordsByDataSource-delete-">Delete All Records by Datasource (DELETE)</h6> +This API allows you to delete all records contained in a datasource. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-registration-data/delete-all-records-by-datasource) + + + +``` + +var type = "type"; //Required +var apiResponse = new CustomRegistrationDataApi().DeleteAllRecordsByDataSource(type); +``` + + + + + + + +### RiskBasedAuthentication API + + +List of APIs in this Section:<br> +[POST : Risk Based Authentication Login by Email](#RBALoginByEmail-post-)<br> +[POST : Risk Based Authentication Login by Username](#RBALoginByUserName-post-)<br> +[POST : Risk Based Authentication Phone Login](#RBALoginByPhone-post-)<br> + + + +<h6 id="RBALoginByEmail-post-">Risk Based Authentication Login by Email (POST)</h6> +This API retrieves a copy of the user data based on the Email [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-login-by-email) + + + +``` + +EmailAuthenticationModel emailAuthenticationModel = new EmailAuthenticationModel{ +Email ="<Email>", +Password ="<Password>" +}; //Required +var emailTemplate = "emailTemplate"; //Optional +string fields = null; //Optional +var loginUrl = "loginUrl"; //Optional +var passwordDelegation = true; //Optional +var passwordDelegationApp = "passwordDelegationApp"; //Optional +var rbaBrowserEmailTemplate = "rbaBrowserEmailTemplate"; //Optional +var rbaBrowserSmsTemplate = "rbaBrowserSmsTemplate"; //Optional +var rbaCityEmailTemplate = "rbaCityEmailTemplate"; //Optional +var rbaCitySmsTemplate = "rbaCitySmsTemplate"; //Optional +var rbaCountryEmailTemplate = "rbaCountryEmailTemplate"; //Optional +var rbaCountrySmsTemplate = "rbaCountrySmsTemplate"; //Optional +var rbaIpEmailTemplate = "rbaIpEmailTemplate"; //Optional +var rbaIpSmsTemplate = "rbaIpSmsTemplate"; //Optional +var rbaOneclickEmailTemplate = "rbaOneclickEmailTemplate"; //Optional +var rbaOTPSmsTemplate = "rbaOTPSmsTemplate"; //Optional +var smsTemplate = "smsTemplate"; //Optional +var verificationUrl = "verificationUrl"; //Optional +var apiResponse = new RiskBasedAuthenticationApi().RBALoginByEmail(emailAuthenticationModel, emailTemplate, fields, loginUrl, passwordDelegation, passwordDelegationApp, rbaBrowserEmailTemplate, rbaBrowserSmsTemplate, rbaCityEmailTemplate, rbaCitySmsTemplate, rbaCountryEmailTemplate, rbaCountrySmsTemplate, rbaIpEmailTemplate, rbaIpSmsTemplate, rbaOneclickEmailTemplate, rbaOTPSmsTemplate, smsTemplate, verificationUrl); +``` + + +<h6 id="RBALoginByUserName-post-">Risk Based Authentication Login by Username (POST)</h6> +This API retrieves a copy of the user data based on the Username [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-login-by-username) + + + +``` + +UserNameAuthenticationModel userNameAuthenticationModel = new UserNameAuthenticationModel{ +Password ="<Password>", +Username ="<Username>" +}; //Required +var emailTemplate = "emailTemplate"; //Optional +string fields = null; //Optional +var loginUrl = "loginUrl"; //Optional +var passwordDelegation = true; //Optional +var passwordDelegationApp = "passwordDelegationApp"; //Optional +var rbaBrowserEmailTemplate = "rbaBrowserEmailTemplate"; //Optional +var rbaBrowserSmsTemplate = "rbaBrowserSmsTemplate"; //Optional +var rbaCityEmailTemplate = "rbaCityEmailTemplate"; //Optional +var rbaCitySmsTemplate = "rbaCitySmsTemplate"; //Optional +var rbaCountryEmailTemplate = "rbaCountryEmailTemplate"; //Optional +var rbaCountrySmsTemplate = "rbaCountrySmsTemplate"; //Optional +var rbaIpEmailTemplate = "rbaIpEmailTemplate"; //Optional +var rbaIpSmsTemplate = "rbaIpSmsTemplate"; //Optional +var rbaOneclickEmailTemplate = "rbaOneclickEmailTemplate"; //Optional +var rbaOTPSmsTemplate = "rbaOTPSmsTemplate"; //Optional +var smsTemplate = "smsTemplate"; //Optional +var verificationUrl = "verificationUrl"; //Optional +var apiResponse = new RiskBasedAuthenticationApi().RBALoginByUserName(userNameAuthenticationModel, emailTemplate, fields, loginUrl, passwordDelegation, passwordDelegationApp, rbaBrowserEmailTemplate, rbaBrowserSmsTemplate, rbaCityEmailTemplate, rbaCitySmsTemplate, rbaCountryEmailTemplate, rbaCountrySmsTemplate, rbaIpEmailTemplate, rbaIpSmsTemplate, rbaOneclickEmailTemplate, rbaOTPSmsTemplate, smsTemplate, verificationUrl); +``` + + +<h6 id="RBALoginByPhone-post-">Risk Based Authentication Phone Login (POST)</h6> +This API retrieves a copy of the user data based on the Phone [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-login) + + + +``` + +PhoneAuthenticationModel phoneAuthenticationModel = new PhoneAuthenticationModel{ +Password ="<Password>", +Phone ="<Phone>" +}; //Required +var emailTemplate = "emailTemplate"; //Optional +string fields = null; //Optional +var loginUrl = "loginUrl"; //Optional +var passwordDelegation = true; //Optional +var passwordDelegationApp = "passwordDelegationApp"; //Optional +var rbaBrowserEmailTemplate = "rbaBrowserEmailTemplate"; //Optional +var rbaBrowserSmsTemplate = "rbaBrowserSmsTemplate"; //Optional +var rbaCityEmailTemplate = "rbaCityEmailTemplate"; //Optional +var rbaCitySmsTemplate = "rbaCitySmsTemplate"; //Optional +var rbaCountryEmailTemplate = "rbaCountryEmailTemplate"; //Optional +var rbaCountrySmsTemplate = "rbaCountrySmsTemplate"; //Optional +var rbaIpEmailTemplate = "rbaIpEmailTemplate"; //Optional +var rbaIpSmsTemplate = "rbaIpSmsTemplate"; //Optional +var rbaOneclickEmailTemplate = "rbaOneclickEmailTemplate"; //Optional +var rbaOTPSmsTemplate = "rbaOTPSmsTemplate"; //Optional +var smsTemplate = "smsTemplate"; //Optional +var verificationUrl = "verificationUrl"; //Optional +var apiResponse = new RiskBasedAuthenticationApi().RBALoginByPhone(phoneAuthenticationModel, emailTemplate, fields, loginUrl, passwordDelegation, passwordDelegationApp, rbaBrowserEmailTemplate, rbaBrowserSmsTemplate, rbaCityEmailTemplate, rbaCitySmsTemplate, rbaCountryEmailTemplate, rbaCountrySmsTemplate, rbaIpEmailTemplate, rbaIpSmsTemplate, rbaOneclickEmailTemplate, rbaOTPSmsTemplate, smsTemplate, verificationUrl); +``` + + + + + + + +### Sott API + + +List of APIs in this Section:<br> +[GET : Generate SOTT](#GenerateSott-get-)<br> + + + +<h6 id="GenerateSott-get-">Generate SOTT (GET)</h6> +This API allows you to generate SOTT with a given expiration time. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/session/generate-sott-token) + + + +``` + +var timeDifference = 0; //Optional +var apiResponse = new SottApi().GenerateSott(timeDifference); +``` + + + + + + + +### NativeSocial API + + +List of APIs in this Section:<br> +[GET : Access Token via Facebook Token](#GetAccessTokenByFacebookAccessToken-get-)<br> +[GET : Access Token via Twitter Token](#GetAccessTokenByTwitterAccessToken-get-)<br> +[GET : Access Token via Google Token](#GetAccessTokenByGoogleAccessToken-get-)<br> +[GET : LoginRadius Access Token using google JWT token for Native Mobile Login](#GetAccessTokenByGoogleJWTAccessToken-get-)<br> +[GET : Access Token via Linkedin Token](#GetAccessTokenByLinkedinAccessToken-get-)<br> +[GET : Get Access Token By Foursquare Access Token](#GetAccessTokenByFoursquareAccessToken-get-)<br> +[GET : Access Token via Vkontakte Token](#GetAccessTokenByVkontakteAccessToken-get-)<br> +[GET : Access Token via Google AuthCode](#GetAccessTokenByGoogleAuthCode-get-)<br> + + + +<h6 id="GetAccessTokenByFacebookAccessToken-get-">Access Token via Facebook Token (GET)</h6> +The API is used to get LoginRadius access token by sending Facebook’s access token. It will be valid for the specific duration of time specified in the response. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-facebook-token/) + + + +``` + +var fbAccessToken = "fbAccessToken"; //Required +var apiResponse = new NativeSocialApi().GetAccessTokenByFacebookAccessToken(fbAccessToken); +``` + + +<h6 id="GetAccessTokenByTwitterAccessToken-get-">Access Token via Twitter Token (GET)</h6> +The API is used to get LoginRadius access token by sending Twitter’s access token. It will be valid for the specific duration of time specified in the response. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-twitter-token) + + + +``` + +var twAccessToken = "twAccessToken"; //Required +var twTokenSecret = "twTokenSecret"; //Required +var apiResponse = new NativeSocialApi().GetAccessTokenByTwitterAccessToken(twAccessToken, twTokenSecret); +``` + + +<h6 id="GetAccessTokenByGoogleAccessToken-get-">Access Token via Google Token (GET)</h6> +The API is used to get LoginRadius access token by sending Google’s access token. It will be valid for the specific duration of time specified in the response. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-google-token) + + + +``` + +var googleAccessToken = "googleAccessToken"; //Required +var clientId = "clientId"; //Optional +var refreshToken = "refreshToken"; //Optional +var apiResponse = new NativeSocialApi().GetAccessTokenByGoogleAccessToken(googleAccessToken, clientId, refreshToken); +``` + + +<h6 id="GetAccessTokenByGoogleJWTAccessToken-get-">LoginRadius Access Token using google JWT token for Native Mobile Login (GET)</h6> +This API is used to Get LoginRadius Access Token using google jwt id token for google native mobile login/registration. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-googlejwt) + + + +``` + +var idToken = "idToken"; //Required +var apiResponse = new NativeSocialApi().GetAccessTokenByGoogleJWTAccessToken(idToken); +``` + + +<h6 id="GetAccessTokenByLinkedinAccessToken-get-">Access Token via Linkedin Token (GET)</h6> +The API is used to get LoginRadius access token by sending Linkedin’s access token. It will be valid for the specific duration of time specified in the response. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-linkedin-token/) + + + +``` + +var lnAccessToken = "lnAccessToken"; //Required +var apiResponse = new NativeSocialApi().GetAccessTokenByLinkedinAccessToken(lnAccessToken); +``` + + +<h6 id="GetAccessTokenByFoursquareAccessToken-get-">Get Access Token By Foursquare Access Token (GET)</h6> +The API is used to get LoginRadius access token by sending Foursquare’s access token. It will be valid for the specific duration of time specified in the response. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-foursquare-token/) + + + +``` + +var fsAccessToken = "fsAccessToken"; //Required +var apiResponse = new NativeSocialApi().GetAccessTokenByFoursquareAccessToken(fsAccessToken); +``` + + +<h6 id="GetAccessTokenByVkontakteAccessToken-get-">Access Token via Vkontakte Token (GET)</h6> +The API is used to get LoginRadius access token by sending Vkontakte’s access token. It will be valid for the specific duration of time specified in the response. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-vkontakte-token) + + + +``` + +var vkAccessToken = "vkAccessToken"; //Required +var apiResponse = new NativeSocialApi().GetAccessTokenByVkontakteAccessToken(vkAccessToken); +``` + + +<h6 id="GetAccessTokenByGoogleAuthCode-get-">Access Token via Google AuthCode (GET)</h6> +The API is used to get LoginRadius access token by sending Google’s AuthCode. It will be valid for the specific duration of time specified in the response. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-google-auth-code) + + + +``` + +var googleAuthcode = "googleAuthcode"; //Required +var apiResponse = new NativeSocialApi().GetAccessTokenByGoogleAuthCode(googleAuthcode); +``` + + + + + + + +### WebHook API + + +List of APIs in this Section:<br> +[POST : Webhook Subscribe](#WebHookSubscribe-post-)<br> +[GET : Webhook Subscribed URLs](#GetWebHookSubscribedURLs-get-)<br> +[GET : Webhook Test](#WebhookTest-get-)<br> +[DELETE : WebHook Unsubscribe](#WebHookUnsubscribe-delete-)<br> + + + +<h6 id="WebHookSubscribe-post-">Webhook Subscribe (POST)</h6> +API can be used to configure a WebHook on your LoginRadius site. Webhooks also work on subscribe and notification model, subscribe your hook and get a notification. Equivalent to RESThook but these provide security on basis of signature and RESThook work on unique URL. Following are the events that are allowed by LoginRadius to trigger a WebHook service call. [More Info](https://www.loginradius.com/docs/api/v2/integrations/webhooks/webhook-subscribe) + + + +``` + +WebHookSubscribeModel webHookSubscribeModel = new WebHookSubscribeModel{ +Event ="<Event>", +TargetUrl ="<TargetUrl>" +}; //Required +var apiResponse = new WebHookApi().WebHookSubscribe(webHookSubscribeModel); +``` + + +<h6 id="GetWebHookSubscribedURLs-get-">Webhook Subscribed URLs (GET)</h6> +This API is used to fatch all the subscribed URLs, for particular event [More Info](https://www.loginradius.com/docs/api/v2/integrations/webhooks/webhook-subscribed-urls) + + + +``` + +var @event = "@event"; //Required +var apiResponse = new WebHookApi().GetWebHookSubscribedURLs(@event); +``` + + +<h6 id="WebhookTest-get-">Webhook Test (GET)</h6> +API can be used to test a subscribed WebHook. [More Info](https://www.loginradius.com/docs/api/v2/integrations/webhooks/webhook-test) + + + +``` + +var apiResponse = new WebHookApi().WebhookTest(); +``` + + +<h6 id="WebHookUnsubscribe-delete-">WebHook Unsubscribe (DELETE)</h6> +API can be used to unsubscribe a WebHook configured on your LoginRadius site. [More Info](https://www.loginradius.com/docs/api/v2/integrations/webhooks/webhook-unsubscribe) + + + +``` + +WebHookSubscribeModel webHookSubscribeModel = new WebHookSubscribeModel{ +Event ="<Event>", +TargetUrl ="<TargetUrl>" +}; //Required +var apiResponse = new WebHookApi().WebHookUnsubscribe(webHookSubscribeModel); +``` + + + + + + + +## Demo +We have configured a sample ASP.net project with extended social profile data, webhook Apis, Account APis. You can get a copy of our demo project at [GitHub](https://github.com/LoginRadius/dot-net-sdk/tree/master/Samples/dot-net-demo). -* Everything you need begin using this SDK: [LoginRadius Developer documentation](https://www.loginradius.com/docs/api/v2/deployment/sdk-libraries/asp-net-library) \ No newline at end of file diff --git a/Samples/dot-net-demo/dot-net-demo/Controllers/HomeController.cs b/Samples/dot-net-demo/dot-net-demo/Controllers/HomeController.cs index 8eea349..7bde963 100644 --- a/Samples/dot-net-demo/dot-net-demo/Controllers/HomeController.cs +++ b/Samples/dot-net-demo/dot-net-demo/Controllers/HomeController.cs @@ -2,22 +2,18 @@ using System.Diagnostics; using Microsoft.AspNetCore.Mvc; using dot_net_demo.Models; -using LoginRadiusSDK.V2.Api; -using LoginRadiusSDK.V2.Models; -using LoginRadiusSDK.V2.Models.CustomerAuthentication.Login; -using LoginRadiusSDK.V2.Models.Password; -using LoginRadiusSDK.V2.Models.UserProfile; -using LoginRadiusSDK.V2.Models.CustomerAuthentication._2FA; -using LoginRadiusSDK.V2; + +using LoginRadiusSDK.V2.Api.Advanced; +using LoginRadiusSDK.V2.Api.Authentication; +using LoginRadiusSDK.V2.Models.RequestModels; + +using LoginRadiusSDK.V2.Common; +using LoginRadiusSDK.V2.Api.Account; namespace dot_net_demo.Controllers { public class HomeController : Controller { - LoginRadiusApiOptionalParams _apiOptionalParams = new LoginRadiusApiOptionalParams(); - - - public IActionResult Index() { return View(); @@ -46,13 +42,15 @@ public IActionResult Profile() [HttpPost] public IActionResult LRLogin([FromBody] EmailLoginModel emailLoginModel) { - Debug.WriteLine(BaseConstants.RestAuthApiEndpoint); - Debug.WriteLine(LoginRadiusSdkGlobalConfig.DomainName); - _apiOptionalParams.VerificationUrl = ""; - _apiOptionalParams.G_Recaptcha_Response = ""; + string fields = null; + EmailAuthenticationModel log = new EmailAuthenticationModel + { + Email = emailLoginModel.Email, + Password = emailLoginModel.Password + }; + var apiresponse = new AuthenticationApi().LoginByEmail(log, fields); - var apiresponse = new AuthenticationApi().LoginByEmail(emailLoginModel.ConvertToJson(), _apiOptionalParams); - if(apiresponse.RestException != null) + if (apiresponse.RestException != null) { return StatusCode(400, Json(apiresponse.RestException)); } @@ -61,8 +59,7 @@ public IActionResult LRLogin([FromBody] EmailLoginModel emailLoginModel) public IActionResult LRMfaLogin([FromBody] EmailLoginModel emailLoginModel) { - _apiOptionalParams.SmsTemplate = ""; - var apiresponse = new MultifactorApi().MultifactorAuthLoginByEmail(emailLoginModel.email, emailLoginModel.password, _apiOptionalParams); + var apiresponse = new MultiFactorAuthenticationApi().MFALoginByEmail(emailLoginModel.Email, emailLoginModel.Password); if (apiresponse.RestException != null) { return StatusCode(400, Json(apiresponse.RestException)); @@ -72,7 +69,7 @@ public IActionResult LRMfaLogin([FromBody] EmailLoginModel emailLoginModel) public IActionResult LRMfaAuth([FromBody] GoogleAuthenticatorModel googleAuth, [FromQuery(Name = "multi_factor_auth_token")] String secondFactorAuthToken) { - var apiresponse = new MultifactorApi().ValidateGoogleAuthCode(secondFactorAuthToken, googleAuth.googleauthenticatorcode, ""); + var apiresponse = new MultiFactorAuthenticationApi().MFAValidateGoogleAuthCode(googleAuth.googleauthenticatorcode, secondFactorAuthToken); if (apiresponse.RestException != null) { return StatusCode(400, Json(apiresponse.RestException)); @@ -82,7 +79,7 @@ public IActionResult LRMfaAuth([FromBody] GoogleAuthenticatorModel googleAuth, [ public IActionResult LRPwlessLogin([FromQuery(Name = "email")] String email, [FromQuery(Name = "verification_url")] String verificationUrl) { - var apiresponse = new PasswordlessLoginApi().PasswordlessLoginByEmail(email, "", verificationUrl); + var apiresponse = new PasswordLessLoginApi().PasswordlessLoginByEmail(email, "", verificationUrl); if (apiresponse.RestException != null) { return StatusCode(400, Json(apiresponse.RestException)); @@ -92,7 +89,8 @@ public IActionResult LRPwlessLogin([FromQuery(Name = "email")] String email, [Fr public IActionResult LRPwlessAuth([FromQuery(Name = "verification_token")] String verificationToken) { - var apiresponse = new PasswordlessLoginApi().PasswordlessLoginVerification(verificationToken, ""); + var apiresponse = new PasswordLessLoginApi().PasswordlessLoginVerification(verificationToken); + if (apiresponse.RestException != null) { return StatusCode(400, Json(apiresponse.RestException)); @@ -100,18 +98,15 @@ public IActionResult LRPwlessAuth([FromQuery(Name = "verification_token")] Strin return Json(apiresponse.Response); } - public IActionResult LRRegister([FromBody] UserIdentityCreateModel identityCreateModel, [FromQuery(Name = "verification_url")] String verificationUrl) + public IActionResult LRRegister([FromBody] AuthUserRegistrationModel identityCreateModel, [FromQuery(Name = "verification_url")] String verificationUrl) { - _apiOptionalParams.SmsTemplate = ""; - _apiOptionalParams.EmailTemplate = ""; - _apiOptionalParams.VerificationUrl = verificationUrl; - + LoginRadiusSecureOneTimeToken _sott = new LoginRadiusSecureOneTimeToken(); var sott = new SottRequest { TimeDifference = "50" }; - - var apiresponse = new AuthenticationApi().RegisterCustomer(identityCreateModel, _apiOptionalParams, sott); + var apiresponse = new AuthenticationApi().UserRegistrationByEmail(identityCreateModel, _sott.GetSott(sott), null,null, verificationUrl,null); + if (apiresponse.RestException != null) { return StatusCode(400, Json(apiresponse.RestException)); @@ -122,6 +117,7 @@ public IActionResult LRRegister([FromBody] UserIdentityCreateModel identityCreat public IActionResult LRVerifyEmail([FromQuery(Name = "verification_token")] String verificationToken) { var apiresponse = new AuthenticationApi().VerifyEmail(verificationToken, "google.ca", ""); + if (apiresponse.RestException != null) { return StatusCode(400, Json(apiresponse.RestException)); @@ -132,6 +128,7 @@ public IActionResult LRVerifyEmail([FromQuery(Name = "verification_token")] Stri public IActionResult LRForgotPassword([FromBody] ForgotPasswordModel forgotPassModel, [FromQuery(Name = "reset_password_url")] String resetPasswordUrl) { var apiresponse = new AuthenticationApi().ForgotPassword(forgotPassModel.Email, resetPasswordUrl, ""); + if (apiresponse.RestException != null) { return StatusCode(400, Json(apiresponse.RestException)); @@ -141,7 +138,13 @@ public IActionResult LRForgotPassword([FromBody] ForgotPasswordModel forgotPassM public IActionResult LRResetPasswordEmail([FromBody] ResetPasswordModel resetPasswordModel) { - var apiresponse = new AuthenticationApi().ResetPassword(resetPasswordModel); + ResetPasswordByResetTokenModel reset = new ResetPasswordByResetTokenModel + { + Password = resetPasswordModel.password, + ResetToken = resetPasswordModel.resettoken + }; + var apiresponse = new AuthenticationApi().ResetPasswordByResetToken(reset); + if (apiresponse.RestException != null) { return StatusCode(400, Json(apiresponse.RestException)); @@ -151,7 +154,8 @@ public IActionResult LRResetPasswordEmail([FromBody] ResetPasswordModel resetPas public IActionResult LRChangePassword([FromBody] ChangePasswordModel changePasswordModel, [FromQuery(Name = "auth")] String accessToken) { - var apiresponse = new AuthenticationApi().ChangePassword(accessToken, changePasswordModel); + var apiresponse = new AuthenticationApi().ChangePassword(accessToken, changePasswordModel.newPassword, changePasswordModel.oldPassword); + if (apiresponse.RestException != null) { return StatusCode(400, Json(apiresponse.RestException)); @@ -161,17 +165,17 @@ public IActionResult LRChangePassword([FromBody] ChangePasswordModel changePassw public IActionResult LRSetPassword([FromBody] SetPasswordModel setPasswordModel, [FromQuery(Name = "uid")] String uid) { - var apiresponse = new AccountApi().SetAccountPassword(uid, setPasswordModel.Password); - if (apiresponse.RestException != null) - { - return StatusCode(400, Json(apiresponse.RestException)); - } - return Json(apiresponse.Response); + var apiresponse = new AccountApi().SetAccountPasswordByUid(setPasswordModel.Password, uid); + if (apiresponse.RestException != null) + { + return StatusCode(400, Json(apiresponse.RestException)); + } + return Json(apiresponse.Response); } - public IActionResult LRUpdate([FromBody] LoginRadiusAccountUpdateModel updateModel, [FromQuery(Name = "uid")] String uid) + public IActionResult LRUpdate([FromBody] AccountUserProfileUpdateModel updateModel, [FromQuery(Name = "uid")] String uid) { - var apiresponse = new AccountApi().UpdateAccount(uid, updateModel); + var apiresponse = new AccountApi().UpdateAccountByUid(updateModel, uid); if (apiresponse.RestException != null) { return StatusCode(400, Json(apiresponse.RestException)); @@ -181,8 +185,7 @@ public IActionResult LRUpdate([FromBody] LoginRadiusAccountUpdateModel updateMod public IActionResult LRCreateCustomObject([FromBody] dynamic customObject, [FromQuery(Name = "auth")] String accessToken, [FromQuery(Name = "object_name")] String objectName) { - var CustomObject = Newtonsoft.Json.JsonConvert.SerializeObject(customObject); - var apiresponse = new CustomObjectApi().CreateCustomObjectByToken(accessToken, objectName, CustomObject); + var apiresponse = new CustomObjectApi().CreateCustomObjectByToken(accessToken, objectName, customObject); if (apiresponse.RestException != null) { return StatusCode(400, Json(apiresponse.RestException)); @@ -190,11 +193,11 @@ public IActionResult LRCreateCustomObject([FromBody] dynamic customObject, [From return Json(apiresponse.Response); } - public IActionResult LRUpdateCustomObject([FromBody] dynamic customObject, [FromQuery(Name = "auth")] String accessToken, [FromQuery(Name = "object_name")] String objectName, - [FromQuery(Name = "object_id")] String objectId) + public IActionResult LRUpdateCustomObject([FromBody] dynamic customObject, [FromQuery(Name = "auth")] String accessToken, [FromQuery(Name = "object_name")] String objectName, [FromQuery(Name = "object_id")] String objectId) { - var CustomObject = Newtonsoft.Json.JsonConvert.SerializeObject(customObject); - var apiresponse = new CustomObjectApi().UpdateByObjectRecordIdAndAccessToken(accessToken, objectId, objectName, CustomObject, fullReplace: true); + + var apiresponse = new CustomObjectApi().UpdateCustomObjectByToken(accessToken, objectName, objectId, customObject); + if (apiresponse.RestException != null) { return StatusCode(400, Json(apiresponse.RestException)); @@ -204,7 +207,8 @@ public IActionResult LRUpdateCustomObject([FromBody] dynamic customObject, [From public IActionResult LRDeleteCustomObject([FromQuery(Name = "auth")] String accessToken, [FromQuery(Name = "object_name")] String objectName, [FromQuery(Name = "object_id")] String objectId) { - var apiresponse = new CustomObjectApi().DeleteByRecordIdAndToken(accessToken, objectId, objectName); + var apiresponse = new CustomObjectApi().DeleteCustomObjectByToken(accessToken, objectName, objectId); + if (apiresponse.RestException != null) { return StatusCode(400, Json(apiresponse.RestException)); @@ -214,7 +218,7 @@ public IActionResult LRDeleteCustomObject([FromQuery(Name = "auth")] String acce public IActionResult LRGetCustomObject([FromQuery(Name = "auth")] String accessToken, [FromQuery(Name = "object_name")] String objectName) { - var apiresponse = new CustomObjectApi().GetByAccessToken(accessToken, objectName); + var apiresponse = new CustomObjectApi().GetCustomObjectByToken(accessToken, objectName); if (apiresponse.RestException != null) { return StatusCode(400, Json(apiresponse.RestException)); @@ -224,9 +228,7 @@ public IActionResult LRGetCustomObject([FromQuery(Name = "auth")] String accessT public IActionResult LRMfaResetGoogle([FromQuery(Name = "auth")] String accessToken) { - RemoveOrResetMultifactorAuthentication obj = new RemoveOrResetMultifactorAuthentication(); - obj.googleauthenticator = true; - var apiresponse = new MultifactorApi().RemoveOrResetMultifactorByAccessToken(obj, accessToken); + var apiresponse = new MultiFactorAuthenticationApi().MFAResetGoogleAuthByToken(accessToken, true); if (apiresponse.RestException != null) { return StatusCode(400, Json(apiresponse.RestException)); @@ -236,18 +238,17 @@ public IActionResult LRMfaResetGoogle([FromQuery(Name = "auth")] String accessTo public IActionResult LRMfaValidate([FromQuery(Name = "auth")] String accessToken) { - _apiOptionalParams.SmsTemplate = ""; - var apiresponse = new MultifactorApi().GetMultifactorAccessToken(accessToken, _apiOptionalParams); + var apiresponse = new MultiFactorAuthenticationApi().MFAConfigureByAccessToken(accessToken); if (apiresponse.RestException != null) { return StatusCode(400, Json(apiresponse.RestException)); } return Json(apiresponse.Response); } - + public IActionResult LRMfaEnableGoogle([FromBody] GoogleAuthenticatorModel googleAuthenticatorCode, [FromQuery(Name = "auth")] String accessToken) { - var apiresponse = new MultifactorApi().ValidateGoogleAuthCode(accessToken, googleAuthenticatorCode.googleauthenticatorcode); + var apiresponse = new MultiFactorAuthenticationApi().MFAValidateGoogleAuthCode(accessToken, googleAuthenticatorCode.googleauthenticatorcode); if (apiresponse.RestException != null) { return StatusCode(400, Json(apiresponse.RestException)); @@ -257,7 +258,7 @@ public IActionResult LRMfaEnableGoogle([FromBody] GoogleAuthenticatorModel googl public IActionResult LRGetRoles() { - var apiresponse = new RolesApi().GetRoles(); + var apiresponse = new RoleApi().GetRolesList(); if (apiresponse.RestException != null) { return StatusCode(400, Json(apiresponse.RestException)); @@ -267,7 +268,7 @@ public IActionResult LRGetRoles() public IActionResult LRGetRole([FromQuery(Name = "uid")] String uid) { - var apiresponse = new RolesApi().GetAccountRole(uid); + var apiresponse = new RoleApi().GetRolesByUid(uid); if (apiresponse.RestException != null) { return StatusCode(400, Json(apiresponse.RestException)); @@ -275,9 +276,10 @@ public IActionResult LRGetRole([FromQuery(Name = "uid")] String uid) return Json(apiresponse.Response); } - public IActionResult LRCreateRole([FromBody] LoginRadiusRolesCreate rolePermissions) + public IActionResult LRCreateRole([FromBody] RolesModel rolePermissions) { - var apiresponse = new RolesApi().CreateRoles(rolePermissions); + var apiresponse = new RoleApi().CreateRoles(rolePermissions); + if (apiresponse.RestException != null) { return StatusCode(400, Json(apiresponse.RestException)); @@ -287,7 +289,7 @@ public IActionResult LRCreateRole([FromBody] LoginRadiusRolesCreate rolePermissi public IActionResult LRDeleteRole([FromQuery(Name = "role")] String roleName) { - var apiresponse = new RolesApi().DeleteRole(roleName); + var apiresponse = new RoleApi().DeleteRole(roleName); if (apiresponse.RestException != null) { return StatusCode(400, Json(apiresponse.RestException)); @@ -295,9 +297,9 @@ public IActionResult LRDeleteRole([FromQuery(Name = "role")] String roleName) return Json(apiresponse.Response); } - public IActionResult LRAssignRole([FromQuery(Name = "uid")] String uid, [FromBody] LoginRadiusAccountRolesUpsert roles) + public IActionResult LRAssignRole([FromQuery(Name = "uid")] String uid, [FromBody] AccountRolesModel roles) { - var apiresponse = new RolesApi().RolesAssignToUser(uid, roles); + var apiresponse = new RoleApi().AssignRolesByUid(roles, uid); if (apiresponse.RestException != null) { return StatusCode(400, Json(apiresponse.RestException)); @@ -307,7 +309,7 @@ public IActionResult LRAssignRole([FromQuery(Name = "uid")] String uid, [FromBod public IActionResult LRGetProfile([FromQuery(Name = "auth")] String accessToken) { - var apiresponse = new AuthenticationApi().GetProfile(accessToken); + var apiresponse = new AuthenticationApi().GetProfileByAccessToken(accessToken); if (apiresponse.RestException != null) { return StatusCode(400, Json(apiresponse.RestException)); @@ -317,7 +319,10 @@ public IActionResult LRGetProfile([FromQuery(Name = "auth")] String accessToken) public IActionResult Error() { - return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); + return View(new ErrorViewModel + { + RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier + }); } } -} +} \ No newline at end of file diff --git a/Samples/dot-net-demo/dot-net-demo/Controllers/TestController.cs b/Samples/dot-net-demo/dot-net-demo/Controllers/TestController.cs index 5369047..28b193f 100644 --- a/Samples/dot-net-demo/dot-net-demo/Controllers/TestController.cs +++ b/Samples/dot-net-demo/dot-net-demo/Controllers/TestController.cs @@ -1,29 +1,21 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using LoginRadiusSDK.V2.Api; -using LoginRadiusSDK.V2.Models; -using LoginRadiusSDK.V2.Models.CustomerAuthentication.Login; -using LoginRadiusSDK.V2.Models.UserProfile; + using Microsoft.AspNetCore.Mvc; namespace dot_net_demo.Controllers { public class TestController : Controller { - LoginRadiusApiOptionalParams _apiOptionalParams = new LoginRadiusApiOptionalParams(); - public IActionResult Whoo() - { - LoginRadiusApiOptionalParams apiOptionalParams = new LoginRadiusApiOptionalParams(); - apiOptionalParams.VerificationUrl = ""; - apiOptionalParams.G_Recaptcha_Response = ""; + /* LoginRadiusApiOptionalParams _apiOptionalParams = new LoginRadiusApiOptionalParams(); + public IActionResult Whoo() + { + LoginRadiusApiOptionalParams apiOptionalParams = new LoginRadiusApiOptionalParams(); + apiOptionalParams.VerificationUrl = ""; + apiOptionalParams.G_Recaptcha_Response = ""; - UserNameLoginModel userNameLoginModel = new UserNameLoginModel { username = "XXX", password = "xxxx" }; - var apiresponse = new AuthenticationApi().LoginByUserName(userNameLoginModel.ConvertToJson(), apiOptionalParams); + UserNameLoginModel userNameLoginModel = new UserNameLoginModel { username = "XXX", password = "xxxx" }; + var apiresponse = new AuthenticationApi().LoginByUserName(userNameLoginModel.ConvertToJson(), apiOptionalParams); - return null; - } - + return null; + }*/ } } \ No newline at end of file diff --git a/Samples/dot-net-demo/dot-net-demo/Models/IndexModel.cs b/Samples/dot-net-demo/dot-net-demo/Models/IndexModel.cs index db8b653..67b9f85 100644 --- a/Samples/dot-net-demo/dot-net-demo/Models/IndexModel.cs +++ b/Samples/dot-net-demo/dot-net-demo/Models/IndexModel.cs @@ -1,20 +1,38 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace dot_net_demo.Models +namespace dot_net_demo.Models { public class ForgotPasswordModel { public string Email { get; set; } } + public class SetPasswordModel { public string Password { get; set; } } + public class GoogleAuthenticatorModel { public string googleauthenticatorcode { get; set; } } + + public class EmailLoginModel + { + public string Email { get; set; } + + public string Password { get; set; } + } + + public class ResetPasswordModel + { + public string password { get; set; } + + public string resettoken { get; set; } + } + + public class ChangePasswordModel + { + public string newPassword { get; set; } + + public string oldPassword { get; set; } + } } diff --git a/Samples/dot-net-demo/dot-net-demo/Program.cs b/Samples/dot-net-demo/dot-net-demo/Program.cs index 591dd56..722603e 100644 --- a/Samples/dot-net-demo/dot-net-demo/Program.cs +++ b/Samples/dot-net-demo/dot-net-demo/Program.cs @@ -1,12 +1,5 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore; +using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.Logging; namespace dot_net_demo { diff --git a/Samples/dot-net-demo/dot-net-demo/Views/Home/Profile.cshtml b/Samples/dot-net-demo/dot-net-demo/Views/Home/Profile.cshtml index d3cc1fa..bfbb074 100644 --- a/Samples/dot-net-demo/dot-net-demo/Views/Home/Profile.cshtml +++ b/Samples/dot-net-demo/dot-net-demo/Views/Home/Profile.cshtml @@ -31,7 +31,7 @@ <h3>Profile</h3> <div class="container"> <div class="lr-image-frame"> - <img style="width: 15%;", src="../images/user-blank.png" /> + <img id="profile-image" style="width: 20%;" src="../images/user-blank.png" /> </div> <span id="profile-name"><b></b></span><br/> <span id="profile-provider"></span><br/> diff --git a/Samples/dot-net-demo/dot-net-demo/dot-net-demo.csproj b/Samples/dot-net-demo/dot-net-demo/dot-net-demo.csproj index b412c1b..20653b3 100644 --- a/Samples/dot-net-demo/dot-net-demo/dot-net-demo.csproj +++ b/Samples/dot-net-demo/dot-net-demo/dot-net-demo.csproj @@ -1,4 +1,4 @@ -<Project Sdk="Microsoft.NET.Sdk.Web"> +<Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>netcoreapp2.0</TargetFramework> @@ -17,8 +17,8 @@ <ItemGroup> <PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.9" /> - <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.0.3" /> - <PackageReference Include="Newtonsoft.Json" Version="11.0.2" /> + <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.0.4" /> + <PackageReference Include="Newtonsoft.Json" Version="12.0.2" /> </ItemGroup> <ItemGroup> diff --git a/Samples/dot-net-demo/dot-net-demo/wwwroot/js/emailVerification.js b/Samples/dot-net-demo/dot-net-demo/wwwroot/js/emailVerification.js index b304c0e..a8338d7 100644 --- a/Samples/dot-net-demo/dot-net-demo/wwwroot/js/emailVerification.js +++ b/Samples/dot-net-demo/dot-net-demo/wwwroot/js/emailVerification.js @@ -31,7 +31,7 @@ let verificationFunc = function () { } }).done(function (ret) { localStorage.setItem("LRTokenKey", ret.access_token); - localStorage.setItem("lr-user-uid", ret.profile.uid); + localStorage.setItem("lr-user-uid", ret.Profile.Uid); window.location.replace("/Home/Profile"); }); } else { diff --git a/Samples/dot-net-demo/dot-net-demo/wwwroot/js/indexControl.js b/Samples/dot-net-demo/dot-net-demo/wwwroot/js/indexControl.js index 1cf16d2..e90ee70 100644 --- a/Samples/dot-net-demo/dot-net-demo/wwwroot/js/indexControl.js +++ b/Samples/dot-net-demo/dot-net-demo/wwwroot/js/indexControl.js @@ -52,7 +52,7 @@ $("#btn-minimal-login").click(function () { } }).done(function(ret) { localStorage.setItem("LRTokenKey", ret.access_token); - localStorage.setItem("lr-user-uid", ret.profile.uid); + localStorage.setItem("lr-user-uid", ret.Profile.Uid); window.location.replace("Home/Profile"); }); }); @@ -83,19 +83,19 @@ $("#btn-minimal-mfalogin-next").click(function () { }).done(function (ret) { console.log(ret); $("#minimal-mfalogin-message").text(""); - if (ret.secondFactorAuthentication && ret.secondFactorAuthentication.secondFactorAuthenticationToken) { - if (ret.secondFactorAuthentication.isGoogleAuthenticatorVerified === false) { - $("#minimal-mfalogin-qrcode").append('<img src="' + ret.secondFactorAuthentication.qrCode + '">'); + if (ret.SecondFactorAuthentication) { + if (ret.SecondFactorAuthentication.IsGoogleAuthenticatorVerified === false) { + $("#minimal-mfalogin-qrcode").append('<img src="' + ret.SecondFactorAuthentication.QRCode + '">'); } $("#minimal-mfalogin-next") .html('<table><tbody><tr>' + '<td>Google Authenticator Code: </td><td><input type="text" id="minimal-mfalogin-googlecode"></td>' + '</tr></tbody></table>' + '<button id="btn-minimal-mfalogin-login">Login</button>'); - multiFactorAuthToken = ret.secondFactorAuthentication.secondFactorAuthenticationToken; + multiFactorAuthToken = ret.SecondFactorAuthentication.SecondFactorAuthenticationToken; } else { localStorage.setItem("LRTokenKey", ret.access_token); - localStorage.setItem("lr-user-uid", ret.profile.uid); + localStorage.setItem("lr-user-uid", ret.Profile.Uid); window.location.replace("Home/Profile"); } }); @@ -118,7 +118,7 @@ $("#minimal-mfalogin-next").on('click', "#btn-minimal-mfalogin-login", function( }).done(function (ret) { console.log(ret); localStorage.setItem("LRTokenKey", ret.access_token); - localStorage.setItem("lr-user-uid", ret.profile.uid); + localStorage.setItem("lr-user-uid", ret.Profile.Uid); window.location.replace("Home/Profile"); }); }); diff --git a/Samples/dot-net-demo/dot-net-demo/wwwroot/js/loginScreen.js b/Samples/dot-net-demo/dot-net-demo/wwwroot/js/loginScreen.js index e9f2109..d0d6974 100644 --- a/Samples/dot-net-demo/dot-net-demo/wwwroot/js/loginScreen.js +++ b/Samples/dot-net-demo/dot-net-demo/wwwroot/js/loginScreen.js @@ -4,7 +4,7 @@ LRObject.util.ready(function() { let options = { redirecturl: { - afterlogin: "http://localhost:57476/Home/Profile", - afterreset: "http://localhost:57476/" + afterlogin: window.location.origin + "/Home/Profile", + afterreset: window.location.origin + "/" } } diff --git a/Samples/dot-net-demo/dot-net-demo/wwwroot/js/profileControl.js b/Samples/dot-net-demo/dot-net-demo/wwwroot/js/profileControl.js index 94697ec..57c8013 100644 --- a/Samples/dot-net-demo/dot-net-demo/wwwroot/js/profileControl.js +++ b/Samples/dot-net-demo/dot-net-demo/wwwroot/js/profileControl.js @@ -225,9 +225,9 @@ $("#btn-user-getcustomobj").click(function () { '<tr>').appendTo("#table-customobj > tbody:last-child"); for (let i = 0; i < ret.data.length; i++) { - $("<tr><td>" + ret.data[i].id + "</td></tr>").appendTo("#table-customobj > tbody:last-child"); + $("<tr><td>" + ret.data[i].Id + "</td></tr>").appendTo("#table-customobj > tbody:last-child"); $("<td>", { - text: JSON.stringify(ret.data[i].customObject) + text: JSON.stringify(ret.data[i].CustomObject) }).appendTo("#table-customobj > tbody:last-child > tr:last-child"); } }); @@ -277,7 +277,12 @@ $( "#btn-user-createrole" ).click(function() { }); }); -$( "#btn-user-deleterole" ).click(function() { +$("#btn-user-deleterole").click(function () { + if ($("#user-roles-deleterole").val() === "") { + $("#user-deleterole-message").text("Please input a valid Role."); + $("#user-deleterole-message").attr("class", "error-message"); + return; + } $.ajax({ method: "DELETE", url: m_options.deleteRoleUrl + "?role=" + $("#user-roles-deleterole").val(), @@ -334,17 +339,20 @@ let profileUpdate = function() { } }).done(function (ret) { console.log(ret); - if (ret.fullName === null) { + if (ret.FullName === null) { $("#profile-name").html(""); } else { - $("#profile-name").html("<b>" + ret.fullName + "</b>"); + $("#profile-name").html("<b>" + ret.FullName + "</b>"); + } + if (ret.ImageUrl != null && ret.ImageUrl != undefined && ret.ImageUrl != "") { + $("#profile-image").attr('src', ret.ImageUrl) } - $("#profile-provider").text("Provider: " + ret.provider); - $("#profile-email").text(ret.email[0].value); - $("#profile-lastlogin").text("Last Login Date: " + ret.lastLoginDate); - $("#user-updateaccount-firstname").val(ret.firstName); - $("#user-updateaccount-lastname").val(ret.lastName); - $("#user-updateaccount-about").val(ret.about); + $("#profile-provider").text("Provider: " + ret.Provider); + $("#profile-email").text(ret.Email[0].Value); + $("#profile-lastlogin").text("Last Login Date: " + ret.LastLoginDate); + $("#user-updateaccount-firstname").val(ret.FirstName); + $("#user-updateaccount-lastname").val(ret.LastName); + $("#user-updateaccount-about").val(ret.About); }); } @@ -361,7 +369,7 @@ let roleUpdate = function() { for (let i = 0; i < ret.data.length; i++) { $("<tr></tr>").appendTo("#table-allroles > tbody:last-child"); $("<td>", { - text: ret.data[i].name + text: ret.data[i].Name }).appendTo('#table-allroles > tbody:last-child > tr:last-child'); } }); @@ -376,11 +384,11 @@ let roleUpdate = function() { } }).done(function(ret) { $('#table-userroles tr:not(:first)').remove(); - if (ret && ret.roles) { - for (let i = 0; i < ret.roles.length; i++) { + if (ret && ret.Roles) { + for (let i = 0; i < ret.Roles.length; i++) { $("<tr></tr>").appendTo("#table-userroles > tbody:last-child"); $("<td>", { - text: ret.roles[i] + text: ret.Roles[i] }).appendTo('#table-userroles > tbody:last-child > tr:last-child'); } } diff --git a/Samples/dot-net-demo/dot-net-demo/wwwroot/js/resetPassword.js b/Samples/dot-net-demo/dot-net-demo/wwwroot/js/resetPassword.js index 053322f..71db069 100644 --- a/Samples/dot-net-demo/dot-net-demo/wwwroot/js/resetPassword.js +++ b/Samples/dot-net-demo/dot-net-demo/wwwroot/js/resetPassword.js @@ -1,6 +1,6 @@ const url = location.href; const params = url.split("?")[1]; -const serverUrl = "http://localhost:4000"; +const serverUrl = "http://localhost:65151"; let paramsObj = {}; $("#btn-minimal-resetpassword").click(function () { @@ -24,9 +24,9 @@ $("#btn-minimal-resetpassword").click(function () { method: "PUT", data: JSON.stringify(data), url: m_options.resetPasswordEmailUrl, - contentType: "application/json", + contentType: "application/json; charset=utf-8", error: function(xhr) { - $("#minimal-resetpassword-message").text(xhr.responseJSON.Description); + $("#minimal-resetpassword-message").text(xhr.responseJSON.value.description); $("#minimal-resetpassword-message").attr("class", "error-message"); } }).done(function () { diff --git a/Source/LoginRadiusSDK.V2/Api/Account/AccountApi.cs b/Source/LoginRadiusSDK.V2/Api/Account/AccountApi.cs new file mode 100644 index 0000000..8fa3d8c --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Api/Account/AccountApi.cs @@ -0,0 +1,687 @@ +//----------------------------------------------------------------------- +// <copyright file="AccountApi.cs" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System; +using LoginRadiusSDK.V2.Common; +using LoginRadiusSDK.V2.Util; +using LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects; +using LoginRadiusSDK.V2.Models.ResponseModels.UserProfile; +using LoginRadiusSDK.V2.Models.RequestModels; +using LoginRadiusSDK.V2.Models.ResponseModels; + +namespace LoginRadiusSDK.V2.Api.Account +{ + public class AccountApi : LoginRadiusResource + { + /// <summary> + /// This API is used to update the information of existing accounts in your Cloud Storage. See our Advanced API Usage section <a href='/api/v2/user-registration/advanced-api-usage'>Here</a> for more capabilities. + /// </summary> + /// <param name="accountUserProfileUpdateModel">Model Class containing Definition of payload for Account Update API</param> + /// <param name="uid">UID, the unified identifier for each user account</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <param name="nullSupport">Boolean, pass true if you wish to update any user profile field with a NULL value, You can get the details <a href='https://www.loginradius.com/docs/api/v2/customer-identity-api/advanced-api-usage/'>Here</a></param> + /// <returns>Response containing Definition for Complete profile data</returns> + /// 18.15 + + public ApiResponse<Identity> UpdateAccountByUid(object payload, string uid, + string fields = "", bool? nullSupport = null) + { + if (payload == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(payload)); + } + if (string.IsNullOrWhiteSpace(uid)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(uid)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + if (nullSupport != false) + { + queryParameters.Add("nullSupport", nullSupport.ToString()); + } + + var resourcePath = $"identity/v2/manage/account/{uid}"; + + return ConfigureAndExecute<Identity>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(payload)); + } + + /// <summary> + /// This API is used to retrieve all of the accepted Policies by the user, associated with their UID. + /// </summary> + /// <param name="uid">UID, the unified identifier for each user account</param> + /// <returns>Complete Policy History data</returns> + /// 15.1.1 + + public ApiResponse<PrivacyPolicyHistoryResponse> GetPrivacyPolicyHistoryByUid(string uid) + { + if (string.IsNullOrWhiteSpace(uid)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(uid)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + + var resourcePath = $"identity/v2/manage/account/{uid}/privacypolicy/history"; + + return ConfigureAndExecute<PrivacyPolicyHistoryResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API is used to create an account in Cloud Storage. This API bypass the normal email verification process and manually creates the user. <br><br>In order to use this API, you need to format a JSON request body with all of the mandatory fields + /// </summary> + /// <param name="accountCreateModel">Model Class containing Definition of payload for Account Create API</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <returns>Response containing Definition for Complete profile data</returns> + /// 18.1 + + public ApiResponse<Identity> CreateAccount(AccountCreateModel accountCreateModel, string fields = "") + { + if (accountCreateModel == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accountCreateModel)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + + var resourcePath = "identity/v2/manage/account"; + + return ConfigureAndExecute<Identity>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(accountCreateModel)); + } + /// <summary> + /// This API is used to retrieve all of the profile data, associated with the specified account by email in Cloud Storage. + /// </summary> + /// <param name="email">Email of the user</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <returns>Response containing Definition for Complete profile data</returns> + /// 18.2 + + public ApiResponse<Identity> GetAccountProfileByEmail(string email, string fields = "") + { + if (string.IsNullOrWhiteSpace(email)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(email)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] }, + { "email", email } + }; + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + + var resourcePath = "identity/v2/manage/account"; + + return ConfigureAndExecute<Identity>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API is used to retrieve all of the profile data associated with the specified account by user name in Cloud Storage. + /// </summary> + /// <param name="userName">UserName of the user</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <returns>Response containing Definition for Complete profile data</returns> + /// 18.3 + + public ApiResponse<Identity> GetAccountProfileByUserName(string userName, string fields = "") + { + if (string.IsNullOrWhiteSpace(userName)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(userName)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] }, + { "userName", userName } + }; + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + + var resourcePath = "identity/v2/manage/account"; + + return ConfigureAndExecute<Identity>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API is used to retrieve all of the profile data, associated with the account by phone number in Cloud Storage. + /// </summary> + /// <param name="phone">The Registered Phone Number</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <returns>Response containing Definition for Complete profile data</returns> + /// 18.4 + + public ApiResponse<Identity> GetAccountProfileByPhone(string phone, string fields = "") + { + if (string.IsNullOrWhiteSpace(phone)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(phone)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] }, + { "phone", phone } + }; + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + + var resourcePath = "identity/v2/manage/account"; + + return ConfigureAndExecute<Identity>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API is used to retrieve all of the profile data, associated with the account by uid in Cloud Storage. + /// </summary> + /// <param name="uid">UID, the unified identifier for each user account</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <returns>Response containing Definition for Complete profile data</returns> + /// 18.5 + + public ApiResponse<Identity> GetAccountProfileByUid(string uid, string fields = "") + { + if (string.IsNullOrWhiteSpace(uid)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(uid)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + + var resourcePath = $"identity/v2/manage/account/{uid}"; + + return ConfigureAndExecute<Identity>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API is used to update the information of existing accounts in your Cloud Storage. See our Advanced API Usage section <a href='/api/v2/customer-identity-api/advanced-api-usage/'>Here</a> for more capabilities. + /// </summary> + /// <param name="accountUserProfileUpdateModel">Model Class containing Definition of payload for Account Update API</param> + /// <param name="uid">UID, the unified identifier for each user account</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <returns>Response containing Definition for Complete profile data</returns> + /// 18.15 + + public ApiResponse<Identity> UpdateAccountByUid(AccountUserProfileUpdateModel accountUserProfileUpdateModel, string uid, + string fields = "") + { + if (accountUserProfileUpdateModel == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accountUserProfileUpdateModel)); + } + if (string.IsNullOrWhiteSpace(uid)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(uid)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + + var resourcePath = $"identity/v2/manage/account/{uid}"; + + return ConfigureAndExecute<Identity>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(accountUserProfileUpdateModel)); + } + /// <summary> + /// This API is used to update the PhoneId by using the Uid's. Admin can update the PhoneId's for both the verified and unverified profiles. It will directly replace the PhoneId and bypass the OTP verification process. + /// </summary> + /// <param name="phone">Phone number</param> + /// <param name="uid">UID, the unified identifier for each user account</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <returns>Response containing Definition for Complete profile data</returns> + /// 18.16 + + public ApiResponse<Identity> UpdatePhoneIDByUid(string phone, string uid, + string fields = "") + { + if (string.IsNullOrWhiteSpace(phone)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(phone)); + } + if (string.IsNullOrWhiteSpace(uid)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(uid)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + + var bodyParameters = new BodyParameters + { + { "phone", phone } + }; + + var resourcePath = $"identity/v2/manage/account/{uid}/phoneid"; + + return ConfigureAndExecute<Identity>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + } + /// <summary> + /// This API use to retrive the hashed password of a specified account in Cloud Storage. + /// </summary> + /// <param name="uid">UID, the unified identifier for each user account</param> + /// <returns>Response containing Definition for Complete PasswordHash data</returns> + /// 18.17 + + public ApiResponse<UserPasswordHash> GetAccountPasswordHashByUid(string uid) + { + if (string.IsNullOrWhiteSpace(uid)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(uid)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + + var resourcePath = $"identity/v2/manage/account/{uid}/password"; + + return ConfigureAndExecute<UserPasswordHash>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API is used to set the password of an account in Cloud Storage. + /// </summary> + /// <param name="password">New password</param> + /// <param name="uid">UID, the unified identifier for each user account</param> + /// <returns>Response containing Definition for Complete PasswordHash data</returns> + /// 18.18 + + public ApiResponse<UserPasswordHash> SetAccountPasswordByUid(string password, string uid) + { + if (string.IsNullOrWhiteSpace(password)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(password)); + } + if (string.IsNullOrWhiteSpace(uid)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(uid)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + + var bodyParameters = new BodyParameters + { + { "password", password } + }; + + var resourcePath = $"identity/v2/manage/account/{uid}/password"; + + return ConfigureAndExecute<UserPasswordHash>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + } + /// <summary> + /// This API deletes the Users account and allows them to re-register for a new account. + /// </summary> + /// <param name="uid">UID, the unified identifier for each user account</param> + /// <returns>Response containing Definition of Delete Request</returns> + /// 18.19 + + public ApiResponse<DeleteResponse> DeleteAccountByUid(string uid) + { + if (string.IsNullOrWhiteSpace(uid)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(uid)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + + var resourcePath = $"identity/v2/manage/account/{uid}"; + + return ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, null); + } + /// <summary> + /// This API is used to invalidate the Email Verification status on an account. + /// </summary> + /// <param name="uid">UID, the unified identifier for each user account</param> + /// <param name="emailTemplate">Email template name</param> + /// <param name="verificationUrl">Email verification url</param> + /// <returns>Response containing Definition of Complete Validation data</returns> + /// 18.20 + + public ApiResponse<PostResponse> InvalidateAccountEmailVerification(string uid, string emailTemplate = "", + string verificationUrl = "") + { + if (string.IsNullOrWhiteSpace(uid)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(uid)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + if (!string.IsNullOrWhiteSpace(emailTemplate)) + { + queryParameters.Add("emailTemplate", emailTemplate); + } + if (!string.IsNullOrWhiteSpace(verificationUrl)) + { + queryParameters.Add("verificationUrl", verificationUrl); + } + + var resourcePath = $"identity/v2/manage/account/{uid}/invalidateemail"; + + return ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, null); + } + /// <summary> + /// This API Returns a Forgot Password Token it can also be used to send a Forgot Password email to the customer. Note: If you have the UserName workflow enabled, you may replace the 'email' parameter with 'username' in the body. + /// </summary> + /// <param name="email">user's email</param> + /// <param name="emailTemplate">Email template name</param> + /// <param name="resetPasswordUrl">Url to which user should get re-directed to for resetting the password</param> + /// <param name="sendEmail">If set to true, the API will also send a Forgot Password email to the customer, bypassing any Bot Protection challenges that they are faced with.</param> + /// <returns>Response containing Definition of Complete Forgot Password data</returns> + /// 18.22 + + public ApiResponse<ForgotPasswordResponse> GetForgotPasswordToken(string email, string emailTemplate = null, + string resetPasswordUrl = null, bool sendEmail = false) + { + if (string.IsNullOrWhiteSpace(email)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(email)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + if (!string.IsNullOrWhiteSpace(emailTemplate)) + { + queryParameters.Add("emailTemplate", emailTemplate); + } + if (!string.IsNullOrWhiteSpace(resetPasswordUrl)) + { + queryParameters.Add("resetPasswordUrl", resetPasswordUrl); + } + if (sendEmail != false) + { + queryParameters.Add("sendEmail", sendEmail.ToString()); + } + + var bodyParameters = new BodyParameters + { + { "email", email } + }; + + var resourcePath = "identity/v2/manage/account/forgot/token"; + + return ConfigureAndExecute<ForgotPasswordResponse>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + } + /// <summary> + /// This API Returns an Email Verification token. + /// </summary> + /// <param name="email">user's email</param> + /// <returns>Response containing Definition of Complete Verification data</returns> + /// 18.23 + + public ApiResponse<EmailVerificationTokenResponse> GetEmailVerificationToken(string email) + { + if (string.IsNullOrWhiteSpace(email)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(email)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + + var bodyParameters = new BodyParameters + { + { "email", email } + }; + + var resourcePath = "identity/v2/manage/account/verify/token"; + + return ConfigureAndExecute<EmailVerificationTokenResponse>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + } + /// <summary> + /// The API is used to get LoginRadius access token based on UID. + /// </summary> + /// <param name="uid">UID, the unified identifier for each user account</param> + /// <returns>Response containing Definition of Complete Token data</returns> + /// 18.24 + + public ApiResponse<AccessToken> GetAccessTokenByUid(string uid) + { + if (string.IsNullOrWhiteSpace(uid)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(uid)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] }, + { "uid", uid } + }; + + var resourcePath = "identity/v2/manage/account/access_token"; + + return ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API Allows you to reset the phone no verification of an end user’s account. + /// </summary> + /// <param name="uid">UID, the unified identifier for each user account</param> + /// <param name="smsTemplate">SMS Template name</param> + /// <returns>Response containing Definition of Complete Validation data</returns> + /// 18.27 + + public ApiResponse<PostResponse> ResetPhoneIDVerificationByUid(string uid, string smsTemplate = "") + { + if (string.IsNullOrWhiteSpace(uid)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(uid)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + if (!string.IsNullOrWhiteSpace(smsTemplate)) + { + queryParameters.Add("smsTemplate", smsTemplate); + } + + var resourcePath = $"identity/v2/manage/account/{uid}/invalidatephone"; + + return ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, null); + } + /// <summary> + /// This API is used to add/upsert another emails in account profile by different-different email types. If the email type is same then it will simply update the existing email, otherwise it will add a new email in Email array. + /// </summary> + /// <param name="upsertEmailModel">Model Class containing Definition of payload for UpsertEmail Property</param> + /// <param name="uid">UID, the unified identifier for each user account</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <returns>Response containing Definition for Complete profile data</returns> + /// 18.29 + + public ApiResponse<Identity> UpsertEmail(UpsertEmailModel upsertEmailModel, string uid, + string fields = "") + { + if (upsertEmailModel == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(upsertEmailModel)); + } + if (string.IsNullOrWhiteSpace(uid)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(uid)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + + var resourcePath = $"identity/v2/manage/account/{uid}/email"; + + return ConfigureAndExecute<Identity>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(upsertEmailModel)); + } + /// <summary> + /// Use this API to Remove emails from a user Account + /// </summary> + /// <param name="email">user's email</param> + /// <param name="uid">UID, the unified identifier for each user account</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <returns>Response containing Definition for Complete profile data</returns> + /// 18.30 + + public ApiResponse<Identity> RemoveEmail(string email, string uid, + string fields = "") + { + if (string.IsNullOrWhiteSpace(email)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(email)); + } + if (string.IsNullOrWhiteSpace(uid)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(uid)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + + var bodyParameters = new BodyParameters + { + { "email", email } + }; + + var resourcePath = $"identity/v2/manage/account/{uid}/email"; + + return ConfigureAndExecute<Identity>(HttpMethod.DELETE, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + } + /// <summary> + /// This API is used to refresh an access_token via it's associated refresh_token. + /// </summary> + /// <param name="refreshToken">LoginRadius refresh_token</param> + /// <returns>Response containing Definition of Complete Token data</returns> + /// 18.31 + + public ApiResponse<AccessToken> RefreshAccessTokenByRefreshToken(string refreshToken) + { + if (string.IsNullOrWhiteSpace(refreshToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(refreshToken)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] }, + { "refresh_Token", refreshToken } + }; + + var resourcePath = "identity/v2/manage/account/access_token/refresh"; + + return ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// The Revoke Refresh Access Token API is used to revoke a refresh token or the Provider Access Token, revoking an existing refresh token will invalidate the refresh token but the associated access token will work until the expiry. + /// </summary> + /// <param name="refreshToken">LoginRadius refresh_token</param> + /// <returns>Response containing Definition of Delete Request</returns> + /// 18.32 + + public ApiResponse<DeleteResponse> RevokeRefreshToken(string refreshToken) + { + if (string.IsNullOrWhiteSpace(refreshToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(refreshToken)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] }, + { "refresh_Token", refreshToken } + }; + + var resourcePath = "identity/v2/manage/account/access_token/refresh/revoke"; + + return ConfigureAndExecute<DeleteResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// Note: This is intended for specific workflows where an email may be associated to multiple UIDs. This API is used to retrieve all of the identities (UID and Profiles), associated with a specified email in Cloud Storage. + /// </summary> + /// <param name="email">Email of the user</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <returns>Complete user Identity data</returns> + /// 18.35 + + public ApiResponse<ListReturn<Identity>> GetAccountIdentitiesByEmail(string email, string fields = "") + { + if (string.IsNullOrWhiteSpace(email)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(email)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] }, + { "email", email } + }; + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + + var resourcePath = "identity/v2/manage/account/identities"; + + return ConfigureAndExecute<ListReturn<Identity>>(HttpMethod.GET, resourcePath, queryParameters, null); + } + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Api/Account/RoleApi.cs b/Source/LoginRadiusSDK.V2/Api/Account/RoleApi.cs new file mode 100644 index 0000000..f7c7d4c --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Api/Account/RoleApi.cs @@ -0,0 +1,390 @@ +//----------------------------------------------------------------------- +// <copyright file="RoleApi.cs" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System; +using LoginRadiusSDK.V2.Common; +using LoginRadiusSDK.V2.Util; +using LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects; +using LoginRadiusSDK.V2.Models.RequestModels; +using LoginRadiusSDK.V2.Models.ResponseModels; +using LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects; + +namespace LoginRadiusSDK.V2.Api.Account +{ + public class RoleApi : LoginRadiusResource + { + /// <summary> + /// API is used to retrieve all the assigned roles of a particular User. + /// </summary> + /// <param name="uid">UID, the unified identifier for each user account</param> + /// <returns>Response containing Definition of Complete Roles data</returns> + /// 18.6 + + public ApiResponse<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.AccountRolesModel> GetRolesByUid(string uid) + { + if (string.IsNullOrWhiteSpace(uid)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(uid)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + + var resourcePath = $"identity/v2/manage/account/{uid}/role"; + + return ConfigureAndExecute<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.AccountRolesModel>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API is used to assign your desired roles to a given user. + /// </summary> + /// <param name="accountRolesModel">Model Class containing Definition of payload for Create Role API</param> + /// <param name="uid">UID, the unified identifier for each user account</param> + /// <returns>Response containing Definition of Complete Roles data</returns> + /// 18.7 + + public ApiResponse<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.AccountRolesModel> AssignRolesByUid(LoginRadiusSDK.V2.Models.RequestModels.AccountRolesModel accountRolesModel, string uid) + { + if (accountRolesModel == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accountRolesModel)); + } + if (string.IsNullOrWhiteSpace(uid)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(uid)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + + var resourcePath = $"identity/v2/manage/account/{uid}/role"; + + return ConfigureAndExecute<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.AccountRolesModel>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(accountRolesModel)); + } + /// <summary> + /// This API is used to unassign roles from a user. + /// </summary> + /// <param name="accountRolesModel">Model Class containing Definition of payload for Create Role API</param> + /// <param name="uid">UID, the unified identifier for each user account</param> + /// <returns>Response containing Definition of Delete Request</returns> + /// 18.8 + + public ApiResponse<DeleteResponse> UnassignRolesByUid(LoginRadiusSDK.V2.Models.RequestModels.AccountRolesModel accountRolesModel, string uid) + { + if (accountRolesModel == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accountRolesModel)); + } + if (string.IsNullOrWhiteSpace(uid)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(uid)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + + var resourcePath = $"identity/v2/manage/account/{uid}/role"; + + return ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, ConvertToJson(accountRolesModel)); + } + /// <summary> + /// This API Gets the contexts that have been configured and the associated roles and permissions. + /// </summary> + /// <param name="uid">UID, the unified identifier for each user account</param> + /// <returns>Complete user RoleContext data</returns> + /// 18.9 + + public ApiResponse<ListReturn<RoleContext>> GetRoleContextByUid(string uid) + { + if (string.IsNullOrWhiteSpace(uid)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(uid)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + + var resourcePath = $"identity/v2/manage/account/{uid}/rolecontext"; + + return ConfigureAndExecute<ListReturn<RoleContext>>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// The API is used to retrieve role context by the context name. + /// </summary> + /// <param name="contextName">Name of context</param> + /// <returns>Complete user RoleContext data</returns> + /// 18.10 + + public ApiResponse<ListReturn<RoleContextResponseModel>> GetRoleContextByContextName(string contextName) + { + if (string.IsNullOrWhiteSpace(contextName)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(contextName)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + + var resourcePath = $"identity/v2/manage/account/rolecontext/{contextName}"; + + return ConfigureAndExecute<ListReturn<RoleContextResponseModel>>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API creates a Context with a set of Roles + /// </summary> + /// <param name="accountRoleContextModel">Model Class containing Definition of RoleContext payload</param> + /// <param name="uid">UID, the unified identifier for each user account</param> + /// <returns>Complete user RoleContext data</returns> + /// 18.11 + + public ApiResponse<ListReturn<RoleContext>> UpdateRoleContextByUid(AccountRoleContextModel accountRoleContextModel, string uid) + { + if (accountRoleContextModel == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accountRoleContextModel)); + } + if (string.IsNullOrWhiteSpace(uid)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(uid)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + + var resourcePath = $"identity/v2/manage/account/{uid}/rolecontext"; + + return ConfigureAndExecute<ListReturn<RoleContext>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(accountRoleContextModel)); + } + /// <summary> + /// This API Deletes the specified Role Context + /// </summary> + /// <param name="contextName">Name of context</param> + /// <param name="uid">UID, the unified identifier for each user account</param> + /// <returns>Response containing Definition of Delete Request</returns> + /// 18.12 + + public ApiResponse<DeleteResponse> DeleteRoleContextByUid(string contextName, string uid) + { + if (string.IsNullOrWhiteSpace(contextName)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(contextName)); + } + if (string.IsNullOrWhiteSpace(uid)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(uid)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + + var resourcePath = $"identity/v2/manage/account/{uid}/rolecontext/{contextName}"; + + return ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, null); + } + /// <summary> + /// This API Deletes the specified Role from a Context. + /// </summary> + /// <param name="contextName">Name of context</param> + /// <param name="roleContextRemoveRoleModel">Model Class containing Definition of payload for RoleContextRemoveRole API</param> + /// <param name="uid">UID, the unified identifier for each user account</param> + /// <returns>Response containing Definition of Delete Request</returns> + /// 18.13 + + public ApiResponse<DeleteResponse> DeleteRolesFromRoleContextByUid(string contextName, RoleContextRemoveRoleModel roleContextRemoveRoleModel, + string uid) + { + if (string.IsNullOrWhiteSpace(contextName)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(contextName)); + } + if (roleContextRemoveRoleModel == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(roleContextRemoveRoleModel)); + } + if (string.IsNullOrWhiteSpace(uid)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(uid)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + + var resourcePath = $"identity/v2/manage/account/{uid}/rolecontext/{contextName}/role"; + + return ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, ConvertToJson(roleContextRemoveRoleModel)); + } + /// <summary> + /// This API Deletes Additional Permissions from Context. + /// </summary> + /// <param name="contextName">Name of context</param> + /// <param name="roleContextAdditionalPermissionRemoveRoleModel">Model Class containing Definition of payload for RoleContextAdditionalPermissionRemoveRole API</param> + /// <param name="uid">UID, the unified identifier for each user account</param> + /// <returns>Response containing Definition of Delete Request</returns> + /// 18.14 + + public ApiResponse<DeleteResponse> DeleteAdditionalPermissionFromRoleContextByUid(string contextName, RoleContextAdditionalPermissionRemoveRoleModel roleContextAdditionalPermissionRemoveRoleModel, + string uid) + { + if (string.IsNullOrWhiteSpace(contextName)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(contextName)); + } + if (roleContextAdditionalPermissionRemoveRoleModel == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(roleContextAdditionalPermissionRemoveRoleModel)); + } + if (string.IsNullOrWhiteSpace(uid)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(uid)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + + var resourcePath = $"identity/v2/manage/account/{uid}/rolecontext/{contextName}/additionalpermission"; + + return ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, ConvertToJson(roleContextAdditionalPermissionRemoveRoleModel)); + } + /// <summary> + /// This API retrieves the complete list of created roles with permissions of your app. + /// </summary> + /// <returns>Complete user Roles List data</returns> + /// 41.1 + + public ApiResponse<ListData<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.RoleModel>> GetRolesList() + { + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + + var resourcePath = "identity/v2/manage/role"; + + return ConfigureAndExecute<ListData<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.RoleModel>>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API creates a role with permissions. + /// </summary> + /// <param name="rolesModel">Model Class containing Definition of payload for Roles API</param> + /// <returns>Complete user Roles data</returns> + /// 41.2 + + public ApiResponse<ListData<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.RoleModel>> CreateRoles(RolesModel rolesModel) + { + if (rolesModel == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(rolesModel)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + + var resourcePath = "identity/v2/manage/role"; + + return ConfigureAndExecute<ListData<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.RoleModel>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(rolesModel)); + } + /// <summary> + /// This API is used to delete the role. + /// </summary> + /// <param name="role">Created RoleName</param> + /// <returns>Response containing Definition of Delete Request</returns> + /// 41.3 + + public ApiResponse<DeleteResponse> DeleteRole(string role) + { + if (string.IsNullOrWhiteSpace(role)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(role)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + + var resourcePath = $"identity/v2/manage/role/{role}"; + + return ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, null); + } + /// <summary> + /// This API is used to add permissions to a given role. + /// </summary> + /// <param name="permissionsModel">Model Class containing Definition for PermissionsModel Property</param> + /// <param name="role">Created RoleName</param> + /// <returns>Response containing Definition of Complete role data</returns> + /// 41.4 + + public ApiResponse<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.RoleModel> AddRolePermissions(PermissionsModel permissionsModel, string role) + { + if (permissionsModel == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(permissionsModel)); + } + if (string.IsNullOrWhiteSpace(role)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(role)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + + var resourcePath = $"identity/v2/manage/role/{role}/permission"; + + return ConfigureAndExecute<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.RoleModel>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(permissionsModel)); + } + /// <summary> + /// API is used to remove permissions from a role. + /// </summary> + /// <param name="permissionsModel">Model Class containing Definition for PermissionsModel Property</param> + /// <param name="role">Created RoleName</param> + /// <returns>Response containing Definition of Complete role data</returns> + /// 41.5 + + public ApiResponse<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.RoleModel> RemoveRolePermissions(PermissionsModel permissionsModel, string role) + { + if (permissionsModel == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(permissionsModel)); + } + if (string.IsNullOrWhiteSpace(role)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(role)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + + var resourcePath = $"identity/v2/manage/role/{role}/permission"; + + return ConfigureAndExecute<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.RoleModel>(HttpMethod.DELETE, resourcePath, queryParameters, ConvertToJson(permissionsModel)); + } + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Api/Account/SottApi.cs b/Source/LoginRadiusSDK.V2/Api/Account/SottApi.cs new file mode 100644 index 0000000..5a8f2d0 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Api/Account/SottApi.cs @@ -0,0 +1,40 @@ +//----------------------------------------------------------------------- +// <copyright file="SottApi.cs" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using LoginRadiusSDK.V2.Common; +using LoginRadiusSDK.V2.Util; +using LoginRadiusSDK.V2.Models.ResponseModels; + +namespace LoginRadiusSDK.V2.Api.Account +{ + public class SottApi : LoginRadiusResource + { + /// <summary> + /// This API allows you to generate SOTT with a given expiration time. + /// </summary> + /// <param name="timeDifference">The time difference you would like to pass, If you not pass difference then the default value is 10 minutes</param> + /// <returns>Sott data For Registration</returns> + /// 18.28 + + public ApiResponse<SottResponseData> GenerateSott(int? timeDifference = null) + { + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + if (timeDifference != null) + { + queryParameters.Add("timeDifference", timeDifference.ToString()); + } + + var resourcePath = "identity/v2/manage/account/sott"; + + return ConfigureAndExecute<SottResponseData>(HttpMethod.GET, resourcePath, queryParameters, null); + } + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Api/AccountApi.cs b/Source/LoginRadiusSDK.V2/Api/AccountApi.cs deleted file mode 100644 index 53056bb..0000000 --- a/Source/LoginRadiusSDK.V2/Api/AccountApi.cs +++ /dev/null @@ -1,239 +0,0 @@ -using LoginRadiusSDK.V2.Entity; -using LoginRadiusSDK.V2.Models; -using LoginRadiusSDK.V2.Models.UserProfile; -using LoginRadiusSDK.V2.Util; -using System.Collections.Generic; -using static LoginRadiusSDK.V2.Util.LoginRadiusArgumentValidator; -using LoginRadiusSDK.V2.Models.Identity; -using LoginRadiusSDK.V2.Models.CustomerAuthentication.Account; -using LoginRadiusSDK.V2.Models.Object; - -namespace LoginRadiusSDK.V2.Api -{ - public class AccountApi : LoginRadiusResource - { - /// <summary> - /// This API is used to create an account in Cloud Storage. This API bypasses the normal email verification process and manually creates the user. - /// </summary> - /// <param name="userIdentity">UserIdentityCreateModel: An object holding the LoginRadius Profile on which the account is created.</param> - /// <returns>LoginRadiusUserIdentity: The account profile.</returns> - public ApiResponse<LoginRadiusUserIdentity> CreateAccount(UserIdentityCreateModel userIdentity) - { - Validate(new List<object> { userIdentity.Email, userIdentity.Password }); - return ConfigureAndExecute<LoginRadiusUserIdentity>(RequestType.Identity, HttpMethod.POST, null, - userIdentity.ConvertToJson()); - } - - /// <summary> - /// This API returns an Email Verification token. - /// </summary> - /// <param name="email">The email of the user being verified.</param> - /// <returns>LoginRadiusVerification: A verification token.</returns> - public ApiResponse<LoginRadiusVerification> EmailVerificationToken(string email) - { - Validate(new[] { email }); - var payload = new BodyParameters { [nameof(email)] = email }; - return ConfigureAndExecute<LoginRadiusVerification>(RequestType.Identity, HttpMethod.POST, "verify/token", - payload.ConvertToJson()); - } - - /// <summary> - /// This API returns a forgot password token. Fill in the appropriate arguments depending on login flow. - /// </summary> - /// <param name="email"> The email of the user resetting password when login flow is email. Leave blank otherwise.</param> - /// <param name="username">The username of the user resetting password when login flow is username. Leave blank otherwise.</param> - /// <returns>ForgotPasswordToken: A Password Reset token.</returns> - public ApiResponse<ForgotPasswordToken> GetForgotPasswordToken(string email = "", string username = "") - { - var payload = new BodyParameters { [nameof(email)] = email, [nameof(username)] = username }; - return ConfigureAndExecute<ForgotPasswordToken>(RequestType.Identity, HttpMethod.POST, "forgot/token", - payload.ConvertToJson()); - } - - /// <summary> - /// This is intended for specific work flows where an email may be associated to multiple UIDs. - /// This API is used to retrieve all of the identities (UID and Profiles), associated with a specified email in Cloud Storage. - /// </summary> - /// <param name="email">A valid email associated with a LoginRadius account.</param> - /// <returns>AccountIdentities: The profiles associated with the passed in email.</returns> - public ApiResponse<AccountIdentities> GetAccountIdentitiesByEmail(string email) - { - Validate(new[] { email }); - var additionalQueryParams = new QueryParameters { { nameof(email), email } }; - return ConfigureAndExecute<AccountIdentities>(RequestType.Identity, HttpMethod.GET, "identities", additionalQueryParams); - } - - /// <summary> - /// The API is used to get a LoginRadius access token based on UID. - /// </summary> - /// <param name="uid">UID of a LoginRadius account.</param> - /// <returns>AccessTokenResponse: A generated access token for the account with the expiry time.</returns> - public ApiResponse<AccessTokenResponse> UserImpersonation(string uid) - { - Validate(new[] { uid }); - var additionalQueryParams = new QueryParameters { { nameof(uid), uid } }; - return ConfigureAndExecute<AccessTokenResponse>(RequestType.Identity, HttpMethod.GET, "access_token", - additionalQueryParams); - } - - /// <summary> - /// You can use this API to retrieve the hashed password of a specified account in Cloud Storage. - /// </summary> - /// <param name="uid">UID of a LoginRadius account.</param> - /// <returns>HashPassword: The hashed password for the account.</returns> - public ApiResponse<HashPassword> GetAccountPassword(string uid) - { - Validate(new[] { uid }); - var pattern = new LoginRadiusResourcePath("{0}/password").ToString(); - var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] { uid }); - return ConfigureAndExecute<HashPassword>(RequestType.Identity, HttpMethod.GET, resourcePath, ""); - } - - /// <summary> - /// This API is used to retrieve all of the profile data, associated with the specified account by email in Cloud Storage. - /// </summary> - /// <param name="email">Email associated with a LoginRadius account.</param> - /// <returns>LoginRadiusUserIdentity: The account profile.</returns> - public ApiResponse<LoginRadiusUserIdentity> GetAccountProfileByEmail(string email) - { - Validate(new[] { email }); - var additionalQueryParams = new QueryParameters { { nameof(email), email } }; - return ConfigureAndExecute<LoginRadiusUserIdentity>(RequestType.Identity, HttpMethod.GET, null, - additionalQueryParams); - } - - /// <summary> - /// This API is used to retrieve all of the profile data, associated with the specified account by username in Cloud Storage. - /// </summary> - /// <param name="username">Username associated with a LoginRadius account.</param> - /// <returns>LoginRadiusUserIdentity: The account profile.</returns> - public ApiResponse<LoginRadiusUserIdentity> GetAccountProfileByUserName(string username) - { - Validate(new[] { username }); - var additionalQueryParams = new QueryParameters { { nameof(username), username } }; - return ConfigureAndExecute<LoginRadiusUserIdentity>(RequestType.Identity, HttpMethod.GET, null, - additionalQueryParams); - } - - /// <summary> - /// This API is used to retrieve all of the profile data, associated with the specified account by phone in Cloud Storage. - /// </summary> - /// <param name="phone">Phone associated with a LoginRadius account.</param> - /// <returns>LoginRadiusUserIdentity: The account profile.</returns> - public ApiResponse<LoginRadiusUserIdentity> GetAccountProfileByPhone(string phone) - { - Validate(new[] { phone }); - var additionalQueryParams = new QueryParameters { { nameof(phone), phone } }; - return ConfigureAndExecute<LoginRadiusUserIdentity>(RequestType.Identity, HttpMethod.GET, null, - additionalQueryParams); - } - - /// <summary> - /// This API is used to retrieve all of the profile data, associated with the specified account by uid in Cloud Storage. - /// </summary> - /// <param name="uid">Uid associated with a LoginRadius account.</param> - /// <returns>LoginRadiusUserIdentity: The account profile.</returns> - public ApiResponse<LoginRadiusUserIdentity> GetAccountProfileByUid(string uid) - { - Validate(new[] { uid }); - var pattern = new LoginRadiusResourcePath("{0}").ToString(); - var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] { uid }); - return ConfigureAndExecute<LoginRadiusUserIdentity>(RequestType.Identity, HttpMethod.GET, resourcePath); - } - - /// <summary> - /// This API is used to set the password of an account in Cloud Storage. - /// </summary> - /// <param name="uid">Uid associated with a LoginRadius account.</param> - /// <param name="password">The new password.</param> - /// <returns>HashPassword: Hashed version of the new password.</returns> - public ApiResponse<HashPassword> SetAccountPassword(string uid, string password) - { - Validate(new[] { uid, password }); - var pattern = new LoginRadiusResourcePath("{0}/password").ToString(); - var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] { uid }); - var passwordBody = new BodyParameters { [nameof(password)] = password }; - return ConfigureAndExecute<HashPassword>(RequestType.Identity, HttpMethod.PUT, resourcePath, - passwordBody.ConvertToJson()); - } - - /// <summary> - /// This API is used to update the information of existing accounts in your Cloud Storage. - /// See our Advanced API Usage section Here for more capabilities. - /// </summary> - /// <param name="uid">Uid associated with a LoginRadius account.</param> - /// <param name="user">LoginRadiusAccountUpdateModel: Profile object with updated fields.</param> - /// <returns>LoginRadiusUserIdentity: The updated account profile.</returns> - public ApiResponse<LoginRadiusUserIdentity> UpdateAccount(string uid, LoginRadiusAccountUpdateModel user) - { - Validate(new[] { uid }); - var pattern = new LoginRadiusResourcePath("{0}").ToString(); - var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] { uid }); - return ConfigureAndExecute<LoginRadiusUserIdentity>(RequestType.Identity, HttpMethod.PUT, resourcePath, - user.ConvertToJson()); - } - - /// <summary> - /// This API is used to update security questions configuration on an existing account. - /// </summary> - /// <param name="uid">Uid associated with a LoginRadius account.</param> - /// <param name="obj">SecurityQuestion: The newly updated security question/answer.</param> - /// <returns>LoginRadiusUserIdentity: The profile with the updated security question/answer.</returns> - public ApiResponse<LoginRadiusUserIdentity> UpdateSecurityQuestion(string uid, SecurityQuestion obj) - { - Validate(new[] { uid }); - var pattern = new LoginRadiusResourcePath("{0}").ToString(); - var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] { uid }); - return ConfigureAndExecute<LoginRadiusUserIdentity>(RequestType.Identity, HttpMethod.PUT, resourcePath, - obj.ConvertToJson()); - } - - /// <summary> - /// This API is used to invalidate the Email Verification status on an account. - /// </summary> - /// <param name="uid">Uid associated with a LoginRadius account.</param> - /// <param name="optionalParams">Gets or sets API optional parameters, <see cref="LoginRadiusApiOptionalParams"/></param> - /// <returns>LoginRadiusPostResponse: Boolean to show if the result was successful.</returns> - public ApiResponse<LoginRadiusPostResponse> InvalidateEmailVerification(string uid, LoginRadiusApiOptionalParams optionalParams) - { - Validate(new[] { uid }); - var pattern = new LoginRadiusResourcePath("{0}/invalidateemail").ToString(); - var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] { uid }); - var additionalParams = new QueryParameters(); - if (!string.IsNullOrEmpty(optionalParams.VerificationUrl)) - additionalParams.Add(nameof(optionalParams.VerificationUrl), optionalParams.VerificationUrl); - if (!string.IsNullOrEmpty(optionalParams.EmailTemplate)) - additionalParams.Add(nameof(optionalParams.EmailTemplate), optionalParams.EmailTemplate); - return ConfigureAndExecute<LoginRadiusPostResponse>(RequestType.Identity, HttpMethod.PUT, resourcePath, additionalParams); - } - - /// <summary> - /// Use this API to Remove emails from a user account. - /// </summary> - /// <param name="uid">Uid associated with a LoginRadius account.</param> - /// <param name="email">Email to be deleted.</param> - /// <returns>LoginRadiusUserIdentity: The profile with the deleted email.</returns> - public ApiResponse<LoginRadiusUserIdentity> DeleteEmail(string uid, string email) - { - Validate(new[] { uid, email }); - var pattern = new LoginRadiusResourcePath("{0}/email").ToString(); - var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] { uid }); - var body = new BodyParameters { ["email"] = email }; - return ConfigureAndExecute<LoginRadiusUserIdentity>(RequestType.Identity, HttpMethod.DELETE, resourcePath, - body.ConvertToJson()); - } - - /// <summary> - /// This API deletes the Users account and allows them to re-register for a new account. - /// </summary> - /// <param name="uid">Uid associated with a LoginRadius account.</param> - /// <returns>LoginRadiusDeleteResponse: Boolean to show if account was deleted.</returns> - public ApiResponse<LoginRadiusDeleteResponse> DeleteAccount(string uid) - { - Validate(new[] { uid }); - var pattern = new LoginRadiusResourcePath("{0}").ToString(); - var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] { uid }); - return ConfigureAndExecute<LoginRadiusDeleteResponse>(RequestType.Identity, HttpMethod.DELETE, resourcePath, ""); - } - } -} diff --git a/Source/LoginRadiusSDK.V2/Api/Advanced/ConfigurationApi.cs b/Source/LoginRadiusSDK.V2/Api/Advanced/ConfigurationApi.cs new file mode 100644 index 0000000..08277bc --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Api/Advanced/ConfigurationApi.cs @@ -0,0 +1,54 @@ +//----------------------------------------------------------------------- +// <copyright file="ConfigurationApi.cs" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using LoginRadiusSDK.V2.Common; +using LoginRadiusSDK.V2.Util; +using LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects; + +namespace LoginRadiusSDK.V2.Api.Advanced +{ + public class ConfigurationApi : LoginRadiusResource + { + /// <summary> + /// This API is used to get the configurations which are set in the LoginRadius Dashboard for a particular LoginRadius site/environment + /// </summary> + /// <returns>Response containing LoginRadius App configurations which are set in the LoginRadius Dashboard for a particular LoginRadius site/environment</returns> + /// 100 + public ApiResponse<ConfigResponseModel> GetConfigurations() + { + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + var resourcePath = "ciam/appinfo"; + return ConfigureAndExecute<ConfigResponseModel>(HttpMethod.GET, resourcePath, queryParameters, null); + } + + /// <summary> + /// This API allows you to query your LoginRadius account for basic server information and server time information which is useful when generating an SOTT token. + /// </summary> + /// <param name="timeDifference">The time difference you would like to pass, If you not pass difference then the default value is 10 minutes</param> + /// <returns>Response containing Definition of Complete service info data</returns> + /// 3.1 + + public ApiResponse<ServiceInfoModel> GetServerInfo(int? timeDifference = null) + { + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + if (timeDifference != null) + { + queryParameters.Add("timeDifference", timeDifference.ToString()); + } + + var resourcePath = "identity/v2/serverinfo"; + + return ConfigureAndExecute<ServiceInfoModel>(HttpMethod.GET, resourcePath, queryParameters, null); + } + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Api/Advanced/CustomObjectApi.cs b/Source/LoginRadiusSDK.V2/Api/Advanced/CustomObjectApi.cs new file mode 100644 index 0000000..e4db91f --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Api/Advanced/CustomObjectApi.cs @@ -0,0 +1,378 @@ +//----------------------------------------------------------------------- +// <copyright file="CustomObjectApi.cs" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System; +using LoginRadiusSDK.V2.Common; +using LoginRadiusSDK.V2.Util; +using LoginRadiusSDK.V2.Models.ResponseModels; +using LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects; +using LoginRadiusSDK.V2.Models.Enums; + +namespace LoginRadiusSDK.V2.Api.Advanced +{ + public class CustomObjectApi : LoginRadiusResource + { + /// <summary> + /// This API is used to write information in JSON format to the custom object for the specified account. + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="objectName">LoginRadius Custom Object Name</param> + /// <param name="payload">LoginRadius Custom Object Name</param> + /// <returns>Response containing Definition for Complete user custom object data</returns> + /// 6.1 + + public ApiResponse<UserCustomObjectData> CreateCustomObjectByToken(string accessToken, string objectName, + object payload) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + if (string.IsNullOrWhiteSpace(objectName)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(objectName)); + } + if (payload == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(payload)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "objectName", objectName } + }; + + var resourcePath = "identity/v2/auth/customobject"; + + return ConfigureAndExecute<UserCustomObjectData>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(payload)); + } + /// <summary> + /// This API is used to update the specified custom object data of the specified account. If the value of updatetype is 'replace' then it will fully replace custom object with the new custom object and if the value of updatetype is 'partialreplace' then it will perform an upsert type operation + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="objectName">LoginRadius Custom Object Name</param> + /// <param name="objectRecordId">Unique identifier of the user's record in Custom Object</param> + /// <param name="payload">LoginRadius Custom Object Name</param> + /// <param name="updateType">Possible values: replace, partialreplace.</param> + /// <returns>Response containing Definition for Complete user custom object data</returns> + /// 6.2 + + public ApiResponse<UserCustomObjectData> UpdateCustomObjectByToken(string accessToken, string objectName, + string objectRecordId, object payload, CustomObjectUpdateOperationType? updateType = null) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + if (string.IsNullOrWhiteSpace(objectName)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(objectName)); + } + if (string.IsNullOrWhiteSpace(objectRecordId)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(objectRecordId)); + } + if (payload == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(payload)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "objectName", objectName } + }; + if (updateType != null) + { + queryParameters.Add("updateType", updateType.ToString()); + } + + var resourcePath = $"identity/v2/auth/customobject/{objectRecordId}"; + + return ConfigureAndExecute<UserCustomObjectData>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(payload)); + } + /// <summary> + /// This API is used to retrieve the specified Custom Object data for the specified account. + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="objectName">LoginRadius Custom Object Name</param> + /// <returns>Complete user CustomObject data</returns> + /// 6.3 + + public ApiResponse<ListData<UserCustomObjectData>> GetCustomObjectByToken(string accessToken, string objectName) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + if (string.IsNullOrWhiteSpace(objectName)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(objectName)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "objectName", objectName } + }; + + var resourcePath = "identity/v2/auth/customobject"; + + return ConfigureAndExecute<ListData<UserCustomObjectData>>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API is used to retrieve the Custom Object data for the specified account. + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="objectName">LoginRadius Custom Object Name</param> + /// <param name="objectRecordId">Unique identifier of the user's record in Custom Object</param> + /// <returns>Response containing Definition for Complete user custom object data</returns> + /// 6.4 + + public ApiResponse<UserCustomObjectData> GetCustomObjectByRecordIDAndToken(string accessToken, string objectName, + string objectRecordId) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + if (string.IsNullOrWhiteSpace(objectName)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(objectName)); + } + if (string.IsNullOrWhiteSpace(objectRecordId)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(objectRecordId)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "objectName", objectName } + }; + + var resourcePath = $"identity/v2/auth/customobject/{objectRecordId}"; + + return ConfigureAndExecute<UserCustomObjectData>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API is used to remove the specified Custom Object data using ObjectRecordId of a specified account. + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="objectName">LoginRadius Custom Object Name</param> + /// <param name="objectRecordId">Unique identifier of the user's record in Custom Object</param> + /// <returns>Response containing Definition of Delete Request</returns> + /// 6.5 + + public ApiResponse<DeleteResponse> DeleteCustomObjectByToken(string accessToken, string objectName, + string objectRecordId) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + if (string.IsNullOrWhiteSpace(objectName)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(objectName)); + } + if (string.IsNullOrWhiteSpace(objectRecordId)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(objectRecordId)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "objectName", objectName } + }; + + var resourcePath = $"identity/v2/auth/customobject/{objectRecordId}"; + + return ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, null); + } + /// <summary> + /// This API is used to write information in JSON format to the custom object for the specified account. + /// </summary> + /// <param name="objectName">LoginRadius Custom Object Name</param> + /// <param name="payload">LoginRadius Custom Object Name</param> + /// <param name="uid">UID, the unified identifier for each user account</param> + /// <returns>Response containing Definition for Complete user custom object data</returns> + /// 19.1 + + public ApiResponse<UserCustomObjectData> CreateCustomObjectByUid(string objectName, object payload, + string uid) + { + if (string.IsNullOrWhiteSpace(objectName)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(objectName)); + } + if (payload == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(payload)); + } + if (string.IsNullOrWhiteSpace(uid)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(uid)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] }, + { "objectName", objectName } + }; + + var resourcePath = $"identity/v2/manage/account/{uid}/customobject"; + + return ConfigureAndExecute<UserCustomObjectData>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(payload)); + } + /// <summary> + /// This API is used to update the specified custom object data of a specified account. If the value of updatetype is 'replace' then it will fully replace custom object with new custom object and if the value of updatetype is partialreplace then it will perform an upsert type operation. + /// </summary> + /// <param name="objectName">LoginRadius Custom Object Name</param> + /// <param name="objectRecordId">Unique identifier of the user's record in Custom Object</param> + /// <param name="payload">LoginRadius Custom Object Name</param> + /// <param name="uid">UID, the unified identifier for each user account</param> + /// <param name="updateType">Possible values: replace, partialreplace.</param> + /// <returns>Response containing Definition for Complete user custom object data</returns> + /// 19.2 + + public ApiResponse<UserCustomObjectData> UpdateCustomObjectByUid(string objectName, string objectRecordId, + object payload, string uid, CustomObjectUpdateOperationType? updateType = null) + { + if (string.IsNullOrWhiteSpace(objectName)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(objectName)); + } + if (string.IsNullOrWhiteSpace(objectRecordId)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(objectRecordId)); + } + if (payload == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(payload)); + } + if (string.IsNullOrWhiteSpace(uid)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(uid)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] }, + { "objectName", objectName } + }; + if (updateType != null) + { + queryParameters.Add("updateType", updateType.ToString()); + } + + var resourcePath = $"identity/v2/manage/account/{uid}/customobject/{objectRecordId}"; + + return ConfigureAndExecute<UserCustomObjectData>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(payload)); + } + /// <summary> + /// This API is used to retrieve all the custom objects by UID from cloud storage. + /// </summary> + /// <param name="objectName">LoginRadius Custom Object Name</param> + /// <param name="uid">UID, the unified identifier for each user account</param> + /// <returns>Complete user CustomObject data</returns> + /// 19.3 + + public ApiResponse<ListData<UserCustomObjectData>> GetCustomObjectByUid(string objectName, string uid) + { + if (string.IsNullOrWhiteSpace(objectName)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(objectName)); + } + if (string.IsNullOrWhiteSpace(uid)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(uid)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] }, + { "objectName", objectName } + }; + + var resourcePath = $"identity/v2/manage/account/{uid}/customobject"; + + return ConfigureAndExecute<ListData<UserCustomObjectData>>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API is used to retrieve the Custom Object data for the specified account. + /// </summary> + /// <param name="objectName">LoginRadius Custom Object Name</param> + /// <param name="objectRecordId">Unique identifier of the user's record in Custom Object</param> + /// <param name="uid">UID, the unified identifier for each user account</param> + /// <returns>Response containing Definition for Complete user custom object data</returns> + /// 19.4 + + public ApiResponse<UserCustomObjectData> GetCustomObjectByRecordID(string objectName, string objectRecordId, + string uid) + { + if (string.IsNullOrWhiteSpace(objectName)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(objectName)); + } + if (string.IsNullOrWhiteSpace(objectRecordId)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(objectRecordId)); + } + if (string.IsNullOrWhiteSpace(uid)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(uid)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] }, + { "objectName", objectName } + }; + + var resourcePath = $"identity/v2/manage/account/{uid}/customobject/{objectRecordId}"; + + return ConfigureAndExecute<UserCustomObjectData>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API is used to remove the specified Custom Object data using ObjectRecordId of specified account. + /// </summary> + /// <param name="objectName">LoginRadius Custom Object Name</param> + /// <param name="objectRecordId">Unique identifier of the user's record in Custom Object</param> + /// <param name="uid">UID, the unified identifier for each user account</param> + /// <returns>Response containing Definition of Delete Request</returns> + /// 19.5 + + public ApiResponse<DeleteResponse> DeleteCustomObjectByRecordID(string objectName, string objectRecordId, + string uid) + { + if (string.IsNullOrWhiteSpace(objectName)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(objectName)); + } + if (string.IsNullOrWhiteSpace(objectRecordId)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(objectRecordId)); + } + if (string.IsNullOrWhiteSpace(uid)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(uid)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] }, + { "objectName", objectName } + }; + + var resourcePath = $"identity/v2/manage/account/{uid}/customobject/{objectRecordId}"; + + return ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, null); + } + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Api/Advanced/CustomRegistrationDataApi.cs b/Source/LoginRadiusSDK.V2/Api/Advanced/CustomRegistrationDataApi.cs new file mode 100644 index 0000000..0b6c395 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Api/Advanced/CustomRegistrationDataApi.cs @@ -0,0 +1,227 @@ +//----------------------------------------------------------------------- +// <copyright file="CustomRegistrationDataApi.cs" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using LoginRadiusSDK.V2.Common; +using LoginRadiusSDK.V2.Util; +using LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects; +using LoginRadiusSDK.V2.Models.RequestModels; + +namespace LoginRadiusSDK.V2.Api.Advanced +{ + public class CustomRegistrationDataApi : LoginRadiusResource + { + /// <summary> + /// This API is used to retrieve dropdown data. + /// </summary> + /// <param name="type">Type of the Datasource</param> + /// <param name="limit">Retrieve number of records at a time(max limit is 50)</param> + /// <param name="parentId">Id of parent dropdown member(if any).</param> + /// <param name="skip">Skip number of records from start</param> + /// <returns>Complete user Registration data</returns> + /// 7.1 + + public ApiResponse<List<RegistrationDataField>> AuthGetRegistrationData(string type, int? limit = null, + string parentId = null, int? skip = null) + { + if (string.IsNullOrWhiteSpace(type)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(type)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + if (limit != null) + { + queryParameters.Add("limit", limit.ToString()); + } + if (!string.IsNullOrWhiteSpace(parentId)) + { + queryParameters.Add("parentId", parentId); + } + if (skip != null) + { + queryParameters.Add("skip", skip.ToString()); + } + + var resourcePath = $"identity/v2/auth/registrationdata/{type}"; + + return ConfigureAndExecute<List<RegistrationDataField>>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API allows you to validate code for a particular dropdown member. + /// </summary> + /// <param name="code">Secret Code</param> + /// <param name="recordId">Selected dropdown item’s record id</param> + /// <returns>Response containing Definition of Complete Validation data</returns> + /// 7.2 + + public ApiResponse<PostValidationResponse> ValidateRegistrationDataCode(string code, string recordId) + { + if (string.IsNullOrWhiteSpace(code)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(code)); + } + if (string.IsNullOrWhiteSpace(recordId)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(recordId)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + + var bodyParameters = new BodyParameters + { + { "code", code }, + { "recordId", recordId } + }; + + var resourcePath = "identity/v2/auth/registrationdata/validatecode"; + + return ConfigureAndExecute<PostValidationResponse>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + } + /// <summary> + /// This API is used to retrieve dropdown data. + /// </summary> + /// <param name="type">Type of the Datasource</param> + /// <param name="limit">Retrive number of records at a time(max limit is 50</param> + /// <param name="parentId">Id of parent dropdown member(if any).</param> + /// <param name="skip">Skip number of records from start</param> + /// <returns>Complete user Registration data Fields</returns> + /// 16.1 + + public ApiResponse<List<RegistrationDataField>> GetRegistrationData(string type, int? limit = null, + string parentId = null, int? skip = null) + { + if (string.IsNullOrWhiteSpace(type)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(type)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + if (limit != null) + { + queryParameters.Add("limit", limit.ToString()); + } + if (!string.IsNullOrWhiteSpace(parentId)) + { + queryParameters.Add("parentId", parentId); + } + if (skip != null) + { + queryParameters.Add("skip", skip.ToString()); + } + + var resourcePath = $"identity/v2/manage/registrationdata/{type}"; + + return ConfigureAndExecute<List<RegistrationDataField>>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API allows you to fill data into a dropdown list which you have created for user Registeration. For more details on how to use this API please see our Custom Registration Data Overview + /// </summary> + /// <param name="registrationDataCreateModelList">Model Class containing Definition of List of Registration Data</param> + /// <returns>Response containing Definition of Complete Validation data</returns> + /// 16.2 + + public ApiResponse<PostResponse> AddRegistrationData(RegistrationDataCreateModelList registrationDataCreateModelList) + { + if (registrationDataCreateModelList == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(registrationDataCreateModelList)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + + var resourcePath = "identity/v2/manage/registrationdata"; + + return ConfigureAndExecute<PostResponse>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(registrationDataCreateModelList)); + } + /// <summary> + /// This API allows you to update a dropdown item + /// </summary> + /// <param name="registrationDataUpdateModel">Model Class containing Definition of payload for Registration Data update API</param> + /// <param name="recordId">Registration data RecordId</param> + /// <returns>Complete user Registration data Field</returns> + /// 16.3 + + public ApiResponse<UserProfilePostResponse<RegistrationDataField>> UpdateRegistrationData(RegistrationDataUpdateModel registrationDataUpdateModel, string recordId) + { + if (registrationDataUpdateModel == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(registrationDataUpdateModel)); + } + if (string.IsNullOrWhiteSpace(recordId)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(recordId)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + + var resourcePath = $"identity/v2/manage/registrationdata/{recordId}"; + + return ConfigureAndExecute<UserProfilePostResponse<RegistrationDataField>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(registrationDataUpdateModel)); + } + /// <summary> + /// This API allows you to delete an item from a dropdown list. + /// </summary> + /// <param name="recordId">Registration data RecordId</param> + /// <returns>Response containing Definition of Delete Request</returns> + /// 16.4 + + public ApiResponse<DeleteResponse> DeleteRegistrationData(string recordId) + { + if (string.IsNullOrWhiteSpace(recordId)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(recordId)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + + var resourcePath = $"identity/v2/manage/registrationdata/{recordId}"; + + return ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, null); + } + /// <summary> + /// This API allows you to delete all records contained in a datasource. + /// </summary> + /// <param name="type">Type of the Datasource</param> + /// <returns>Response containing Definition of Delete Request</returns> + /// 16.5 + + public ApiResponse<DeleteResponse> DeleteAllRecordsByDataSource(string type) + { + if (string.IsNullOrWhiteSpace(type)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(type)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + + var resourcePath = $"identity/v2/manage/registrationdata/type/{type}"; + + return ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, null); + } + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Api/Advanced/MultiFactorAuthenticationApi.cs b/Source/LoginRadiusSDK.V2/Api/Advanced/MultiFactorAuthenticationApi.cs new file mode 100644 index 0000000..197aeca --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Api/Advanced/MultiFactorAuthenticationApi.cs @@ -0,0 +1,898 @@ +//----------------------------------------------------------------------- +// <copyright file="MultiFactorAuthenticationApi.cs" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System; +using LoginRadiusSDK.V2.Common; +using LoginRadiusSDK.V2.Util; +using LoginRadiusSDK.V2.Models.ResponseModels; +using LoginRadiusSDK.V2.Models.ResponseModels.UserProfile; +using LoginRadiusSDK.V2.Models.RequestModels; +using LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects; + +namespace LoginRadiusSDK.V2.Api.Advanced +{ + public class MultiFactorAuthenticationApi : LoginRadiusResource + { + /// <summary> + /// This API is used to configure the Multi-factor authentication after login by using the access_token when MFA is set as optional on the LoginRadius site. + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="smsTemplate2FA">SMS Template Name</param> + /// <returns>Response containing Definition of Complete Multi-Factor Authentication Settings data</returns> + /// 5.7 + + public ApiResponse<MultiFactorAuthenticationSettingsResponse> MFAConfigureByAccessToken(string accessToken, string smsTemplate2FA = null) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + if (!string.IsNullOrWhiteSpace(smsTemplate2FA)) + { + queryParameters.Add("smsTemplate2FA", smsTemplate2FA); + } + + var resourcePath = "identity/v2/auth/account/2fa"; + + return ConfigureAndExecute<MultiFactorAuthenticationSettingsResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API is used to trigger the Multi-factor authentication settings after login for secure actions + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="multiFactorAuthModelWithLockout">Model Class containing Definition of payload for MultiFactorAuthModel With Lockout API</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <returns>Response containing Definition for Complete profile data</returns> + /// 5.9 + + public ApiResponse<Identity> MFAUpdateSetting(string accessToken, MultiFactorAuthModelWithLockout multiFactorAuthModelWithLockout, + string fields = "") + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + if (multiFactorAuthModelWithLockout == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(multiFactorAuthModelWithLockout)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + + var resourcePath = "identity/v2/auth/account/2fa/verification/otp"; + + return ConfigureAndExecute<Identity>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(multiFactorAuthModelWithLockout)); + } + /// <summary> + /// This API is used to Enable Multi-factor authentication by access token on user login + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="multiFactorAuthModelByGoogleAuthenticatorCode">Model Class containing Definition of payload for MultiFactorAuthModel By GoogleAuthenticator Code API</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <param name="smsTemplate">SMS Template name</param> + /// <returns>Response containing Definition for Complete profile data</returns> + /// 5.10 + + public ApiResponse<Identity> MFAUpdateByAccessToken(string accessToken, MultiFactorAuthModelByGoogleAuthenticatorCode multiFactorAuthModelByGoogleAuthenticatorCode, + string fields = "", string smsTemplate = null) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + if (multiFactorAuthModelByGoogleAuthenticatorCode == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(multiFactorAuthModelByGoogleAuthenticatorCode)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + if (!string.IsNullOrWhiteSpace(smsTemplate)) + { + queryParameters.Add("smsTemplate", smsTemplate); + } + + var resourcePath = "identity/v2/auth/account/2fa/verification/googleauthenticatorcode"; + + return ConfigureAndExecute<Identity>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(multiFactorAuthModelByGoogleAuthenticatorCode)); + } + /// <summary> + /// This API is used to update the Multi-factor authentication phone number by sending the verification OTP to the provided phone number + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="phoneNo2FA">Phone Number For 2FA</param> + /// <param name="smsTemplate2FA">SMS Template Name</param> + /// <returns>Response containing Definition for Complete SMS data</returns> + /// 5.11 + + public ApiResponse<SMSResponseData> MFAUpdatePhoneNumberByToken(string accessToken, string phoneNo2FA, + string smsTemplate2FA = null) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + if (string.IsNullOrWhiteSpace(phoneNo2FA)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(phoneNo2FA)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + if (!string.IsNullOrWhiteSpace(smsTemplate2FA)) + { + queryParameters.Add("smsTemplate2FA", smsTemplate2FA); + } + + var bodyParameters = new BodyParameters + { + { "phoneNo2FA", phoneNo2FA } + }; + + var resourcePath = "identity/v2/auth/account/2fa"; + + return ConfigureAndExecute<SMSResponseData>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + } + /// <summary> + /// This API Resets the Google Authenticator configurations on a given account via the access_token + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="googleAuthenticator">boolean type value,Enable google Authenticator Code.</param> + /// <returns>Response containing Definition of Delete Request</returns> + /// 5.12.1 + + public ApiResponse<DeleteResponse> MFAResetGoogleAuthByToken(string accessToken, bool googleAuthenticator) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + + var bodyParameters = new BodyParameters + { + { "googleauthenticator", googleAuthenticator } + }; + + var resourcePath = "identity/v2/auth/account/2fa/authenticator"; + + return ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + } + /// <summary> + /// This API resets the SMS Authenticator configurations on a given account via the access_token. + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="otpAuthenticator">Pass 'otpauthenticator' to remove SMS Authenticator</param> + /// <returns>Response containing Definition of Delete Request</returns> + /// 5.12.2 + + public ApiResponse<DeleteResponse> MFAResetSMSAuthByToken(string accessToken, bool otpAuthenticator) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + + var bodyParameters = new BodyParameters + { + { "otpauthenticator", otpAuthenticator } + }; + + var resourcePath = "identity/v2/auth/account/2fa/authenticator"; + + return ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + } + /// <summary> + /// This API is used to get a set of backup codes via access_token to allow the user login on a site that has Multi-factor Authentication enabled in the event that the user does not have a secondary factor available. We generate 10 codes, each code can only be consumed once. If any user attempts to go over the number of invalid login attempts configured in the Dashboard then the account gets blocked automatically + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <returns>Response containing Definition of Complete Backup Code data</returns> + /// 5.13 + + public ApiResponse<BackupCodeResponse> MFABackupCodeByAccessToken(string accessToken) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + + var resourcePath = "identity/v2/auth/account/2fa/backupcode"; + + return ConfigureAndExecute<BackupCodeResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// API is used to reset the backup codes on a given account via the access_token. This API call will generate 10 new codes, each code can only be consumed once + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <returns>Response containing Definition of Complete Backup Code data</returns> + /// 5.14 + + public ApiResponse<BackupCodeResponse> MFAResetBackupCodeByAccessToken(string accessToken) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + + var resourcePath = "identity/v2/auth/account/2fa/backupcode/reset"; + + return ConfigureAndExecute<BackupCodeResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API can be used to login by emailid on a Multi-factor authentication enabled LoginRadius site. + /// </summary> + /// <param name="email">user's email</param> + /// <param name="password">Password for the email</param> + /// <param name="emailTemplate">Email template name</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <param name="loginUrl">Url where the user is logging from</param> + /// <param name="smsTemplate">SMS Template name</param> + /// <param name="smsTemplate2FA">SMS Template Name</param> + /// <param name="verificationUrl">Email verification url</param> + /// <returns>Complete user UserProfile data</returns> + /// 9.8.1 + + public ApiResponse<MultiFactorAuthenticationResponse<Identity>> MFALoginByEmail(string email, string password, + string emailTemplate = null, string fields = "", string loginUrl = null, string smsTemplate = null, string smsTemplate2FA = null, + string verificationUrl = null) + { + if (string.IsNullOrWhiteSpace(email)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(email)); + } + if (string.IsNullOrWhiteSpace(password)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(password)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + if (!string.IsNullOrWhiteSpace(emailTemplate)) + { + queryParameters.Add("emailTemplate", emailTemplate); + } + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + if (!string.IsNullOrWhiteSpace(loginUrl)) + { + queryParameters.Add("loginUrl", loginUrl); + } + if (!string.IsNullOrWhiteSpace(smsTemplate)) + { + queryParameters.Add("smsTemplate", smsTemplate); + } + if (!string.IsNullOrWhiteSpace(smsTemplate2FA)) + { + queryParameters.Add("smsTemplate2FA", smsTemplate2FA); + } + if (!string.IsNullOrWhiteSpace(verificationUrl)) + { + queryParameters.Add("verificationUrl", verificationUrl); + } + + var bodyParameters = new BodyParameters + { + { "email", email }, + { "password", password } + }; + + var resourcePath = "identity/v2/auth/login/2fa"; + + return ConfigureAndExecute<MultiFactorAuthenticationResponse<Identity>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + } + /// <summary> + /// This API can be used to login by username on a Multi-factor authentication enabled LoginRadius site. + /// </summary> + /// <param name="password">Password for the email</param> + /// <param name="username">Username of the user</param> + /// <param name="emailTemplate">Email template name</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <param name="loginUrl">Url where the user is logging from</param> + /// <param name="smsTemplate">SMS Template name</param> + /// <param name="smsTemplate2FA">SMS Template Name</param> + /// <param name="verificationUrl">Email verification url</param> + /// <returns>Complete user UserProfile data</returns> + /// 9.8.2 + + public ApiResponse<MultiFactorAuthenticationResponse<Identity>> MFALoginByUserName(string password, string username, + string emailTemplate = null, string fields = "", string loginUrl = null, string smsTemplate = null, string smsTemplate2FA = null, + string verificationUrl = null) + { + if (string.IsNullOrWhiteSpace(password)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(password)); + } + if (string.IsNullOrWhiteSpace(username)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(username)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + if (!string.IsNullOrWhiteSpace(emailTemplate)) + { + queryParameters.Add("emailTemplate", emailTemplate); + } + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + if (!string.IsNullOrWhiteSpace(loginUrl)) + { + queryParameters.Add("loginUrl", loginUrl); + } + if (!string.IsNullOrWhiteSpace(smsTemplate)) + { + queryParameters.Add("smsTemplate", smsTemplate); + } + if (!string.IsNullOrWhiteSpace(smsTemplate2FA)) + { + queryParameters.Add("smsTemplate2FA", smsTemplate2FA); + } + if (!string.IsNullOrWhiteSpace(verificationUrl)) + { + queryParameters.Add("verificationUrl", verificationUrl); + } + + var bodyParameters = new BodyParameters + { + { "password", password }, + { "username", username } + }; + + var resourcePath = "identity/v2/auth/login/2fa"; + + return ConfigureAndExecute<MultiFactorAuthenticationResponse<Identity>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + } + /// <summary> + /// This API can be used to login by Phone on a Multi-factor authentication enabled LoginRadius site. + /// </summary> + /// <param name="password">Password for the email</param> + /// <param name="phone">New Phone Number</param> + /// <param name="emailTemplate">Email template name</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <param name="loginUrl">Url where the user is logging from</param> + /// <param name="smsTemplate">SMS Template name</param> + /// <param name="smsTemplate2FA">SMS Template Name</param> + /// <param name="verificationUrl">Email verification url</param> + /// <returns>Complete user UserProfile data</returns> + /// 9.8.3 + + public ApiResponse<MultiFactorAuthenticationResponse<Identity>> MFALoginByPhone(string password, string phone, + string emailTemplate = null, string fields = "", string loginUrl = null, string smsTemplate = null, string smsTemplate2FA = null, + string verificationUrl = null) + { + if (string.IsNullOrWhiteSpace(password)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(password)); + } + if (string.IsNullOrWhiteSpace(phone)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(phone)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + if (!string.IsNullOrWhiteSpace(emailTemplate)) + { + queryParameters.Add("emailTemplate", emailTemplate); + } + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + if (!string.IsNullOrWhiteSpace(loginUrl)) + { + queryParameters.Add("loginUrl", loginUrl); + } + if (!string.IsNullOrWhiteSpace(smsTemplate)) + { + queryParameters.Add("smsTemplate", smsTemplate); + } + if (!string.IsNullOrWhiteSpace(smsTemplate2FA)) + { + queryParameters.Add("smsTemplate2FA", smsTemplate2FA); + } + if (!string.IsNullOrWhiteSpace(verificationUrl)) + { + queryParameters.Add("verificationUrl", verificationUrl); + } + + var bodyParameters = new BodyParameters + { + { "password", password }, + { "phone", phone } + }; + + var resourcePath = "identity/v2/auth/login/2fa"; + + return ConfigureAndExecute<MultiFactorAuthenticationResponse<Identity>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + } + /// <summary> + /// This API is used to login via Multi-factor authentication by passing the One Time Password received via SMS + /// </summary> + /// <param name="multiFactorAuthModelWithLockout">Model Class containing Definition of payload for MultiFactorAuthModel With Lockout API</param> + /// <param name="secondFactorAuthenticationToken">A Uniquely generated MFA identifier token after successful authentication</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <param name="smsTemplate2FA">SMS Template Name</param> + /// <returns>Complete user UserProfile data</returns> + /// 9.12 + + public ApiResponse<AccessToken<Identity>> MFAValidateOTPByPhone(MultiFactorAuthModelWithLockout multiFactorAuthModelWithLockout, string secondFactorAuthenticationToken, + string fields = "", string smsTemplate2FA = null) + { + if (multiFactorAuthModelWithLockout == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(multiFactorAuthModelWithLockout)); + } + if (string.IsNullOrWhiteSpace(secondFactorAuthenticationToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(secondFactorAuthenticationToken)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "secondFactorAuthenticationToken", secondFactorAuthenticationToken } + }; + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + if (!string.IsNullOrWhiteSpace(smsTemplate2FA)) + { + queryParameters.Add("smsTemplate2FA", smsTemplate2FA); + } + + var resourcePath = "identity/v2/auth/login/2fa/verification/otp"; + + return ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(multiFactorAuthModelWithLockout)); + } + /// <summary> + /// This API is used to login via Multi-factor-authentication by passing the google authenticator code. + /// </summary> + /// <param name="googleAuthenticatorCode">The code generated by google authenticator app after scanning QR code</param> + /// <param name="secondFactorAuthenticationToken">A Uniquely generated MFA identifier token after successful authentication</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <param name="smsTemplate2FA">SMS Template Name</param> + /// <returns>Complete user UserProfile data</returns> + /// 9.13 + + public ApiResponse<AccessToken<Identity>> MFAValidateGoogleAuthCode(string googleAuthenticatorCode, string secondFactorAuthenticationToken, + string fields = "", string smsTemplate2FA = null) + { + if (string.IsNullOrWhiteSpace(googleAuthenticatorCode)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(googleAuthenticatorCode)); + } + if (string.IsNullOrWhiteSpace(secondFactorAuthenticationToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(secondFactorAuthenticationToken)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "secondFactorAuthenticationToken", secondFactorAuthenticationToken } + }; + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + if (!string.IsNullOrWhiteSpace(smsTemplate2FA)) + { + queryParameters.Add("smsTemplate2FA", smsTemplate2FA); + } + + var bodyParameters = new BodyParameters + { + { "googleAuthenticatorCode", googleAuthenticatorCode } + }; + + var resourcePath = "identity/v2/auth/login/2fa/verification/googleauthenticatorcode"; + + return ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + } + /// <summary> + /// This API is used to validate the backup code provided by the user and if valid, we return an access_token allowing the user to login incases where Multi-factor authentication (MFA) is enabled and the secondary factor is unavailable. When a user initially downloads the Backup codes, We generate 10 codes, each code can only be consumed once. if any user attempts to go over the number of invalid login attempts configured in the Dashboard then the account gets blocked automatically + /// </summary> + /// <param name="multiFactorAuthModelByBackupCode">Model Class containing Definition of payload for MultiFactorAuth By BackupCode API</param> + /// <param name="secondFactorAuthenticationToken">A Uniquely generated MFA identifier token after successful authentication</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <returns>Complete user UserProfile data</returns> + /// 9.14 + + public ApiResponse<AccessToken<Identity>> MFAValidateBackupCode(MultiFactorAuthModelByBackupCode multiFactorAuthModelByBackupCode, string secondFactorAuthenticationToken, + string fields = "") + { + if (multiFactorAuthModelByBackupCode == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(multiFactorAuthModelByBackupCode)); + } + if (string.IsNullOrWhiteSpace(secondFactorAuthenticationToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(secondFactorAuthenticationToken)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "secondFactorAuthenticationToken", secondFactorAuthenticationToken } + }; + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + + var resourcePath = "identity/v2/auth/login/2fa/verification/backupcode"; + + return ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(multiFactorAuthModelByBackupCode)); + } + /// <summary> + /// This API is used to update (if configured) the phone number used for Multi-factor authentication by sending the verification OTP to the provided phone number + /// </summary> + /// <param name="phoneNo2FA">Phone Number For 2FA</param> + /// <param name="secondFactorAuthenticationToken">A Uniquely generated MFA identifier token after successful authentication</param> + /// <param name="smsTemplate2FA">SMS Template Name</param> + /// <returns>Response containing Definition for Complete SMS data</returns> + /// 9.16 + + public ApiResponse<SMSResponseData> MFAUpdatePhoneNumber(string phoneNo2FA, string secondFactorAuthenticationToken, + string smsTemplate2FA = null) + { + if (string.IsNullOrWhiteSpace(phoneNo2FA)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(phoneNo2FA)); + } + if (string.IsNullOrWhiteSpace(secondFactorAuthenticationToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(secondFactorAuthenticationToken)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "secondFactorAuthenticationToken", secondFactorAuthenticationToken } + }; + if (!string.IsNullOrWhiteSpace(smsTemplate2FA)) + { + queryParameters.Add("smsTemplate2FA", smsTemplate2FA); + } + + var bodyParameters = new BodyParameters + { + { "phoneNo2FA", phoneNo2FA } + }; + + var resourcePath = "identity/v2/auth/login/2fa"; + + return ConfigureAndExecute<SMSResponseData>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + } + /// <summary> + /// This API is used to resending the verification OTP to the provided phone number + /// </summary> + /// <param name="secondFactorAuthenticationToken">A Uniquely generated MFA identifier token after successful authentication</param> + /// <param name="smsTemplate2FA">SMS Template Name</param> + /// <returns>Response containing Definition for Complete SMS data</returns> + /// 9.17 + + public ApiResponse<SMSResponseData> MFAResendOTP(string secondFactorAuthenticationToken, string smsTemplate2FA = null) + { + if (string.IsNullOrWhiteSpace(secondFactorAuthenticationToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(secondFactorAuthenticationToken)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "secondFactorAuthenticationToken", secondFactorAuthenticationToken } + }; + if (!string.IsNullOrWhiteSpace(smsTemplate2FA)) + { + queryParameters.Add("smsTemplate2FA", smsTemplate2FA); + } + + var resourcePath = "identity/v2/auth/login/2fa/resend"; + + return ConfigureAndExecute<SMSResponseData>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API is used to trigger the Multi-Factor Autentication workflow for the provided access_token + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="smsTemplate2FA">SMS Template Name</param> + /// <returns>Response containing Definition of Complete Multi-Factor Authentication Settings data</returns> + /// 14.3 + + public ApiResponse<MultiFactorAuthenticationSettingsResponse> MFAReAuthenticate(string accessToken, string smsTemplate2FA = null) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + if (!string.IsNullOrWhiteSpace(smsTemplate2FA)) + { + queryParameters.Add("smsTemplate2FA", smsTemplate2FA); + } + + var resourcePath = "identity/v2/auth/account/reauth/2fa"; + + return ConfigureAndExecute<MultiFactorAuthenticationSettingsResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API is used to re-authenticate via Multi-factor authentication by passing the One Time Password received via SMS + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="reauthByOtpModel">Model Class containing Definition for MFA Reauthentication by OTP</param> + /// <returns>Complete user Multi-Factor Authentication Token data</returns> + /// 14.4 + + public ApiResponse<EventBasedMultiFactorAuthenticationToken> MFAReAuthenticateByOTP(string accessToken, ReauthByOtpModel reauthByOtpModel) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + if (reauthByOtpModel == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(reauthByOtpModel)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + + var resourcePath = "identity/v2/auth/account/reauth/2fa/otp"; + + return ConfigureAndExecute<EventBasedMultiFactorAuthenticationToken>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(reauthByOtpModel)); + } + /// <summary> + /// This API is used to re-authenticate by set of backup codes via access_token on the site that has Multi-factor authentication enabled in re-authentication for the user that does not have the device + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="reauthByBackupCodeModel">Model Class containing Definition for MFA Reauthentication by Backup code</param> + /// <returns>Complete user Multi-Factor Authentication Token data</returns> + /// 14.5 + + public ApiResponse<EventBasedMultiFactorAuthenticationToken> MFAReAuthenticateByBackupCode(string accessToken, ReauthByBackupCodeModel reauthByBackupCodeModel) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + if (reauthByBackupCodeModel == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(reauthByBackupCodeModel)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + + var resourcePath = "identity/v2/auth/account/reauth/2fa/backupcode"; + + return ConfigureAndExecute<EventBasedMultiFactorAuthenticationToken>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(reauthByBackupCodeModel)); + } + /// <summary> + /// This API is used to re-authenticate via Multi-factor-authentication by passing the google authenticator code + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="reauthByGoogleAuthenticatorCodeModel">Model Class containing Definition for MFA Reauthentication by Google Authenticator</param> + /// <returns>Complete user Multi-Factor Authentication Token data</returns> + /// 14.6 + + public ApiResponse<EventBasedMultiFactorAuthenticationToken> MFAReAuthenticateByGoogleAuth(string accessToken, ReauthByGoogleAuthenticatorCodeModel reauthByGoogleAuthenticatorCodeModel) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + if (reauthByGoogleAuthenticatorCodeModel == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(reauthByGoogleAuthenticatorCodeModel)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + + var resourcePath = "identity/v2/auth/account/reauth/2fa/googleauthenticatorcode"; + + return ConfigureAndExecute<EventBasedMultiFactorAuthenticationToken>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(reauthByGoogleAuthenticatorCodeModel)); + } + /// <summary> + /// This API is used to re-authenticate via Multi-factor-authentication by passing the password + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="passwordEventBasedAuthModelWithLockout">Model Class containing Definition of payload for PasswordEventBasedAuthModel with Lockout API</param> + /// <param name="smsTemplate2FA">SMS Template Name</param> + /// <returns>Complete user Multi-Factor Authentication Token data</returns> + /// 14.7 + + public ApiResponse<EventBasedMultiFactorAuthenticationToken> MFAReAuthenticateByPassword(string accessToken, PasswordEventBasedAuthModelWithLockout passwordEventBasedAuthModelWithLockout, + string smsTemplate2FA = null) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + if (passwordEventBasedAuthModelWithLockout == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(passwordEventBasedAuthModelWithLockout)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + if (!string.IsNullOrWhiteSpace(smsTemplate2FA)) + { + queryParameters.Add("smsTemplate2FA", smsTemplate2FA); + } + + var resourcePath = "identity/v2/auth/account/reauth/password"; + + return ConfigureAndExecute<EventBasedMultiFactorAuthenticationToken>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(passwordEventBasedAuthModelWithLockout)); + } + /// <summary> + /// This API resets the SMS Authenticator configurations on a given account via the UID. + /// </summary> + /// <param name="otpAuthenticator">Pass 'otpauthenticator' to remove SMS Authenticator</param> + /// <param name="uid">UID, the unified identifier for each user account</param> + /// <returns>Response containing Definition of Delete Request</returns> + /// 18.21.1 + + public ApiResponse<DeleteResponse> MFAResetSMSAuthenticatorByUid(bool otpAuthenticator, string uid) + { + if (string.IsNullOrWhiteSpace(uid)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(uid)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] }, + { "uid", uid } + }; + + var bodyParameters = new BodyParameters + { + { "otpauthenticator", otpAuthenticator } + }; + + var resourcePath = "identity/v2/manage/account/2fa/authenticator"; + + return ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + } + /// <summary> + /// This API resets the Google Authenticator configurations on a given account via the UID. + /// </summary> + /// <param name="googleAuthenticator">boolean type value,Enable google Authenticator Code.</param> + /// <param name="uid">UID, the unified identifier for each user account</param> + /// <returns>Response containing Definition of Delete Request</returns> + /// 18.21.2 + + public ApiResponse<DeleteResponse> MFAResetGoogleAuthenticatorByUid(bool googleAuthenticator, string uid) + { + if (string.IsNullOrWhiteSpace(uid)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(uid)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] }, + { "uid", uid } + }; + + var bodyParameters = new BodyParameters + { + { "googleauthenticator", googleAuthenticator } + }; + + var resourcePath = "identity/v2/manage/account/2fa/authenticator"; + + return ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + } + /// <summary> + /// This API is used to reset the backup codes on a given account via the UID. This API call will generate 10 new codes, each code can only be consumed once. + /// </summary> + /// <param name="uid">UID, the unified identifier for each user account</param> + /// <returns>Response containing Definition of Complete Backup Code data</returns> + /// 18.25 + + public ApiResponse<BackupCodeResponse> MFABackupCodeByUid(string uid) + { + if (string.IsNullOrWhiteSpace(uid)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(uid)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] }, + { "uid", uid } + }; + + var resourcePath = "identity/v2/manage/account/2fa/backupcode"; + + return ConfigureAndExecute<BackupCodeResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API is used to reset the backup codes on a given account via the UID. This API call will generate 10 new codes, each code can only be consumed once. + /// </summary> + /// <param name="uid">UID, the unified identifier for each user account</param> + /// <returns>Response containing Definition of Complete Backup Code data</returns> + /// 18.26 + + public ApiResponse<BackupCodeResponse> MFAResetBackupCodeByUid(string uid) + { + if (string.IsNullOrWhiteSpace(uid)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(uid)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] }, + { "uid", uid } + }; + + var resourcePath = "identity/v2/manage/account/2fa/backupcode/reset"; + + return ConfigureAndExecute<BackupCodeResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + } + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Api/Advanced/WebHookApi.cs b/Source/LoginRadiusSDK.V2/Api/Advanced/WebHookApi.cs new file mode 100644 index 0000000..12adbf4 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Api/Advanced/WebHookApi.cs @@ -0,0 +1,107 @@ +//----------------------------------------------------------------------- +// <copyright file="WebHookApi.cs" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System; +using LoginRadiusSDK.V2.Common; +using LoginRadiusSDK.V2.Util; +using LoginRadiusSDK.V2.Models.ResponseModels; +using LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects; + +namespace LoginRadiusSDK.V2.Api.Advanced +{ + public class WebHookApi : LoginRadiusResource + { + /// <summary> + /// This API is used to fatch all the subscribed URLs, for particular event + /// </summary> + /// <param name="@event">Allowed events: Login, Register, UpdateProfile, ResetPassword, ChangePassword, emailVerification, AddEmail, RemoveEmail, BlockAccount, DeleteAccount, SetUsername, AssignRoles, UnassignRoles, SetPassword, LinkAccount, UnlinkAccount, UpdatePhoneId, VerifyPhoneNumber, CreateCustomObject, UpdateCustomobject, DeleteCustomObject</param> + /// <returns>Response Containing List of Webhhook Data</returns> + /// 40.1 + + public ApiResponse<ListData<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.WebHookSubscribeModel>> GetWebHookSubscribedURLs(string @event) + { + if (string.IsNullOrWhiteSpace(@event)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(@event)); + } + var queryParameters = new QueryParameters + { + { "apikey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apisecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] }, + { "event", @event } + }; + + var resourcePath = "api/v2/webhook"; + + return ConfigureAndExecute<ListData<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.WebHookSubscribeModel>>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// API can be used to configure a WebHook on your LoginRadius site. Webhooks also work on subscribe and notification model, subscribe your hook and get a notification. Equivalent to RESThook but these provide security on basis of signature and RESThook work on unique URL. Following are the events that are allowed by LoginRadius to trigger a WebHook service call. + /// </summary> + /// <param name="webHookSubscribeModel">Model Class containing Definition of payload for Webhook Subscribe API</param> + /// <returns>Response containing Definition of Complete Validation data</returns> + /// 40.2 + + public ApiResponse<PostResponse> WebHookSubscribe(LoginRadiusSDK.V2.Models.RequestModels.WebHookSubscribeModel webHookSubscribeModel) + { + if (webHookSubscribeModel == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(webHookSubscribeModel)); + } + var queryParameters = new QueryParameters + { + { "apikey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apisecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + + var resourcePath = "api/v2/webhook"; + + return ConfigureAndExecute<PostResponse>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(webHookSubscribeModel)); + } + /// <summary> + /// API can be used to test a subscribed WebHook. + /// </summary> + /// <returns>Response containing Definition of Complete Validation data</returns> + /// 40.3 + + public ApiResponse<EntityPermissionAcknowledgement> WebhookTest() + { + var queryParameters = new QueryParameters + { + { "apikey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apisecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + + var resourcePath = "api/v2/webhook/test"; + + return ConfigureAndExecute<EntityPermissionAcknowledgement>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// API can be used to unsubscribe a WebHook configured on your LoginRadius site. + /// </summary> + /// <param name="webHookSubscribeModel">Model Class containing Definition of payload for Webhook Subscribe API</param> + /// <returns>Response containing Definition of Delete Request</returns> + /// 40.4 + + public ApiResponse<DeleteResponse> WebHookUnsubscribe(LoginRadiusSDK.V2.Models.RequestModels.WebHookSubscribeModel webHookSubscribeModel) + { + if (webHookSubscribeModel == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(webHookSubscribeModel)); + } + var queryParameters = new QueryParameters + { + { "apikey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "apisecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + + var resourcePath = "api/v2/webhook"; + + return ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, ConvertToJson(webHookSubscribeModel)); + } + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Api/Authentication/AuthenticationApi.cs b/Source/LoginRadiusSDK.V2/Api/Authentication/AuthenticationApi.cs new file mode 100644 index 0000000..0a7f00b --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Api/Authentication/AuthenticationApi.cs @@ -0,0 +1,1320 @@ +//----------------------------------------------------------------------- +// <copyright file="AuthenticationApi.cs" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using LoginRadiusSDK.V2.Common; +using LoginRadiusSDK.V2.Util; +using LoginRadiusSDK.V2.Models.ResponseModels; +using LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects; +using LoginRadiusSDK.V2.Models.ResponseModels.UserProfile; +using LoginRadiusSDK.V2.Models.RequestModels; + +namespace LoginRadiusSDK.V2.Api.Authentication +{ + public class AuthenticationApi : LoginRadiusResource + { + /// <summary> + /// This API is used to update the user's profile by passing the access_token. + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="userProfileUpdateModel">Model Class containing Definition of payload for User Profile update API</param> + /// <param name="emailTemplate">Email template name</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <param name="nullSupport">>Boolean, pass true if you wish to update any user profile field with a NULL value, You can get the details <a href='/api/v2/user-registration/advanced-api-usage#nullsupport0'>Here</a></param> + /// <param name="smsTemplate">SMS Template name</param> + /// <param name="verificationUrl">Email verification url</param> + /// <returns>Response containing Definition of Complete Validation and UserProfile data</returns> + /// 5.4 + + public ApiResponse<UserProfilePostResponse<Identity>> UpdateProfileByAccessToken(string accessToken, object payload, + string emailTemplate = null, string fields = "", bool? nullSupport = null, string smsTemplate = null, string verificationUrl = null) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + if (payload == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(payload)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + if (!string.IsNullOrWhiteSpace(emailTemplate)) + { + queryParameters.Add("emailTemplate", emailTemplate); + } + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + if (nullSupport != false) + { + queryParameters.Add("nullSupport", nullSupport.ToString()); + } + if (!string.IsNullOrWhiteSpace(smsTemplate)) + { + queryParameters.Add("smsTemplate", smsTemplate); + } + if (!string.IsNullOrWhiteSpace(verificationUrl)) + { + queryParameters.Add("verificationUrl", verificationUrl); + } + + var resourcePath = "identity/v2/auth/account"; + + return ConfigureAndExecute<UserProfilePostResponse<Identity>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(payload)); + } + + /// <summary> + /// This API is used to retrieve the list of questions that are configured on the respective LoginRadius site. + /// </summary> + /// <param name="email">Email of the user</param> + /// <returns>Response containing Definition for Complete SecurityQuestions data</returns> + /// 2.1 + + public ApiResponse<List<SecurityQuestions>> GetSecurityQuestionsByEmail(string email) + { + if (string.IsNullOrWhiteSpace(email)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(email)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "email", email } + }; + + var resourcePath = "identity/v2/auth/securityquestion/email"; + + return ConfigureAndExecute<List<SecurityQuestions>>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API is used to retrieve the list of questions that are configured on the respective LoginRadius site. + /// </summary> + /// <param name="userName">UserName of the user</param> + /// <returns>Response containing Definition for Complete SecurityQuestions data</returns> + /// 2.2 + + public ApiResponse<List<SecurityQuestions>> GetSecurityQuestionsByUserName(string userName) + { + if (string.IsNullOrWhiteSpace(userName)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(userName)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "userName", userName } + }; + + var resourcePath = "identity/v2/auth/securityquestion/username"; + + return ConfigureAndExecute<List<SecurityQuestions>>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API is used to retrieve the list of questions that are configured on the respective LoginRadius site. + /// </summary> + /// <param name="phone">The Registered Phone Number</param> + /// <returns>Response containing Definition for Complete SecurityQuestions data</returns> + /// 2.3 + + public ApiResponse<List<SecurityQuestions>> GetSecurityQuestionsByPhone(string phone) + { + if (string.IsNullOrWhiteSpace(phone)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(phone)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "phone", phone } + }; + + var resourcePath = "identity/v2/auth/securityquestion/phone"; + + return ConfigureAndExecute<List<SecurityQuestions>>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API is used to retrieve the list of questions that are configured on the respective LoginRadius site. + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <returns>Response containing Definition for Complete SecurityQuestions data</returns> + /// 2.4 + + public ApiResponse<List<SecurityQuestions>> GetSecurityQuestionsByAccessToken(string accessToken) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + + var resourcePath = "identity/v2/auth/securityquestion/accesstoken"; + + return ConfigureAndExecute<List<SecurityQuestions>>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This api validates access token, if valid then returns a response with its expiry otherwise error. + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <returns>Response containing Definition of Complete Token data</returns> + /// 4.1 + + public ApiResponse<AccessToken> AuthValidateAccessToken(string accessToken) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + + var resourcePath = "identity/v2/auth/access_token/validate"; + + return ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This api call invalidates the active access token or expires an access token's validity. + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="preventRefresh">Boolean value that when set as true, in addition of the access_token being invalidated, it will no longer have the capability of being refreshed.</param> + /// <returns>Response containing Definition of Complete Validation data</returns> + /// 4.2 + + public ApiResponse<PostResponse> AuthInValidateAccessToken(string accessToken, bool preventRefresh = false) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + if (preventRefresh != false) + { + queryParameters.Add("preventRefresh", preventRefresh.ToString()); + } + + var resourcePath = "identity/v2/auth/access_token/invalidate"; + + return ConfigureAndExecute<PostResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This api call provide the active access token Information + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <returns>Response containing Definition of Token Information</returns> + /// 4.3 + + public ApiResponse<TokenInfoResponseModel> GetAccessTokenInfo(string accessToken) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + + var resourcePath = "identity/v2/auth/access_token"; + + return ConfigureAndExecute<TokenInfoResponseModel>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API retrieves a copy of the user data based on the access_token. + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <returns>Response containing Definition for Complete profile data</returns> + /// 5.2 + + public ApiResponse<Identity> GetProfileByAccessToken(string accessToken, string fields = "") + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + + var resourcePath = "identity/v2/auth/account"; + + return ConfigureAndExecute<Identity>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API sends a welcome email + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="welcomeEmailTemplate">Name of the welcome email template</param> + /// <returns>Response containing Definition of Complete Validation data</returns> + /// 5.3 + + public ApiResponse<PostResponse> SendWelcomeEmail(string accessToken, string welcomeEmailTemplate = null) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + if (!string.IsNullOrWhiteSpace(welcomeEmailTemplate)) + { + queryParameters.Add("welcomeEmailTemplate", welcomeEmailTemplate); + } + + var resourcePath = "identity/v2/auth/account/sendwelcomeemail"; + + return ConfigureAndExecute<PostResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API is used to update the user's profile by passing the access_token. + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="userProfileUpdateModel">Model Class containing Definition of payload for User Profile update API</param> + /// <param name="emailTemplate">Email template name</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <param name="smsTemplate">SMS Template name</param> + /// <param name="verificationUrl">Email verification url</param> + /// <returns>Response containing Definition of Complete Validation and UserProfile data</returns> + /// 5.4 + + public ApiResponse<UserProfilePostResponse<Identity>> UpdateProfileByAccessToken(string accessToken, UserProfileUpdateModel userProfileUpdateModel, + string emailTemplate = null, string fields = "", string smsTemplate = null, string verificationUrl = null) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + if (userProfileUpdateModel == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(userProfileUpdateModel)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + if (!string.IsNullOrWhiteSpace(emailTemplate)) + { + queryParameters.Add("emailTemplate", emailTemplate); + } + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + if (!string.IsNullOrWhiteSpace(smsTemplate)) + { + queryParameters.Add("smsTemplate", smsTemplate); + } + if (!string.IsNullOrWhiteSpace(verificationUrl)) + { + queryParameters.Add("verificationUrl", verificationUrl); + } + + var resourcePath = "identity/v2/auth/account"; + + return ConfigureAndExecute<UserProfilePostResponse<Identity>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(userProfileUpdateModel)); + } + /// <summary> + /// This API will send a confirmation email for account deletion to the customer's email when passed the customer's access token + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="deleteUrl">Url of the site</param> + /// <param name="emailTemplate">Email template name</param> + /// <returns>Response containing Definition of Delete Request</returns> + /// 5.5 + + public ApiResponse<DeleteRequestAcceptResponse> DeleteAccountWithEmailConfirmation(string accessToken, string deleteUrl = null, + string emailTemplate = null) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + if (!string.IsNullOrWhiteSpace(deleteUrl)) + { + queryParameters.Add("deleteUrl", deleteUrl); + } + if (!string.IsNullOrWhiteSpace(emailTemplate)) + { + queryParameters.Add("emailTemplate", emailTemplate); + } + + var resourcePath = "identity/v2/auth/account"; + + return ConfigureAndExecute<DeleteRequestAcceptResponse>(HttpMethod.DELETE, resourcePath, queryParameters, null); + } + /// <summary> + /// This API is used to delete an account by passing it a delete token. + /// </summary> + /// <param name="deleteToken">Delete token received in the email</param> + /// <returns>Response containing Definition of Complete Validation data</returns> + /// 5.6 + + public ApiResponse<PostResponse> DeleteAccountByDeleteToken(string deleteToken) + { + if (string.IsNullOrWhiteSpace(deleteToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(deleteToken)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "deletetoken", deleteToken } + }; + + var resourcePath = "identity/v2/auth/account/delete"; + + return ConfigureAndExecute<PostResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API is used to allow a customer with a valid access_token to unlock their account provided that they successfully pass the prompted Bot Protection challenges. The Block or Suspend block types are not applicable for this API. For additional details see our Auth Security Configuration documentation.You are only required to pass the Post Parameters that correspond to the prompted challenges. + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="unlockProfileModel">Payload containing Unlock Profile API</param> + /// <returns>Response containing Definition of Complete Validation data</returns> + /// 5.15 + + public ApiResponse<PostResponse> UnlockAccountByToken(string accessToken, UnlockProfileModel unlockProfileModel) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + if (unlockProfileModel == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(unlockProfileModel)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + + var resourcePath = "identity/v2/auth/account/unlock"; + + return ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(unlockProfileModel)); + } + /// <summary> + /// This API is used to check the email exists or not on your site. + /// </summary> + /// <param name="email">Email of the user</param> + /// <returns>Response containing Definition Complete ExistResponse data</returns> + /// 8.1 + + public ApiResponse<ExistResponse> CheckEmailAvailability(string email) + { + if (string.IsNullOrWhiteSpace(email)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(email)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "email", email } + }; + + var resourcePath = "identity/v2/auth/email"; + + return ConfigureAndExecute<ExistResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API is used to verify the email of user. Note: This API will only return the full profile if you have 'Enable auto login after email verification' set in your LoginRadius Admin Console's Email Workflow settings under 'Verification Email'. + /// </summary> + /// <param name="verificationToken">Verification token received in the email</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <param name="url">Mention URL to log the main URL(Domain name) in Database.</param> + /// <param name="welcomeEmailTemplate">Name of the welcome email template</param> + /// <returns>Response containing Definition of Complete Validation, UserProfile data and Access Token</returns> + /// 8.2 + + public ApiResponse<UserProfilePostResponse<AccessToken<Identity>>> VerifyEmail(string verificationToken, string fields = "", + string url = null, string welcomeEmailTemplate = null) + { + if (string.IsNullOrWhiteSpace(verificationToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(verificationToken)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "verificationToken", verificationToken } + }; + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + if (!string.IsNullOrWhiteSpace(url)) + { + queryParameters.Add("url", url); + } + if (!string.IsNullOrWhiteSpace(welcomeEmailTemplate)) + { + queryParameters.Add("welcomeEmailTemplate", welcomeEmailTemplate); + } + + var resourcePath = "identity/v2/auth/email"; + + return ConfigureAndExecute<UserProfilePostResponse<AccessToken<Identity>>>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API is used to verify the email of user when the OTP Email verification flow is enabled, please note that you must contact LoginRadius to have this feature enabled. + /// </summary> + /// <param name="emailVerificationByOtpModel">Model Class containing Definition for EmailVerificationByOtpModel API</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <param name="url">Mention URL to log the main URL(Domain name) in Database.</param> + /// <param name="welcomeEmailTemplate">Name of the welcome email template</param> + /// <returns>Response containing Definition of Complete Validation, UserProfile data and Access Token</returns> + /// 8.3 + + public ApiResponse<UserProfilePostResponse<AccessToken<Identity>>> VerifyEmailByOTP(EmailVerificationByOtpModel emailVerificationByOtpModel, string fields = "", + string url = null, string welcomeEmailTemplate = null) + { + if (emailVerificationByOtpModel == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(emailVerificationByOtpModel)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + if (!string.IsNullOrWhiteSpace(url)) + { + queryParameters.Add("url", url); + } + if (!string.IsNullOrWhiteSpace(welcomeEmailTemplate)) + { + queryParameters.Add("welcomeEmailTemplate", welcomeEmailTemplate); + } + + var resourcePath = "identity/v2/auth/email"; + + return ConfigureAndExecute<UserProfilePostResponse<AccessToken<Identity>>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(emailVerificationByOtpModel)); + } + /// <summary> + /// This API is used to add additional emails to a user's account. + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="email">user's email</param> + /// <param name="type">String to identify the type of parameter</param> + /// <param name="emailTemplate">Email template name</param> + /// <param name="verificationUrl">Email verification url</param> + /// <returns>Response containing Definition of Complete Validation data</returns> + /// 8.5 + + public ApiResponse<PostResponse> AddEmail(string accessToken, string email, + string type, string emailTemplate = null, string verificationUrl = null) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + if (string.IsNullOrWhiteSpace(email)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(email)); + } + if (string.IsNullOrWhiteSpace(type)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(type)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + if (!string.IsNullOrWhiteSpace(emailTemplate)) + { + queryParameters.Add("emailTemplate", emailTemplate); + } + if (!string.IsNullOrWhiteSpace(verificationUrl)) + { + queryParameters.Add("verificationUrl", verificationUrl); + } + + var bodyParameters = new BodyParameters + { + { "email", email }, + { "type", type } + }; + + var resourcePath = "identity/v2/auth/email"; + + return ConfigureAndExecute<PostResponse>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + } + /// <summary> + /// This API is used to remove additional emails from a user's account. + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="email">user's email</param> + /// <returns>Response containing Definition of Delete Request</returns> + /// 8.6 + + public ApiResponse<DeleteResponse> RemoveEmail(string accessToken, string email) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + if (string.IsNullOrWhiteSpace(email)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(email)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + + var bodyParameters = new BodyParameters + { + { "email", email } + }; + + var resourcePath = "identity/v2/auth/email"; + + return ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + } + /// <summary> + /// This API retrieves a copy of the user data based on the Email + /// </summary> + /// <param name="emailAuthenticationModel">Model Class containing Definition of payload for Email Authentication API</param> + /// <param name="emailTemplate">Email template name</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <param name="loginUrl">Url where the user is logging from</param> + /// <param name="verificationUrl">Email verification url</param> + /// <returns>Response containing User Profile Data and access token</returns> + /// 9.2.1 + + public ApiResponse<AccessToken<Identity>> LoginByEmail(EmailAuthenticationModel emailAuthenticationModel, string emailTemplate = null, + string fields = "", string loginUrl = null, string verificationUrl = null) + { + if (emailAuthenticationModel == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(emailAuthenticationModel)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + if (!string.IsNullOrWhiteSpace(emailTemplate)) + { + queryParameters.Add("emailTemplate", emailTemplate); + } + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + if (!string.IsNullOrWhiteSpace(loginUrl)) + { + queryParameters.Add("loginUrl", loginUrl); + } + if (!string.IsNullOrWhiteSpace(verificationUrl)) + { + queryParameters.Add("verificationUrl", verificationUrl); + } + + var resourcePath = "identity/v2/auth/login"; + + return ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(emailAuthenticationModel)); + } + /// <summary> + /// This API retrieves a copy of the user data based on the Username + /// </summary> + /// <param name="userNameAuthenticationModel">Model Class containing Definition of payload for Username Authentication API</param> + /// <param name="emailTemplate">Email template name</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <param name="loginUrl">Url where the user is logging from</param> + /// <param name="verificationUrl">Email verification url</param> + /// <returns>Response containing User Profile Data and access token</returns> + /// 9.2.2 + + public ApiResponse<AccessToken<Identity>> LoginByUserName(UserNameAuthenticationModel userNameAuthenticationModel, string emailTemplate = null, + string fields = "", string loginUrl = null, string verificationUrl = null) + { + if (userNameAuthenticationModel == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(userNameAuthenticationModel)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + if (!string.IsNullOrWhiteSpace(emailTemplate)) + { + queryParameters.Add("emailTemplate", emailTemplate); + } + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + if (!string.IsNullOrWhiteSpace(loginUrl)) + { + queryParameters.Add("loginUrl", loginUrl); + } + if (!string.IsNullOrWhiteSpace(verificationUrl)) + { + queryParameters.Add("verificationUrl", verificationUrl); + } + + var resourcePath = "identity/v2/auth/login"; + + return ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(userNameAuthenticationModel)); + } + /// <summary> + /// This API is used to send the reset password url to a specified account. Note: If you have the UserName workflow enabled, you may replace the 'email' parameter with 'username' + /// </summary> + /// <param name="email">user's email</param> + /// <param name="resetPasswordUrl">Url to which user should get re-directed to for resetting the password</param> + /// <param name="emailTemplate">Email template name</param> + /// <returns>Response containing Definition of Complete Validation data</returns> + /// 10.1 + + public ApiResponse<PostResponse> ForgotPassword(string email, string resetPasswordUrl, + string emailTemplate = null) + { + if (string.IsNullOrWhiteSpace(email)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(email)); + } + if (string.IsNullOrWhiteSpace(resetPasswordUrl)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(resetPasswordUrl)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "resetPasswordUrl", resetPasswordUrl } + }; + if (!string.IsNullOrWhiteSpace(emailTemplate)) + { + queryParameters.Add("emailTemplate", emailTemplate); + } + + var bodyParameters = new BodyParameters + { + { "email", email } + }; + + var resourcePath = "identity/v2/auth/password"; + + return ConfigureAndExecute<PostResponse>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + } + /// <summary> + /// This API is used to reset password for the specified account by security question + /// </summary> + /// <param name="resetPasswordBySecurityAnswerAndEmailModel">Model Class containing Definition of payload for ResetPasswordBySecurityAnswerAndEmail API</param> + /// <returns>Response containing Definition of Validation data and access token</returns> + /// 10.3.1 + + public ApiResponse<UserProfilePostResponse<AccessToken>> ResetPasswordBySecurityAnswerAndEmail(ResetPasswordBySecurityAnswerAndEmailModel resetPasswordBySecurityAnswerAndEmailModel) + { + if (resetPasswordBySecurityAnswerAndEmailModel == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(resetPasswordBySecurityAnswerAndEmailModel)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + + var resourcePath = "identity/v2/auth/password/securityanswer"; + + return ConfigureAndExecute<UserProfilePostResponse<AccessToken>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(resetPasswordBySecurityAnswerAndEmailModel)); + } + /// <summary> + /// This API is used to reset password for the specified account by security question + /// </summary> + /// <param name="resetPasswordBySecurityAnswerAndPhoneModel">Model Class containing Definition of payload for ResetPasswordBySecurityAnswerAndPhone API</param> + /// <returns>Response containing Definition of Validation data and access token</returns> + /// 10.3.2 + + public ApiResponse<UserProfilePostResponse<AccessToken>> ResetPasswordBySecurityAnswerAndPhone(ResetPasswordBySecurityAnswerAndPhoneModel resetPasswordBySecurityAnswerAndPhoneModel) + { + if (resetPasswordBySecurityAnswerAndPhoneModel == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(resetPasswordBySecurityAnswerAndPhoneModel)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + + var resourcePath = "identity/v2/auth/password/securityanswer"; + + return ConfigureAndExecute<UserProfilePostResponse<AccessToken>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(resetPasswordBySecurityAnswerAndPhoneModel)); + } + /// <summary> + /// This API is used to reset password for the specified account by security question + /// </summary> + /// <param name="resetPasswordBySecurityAnswerAndUserNameModel">Model Class containing Definition of payload for ResetPasswordBySecurityAnswerAndUserName API</param> + /// <returns>Response containing Definition of Validation data and access token</returns> + /// 10.3.3 + + public ApiResponse<UserProfilePostResponse<AccessToken>> ResetPasswordBySecurityAnswerAndUserName(ResetPasswordBySecurityAnswerAndUserNameModel resetPasswordBySecurityAnswerAndUserNameModel) + { + if (resetPasswordBySecurityAnswerAndUserNameModel == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(resetPasswordBySecurityAnswerAndUserNameModel)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + + var resourcePath = "identity/v2/auth/password/securityanswer"; + + return ConfigureAndExecute<UserProfilePostResponse<AccessToken>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(resetPasswordBySecurityAnswerAndUserNameModel)); + } + /// <summary> + /// This API is used to set a new password for the specified account. + /// </summary> + /// <param name="resetPasswordByResetTokenModel">Model Class containing Definition of payload for ResetToken API</param> + /// <returns>Response containing Definition of Validation data and access token</returns> + /// 10.7.1 + + public ApiResponse<UserProfilePostResponse<AccessToken>> ResetPasswordByResetToken(ResetPasswordByResetTokenModel resetPasswordByResetTokenModel) + { + if (resetPasswordByResetTokenModel == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(resetPasswordByResetTokenModel)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + + var resourcePath = "identity/v2/auth/password/reset"; + + return ConfigureAndExecute<UserProfilePostResponse<AccessToken>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(resetPasswordByResetTokenModel)); + } + /// <summary> + /// This API is used to set a new password for the specified account. + /// </summary> + /// <param name="resetPasswordByEmailAndOtpModel">Model Class containing Definition of payload for ResetPasswordByEmailAndOtp API</param> + /// <returns>Response containing Definition of Validation data and access token</returns> + /// 10.7.2 + + public ApiResponse<UserProfilePostResponse<AccessToken>> ResetPasswordByEmailOTP(ResetPasswordByEmailAndOtpModel resetPasswordByEmailAndOtpModel) + { + if (resetPasswordByEmailAndOtpModel == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(resetPasswordByEmailAndOtpModel)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + + var resourcePath = "identity/v2/auth/password/reset"; + + return ConfigureAndExecute<UserProfilePostResponse<AccessToken>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(resetPasswordByEmailAndOtpModel)); + } + /// <summary> + /// This API is used to set a new password for the specified account if you are using the username as the unique identifier in your workflow + /// </summary> + /// <param name="resetPasswordByUserNameModel">Model Class containing Definition of payload for ResetPasswordByUserName API</param> + /// <returns>Response containing Definition of Validation data and access token</returns> + /// 10.7.3 + + public ApiResponse<UserProfilePostResponse<AccessToken>> ResetPasswordByOTPAndUserName(ResetPasswordByUserNameModel resetPasswordByUserNameModel) + { + if (resetPasswordByUserNameModel == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(resetPasswordByUserNameModel)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + + var resourcePath = "identity/v2/auth/password/reset"; + + return ConfigureAndExecute<UserProfilePostResponse<AccessToken>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(resetPasswordByUserNameModel)); + } + /// <summary> + /// This API is used to change the accounts password based on the previous password + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="newPassword">New password</param> + /// <param name="oldPassword">User's current password</param> + /// <returns>Response containing Definition of Complete Validation data</returns> + /// 10.8 + + public ApiResponse<PostResponse> ChangePassword(string accessToken, string newPassword, + string oldPassword) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + if (string.IsNullOrWhiteSpace(newPassword)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(newPassword)); + } + if (string.IsNullOrWhiteSpace(oldPassword)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(oldPassword)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + + var bodyParameters = new BodyParameters + { + { "newPassword", newPassword }, + { "oldPassword", oldPassword } + }; + + var resourcePath = "identity/v2/auth/password/change"; + + return ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + } + /// <summary> + /// This API is used to link up a social provider account with the specified account based on the access token and the social providers user access token. + /// </summary> + /// <param name="accessToken">Access_Token</param> + /// <param name="candidateToken">Access token of the account to be linked</param> + /// <returns>Response containing Definition of Complete Validation data</returns> + /// 12.1 + + public ApiResponse<PostResponse> LinkSocialIdentities(string accessToken, string candidateToken) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + if (string.IsNullOrWhiteSpace(candidateToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(candidateToken)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + + var bodyParameters = new BodyParameters + { + { "candidateToken", candidateToken } + }; + + var resourcePath = "identity/v2/auth/socialidentity"; + + return ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + } + /// <summary> + /// This API is used to unlink up a social provider account with the specified account based on the access token and the social providers user access token. The unlinked account will automatically get removed from your database. + /// </summary> + /// <param name="accessToken">Access_Token</param> + /// <param name="provider">Name of the provider</param> + /// <param name="providerId">Unique ID of the linked account</param> + /// <returns>Response containing Definition of Delete Request</returns> + /// 12.2 + + public ApiResponse<DeleteResponse> UnlinkSocialIdentities(string accessToken, string provider, + string providerId) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + if (string.IsNullOrWhiteSpace(provider)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(provider)); + } + if (string.IsNullOrWhiteSpace(providerId)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(providerId)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + + var bodyParameters = new BodyParameters + { + { "provider", provider }, + { "providerId", providerId } + }; + + var resourcePath = "identity/v2/auth/socialidentity"; + + return ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + } + /// <summary> + /// This API is called just after account linking API and it prevents the raas profile of the second account from getting created. + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <returns>Response containing Definition for Complete SocialUserProfile data</returns> + /// 12.3 + + public ApiResponse<SocialUserProfile> GetSocialIdentity(string accessToken, string fields = "") + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + + var resourcePath = "identity/v2/auth/socialidentity"; + + return ConfigureAndExecute<SocialUserProfile>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API is used to set or change UserName by access token. + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="username">Username of the user</param> + /// <returns>Response containing Definition of Complete Validation data</returns> + /// 13.1 + + public ApiResponse<PostResponse> SetOrChangeUserName(string accessToken, string username) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + if (string.IsNullOrWhiteSpace(username)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(username)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + + var bodyParameters = new BodyParameters + { + { "username", username } + }; + + var resourcePath = "identity/v2/auth/username"; + + return ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + } + /// <summary> + /// This API is used to check the UserName exists or not on your site. + /// </summary> + /// <param name="username">UserName of the user</param> + /// <returns>Response containing Definition Complete ExistResponse data</returns> + /// 13.2 + + public ApiResponse<ExistResponse> CheckUserNameAvailability(string username) + { + if (string.IsNullOrWhiteSpace(username)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(username)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "username", username } + }; + + var resourcePath = "identity/v2/auth/username"; + + return ConfigureAndExecute<ExistResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API is used to update the privacy policy stored in the user's profile by providing the access_token of the user accepting the privacy policy + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <returns>Response containing Definition for Complete profile data</returns> + /// 15.1 + + public ApiResponse<Identity> AcceptPrivacyPolicy(string accessToken, string fields = "") + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + + var resourcePath = "identity/v2/auth/privacypolicy/accept"; + + return ConfigureAndExecute<Identity>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API will return all the accepted privacy policies for the user by providing the access_token of that user. + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <returns>Complete Policy History data</returns> + /// 15.2 + + public ApiResponse<PrivacyPolicyHistoryResponse> GetPrivacyPolicyHistoryByAccessToken(string accessToken) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + + var resourcePath = "identity/v2/auth/privacypolicy/history"; + + return ConfigureAndExecute<PrivacyPolicyHistoryResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API creates a user in the database as well as sends a verification email to the user. + /// </summary> + /// <param name="authUserRegistrationModel">Model Class containing Definition of payload for Auth User Registration API</param> + /// <param name="sott">LoginRadius Secured One Time Token</param> + /// <param name="emailTemplate">Email template name</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <param name="options">PreventVerificationEmail (Specifying this value prevents the verification email from being sent. Only applicable if you have the optional email verification flow)</param> + /// <param name="verificationUrl">Email verification url</param> + /// <param name="welcomeEmailTemplate">Name of the welcome email template</param> + /// <returns>Response containing Definition of Complete Validation, UserProfile data and Access Token</returns> + /// 17.1.1 + + public ApiResponse<UserProfilePostResponse<AccessToken<Identity>>> UserRegistrationByEmail(AuthUserRegistrationModel authUserRegistrationModel, string sott, + string emailTemplate = null, string fields = "", string options = "", string verificationUrl = null, string welcomeEmailTemplate = null) + { + if (authUserRegistrationModel == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(authUserRegistrationModel)); + } + if (string.IsNullOrWhiteSpace(sott)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(sott)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "sott", sott } + }; + if (!string.IsNullOrWhiteSpace(emailTemplate)) + { + queryParameters.Add("emailTemplate", emailTemplate); + } + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + if (!string.IsNullOrWhiteSpace(options)) + { + queryParameters.Add("options", options); + } + if (!string.IsNullOrWhiteSpace(verificationUrl)) + { + queryParameters.Add("verificationUrl", verificationUrl); + } + if (!string.IsNullOrWhiteSpace(welcomeEmailTemplate)) + { + queryParameters.Add("welcomeEmailTemplate", welcomeEmailTemplate); + } + + var resourcePath = "identity/v2/auth/register"; + + return ConfigureAndExecute<UserProfilePostResponse<AccessToken<Identity>>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(authUserRegistrationModel)); + } + /// <summary> + /// This API registers the new users into your Cloud Storage and triggers the phone verification process. + /// </summary> + /// <param name="authUserRegistrationModel">Model Class containing Definition of payload for Auth User Registration API</param> + /// <param name="sott">LoginRadius Secured One Time Token</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <param name="options">PreventVerificationEmail (Specifying this value prevents the verification email from being sent. Only applicable if you have the optional email verification flow)</param> + /// <param name="smsTemplate">SMS Template name</param> + /// <param name="verificationUrl">Email verification url</param> + /// <param name="welcomeEmailTemplate">Name of the welcome email template</param> + /// <returns>Response containing Definition of Complete Validation, UserProfile data and Access Token</returns> + /// 17.1.2 + + public ApiResponse<UserProfilePostResponse<AccessToken<Identity>>> UserRegistrationByPhone(AuthUserRegistrationModel authUserRegistrationModel, string sott, + string fields = "", string options = "", string smsTemplate = null, string verificationUrl = null, string welcomeEmailTemplate = null) + { + if (authUserRegistrationModel == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(authUserRegistrationModel)); + } + if (string.IsNullOrWhiteSpace(sott)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(sott)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "sott", sott } + }; + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + if (!string.IsNullOrWhiteSpace(options)) + { + queryParameters.Add("options", options); + } + if (!string.IsNullOrWhiteSpace(smsTemplate)) + { + queryParameters.Add("smsTemplate", smsTemplate); + } + if (!string.IsNullOrWhiteSpace(verificationUrl)) + { + queryParameters.Add("verificationUrl", verificationUrl); + } + if (!string.IsNullOrWhiteSpace(welcomeEmailTemplate)) + { + queryParameters.Add("welcomeEmailTemplate", welcomeEmailTemplate); + } + + var resourcePath = "identity/v2/auth/register"; + + return ConfigureAndExecute<UserProfilePostResponse<AccessToken<Identity>>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(authUserRegistrationModel)); + } + /// <summary> + /// This API creates a user in the database as well as sends a verification email to the user. + /// </summary> + /// <param name="authUserRegistrationModelWithCaptcha">Model Class containing Definition of payload for Auth User Registration by Recaptcha API</param> + /// <param name="emailTemplate">Email template name</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <param name="options">PreventVerificationEmail (Specifying this value prevents the verification email from being sent. Only applicable if you have the optional email verification flow)</param> + /// <param name="smsTemplate">SMS Template name</param> + /// <param name="verificationUrl">Email verification url</param> + /// <param name="welcomeEmailTemplate">Name of the welcome email template</param> + /// <returns>Response containing Definition of Complete Validation, UserProfile data and Access Token</returns> + /// 17.2 + + public ApiResponse<UserProfilePostResponse<AccessToken<Identity>>> UserRegistrationByCaptcha(AuthUserRegistrationModelWithCaptcha authUserRegistrationModelWithCaptcha, string emailTemplate = null, + string fields = "", string options = "", string smsTemplate = null, string verificationUrl = null, string welcomeEmailTemplate = null) + { + if (authUserRegistrationModelWithCaptcha == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(authUserRegistrationModelWithCaptcha)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + if (!string.IsNullOrWhiteSpace(emailTemplate)) + { + queryParameters.Add("emailTemplate", emailTemplate); + } + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + if (!string.IsNullOrWhiteSpace(options)) + { + queryParameters.Add("options", options); + } + if (!string.IsNullOrWhiteSpace(smsTemplate)) + { + queryParameters.Add("smsTemplate", smsTemplate); + } + if (!string.IsNullOrWhiteSpace(verificationUrl)) + { + queryParameters.Add("verificationUrl", verificationUrl); + } + if (!string.IsNullOrWhiteSpace(welcomeEmailTemplate)) + { + queryParameters.Add("welcomeEmailTemplate", welcomeEmailTemplate); + } + + var resourcePath = "identity/v2/auth/register/captcha"; + + return ConfigureAndExecute<UserProfilePostResponse<AccessToken<Identity>>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(authUserRegistrationModelWithCaptcha)); + } + /// <summary> + /// This API resends the verification email to the user. + /// </summary> + /// <param name="email">user's email</param> + /// <param name="emailTemplate">Email template name</param> + /// <param name="verificationUrl">Email verification url</param> + /// <returns>Response containing Definition of Complete Validation data</returns> + /// 17.3 + + public ApiResponse<PostResponse> AuthResendEmailVerification(string email, string emailTemplate = null, + string verificationUrl = null) + { + if (string.IsNullOrWhiteSpace(email)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(email)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + if (!string.IsNullOrWhiteSpace(emailTemplate)) + { + queryParameters.Add("emailTemplate", emailTemplate); + } + if (!string.IsNullOrWhiteSpace(verificationUrl)) + { + queryParameters.Add("verificationUrl", verificationUrl); + } + + var bodyParameters = new BodyParameters + { + { "email", email } + }; + + var resourcePath = "identity/v2/auth/register"; + + return ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + } + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Api/Authentication/OneTouchLoginApi.cs b/Source/LoginRadiusSDK.V2/Api/Authentication/OneTouchLoginApi.cs new file mode 100644 index 0000000..79d7051 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Api/Authentication/OneTouchLoginApi.cs @@ -0,0 +1,186 @@ +//----------------------------------------------------------------------- +// <copyright file="OneTouchLoginApi.cs" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System; +using LoginRadiusSDK.V2.Common; +using LoginRadiusSDK.V2.Util; +using LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects; +using LoginRadiusSDK.V2.Models.RequestModels; +using LoginRadiusSDK.V2.Models.ResponseModels; +using LoginRadiusSDK.V2.Models.ResponseModels.UserProfile; + +namespace LoginRadiusSDK.V2.Api.Authentication +{ + public class OneTouchLoginApi : LoginRadiusResource + { + /// <summary> + /// This API is used to send a link to a specified email for a frictionless login/registration + /// </summary> + /// <param name="oneTouchLoginByEmailModel">Model Class containing Definition of payload for OneTouchLogin By EmailModel API</param> + /// <param name="oneTouchLoginEmailTemplate">Name of the One Touch Login Email Template</param> + /// <param name="redirecturl">Url where the user will redirect after success authentication</param> + /// <param name="welcomeemailtemplate">Name of the welcome email template</param> + /// <returns>Response containing Definition of Complete Validation data</returns> + /// 1.2 + + public ApiResponse<PostResponse> OneTouchLoginByEmail(OneTouchLoginByEmailModel oneTouchLoginByEmailModel, string oneTouchLoginEmailTemplate = null, + string redirecturl = null, string welcomeemailtemplate = null) + { + if (oneTouchLoginByEmailModel == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(oneTouchLoginByEmailModel)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + if (!string.IsNullOrWhiteSpace(oneTouchLoginEmailTemplate)) + { + queryParameters.Add("oneTouchLoginEmailTemplate", oneTouchLoginEmailTemplate); + } + if (!string.IsNullOrWhiteSpace(redirecturl)) + { + queryParameters.Add("redirecturl", redirecturl); + } + if (!string.IsNullOrWhiteSpace(welcomeemailtemplate)) + { + queryParameters.Add("welcomeemailtemplate", welcomeemailtemplate); + } + + var resourcePath = "identity/v2/auth/onetouchlogin/email"; + + return ConfigureAndExecute<PostResponse>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(oneTouchLoginByEmailModel)); + } + /// <summary> + /// This API is used to send one time password to a given phone number for a frictionless login/registration. + /// </summary> + /// <param name="oneTouchLoginByPhoneModel">Model Class containing Definition of payload for OneTouchLogin By PhoneModel API</param> + /// <param name="smsTemplate">SMS Template name</param> + /// <returns>Response containing Definition of Complete Validation data</returns> + /// 1.4 + + public ApiResponse<PostResponse> OneTouchLoginByPhone(OneTouchLoginByPhoneModel oneTouchLoginByPhoneModel, string smsTemplate = null) + { + if (oneTouchLoginByPhoneModel == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(oneTouchLoginByPhoneModel)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + if (!string.IsNullOrWhiteSpace(smsTemplate)) + { + queryParameters.Add("smsTemplate", smsTemplate); + } + + var resourcePath = "identity/v2/auth/onetouchlogin/phone"; + + return ConfigureAndExecute<PostResponse>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(oneTouchLoginByPhoneModel)); + } + /// <summary> + /// This API is used to verify the otp for One Touch Login. + /// </summary> + /// <param name="otp">The Verification Code</param> + /// <param name="phone">New Phone Number</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <param name="smsTemplate">SMS Template name</param> + /// <returns>Response Containing Access Token and Complete Profile Data</returns> + /// 1.5 + + public ApiResponse<AccessToken<UserProfile>> OneTouchLoginOTPVerification(string otp, string phone, + string fields = "", string smsTemplate = null) + { + if (string.IsNullOrWhiteSpace(otp)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(otp)); + } + if (string.IsNullOrWhiteSpace(phone)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(phone)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "otp", otp } + }; + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + if (!string.IsNullOrWhiteSpace(smsTemplate)) + { + queryParameters.Add("smsTemplate", smsTemplate); + } + + var bodyParameters = new BodyParameters + { + { "phone", phone } + }; + + var resourcePath = "identity/v2/auth/onetouchlogin/phone/verify"; + + return ConfigureAndExecute<AccessToken<UserProfile>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + } + /// <summary> + /// This API verifies the provided token for One Touch Login + /// </summary> + /// <param name="verificationToken">Verification token received in the email</param> + /// <param name="welcomeEmailTemplate">Name of the welcome email template</param> + /// <returns>Complete verified response data</returns> + /// 8.4.2 + + public ApiResponse<VerifiedResponse> OneTouchEmailVerification(string verificationToken, string welcomeEmailTemplate = null) + { + if (string.IsNullOrWhiteSpace(verificationToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(verificationToken)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "verificationToken", verificationToken } + }; + if (!string.IsNullOrWhiteSpace(welcomeEmailTemplate)) + { + queryParameters.Add("welcomeEmailTemplate", welcomeEmailTemplate); + } + + var resourcePath = "identity/v2/auth/email/onetouchlogin"; + + return ConfigureAndExecute<VerifiedResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API is used to check if the One Touch Login link has been clicked or not. + /// </summary> + /// <param name="clientGuid">Unique string used in the Smart Login request</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <returns>Response containing User Profile Data and access token</returns> + /// 9.21.2 + + public ApiResponse<AccessToken<Identity>> OneTouchLoginPing(string clientGuid, string fields = "") + { + if (string.IsNullOrWhiteSpace(clientGuid)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(clientGuid)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "clientGuid", clientGuid } + }; + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + + var resourcePath = "identity/v2/auth/login/smartlogin/ping"; + + return ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.GET, resourcePath, queryParameters, null); + } + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Api/Authentication/PasswordLessLoginApi.cs b/Source/LoginRadiusSDK.V2/Api/Authentication/PasswordLessLoginApi.cs new file mode 100644 index 0000000..56ab71e --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Api/Authentication/PasswordLessLoginApi.cs @@ -0,0 +1,184 @@ +//----------------------------------------------------------------------- +// <copyright file="PasswordLessLoginApi.cs" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System; +using LoginRadiusSDK.V2.Common; +using LoginRadiusSDK.V2.Util; +using LoginRadiusSDK.V2.Models.ResponseModels; +using LoginRadiusSDK.V2.Models.ResponseModels.UserProfile; +using LoginRadiusSDK.V2.Models.RequestModels; +using LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects; + +namespace LoginRadiusSDK.V2.Api.Authentication +{ + public class PasswordLessLoginApi : LoginRadiusResource + { + /// <summary> + /// This API verifies an account by OTP and allows the customer to login. + /// </summary> + /// <param name="passwordLessLoginOtpModel">Model Class containing Definition of payload for PasswordLessLoginOtpModel API</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <param name="smsTemplate">SMS Template name</param> + /// <returns>Response containing User Profile Data and access token</returns> + /// 9.6 + + public ApiResponse<AccessToken<Identity>> PasswordlessLoginPhoneVerification(PasswordLessLoginOtpModel passwordLessLoginOtpModel, string fields = "", + string smsTemplate = null) + { + if (passwordLessLoginOtpModel == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(passwordLessLoginOtpModel)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + if (!string.IsNullOrWhiteSpace(smsTemplate)) + { + queryParameters.Add("smsTemplate", smsTemplate); + } + + var resourcePath = "identity/v2/auth/login/passwordlesslogin/otp/verify"; + + return ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(passwordLessLoginOtpModel)); + } + /// <summary> + /// API can be used to send a One-time Passcode (OTP) provided that the account has a verified PhoneID + /// </summary> + /// <param name="phone">The Registered Phone Number</param> + /// <param name="smsTemplate">SMS Template name</param> + /// <returns>Response Containing Definition of SMS Data</returns> + /// 9.15 + + public ApiResponse<GetResponse<SMSResponseData>> PasswordlessLoginByPhone(string phone, string smsTemplate = null) + { + if (string.IsNullOrWhiteSpace(phone)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(phone)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "phone", phone } + }; + if (!string.IsNullOrWhiteSpace(smsTemplate)) + { + queryParameters.Add("smsTemplate", smsTemplate); + } + + var resourcePath = "identity/v2/auth/login/passwordlesslogin/otp"; + + return ConfigureAndExecute<GetResponse<SMSResponseData>>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API is used to send a Passwordless Login verification link to the provided Email ID + /// </summary> + /// <param name="email">Email of the user</param> + /// <param name="passwordLessLoginTemplate">Passwordless Login Template Name</param> + /// <param name="verificationUrl">Email verification url</param> + /// <returns>Response containing Definition of Complete Validation data</returns> + /// 9.18.1 + + public ApiResponse<PostResponse> PasswordlessLoginByEmail(string email, string passwordLessLoginTemplate = null, + string verificationUrl = null) + { + if (string.IsNullOrWhiteSpace(email)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(email)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "email", email } + }; + if (!string.IsNullOrWhiteSpace(passwordLessLoginTemplate)) + { + queryParameters.Add("passwordLessLoginTemplate", passwordLessLoginTemplate); + } + if (!string.IsNullOrWhiteSpace(verificationUrl)) + { + queryParameters.Add("verificationUrl", verificationUrl); + } + + var resourcePath = "identity/v2/auth/login/passwordlesslogin/email"; + + return ConfigureAndExecute<PostResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API is used to send a Passwordless Login Verification Link to a customer by providing their UserName + /// </summary> + /// <param name="username">UserName of the user</param> + /// <param name="passwordLessLoginTemplate">Passwordless Login Template Name</param> + /// <param name="verificationUrl">Email verification url</param> + /// <returns>Response containing Definition of Complete Validation data</returns> + /// 9.18.2 + + public ApiResponse<PostResponse> PasswordlessLoginByUserName(string username, string passwordLessLoginTemplate = null, + string verificationUrl = null) + { + if (string.IsNullOrWhiteSpace(username)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(username)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "username", username } + }; + if (!string.IsNullOrWhiteSpace(passwordLessLoginTemplate)) + { + queryParameters.Add("passwordLessLoginTemplate", passwordLessLoginTemplate); + } + if (!string.IsNullOrWhiteSpace(verificationUrl)) + { + queryParameters.Add("verificationUrl", verificationUrl); + } + + var resourcePath = "identity/v2/auth/login/passwordlesslogin/email"; + + return ConfigureAndExecute<PostResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API is used to verify the Passwordless Login verification link. Note: If you are using Passwordless Login by Phone you will need to use the Passwordless Login Phone Verification API + /// </summary> + /// <param name="verificationToken">Verification token received in the email</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <param name="welcomeEmailTemplate">Name of the welcome email template</param> + /// <returns>Response containing User Profile Data and access token</returns> + /// 9.19 + + public ApiResponse<AccessToken<Identity>> PasswordlessLoginVerification(string verificationToken, string fields = "", + string welcomeEmailTemplate = null) + { + if (string.IsNullOrWhiteSpace(verificationToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(verificationToken)); + } + var queryParameters = new QueryParameters + { + { "apikey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "verificationToken", verificationToken } + }; + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + if (!string.IsNullOrWhiteSpace(welcomeEmailTemplate)) + { + queryParameters.Add("welcomeEmailTemplate", welcomeEmailTemplate); + } + + var resourcePath = "identity/v2/auth/login/passwordlesslogin/email/verify"; + + return ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.GET, resourcePath, queryParameters, null); + } + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Api/Authentication/PhoneAuthenticationApi.cs b/Source/LoginRadiusSDK.V2/Api/Authentication/PhoneAuthenticationApi.cs new file mode 100644 index 0000000..92623de --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Api/Authentication/PhoneAuthenticationApi.cs @@ -0,0 +1,352 @@ +//----------------------------------------------------------------------- +// <copyright file="PhoneAuthenticationApi.cs" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System; +using LoginRadiusSDK.V2.Common; +using LoginRadiusSDK.V2.Util; +using LoginRadiusSDK.V2.Models.ResponseModels; +using LoginRadiusSDK.V2.Models.ResponseModels.UserProfile; +using LoginRadiusSDK.V2.Models.RequestModels; +using LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects; + +namespace LoginRadiusSDK.V2.Api.Authentication +{ + public class PhoneAuthenticationApi : LoginRadiusResource + { + /// <summary> + /// This API retrieves a copy of the user data based on the Phone + /// </summary> + /// <param name="phoneAuthenticationModel">Model Class containing Definition of payload for PhoneAuthenticationModel API</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <param name="loginUrl">Url where the user is logging from</param> + /// <param name="smsTemplate">SMS Template name</param> + /// <returns>Response containing User Profile Data and access token</returns> + /// 9.2.3 + + public ApiResponse<AccessToken<Identity>> LoginByPhone(PhoneAuthenticationModel phoneAuthenticationModel, string fields = "", + string loginUrl = null, string smsTemplate = null) + { + if (phoneAuthenticationModel == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(phoneAuthenticationModel)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + if (!string.IsNullOrWhiteSpace(loginUrl)) + { + queryParameters.Add("loginUrl", loginUrl); + } + if (!string.IsNullOrWhiteSpace(smsTemplate)) + { + queryParameters.Add("smsTemplate", smsTemplate); + } + + var resourcePath = "identity/v2/auth/login"; + + return ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(phoneAuthenticationModel)); + } + /// <summary> + /// This API is used to send the OTP to reset the account password. + /// </summary> + /// <param name="phone">New Phone Number</param> + /// <param name="smsTemplate">SMS Template name</param> + /// <returns>Response Containing Validation Data and SMS Data</returns> + /// 10.4 + + public ApiResponse<UserProfilePostResponse<SMSResponseData>> ForgotPasswordByPhoneOTP(string phone, string smsTemplate = null) + { + if (string.IsNullOrWhiteSpace(phone)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(phone)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + if (!string.IsNullOrWhiteSpace(smsTemplate)) + { + queryParameters.Add("smsTemplate", smsTemplate); + } + + var bodyParameters = new BodyParameters + { + { "phone", phone } + }; + + var resourcePath = "identity/v2/auth/password/otp"; + + return ConfigureAndExecute<UserProfilePostResponse<SMSResponseData>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + } + /// <summary> + /// This API is used to reset the password + /// </summary> + /// <param name="resetPasswordByOTPModel">Model Class containing Definition of payload for ResetPasswordByOTP API</param> + /// <returns>Response containing Definition of Complete Validation data</returns> + /// 10.5 + + public ApiResponse<PostResponse> ResetPasswordByPhoneOTP(ResetPasswordByOTPModel resetPasswordByOTPModel) + { + if (resetPasswordByOTPModel == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(resetPasswordByOTPModel)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + + var resourcePath = "identity/v2/auth/password/otp"; + + return ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(resetPasswordByOTPModel)); + } + /// <summary> + /// This API is used to validate the verification code sent to verify a user's phone number + /// </summary> + /// <param name="otp">The Verification Code</param> + /// <param name="phone">New Phone Number</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <param name="smsTemplate">SMS Template name</param> + /// <returns>Response containing User Profile Data and access token</returns> + /// 11.1.1 + + public ApiResponse<AccessToken<Identity>> PhoneVerificationByOTP(string otp, string phone, + string fields = "", string smsTemplate = null) + { + if (string.IsNullOrWhiteSpace(otp)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(otp)); + } + if (string.IsNullOrWhiteSpace(phone)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(phone)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "otp", otp } + }; + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + if (!string.IsNullOrWhiteSpace(smsTemplate)) + { + queryParameters.Add("smsTemplate", smsTemplate); + } + + var bodyParameters = new BodyParameters + { + { "phone", phone } + }; + + var resourcePath = "identity/v2/auth/phone/otp"; + + return ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + } + /// <summary> + /// This API is used to consume the verification code sent to verify a user's phone number. Use this call for front-end purposes in cases where the user is already logged in by passing the user's access token. + /// </summary> + /// <param name="accessToken">Access_Token</param> + /// <param name="otp">The Verification Code</param> + /// <param name="smsTemplate">SMS Template name</param> + /// <returns>Response containing Definition of Complete Validation data</returns> + /// 11.1.2 + + public ApiResponse<PostResponse> PhoneVerificationOTPByAccessToken(string accessToken, string otp, + string smsTemplate = null) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + if (string.IsNullOrWhiteSpace(otp)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(otp)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "otp", otp } + }; + if (!string.IsNullOrWhiteSpace(smsTemplate)) + { + queryParameters.Add("smsTemplate", smsTemplate); + } + + var bodyParameters = new BodyParameters + { + { "access_token", accessToken } + }; + + var resourcePath = "identity/v2/auth/phone/otp"; + + return ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + } + /// <summary> + /// This API is used to resend a verification OTP to verify a user's Phone Number. The user will receive a verification code that they will need to input + /// </summary> + /// <param name="phone">New Phone Number</param> + /// <param name="smsTemplate">SMS Template name</param> + /// <returns>Response Containing Validation Data and SMS Data</returns> + /// 11.2.1 + + public ApiResponse<UserProfilePostResponse<SMSResponseData>> PhoneResendVerificationOTP(string phone, string smsTemplate = null) + { + if (string.IsNullOrWhiteSpace(phone)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(phone)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + if (!string.IsNullOrWhiteSpace(smsTemplate)) + { + queryParameters.Add("smsTemplate", smsTemplate); + } + + var bodyParameters = new BodyParameters + { + { "phone", phone } + }; + + var resourcePath = "identity/v2/auth/phone/otp"; + + return ConfigureAndExecute<UserProfilePostResponse<SMSResponseData>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + } + /// <summary> + /// This API is used to resend a verification OTP to verify a user's Phone Number in cases in which an active token already exists + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="phone">New Phone Number</param> + /// <param name="smsTemplate">SMS Template name</param> + /// <returns>Response Containing Validation Data and SMS Data</returns> + /// 11.2.2 + + public ApiResponse<UserProfilePostResponse<SMSResponseData>> PhoneResendVerificationOTPByToken(string accessToken, string phone, + string smsTemplate = null) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + if (string.IsNullOrWhiteSpace(phone)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(phone)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + if (!string.IsNullOrWhiteSpace(smsTemplate)) + { + queryParameters.Add("smsTemplate", smsTemplate); + } + + var bodyParameters = new BodyParameters + { + { "access_token", accessToken }, + { "phone", phone } + }; + + var resourcePath = "identity/v2/auth/phone/otp"; + + return ConfigureAndExecute<UserProfilePostResponse<SMSResponseData>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + } + /// <summary> + /// This API is used to update the login Phone Number of users + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="phone">New Phone Number</param> + /// <param name="smsTemplate">SMS Template name</param> + /// <returns>Response Containing Validation Data and SMS Data</returns> + /// 11.5 + + public ApiResponse<UserProfilePostResponse<SMSResponseData>> UpdatePhoneNumber(string accessToken, string phone, + string smsTemplate = null) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + if (string.IsNullOrWhiteSpace(phone)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(phone)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + if (!string.IsNullOrWhiteSpace(smsTemplate)) + { + queryParameters.Add("smsTemplate", smsTemplate); + } + + var bodyParameters = new BodyParameters + { + { "phone", phone } + }; + + var resourcePath = "identity/v2/auth/phone"; + + return ConfigureAndExecute<UserProfilePostResponse<SMSResponseData>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + } + /// <summary> + /// This API is used to check the Phone Number exists or not on your site. + /// </summary> + /// <param name="phone">LoginRadius API Key</param> + /// <returns>Response containing Definition Complete ExistResponse data</returns> + /// 11.6 + + public ApiResponse<ExistResponse> CheckPhoneNumberAvailability(string phone) + { + if (string.IsNullOrWhiteSpace(phone)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(phone)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "phone", phone } + }; + + var resourcePath = "identity/v2/auth/phone"; + + return ConfigureAndExecute<ExistResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API is used to delete the Phone ID on a user's account via the access_token + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <returns>Response containing Definition of Delete Request</returns> + /// 11.7 + + public ApiResponse<DeleteResponse> RemovePhoneIDByAccessToken(string accessToken) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + + var resourcePath = "identity/v2/auth/phone"; + + return ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, null); + } + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Api/Authentication/RiskBasedAuthenticationApi.cs b/Source/LoginRadiusSDK.V2/Api/Authentication/RiskBasedAuthenticationApi.cs new file mode 100644 index 0000000..589f883 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Api/Authentication/RiskBasedAuthenticationApi.cs @@ -0,0 +1,353 @@ +//----------------------------------------------------------------------- +// <copyright file="RiskBasedAuthenticationApi.cs" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System; +using LoginRadiusSDK.V2.Common; +using LoginRadiusSDK.V2.Util; +using LoginRadiusSDK.V2.Models.ResponseModels; +using LoginRadiusSDK.V2.Models.ResponseModels.UserProfile; +using LoginRadiusSDK.V2.Models.RequestModels; + +namespace LoginRadiusSDK.V2.Api.Authentication +{ + public class RiskBasedAuthenticationApi : LoginRadiusResource + { + /// <summary> + /// This API retrieves a copy of the user data based on the Email + /// </summary> + /// <param name="emailAuthenticationModel">Model Class containing Definition of payload for Email Authentication API</param> + /// <param name="emailTemplate">Email template name</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <param name="loginUrl">Url where the user is logging from</param> + /// <param name="passwordDelegation">Password Delegation Allows you to use a third-party service to store your passwords rather than LoginRadius Cloud storage.</param> + /// <param name="passwordDelegationApp">RiskBased Authentication Password Delegation App</param> + /// <param name="rbaBrowserEmailTemplate">Risk Based Authentication Browser EmailTemplate</param> + /// <param name="rbaBrowserSmsTemplate">Risk Based Authentication Browser Sms Template</param> + /// <param name="rbaCityEmailTemplate">Risk Based Authentication City Email Template</param> + /// <param name="rbaCitySmsTemplate">Risk Based Authentication City SmsTemplate</param> + /// <param name="rbaCountryEmailTemplate">Risk Based Authentication Country EmailTemplate</param> + /// <param name="rbaCountrySmsTemplate">Risk Based Authentication Country SmsTemplate</param> + /// <param name="rbaIpEmailTemplate">Risk Based Authentication Ip EmailTemplate</param> + /// <param name="rbaIpSmsTemplate">Risk Based Authentication Ip SmsTemplate</param> + /// <param name="rbaOneclickEmailTemplate">Risk Based Authentication Oneclick EmailTemplate</param> + /// <param name="rbaOTPSmsTemplate">Risk Based Authentication Oneclick EmailTemplate</param> + /// <param name="smsTemplate">SMS Template name</param> + /// <param name="verificationUrl">Email verification url</param> + /// <returns>Response containing User Profile Data and access token</returns> + /// 9.2.4 + + public ApiResponse<AccessToken<Identity>> RBALoginByEmail(EmailAuthenticationModel emailAuthenticationModel, string emailTemplate = null, + string fields = "", string loginUrl = null, bool? passwordDelegation = null, string passwordDelegationApp = null, string rbaBrowserEmailTemplate = null, + string rbaBrowserSmsTemplate = null, string rbaCityEmailTemplate = null, string rbaCitySmsTemplate = null, string rbaCountryEmailTemplate = null, + string rbaCountrySmsTemplate = null, string rbaIpEmailTemplate = null, string rbaIpSmsTemplate = null, string rbaOneclickEmailTemplate = null, + string rbaOTPSmsTemplate = null, string smsTemplate = null, string verificationUrl = null) + { + if (emailAuthenticationModel == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(emailAuthenticationModel)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + if (!string.IsNullOrWhiteSpace(emailTemplate)) + { + queryParameters.Add("emailTemplate", emailTemplate); + } + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + if (!string.IsNullOrWhiteSpace(loginUrl)) + { + queryParameters.Add("loginUrl", loginUrl); + } + if (passwordDelegation != false) + { + queryParameters.Add("passwordDelegation", passwordDelegation.ToString()); + } + if (!string.IsNullOrWhiteSpace(passwordDelegationApp)) + { + queryParameters.Add("passwordDelegationApp", passwordDelegationApp); + } + if (!string.IsNullOrWhiteSpace(rbaBrowserEmailTemplate)) + { + queryParameters.Add("rbaBrowserEmailTemplate", rbaBrowserEmailTemplate); + } + if (!string.IsNullOrWhiteSpace(rbaBrowserSmsTemplate)) + { + queryParameters.Add("rbaBrowserSmsTemplate", rbaBrowserSmsTemplate); + } + if (!string.IsNullOrWhiteSpace(rbaCityEmailTemplate)) + { + queryParameters.Add("rbaCityEmailTemplate", rbaCityEmailTemplate); + } + if (!string.IsNullOrWhiteSpace(rbaCitySmsTemplate)) + { + queryParameters.Add("rbaCitySmsTemplate", rbaCitySmsTemplate); + } + if (!string.IsNullOrWhiteSpace(rbaCountryEmailTemplate)) + { + queryParameters.Add("rbaCountryEmailTemplate", rbaCountryEmailTemplate); + } + if (!string.IsNullOrWhiteSpace(rbaCountrySmsTemplate)) + { + queryParameters.Add("rbaCountrySmsTemplate", rbaCountrySmsTemplate); + } + if (!string.IsNullOrWhiteSpace(rbaIpEmailTemplate)) + { + queryParameters.Add("rbaIpEmailTemplate", rbaIpEmailTemplate); + } + if (!string.IsNullOrWhiteSpace(rbaIpSmsTemplate)) + { + queryParameters.Add("rbaIpSmsTemplate", rbaIpSmsTemplate); + } + if (!string.IsNullOrWhiteSpace(rbaOneclickEmailTemplate)) + { + queryParameters.Add("rbaOneclickEmailTemplate", rbaOneclickEmailTemplate); + } + if (!string.IsNullOrWhiteSpace(rbaOTPSmsTemplate)) + { + queryParameters.Add("rbaOTPSmsTemplate", rbaOTPSmsTemplate); + } + if (!string.IsNullOrWhiteSpace(smsTemplate)) + { + queryParameters.Add("smsTemplate", smsTemplate); + } + if (!string.IsNullOrWhiteSpace(verificationUrl)) + { + queryParameters.Add("verificationUrl", verificationUrl); + } + + var resourcePath = "identity/v2/auth/login"; + + return ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(emailAuthenticationModel)); + } + /// <summary> + /// This API retrieves a copy of the user data based on the Username + /// </summary> + /// <param name="userNameAuthenticationModel">Model Class containing Definition of payload for Username Authentication API</param> + /// <param name="emailTemplate">Email template name</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <param name="loginUrl">Url where the user is logging from</param> + /// <param name="passwordDelegation">Password Delegation Allows you to use a third-party service to store your passwords rather than LoginRadius Cloud storage.</param> + /// <param name="passwordDelegationApp">RiskBased Authentication Password Delegation App</param> + /// <param name="rbaBrowserEmailTemplate">Risk Based Authentication Browser EmailTemplate</param> + /// <param name="rbaBrowserSmsTemplate">Risk Based Authentication Browser Sms Template</param> + /// <param name="rbaCityEmailTemplate">Risk Based Authentication City Email Template</param> + /// <param name="rbaCitySmsTemplate">Risk Based Authentication City SmsTemplate</param> + /// <param name="rbaCountryEmailTemplate">Risk Based Authentication Country EmailTemplate</param> + /// <param name="rbaCountrySmsTemplate">Risk Based Authentication Country SmsTemplate</param> + /// <param name="rbaIpEmailTemplate">Risk Based Authentication Ip EmailTemplate</param> + /// <param name="rbaIpSmsTemplate">Risk Based Authentication Ip SmsTemplate</param> + /// <param name="rbaOneclickEmailTemplate">Risk Based Authentication Oneclick EmailTemplate</param> + /// <param name="rbaOTPSmsTemplate">Risk Based Authentication OTPSmsTemplate</param> + /// <param name="smsTemplate">SMS Template name</param> + /// <param name="verificationUrl">Email verification url</param> + /// <returns>Response containing User Profile Data and access token</returns> + /// 9.2.5 + + public ApiResponse<AccessToken<Identity>> RBALoginByUserName(UserNameAuthenticationModel userNameAuthenticationModel, string emailTemplate = null, + string fields = "", string loginUrl = null, bool? passwordDelegation = null, string passwordDelegationApp = null, string rbaBrowserEmailTemplate = null, + string rbaBrowserSmsTemplate = null, string rbaCityEmailTemplate = null, string rbaCitySmsTemplate = null, string rbaCountryEmailTemplate = null, + string rbaCountrySmsTemplate = null, string rbaIpEmailTemplate = null, string rbaIpSmsTemplate = null, string rbaOneclickEmailTemplate = null, + string rbaOTPSmsTemplate = null, string smsTemplate = null, string verificationUrl = null) + { + if (userNameAuthenticationModel == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(userNameAuthenticationModel)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + if (!string.IsNullOrWhiteSpace(emailTemplate)) + { + queryParameters.Add("emailTemplate", emailTemplate); + } + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + if (!string.IsNullOrWhiteSpace(loginUrl)) + { + queryParameters.Add("loginUrl", loginUrl); + } + if (passwordDelegation != false) + { + queryParameters.Add("passwordDelegation", passwordDelegation.ToString()); + } + if (!string.IsNullOrWhiteSpace(passwordDelegationApp)) + { + queryParameters.Add("passwordDelegationApp", passwordDelegationApp); + } + if (!string.IsNullOrWhiteSpace(rbaBrowserEmailTemplate)) + { + queryParameters.Add("rbaBrowserEmailTemplate", rbaBrowserEmailTemplate); + } + if (!string.IsNullOrWhiteSpace(rbaBrowserSmsTemplate)) + { + queryParameters.Add("rbaBrowserSmsTemplate", rbaBrowserSmsTemplate); + } + if (!string.IsNullOrWhiteSpace(rbaCityEmailTemplate)) + { + queryParameters.Add("rbaCityEmailTemplate", rbaCityEmailTemplate); + } + if (!string.IsNullOrWhiteSpace(rbaCitySmsTemplate)) + { + queryParameters.Add("rbaCitySmsTemplate", rbaCitySmsTemplate); + } + if (!string.IsNullOrWhiteSpace(rbaCountryEmailTemplate)) + { + queryParameters.Add("rbaCountryEmailTemplate", rbaCountryEmailTemplate); + } + if (!string.IsNullOrWhiteSpace(rbaCountrySmsTemplate)) + { + queryParameters.Add("rbaCountrySmsTemplate", rbaCountrySmsTemplate); + } + if (!string.IsNullOrWhiteSpace(rbaIpEmailTemplate)) + { + queryParameters.Add("rbaIpEmailTemplate", rbaIpEmailTemplate); + } + if (!string.IsNullOrWhiteSpace(rbaIpSmsTemplate)) + { + queryParameters.Add("rbaIpSmsTemplate", rbaIpSmsTemplate); + } + if (!string.IsNullOrWhiteSpace(rbaOneclickEmailTemplate)) + { + queryParameters.Add("rbaOneclickEmailTemplate", rbaOneclickEmailTemplate); + } + if (!string.IsNullOrWhiteSpace(rbaOTPSmsTemplate)) + { + queryParameters.Add("rbaOTPSmsTemplate", rbaOTPSmsTemplate); + } + if (!string.IsNullOrWhiteSpace(smsTemplate)) + { + queryParameters.Add("smsTemplate", smsTemplate); + } + if (!string.IsNullOrWhiteSpace(verificationUrl)) + { + queryParameters.Add("verificationUrl", verificationUrl); + } + + var resourcePath = "identity/v2/auth/login"; + + return ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(userNameAuthenticationModel)); + } + /// <summary> + /// This API retrieves a copy of the user data based on the Phone + /// </summary> + /// <param name="phoneAuthenticationModel">Model Class containing Definition of payload for PhoneAuthenticationModel API</param> + /// <param name="emailTemplate">Email template name</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <param name="loginUrl">Url where the user is logging from</param> + /// <param name="passwordDelegation">Password Delegation Allows you to use a third-party service to store your passwords rather than LoginRadius Cloud storage.</param> + /// <param name="passwordDelegationApp">RiskBased Authentication Password Delegation App</param> + /// <param name="rbaBrowserEmailTemplate">Risk Based Authentication Browser EmailTemplate</param> + /// <param name="rbaBrowserSmsTemplate">Risk Based Authentication Browser Sms Template</param> + /// <param name="rbaCityEmailTemplate">Risk Based Authentication City Email Template</param> + /// <param name="rbaCitySmsTemplate">Risk Based Authentication City SmsTemplate</param> + /// <param name="rbaCountryEmailTemplate">Risk Based Authentication Country EmailTemplate</param> + /// <param name="rbaCountrySmsTemplate">Risk Based Authentication Country SmsTemplate</param> + /// <param name="rbaIpEmailTemplate">Risk Based Authentication Ip EmailTemplate</param> + /// <param name="rbaIpSmsTemplate">Risk Based Authentication Ip SmsTemplate</param> + /// <param name="rbaOneclickEmailTemplate">Risk Based Authentication Oneclick EmailTemplate</param> + /// <param name="rbaOTPSmsTemplate">Risk Based Authentication OTPSmsTemplate</param> + /// <param name="smsTemplate">SMS Template name</param> + /// <param name="verificationUrl">Email verification url</param> + /// <returns>Response containing User Profile Data and access token</returns> + /// 9.2.6 + + public ApiResponse<AccessToken<Identity>> RBALoginByPhone(PhoneAuthenticationModel phoneAuthenticationModel, string emailTemplate = null, + string fields = "", string loginUrl = null, bool? passwordDelegation = null, string passwordDelegationApp = null, string rbaBrowserEmailTemplate = null, + string rbaBrowserSmsTemplate = null, string rbaCityEmailTemplate = null, string rbaCitySmsTemplate = null, string rbaCountryEmailTemplate = null, + string rbaCountrySmsTemplate = null, string rbaIpEmailTemplate = null, string rbaIpSmsTemplate = null, string rbaOneclickEmailTemplate = null, + string rbaOTPSmsTemplate = null, string smsTemplate = null, string verificationUrl = null) + { + if (phoneAuthenticationModel == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(phoneAuthenticationModel)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + if (!string.IsNullOrWhiteSpace(emailTemplate)) + { + queryParameters.Add("emailTemplate", emailTemplate); + } + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + if (!string.IsNullOrWhiteSpace(loginUrl)) + { + queryParameters.Add("loginUrl", loginUrl); + } + if (passwordDelegation != false) + { + queryParameters.Add("passwordDelegation", passwordDelegation.ToString()); + } + if (!string.IsNullOrWhiteSpace(passwordDelegationApp)) + { + queryParameters.Add("passwordDelegationApp", passwordDelegationApp); + } + if (!string.IsNullOrWhiteSpace(rbaBrowserEmailTemplate)) + { + queryParameters.Add("rbaBrowserEmailTemplate", rbaBrowserEmailTemplate); + } + if (!string.IsNullOrWhiteSpace(rbaBrowserSmsTemplate)) + { + queryParameters.Add("rbaBrowserSmsTemplate", rbaBrowserSmsTemplate); + } + if (!string.IsNullOrWhiteSpace(rbaCityEmailTemplate)) + { + queryParameters.Add("rbaCityEmailTemplate", rbaCityEmailTemplate); + } + if (!string.IsNullOrWhiteSpace(rbaCitySmsTemplate)) + { + queryParameters.Add("rbaCitySmsTemplate", rbaCitySmsTemplate); + } + if (!string.IsNullOrWhiteSpace(rbaCountryEmailTemplate)) + { + queryParameters.Add("rbaCountryEmailTemplate", rbaCountryEmailTemplate); + } + if (!string.IsNullOrWhiteSpace(rbaCountrySmsTemplate)) + { + queryParameters.Add("rbaCountrySmsTemplate", rbaCountrySmsTemplate); + } + if (!string.IsNullOrWhiteSpace(rbaIpEmailTemplate)) + { + queryParameters.Add("rbaIpEmailTemplate", rbaIpEmailTemplate); + } + if (!string.IsNullOrWhiteSpace(rbaIpSmsTemplate)) + { + queryParameters.Add("rbaIpSmsTemplate", rbaIpSmsTemplate); + } + if (!string.IsNullOrWhiteSpace(rbaOneclickEmailTemplate)) + { + queryParameters.Add("rbaOneclickEmailTemplate", rbaOneclickEmailTemplate); + } + if (!string.IsNullOrWhiteSpace(rbaOTPSmsTemplate)) + { + queryParameters.Add("rbaOTPSmsTemplate", rbaOTPSmsTemplate); + } + if (!string.IsNullOrWhiteSpace(smsTemplate)) + { + queryParameters.Add("smsTemplate", smsTemplate); + } + if (!string.IsNullOrWhiteSpace(verificationUrl)) + { + queryParameters.Add("verificationUrl", verificationUrl); + } + + var resourcePath = "identity/v2/auth/login"; + + return ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(phoneAuthenticationModel)); + } + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Api/Authentication/SmartLoginApi.cs b/Source/LoginRadiusSDK.V2/Api/Authentication/SmartLoginApi.cs new file mode 100644 index 0000000..8303785 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Api/Authentication/SmartLoginApi.cs @@ -0,0 +1,166 @@ +//----------------------------------------------------------------------- +// <copyright file="SmartLoginApi.cs" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System; +using LoginRadiusSDK.V2.Common; +using LoginRadiusSDK.V2.Util; +using LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects; +using LoginRadiusSDK.V2.Models.ResponseModels; +using LoginRadiusSDK.V2.Models.ResponseModels.UserProfile; + +namespace LoginRadiusSDK.V2.Api.Authentication +{ + public class SmartLoginApi : LoginRadiusResource + { + /// <summary> + /// This API verifies the provided token for Smart Login + /// </summary> + /// <param name="verificationToken">Verification token received in the email</param> + /// <param name="welcomeEmailTemplate">Name of the welcome email template</param> + /// <returns>Complete verified response data</returns> + /// 8.4.1 + + public ApiResponse<VerifiedResponse> SmartLoginTokenVerification(string verificationToken, string welcomeEmailTemplate = null) + { + if (string.IsNullOrWhiteSpace(verificationToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(verificationToken)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "verificationToken", verificationToken } + }; + if (!string.IsNullOrWhiteSpace(welcomeEmailTemplate)) + { + queryParameters.Add("welcomeEmailTemplate", welcomeEmailTemplate); + } + + var resourcePath = "identity/v2/auth/email/smartlogin"; + + return ConfigureAndExecute<VerifiedResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API sends a Smart Login link to the user's Email Id. + /// </summary> + /// <param name="clientGuid">Unique string used in the Smart Login request</param> + /// <param name="email">Email of the user</param> + /// <param name="redirectUrl">Url where the user will redirect after success authentication</param> + /// <param name="smartLoginEmailTemplate">Email template for Smart Login link</param> + /// <param name="welcomeEmailTemplate">Name of the welcome email template</param> + /// <returns>Response containing Definition of Complete Validation data</returns> + /// 9.17.1 + + public ApiResponse<PostResponse> SmartLoginByEmail(string clientGuid, string email, + string redirectUrl = null, string smartLoginEmailTemplate = null, string welcomeEmailTemplate = null) + { + if (string.IsNullOrWhiteSpace(clientGuid)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(clientGuid)); + } + if (string.IsNullOrWhiteSpace(email)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(email)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "clientGuid", clientGuid }, + { "email", email } + }; + if (!string.IsNullOrWhiteSpace(redirectUrl)) + { + queryParameters.Add("redirectUrl", redirectUrl); + } + if (!string.IsNullOrWhiteSpace(smartLoginEmailTemplate)) + { + queryParameters.Add("smartLoginEmailTemplate", smartLoginEmailTemplate); + } + if (!string.IsNullOrWhiteSpace(welcomeEmailTemplate)) + { + queryParameters.Add("welcomeEmailTemplate", welcomeEmailTemplate); + } + + var resourcePath = "identity/v2/auth/login/smartlogin"; + + return ConfigureAndExecute<PostResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API sends a Smart Login link to the user's Email Id. + /// </summary> + /// <param name="clientGuid">Unique string used in the Smart Login request</param> + /// <param name="username">UserName of the user</param> + /// <param name="redirectUrl">Url where the user will redirect after success authentication</param> + /// <param name="smartLoginEmailTemplate">Email template for Smart Login link</param> + /// <param name="welcomeEmailTemplate">Name of the welcome email template</param> + /// <returns>Response containing Definition of Complete Validation data</returns> + /// 9.17.2 + + public ApiResponse<PostResponse> SmartLoginByUserName(string clientGuid, string username, + string redirectUrl = null, string smartLoginEmailTemplate = null, string welcomeEmailTemplate = null) + { + if (string.IsNullOrWhiteSpace(clientGuid)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(clientGuid)); + } + if (string.IsNullOrWhiteSpace(username)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(username)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "clientGuid", clientGuid }, + { "username", username } + }; + if (!string.IsNullOrWhiteSpace(redirectUrl)) + { + queryParameters.Add("redirectUrl", redirectUrl); + } + if (!string.IsNullOrWhiteSpace(smartLoginEmailTemplate)) + { + queryParameters.Add("smartLoginEmailTemplate", smartLoginEmailTemplate); + } + if (!string.IsNullOrWhiteSpace(welcomeEmailTemplate)) + { + queryParameters.Add("welcomeEmailTemplate", welcomeEmailTemplate); + } + + var resourcePath = "identity/v2/auth/login/smartlogin"; + + return ConfigureAndExecute<PostResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API is used to check if the Smart Login link has been clicked or not + /// </summary> + /// <param name="clientGuid">Unique string used in the Smart Login request</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <returns>Response containing User Profile Data and access token</returns> + /// 9.21.1 + + public ApiResponse<AccessToken<Identity>> SmartLoginPing(string clientGuid, string fields = "") + { + if (string.IsNullOrWhiteSpace(clientGuid)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(clientGuid)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "clientGuid", clientGuid } + }; + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + + var resourcePath = "identity/v2/auth/login/smartlogin/ping"; + + return ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.GET, resourcePath, queryParameters, null); + } + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Api/AuthenticationApi.cs b/Source/LoginRadiusSDK.V2/Api/AuthenticationApi.cs deleted file mode 100644 index 0dafb42..0000000 --- a/Source/LoginRadiusSDK.V2/Api/AuthenticationApi.cs +++ /dev/null @@ -1,600 +0,0 @@ -using LoginRadiusSDK.V2.Models; -using LoginRadiusSDK.V2.Models.CustomerAuthentication.Email; -using LoginRadiusSDK.V2.Models.Email; -using LoginRadiusSDK.V2.Models.UserProfile; -using LoginRadiusSDK.V2.Util; -using System.Collections.Generic; -using static LoginRadiusSDK.V2.Util.LoginRadiusArgumentValidator; -using static LoginRadiusSDK.V2.Entity.LoginRadiusSecureOneTimeToken; -using LoginRadiusSDK.V2.Models.Identity; -using LoginRadiusSDK.V2.Models.Configuration; -using LoginRadiusSDK.V2.Models.CustomerAuthentication.Password; -using LoginRadiusSDK.V2.Models.Password; - -namespace LoginRadiusSDK.V2.Api -{ - public class AuthenticationApi : LoginRadiusResource - { - /// <summary> - /// This API is used to add additional emails to a user's account. - /// </summary> - /// <param name="accessToken">Access token for session that is completing action.</param> - /// <param name="email">Email being added.</param> - /// <param name="verificationUrl">Verification url sent to email.</param> - /// <param name="emailTemplate">Email template being sent out.</param> - /// <returns> LoginRadiusPostResponse: Boolean to show if email was added.</returns> - public ApiResponse<LoginRadiusPostResponse> AddEmail(string accessToken, AddEmail email, - string verificationUrl = "", string emailTemplate = "") - { - Validate(new[] { email.Email, email.Type, accessToken }); - var additionalQueryParams = new QueryParameters(); - var additionalHeaders = new Dictionary<string, string>() { [BaseConstants.AccessTokenAuthorizationHeader] = - BaseConstants.AccessTokenBearerHeader + accessToken }; - if (!string.IsNullOrWhiteSpace(verificationUrl)) - additionalQueryParams.Add("verificationUrl", verificationUrl); - if (!string.IsNullOrWhiteSpace(emailTemplate)) additionalQueryParams.Add("emailTemplate", emailTemplate); - return ConfigureAndExecute<LoginRadiusPostResponse>(RequestType.Authentication, HttpMethod.POST, - "email", additionalQueryParams, email.ConvertToJson(), additionalHeaders); - } - - /// <summary> - /// This API is used to send the reset password url to a specified account. - /// Note: If you have the UserName workflow enabled, you may replace the 'email' parameter with 'username'. - /// </summary> - /// <param name="email">Email associated with a LoginRadius account.</param> - /// <param name="resetPasswordUrl">Reset password url sent to email.</param> - /// <param name="emailTemplate">Email template being sent out.</param> - /// <returns> LoginRadiusPostResponse: Boolean to show if email was added.</returns> - public ApiResponse<LoginRadiusPostResponse> ForgotPassword(string email, string resetPasswordUrl = "", string emailTemplate = "") - { - Validate(new[] { email, resetPasswordUrl }); - var additionalQueryParams = new QueryParameters - { - {"resetPasswordUrl", resetPasswordUrl}, {"emailTemplate", emailTemplate} - }; - - var bodyParameter = new BodyParameters { ["email"] = email }; - return ConfigureAndExecute<LoginRadiusPostResponse>(RequestType.Authentication, HttpMethod.POST, - "password", additionalQueryParams, bodyParameter.ConvertToJson()); - } - - /// <summary> - /// This API creates a user in the database as well as sends a verification email to the user. - /// </summary> - /// <param name="socialUserProfile">LoginRadius Profile that is being created.</param> - /// <param name="optionalParams">Gets or sets API optional parameters, <see cref="LoginRadiusApiOptionalParams"/></param> - /// <param name="sottAuth">Settings for the SOTT generated to register.</param> - /// <returns> LoginRadiusPostResponse: Boolean to show if account was registered.</returns> - public ApiResponse<LoginRadiusPostResponse> RegisterCustomer(UserIdentityCreateModel socialUserProfile, - LoginRadiusApiOptionalParams optionalParams, SottRequest sottAuth) - { - var additionalQueryParams = new QueryParameters(); - var additionalHeaders = new Dictionary<string, string>() { [BaseConstants.SottAuthorizationHeader] = "" }; - additionalQueryParams.AddOptionalParamsRange(optionalParams); - - if (!string.IsNullOrWhiteSpace(sottAuth.Sott)) - { - additionalHeaders[BaseConstants.SottAuthorizationHeader] = sottAuth.Sott; - } - else - { - var timeDifference = new QueryParameters { ["timedifference"] = sottAuth.TimeDifference }; - var sottResponse = ConfigureAndExecute<SottDetails>(RequestType.ServerInfo, HttpMethod.GET, null, timeDifference); - - if (sottResponse.Response?.Sott != null) - { - sottAuth.StartTime = sottResponse.Response.Sott.StartTime; - sottAuth.EndTime = sottResponse.Response.Sott.EndTime; - sottAuth.TimeDifference = sottResponse.Response.Sott.TimeDifference; - } - additionalHeaders[BaseConstants.SottAuthorizationHeader] = GetSott(sottAuth); - } - - return ConfigureAndExecute<LoginRadiusPostResponse>(RequestType.Authentication, HttpMethod.POST, - "register", additionalQueryParams, socialUserProfile.ConvertToJson(), additionalHeaders); - } - - /// <summary> - /// This API retrieves a copy of the user data based on the email and generates an access token for the account. - /// </summary> - /// <param name="payload">JSON string storing login information.</param> - /// <param name="optionalParams">Gets or sets API optional parameters, <see cref="LoginRadiusApiOptionalParams"/></param> - /// <returns> LoginResponse: Login Response containing accessToken and user profile data.</returns> - public ApiResponse<LoginResponse> LoginByEmail(string payload, LoginRadiusApiOptionalParams optionalParams) - { - Validate(new[] { payload }); - var additionalQueryParams = new QueryParameters(); - additionalQueryParams.AddOptionalParamsRange(optionalParams); - return ConfigureAndExecute<LoginResponse>(RequestType.Authentication, HttpMethod.POST, "login", - additionalQueryParams, payload); - } - - /// <summary> - /// This API retrieves a copy of the user data based on the username. - /// </summary> - /// <param name="payload">JSON string storing login information.</param> - /// <param name="optionalParams">Gets or sets API optional parameters, <see cref="LoginRadiusApiOptionalParams"/></param> - /// <returns> LoginResponse: Login Response containing accessToken and user profile data.</returns> - public ApiResponse<LoginResponse> LoginByUserName(string payload, LoginRadiusApiOptionalParams optionalParams) - { - Validate(new[] { payload }); - var additionalQueryParams = new QueryParameters(); - additionalQueryParams.AddOptionalParamsRange(optionalParams); - return ConfigureAndExecute<LoginResponse>(RequestType.Authentication, HttpMethod.POST, "login", - additionalQueryParams, payload); - } - - /// <summary> - /// This API is used to check the email exists or not on your site. - /// </summary> - /// <param name="email"> Email being checked.</param> - /// <returns>LoginRadiusExistsResponse: Boolean to show if email exists.</returns> - public ApiResponse<LoginRadiusExistsResponse> CheckEmailAvailability(string email) - { - Validate(new[] { email }); - var additionalQueryParams = new QueryParameters { ["email"] = email }; - return ConfigureAndExecute<LoginRadiusExistsResponse>(RequestType.Authentication, HttpMethod.GET, - "email", additionalQueryParams); - } - - /// <summary> - /// This API is used to check the UserName exists or not on your site. - /// </summary> - /// <param name="userName">Username being checked.</param> - /// <returns>LoginRadiusDeleteResponse: Boolean to show if userName was deleted.</returns> - public ApiResponse<LoginRadiusExistsResponse> CheckUserNameAvailability(string userName) - { - Validate(new[] { userName }); - var additionalQueryParams = new QueryParameters { ["username"] = userName }; - return ConfigureAndExecute<LoginRadiusExistsResponse>(RequestType.Authentication, HttpMethod.GET, - "username", additionalQueryParams); - } - - /// <summary> - /// This API retrieves a copy of the user data based on the access_token. - /// </summary> - /// <param name="accessToken">Access token for the current session.</param> - /// <returns>LoginRadiusUserIdentity: The LoginRadius profile.</returns> - public ApiResponse<LoginRadiusUserIdentity> GetProfile(string accessToken) - { - Validate(new[] { accessToken }); - var additionalHeaders = new Dictionary<string, string>() { [BaseConstants.AccessTokenAuthorizationHeader] = - BaseConstants.AccessTokenBearerHeader + accessToken }; - return ConfigureAndExecute<LoginRadiusUserIdentity>(RequestType.Authentication, HttpMethod.GET, "account", - null, null, additionalHeaders); - } - - /// <summary> - /// This API is used to update the privacy policy stored in the user's profile by providing the access_token of the user accepting the privacy policy. - /// </summary> - /// <param name="accessToken">Access token for the current session.</param> - /// <returns>LoginRadiusUserIdentity: The LoginRadius profile.</returns> - public ApiResponse<LoginRadiusUserIdentity> PrivacyPolicyAccept(string accessToken) - { - Validate(new[] { accessToken }); - var additionalHeaders = new Dictionary<string, string>() { [BaseConstants.AccessTokenAuthorizationHeader] = - BaseConstants.AccessTokenBearerHeader + accessToken }; - - return ConfigureAndExecute<LoginRadiusUserIdentity>(RequestType.Authentication, HttpMethod.GET, "privacypolicy/accept", - null, null, additionalHeaders); - } - - /// <summary> - /// This API will send a welcome email. - /// </summary> - /// <param name="accessToken">Access token for the current session.</param> - /// <param name="welcomeEmailTemplate">Name of the welcome email template.</param> - /// <returns>LoginRadiusPostResponse: Boolean to show if welcome email was sent.</returns> - public ApiResponse<LoginRadiusPostResponse> SendWelcomeEmail(string accessToken, string welcomeEmailTemplate = "") - { - Validate(new[] { accessToken }); - var additionalHeaders = new Dictionary<string, string>() { [BaseConstants.AccessTokenAuthorizationHeader] = - BaseConstants.AccessTokenBearerHeader + accessToken }; - var additionalQueryParams = new QueryParameters(); - if (!string.IsNullOrWhiteSpace(welcomeEmailTemplate)) - additionalQueryParams.Add("welcomeEmailTemplate", welcomeEmailTemplate); - return ConfigureAndExecute<LoginRadiusPostResponse>(RequestType.Authentication, HttpMethod.GET, - "account/sendwelcomeemail", additionalQueryParams, null, additionalHeaders); - } - - /// <summary> - /// This API is called just before account linking API and it prevents the raas profile of the second account from getting created. - /// </summary> - /// <param name="accessToken">Access token for the current session.</param> - /// <returns>LoginRadiusSocialUserProfile: Boolean to show if account was deleted.</returns> - public ApiResponse<LoginRadiusSocialUserProfile> AuthSocialIdentity(string accessToken) - { - Validate(new[] { accessToken }); - var additionalHeaders = new Dictionary<string, string>() { [BaseConstants.AccessTokenAuthorizationHeader] = - BaseConstants.AccessTokenBearerHeader + accessToken }; - return ConfigureAndExecute<LoginRadiusSocialUserProfile>(RequestType.Authentication, HttpMethod.GET, - "socialidentity", null, null, additionalHeaders); - } - - /// <summary> - /// This api validates access token, if valid then returns a response with its expiry otherwise error. - /// </summary> - /// <param name="accessToken">Access token for the current session.</param> - /// <returns>AccessTokenResponse: The updated access token and its new expiry time.</returns> - public ApiResponse<AccessTokenResponse> AuthValidateAccessToken(string accessToken) - { - Validate(new[] { accessToken }); - var additionalHeaders = new Dictionary<string, string>() { [BaseConstants.AccessTokenAuthorizationHeader] = - BaseConstants.AccessTokenBearerHeader + accessToken }; - return ConfigureAndExecute<AccessTokenResponse>(RequestType.Authentication, HttpMethod.GET, - "access_token/validate", null, null, additionalHeaders); - } - - /// <summary> - /// This API is used to obtain information on the provided access token. - /// </summary> - /// <param name="accessToken">A valid access token.</param> - /// <returns>AccessTokenResponse: Info on the provided account token.</returns> - public ApiResponse<AccessTokenResponse> AccessTokenInfo(string accessToken) - { - Validate(new[] { accessToken }); - var additionalHeaders = new Dictionary<string, string>() - { - [BaseConstants.AccessTokenAuthorizationHeader] = - BaseConstants.AccessTokenBearerHeader + accessToken - }; - return ConfigureAndExecute<AccessTokenResponse>(RequestType.Authentication, HttpMethod.GET, - "access_token", null, null, additionalHeaders); - } - - /// <summary> - /// This API is used to verify the email of user. Note: This API will only return the full profile if you have - /// 'Enable auto login after email verification' set in your LoginRadius Dashboard's Email Workflow settings under 'Verification Email'. - /// </summary> - /// <param name="verificationToken">Verification token received in the email.</param> - /// <param name="url">Mention URL to log the main URL(Domain name) in Database.</param> - /// <param name="welcomeEmailTemplate">Email template for welcome email.</param> - /// <returns>LoginRadiusPostResponse: Boolean to show if email verification was successful.</returns> - public ApiResponse<LoginRadiusPostResponse<Data>> VerifyEmail(string verificationToken, string url, - string welcomeEmailTemplate = "") - { - Validate(new[] { verificationToken, url }); - var additionalQueryParams = new QueryParameters { ["VerificationToken"] = verificationToken, ["url"] = url }; - if (!string.IsNullOrWhiteSpace(welcomeEmailTemplate)) - additionalQueryParams.Add("welcomeEmailTemplate", welcomeEmailTemplate); - return ConfigureAndExecute<LoginRadiusPostResponse<Data>>(RequestType.Authentication, HttpMethod.GET, - "email", additionalQueryParams); - } - - /// <summary> - /// This API sends a verification email with an OTP. - /// </summary> - /// <param name="verifyEmailModel">Uid associated with a LoginRadius account.</param> - /// <param name="url">Mention URL to log the main URL(Domain name) in Database.</param> - /// <param name="welcomeEmailTemplate">Email template for welcome email.</param> - /// <returns>LoginRadiusPostResponse: Boolean to show if email verification was successful.</returns> - public ApiResponse<LoginRadiusPostResponse<Data>> VerifyEmailByOtp(VerifyEmailModel verifyEmailModel, string url = "", - string welcomeEmailTemplate = "") - { - Validate(new[] { verifyEmailModel.email, verifyEmailModel.otp }); - var additionalQueryParams = new QueryParameters(); - if (!string.IsNullOrWhiteSpace(welcomeEmailTemplate)) - additionalQueryParams.Add("welcomeEmailTemplate", welcomeEmailTemplate); - if (!string.IsNullOrWhiteSpace(url)) additionalQueryParams.Add("url", url); - return ConfigureAndExecute<LoginRadiusPostResponse<Data>>(RequestType.Authentication, HttpMethod.PUT, - "email", additionalQueryParams, verifyEmailModel.ConvertToJson()); - } - - /// <summary> - /// API is used to delete account using delete token. - /// </summary> - /// <param name="deleteToken">Delete Token sent to the email.</param> - /// <returns><see cref="LoginRadiusPostResponse"/>Boolean to show if account was deleted</returns> - public ApiResponse<LoginRadiusPostResponse> DeleteProfile(string deleteToken) - { - Validate(new[] { deleteToken }); - var additionalQueryParams = new QueryParameters { { nameof(deleteToken), deleteToken } }; - return ConfigureAndExecute<LoginRadiusPostResponse>(RequestType.Authentication, HttpMethod.GET, - "account/delete", additionalQueryParams); - } - - /// <summary> - /// This api call invalidates the active access_token or expires an access token's validity. - /// </summary> - /// <param name="accessToken">Access token being invalidated.</param> - /// <returns>LoginRadiusPostResponse: Boolean to show if the token was invalidated.</returns> - public ApiResponse<LoginRadiusPostResponse> AuthInvalidateAccessToken(string accessToken) - { - Validate(new[] { accessToken }); - var additionalHeaders = new Dictionary<string, string>() { [BaseConstants.AccessTokenAuthorizationHeader] = - BaseConstants.AccessTokenBearerHeader + accessToken }; - return ConfigureAndExecute<LoginRadiusPostResponse>(RequestType.Authentication, HttpMethod.GET, - "access_token/invalidate", null, null, additionalHeaders); - } - - /// <summary> - /// This API is used to retrieve the list of questions that are configured on the respective LoginRadius site. - /// </summary> - /// <param name="accessToken">Session token associated with the security questions needing to be retrieved.</param> - /// <returns>List of SecurityQuestionGet: The list of security questions.</returns> - public ApiResponse<List<SecurityQuestionGet>> SecurityQuestionByAccessToken(string accessToken) - { - Validate(new[] { accessToken }); - var additionalHeaders = new Dictionary<string, string>() { [BaseConstants.AccessTokenAuthorizationHeader] = - BaseConstants.AccessTokenBearerHeader + accessToken }; - return ConfigureAndExecute<List<SecurityQuestionGet>>(RequestType.Authentication, HttpMethod.GET, - "securityquestion/accesstoken", null, null, additionalHeaders); - } - - /// <summary> - /// This API is used to retrieve the list of questions that are configured on the respective LoginRadius site. - /// </summary> - /// <param name="email">Email associated with the security questions needing to be retrieved.</param> - /// <returns>List of SecurityQuestionGet: The list of security questions.</returns> - public ApiResponse<List<SecurityQuestionGet>> SecurityQuestionByEmail(string email) - { - Validate(new[] { email }); - var additionalQueryParams = new QueryParameters { [nameof(email)] = email }; - return ConfigureAndExecute<List<SecurityQuestionGet>>(RequestType.Authentication, HttpMethod.GET, - "securityquestion/email", additionalQueryParams, null); - } - - /// <summary> - /// This API is used to retrieve the list of questions that are configured on the respective LoginRadius site. - /// </summary> - /// <param name="username">Username associated with the security questions needing to be retrieved.</param> - /// <returns>List of SecurityQuestionGet: The list of security questions.</returns> - public ApiResponse<List<SecurityQuestionGet>> SecurityQuestionByUserName(string username) - { - Validate(new[] { username }); - var additionalQueryParams = new QueryParameters { [nameof(username)] = username }; - return ConfigureAndExecute<List<SecurityQuestionGet>>(RequestType.Authentication, HttpMethod.GET, - "securityquestion/username", additionalQueryParams, null); - } - - /// <summary> - /// This API is used to retrieve the list of questions that are configured on the respective LoginRadius site. - /// </summary> - /// <param name="phone">Phone number associated with the security questions needing to be retrieved.</param> - /// <returns>List of SecurityQuestionGet: The list of security questions.</returns> - public ApiResponse<List<SecurityQuestionGet>> SecurityQuestionByPhone(string phone) - { - Validate(new[] { phone }); - var additionalQueryParams = new QueryParameters { [nameof(phone)] = phone }; - return ConfigureAndExecute<List<SecurityQuestionGet>>(RequestType.Authentication, HttpMethod.GET, - "securityquestion/phone", additionalQueryParams, null); - } - - /// <summary> - /// This API is used to change the accounts password based on the previous password. - /// </summary> - /// <param name="accessToken">Session token where password change is occuring.</param> - /// <param name="changePasswordModel">Object containing old and new password parameters.</param> - /// <returns>LoginRadiusPostResponse: Boolean to show if password was changed.</returns> - public ApiResponse<LoginRadiusPostResponse> ChangePassword(string accessToken, ChangePasswordModel changePasswordModel) - { - Validate(new[] { accessToken, changePasswordModel.OldPassword, changePasswordModel.NewPassword }); - var additionalHeaders = new Dictionary<string, string>() { [BaseConstants.AccessTokenAuthorizationHeader] = - BaseConstants.AccessTokenBearerHeader + accessToken }; - var passwordModel = new BodyParameters - { - ["OldPassword"] = changePasswordModel.OldPassword, - ["NewPassword"] = changePasswordModel.NewPassword - }; - return ConfigureAndExecute<LoginRadiusPostResponse>(RequestType.Authentication, HttpMethod.PUT, - "password/change", null, passwordModel.ConvertToJson(), additionalHeaders); - } - - /// <summary> - /// This API is used to link up a social provider account with the specified account based on the access token and the social providers user access token. - /// </summary> - /// <param name="accessToken">Session token where linking is taking place.</param> - /// <param name="candidateToken">Access token generated when completing a social login with no attached LoginRadius account.</param> - /// <returns>LoginRadiusPostResponse: Boolean to show if account was successfully linked.</returns> - public ApiResponse<LoginRadiusPostResponse> LinkAccount(string accessToken, string candidateToken) - { - Validate(new[] { accessToken, candidateToken }); - var additionalHeaders = new Dictionary<string, string>() { [BaseConstants.AccessTokenAuthorizationHeader] = - BaseConstants.AccessTokenBearerHeader + accessToken }; - var bodyParams = new BodyParameters { ["candidateToken"] = candidateToken }; - return ConfigureAndExecute<LoginRadiusPostResponse>(RequestType.Authentication, HttpMethod.PUT, - "socialidentity", null, bodyParams.ConvertToJson(), additionalHeaders); - } - - /// <summary> - /// This API resends the verification email to the user. - /// </summary> - /// <param name="email">Email being verified.</param> - /// <param name="verificationUrl">Url where user should go to verify.</param> - /// <param name="emailTemplate">Email template name.</param> - /// <returns>LoginRadiusPostResponse: Boolean to show if email has been sent out.</returns> - public ApiResponse<LoginRadiusPostResponse> ResendVerificationEmail(string email, string verificationUrl = "", - string emailTemplate = "") - { - var additionalQueryParams = new QueryParameters(); - if (!string.IsNullOrWhiteSpace(verificationUrl)) additionalQueryParams.Add("verificationUrl", verificationUrl); - if (!string.IsNullOrWhiteSpace(emailTemplate)) additionalQueryParams.Add("emailTemplate", emailTemplate); - var bodyParams = new BodyParameters { ["Email"] = email }; - return ConfigureAndExecute<LoginRadiusPostResponse>(RequestType.Authentication, HttpMethod.PUT, - "register", additionalQueryParams, bodyParams.ConvertToJson()); - } - - /// <summary> - /// This API is used to set a new password for the specified account. - /// </summary> - /// <param name="resetPasswordModel">Object containing reset token, new password and other optional parameters.</param> - /// <returns>LoginRadiusPostResponse: Boolean to show if password was successfully changed.</returns> - public ApiResponse<LoginRadiusPostResponse> ResetPassword(ResetPasswordModel resetPasswordModel) - { - Validate(new[] { resetPasswordModel.Password, resetPasswordModel.ResetToken }); - return ConfigureAndExecute<LoginRadiusPostResponse>(RequestType.Authentication, HttpMethod.PUT, - "password/reset", null, resetPasswordModel.ConvertToJson()); - } - - /// <summary> - /// This API is used to set a new password for the specified account. - /// </summary> - /// <param name="resetPasswordOtpModel">Object containing otp, new password, email and other optional parameters.</param> - /// <returns>LoginRadiusPostResponse: Boolean to show if account password was reset successfully.</returns> - public ApiResponse<LoginRadiusPostResponse<Data>> AuthResetPasswordByOtp(ResetPasswordByEmailAndOtpModel resetPasswordOtpModel) - { - Validate(new[] { resetPasswordOtpModel.password, resetPasswordOtpModel.otp, resetPasswordOtpModel.email }); - return ConfigureAndExecute<LoginRadiusPostResponse<Data>>(RequestType.Authentication, HttpMethod.PUT, - "password/reset", null, resetPasswordOtpModel.ConvertToJson()); - } - - /// <summary> - /// This API is used to reset password for the specified account by security question. - /// </summary> - /// <param name="resetPasswordModel">Object containing security answer, new password, email and other parameters.</param> - /// <returns>LoginRadiusPostResponse: Boolean to show if password was changed successfully.</returns> - public ApiResponse<LoginRadiusPostResponse<Data>> ResetPasswordBySecurityAnswerAndEmail( - ResetPasswordBySecurityAnswerModelAndEmail resetPasswordModel) - { - Validate(new List<object> - { - resetPasswordModel.SecurityAnswer, - resetPasswordModel.Password, - resetPasswordModel.Email - }); - return ConfigureAndExecute<LoginRadiusPostResponse<Data>>(RequestType.Authentication, HttpMethod.PUT, - "password/securityanswer", null, resetPasswordModel.ConvertToJson()); - } - - /// <summary> - /// This API is used to reset password for the specified account by security question. - /// </summary> - /// <param name="resetPasswordModel">Object containing security answer, new password, phone and other parameters.</param> - /// <returns>LoginRadiusPostResponse: Boolean to show if password was changed successfully.</returns> - public ApiResponse<LoginRadiusPostResponse<Data>> ResetPasswordBySecurityAnswerAndPhone( - ResetPasswordBySecurityAnswerModelAndPhone resetPasswordModel) - { - Validate(new List<object> - { - resetPasswordModel.SecurityAnswer, - resetPasswordModel.Password, - resetPasswordModel.Phone - }); - return ConfigureAndExecute<LoginRadiusPostResponse<Data>>(RequestType.Authentication, HttpMethod.PUT, - "password/securityanswer", null, resetPasswordModel.ConvertToJson()); - } - - /// <summary> - /// This API is used to reset password for the specified account by security question. - /// </summary> - /// <param name="resetPasswordModel">Object containing security answer, new password, username and other parameters.</param> - /// <returns>LoginRadiusPostResponse: Boolean to show if password was changed successfully.</returns> - public ApiResponse<LoginRadiusPostResponse<Data>> ResetPasswordBySecurityAnswerAndUserName( - ResetPasswordBySecurityAnswerModelAndUserName resetPasswordModel) - { - Validate(new List<object> - { - resetPasswordModel.SecurityAnswer, - resetPasswordModel.Password, - resetPasswordModel.Username - }); - return ConfigureAndExecute<LoginRadiusPostResponse<Data>>(RequestType.Authentication, HttpMethod.PUT, - "password/securityanswer", null, resetPasswordModel.ConvertToJson()); - } - - /// <summary> - /// This API is used to set or change UserName by access token. - /// </summary> - /// <param name="accessToken">Session token for username being updated.</param> - /// <param name="userName">New username.</param> - /// <returns>LoginRadiusPostResponse: Boolean to show if username was updated.</returns> - public ApiResponse<LoginRadiusPostResponse> UpdateUserName(string accessToken, string userName) - { - Validate(new[] { accessToken, userName }); - var additionalHeaders = new Dictionary<string, string>() { [BaseConstants.AccessTokenAuthorizationHeader] = - BaseConstants.AccessTokenBearerHeader + accessToken }; - var bodyParams = new BodyParameters { ["username"] = userName }.ConvertToJson(); - return ConfigureAndExecute<LoginRadiusPostResponse>(RequestType.Authentication, HttpMethod.PUT, - "username", null, bodyParams, additionalHeaders); - } - - /// <summary> - /// This API is used to update the profile. - /// </summary> - /// <param name="accessToken">Session token for profile being updated.</param> - /// <param name="userProfile">The object containing data for the updated profile.</param> - /// <param name="optionalParams">Extra optional parameters.</param> - /// <returns>PostResponse: Boolean to show if profile was updated, along with profile object.</returns> - public ApiResponse<PostResponse> UpdateProfile(string accessToken, LoginRadiusUserIdentity userProfile, - LoginRadiusApiOptionalParams optionalParams) - { - userProfile.Email?.Clear(); - Validate(new[] { accessToken }); - var additionalQueryParams = new QueryParameters(); - additionalQueryParams.AddOptionalParamsRange(optionalParams); - var additionalHeaders = new Dictionary<string, string>() { [BaseConstants.AccessTokenAuthorizationHeader] = - BaseConstants.AccessTokenBearerHeader + accessToken }; - return ConfigureAndExecute<PostResponse>(RequestType.Authentication, HttpMethod.PUT, - "account", additionalQueryParams, userProfile.ConvertToJson(), additionalHeaders); - } - - /// <summary> - /// This API is used to update the security question for a user. - /// </summary> - /// <param name="accessToken">Session token for security question settings being updated.</param> - /// <param name="securityQuestionAnswerPost">The object containing the updated security question settings.</param> - /// <returns>PostResponse: Boolean to show if profile was updated, along with profile object.</returns> - public ApiResponse<PostResponse> UpdateSecurityQuestionByAccessToken(string accessToken, - SecurityQuestionAnswerPost securityQuestionAnswerPost) - { - Validate(new[] { accessToken }); - var additionalHeaders = new Dictionary<string, string>() { [BaseConstants.AccessTokenAuthorizationHeader] = - BaseConstants.AccessTokenBearerHeader + accessToken }; - return ConfigureAndExecute<PostResponse>(RequestType.Authentication, HttpMethod.PUT, - "account", null, securityQuestionAnswerPost.ConvertToJson(), additionalHeaders); - } - - /// <summary> - /// This API sends an email to the user with a delete token. - /// </summary> - /// <param name="accessToken">Session token for the account being deleted.</param> - /// <param name="loginRadiusApiOptionalParams">Extra optional parameters.</param> - /// <returns>CustomerRegistrationDeleteResponse: Boolean to show if delete email was sent.</returns> - public ApiResponse<CustomerRegistrationDeleteResponse> DeleteAccountWithEmailConfirmation( - string accessToken, LoginRadiusApiOptionalParams loginRadiusApiOptionalParams) - { - Validate(new[] { accessToken }); - var additionalQueryParams = new QueryParameters - { - [nameof(loginRadiusApiOptionalParams.DeleteUrl)] = loginRadiusApiOptionalParams.DeleteUrl, - [nameof(loginRadiusApiOptionalParams.EmailTemplate)] = loginRadiusApiOptionalParams.EmailTemplate - }; - var additionalHeaders = new Dictionary<string, string>() { [BaseConstants.AccessTokenAuthorizationHeader] = - BaseConstants.AccessTokenBearerHeader + accessToken }; - return ConfigureAndExecute<CustomerRegistrationDeleteResponse>(RequestType.Authentication, - HttpMethod.DELETE, "account", additionalQueryParams, null, additionalHeaders); - } - - /// <summary> - /// This API removes an email from an account which has more than one email. - /// </summary> - /// <param name="accessToken">Session token associated with account with the target email.</param> - /// <param name="email">Email being removed.</param> - /// <returns>LoginRadiusDeleteResponse: Boolean to show if email was deleted.</returns> - public ApiResponse<LoginRadiusDeleteResponse> RemoveEmail(string accessToken, string email) - { - Validate(new[] { accessToken, email }); - var additionalHeaders = new Dictionary<string, string>() { [BaseConstants.AccessTokenAuthorizationHeader] = - BaseConstants.AccessTokenBearerHeader + accessToken }; - var body = new BodyParameters { ["email"] = email }; - - return ConfigureAndExecute<LoginRadiusDeleteResponse>(RequestType.Authentication, HttpMethod.DELETE, - "email", null, body.ConvertToJson(), additionalHeaders); - } - - /// <summary> - /// This API unlinks the account from a social profile. - /// </summary> - /// <param name="accessToken">Session token associated with a LoginRadius account.</param> - /// <param name="unlinkModel">Session token associated with a LoginRadius account.</param> - /// <returns>LoginRadiusDeleteResponse: Boolean to show if account was deleted.</returns> - public ApiResponse<LoginRadiusDeleteResponse> UnLinkAccount(string accessToken, UnlinkProfileModel unlinkModel) - { - Validate(new[] { accessToken }); - var additionalHeaders = new Dictionary<string, string>() { [BaseConstants.AccessTokenAuthorizationHeader] = - BaseConstants.AccessTokenBearerHeader + accessToken }; - return ConfigureAndExecute<LoginRadiusDeleteResponse>(RequestType.Authentication, HttpMethod.DELETE, - "socialidentity", null, unlinkModel.ConvertToJson(), additionalHeaders); - } - } -} diff --git a/Source/LoginRadiusSDK.V2/Api/ConfigurationApi.cs b/Source/LoginRadiusSDK.V2/Api/ConfigurationApi.cs deleted file mode 100644 index 683f7e2..0000000 --- a/Source/LoginRadiusSDK.V2/Api/ConfigurationApi.cs +++ /dev/null @@ -1,55 +0,0 @@ -using LoginRadiusSDK.V2.Models; -using LoginRadiusSDK.V2.Models.Configuration; -using LoginRadiusSDK.V2.Util; - -namespace LoginRadiusSDK.V2.Api -{ - public class ConfigurationApi : LoginRadiusResource - { - /// <summary> - /// Gets LoginRadius configuration information, dashboard data and other useful information for your current LoginRadius workflows. - /// </summary> - /// <returns>ConfigurationResponse: An object containing fields of configuration data.</returns> - public ApiResponse<ConfigurationResponse> GetConfiguration() - { - return ConfigureAndExecute<ConfigurationResponse>(RequestType.Configuration, HttpMethod.GET, null); - } - - /// <summary> - /// Gets the current server time. - /// </summary> - /// <returns>SottDetails contains server time and location information, along with sott information when using the returned data to create a sott.</returns> - public ApiResponse<SottDetails> GetServerTime(string timeDifference) - { - var additionalQueryParams = new QueryParameters(); - if (!string.IsNullOrWhiteSpace(timeDifference)) - additionalQueryParams.Add("timedifference", timeDifference); - return ConfigureAndExecute<SottDetails>(RequestType.ServerInfo, HttpMethod.GET, null, additionalQueryParams); - } - - /// <summary> - /// Generates a sott. - /// </summary> - /// <returns>SottResponseData: Data for a sott.</returns> - public ApiResponse<SottResponseData> GenerateSott(string timeDifference) - { - var additionalQueryParams = new QueryParameters(); - if (!string.IsNullOrWhiteSpace(timeDifference)) - additionalQueryParams.Add("timedifference", timeDifference); - return ConfigureAndExecute<SottResponseData>(RequestType.Identity, HttpMethod.GET, "sott", additionalQueryParams); - } - - /// <summary> - /// Gets the current session details with the access token. - /// </summary> - /// <param name="accessToken">Session token associated with a LoginRadius account.</param> - /// <returns>ActiveSessionDetails: Object containing information on the current session.</returns> - public ApiResponse<ActiveSessionDetails> GetActiveSessionDetails(string accessToken) - { - LoginRadiusArgumentValidator.Validate(new[] { accessToken }); - var additionalQueryParams = new QueryParameters { ["token"] = accessToken }; - return ConfigureAndExecute<ActiveSessionDetails>(RequestType.AdvancedSocial, HttpMethod.GET, - "access_token/activesession", additionalQueryParams); - } - } -} diff --git a/Source/LoginRadiusSDK.V2/Api/CustomObjectApi.cs b/Source/LoginRadiusSDK.V2/Api/CustomObjectApi.cs deleted file mode 100644 index 2ccdafc..0000000 --- a/Source/LoginRadiusSDK.V2/Api/CustomObjectApi.cs +++ /dev/null @@ -1,219 +0,0 @@ -using System.Collections.Generic; -using LoginRadiusSDK.V2.Entity; -using LoginRadiusSDK.V2.Models; -using LoginRadiusSDK.V2.Models.Object; -using LoginRadiusSDK.V2.Util; -using static LoginRadiusSDK.V2.Util.LoginRadiusArgumentValidator; -namespace LoginRadiusSDK.V2.Api -{ - public class CustomObjectApi : LoginRadiusResource - { - private readonly LoginRadiusResourcePath _uidResourcePath = new LoginRadiusResourcePath("{0}/CustomObject"); - private readonly LoginRadiusResourcePath _tokenResourcePath = new LoginRadiusResourcePath("CustomObject"); - - /// <summary> - /// This API is used to write information in JSON format to the custom object for the specified account. - /// </summary> - /// <param name="uid">The uid for the user getting the custom object.</param> - /// <param name="objectName">The custom object name that is created by LoginRadius.</param> - /// <param name="customObject">The data for the created custom object.</param> - /// <returns>CustomObjectprop: Information on the created custom object.</returns> - public ApiResponse<CustomObjectprop> CreateCustomObjectByUid(string uid, string objectName, - string customObject) - { - Validate(new[] { uid, customObject }); - var resourcePath = SDKUtil.FormatURIPath(_uidResourcePath, new object[] { uid }); - var additionalParameter = new QueryParameters { ["objectname"] = objectName }; - return ConfigureAndExecute<CustomObjectprop>(RequestType.Identity, HttpMethod.POST, resourcePath, - additionalParameter, customObject); - } - - /// <summary> - /// This API is used to write information in JSON format to the custom object for the specified account. - /// </summary> - /// <param name="accessToken">The access token for the user getting the custom object.</param> - /// <param name="objectName">The custom object name that is created by LoginRadius.</param> - /// <param name="customObject">The data for the created custom object.</param> - /// <returns>CustomObjectprop: Information on the created custom object.</returns> - public ApiResponse<CustomObjectprop> CreateCustomObjectByToken(string accessToken, string objectName, string customObject) - { - Validate(new[] { objectName, accessToken }); - var additionalQueryParams = - new QueryParameters { ["objectName"] = objectName }; - var additionalHeaders = new Dictionary<string, string>() { [BaseConstants.AccessTokenAuthorizationHeader] = - BaseConstants.AccessTokenBearerHeader + accessToken }; - return ConfigureAndExecute<CustomObjectprop>(RequestType.Authentication, HttpMethod.POST, - _tokenResourcePath.ToString(), additionalQueryParams, customObject, additionalHeaders); - } - - /// <summary> - /// This API is used to retrieve the Custom Object data for the specified account. - /// </summary> - /// <param name="uid">The uid for the user associated with the custom object.</param> - /// <param name="objectRecordId">The custom object id being looked up</param> - /// <param name="objectName">The custom object name that is created by LoginRadius.</param> - /// <returns>CustomObjectprop: Information on the custom object.</returns> - public ApiResponse<CustomObjectprop> GetByObjectRecordIdAndUid(string uid, string objectRecordId, string objectName) - { - Validate(new[] { uid, objectRecordId, objectName }); - var additionalQueryParams = new QueryParameters - { - ["objectname"] = objectName - }; - //{uid}/customobject/{objectrecordid} - var resourcePath = SDKUtil.FormatURIPath(("{0}/customobject/{1}"), - new object[] { uid, objectRecordId }); - return ConfigureAndExecute<CustomObjectprop>(RequestType.Identity, HttpMethod.GET, - resourcePath, additionalQueryParams); - } - - /// <summary> - /// This API is used to retrieve the Custom Object data for the specified account. - /// </summary> - /// <param name="accessToken">The access token for the user associated with the custom object.</param> - /// <param name="objectRecordId">The custom object id being looked up</param> - /// <param name="objectName">The custom object name that is created by LoginRadius.</param> - /// <returns>CustomObjectprop: Information on the custom object.</returns> - public ApiResponse<CustomObjectprop> GetByObjectRecordIdAndToken(string accessToken, string objectRecordId, - string objectName) - { - Validate(new[] { objectName, objectRecordId, accessToken }); - var additionalQueryParams = new QueryParameters { ["objectName"] = objectName }; - var additionalHeaders = new Dictionary<string, string>() - { - [BaseConstants.AccessTokenAuthorizationHeader] = - BaseConstants.AccessTokenBearerHeader + accessToken - }; - var resourcePath = SDKUtil.FormatURIPath(_tokenResourcePath.ChildObject("{0}").ToString(), - new object[] { objectRecordId }); - return ConfigureAndExecute<CustomObjectprop>(RequestType.Authentication, HttpMethod.GET, resourcePath, - additionalQueryParams, null, additionalHeaders); - } - - /// <summary> - /// his API is used to all Custom Object data for the specified account. - /// </summary> - /// <param name="accessToken">The access token for the user getting the custom object.</param> - /// <param name="objectName">The custom object name that is created by LoginRadius.</param> - /// <returns>List of CustomObjectprop: Information on the created custom object.</returns> - public ApiResponse<LoginRadiusCountResponse<List<CustomObjectprop>>> GetByAccessToken(string accessToken, - string objectName) - { - Validate(new[] { objectName, accessToken }); - var additionalQueryParams = new QueryParameters { ["objectName"] = objectName }; - var additionalHeaders = new Dictionary<string, string>() { [BaseConstants.AccessTokenAuthorizationHeader] = BaseConstants.AccessTokenBearerHeader + accessToken }; - return ConfigureAndExecute<LoginRadiusCountResponse<List<CustomObjectprop>>>(RequestType.Authentication, - HttpMethod.GET, _tokenResourcePath.ToString(), additionalQueryParams, null, additionalHeaders); - } - - /// <summary> - /// his API is used to all Custom Object data for the specified account. - /// </summary> - /// <param name="uid">The uid for the user getting the custom object.</param> - /// <param name="objectName">The custom object name that is created by LoginRadius.</param> - /// <returns>List of CustomObjectprop: Information on the created custom object.</returns> - public ApiResponse<CustomObjectResponse> GetByUid(string uid, string objectName) - { - Validate(new[] { uid }); - var resourcePath = SDKUtil.FormatURIPath(_uidResourcePath, new object[] { uid }); - var additionalParameter = new QueryParameters { ["objectname"] = objectName }; - return ConfigureAndExecute<CustomObjectResponse>(RequestType.Identity, HttpMethod.GET, resourcePath, - additionalParameter); - } - - /// <summary> - /// This API is used to write information in JSON format to the custom object for the specified account. - /// </summary> - /// <param name="accessToken">The access token for the user associated with the custom object.</param> - /// <param name="objectRecordId">The custom object id that is being updated</param> - /// <param name="objectName">The custom object name that is created by LoginRadius.</param> - /// <param name="customObject">The data for the updated custom object.</param> - /// <param name="fullReplace">Determines whether to do a full replace or a partial replace for the custom object.</param> - /// <returns>CustomObjectprop: Information on the updated custom object.</returns> - public ApiResponse<CustomObjectprop> UpdateByObjectRecordIdAndAccessToken(string accessToken, string objectRecordId, string objectName, - string customObject, bool? fullReplace = false) - { - Validate(new[] { objectName, accessToken }); - var additionalQueryParams = - new QueryParameters { ["objectName"] = objectName }; - var additionalHeaders = new Dictionary<string, string>() { [BaseConstants.AccessTokenAuthorizationHeader] = BaseConstants.AccessTokenBearerHeader + accessToken }; - if (fullReplace.HasValue && fullReplace.Value) - { - additionalQueryParams.Add("updateType", "Replace"); - } - else - { - additionalQueryParams.Add("updateType", "PartialReplace"); - } - var resourcePath = SDKUtil.FormatURIPath(_tokenResourcePath.ChildObject("{0}").ToString(), - new object[] { objectRecordId }); - return ConfigureAndExecute<CustomObjectprop>(RequestType.Authentication, HttpMethod.PUT, resourcePath, - additionalQueryParams, customObject, additionalHeaders); - } - - /// <summary> - /// This API is used to write information in JSON format to the custom object for the specified account. - /// </summary> - /// <param name="uid">The uid for the user associated with the custom object.</param> - /// <param name="objectRecordId">The custom object id that is being updated</param> - /// <param name="objectName">The custom object name that is created by LoginRadius.</param> - /// <param name="customObject">The data for the updated custom object.</param> - /// <param name="fullReplace">Determines whether to do a full replace or a partial replace for the custom object.</param> - /// <returns>CustomObjectprop: Information on the updated custom object.</returns> - public ApiResponse<CustomObjectprop> UpdateByObjectRecordIdAndUid(string uid, string objectRecordId, - string objectName, string customObject, bool? fullReplace = false) - { - Validate(new[] { uid, objectRecordId, customObject }); - var pattern = _uidResourcePath.ChildObject("{1}").ObjectName; - var additionalparams = new QueryParameters { ["objectname"] = objectName }; - if (fullReplace.HasValue && fullReplace.Value) - { - additionalparams.Add("updateType", "Replace"); - } - else - { - additionalparams.Add("updateType", "PartialReplace"); - } - var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] { uid, objectRecordId }); - return ConfigureAndExecute<CustomObjectprop>(RequestType.Identity, HttpMethod.PUT, resourcePath, additionalparams, - customObject); - } - - /// <summary> - /// This API is used to write information in JSON format to the custom object for the specified account. - /// </summary> - /// <param name="uid">The uid for the user associated with the custom object.</param> - /// <param name="objectRecordId">The custom object id that is being deleted.</param> - /// <param name="objectName">The custom object name that is created by LoginRadius.</param> - /// <returns>LoginRadiusDeleteResponse: Boolean that shows whether the custom object was deleted.</returns> - public ApiResponse<LoginRadiusDeleteResponse> DeleteByRecordIdAndUid(string uid, string objectRecordId, string objectName) - { - Validate(new[] { uid, objectRecordId }); - var pattern = _uidResourcePath.ChildObject("{1}").ObjectName; - var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] { uid, objectRecordId }); - var additionalparams = new QueryParameters { ["objectname"] = objectName }; - return ConfigureAndExecute<LoginRadiusDeleteResponse>(RequestType.Identity, HttpMethod.DELETE, - resourcePath, additionalparams); - } - - /// <summary> - /// This API is used to write information in JSON format to the custom object for the specified account. - /// </summary> - /// <param name="accessToken">The access token for the user getting the custom object.</param> - /// <param name="objectRecordId">The custom object id that is being deleted.</param> - /// <param name="objectName">The data for the created custom object.</param> - /// <returns>LoginRadiusDeleteResponse: Boolean that shows whether the custom object was deleted.</returns> - public ApiResponse<LoginRadiusDeleteResponse> DeleteByRecordIdAndToken(string accessToken, string objectRecordId, - string objectName) - { - Validate(new[] { objectName, accessToken }); - var additionalQueryParams = - new QueryParameters { ["objectName"] = objectName }; - var additionalHeaders = new Dictionary<string, string>() { [BaseConstants.AccessTokenAuthorizationHeader] = BaseConstants.AccessTokenBearerHeader + accessToken }; - var resourcePath = SDKUtil.FormatURIPath(_tokenResourcePath.ChildObject("{0}").ToString(), - new object[] { objectRecordId }); - return ConfigureAndExecute<LoginRadiusDeleteResponse>(RequestType.Authentication, HttpMethod.DELETE, - resourcePath, additionalQueryParams, null, additionalHeaders); - } - } -} diff --git a/Source/LoginRadiusSDK.V2/Api/CustomRegistrationApi.cs b/Source/LoginRadiusSDK.V2/Api/CustomRegistrationApi.cs deleted file mode 100644 index f0b5e2e..0000000 --- a/Source/LoginRadiusSDK.V2/Api/CustomRegistrationApi.cs +++ /dev/null @@ -1,125 +0,0 @@ -using LoginRadiusSDK.V2.Models; -using LoginRadiusSDK.V2.Models.RegistrationData; -using System.Collections.Generic; -using LoginRadiusSDK.V2.Util; -using static LoginRadiusSDK.V2.Util.LoginRadiusArgumentValidator; -using Newtonsoft.Json.Linq; - -namespace LoginRadiusSDK.V2.Api -{ - public class CustomRegistrationApi : LoginRadiusResource - { - /// <summary> - /// This API allows you to fill data into a dropdown list which you have created for user Registeration. - /// </summary> - /// <param name="payload">Contains fields that are used in generating custom registration data.</param> - /// <returns>LoginRadiusPostResponse: Boolean that shows if custom registration data was added.</returns> - public ApiResponse<LoginRadiusPostResponse> AddRegistrationData(AddRegistrationDataModel payload) - { - Validate(new[] { payload }); - return ConfigureAndExecute<LoginRadiusPostResponse>(RequestType.RegistrationData, HttpMethod.POST, null, - payload.ConvertToJson()); - } - - /// <summary> - /// This API allows you to validate code for a particular dropdown member. - /// </summary> - /// <param name="recordId">The dropdown's record id.</param> - /// <param name="code">A secret code.</param> - /// <returns>ValidateSecretCodeResponse: Boolean that shows if the secret code is valid.</returns> - public ApiResponse<ValidateSecretCodeResponse> ValidateSecretCode(string recordId, string code) - { - var payload = new JObject(); - payload.Add("recordid", recordId); - payload.Add("code", code); - - Validate(new[] { payload.ToString() }); - return ConfigureAndExecute<ValidateSecretCodeResponse>(RequestType.RegistrationDataAuth, HttpMethod.POST, "validatecode", null, - payload.ToString()); - } - - /// <summary> - /// This API is used to retrieve dropdown data. Uses apikey and apisecret. - /// </summary> - /// <param name="type">Type of the data source.</param> - /// <param name="parentid">The id of the parent dropdown member if it exists.</param> - /// <param name="skip">Skips a number of records from the start.</param> - /// <param name="limit">Retrieves at most this number of records at a time (max is 50).</param> - /// <returns>List of GetRegistrationDataResponse: Registration data object.</returns> - public ApiResponse<List<GetRegistrationDataResponse>> GetRegistrationData(string type, string parentid, string skip, string limit) - { - - var additionalQueryParams = new QueryParameters - { - {"parentid", parentid}, - {"skip", skip}, - {"limit", limit} - }; - - Validate(new[] { type }); - var resourcePath = SDKUtil.FormatURIPath("{0}", new object[] { type }); - return ConfigureAndExecute<List<GetRegistrationDataResponse>>(RequestType.RegistrationData, HttpMethod.GET, resourcePath, additionalQueryParams); - } - - /// <summary> - /// This API is used to retrieve dropdown data. Uses just an apikey. - /// </summary> - /// <param name="type">Type of the data source.</param> - /// <param name="parentid">The id of the parent dropdown member if it exists.</param> - /// <param name="skip">Skips a number of records from the start.</param> - /// <param name="limit">Retrieves at most this number of records at a time (max is 50).</param> - /// <returns>List of GetRegistrationDataResponse: Registration data object.</returns> - public ApiResponse<List<GetRegistrationDataResponse>> GetRegistrationDataAuth(string type, string parentid, string skip, string limit) - { - - var additionalQueryParams = new QueryParameters - { - {"parentid", parentid}, - {"skip", skip}, - {"limit", limit} - }; - - Validate(new[] { type }); - var resourcePath = SDKUtil.FormatURIPath("{0}", new object[] { type }); - return ConfigureAndExecute<List<GetRegistrationDataResponse>>(RequestType.RegistrationDataAuth, HttpMethod.GET, resourcePath, additionalQueryParams); - } - - /// <summary> - /// This API is used to retrieve dropdown data. Uses just an apikey. - /// </summary> - /// <param name="recordId">Dropdown item's record id.</param> - /// <param name="updateRegistrationData">Object that contains identifiers for the object being updated.</param> - /// <returns>List of GetRegistrationDataResponse: Boolean that shows if registration data was updated and updated data.</returns> - public ApiResponse<UpdateRegistrationDataResponse> UpdateRegistrationData(string recordId, UpdateRegistrationDataModel updateRegistrationData) - { - Validate(new[] { recordId }); - var resourcePath = SDKUtil.FormatURIPath("{0}", new object[] { recordId }); - return ConfigureAndExecute<UpdateRegistrationDataResponse>(RequestType.RegistrationData, HttpMethod.PUT, resourcePath, null, - updateRegistrationData.ConvertToJson()); - } - - /// <summary> - /// This API allows you to delete an item from a dropdown list. - /// </summary> - /// <param name="recordId">Record id of the data being deleted.</param> - /// <returns>LoginRadiusDeleteResponse: Boolean that shows if registration data was deleted.</returns> - public ApiResponse<LoginRadiusDeleteResponse> DeleteRegistrationData(string recordId) - { - Validate(new[] { recordId }); - var resourcePath = SDKUtil.FormatURIPath("{0}", new object[] { recordId }); - return ConfigureAndExecute<LoginRadiusDeleteResponse>(RequestType.RegistrationData, HttpMethod.DELETE, resourcePath); - } - - /// <summary> - /// This API allows you to delete all records contained in a data source. - /// </summary> - /// <param name="type">The name of the data source.</param> - /// <returns>LoginRadiusDeleteResponse: Boolean that shows if registration data was deleted.</returns> - public ApiResponse<LoginRadiusDeleteResponse> DeleteAllRecordsByDataSource(string type) - { - Validate(new[] { type }); - var resourcePath = SDKUtil.FormatURIPath("type/{0}", new object[] { type }); - return ConfigureAndExecute<LoginRadiusDeleteResponse>(RequestType.RegistrationData, HttpMethod.DELETE, resourcePath); - } - } -} diff --git a/Source/LoginRadiusSDK.V2/Api/LoginRadiusResource.cs b/Source/LoginRadiusSDK.V2/Api/LoginRadiusResource.cs deleted file mode 100755 index 1b16b5e..0000000 --- a/Source/LoginRadiusSDK.V2/Api/LoginRadiusResource.cs +++ /dev/null @@ -1,542 +0,0 @@ -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Security.Cryptography; -using System.Text; -using System.Threading; -using LoginRadiusSDK.V2.Exception; -using LoginRadiusSDK.V2.Http; -using LoginRadiusSDK.V2.Models; -using LoginRadiusSDK.V2.Util; -using LoginRadiusSDK.V2.Util.Serialization; -using Newtonsoft.Json; - - -namespace LoginRadiusSDK.V2.Api -{ - /// <summary> - /// Abstract class that handles configuring an HTTP request prior to making an API call. - /// </summary> - public abstract class LoginRadiusResource : LoginRadiusSerializableObject - { - /// <summary> - /// List of supported HTTP methods when making HTTP requests to the LoginRadius REST API. - /// </summary> - public enum HttpMethod - { - /// <summary> - /// GET HTTP request. This is typically used in API operations to retrieve a static resource. - /// </summary> - GET, - - /// <summary> - /// POST HTTP request. This is typically used in API operations that require data in the request body to complete. - /// </summary> - POST, - - /// <summary> - /// PUT HTTP request. This is used in some API operations that update a given resource. - /// </summary> - PUT, - - /// <summary> - /// DELETE HTTP request. This is typcially used in API oeprations that delete a given resource. - /// </summary> - DELETE - } - - public enum RequestType - { - /// <summary> - /// - /// </summary> - Authentication, - - /// <summary> - /// - /// </summary> - Social, - - /// <summary> - /// - /// </summary> - AdvancedSocial, - - /// <summary> - /// - /// </summary> - Identity, - - /// <summary> - /// - /// </summary> - Role, - - /// <summary> - /// - /// </summary> - Sso, - - /// <summary> - /// - /// </summary> - Cloud, - - /// <summary> - /// - /// </summary> - RestHook, - - /// <summary> - /// - /// </summary> - AdvancedSharing, - - /// <summary> - /// - /// </summary> - AccessToken, - - /// <summary> - /// - /// </summary> - IdentityAuth, - - /// <summary> - /// - /// </summary> - ServerInfo, - - /// <summary> - /// - /// </summary> - Webhook, - /// <summary> - /// - /// </summary> - RegistrationData, - /// <summary> - /// - /// </summary> - RegistrationDataAuth, - /// <summary> - /// - /// </summary> - Configuration - - - } - - /// <summary> - /// Gets the last request sent by the SDK in the current thread. - /// </summary> - public static ThreadLocal<RequestDetails> LastRequestDetails { get; private set; } - - /// <summary> - /// Gets the last response received by the SDK in the current thread. - /// </summary> - public static ThreadLocal<ResponseDetails> LastResponseDetails { get; private set; } - - private static bool _requestChannel; - - internal static ConcurrentDictionary<string, string> ConfigDictionary; - - /// <summary> - /// Static constructor initializing any static properties. - /// </summary> - static LoginRadiusResource() - { - LastRequestDetails = new ThreadLocal<RequestDetails>(); - LastResponseDetails = new ThreadLocal<ResponseDetails>(); - ConfigDictionary = ConfigManager.Instance.GetConfiguration(); - } - - /// <summary> - /// Configures and executes REST call: Supports JSON - /// </summary> - /// <param name="requestType"></param> - /// <param name="httpMethod">HttpMethod type</param> - /// <param name="resource">URI path of the resource</param> - /// <param name="payload">JSON request payload</param> - /// <param name="queryParameters"></param> - /// <returns>Response object or null otherwise for void API calls</returns> - internal static object ConfigureAndExecute(RequestType requestType, HttpMethod httpMethod, string resource, - QueryParameters queryParameters, string payload = "") - { - return ConfigureAndExecute<object>(requestType, httpMethod, resource, queryParameters, payload); - } - - static string CreateHash(string apiSecret, string endPoint, string httpMethod, string expiryTime, - string payload = null) - { - string stringToHash; - string decodedUrl; - string encodedUrl; - -#if NETSTANDARD1_3 - decodedUrl = System.Net.WebUtility.UrlDecode(endPoint); - encodedUrl = System.Net.WebUtility.UrlEncode(decodedUrl)?.ToLower(); -#else - decodedUrl = System.Web.HttpUtility.UrlDecode(endPoint); - encodedUrl = System.Web.HttpUtility.UrlEncode(decodedUrl)?.ToLower(); -#endif - - if (!string.IsNullOrEmpty(payload)) - { - stringToHash = expiryTime + ":" + encodedUrl + ":" + payload; - } - else - { - stringToHash = expiryTime + ":" + encodedUrl; - } - - - var hmacSha = new HMACSHA256(Encoding.UTF8.GetBytes(apiSecret)); - hmacSha.Initialize(); - byte[] hmac = hmacSha.ComputeHash(Encoding.UTF8.GetBytes(stringToHash)); - - var hash = Convert.ToBase64String(hmac); - - return hash; - } - - /// <summary> - /// - /// </summary> - /// <typeparam name="T"></typeparam> - /// <param name="requestType"></param> - /// <param name="httpMethod"></param> - /// <param name="resource"></param> - /// <returns></returns> - protected internal static ApiResponse<T> ConfigureAndExecute<T>(RequestType requestType, HttpMethod httpMethod, - string resource) - { - return ConfigureAndExecute<T>(requestType, httpMethod, resource, null, null); - } - - /// <summary> - /// - /// </summary> - /// <typeparam name="T"></typeparam> - /// <param name="requestType"></param> - /// <param name="httpMethod"></param> - /// <param name="resource"></param> - /// <param name="payload"></param> - /// <returns></returns> - protected internal static ApiResponse<T> ConfigureAndExecute<T>(RequestType requestType, HttpMethod httpMethod, - string resource, - string payload) - { - return ConfigureAndExecute<T>(requestType, httpMethod, resource, null, payload); - } - - /// <summary> - /// Configures and executes REST call: Supports JSON - /// </summary> - /// <typeparam name="T">Generic Type parameter for response object</typeparam> - /// <param name="requestType"></param> - /// <param name="httpMethod">HttpMethod type</param> - /// <param name="resource">URI path of the resource</param> - /// <param name="payload">JSON request payload</param> - /// <param name="queryParameters"></param> - /// <param name="headers"></param> - /// <returns>Response object or null otherwise for void API calls</returns> - /// <exception cref="HttpException">Thrown if there was an error sending the request.</exception> - protected internal static ApiResponse<T> ConfigureAndExecute<T>(RequestType requestType, HttpMethod httpMethod, - string resource = "", - QueryParameters queryParameters = null, string payload = "", Dictionary<string, string> headers = null) - { - try - { - // Create the URI where the HTTP request will be sent. - Uri uniformResourceIdentifier; - var endPoint = GetEndpoint(requestType, resource, out Dictionary<string, string> authHeaders, queryParameters); - if (ConfigDictionary[BaseConstants.ApiRequestSigning] != null && ConfigDictionary[BaseConstants.ApiRequestSigning] == "true" && _requestChannel) - { - var time = DateTime.UtcNow.AddMinutes(15).ToString("yyyy-M-d h:m:s tt"); - var hash = CreateHash(ConfigDictionary[BaseConstants.LoginRadiusApiSecret], endPoint, httpMethod.ToString(), time, payload); - - if (headers == null) - { - headers = new Dictionary<string, string>(); - } - - headers.Add("digest", "SHA-256=" + hash); - headers.Add("X-Request-Expires", time); - } - var baseUri = new Uri(endPoint); - if (resource != null) - { - var resourceUri = baseUri; - if (!Uri.TryCreate(resourceUri, resource, out uniformResourceIdentifier)) - { - throw new LoginRadiusException("Cannot create URL; baseURI=" + baseUri + ", resourcePath=" + - resource); - } - uniformResourceIdentifier = resourceUri; - } - else - { - uniformResourceIdentifier = baseUri; - } - - - var connMngr = ConnectionManager.Instance; - var httpRequest = connMngr.GetConnection(ConfigDictionary, uniformResourceIdentifier.ToString(), headers, authHeaders); - httpRequest.Method = httpMethod.ToString(); - - httpRequest.ContentType = BaseConstants.ContentTypeHeaderJson; - - // Execute call - var connectionHttp = new HttpConnection(ConfigDictionary); - - // Setup the last request & response details. - LastRequestDetails.Value = connectionHttp.RequestDetails; - LastResponseDetails.Value = connectionHttp.ResponseDetails; - - payload = payload ?? ""; - - var response = connectionHttp.Execute(payload, httpRequest, payload.Length); - - if (typeof(T).Name.Equals("Object")) - { - return default(ApiResponse<T>); - } - if (typeof(T).Name.Equals("String")) - { - return (ApiResponse<T>)Convert.ChangeType(response, typeof(T)); - } - - return new ApiResponse<T> { Response = JsonFormatter.ConvertFromJson<T>(response) }; - } - catch (ConnectionException ex) - { - try - { - if (ex.Response == string.Empty) - { - throw; - } - var exception = new ApiResponse<T>(); - exception.RestException = JsonConvert.DeserializeObject<ApiExceptionResponse>(ex.Response); - return exception; - } - catch - { - throw ex; - } - } - catch (LoginRadiusException e) - { - // If get a LoginRadius, just rethrow to preserve the stack trace. - return new ApiResponse<T> { RestException = e.ErrorResponse }; - } - catch (System.Exception ex) - { - throw new LoginRadiusException(ex.Message, ex); - } - } - - private static string GetEndpoint(RequestType type, string apiPath, out Dictionary<string, string> authHeaders, QueryParameters additionalParameters = null) - { - QueryParameters requestParameter; - string baseEndPoint; - authHeaders = null; - - switch (type) - { - case RequestType.Authentication: - requestParameter = new QueryParameters { ["apikey"] = ConfigDictionary[BaseConstants.LoginRadiusApiKey] }; - baseEndPoint = BaseConstants.RestAuthApiEndpoint; - break; - case RequestType.Social: - requestParameter = new QueryParameters(); - baseEndPoint = BaseConstants.RestApiEndpoint; - break; - case RequestType.AccessToken: - requestParameter = new QueryParameters - { - ["secret"] = ConfigDictionary[BaseConstants.LoginRadiusApiSecret] - }; - - baseEndPoint = BaseConstants.RestApiEndpoint; - break; - case RequestType.AdvancedSocial: - if (ConfigDictionary[BaseConstants.ApiRequestSigning] != null && ConfigDictionary[BaseConstants.ApiRequestSigning] == "true") - { - _requestChannel = true; - requestParameter = new QueryParameters - { - ["key"] = ConfigDictionary[BaseConstants.LoginRadiusApiKey] - }; - } - else - { - requestParameter = new QueryParameters - { - ["key"] = ConfigDictionary[BaseConstants.LoginRadiusApiKey], - ["secret"] = ConfigDictionary[BaseConstants.LoginRadiusApiSecret] - }; - } - baseEndPoint = BaseConstants.RestApiEndpoint; - break; - case RequestType.AdvancedSharing: - requestParameter = new QueryParameters - { - ["key"] = ConfigDictionary[BaseConstants.LoginRadiusApiKey] - }; - baseEndPoint = BaseConstants.RestShareApiEndpoint; - break; - case RequestType.Cloud: - case RequestType.Sso: - baseEndPoint = BaseConstants.RestApiEndpoint; - if (ConfigDictionary[BaseConstants.ApiRequestSigning] != null && ConfigDictionary[BaseConstants.ApiRequestSigning] == "true") - { - _requestChannel = true; - requestParameter = new QueryParameters - { - ["key"] = ConfigDictionary[BaseConstants.LoginRadiusApiKey] - }; - } - else - { - requestParameter = new QueryParameters - { - ["key"] = ConfigDictionary[BaseConstants.LoginRadiusApiKey], - ["secret"] = ConfigDictionary[BaseConstants.LoginRadiusApiSecret] - }; - } - break; - case RequestType.Identity: - baseEndPoint = BaseConstants.RestIdentityApiEndpoint; - - if (ConfigDictionary[BaseConstants.ApiRequestSigning] != null && ConfigDictionary[BaseConstants.ApiRequestSigning] == "true") - { - _requestChannel = true; - requestParameter = new QueryParameters { ["apiKey"] = ConfigDictionary[BaseConstants.LoginRadiusApiKey] }; - } - else - { - requestParameter = new QueryParameters { ["apiKey"] = ConfigDictionary[BaseConstants.LoginRadiusApiKey] }; - authHeaders = new Dictionary<string, string> - { - [BaseConstants.AuthorizationHeader] = ConfigDictionary[BaseConstants.LoginRadiusApiSecret] - }; - } - break; - case RequestType.Role: - baseEndPoint = BaseConstants.RestRoleApiEndpoint; - requestParameter = new QueryParameters { ["apiKey"] = ConfigDictionary[BaseConstants.LoginRadiusApiKey] }; - authHeaders = new Dictionary<string, string> - { - [BaseConstants.AuthorizationHeader] = ConfigDictionary[BaseConstants.LoginRadiusApiSecret] - }; - break; - case RequestType.RestHook: - baseEndPoint = BaseConstants.RestHookApiEndpoint; - if (ConfigDictionary[BaseConstants.ApiRequestSigning] != null && ConfigDictionary[BaseConstants.ApiRequestSigning] == "true") - { - _requestChannel = true; - requestParameter = new QueryParameters - { - ["api_key"] = ConfigDictionary[BaseConstants.LoginRadiusApiKey] - }; - } - else - { - requestParameter = new QueryParameters - { - ["api_key"] = ConfigDictionary[BaseConstants.LoginRadiusApiKey], - ["api_secret"] = ConfigDictionary[BaseConstants.LoginRadiusApiSecret] - }; - } - break; - - case RequestType.ServerInfo: - baseEndPoint = BaseConstants.ServerinfoApiEndpoint; - requestParameter = new QueryParameters - { - ["apikey"] = ConfigDictionary[BaseConstants.LoginRadiusApiKey], - }; - break; - case RequestType.Webhook: - baseEndPoint = BaseConstants.WebhookApiEndpoint; - if (ConfigDictionary[BaseConstants.ApiRequestSigning] != null && ConfigDictionary[BaseConstants.ApiRequestSigning] == "true") - { - _requestChannel = true; - requestParameter = new QueryParameters - { - ["apikey"] = ConfigDictionary[BaseConstants.LoginRadiusApiKey] - }; - } - else - { - requestParameter = new QueryParameters - { - ["apikey"] = ConfigDictionary[BaseConstants.LoginRadiusApiKey], - ["apisecret"] = ConfigDictionary[BaseConstants.LoginRadiusApiSecret] - }; - } - break; - - case RequestType.RegistrationData: - baseEndPoint = BaseConstants.RegistrationDataApiEndpoint; - if (ConfigDictionary[BaseConstants.ApiRequestSigning] != null && ConfigDictionary[BaseConstants.ApiRequestSigning] == "true") - { - _requestChannel = true; - requestParameter = new QueryParameters - { - ["apikey"] = ConfigDictionary[BaseConstants.LoginRadiusApiKey] - }; - } - else - { - requestParameter = new QueryParameters - { - ["apikey"] = ConfigDictionary[BaseConstants.LoginRadiusApiKey], - ["apisecret"] = ConfigDictionary[BaseConstants.LoginRadiusApiSecret] - }; - } - break; - - case RequestType.RegistrationDataAuth: - baseEndPoint = BaseConstants.RegistrationDataAuthApiEndpoint; - requestParameter = new QueryParameters - { - ["apikey"] = ConfigDictionary[BaseConstants.LoginRadiusApiKey] - }; - break; - - case RequestType.Configuration: - baseEndPoint = BaseConstants.ConfigurationAuthApiEndpoint; - requestParameter = new QueryParameters - { - ["apikey"] = ConfigDictionary[BaseConstants.LoginRadiusApiKey] - }; - break; - - default: - throw new ArgumentOutOfRangeException(nameof(type), type, null); - } - - if (type != RequestType.Configuration) - { - baseEndPoint = ConfigDictionary[BaseConstants.DomainName] + baseEndPoint; - } - if (additionalParameters != null && additionalParameters.Count > 0) - { - foreach (var par in requestParameter) - { - additionalParameters.Add(par.Key, par.Value); - } - } - else - { - additionalParameters = requestParameter; - } - return string.IsNullOrWhiteSpace(apiPath) - ? $"{baseEndPoint}{additionalParameters.ToUrlFormattedString()}" - : $"{baseEndPoint}{apiPath}{additionalParameters.ToUrlFormattedString()}"; - } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Api/MultifactorApi.cs b/Source/LoginRadiusSDK.V2/Api/MultifactorApi.cs deleted file mode 100644 index 4df94bd..0000000 --- a/Source/LoginRadiusSDK.V2/Api/MultifactorApi.cs +++ /dev/null @@ -1,396 +0,0 @@ -using System.Collections.Generic; -using LoginRadiusSDK.V2.Models; -using LoginRadiusSDK.V2.Models.BackupCodes; -using LoginRadiusSDK.V2.Models.CustomerAuthentication._2FA; -using LoginRadiusSDK.V2.Models.UserProfile; -using LoginRadiusSDK.V2.Util; -using Newtonsoft.Json.Linq; -using static LoginRadiusSDK.V2.Util.LoginRadiusArgumentValidator; - -namespace LoginRadiusSDK.V2.Api -{ - public class MultifactorApi : LoginRadiusResource - { - - /// <summary> - /// This API can be used to login by email id on a Multi-factor authentication enabled LoginRadius site. - /// </summary> - /// <param name="email">Email used for logging in.</param> - /// <param name="password">Password used for logging in.</param> - /// <param name="optionalParams">Additional parameters that can be passed in.</param> - /// <returns>MultifactorAuthenticationResponse: An object that contains data for logging in with multifactor if required or enabled. Otherwise returns LR profile.</returns> - public ApiResponse<MultifactorAuthenticationResponse<LoginRadiusUserIdentity>> - MultifactorAuthLoginByEmail(string email, string password, LoginRadiusApiOptionalParams optionalParams) - { - Validate(new[] { email, password }); - var additionalQueryParams = new QueryParameters { { "email", email }, { "password", password } }; - additionalQueryParams.AddOptionalParamsRange(optionalParams); - return ConfigureAndExecute<MultifactorAuthenticationResponse<LoginRadiusUserIdentity>>( - RequestType.Authentication, HttpMethod.GET, "login/2fa", additionalQueryParams); - } - - /// <summary> - /// This API can be used to login by username on a Multi-factor authentication enabled LoginRadius site. - /// </summary> - /// <param name="username">Username used for logging in.</param> - /// <param name="password">Password used for logging in.</param> - /// <param name="optionalParams">Additional parameters that can be passed in.</param> - /// <returns>MultifactorAuthenticationResponse: An object that contains data for logging in with multifactor if required or enabled. Otherwise returns LR profile.</returns> - public ApiResponse<MultifactorAuthenticationResponse<LoginRadiusUserIdentity>> - MultifactorAuthLoginByUsername(string username, string password, LoginRadiusApiOptionalParams optionalParams) - { - Validate(new[] { username, password }); - var additionalQueryParams = new QueryParameters { { "username", username }, { "password", password } }; - additionalQueryParams.AddOptionalParamsRange(optionalParams); - return ConfigureAndExecute<MultifactorAuthenticationResponse<LoginRadiusUserIdentity>>( - RequestType.Authentication, HttpMethod.GET, "login/2fa", additionalQueryParams); - } - - /// <summary> - /// This API can be used to login by username on a Multi-factor authentication enabled LoginRadius site. - /// </summary> - /// <param name="phone">Phone used for logging in.</param> - /// <param name="password">Password used for logging in.</param> - /// <param name="optionalParams">Additional parameters that can be passed in.</param> - /// <returns>MultifactorAuthenticationResponse: An object that contains data for logging in with multifactor if required or enabled. Otherwise returns LR profile.</returns> - public ApiResponse<MultifactorAuthenticationResponse<LoginRadiusUserIdentity>> MultifactorAuthLoginByPhone(string phone, string password, - LoginRadiusApiOptionalParams optionalParams) - { - Validate(new[] { phone, password }); - var additionalQueryParams = new QueryParameters { { "phone", phone }, { "password", password } }; - additionalQueryParams.AddOptionalParamsRange(optionalParams); - return ConfigureAndExecute<MultifactorAuthenticationResponse<LoginRadiusUserIdentity>>(RequestType.Authentication, - HttpMethod.GET, "login/2fa", additionalQueryParams); - } - - /// <summary> - /// Allows you to setup multifactor authentication with an access token when set to optional. - /// </summary> - /// <param name="accessToken">Session for account which is setting up multifactor.</param> - /// <param name="optionalParams">Optional parameters.</param> - /// <returns>Object for setting up multifactor authentication</returns> - public ApiResponse<MultifactorAuthentication> GetMultifactorAccessToken(string accessToken, - LoginRadiusApiOptionalParams optionalParams) - { - Validate(new[] { accessToken }); - var additionalQueryParams = new QueryParameters(); - additionalQueryParams.AddOptionalParamsRange(optionalParams); - var additionalHeaders = new Dictionary<string, string>() { [BaseConstants.AccessTokenAuthorizationHeader] = - BaseConstants.AccessTokenBearerHeader + accessToken }; - return ConfigureAndExecute<MultifactorAuthentication> (RequestType.Authentication, HttpMethod.GET, - "account/2fa", additionalQueryParams, null, additionalHeaders); - } - - /// <summary> - /// Uses the access token of a multifactor account to generate backup codes. - /// </summary> - /// <param name="accessToken">Session for account which is generating backup codes.</param> - /// <returns>CustomerRegistrationBackupCodeResponse: List of valid backup codes.</returns> - public ApiResponse<CustomerRegistrationBackupCodeResponse> GetBackupCodeByAccessToken(string accessToken) - { - Validate(new[] { accessToken }); - var additionalHeaders = new Dictionary<string, string>() { [BaseConstants.AccessTokenAuthorizationHeader] = - BaseConstants.AccessTokenBearerHeader + accessToken }; - return ConfigureAndExecute<CustomerRegistrationBackupCodeResponse>(RequestType.Authentication, - HttpMethod.GET, "account/2fa/backupcode", null, null, additionalHeaders); - } - - /// <summary> - /// Uses the access token of a multifactor account to reset a new list of backup codes. - /// </summary> - /// <param name="accessToken">Session for account which is resetting backup codes.</param> - /// <returns>CustomerRegistrationBackupCodeResponse: List of valid backup codes.</returns> - public ApiResponse<CustomerRegistrationBackupCodeResponse> ResetBackUpCodeByAccessToken(string accessToken) - { - Validate(new[] { accessToken }); - var additionalHeaders = new Dictionary<string, string>() { [BaseConstants.AccessTokenAuthorizationHeader] = - BaseConstants.AccessTokenBearerHeader + accessToken }; - return ConfigureAndExecute<CustomerRegistrationBackupCodeResponse>(RequestType.Authentication, HttpMethod.GET, - "account/2fa/backupcode/reset", null, null, additionalHeaders); - } - - /// <summary> - /// Uses the uid of a multifactor account to generate backup codes. - /// </summary> - /// <param name="uid">Uid for account which is generating backup codes.</param> - /// <returns>CustomerRegistrationBackupCodeResponse: List of valid backup codes.</returns> - public ApiResponse<CustomerRegistrationBackupCodeResponse> GetBackupCodeByUid(string uid) - { - Validate(new[] { uid }); - var additionalQueryParams = new QueryParameters { [nameof(uid)] = uid }; - return ConfigureAndExecute<CustomerRegistrationBackupCodeResponse>(RequestType.Identity, HttpMethod.GET, - "2fa/backupcode", additionalQueryParams); - } - - /// <summary> - /// Uses the uid of a multifactor account to reset a new list of backup codes. - /// </summary> - /// <param name="uid">Uid for account which is resetting backup codes.</param> - /// <returns>CustomerRegistrationBackupCodeResponse: List of valid backup codes.</returns> - public ApiResponse<CustomerRegistrationBackupCodeResponse> ResetBackupCodeByUid(string uid) - { - Validate(new[] { uid }); - var additionalQueryParams = new QueryParameters { [nameof(uid)] = uid }; - return ConfigureAndExecute<CustomerRegistrationBackupCodeResponse>(RequestType.Identity, HttpMethod.GET, - "2fa/backupcode/reset", additionalQueryParams); - } - - /// <summary> - /// Validates a backup code to login. - /// </summary> - /// <param name="secondfactorauthenticationtoken">Token generated on first step of multifactor login.</param> - /// <param name="backupCode">Backup code being validated.</param> - /// <returns>LoginResponse: LoginRadius profile object with access token.</returns> - public ApiResponse<LoginResponse> ValidateBackupCode(string secondfactorauthenticationtoken, string backupCode) - { - Validate(new[] { secondfactorauthenticationtoken, backupCode }); - - var additionalQueryParams = new QueryParameters - { - {"secondfactorauthenticationtoken", secondfactorauthenticationtoken} - }; - var body = new BodyParameters { ["backupcode"] = backupCode }; - return ConfigureAndExecute<LoginResponse>(RequestType.Authentication, HttpMethod.PUT, "login/2fa/verification/backupcode", - additionalQueryParams, body.ConvertToJson()); - } - - /// <summary> - /// Validates an otp to login. - /// </summary> - /// <param name="secondfactorauthenticationtoken">Token generated on first step of multifactor login.</param> - /// <param name="multifactorUpdateSettingsModel">Object that contains otp data needed to login.</param> - /// <param name="smsTemplate2Fa">SMS template for login.</param> - /// <returns>LoginResponse: LoginRadius profile object with access token.</returns> - public ApiResponse<LoginResponse> ValidateOtp(string secondfactorauthenticationtoken, - MultifactorUpdateSettingsModel multifactorUpdateSettingsModel, string smsTemplate2Fa = "") - { - Validate(new[] { secondfactorauthenticationtoken, multifactorUpdateSettingsModel.otp }); - - var additionalQueryParams = new QueryParameters - { - {"secondfactorauthenticationtoken", secondfactorauthenticationtoken} - }; - if (!string.IsNullOrWhiteSpace(smsTemplate2Fa)) - additionalQueryParams.Add("smsTemplate2FA", smsTemplate2Fa); - return ConfigureAndExecute<LoginResponse>(RequestType.Authentication, HttpMethod.PUT, "login/2fa/verification/otp", - additionalQueryParams, multifactorUpdateSettingsModel.ConvertToJson()); - } - - /// <summary> - /// Validates a google authenticator code to login. - /// </summary> - /// <param name="secondfactorauthenticationtoken">Token generated on first step of multifactor login.</param> - /// <param name="googleauthenticatorcode">The google auth code.</param> - /// <param name="smsTemplate2Fa">SMS template for login.</param> - /// <returns>LoginResponse: LoginRadius profile object with access token.</returns> - public ApiResponse<LoginResponse> ValidateGoogleAuthCode(string secondfactorauthenticationtoken, - string googleauthenticatorcode, string smsTemplate2Fa = "") - { - Validate(new[] { secondfactorauthenticationtoken }); - - var additionalQueryParams = new QueryParameters - { - {"secondfactorauthenticationtoken", secondfactorauthenticationtoken} - }; - var body = new BodyParameters { ["googleauthenticatorcode"] = googleauthenticatorcode }; - if (!string.IsNullOrWhiteSpace(smsTemplate2Fa)) - additionalQueryParams.Add("smsTemplate2FA", smsTemplate2Fa); - return ConfigureAndExecute<LoginResponse>(RequestType.Authentication, HttpMethod.PUT, "login/2fa/verification/googleauthenticatorcode", - additionalQueryParams, body.ConvertToJson()); - } - - /// <summary> - /// Updates the phone number being used for multifactor authentication. - /// </summary> - /// <param name="secondFactorAuthenticationToken">Token generated on first step of multifactor login.</param> - /// <param name="authModel">Object for phone multifactor update.</param> - /// <param name="optionalParams">Optional parameters.</param> - /// <returns>SmsResponseData: Object containing information on SMS sent.</returns> - public ApiResponse<SmsSendResponse> UpdatePhoneNumber(string secondFactorAuthenticationToken, TwoFactorPhoneAuthModel authModel, LoginRadiusApiOptionalParams optionalParams) - { - Validate(new[] { secondFactorAuthenticationToken }); - - var additionalQueryParams = new QueryParameters - { - {"SecondFactorAuthenticationToken", secondFactorAuthenticationToken} - }; - var body = new BodyParameters { ["phoneno2fa"] = authModel.PhoneNo2Fa }; - additionalQueryParams.AddOptionalParamsRange(authModel); - if (!string.IsNullOrWhiteSpace(optionalParams.SmsTemplate)) - additionalQueryParams.Add("smsTemplate2FA", optionalParams.SmsTemplate2Fa); - return ConfigureAndExecute<SmsSendResponse>(RequestType.Authentication, HttpMethod.PUT, "login/2fa", - additionalQueryParams, body.ConvertToJson()); - } - - /// <summary> - /// Sets up the phone number being used for multifactor authentication. - /// </summary> - /// <param name="accessToken">Adds a phone for multifactor login.</param> - /// <param name="authModel">Object for phone multifactor update.</param> - /// <param name="optionalParams">Optional parameters.</param> - /// <returns>SmsSendResponse: Object containing information on SMS sent.</returns> - public ApiResponse<SmsSendResponse> UpdateMultifactorAuthenticationPhone(string accessToken, TwoFactorPhoneAuthModel authModel, LoginRadiusApiOptionalParams optionalParams) - { - Validate(new[] { accessToken }); - var additionalQueryParams = new QueryParameters(); - additionalQueryParams.AddOptionalParamsRange(optionalParams); - var additionalHeaders = new Dictionary<string, string>() { [BaseConstants.AccessTokenAuthorizationHeader] = BaseConstants.AccessTokenBearerHeader + accessToken }; - return ConfigureAndExecute<SmsSendResponse>(RequestType.Authentication, HttpMethod.PUT, "account/2fa", - additionalQueryParams, authModel.ConvertToJson(), additionalHeaders); - } - - /// <summary> - /// Sets up the multifactor login for a logged in account with Google Authenticator. - /// </summary> - /// <param name="accessToken">Session which google authentication is being added.</param> - /// <param name="googleAuthenticatorCode">Google authenticator code.</param> - /// <returns>LoginRadiusUserIdentity: LoginRadius identity object.</returns> - public ApiResponse<LoginRadiusUserIdentity> UpdateMultifactorAuthenticationGoogle(string accessToken, string googleAuthenticatorCode) - { - Validate(new[] { accessToken, googleAuthenticatorCode }); - var payload = new JObject(); - payload.Add("GoogleAuthenticatorCode", googleAuthenticatorCode); - var additionalHeaders = new Dictionary<string, string>() { [BaseConstants.AccessTokenAuthorizationHeader] = BaseConstants.AccessTokenBearerHeader + accessToken }; - return ConfigureAndExecute<LoginRadiusUserIdentity>(RequestType.Authentication, HttpMethod.PUT, "account/2fa/verification/googleauthenticatorcode", - null, payload.ToString(), additionalHeaders); - } - - /// <summary> - /// Sets up the multifactor login for a logged in account with Google Authenticator. - /// </summary> - /// <param name="accessToken">Session which google authentication is being added.</param> - /// <param name="multifactorUpdateSettingsModel">New multifactor settings to update.</param> - /// <returns>LoginRadiusUserIdentity: LoginRadius identity object.</returns> - public ApiResponse<LoginRadiusUserIdentity> UpdateMultifactorSettings(string accessToken, MultifactorUpdateSettingsModel multifactorUpdateSettingsModel) - { - Validate(new[] { accessToken, multifactorUpdateSettingsModel.otp }); - var additionalHeaders = new Dictionary<string, string>() { [BaseConstants.AccessTokenAuthorizationHeader] = BaseConstants.AccessTokenBearerHeader + accessToken }; - return ConfigureAndExecute<LoginRadiusUserIdentity>(RequestType.Authentication, HttpMethod.PUT, "account/2fa/verification/otp", - null, multifactorUpdateSettingsModel.ConvertToJson(), additionalHeaders); - } - - /// <summary> - /// Resets the multifactor settings on the account with access token. - /// </summary> - /// <param name="model">Used to determine whether to reset SMS auth or multifactor auth.</param> - /// <param name="accessToken">Session which is getting their multifactor reset.</param> - /// <returns>LoginRadiusDeleteResponse: Boolean that shows whether multifactor was reset.</returns> - public ApiResponse<LoginRadiusDeleteResponse> RemoveOrResetMultifactorByAccessToken(RemoveOrResetMultifactorAuthentication model, - string accessToken) - { - Validate(new[] { model.otpauthenticator, model.googleauthenticator }); - var additionalHeaders = new Dictionary<string, string>() { [BaseConstants.AccessTokenAuthorizationHeader] = BaseConstants.AccessTokenBearerHeader + accessToken }; - return ConfigureAndExecute<LoginRadiusDeleteResponse>(RequestType.Authentication, HttpMethod.DELETE, - "account/2fa/authenticator", null, model.ConvertToJson(), additionalHeaders); - } - - /// <summary> - /// Resets the multifactor settings on the account with uid. - /// </summary> - /// <param name="model">Used to determine whether to reset SMS auth or multifactor auth.</param> - /// <param name="uid">Uid for account which is getting their multifactor reset.</param> - /// <returns>LoginRadiusDeleteResponse: Boolean that shows whether multifactor was reset.</returns> - public ApiResponse<LoginRadiusDeleteResponse> RemoveOrResetMultifactorByUid(RemoveOrResetMultifactorAuthentication model, - string uid) - { - Validate(new List<object> { model.googleauthenticator, model.otpauthenticator, uid }); - var additionalQueryParams = new QueryParameters { [nameof(uid)] = uid }; - return ConfigureAndExecute<LoginRadiusDeleteResponse>(RequestType.Identity, HttpMethod.DELETE, "2fa/authenticator", - additionalQueryParams, model.ConvertToJson()); - } - - /// <summary> - /// This API is used to trigger the Multi-Factor Autentication workflow for the provided access_token. - /// </summary> - /// <param name="accessToken">Verifies the current session.</param> - /// <param name="optionalParams">Additional parameters that can be passed in.</param> - /// <returns>MultifactorAuthentication: Object for setting up multifactor authentication.</returns> - public ApiResponse<MultifactorAuthentication> MultifactorReAuth(string accessToken, LoginRadiusApiOptionalParams optionalParams) - { - Validate(new[] { accessToken }); - var additionalHeaders = new Dictionary<string, string>() - { - [BaseConstants.AccessTokenAuthorizationHeader] = - BaseConstants.AccessTokenBearerHeader + accessToken - }; - return ConfigureAndExecute<MultifactorAuthentication>(RequestType.Authentication, HttpMethod.GET, - "/account/reauth/2fa", null, null, additionalHeaders); - } - - /// <summary> - /// This API is used to re-authenticate via Multi-factor-authentication by passing the google authenticator code. - /// </summary> - /// <param name="accessToken">Verifies the current session.</param> - /// <param name="googleAuthenticatorCode">Google Auth Code for session being re-validated.</param> - /// <returns>ValidateMultifactorResponse: Object containing the re-validation token.</returns> - public ApiResponse<ValidateMultifactorResponse> MultifactorGoogleReAuth(string accessToken, string googleAuthenticatorCode) - { - Validate(new[] { accessToken }); - var additionalHeaders = new Dictionary<string, string>() - { - [BaseConstants.AccessTokenAuthorizationHeader] = - BaseConstants.AccessTokenBearerHeader + accessToken - }; - var body = new BodyParameters { ["googleauthenticatorcode"] = googleAuthenticatorCode }; - return ConfigureAndExecute<ValidateMultifactorResponse>(RequestType.Authentication, HttpMethod.PUT, - "account/reauth/2fa/googleauthenticatorcode", null, body.ConvertToJson(), additionalHeaders); - } - - /// <summary> - /// This API is used to re-authenticate via Multi-factor-authentication by passing the google authenticator code. - /// </summary> - /// <param name="accessToken">Verifies the current session.</param> - /// <param name="backupCode">Backup Code for session being re-validated.</param> - /// <returns>ValidateMultifactorResponse: Object containing the re-validation token.</returns> - public ApiResponse<ValidateMultifactorResponse> MultifactorBackupCodeReAuth(string accessToken, string backupCode) - { - Validate(new[] { accessToken }); - var additionalHeaders = new Dictionary<string, string>() - { - [BaseConstants.AccessTokenAuthorizationHeader] = - BaseConstants.AccessTokenBearerHeader + accessToken - }; - var body = new BodyParameters { ["backupcode"] = backupCode }; - return ConfigureAndExecute<ValidateMultifactorResponse>(RequestType.Authentication, HttpMethod.PUT, - "account/reauth/2fa/backupcode", null, body.ConvertToJson(), additionalHeaders); - } - - /// <summary> - /// This API is used to re-authenticate via Multi-factor-authentication by passing the google authenticator code. - /// </summary> - /// <param name="accessToken">Verifies the current session.</param> - /// <param name="multifactorUpdateSettingsModel">Otp data for session being re-validated.</param> - /// <returns>ValidateMultifactorResponse: Object containing the re-validation token.</returns> - public ApiResponse<ValidateMultifactorResponse> MultifactorOTPReAuth(string accessToken, - MultifactorUpdateSettingsModel multifactorUpdateSettingsModel, string smsTemplate2Fa = "") - { - Validate(new[] { accessToken }); - var additionalHeaders = new Dictionary<string, string>() - { - [BaseConstants.AccessTokenAuthorizationHeader] = - BaseConstants.AccessTokenBearerHeader + accessToken - }; - return ConfigureAndExecute<ValidateMultifactorResponse>(RequestType.Authentication, HttpMethod.PUT, - "account/reauth/2fa/otp", null, multifactorUpdateSettingsModel.ConvertToJson(), additionalHeaders); - } - - /// <summary> - /// This API is used to re-authenticate via Multi-factor-authentication by passing the google authenticator code. - /// </summary> - /// <param name="accessToken">Verifies the current session.</param> - /// <param name="multifactorUpdateSettingsModel">Password data for session being re-validated.</param> - /// <returns>ValidateMultifactorResponse: Object containing the re-validation token.</returns> - public ApiResponse<ValidateMultifactorResponse> MultifactorPasswordReAuth(string accessToken, - ValidateTwoFactorByPasswordModel multifactorUpdateSettingsModel, string smsTemplate2Fa = "") - { - Validate(new[] { accessToken }); - var additionalHeaders = new Dictionary<string, string>() - { - [BaseConstants.AccessTokenAuthorizationHeader] = - BaseConstants.AccessTokenBearerHeader + accessToken - }; - return ConfigureAndExecute<ValidateMultifactorResponse>(RequestType.Authentication, HttpMethod.PUT, - "account/reauth/password", null, multifactorUpdateSettingsModel.ConvertToJson(), additionalHeaders); - } - } -} diff --git a/Source/LoginRadiusSDK.V2/Api/OneTouchLoginApi.cs b/Source/LoginRadiusSDK.V2/Api/OneTouchLoginApi.cs deleted file mode 100644 index 32b91bf..0000000 --- a/Source/LoginRadiusSDK.V2/Api/OneTouchLoginApi.cs +++ /dev/null @@ -1,89 +0,0 @@ -using LoginRadiusSDK.V2.Models; -using LoginRadiusSDK.V2.Util; -using Newtonsoft.Json.Linq; -using LoginRadiusSDK.V2.Models.CustomerAuthentication.Login; -using static LoginRadiusSDK.V2.Util.LoginRadiusArgumentValidator; - -namespace LoginRadiusSDK.V2.Api -{ - public class OneTouchLoginApi : LoginRadiusResource - { - - /// <summary> - /// This API is used to send a link to a specified email for a frictionless login/registration. - /// </summary> - /// <param name="oneTouchEmail">Object containing client guid, email and other login info.</param> - /// <param name="redirectUrl">Url where the user will redirect after success authentication.</param> - /// <param name="oneTouchLoginEmailTemplate">Name of the One Touch Login Email Template.</param> - /// <param name="welcomeEmailTemplate">Name of the Welcome Email Template.</param> - /// <returns>LoginRadiusPostResponse: Boolean that shows whether the email for one touch login was sent.</returns> - public ApiResponse<LoginRadiusPostResponse> OneTouchLoginByEmail(OneTouchEmailLoginModel oneTouchEmail, string redirectUrl = "", - string oneTouchLoginEmailTemplate = "", string welcomeEmailTemplate = "") - { - Validate(new[] { oneTouchEmail.email, oneTouchEmail.clientguid }); - var additionalQueryParams = new QueryParameters - { - ["redirecturl"] = redirectUrl, - ["onetouchloginemailtemplate"] = oneTouchLoginEmailTemplate, - ["welcomeemailtemplate"] = welcomeEmailTemplate - }; - return ConfigureAndExecute<LoginRadiusPostResponse>(RequestType.Authentication, HttpMethod.POST, - "onetouchlogin/email", additionalQueryParams, oneTouchEmail.ConvertToJson()); - } - - /// <summary> - /// This API is used to send a link to a specified email for a frictionless login/registration. - /// </summary> - /// <param name="oneTouchPhone">Object containing phone number and other login info.</param> - /// <param name="smsTemplate">Name of template for SMS.</param> - /// <returns>ResendOtpResponse: Object containing SMS details.</returns> - public ApiResponse<ResendOtpResponse> OneTouchLoginByPhone(OneTouchPhoneLoginModel oneTouchPhone, string smsTemplate = "") - { - Validate(new[] { oneTouchPhone.phone }); - var additionalQueryParams = new QueryParameters - { - ["smstemplate"] = smsTemplate - }; - return ConfigureAndExecute<ResendOtpResponse>(RequestType.Authentication, HttpMethod.POST, - "onetouchlogin/phone", additionalQueryParams, oneTouchPhone.ConvertToJson()); - } - - /// <summary> - /// This API verifies the provided token for One Touch Login. - /// </summary> - /// <param name="verificationToken">Token obtained from one touch email login email.</param> - /// <param name="welcomeEmailTemplate">Name of template for welcome email.</param> - /// <returns>OneTouchEmailVerificationModel: Booleans for token verification.</returns> - public ApiResponse<OneTouchEmailVerificationModel> OneTouchLoginEmailVerification(string verificationToken, string welcomeEmailTemplate = "") - { - Validate(new[] { verificationToken }); - var additionalQueryParams = new QueryParameters - { - ["verificationtoken"] = verificationToken, - ["welcomeemailtemplate"] = welcomeEmailTemplate - }; - return ConfigureAndExecute<OneTouchEmailVerificationModel>(RequestType.Authentication, HttpMethod.GET, - "email/smartlogin", additionalQueryParams); - } - - /// <summary> - /// This API verifies the OTP for One Touch Login. - /// </summary> - /// <param name="phone">Phone number being logged in.</param> - /// <param name="otp">OTP being verified.</param> - /// <param name="smsTemplate">Name of SMS template.</param> - /// <returns>LoginResponse: LoginRadius profile object with access token.</returns> - public ApiResponse<LoginResponse> OneTouchLoginOtpVerification(string phone, string otp, string smsTemplate = "") - { - Validate(new[] { phone, otp }); - var payload = new JObject {{"phone", phone}}; - var additionalQueryParams = new QueryParameters - { - ["otp"] = otp, - ["smstemplate"] = smsTemplate - }; - return ConfigureAndExecute<LoginResponse>(RequestType.Authentication, HttpMethod.PUT, - "onetouchlogin/phone/verify", additionalQueryParams, payload.ToString()); - } - } -} diff --git a/Source/LoginRadiusSDK.V2/Api/PasswordlessLoginApi.cs b/Source/LoginRadiusSDK.V2/Api/PasswordlessLoginApi.cs deleted file mode 100644 index 232c85c..0000000 --- a/Source/LoginRadiusSDK.V2/Api/PasswordlessLoginApi.cs +++ /dev/null @@ -1,69 +0,0 @@ -using LoginRadiusSDK.V2.Models; -using LoginRadiusSDK.V2.Util; -using static LoginRadiusSDK.V2.Util.LoginRadiusArgumentValidator; - -namespace LoginRadiusSDK.V2.Api -{ - public class PasswordlessLoginApi : LoginRadiusResource - { - /// <summary> - /// This API is used to send a Passwordless Login verification link to the provided Email ID. - /// </summary> - /// <param name="email">Email of account being logged in.</param> - /// <param name="passwordlesslogintemplate">Passwordless login email template name.</param> - /// <param name="verificationUrl">Location of verification url.</param> - /// <returns>LoginRadiusPostResponse: Boolean to show if email was sent for passwordless login.</returns> - public ApiResponse<LoginRadiusPostResponse> PasswordlessLoginByEmail(string email, string passwordlesslogintemplate, - string verificationUrl) - { - Validate(new[] { email }); - var additionalQueryParams = new QueryParameters - { - ["email"] = email, - ["passwordlesslogintemplate"] = passwordlesslogintemplate, - ["verificationUrl"] = verificationUrl, - }; - return ConfigureAndExecute<LoginRadiusPostResponse>(RequestType.Authentication, HttpMethod.GET, - "login/passwordlesslogin/email", additionalQueryParams); - } - - /// <summary> - /// This API is used to send a Passwordless Login verification link to the provided Username. - /// </summary> - /// <param name="username">Username of account being logged in.</param> - /// <param name="passwordlesslogintemplate">Passwordless login email template name.</param> - /// <param name="verificationUrl">Location of verification url.</param> - /// <returns>LoginRadiusPostResponse: Boolean to show if email was sent for passwordless login.</returns> - public ApiResponse<LoginRadiusPostResponse> PasswordlessLoginByUserName(string username, string passwordlesslogintemplate, - string verificationUrl) - { - Validate(new[] { username, username }); - var additionalQueryParams = new QueryParameters - { - ["username"] = username, - ["passwordlesslogintemplate"] = passwordlesslogintemplate, - ["verificationUrl"] = verificationUrl, - }; - return ConfigureAndExecute<LoginRadiusPostResponse>(RequestType.Authentication, HttpMethod.GET, - "login/passwordlesslogin/email", additionalQueryParams); - } - - /// <summary> - /// This API is used to verify the Passwordless Login verification link. - /// </summary> - /// <param name="verificationToken">Verification token for passwordless login sent to email.</param> - /// <param name="welcomeEmailTemplate">Welcome email template name.</param> - /// <returns>LoginRadiusPostResponse: Boolean to show if email was sent for passwordless login.</returns> - public ApiResponse<LoginResponse> PasswordlessLoginVerification(string verificationToken, string welcomeEmailTemplate = "") - { - Validate(new[] { verificationToken }); - var additionalQueryParams = new QueryParameters - { - ["welcomeEmailTemplate"] = welcomeEmailTemplate, - ["verificationtoken"] = verificationToken, - }; - return ConfigureAndExecute<LoginResponse>(RequestType.Authentication, HttpMethod.GET, - "login/passwordlesslogin/email/verify", additionalQueryParams); - } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Api/PhoneAuthenticationApi.cs b/Source/LoginRadiusSDK.V2/Api/PhoneAuthenticationApi.cs deleted file mode 100644 index 6ccd4b0..0000000 --- a/Source/LoginRadiusSDK.V2/Api/PhoneAuthenticationApi.cs +++ /dev/null @@ -1,255 +0,0 @@ -using LoginRadiusSDK.V2.Entity; -using LoginRadiusSDK.V2.Models; -using LoginRadiusSDK.V2.Models.UserProfile; -using LoginRadiusSDK.V2.Util; -using System.Collections.Generic; -using static LoginRadiusSDK.V2.Util.LoginRadiusArgumentValidator; -using LoginRadiusSDK.V2.Models.CustomerAuthentication.Phone; -using LoginRadiusSDK.V2.Models.Password; - - -namespace LoginRadiusSDK.V2.Api -{ - public class PhoneAuthenticationApi : LoginRadiusResource - { - /// <summary> - /// This API retrieves a copy of the user data based on the Phone. - /// </summary> - /// <param name="payload">Object containing data for logging in</param> - /// <param name="optionalParams">Additional parameters that may not be needed.</param> - /// <returns>LoginResponse: Object containing LR profile and access token.</returns> - public ApiResponse<LoginResponse> LoginByPhone(string payload, LoginRadiusApiOptionalParams optionalParams) - { - Validate(new[] { payload }); - var additionalQueryParams = new QueryParameters(); - additionalQueryParams.AddOptionalParamsRange(optionalParams); - return ConfigureAndExecute<LoginResponse>(RequestType.Authentication, HttpMethod.POST, - "login", additionalQueryParams, payload); - } - - /// <summary> - /// This API is used to send the OTP to reset the account password. - /// </summary> - /// <param name="phone">Phone number of account having password reset.</param> - /// <param name="optionalParams">Additional parameters that may not be needed.</param> - /// <returns>LoginRadiusPostResponse: Boolean showing whether OTP has been sent.</returns> - public ApiResponse<LoginRadiusPostResponse<SmsResponseData>> ForgotPasswordByOtp(string phone, - LoginRadiusApiOptionalParams optionalParams) - { - Validate(new[] { phone }); - var additionalQueryParams = new QueryParameters(); - if (!string.IsNullOrWhiteSpace(optionalParams.SmsTemplate)) - additionalQueryParams.Add("SmsTemplate", optionalParams.SmsTemplate); - var bodyParams = new BodyParameters { ["phone"] = phone }; - return ConfigureAndExecute<LoginRadiusPostResponse<SmsResponseData>>(RequestType.Authentication, - HttpMethod.POST, "password/otp", additionalQueryParams, bodyParams.ConvertToJson()); - } - - /// <summary> - /// This API is used to send the OTP to reset the account password. - /// </summary> - /// <param name="phone">Phone number of account having password reset.</param> - /// <param name="smsTemplate">Name of SMS template.</param> - /// <returns>ResendOtpResponse: Object containing SMS sent details.</returns> - public ApiResponse<ResendOtpResponse> ResendOtp(string phone, string smsTemplate = "") - { - Validate(new[] { phone }); - var bodyParams = new BodyParameters { ["phone"] = phone }; - var additionalQueryParams = new QueryParameters(); - if (!string.IsNullOrWhiteSpace(smsTemplate)) additionalQueryParams["smsTemplate"] = smsTemplate; - return ConfigureAndExecute<ResendOtpResponse>(RequestType.Authentication, HttpMethod.POST, "phone/otp", - additionalQueryParams, bodyParams.ConvertToJson()); - } - - /// <summary> - /// This API is used to send the OTP to reset the account password. - /// </summary> - /// <param name="accessToken">Session which requires the OTP to be sent.</param> - /// <param name="phone">Phone number of account having password reset.</param> - /// <param name="smsTemplate">Name of SMS template.</param> - /// <returns>LoginRadiusPostResponse: Boolean showing whether OTP has been sent.</returns> - public ApiResponse<LoginRadiusPostResponse> ResendOtpByAccessToken(string accessToken, string phone, - string smsTemplate = "") - { - Validate(new[] { phone }); - var additionalHeaders = new Dictionary<string, string>() { [BaseConstants.AccessTokenAuthorizationHeader] = - BaseConstants.AccessTokenBearerHeader + accessToken }; - var bodyParams = new BodyParameters { ["phone"] = phone }; - var additionalQueryParams = new QueryParameters(); - if (!string.IsNullOrWhiteSpace(smsTemplate)) additionalQueryParams["smsTemplate"] = smsTemplate; - return ConfigureAndExecute<LoginRadiusPostResponse>(RequestType.Authentication, HttpMethod.POST, "phone/otp", - additionalQueryParams, bodyParams.ConvertToJson(), additionalHeaders); - } - - /// <summary> - /// This API registers the new users into your Cloud Storage and triggers the phone verification process. - /// </summary> - /// <param name="sottAuth">Sott used while creating the account.</param> - /// <param name="loginRadiusApiOptionalParams">Optional parameters.</param> - /// <param name="userIdentityCreateModel">Object containing information for creating a LoginRadius profile.</param> - /// <returns>LoginRadiusPostResponse: Boolean to show that account was created.</returns> - public ApiResponse<LoginRadiusPostResponse> PhoneUserRegistrationBySms(Sott sottAuth, - LoginRadiusApiOptionalParams loginRadiusApiOptionalParams, UserIdentityCreateModel userIdentityCreateModel) - { - var additionalparams = new QueryParameters(); - - additionalparams.TryAdd(nameof(loginRadiusApiOptionalParams.VerificationUrl), loginRadiusApiOptionalParams.VerificationUrl); - additionalparams.TryAdd(nameof(loginRadiusApiOptionalParams.SmsTemplate), loginRadiusApiOptionalParams.SmsTemplate); - - if (sottAuth.StartTime == null) - { - var timeDifference = new QueryParameters { [nameof(sottAuth.TimeDifference)] = sottAuth.TimeDifference }; - var sottResponse = ConfigureAndExecute<SottDetails>(RequestType.ServerInfo, HttpMethod.GET, null, timeDifference); - - if (sottResponse.Response != null) sottAuth = sottResponse.Response.Sott; - } - - additionalparams.Add("sott", LoginRadiusSecureOneTimeToken.GetSott(sottAuth)); - - return ConfigureAndExecute<LoginRadiusPostResponse>(RequestType.Authentication, HttpMethod.POST, "register", - additionalparams, userIdentityCreateModel.ConvertToJson()); - } - - /// <summary> - /// This API verifies an account by OTP and allows the user to login. - /// </summary> - /// <param name="phoneOtpModel">Object that contains otp data and other info needed for verification.</param> - /// <param name="smstemplate">SMS template name.</param> - /// <returns>LoginResponse: Object with LR Profile and access token.</returns> - public ApiResponse<LoginResponse> LoginUsingOtp(PhoneOtpModel phoneOtpModel, string smstemplate = "") - { - Validate(new[] { phoneOtpModel.phone, phoneOtpModel.otp }); - var additionalQueryParams = new QueryParameters - { - ["smstemplate"] = smstemplate - }; - return ConfigureAndExecute<LoginResponse>(RequestType.Authentication, HttpMethod.PUT, - "login/passwordlesslogin/otp/verify", additionalQueryParams, phoneOtpModel.ConvertToJson()); - } - - /// <summary> - /// This API checks whether a phone number exists in your LoginRadius database. - /// </summary> - /// <param name="phone">Phone number being checked in the database.</param> - /// <returns>LoginRadiusExistsResponse: Boolean that is true if phone number already exists.</returns> - public ApiResponse<LoginRadiusExistsResponse> CheckPhoneAvailability(string phone) - { - Validate(new[] { phone }); - var additionalQueryParams = new QueryParameters { ["phone"] = phone }; - return ConfigureAndExecute<LoginRadiusExistsResponse>(RequestType.Authentication, HttpMethod.GET, - "phone", additionalQueryParams); - } - - /// <summary> - /// This API sends an OTP for logging in with a phone. - /// </summary> - /// <param name="phone">Phone number associated with account where otp is sent.</param> - /// <param name="smsTemplate">SMS template name.</param> - /// <returns>ResendOtpResponse: Object containing SMS sent details.</returns> - public ApiResponse<ResendOtpResponse> SendOtp(string phone, string smsTemplate = "") - { - Validate(new[] { phone }); - var additionalQueryParams = new QueryParameters { ["phone"] = phone }; - if (!string.IsNullOrWhiteSpace(smsTemplate)) additionalQueryParams["smsTemplate"] = smsTemplate; - return ConfigureAndExecute<ResendOtpResponse>(RequestType.Authentication, HttpMethod.GET, - "login/passwordlesslogin/otp", additionalQueryParams); - } - - /// <summary> - /// Updates phone number for an active session. - /// </summary> - /// <param name="accessToken">Session where phone number is being updated.</param> - /// <param name="phone">New phone number.</param> - /// <param name="smsTemplate">SMS template name.</param> - /// <returns>ResendOtpResponse: Object containing SMS sent details.</returns> - public ApiResponse<LoginRadiusPostResponse<PhoneUpsertResponse>> UpdatePhone(string accessToken, string phone, - string smsTemplate = "") - { - Validate(new[] { accessToken, phone }); - var additionalHeaders = new Dictionary<string, string>() { [BaseConstants.AccessTokenAuthorizationHeader] = BaseConstants.AccessTokenBearerHeader + accessToken }; - var additionalQueryParams = new QueryParameters(); - - var bodyParams = new BodyParameters { ["phone"] = phone }; - - if (!string.IsNullOrWhiteSpace(smsTemplate)) additionalQueryParams["smsTemplate"] = smsTemplate; - return ConfigureAndExecute<LoginRadiusPostResponse<PhoneUpsertResponse>>(RequestType.Authentication, - HttpMethod.PUT, "phone", additionalQueryParams, bodyParams.ConvertToJson(), additionalHeaders); - } - - /// <summary> - /// Resets a password using an OTP. - /// </summary> - /// <param name="resetPassword">Object containing data needed to send an OTP.</param> - /// <returns>LoginRadiusPostResponse: Boolean that shows whether the OTP was sent.</returns> - public ApiResponse<LoginRadiusPostResponse> ResetPasswordByOtp(ResetPasswordByOtpModel resetPassword) - { - Validate(new[] { resetPassword.Password, resetPassword.Otp, resetPassword.Phone }); - return ConfigureAndExecute<LoginRadiusPostResponse>(RequestType.Authentication, HttpMethod.PUT, - "password/otp", null, resetPassword.ConvertToJson()); - } - - /// <summary> - /// Verifies a phone using an OTP. - /// </summary> - /// <param name="phone">Phone number being verified.</param> - /// <param name="otp">OTP being verified.</param> - /// <param name="smsTemplate">Name of SMS template.</param> - /// <returns>LoginResponse: Object containing a LR profile and access token.</returns> - public ApiResponse<LoginResponse> VerifyOtp(string phone, string otp, string smsTemplate = "") - { - Validate(new[] { phone, otp }); - var additionalQueryParams = new QueryParameters { ["otp"] = otp }; - - var bodyParams = new BodyParameters { ["phone"] = phone }; - if (!string.IsNullOrWhiteSpace(smsTemplate)) additionalQueryParams["smsTemplate"] = smsTemplate; - return ConfigureAndExecute<LoginResponse>(RequestType.Authentication, HttpMethod.PUT, "phone/otp", - additionalQueryParams, bodyParams.ConvertToJson()); - } - - /// <summary> - /// Verifies a phone for an active session. - /// </summary> - /// <param name="accessToken">Session where phone number is being verified.</param> - /// <param name="otp">OTP being verified..</param> - /// <param name="smsTemplate">SMS template name.</param> - /// <returns>LoginRadiusPostResponse: Boolean showing whether the phone number was verified.</returns> - public ApiResponse<LoginRadiusPostResponse> VerifyOtpByAccessToken(string accessToken, string otp, - string smsTemplate = "") - { - Validate(new[] { accessToken, otp }); - var additionalHeaders = new Dictionary<string, string>() { [BaseConstants.AccessTokenAuthorizationHeader] = - BaseConstants.AccessTokenBearerHeader + accessToken }; - var additionalQueryParams = new QueryParameters { ["otp"] = otp }; - if (!string.IsNullOrWhiteSpace(smsTemplate)) additionalQueryParams["smsTemplate"] = smsTemplate; - return ConfigureAndExecute<LoginRadiusPostResponse>(RequestType.Authentication, HttpMethod.PUT, "phone/otp", - additionalQueryParams, null, additionalHeaders); - } - - /// <summary> - /// Invalidates a phone's verification status. - /// </summary> - /// <param name="uid">Uid for account getting phone number invalidated.</param> - /// <returns>LoginRadiusPostResponse: Boolean that shows if phone number was invalidated.</returns> - public ApiResponse<LoginRadiusPostResponse> ResetPhoneIdVerification(string uid) - { - Validate(new[] { uid }); - var pattern = new LoginRadiusResourcePath("{0}/invalidatephone").ToString(); - var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] { uid }); - return ConfigureAndExecute<LoginRadiusPostResponse>(RequestType.Identity, HttpMethod.PUT, resourcePath); - } - - /// <summary> - /// Removes a phone number from an account using active session. - /// </summary> - /// <param name="accessToken">Session where phone number is being removed.</param> - /// <returns>LoginRadiusDeleteResponse: Boolean that shows if phone ID was removed from account.</returns> - public ApiResponse<LoginRadiusDeleteResponse> RemovePhoneIdByAccessToken(string accessToken) - { - Validate(new[] { accessToken }); - var additionalHeaders = new Dictionary<string, string>() { [BaseConstants.AccessTokenAuthorizationHeader] = - BaseConstants.AccessTokenBearerHeader + accessToken }; - return ConfigureAndExecute<LoginRadiusDeleteResponse>(RequestType.Authentication, HttpMethod.DELETE, - "phone", null,null,additionalHeaders); - } - } -} diff --git a/Source/LoginRadiusSDK.V2/Api/RolesApi.cs b/Source/LoginRadiusSDK.V2/Api/RolesApi.cs deleted file mode 100644 index 3ad0ea3..0000000 --- a/Source/LoginRadiusSDK.V2/Api/RolesApi.cs +++ /dev/null @@ -1,191 +0,0 @@ -using System.Collections.Generic; -using LoginRadiusSDK.V2.Entity; -using LoginRadiusSDK.V2.Models; -using LoginRadiusSDK.V2.Util; -using static LoginRadiusSDK.V2.Util.LoginRadiusArgumentValidator; - -namespace LoginRadiusSDK.V2.Api -{ - public class RolesApi : LoginRadiusResource - { - - /// <summary> - /// This API creates a role with permissions. - /// </summary> - /// <param name="accountRolesCreate">Object containing data to create a new role.</param> - /// <returns>LoginRadiusRolesResponse: Contains data on the newly created role.</returns> - public ApiResponse<LoginRadiusRolesResponse> CreateRoles(LoginRadiusRolesCreate accountRolesCreate) - { - Validate(new[] { accountRolesCreate }); - return ConfigureAndExecute<LoginRadiusRolesResponse>(RequestType.Role, HttpMethod.POST, - "role", accountRolesCreate.ConvertToJson()); - } - - /// <summary> - /// This API Gets the contexts that have been configured and the associated roles and permissions. - /// </summary> - /// <param name="uid">Uid for account getting queried.</param> - /// <returns>RoleContextData: Role context data for the associated account.</returns> - public ApiResponse<RoleContextData> GetContextWithRolesAndPermissions(string uid) - { - Validate(new[] { uid }); - var resourcePath = SDKUtil.FormatURIPath(new LoginRadiusResourcePath("{0}/rolecontext"), new object[] { uid }); - return ConfigureAndExecute<RoleContextData>(RequestType.Identity, HttpMethod.GET, resourcePath); - } - - /// <summary> - /// This API is used to get a list of all roles. - /// </summary> - /// <returns>LoginRadiusRolesResponse: A list of all roles set up.</returns> - public ApiResponse<LoginRadiusRolesResponse> GetRoles() - { - return ConfigureAndExecute<LoginRadiusRolesResponse>(RequestType.Role, HttpMethod.GET, "role"); - } - - /// <summary> - /// API is used to retrieve all the assigned roles of a particular User. - /// </summary> - /// <param name="uid">Uid for account getting queried.</param> - /// <returns>LoginRadiusUserRoles: Roles for the associated account.</returns> - public ApiResponse<LoginRadiusUserRoles> GetAccountRole(string uid) - { - Validate(new[] { uid }); - var resourcePath = SDKUtil.FormatURIPath("{0}/role", new object[] { uid }); - return ConfigureAndExecute<LoginRadiusUserRoles>(RequestType.Identity, HttpMethod.GET, resourcePath); - } - - /// <summary> - /// This API is used to add permissions to a given role. - /// </summary> - /// <param name="roleName">Role name getting updated.</param> - /// <param name="permissions">Object containing data for permissions being added.</param> - /// <returns>LoginRadiusRoles: Updated role.</returns> - public ApiResponse<LoginRadiusRoles> AddRolePermissions(string roleName, LoginRadiusDeleteRolePermissions permissions) - { - Validate(new[] { roleName }); - var resourcePath = SDKUtil.FormatURIPath("role/{0}/permission", new object[] { roleName }); - return ConfigureAndExecute<LoginRadiusRoles>(RequestType.Role, HttpMethod.PUT, resourcePath, - permissions.ConvertToJson()); - } - - /// <summary> - /// This API is used to assign a role to a user. - /// </summary> - /// <param name="uid">Uid of user getting assigned a role.</param> - /// <param name="accountRoles">Object containing data for roles being assigned to user.</param> - /// <returns>LoginRadiusAccountRolesUpsert: A list of the user's updated roles.</returns> - public ApiResponse<LoginRadiusAccountRolesUpsert> RolesAssignToUser(string uid, LoginRadiusAccountRolesUpsert accountRoles) - { - Validate(new List<object> { uid, accountRoles }); - var resourcePath = SDKUtil.FormatURIPath("{0}/role", new object[] { uid }); - return ConfigureAndExecute<LoginRadiusAccountRolesUpsert>(RequestType.Identity, HttpMethod.PUT, - resourcePath, accountRoles.ConvertToJson()); - } - - /// <summary> - /// This API creates a Context with a set of Roles - /// </summary> - /// <param name="uid">Uid of account with contexts getting added.</param> - /// <param name="roleContext">The role context data being assigned to the user.</param> - /// <returns>RoleContextData: Role context data in an object.</returns> - public ApiResponse<RoleContextData> UpsertContext(string uid, AccountRoleContextModel roleContext) - { - Validate(new[] { uid }); - var resourcePath = SDKUtil.FormatURIPath(new LoginRadiusResourcePath("{0}/rolecontext"), new object[] { uid }); - return ConfigureAndExecute<RoleContextData>(RequestType.Identity, HttpMethod.PUT, resourcePath, - roleContext.ConvertToJson()); - } - - /// <summary> - /// This API is used to delete a role. - /// </summary> - /// <param name="roleName">Role name of role being deleted.</param> - /// <returns>LoginRadiusDeleteResponse: Boolean to show if role was deleted.</returns> - public ApiResponse<LoginRadiusDeleteResponse> DeleteRole(string roleName) - { - Validate(new[] { roleName }); - var resourcePath = SDKUtil.FormatURIPath("role/{0}", new object[] { roleName }); - return ConfigureAndExecute<LoginRadiusDeleteResponse>(RequestType.Role, HttpMethod.DELETE, resourcePath); - } - - /// <summary> - /// This API is used to unassign roles from a user. - /// </summary> - /// <param name="uid">Uid of account with roles being removed.</param> - /// <param name="accountRoles">Roles being unassigned from user.</param> - /// <returns>LoginRadiusDeleteResponse: Boolean to show if role was deleted.</returns> - public ApiResponse<LoginRadiusDeleteResponse> UnAssignRolesToUser(string uid, - LoginRadiusAccountRolesUpsert accountRoles) - { - Validate(new List<object> { uid, accountRoles }); - var resourcePath = SDKUtil.FormatURIPath("{0}/role", new object[] { uid }); - return ConfigureAndExecute<LoginRadiusDeleteResponse>(RequestType.Identity, HttpMethod.DELETE, resourcePath, - accountRoles.ConvertToJson()); - } - - /// <summary> - /// This API Deletes the specified Role Context - /// </summary> - /// <param name="uid">Uid of account with roles being removed.</param> - /// <param name="rolecontextname">Name of role context being deleted.</param> - /// <returns>LoginRadiusDeleteResponse: Boolean to show if context was deleted.</returns> - public ApiResponse<LoginRadiusDeleteResponse> DeleteContext(string uid, string rolecontextname) - { - Validate(new[] { uid, rolecontextname }); - var resourcePath = - SDKUtil.FormatURIPath(new LoginRadiusResourcePath("{0}/rolecontext/{1}"), - new object[] { uid, rolecontextname }); - return ConfigureAndExecute<LoginRadiusDeleteResponse>(RequestType.Identity, HttpMethod.DELETE, resourcePath); - } - - /// <summary> - /// This API is used to remove permissions from a role. - /// </summary> - /// <param name="roleName">Role name of role with permissions getting deleted.</param> - /// <param name="permissions">Permissions getting deleted.</param> - /// <returns>LoginRadiusDeleteResponse: Boolean to show if permissions was deleted.</returns> - public ApiResponse<LoginRadiusRoles> DeleteRolePermissions(string roleName, - LoginRadiusDeleteRolePermissions permissions) - { - Validate(new[] { roleName }); - var resourcePath = SDKUtil.FormatURIPath("role/{0}/permission", new object[] { roleName }); - return ConfigureAndExecute<LoginRadiusRoles>(RequestType.Role, HttpMethod.DELETE, resourcePath, - permissions.ConvertToJson()); - } - - /// <summary> - /// This API Deletes the specified Role from a Context. - /// </summary> - /// <param name="uid">Uid of account with roles being removed.</param> - /// <param name="rolecontextname">Name of role context being deleted.</param> - /// <param name="roles">Next of role context being deleted.</param> - /// <returns>LoginRadiusDeleteResponse: Boolean to show if role was deleted.</returns> - public ApiResponse<LoginRadiusDeleteResponse> DeleteRoleFromContext(string uid, string rolecontextname, - LoginRadiusAccountRolesUpsert roles) - { - Validate(new[] { uid, rolecontextname }); - var resourcePath = SDKUtil.FormatURIPath(new LoginRadiusResourcePath("{0}/rolecontext/{1}/role"), - new object[] { uid, rolecontextname }); - return ConfigureAndExecute<LoginRadiusDeleteResponse>(RequestType.Identity, HttpMethod.DELETE, resourcePath, - roles.ConvertToJson()); - } - - /// <summary> - /// This API deletes additional permissions from a context. - /// </summary> - /// <param name="uid">Uid of account with permissions getting deleted.</param> - /// <param name="rolecontextname">Name of the role context.</param> - /// <param name="additionalRolePermissions">Object containing permissions targeted for deletion.</param> - /// <returns>LoginRadiusDeleteResponse: Boolean to show if permissions were deleted.</returns> - public ApiResponse<LoginRadiusDeleteResponse> DeleteAdditionalPermissionFromContext(string uid, - string rolecontextname, AdditionalRolePermissions additionalRolePermissions) - { - Validate(new[] { uid, rolecontextname }); - var resourcePath = - SDKUtil.FormatURIPath(new LoginRadiusResourcePath("{0}/rolecontext/{1}/additionalpermission"), - new object[] { uid, rolecontextname }); - return ConfigureAndExecute<LoginRadiusDeleteResponse>(RequestType.Identity, HttpMethod.DELETE, resourcePath, - additionalRolePermissions.ConvertToJson()); - } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Api/SmartLoginApi.cs b/Source/LoginRadiusSDK.V2/Api/SmartLoginApi.cs deleted file mode 100644 index 6a321d1..0000000 --- a/Source/LoginRadiusSDK.V2/Api/SmartLoginApi.cs +++ /dev/null @@ -1,95 +0,0 @@ -using LoginRadiusSDK.V2.Models; -using LoginRadiusSDK.V2.Models.CustomerAuthentication.Login; -using LoginRadiusSDK.V2.Util; -using static LoginRadiusSDK.V2.Util.LoginRadiusArgumentValidator; - -namespace LoginRadiusSDK.V2.Api -{ - public class SmartLoginApi : LoginRadiusResource - { - /// <summary> - /// This API sends a Smart Login link to the user's Email Id. - /// </summary> - /// <param name="email">Email of account being logged in.</param> - /// <param name="clientguid">Unique client guid.</param> - /// <param name="smartloginemailtemplate">Smart login email template name.</param> - /// <param name="welcomeemailtemplate">Welcome email template name.</param> - /// <param name="redirecturl">Redirection url after successful smart login.</param> - /// <returns>LoginRadiusPostResponse: Boolean to show if smart login email was sent.</returns> - public ApiResponse<LoginRadiusPostResponse> SmartLoginByEmail(string email, string clientguid, - string smartloginemailtemplate = "", string welcomeemailtemplate = "", string redirecturl = "") - { - Validate(new[] { email, clientguid }); - var additionalQueryParams = new QueryParameters - { - ["email"] = email, - ["clientguid"] = clientguid, - ["smartloginemailtemplate"] = smartloginemailtemplate, - ["welcomeemailtemplate"] = welcomeemailtemplate, - ["redirecturl"] = redirecturl - }; - return ConfigureAndExecute<LoginRadiusPostResponse>(RequestType.Authentication, HttpMethod.GET, - "login/smartlogin", additionalQueryParams); - } - - /// <summary> - /// This API sends a Smart Login link to the user's Username. - /// </summary> - /// <param name="username">Username of account being logged in.</param> - /// <param name="clientguid">Unique client guid.</param> - /// <param name="smartloginemailtemplate">Smart login email template name.</param> - /// <param name="welcomeemailtemplate">Welcome email template name.</param> - /// <param name="redirecturl">Redirection url after successful smart login.</param> - /// <returns>LoginRadiusPostResponse: Boolean to show if smart login email was sent.</returns> - public ApiResponse<LoginRadiusPostResponse> SmartLoginByUserName(string username, string clientguid, - string smartloginemailtemplate = "", string welcomeemailtemplate = "", string redirecturl = "") - { - Validate(new[] { username, clientguid }); - var additionalQueryParams = new QueryParameters - { - ["username"] = username, - ["clientguid"] = clientguid, - ["smartloginemailtemplate"] = smartloginemailtemplate, - ["welcomeemailtemplate"] = welcomeemailtemplate, - ["redirecturl"] = redirecturl - }; - return ConfigureAndExecute<LoginRadiusPostResponse>(RequestType.Authentication, HttpMethod.GET, - "login/smartlogin", additionalQueryParams); - } - - /// <summary> - /// This API is used to check if the Smart Login link has been clicked or not. - /// </summary> - /// <param name="clientguid">Used Unique client guid.</param> - /// <returns>LoginResponse: LR Profile with access token.</returns> - public ApiResponse<LoginResponse> SmartLoginPing(string clientguid) - { - Validate(new[] { clientguid }); - var additionalQueryParams = new QueryParameters - { - ["clientguid"] = clientguid - }; - return ConfigureAndExecute<LoginResponse>(RequestType.Authentication, HttpMethod.GET, - "login/smartlogin/ping", additionalQueryParams); - } - - /// <summary> - /// This API verifies the provided token for Smart Login. - /// </summary> - /// <param name="verificationtoken">Verification token being verified.</param> - /// <param name="welcomeemailtemplate">Welcome email template name.</param> - /// <returns>LoginResponse: LR Profile with access token.</returns> - public ApiResponse<OneTouchEmailVerificationModel> SmartLoginVerifyToken(string verificationtoken, string welcomeemailtemplate = "") - { - Validate(new[] { verificationtoken }); - var additionalQueryParams = new QueryParameters - { - ["verificationtoken"] = verificationtoken, - ["welcomeemailtemplate"] = welcomeemailtemplate - }; - return ConfigureAndExecute<OneTouchEmailVerificationModel>(RequestType.Authentication, HttpMethod.GET, - "email/smartlogin", additionalQueryParams); - } - - } -} diff --git a/Source/LoginRadiusSDK.V2/Api/Social/NativeSocialApi.cs b/Source/LoginRadiusSDK.V2/Api/Social/NativeSocialApi.cs new file mode 100644 index 0000000..9d029ee --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Api/Social/NativeSocialApi.cs @@ -0,0 +1,219 @@ +//----------------------------------------------------------------------- +// <copyright file="NativeSocialApi.cs" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System; +using LoginRadiusSDK.V2.Common; +using LoginRadiusSDK.V2.Util; +using LoginRadiusSDK.V2.Models.ResponseModels; + +namespace LoginRadiusSDK.V2.Api.Social +{ + public class NativeSocialApi : LoginRadiusResource + { + /// <summary> + /// The API is used to get LoginRadius access token by sending Facebook’s access token. It will be valid for the specific duration of time specified in the response. + /// </summary> + /// <param name="fbAccessToken">Facebook Access Token</param> + /// <returns>Response containing Definition of Complete Token data</returns> + /// 20.3 + + public ApiResponse<AccessToken> GetAccessTokenByFacebookAccessToken(string fbAccessToken) + { + if (string.IsNullOrWhiteSpace(fbAccessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(fbAccessToken)); + } + var queryParameters = new QueryParameters + { + { "fb_Access_Token", fbAccessToken }, + { "key", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + + var resourcePath = "api/v2/access_token/facebook"; + + return ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// The API is used to get LoginRadius access token by sending Twitter’s access token. It will be valid for the specific duration of time specified in the response. + /// </summary> + /// <param name="twAccessToken">Twitter Access Token</param> + /// <param name="twTokenSecret">Twitter Token Secret</param> + /// <returns>Response containing Definition of Complete Token data</returns> + /// 20.4 + + public ApiResponse<AccessToken> GetAccessTokenByTwitterAccessToken(string twAccessToken, string twTokenSecret) + { + if (string.IsNullOrWhiteSpace(twAccessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(twAccessToken)); + } + if (string.IsNullOrWhiteSpace(twTokenSecret)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(twTokenSecret)); + } + var queryParameters = new QueryParameters + { + { "key", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "tw_Access_Token", twAccessToken }, + { "tw_Token_Secret", twTokenSecret } + }; + + var resourcePath = "api/v2/access_token/twitter"; + + return ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// The API is used to get LoginRadius access token by sending Google’s access token. It will be valid for the specific duration of time specified in the response. + /// </summary> + /// <param name="googleAccessToken">Google Access Token</param> + /// <param name="clientId">Google Client ID</param> + /// <param name="refreshToken">LoginRadius refresh_token</param> + /// <returns>Response containing Definition of Complete Token data</returns> + /// 20.5 + + public ApiResponse<AccessToken> GetAccessTokenByGoogleAccessToken(string googleAccessToken, string clientId = null, + string refreshToken = null) + { + if (string.IsNullOrWhiteSpace(googleAccessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(googleAccessToken)); + } + var queryParameters = new QueryParameters + { + { "google_Access_Token", googleAccessToken }, + { "key", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + if (!string.IsNullOrWhiteSpace(clientId)) + { + queryParameters.Add("client_id", clientId); + } + if (!string.IsNullOrWhiteSpace(refreshToken)) + { + queryParameters.Add("refresh_token", refreshToken); + } + + var resourcePath = "api/v2/access_token/google"; + + return ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API is used to Get LoginRadius Access Token using google jwt id token for google native mobile login/registration. + /// </summary> + /// <param name="idToken">Google JWT id_token</param> + /// <returns>Response containing Definition of Complete Token data</returns> + /// 20.6 + + public ApiResponse<AccessToken> GetAccessTokenByGoogleJWTAccessToken(string idToken) + { + if (string.IsNullOrWhiteSpace(idToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(idToken)); + } + var queryParameters = new QueryParameters + { + { "id_Token", idToken }, + { "key", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + + var resourcePath = "api/v2/access_token/googlejwt"; + + return ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// The API is used to get LoginRadius access token by sending Linkedin’s access token. It will be valid for the specific duration of time specified in the response. + /// </summary> + /// <param name="lnAccessToken">Linkedin Access Token</param> + /// <returns>Response containing Definition of Complete Token data</returns> + /// 20.7 + + public ApiResponse<AccessToken> GetAccessTokenByLinkedinAccessToken(string lnAccessToken) + { + if (string.IsNullOrWhiteSpace(lnAccessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(lnAccessToken)); + } + var queryParameters = new QueryParameters + { + { "key", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "ln_Access_Token", lnAccessToken } + }; + + var resourcePath = "api/v2/access_token/linkedin"; + + return ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// The API is used to get LoginRadius access token by sending Foursquare’s access token. It will be valid for the specific duration of time specified in the response. + /// </summary> + /// <param name="fsAccessToken">Foursquare Access Token</param> + /// <returns>Response containing Definition of Complete Token data</returns> + /// 20.8 + + public ApiResponse<AccessToken> GetAccessTokenByFoursquareAccessToken(string fsAccessToken) + { + if (string.IsNullOrWhiteSpace(fsAccessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(fsAccessToken)); + } + var queryParameters = new QueryParameters + { + { "fs_Access_Token", fsAccessToken }, + { "key", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } + }; + + var resourcePath = "api/v2/access_token/foursquare"; + + return ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// The API is used to get LoginRadius access token by sending Vkontakte’s access token. It will be valid for the specific duration of time specified in the response. + /// </summary> + /// <param name="vkAccessToken">Vkontakte Access Token</param> + /// <returns>Response containing Definition of Complete Token data</returns> + /// 20.15 + + public ApiResponse<AccessToken> GetAccessTokenByVkontakteAccessToken(string vkAccessToken) + { + if (string.IsNullOrWhiteSpace(vkAccessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(vkAccessToken)); + } + var queryParameters = new QueryParameters + { + { "key", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "vk_access_token", vkAccessToken } + }; + + var resourcePath = "api/v2/access_token/vkontakte"; + + return ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// The API is used to get LoginRadius access token by sending Google’s AuthCode. It will be valid for the specific duration of time specified in the response. + /// </summary> + /// <param name="googleAuthcode">Google AuthCode</param> + /// <returns>Response containing Definition of Complete Token data</returns> + /// 20.16 + + public ApiResponse<AccessToken> GetAccessTokenByGoogleAuthCode(string googleAuthcode) + { + if (string.IsNullOrWhiteSpace(googleAuthcode)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(googleAuthcode)); + } + var queryParameters = new QueryParameters + { + { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "google_authcode", googleAuthcode } + }; + + var resourcePath = "api/v2/access_token/google"; + + return ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); + } + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Api/Social/SocialApi.cs b/Source/LoginRadiusSDK.V2/Api/Social/SocialApi.cs new file mode 100644 index 0000000..5a6ca46 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Api/Social/SocialApi.cs @@ -0,0 +1,793 @@ +//----------------------------------------------------------------------- +// <copyright file="SocialApi.cs" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using LoginRadiusSDK.V2.Common; +using LoginRadiusSDK.V2.Util; +using LoginRadiusSDK.V2.Models.ResponseModels; +using LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects; +using LoginRadiusSDK.V2.Models.RequestModels; +using LoginRadiusSDK.V2.Models.ResponseModels.UserProfile; + +namespace LoginRadiusSDK.V2.Api.Social +{ + public class SocialApi : LoginRadiusResource + { + /// <summary> + /// This API Is used to translate the Request Token returned during authentication into an Access Token that can be used with other API calls. + /// </summary> + /// <param name="token">Token generated from a successful oauth from social platform</param> + /// <returns>Response containing Definition of Complete Token data</returns> + /// 20.1 + + public ApiResponse<AccessToken> ExchangeAccessToken(string token) + { + if (string.IsNullOrWhiteSpace(token)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(token)); + } + var queryParameters = new QueryParameters + { + { "secret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] }, + { "token", token } + }; + + var resourcePath = "api/v2/access_token"; + + return ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// The Refresh Access Token API is used to refresh the provider access token after authentication. It will be valid for up to 60 days on LoginRadius depending on the provider. In order to use the access token in other APIs, always refresh the token using this API.<br><br><b>Supported Providers :</b> Facebook,Yahoo,Google,Twitter, Linkedin.<br><br> Contact LoginRadius support team to enable this API. + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="expiresIn">Allows you to specify a desired expiration time in minutes for the newly issued access_token.</param> + /// <returns>Response containing Definition of Complete Token data</returns> + /// 20.2 + + public ApiResponse<AccessToken> RefreshAccessToken(string accessToken, int? expiresIn = 0) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "secret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + if (expiresIn != null) + { + queryParameters.Add("expiresIn", expiresIn.ToString()); + } + + var resourcePath = "api/v2/access_token/refresh"; + + return ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This API validates access token, if valid then returns a response with its expiry otherwise error. + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <returns>Response containing Definition of Complete Token data</returns> + /// 20.9 + + public ApiResponse<AccessToken> ValidateAccessToken(string accessToken) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "key", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "secret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + + var resourcePath = "api/v2/access_token/validate"; + + return ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This api invalidates the active access token or expires an access token validity. + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <returns>Response containing Definition for Complete Validation data</returns> + /// 20.10 + + public ApiResponse<PostMethodResponse> InValidateAccessToken(string accessToken) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "key", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "secret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + + var resourcePath = "api/v2/access_token/invalidate"; + + return ConfigureAndExecute<PostMethodResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This api is use to get all active session by Access Token. + /// </summary> + /// <param name="token">Token generated from a successful oauth from social platform</param> + /// <returns>Response containing Definition for Complete active sessions</returns> + /// 20.11 + + public ApiResponse<UserActiveSession> GetActiveSession(string token) + { + if (string.IsNullOrWhiteSpace(token)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(token)); + } + var queryParameters = new QueryParameters + { + { "key", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "secret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] }, + { "token", token } + }; + + var resourcePath = "api/v2/access_token/activesession"; + + return ConfigureAndExecute<UserActiveSession>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This api is used to get all active sessions by AccountID(UID). + /// </summary> + /// <param name="accountId">UID, the unified identifier for each user account</param> + /// <returns>Response containing Definition for Complete active sessions</returns> + /// 20.12 + + public ApiResponse<UserActiveSession> GetActiveSessionByAccountID(string accountId) + { + if (string.IsNullOrWhiteSpace(accountId)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accountId)); + } + var queryParameters = new QueryParameters + { + { "accountId", accountId }, + { "key", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "secret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + + var resourcePath = "api/v2/access_token/activesession"; + + return ConfigureAndExecute<UserActiveSession>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// This api is used to get all active sessions by ProfileId. + /// </summary> + /// <param name="profileId">Social Provider Id</param> + /// <returns>Response containing Definition for Complete active sessions</returns> + /// 20.13 + + public ApiResponse<UserActiveSession> GetActiveSessionByProfileID(string profileId) + { + if (string.IsNullOrWhiteSpace(profileId)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(profileId)); + } + var queryParameters = new QueryParameters + { + { "key", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] }, + { "profileId", profileId }, + { "secret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + + var resourcePath = "api/v2/access_token/activesession"; + + return ConfigureAndExecute<UserActiveSession>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// <b>Supported Providers:</b> Facebook, Google, Live, Vkontakte.<br><br> This API returns the photo albums associated with the passed in access tokens Social Profile. + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <returns>Response Containing List of Album Data</returns> + /// 22.1 + + public ApiResponse<List<Album>> GetAlbums(string accessToken) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken } + }; + + var resourcePath = "api/v2/album"; + + return ConfigureAndExecute<List<Album>>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// The Audio API is used to get audio files data from the user’s social account.<br><br><b>Supported Providers:</b> Live, Vkontakte + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <returns>Response Containing List of Audio Data</returns> + /// 24.1 + + public ApiResponse<List<Audio>> GetAudios(string accessToken) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken } + }; + + var resourcePath = "api/v2/audio"; + + return ConfigureAndExecute<List<Audio>>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// The Check In API is used to get check Ins data from the user’s social account.<br><br><b>Supported Providers:</b> Facebook, Foursquare, Vkontakte + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <returns>Response Containing List of CheckIn Data</returns> + /// 25.1 + + public ApiResponse<List<CheckIn>> GetCheckIns(string accessToken) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken } + }; + + var resourcePath = "api/v2/checkin"; + + return ConfigureAndExecute<List<CheckIn>>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// The Contact API is used to get contacts/friends/connections data from the user’s social account.This is one of the APIs that makes up the LoginRadius Friend Invite System. The data will normalized into LoginRadius’ standard data format. This API requires setting permissions in your LoginRadius Dashboard. <br><br><b>Note:</b> Facebook restricts access to the list of friends that is returned. When using the Contacts API with Facebook you will only receive friends that have accepted some permissions with your app. <br><br><b>Supported Providers:</b> Facebook, Foursquare, Google, LinkedIn, Live, Twitter, Vkontakte, Yahoo + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="nextCursor">Cursor value if not all contacts can be retrieved once.</param> + /// <returns>Response containing Definition of Contact Data with Cursor</returns> + /// 27.1 + + public ApiResponse<CursorResponse<Contact>> GetContacts(string accessToken, string nextCursor = "") + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken } + }; + if (!string.IsNullOrWhiteSpace(nextCursor)) + { + queryParameters.Add("nextCursor", nextCursor); + } + + var resourcePath = "api/v2/contact"; + + return ConfigureAndExecute<CursorResponse<Contact>>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// The Event API is used to get the event data from the user’s social account.<br><br><b>Supported Providers:</b> Facebook, Live + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <returns>Response Containing List of Events Data</returns> + /// 28.1 + + public ApiResponse<List<Events>> GetEvents(string accessToken) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken } + }; + + var resourcePath = "api/v2/event"; + + return ConfigureAndExecute<List<Events>>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// Get the following user list from the user’s social account.<br><br><b>Supported Providers:</b> Twitter + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <returns>Response Containing List of Contacts Data</returns> + /// 29.1 + + public ApiResponse<List<Contact>> GetFollowings(string accessToken) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken } + }; + + var resourcePath = "api/v2/following"; + + return ConfigureAndExecute<List<Contact>>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// The Group API is used to get group data from the user’s social account.<br><br><b>Supported Providers:</b> Facebook, Vkontakte + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <returns>Response Containing List of Groups Data</returns> + /// 30.1 + + public ApiResponse<List<Group>> GetGroups(string accessToken) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken } + }; + + var resourcePath = "api/v2/group"; + + return ConfigureAndExecute<List<Group>>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// The Like API is used to get likes data from the user’s social account.<br><br><b>Supported Providers:</b> Facebook + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <returns>Response Containing List of Likes Data</returns> + /// 31.1 + + public ApiResponse<List<Like>> GetLikes(string accessToken) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken } + }; + + var resourcePath = "api/v2/like"; + + return ConfigureAndExecute<List<Like>>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// The Mention API is used to get mentions data from the user’s social account.<br><br><b>Supported Providers:</b> Twitter + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <returns>Response Containing List of Status Data</returns> + /// 32.1 + + public ApiResponse<List<Status>> GetMentions(string accessToken) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken } + }; + + var resourcePath = "api/v2/mention"; + + return ConfigureAndExecute<List<Status>>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// Post Message API is used to post messages to the user’s contacts.<br><br><b>Supported Providers:</b> Twitter, LinkedIn <br><br>The Message API is used to post messages to the user’s contacts. This is one of the APIs that makes up the LoginRadius Friend Invite System. After using the Contact API, you can send messages to the retrieved contacts. This API requires setting permissions in your LoginRadius Dashboard.<br><br>GET & POST Message API work the same way except the API method is different + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="message">Body of your message</param> + /// <param name="subject">Subject of your message</param> + /// <param name="to">Recipient's social provider's id</param> + /// <returns>Response containing Definition for Complete Validation data</returns> + /// 33.1 + + public ApiResponse<PostMethodResponse> PostMessage(string accessToken, string message, + string subject, string to) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + if (string.IsNullOrWhiteSpace(message)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(message)); + } + if (string.IsNullOrWhiteSpace(subject)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(subject)); + } + if (string.IsNullOrWhiteSpace(to)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(to)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "message", message }, + { "subject", subject }, + { "to", to } + }; + + var resourcePath = "api/v2/message"; + + return ConfigureAndExecute<PostMethodResponse>(HttpMethod.POST, resourcePath, queryParameters, null); + } + /// <summary> + /// The Page API is used to get the page data from the user’s social account.<br><br><b>Supported Providers:</b> Facebook, LinkedIn + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="pageName">Name of the page you want to retrieve info from</param> + /// <returns>Response containing Definition of Complete page data</returns> + /// 34.1 + + public ApiResponse<Page> GetPage(string accessToken, string pageName) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + if (string.IsNullOrWhiteSpace(pageName)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(pageName)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "pageName", pageName } + }; + + var resourcePath = "api/v2/page"; + + return ConfigureAndExecute<Page>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// The Photo API is used to get photo data from the user’s social account.<br><br><b>Supported Providers:</b> Facebook, Foursquare, Google, Live, Vkontakte + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="albumId">The id of the album you want to retrieve info from</param> + /// <returns>Response Containing List of Photos Data</returns> + /// 35.1 + + public ApiResponse<List<Photo>> GetPhotos(string accessToken, string albumId) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + if (string.IsNullOrWhiteSpace(albumId)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(albumId)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "albumId", albumId } + }; + + var resourcePath = "api/v2/photo"; + + return ConfigureAndExecute<List<Photo>>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// The Post API is used to get post message data from the user’s social account.<br><br><b>Supported Providers:</b> Facebook + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <returns>Response Containing List of Posts Data</returns> + /// 36.1 + + public ApiResponse<List<Post>> GetPosts(string accessToken) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken } + }; + + var resourcePath = "api/v2/post"; + + return ConfigureAndExecute<List<Post>>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// The Status API is used to update the status on the user’s wall.<br><br><b>Supported Providers:</b> Facebook, Twitter, LinkedIn + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="caption">Message displayed below the description(Requires URL, Under 70 Characters).</param> + /// <param name="description">Description of the displayed URL and Image(Requires URL)</param> + /// <param name="imageUrl">Image to be displayed in the share(Requires URL).</param> + /// <param name="status">Main body of the Status update.</param> + /// <param name="title">Title of Linked URL</param> + /// <param name="url">URL to be included when clicking on the share.</param> + /// <param name="shorturl">short url</param> + /// <returns>Response conatining Definition of Validation and Short URL data</returns> + /// 37.2 + + public ApiResponse<PostMethodResponse<ShortUrlResponse>> StatusPosting(string accessToken, string caption, + string description, string imageUrl, string status, string title, string url, + string shorturl = "0") + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + if (string.IsNullOrWhiteSpace(caption)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(caption)); + } + if (string.IsNullOrWhiteSpace(description)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(description)); + } + if (string.IsNullOrWhiteSpace(imageUrl)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(imageUrl)); + } + if (string.IsNullOrWhiteSpace(status)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(status)); + } + if (string.IsNullOrWhiteSpace(title)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(title)); + } + if (string.IsNullOrWhiteSpace(url)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(url)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "caption", caption }, + { "description", description }, + { "imageurl", imageUrl }, + { "status", status }, + { "title", title }, + { "url", url } + }; + if (!string.IsNullOrWhiteSpace(shorturl)) + { + queryParameters.Add("shorturl", shorturl); + } + + var resourcePath = "api/v2/status"; + + return ConfigureAndExecute<PostMethodResponse<ShortUrlResponse>>(HttpMethod.POST, resourcePath, queryParameters, null); + } + /// <summary> + /// The Status API is used to get the status messages from the user’s social account. + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <returns>Response Containing List of Status Data</returns> + /// 37.3 + + public ApiResponse<List<Status>> GetStatus(string accessToken) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken } + }; + + var resourcePath = "api/v2/status"; + + return ConfigureAndExecute<List<Status>>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// The Trackable status API works very similar to the Status API but it returns a Post id that you can use to track the stats(shares, likes, comments) for a specific share/post/status update. This API requires setting permissions in your LoginRadius Dashboard.<br><br> The Trackable Status API is used to update the status on the user’s wall and return an Post ID value. It is commonly referred to as Permission based sharing or Push notifications.<br><br> POST Input Parameter Format: application/x-www-form-urlencoded + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="statusModel">Model Class containing Definition of payload for Status API</param> + /// <returns>Response containing Definition for Complete status data</returns> + /// 37.6 + + public ApiResponse<StatusUpdateResponse> TrackableStatusPosting(string accessToken, StatusModel statusModel) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + if (statusModel == null) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(statusModel)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken } + }; + + var resourcePath = "api/v2/status/trackable"; + + return ConfigureAndExecute<StatusUpdateResponse>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(statusModel)); + } + /// <summary> + /// The Trackable status API works very similar to the Status API but it returns a Post id that you can use to track the stats(shares, likes, comments) for a specific share/post/status update. This API requires setting permissions in your LoginRadius Dashboard.<br><br> The Trackable Status API is used to update the status on the user’s wall and return an Post ID value. It is commonly referred to as Permission based sharing or Push notifications. + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="caption">Message displayed below the description(Requires URL, Under 70 Characters).</param> + /// <param name="description">Description of the displayed URL and Image(Requires URL)</param> + /// <param name="imageUrl">Image to be displayed in the share(Requires URL).</param> + /// <param name="status">Main body of the Status update.</param> + /// <param name="title">Title of Linked URL</param> + /// <param name="url">URL to be included when clicking on the share.</param> + /// <returns>Response containing Definition for Complete status data</returns> + /// 37.7 + + public ApiResponse<StatusUpdateResponse> GetTrackableStatusStats(string accessToken, string caption, + string description, string imageUrl, string status, string title, string url) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + if (string.IsNullOrWhiteSpace(caption)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(caption)); + } + if (string.IsNullOrWhiteSpace(description)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(description)); + } + if (string.IsNullOrWhiteSpace(imageUrl)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(imageUrl)); + } + if (string.IsNullOrWhiteSpace(status)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(status)); + } + if (string.IsNullOrWhiteSpace(title)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(title)); + } + if (string.IsNullOrWhiteSpace(url)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(url)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "caption", caption }, + { "description", description }, + { "imageurl", imageUrl }, + { "status", status }, + { "title", title }, + { "url", url } + }; + + var resourcePath = "api/v2/status/trackable/js"; + + return ConfigureAndExecute<StatusUpdateResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// The Trackable status API works very similar to the Status API but it returns a Post id that you can use to track the stats(shares, likes, comments) for a specific share/post/status update. This API requires setting permissions in your LoginRadius Dashboard.<br><br> This API is used to retrieve a tracked post based on the passed in post ID value. This API requires setting permissions in your LoginRadius Dashboard.<br><br> <b>Note:</b> To utilize this API you need to find the ID for the post you want to track, which might require using Trackable Status Posting API first. + /// </summary> + /// <param name="postId">Post ID value</param> + /// <returns>Response containing Definition of Complete Status Update data</returns> + /// 37.8 + + public ApiResponse<StatusUpdateStats> TrackableStatusFetching(string postId) + { + if (string.IsNullOrWhiteSpace(postId)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(postId)); + } + var queryParameters = new QueryParameters + { + { "postId", postId }, + { "secret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] } + }; + + var resourcePath = "api/v2/status/trackable"; + + return ConfigureAndExecute<StatusUpdateStats>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// The User Profile API is used to get social profile data from the user’s social account after authentication.<br><br><b>Supported Providers:</b> All + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <returns>Response containing Definition for Complete UserProfile data</returns> + /// 38.1 + + public ApiResponse<UserProfile> GetSocialUserProfile(string accessToken, string fields = "") + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken } + }; + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + + var resourcePath = "api/v2/userprofile"; + + return ConfigureAndExecute<UserProfile>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// The User Profile API is used to get the latest updated social profile data from the user’s social account after authentication. The social profile will be retrieved via oAuth and OpenID protocols. The data is normalized into LoginRadius’ standard data format. This API should be called using the access token retrieved from the refresh access token API. + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param> + /// <returns>Response containing Definition for Complete UserProfile data</returns> + /// 38.2 + + public ApiResponse<UserProfile> GetRefreshedSocialUserProfile(string accessToken, string fields = "") + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken } + }; + if (!string.IsNullOrWhiteSpace(fields)) + { + queryParameters.Add("fields", fields); + } + + var resourcePath = "api/v2/userprofile/refresh"; + + return ConfigureAndExecute<UserProfile>(HttpMethod.GET, resourcePath, queryParameters, null); + } + /// <summary> + /// The Video API is used to get video files data from the user’s social account.<br><br><b>Supported Providers:</b> Facebook, Google, Live, Vkontakte + /// </summary> + /// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param> + /// <param name="nextCursor">Cursor value if not all contacts can be retrieved once.</param> + /// <returns>Response containing Definition of Video Data with Cursor</returns> + /// 39.2 + + public ApiResponse<CursorResponse<Video>> GetVideos(string accessToken, string nextCursor) + { + if (string.IsNullOrWhiteSpace(accessToken)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accessToken)); + } + if (string.IsNullOrWhiteSpace(nextCursor)) + { + throw new ArgumentException(BaseConstants.ValidationMessage, nameof(nextCursor)); + } + var queryParameters = new QueryParameters + { + { "access_token", accessToken }, + { "nextCursor", nextCursor } + }; + + var resourcePath = "api/v2/video"; + + return ConfigureAndExecute<CursorResponse<Video>>(HttpMethod.GET, resourcePath, queryParameters, null); + } + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Api/SocialApi.cs b/Source/LoginRadiusSDK.V2/Api/SocialApi.cs deleted file mode 100644 index a4b6882..0000000 --- a/Source/LoginRadiusSDK.V2/Api/SocialApi.cs +++ /dev/null @@ -1,392 +0,0 @@ -using LoginRadiusSDK.V2.Entity; -using LoginRadiusSDK.V2.Models; -using LoginRadiusSDK.V2.Models.Album; -using LoginRadiusSDK.V2.Models.Audio; -using LoginRadiusSDK.V2.Models.CheckIn; -using LoginRadiusSDK.V2.Models.Company; -using LoginRadiusSDK.V2.Models.Contact; -using LoginRadiusSDK.V2.Models.Event; -using LoginRadiusSDK.V2.Models.Following; -using LoginRadiusSDK.V2.Models.Group; -using LoginRadiusSDK.V2.Models.Like; -using LoginRadiusSDK.V2.Models.Mention; -using LoginRadiusSDK.V2.Models.Page; -using LoginRadiusSDK.V2.Models.Photo; -using LoginRadiusSDK.V2.Models.UserProfile; -using LoginRadiusSDK.V2.Util; -using static LoginRadiusSDK.V2.Util.LoginRadiusArgumentValidator; -using System.Collections.Generic; - -namespace LoginRadiusSDK.V2.Api -{ - public class SocialApi : LoginRadiusResource - { - /// <summary> - /// This API is used to post messages to the user’s contacts. - /// </summary> - /// <param name="accessToken">Session which is linked to a social profile.</param> - /// <param name="to">Id of target of message.</param> - /// <param name="subject">Subject of message.</param> - /// <param name="message">The message.</param> - /// <returns>LoginRadiusPostResponse: Boolean to show message was sent.</returns> - public ApiResponse<LoginRadiusPostResponse> PostMessage(string accessToken, string to, string subject, - string message) - { - Validate(new[] { accessToken }); - var additionalQueryParams = new QueryParameters - { - ["access_token"] = accessToken, - ["to"] = to, - ["subject"] = subject, - ["message"] = message - }; - return ConfigureAndExecute<LoginRadiusPostResponse>(RequestType.Social, HttpMethod.POST, - "message", additionalQueryParams); - } - - /// <summary> - /// This API is used to post statuses. - /// </summary> - /// <param name="accessToken">Session which is linked to a social profile.</param> - /// <param name="model">Contains data for posting a status.</param> - /// <returns>LoginRadiusPostResponse: Boolean to show status was posted.</returns> - public ApiResponse<LoginRadiusPostResponse> PostStatus(string accessToken, PostStatus model) - { - Validate(new[] { accessToken }); - var additionalQueryParams = new QueryParameters - { - ["access_token"] = accessToken, - ["Imageurl"] = model.Imageurl, - ["Url"] = model.Url, - ["Title"] = model.Title, - ["Status"] = model.Status, - ["Caption"] = model.Caption, - ["Description"] = model.Description - }; - return ConfigureAndExecute<LoginRadiusPostResponse>(RequestType.Social, HttpMethod.POST, - "status", additionalQueryParams); - } - - /// <summary> - /// This API is used to get a social access token. - /// </summary> - /// <param name="token">Session which is linked to a social profile.</param> - /// <returns>LoginRadiusAccessToken: Access token data.</returns> - public ApiResponse<LoginRadiusAccessToken> GetAccessToken(string token) - { - Validate(new[] { token }); - var additionalQueryParams = new QueryParameters { ["token"] = token }; - return ConfigureAndExecute<LoginRadiusAccessToken>(RequestType.AccessToken, HttpMethod.GET, "access_token", - additionalQueryParams); - } - - /// <summary> - /// This API is used to validate an access token. - /// </summary> - /// <param name="accessToken">Session token.</param> - /// <returns>LoginRadiusAccessToken: Access token data.</returns> - public ApiResponse<LoginRadiusAccessToken> TokenValidate(string accessToken) - { - Validate(new[] { accessToken }); - var additionalQueryParams = new QueryParameters { ["access_token"] = accessToken }; - return ConfigureAndExecute<LoginRadiusAccessToken>(RequestType.Sso, HttpMethod.GET, "access_token/validate", - additionalQueryParams); - } - - /// <summary> - /// This API is used to invalidate an access token. - /// </summary> - /// <param name="accessToken">Session token.</param> - /// <returns>LoginRadiusPostResponse: Boolean to show token is invalidated.</returns> - public ApiResponse<LoginRadiusPostResponse> TokenInvalidate(string accessToken) - { - Validate(new[] { accessToken }); - var additionalQueryParams = new QueryParameters { ["access_token"] = accessToken }; - return ConfigureAndExecute<LoginRadiusPostResponse>(RequestType.Sso, HttpMethod.GET, "access_token/invalidate", - additionalQueryParams); - } - - /// <summary> - /// This API is used to get album data. - /// </summary> - /// <param name="accessToken">Session token.</param> - /// <param name="nextCursor">Targets the next point in the album list.</param> - /// <returns>ListLoginRadiusAlbum: Object containing album data.</returns> - public ApiResponse<ListLoginRadiusAlbum> GetAlbumData(string accessToken, int nextCursor = 0) - { - Validate(new[] { accessToken }); - var additionalQueryParams = new QueryParameters - { - ["access_token"] = accessToken, - ["nextcursor"] = nextCursor.ToString() - }; - return ConfigureAndExecute<ListLoginRadiusAlbum>(RequestType.Social, HttpMethod.GET, "album", - additionalQueryParams); - } - - /// <summary> - /// This API is used to get audio data. - /// </summary> - /// <param name="accessToken">Session token.</param> - /// <returns>ListLoginRadiusAlbum: Object containing audio data.</returns> - public ApiResponse<List<LoginRadiusAudio>> GetAudioData(string accessToken) - { - Validate(new[] { accessToken }); - var additionalQueryParams = new QueryParameters { ["access_token"] = accessToken }; - return ConfigureAndExecute<List<LoginRadiusAudio>>(RequestType.Social, HttpMethod.GET, "audio", - additionalQueryParams); - } - - /// <summary> - /// This API is used to get check in data. - /// </summary> - /// <param name="accessToken">Session token.</param> - /// <returns>ListLoginRadiusAlbum: Object containing check in data.</returns> - public ApiResponse<List<LoginRadiusCheckIn>> GetCheckInData(string accessToken) - { - Validate(new[] { accessToken }); - var additionalQueryParams = new QueryParameters { ["access_token"] = accessToken }; - return ConfigureAndExecute<List<LoginRadiusCheckIn>>(RequestType.Social, HttpMethod.GET, "checkin", - additionalQueryParams); - } - - /// <summary> - /// This API is used to get company data. - /// </summary> - /// <param name="accessToken">Session token.</param> - /// <returns>ListLoginRadiusAlbum: Object containing company data.</returns> - public ApiResponse<List<LoginRadiusCompany>> GetCompanyData(string accessToken) - { - Validate(new[] { accessToken }); - var additionalQueryParams = new QueryParameters { ["access_token"] = accessToken }; - return ConfigureAndExecute<List<LoginRadiusCompany>>(RequestType.Social, HttpMethod.GET, "company", - additionalQueryParams); - } - - /// <summary> - /// This API is used to get contact data. - /// </summary> - /// <param name="accessToken">Session token.</param> - /// <param name="nextCursor">Pointer to next array element.</param> - /// <returns>ListLoginRadiusAlbum: Object containing contact data.</returns> - public ApiResponse<LoginRadiusContact> GetContactData(string accessToken, int nextCursor = 0) - { - Validate(new[] { accessToken }); - var additionalQueryParams = new QueryParameters - { - ["access_token"] = accessToken, - ["nextcursor"] = nextCursor.ToString() - }; - return ConfigureAndExecute<LoginRadiusContact>(RequestType.Social, HttpMethod.GET, "contact", - additionalQueryParams); - } - - /// <summary> - /// This API is used to get event data. - /// </summary> - /// <param name="accessToken">Session token.</param> - /// <param name="nextCursor">Pointer to next array element.</param> - /// <returns>ListLoginRadiusAlbum: Object containing event data.</returns> - public ApiResponse<ListLoginRadiusEvent> GetEventData(string accessToken, int nextCursor = 0) - { - Validate(new[] { accessToken }); - var additionalQueryParams = new QueryParameters - { - ["access_token"] = accessToken, - ["nextcursor"] = nextCursor.ToString() - }; - return ConfigureAndExecute<ListLoginRadiusEvent>(RequestType.Social, HttpMethod.GET, "event", - additionalQueryParams); - } - - /// <summary> - /// This API is used to get following data. - /// </summary> - /// <param name="accessToken">Session token.</param> - /// <returns>ListLoginRadiusAlbum: Object containing following data.</returns> - public ApiResponse<List<LoginRadiusFollowing>> GetFollowingData(string accessToken) - { - Validate(new[] { accessToken }); - var additionalQueryParams = new QueryParameters { ["access_token"] = accessToken }; - return ConfigureAndExecute<List<LoginRadiusFollowing>>(RequestType.Social, HttpMethod.GET, "following", - additionalQueryParams); - } - - /// <summary> - /// This API is used to get group data. - /// </summary> - /// <param name="accessToken">Session token.</param> - /// <param name="nextCursor">Pointer to next array element.</param> - /// <returns>ListLoginRadiusAlbum: Object containing group data.</returns> - public ApiResponse<ListLoginRadiusGroup> GetGroupData(string accessToken, int nextCursor = 0) - { - Validate(new[] { accessToken }); - var additionalQueryParams = new QueryParameters - { - ["access_token"] = accessToken, - ["nextcursor"] = nextCursor.ToString() - }; - - return ConfigureAndExecute<ListLoginRadiusGroup>(RequestType.Social, HttpMethod.GET, "group", - additionalQueryParams); - } - - /// <summary> - /// This API is used to get like data. - /// </summary> - /// <param name="accessToken">Session token.</param> - /// <param name="nextCursor">Pointer to next array element.</param> - /// <returns>ListLoginRadiusAlbum: Object containing like data.</returns> - public ApiResponse<ListLoginRadiusLike> GetLikeData(string accessToken, int nextCursor = 0) - { - Validate(new[] { accessToken }); - var additionalQueryParams = new QueryParameters - { - ["access_token"] = accessToken, - ["nextcursor"] = nextCursor.ToString() - }; - - return ConfigureAndExecute<ListLoginRadiusLike>(RequestType.Social, HttpMethod.GET, "like", - additionalQueryParams); - } - - /// <summary> - /// This API is used to get mention data. - /// </summary> - /// <param name="accessToken">Session token.</param> - /// <returns>ListLoginRadiusAlbum: Object containing mention data.</returns> - public ApiResponse<List<LoginRadiusMention>> GetMentionData(string accessToken) - { - Validate(new[] { accessToken }); - var additionalQueryParams = new QueryParameters { ["access_token"] = accessToken }; - return ConfigureAndExecute<List<LoginRadiusMention>>(RequestType.Social, HttpMethod.GET, "mention", - additionalQueryParams); - } - - /// <summary> - /// This API is used to post messages to the user’s contacts. - /// </summary> - /// <param name="accessToken">Session which is linked to a social profile.</param> - /// <param name="to">Id of target of message.</param> - /// <param name="subject">Subject of message.</param> - /// <param name="message">The message.</param> - /// <returns>LoginRadiusPostResponse: Boolean to show message was sent.</returns> - public ApiResponse<LoginRadiusPostResponse> GetMessage(string accessToken, string to, string subject, string message) - { - Validate(new[] { accessToken, to, subject, message }); - var additionalQueryParams = new QueryParameters - { - ["access_token"] = accessToken, - ["to"] = to, - ["subject"] = subject, - ["message"] = message - }; - return ConfigureAndExecute<LoginRadiusPostResponse>(RequestType.Social, HttpMethod.GET, - "message/js", additionalQueryParams); - } - - /// <summary> - /// This API is used to get page data. - /// </summary> - /// <param name="accessToken">Session token.</param> - /// <param name="pageName">Name of page.</param> - /// <returns>ListLoginRadiusAlbum: Object containing page data.</returns> - public ApiResponse<LoginRadiusPage> GetPageData(string accessToken, string pageName) - { - Validate(new[] { accessToken, pageName }); - var additionalQueryParams = new QueryParameters { ["access_token"] = accessToken, ["pageName"] = pageName }; - return ConfigureAndExecute<LoginRadiusPage>(RequestType.Social, HttpMethod.GET, "page", - additionalQueryParams); - } - - /// <summary> - /// This API is used to get photo data. - /// </summary> - /// <param name="accessToken">Session token.</param> - /// <param name="albumId">Name of photo album.</param> - /// <returns>ListLoginRadiusAlbum: Object containing photo data.</returns> - public ApiResponse<List<LoginRadiusPhoto>> GetPhotoData(string accessToken, string albumId) - { - Validate(new[] { accessToken, albumId }); - var additionalQueryParams = new QueryParameters { ["access_token"] = accessToken, ["albumId"] = albumId }; - return ConfigureAndExecute<List<LoginRadiusPhoto>>(RequestType.Social, HttpMethod.GET, "photo", - additionalQueryParams); - } - - /// <summary> - /// This API is used to get post data. - /// </summary> - /// <param name="accessToken">Session token.</param> - /// <returns>ListLoginRadiusAlbum: Object containing post data.</returns> - public ApiResponse<List<LoginRadiusStatus>> GetPostData(string accessToken) - { - Validate(new[] { accessToken }); - var additionalQueryParams = new QueryParameters { ["access_token"] = accessToken }; - return ConfigureAndExecute<List<LoginRadiusStatus>>(RequestType.Social, HttpMethod.GET, "post", - additionalQueryParams); - } - - /// <summary> - /// This API is used to get status data. - /// </summary> - /// <param name="accessToken">Session token.</param> - /// <returns>ListLoginRadiusAlbum: Object containing status data.</returns> - public ApiResponse<List<LoginRadiusStatus>> GetStatusData(string accessToken) - { - Validate(new[] { accessToken }); - var additionalQueryParams = new QueryParameters { ["access_token"] = accessToken }; - return ConfigureAndExecute<List<LoginRadiusStatus>>(RequestType.Social, HttpMethod.GET, "status", - additionalQueryParams); - } - - - /// <summary> - /// This API is used to post statuses. - /// </summary> - /// <param name="accessToken">Session which is linked to a social profile.</param> - /// <param name="model">Contains data for posting a status.</param> - /// <returns>LoginRadiusPostResponse: Boolean to show status was posted.</returns> - public ApiResponse<List<LoginRadiusCurrentStatus>> GetPostStatus(string accessToken, PostStatus model) - { - Validate(new[] { accessToken }); - var additionalQueryParams = new QueryParameters - { - ["access_token"] = accessToken, - ["Imageurl"] = model.Imageurl, - ["Url"] = model.Url, - ["Title"] = model.Title, - ["Status"] = model.Status, - ["Caption"] = model.Caption, - ["Description"] = model.Description - }; - return ConfigureAndExecute<List<LoginRadiusCurrentStatus>>(RequestType.Social, HttpMethod.GET, - "status", additionalQueryParams); - } - - /// <summary> - /// This API is used to get user profile data. - /// </summary> - /// <param name="accessToken">Session token.</param> - /// <returns>ListLoginRadiusAlbum: Object containing user profile data.</returns> - public ApiResponse<LoginRadiusSocialUserProfile> GetUserProfile(string accessToken) - { - Validate(new[] { accessToken }); - var additionalQueryParams = new QueryParameters { ["access_token"] = accessToken }; - return ConfigureAndExecute<LoginRadiusSocialUserProfile>(RequestType.Social, HttpMethod.GET, - "userprofile", additionalQueryParams); - } - - /// <summary> - /// This API is used to get video data. - /// </summary> - /// <param name="accessToken">Session token.</param> - /// <returns>ListLoginRadiusAlbum: Object containing video data.</returns> - public ApiResponse<List<Models.Video.Data>> GetVideoData(string accessToken) - { - Validate(new[] { accessToken }); - var additionalQueryParams = new QueryParameters { ["access_token"] = accessToken }; - return ConfigureAndExecute<List<Models.Video.Data>>(RequestType.Social, HttpMethod.GET, "video", - additionalQueryParams); - } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Api/TokenManagementApi.cs b/Source/LoginRadiusSDK.V2/Api/TokenManagementApi.cs deleted file mode 100644 index 6b44fe5..0000000 --- a/Source/LoginRadiusSDK.V2/Api/TokenManagementApi.cs +++ /dev/null @@ -1,105 +0,0 @@ -using LoginRadiusSDK.V2.Entity; -using LoginRadiusSDK.V2.Models; -using LoginRadiusSDK.V2.Models.Identity; -using LoginRadiusSDK.V2.Models.UserProfile; -using LoginRadiusSDK.V2.Util; -using static LoginRadiusSDK.V2.Util.LoginRadiusArgumentValidator; - -namespace LoginRadiusSDK.V2.Api -{ - public class TokenManagementApi : LoginRadiusResource - { - /// <summary> - /// This API creates a LoginRadius access token using Facebook credentials. - /// </summary> - /// <param name="facebookToken">Facebook access token.</param> - /// <returns>LoginRadiusAccessToken: LR access token.</returns> - public ApiResponse<LoginRadiusAccessToken> GetFacebookAccessToken(string facebookToken) - { - Validate(new[] { facebookToken }); - var additionalQueryParams = new QueryParameters { ["fb_access_token"] = facebookToken }; - return ConfigureAndExecute<LoginRadiusAccessToken>(RequestType.AdvancedSocial, - HttpMethod.GET, "access_token/facebook", additionalQueryParams); - } - - /// <summary> - /// This API creates a LoginRadius access token using Twitter credentials. - /// </summary> - /// <param name="twitterToken">Twitter access token.</param> - /// <param name="twitterTokenSecret">Twitter secret.</param> - /// <returns>LoginRadiusAccessToken: LR access token.</returns> - public ApiResponse<LoginRadiusAccessToken> GetTwitterAccessToken(string twitterToken, string twitterTokenSecret) - { - Validate(new[] { 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); - } - - /// <summary> - /// This API creates a LoginRadius access token using Vkontakte credentials. - /// </summary> - /// <param name="vkontakteToken">Vkontakte access token.</param> - /// <returns>LoginRadiusAccessToken: LR access token.</returns> - public ApiResponse<LoginRadiusAccessToken> GetVkontakteAccessToken(string vkontakteToken) - { - Validate(new[] { vkontakteToken }); - var additionalQueryParams = new QueryParameters { ["vk_access_token"] = vkontakteToken }; - return ConfigureAndExecute<LoginRadiusAccessToken>(RequestType.AdvancedSocial, - HttpMethod.GET, "access_token/vkontakte", additionalQueryParams); - } - - /// <summary> - /// This API creates a LoginRadius access token using Google credentials. - /// </summary> - /// <param name="googleToken">Google JWT token.</param> - /// <returns>LoginRadiusAccessToken: LR access token.</returns> - public ApiResponse<LoginRadiusAccessToken> GetGoogleAccessToken(string googleToken) - { - Validate(new[] { googleToken }); - var additionalQueryParams = new QueryParameters { ["id_token"] = googleToken }; - return ConfigureAndExecute<LoginRadiusAccessToken>(RequestType.AdvancedSocial, - HttpMethod.GET, "access_token/googlejwt", additionalQueryParams); - } - - /// <summary> - /// Refreshes a LoginRadius user profile - /// </summary> - /// <param name="accessToken">Existing valid access token.</param> - /// <returns>LoginRadiusSocialUserProfile: LR profile with social data.</returns> - public ApiResponse<LoginRadiusSocialUserProfile> GetRefreshUserProfile(string accessToken) - { - Validate(new[] { accessToken }); - var additionalQueryParams = new QueryParameters { ["access_token"] = accessToken }; - return ConfigureAndExecute<LoginRadiusSocialUserProfile>(RequestType.AdvancedSocial, HttpMethod.GET, - "userprofile/refresh", additionalQueryParams); - } - - /// <summary> - /// Refreshes a LoginRadius access token. - /// </summary> - /// <param name="accessToken">Existing valid access token.</param> - /// <returns>LoginResponse: LR access token.</returns> - public ApiResponse<AccessTokenResponse> GetRefreshToken(string accessToken) - { - Validate(new[] { accessToken }); - var additionalQueryParams = new QueryParameters { ["access_token"] = accessToken }; - return ConfigureAndExecute<AccessTokenResponse>(RequestType.AdvancedSocial, HttpMethod.GET, - "access_token/refresh", additionalQueryParams); - } - - /// <summary> - /// The Shorten URL API is used to convert your URLs to the LoginRadius short URL - ish.re - /// </summary> - /// <param name="uri">Verification token being verified.</param> - /// <returns>ShortUrlResponse: Object containing info on shortened url.</returns> - public ApiResponse<ShortUrlResponse> GetShortenUri(string uri) - { - Validate(new[] { uri }); - var additionalQueryParams = new QueryParameters { ["url"] = uri }; - return ConfigureAndExecute<ShortUrlResponse>(RequestType.AdvancedSharing, HttpMethod.GET, null, - additionalQueryParams); - } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Api/WebhookApi.cs b/Source/LoginRadiusSDK.V2/Api/WebhookApi.cs deleted file mode 100644 index d933476..0000000 --- a/Source/LoginRadiusSDK.V2/Api/WebhookApi.cs +++ /dev/null @@ -1,51 +0,0 @@ -using LoginRadiusSDK.V2.Models; -using LoginRadiusSDK.V2.Models.webhook; -using LoginRadiusSDK.V2.Util; - -namespace LoginRadiusSDK.V2.Api -{ - public class WebhookApi : LoginRadiusResource - { - /// <summary> - /// This API can be used to test a subscribed WebHook. - /// </summary> - /// <returns>LoginRadiusWebhookTestResponse: Boolean to check if webhook is allowed.</returns> - public ApiResponse<LoginRadiusWebhookTestResponse> WebhookTest() - { - return ConfigureAndExecute<LoginRadiusWebhookTestResponse>(RequestType.Webhook, HttpMethod.GET, "/test"); - } - - /// <summary> - /// This API can be used to configure a WebHook on your LoginRadius site. - /// </summary> - /// <param name="webhookPost">Name of the role context.</param> - /// <returns>LoginRadiusWebhookSubscribe: Boolean to check if webhook is subscribed.</returns> - public ApiResponse<LoginRadiusWebhookSubscribe> WebHookSubscribeApi(webhookPost webhookPost) - { - return ConfigureAndExecute<LoginRadiusWebhookSubscribe>(RequestType.Webhook, HttpMethod.POST, string.Empty, - webhookPost.ConvertToJson()); - } - - /// <summary> - /// This API can be used to unsubscribe a WebHook configured on your LoginRadius site. - /// </summary> - /// <param name="webhookPost">Object of the unsubscribing webhook.</param> - /// <returns>LoginRadiusWebhookUnSubscribe: Boolean to check if webhook is removed.</returns> - public ApiResponse<LoginRadiusWebhookUnSubscribe> WebHookUnsubscribe(webhookPost webhookPost) - { - return ConfigureAndExecute<LoginRadiusWebhookUnSubscribe>(RequestType.Webhook, HttpMethod.DELETE, string.Empty, - webhookPost.ConvertToJson()); - } - - /// <summary> - /// This API is used to fatch all the subscribed URLs, for particular event. - /// </summary> - /// <param name="Event">Name of the hooked event.</param> - /// <returns>LoginRadiouswebhookEvent: List of webhooks attached to event.</returns> - public ApiResponse<LoginRadiouswebhookEvent> WebhookSubscribedUrls(string Event) - { - var additionalparams = new QueryParameters { ["event"] = Event }; - return ConfigureAndExecute<LoginRadiouswebhookEvent>(RequestType.Webhook, HttpMethod.GET, null, additionalparams); - } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/BaseConstants.cs b/Source/LoginRadiusSDK.V2/BaseConstants.cs index 4d493b4..5dabab6 100755 --- a/Source/LoginRadiusSDK.V2/BaseConstants.cs +++ b/Source/LoginRadiusSDK.V2/BaseConstants.cs @@ -7,41 +7,7 @@ namespace LoginRadiusSDK.V2 /// </summary> public static class BaseConstants { - /// <summary> - /// Configuration key for HTTP Proxy Address - /// </summary> - public const string HttpProxyAddressConfig = "proxyAddress"; - - /// <summary> - /// Configuration key for HTTP Proxy Credential - /// </summary> - public const string HttpProxyCredentialConfig = "proxyCredentials"; - - /// <summary> - /// Configuration key for HTTP Connection Timeout - /// </summary> - public const string HttpConnectionTimeoutConfig = "connectionTimeout"; - - /// <summary> - /// Configuration key for HTTP Connection Retry - /// </summary> - public const string HttpConnectionRetryConfig = "requestRetries"; - - /// <summary> - /// Configuration LoginRadius API Key - /// </summary> - public const string LoginRadiusApiKey = "apiKey"; - - /// <summary> - /// Configuration LoginRadius APP Name - /// </summary> - public const string LoginRadiusAppName = "appName"; - - /// <summary> - /// Configuration LoginRadius API Secret - /// </summary> - public const string LoginRadiusApiSecret = "apiSecret"; - + /// <summary> /// Configuration LoginRadius API Secret Header Key /// </summary> @@ -62,16 +28,7 @@ public static class BaseConstants /// </summary> public const string AccessTokenBearerHeader = "Bearer "; - /// <summary> - /// Configuration LoginRadius ApiRequestSigning Key - /// </summary> - public const string ApiRequestSigning = "ApiRequestSigning"; - - /// <summary> - /// Configuration Section Identifier - /// </summary> - public const string ConfigSection = "loginradius"; - + /// <summary> /// Content Type HTTP Header /// </summary> @@ -82,10 +39,11 @@ public static class BaseConstants /// </summary> public const string ContentTypeHeaderJson = "application/json"; + /// <summary> - /// Application - Json Content Type + /// Parameter validation /// </summary> - public const string DomainName = "domainName"; + public const string ValidationMessage = "The Method Parameter is not Formated or Null"; /// <summary> /// The version of this SDK. @@ -97,18 +55,8 @@ public static class BaseConstants /// </summary> public const string SdkName = "LoginRadius-NET-SDK"; - private const string BaseRestApiEndpoint = "https://api.loginradius.com/"; - private const string BaseConfigApiEndpoint = "https://config.lrcontent.com/"; - public const string RestAuthApiEndpoint = "identity/v2/auth/"; - public const string RestIdentityApiEndpoint = "identity/v2/manage/account/"; - public const string RestRoleApiEndpoint = "identity/v2/manage/"; - public const string RestApiEndpoint = "api/v2/"; - public const string RestHookApiEndpoint = "api/v2/resthook/"; - public const string RestShareApiEndpoint = "sharing/v1/shorturl/"; - public const string ServerinfoApiEndpoint = "identity/v2/serverinfo"; - public const string WebhookApiEndpoint = "api/v2/webhook"; - public const string RegistrationDataApiEndpoint = "identity/v2/manage/registrationdata"; - public const string RegistrationDataAuthApiEndpoint = "identity/v2/auth/registrationdata"; - public const string ConfigurationAuthApiEndpoint = BaseConfigApiEndpoint + "ciam/appinfo"; + public const string BaseRestApiEndpoint = "https://api.loginradius.com/"; + public const string BaseConfigApiEndpoint = "https://config.lrcontent.com/"; + } } \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ApiExceptionResponse.cs b/Source/LoginRadiusSDK.V2/Common/ApiExceptionResponse.cs old mode 100755 new mode 100644 similarity index 87% rename from Source/LoginRadiusSDK.V2/Models/ApiExceptionResponse.cs rename to Source/LoginRadiusSDK.V2/Common/ApiExceptionResponse.cs index ef251ed..49d29e1 --- a/Source/LoginRadiusSDK.V2/Models/ApiExceptionResponse.cs +++ b/Source/LoginRadiusSDK.V2/Common/ApiExceptionResponse.cs @@ -1,11 +1,13 @@ -using System.Collections.Generic; + +using System.Collections.Generic; -namespace LoginRadiusSDK.V2.Models + +namespace LoginRadiusSDK.V2.Common { public class ApiExceptionResponse { /// <summary> - /// Deatiled error description. + /// Detailed error description. /// </summary> public string Description { get; set; } @@ -13,21 +15,22 @@ public class ApiExceptionResponse /// LoginRadius API error code. /// </summary> public int? ErrorCode { get; set; } - + /// <summary> /// Error message /// </summary> public string Message { get; set; } - + /// <summary> /// Determines whether the error is of social provider. /// </summary> public bool? IsProviderError { get; set; } - + /// <summary> /// Determines social provider error response. /// </summary> public string ProviderErrorResponse { get; set; } + /// <summary> /// Represents errors that occurred during the server validation of request payload. @@ -39,4 +42,4 @@ public class ApiExceptionResponse<T> : ApiExceptionResponse { public T Data { get; set; } } -} \ No newline at end of file +} diff --git a/Source/LoginRadiusSDK.V2/Models/ApiResponse.cs b/Source/LoginRadiusSDK.V2/Common/ApiResponse.cs old mode 100755 new mode 100644 similarity index 86% rename from Source/LoginRadiusSDK.V2/Models/ApiResponse.cs rename to Source/LoginRadiusSDK.V2/Common/ApiResponse.cs index 29d68d5..aad6948 --- a/Source/LoginRadiusSDK.V2/Models/ApiResponse.cs +++ b/Source/LoginRadiusSDK.V2/Common/ApiResponse.cs @@ -1,10 +1,10 @@ using LoginRadiusSDK.V2.Util.Serialization; -namespace LoginRadiusSDK.V2.Models +namespace LoginRadiusSDK.V2.Common { public class ApiResponse<T> : LoginRadiusSerializableObject { public ApiExceptionResponse RestException { get; set; } public T Response { get; set; } } -} \ No newline at end of file +} diff --git a/Source/LoginRadiusSDK.V2/Common/LoginRadiusResource.cs b/Source/LoginRadiusSDK.V2/Common/LoginRadiusResource.cs new file mode 100644 index 0000000..5e306bc --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Common/LoginRadiusResource.cs @@ -0,0 +1,307 @@ +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Security.Cryptography; +using System.Text; +using System.Threading; +using LoginRadiusSDK.V2.Exception; +using LoginRadiusSDK.V2.Http; +using LoginRadiusSDK.V2.Util; +using LoginRadiusSDK.V2.Util.Serialization; +using Newtonsoft.Json; + +namespace LoginRadiusSDK.V2.Common +{ + /// <summary> + /// Abstract class that handles configuring an HTTP request prior to making an API call. + /// </summary> + public abstract class LoginRadiusResource : LoginRadiusSerializableObject + { + /// <summary> + /// List of supported HTTP methods when making HTTP requests to the LoginRadius REST API. + /// </summary> + public enum HttpMethod + { + /// <summary> + /// GET HTTP request. This is typically used in API operations to retrieve a static resource. + /// </summary> + GET, + + /// <summary> + /// POST HTTP request. This is typically used in API operations that require data in the request body to complete. + /// </summary> + POST, + + /// <summary> + /// PUT HTTP request. This is used in some API operations that update a given resource. + /// </summary> + PUT, + + /// <summary> + /// DELETE HTTP request. This is typcially used in API oeprations that delete a given resource. + /// </summary> + DELETE + } + + + + /// <summary> + /// Gets the last request sent by the SDK in the current thread. + /// </summary> + public static ThreadLocal<RequestDetails> LastRequestDetails { get; private set; } + + /// <summary> + /// Gets the last response received by the SDK in the current thread. + /// </summary> + public static ThreadLocal<ResponseDetails> LastResponseDetails { get; private set; } + + + + internal static ConcurrentDictionary<string, string> ConfigDictionary; + + /// <summary> + /// Static constructor initializing any static properties. + /// </summary> + static LoginRadiusResource() + { + LastRequestDetails = new ThreadLocal<RequestDetails>(); + LastResponseDetails = new ThreadLocal<ResponseDetails>(); + ConfigDictionary = ConfigManager.Instance.GetConfiguration(); + } + + /// <summary> + /// Configures and executes REST call: Supports JSON + /// </summary> + /// <param name="requestType"></param> + /// <param name="httpMethod">HttpMethod type</param> + /// <param name="resource">URI path of the resource</param> + /// <param name="payload">JSON request payload</param> + /// <param name="queryParameters"></param> + /// <returns>Response object or null otherwise for void API calls</returns> + public static object ConfigureAndExecute(HttpMethod httpMethod, string resource, + QueryParameters queryParameters, string payload = "") + { + return ConfigureAndExecute<object>(httpMethod, resource, queryParameters, payload); + } + + static string CreateHash(string apiSecret, string endPoint, string httpMethod, string expiryTime, + string payload = null) + { + string stringToHash; + string decodedUrl; + string encodedUrl; + +#if NETSTANDARD1_3 + decodedUrl = System.Net.WebUtility.UrlDecode(endPoint); + encodedUrl = System.Net.WebUtility.UrlEncode(decodedUrl)?.ToLower(); +#else + decodedUrl = System.Web.HttpUtility.UrlDecode(endPoint); + encodedUrl = System.Web.HttpUtility.UrlEncode(decodedUrl)?.ToLower(); +#endif + + if (!string.IsNullOrEmpty(payload)) + { + stringToHash = expiryTime + ":" + encodedUrl + ":" + payload; + } + else + { + stringToHash = expiryTime + ":" + encodedUrl; + } + + + var hmacSha = new HMACSHA256(Encoding.UTF8.GetBytes(apiSecret)); + hmacSha.Initialize(); + byte[] hmac = hmacSha.ComputeHash(Encoding.UTF8.GetBytes(stringToHash)); + + var hash = Convert.ToBase64String(hmac); + + return hash; + } + + /// <summary> + /// + /// </summary> + /// <typeparam name="T"></typeparam> + /// <param name="requestType"></param> + /// <param name="httpMethod"></param> + /// <param name="resource"></param> + /// <returns></returns> + protected static ApiResponse<T> ConfigureAndExecute<T>(HttpMethod httpMethod, string resource) + { + return ConfigureAndExecute<T>(httpMethod, resource, null, null); + } + + /// <summary> + /// + /// </summary> + /// <typeparam name="T"></typeparam> + /// <param name="requestType"></param> + /// <param name="httpMethod"></param> + /// <param name="resource"></param> + /// <param name="payload"></param> + /// <returns></returns> + protected static ApiResponse<T> ConfigureAndExecute<T>(HttpMethod httpMethod,string resource,string payload) + { + return ConfigureAndExecute<T>(httpMethod, resource, null, payload); + } + + /// <summary> + /// Configures and executes REST call: Supports JSON + /// </summary> + /// <typeparam name="T">Generic Type parameter for response object</typeparam> + /// <param name="requestType"></param> + /// <param name="httpMethod">HttpMethod type</param> + /// <param name="resource">URI path of the resource</param> + /// <param name="payload">JSON request payload</param> + /// <param name="queryParameters"></param> + /// <param name="headers"></param> + /// <returns>Response object or null otherwise for void API calls</returns> + /// <exception cref="HttpException">Thrown if there was an error sending the request.</exception> + protected static ApiResponse<T> ConfigureAndExecute<T>(HttpMethod httpMethod,string resource = "" , + QueryParameters queryParameters = null, string payload = "", Dictionary<string, string> headers = null) + { + try + { + // Create the URI where the HTTP request will be sent. + Uri uniformResourceIdentifier; + var apiPath = resource; + var endPoint = GetEndpoint(apiPath,out Dictionary<string, string> authHeaders, queryParameters); + if (ConfigDictionary[LRConfigConstants.ApiRequestSigning] != null && ConfigDictionary[LRConfigConstants.ApiRequestSigning] == "true" && authHeaders.Count>0) + { + var time = DateTime.UtcNow.AddMinutes(15).ToString("yyyy-M-d h:m:s tt"); + var hash = CreateHash(ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret], endPoint, httpMethod.ToString(), time, payload); + authHeaders.Remove("apiSecret"); + if (headers == null) + { + headers = new Dictionary<string, string>(); + } + + headers.Add("digest", "SHA-256=" + hash); + headers.Add("X-Request-Expires", time); + } + var baseUri = new Uri(endPoint); + if (apiPath != null) + { + var resourceUri = baseUri; + if (!Uri.TryCreate(resourceUri, apiPath, out uniformResourceIdentifier)) + { + throw new LoginRadiusException("Cannot create URL; baseURI=" + baseUri + ", resourcePath=" + + apiPath); + } + uniformResourceIdentifier = resourceUri; + } + else + { + uniformResourceIdentifier = baseUri; + } + + var connMngr = ConnectionManager.Instance; + var httpRequest = connMngr.GetConnection(ConfigDictionary, uniformResourceIdentifier.ToString(), headers, authHeaders); + httpRequest.Method = httpMethod.ToString(); + + httpRequest.ContentType = BaseConstants.ContentTypeHeaderJson; + + // Execute call + var connectionHttp = new HttpConnection(ConfigDictionary); + + // Setup the last request & response details. + LastRequestDetails.Value = connectionHttp.RequestDetails; + LastResponseDetails.Value = connectionHttp.ResponseDetails; + + payload = payload ?? ""; + + var response = connectionHttp.Execute(payload, httpRequest, payload.Length); + if (response.Contains("errorCode")) + { + var exception = new ApiResponse<T> + { + RestException = JsonConvert.DeserializeObject<ApiExceptionResponse>(response) + }; + return exception; + } + if (typeof(T).Name.Equals("Object")) + { + return default(ApiResponse<T>); + } + if (typeof(T).Name.Equals("String")) + { + return (ApiResponse<T>)Convert.ChangeType(response, typeof(T)); + } + + + return new ApiResponse<T> { Response = JsonFormatter.ConvertFromJson<T>(response) }; + } + catch (ConnectionException ex) + { + try + { + if (ex.Response == string.Empty) + { + throw; + } + var exception = new ApiResponse<T> + { + RestException = JsonConvert.DeserializeObject<ApiExceptionResponse>(ex.Response) + }; + return exception; + } + catch + { + throw ex; + } + } + catch (LoginRadiusException e) + { + // If get a LoginRadius, just rethrow to preserve the stack trace. + return new ApiResponse<T> { RestException = e.ErrorResponse }; + } + catch (System.Exception ex) + { + throw new LoginRadiusException(ex.Message, ex); + } + } + + private static string GetEndpoint(string apiPath, out Dictionary<string, string> authHeaders, QueryParameters additionalParameters = null) + { + + string baseEndPoint; + authHeaders = null; + if (ConfigDictionary.ContainsKey(LRConfigConstants.ApiRegion) && !string.IsNullOrWhiteSpace(ConfigDictionary[LRConfigConstants.ApiRegion])) { + additionalParameters.Add("region", ConfigDictionary[LRConfigConstants.ApiRegion]); + } + if (apiPath.Contains("identity/v2") && additionalParameters.ContainsKey("apiSecret")){ + additionalParameters.Remove("apiSecret"); + authHeaders = new Dictionary<string, string> + { + [BaseConstants.AuthorizationHeader] = ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] + }; + }else if (apiPath.Contains("/auth") && additionalParameters.ContainsKey("access_token")){ + authHeaders = new Dictionary<string, string> + { + [BaseConstants.AccessTokenAuthorizationHeader] = BaseConstants.AccessTokenBearerHeader +additionalParameters["access_token"] + }; + additionalParameters.Remove("access_token"); + + }else if (apiPath.Contains("identity/v2/auth/register") && additionalParameters.ContainsKey("sott")){ + authHeaders = new Dictionary<string, string>{ + [BaseConstants.SottAuthorizationHeader] = additionalParameters["sott"] + }; + additionalParameters.Remove("sott"); + + } + + if (apiPath.Contains("ciam/appinfo")) + { + baseEndPoint = BaseConstants.BaseConfigApiEndpoint; + }else + { + baseEndPoint = string.IsNullOrWhiteSpace(ConfigDictionary[LRConfigConstants.DomainName]) + ? BaseConstants.BaseRestApiEndpoint : ConfigDictionary[LRConfigConstants.DomainName]; + + } + + return string.IsNullOrWhiteSpace(apiPath) + ? $"{baseEndPoint}{additionalParameters.ToUrlFormattedString()}": $"{baseEndPoint}{apiPath}{additionalParameters.ToUrlFormattedString()}"; + } + } +} diff --git a/Source/LoginRadiusSDK.V2/Common/LoginRadiusSecureOneTimeToken.cs b/Source/LoginRadiusSDK.V2/Common/LoginRadiusSecureOneTimeToken.cs new file mode 100644 index 0000000..c381663 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Common/LoginRadiusSecureOneTimeToken.cs @@ -0,0 +1,87 @@ +using System; + +using System.Text; + + +using System.Globalization; +using System.IO; +using System.Security.Cryptography; + + +namespace LoginRadiusSDK.V2.Common +{ + public class LoginRadiusSecureOneTimeToken + { + public string GetSott(Sott sottAuth) + { + string secret = LoginRadiusResource.ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret]; + string key = LoginRadiusResource.ConfigDictionary[LRConfigConstants.LoginRadiusApiKey]; + + if (!string.IsNullOrWhiteSpace(secret) && !string.IsNullOrWhiteSpace(key)) + { + string tempToken; + + if (sottAuth.StartTime != null && sottAuth.EndTime != null) + { + tempToken = + $"{Convert.ToDateTime(sottAuth.StartTime).ToString("yyyy/M/d H:m:s", CultureInfo.InvariantCulture)}#{key}#{Convert.ToDateTime(sottAuth.EndTime).ToString("yyyy/M/d H:m:s", CultureInfo.InvariantCulture)}"; + } + else + { + tempToken = DateTime.UtcNow.ToString("yyyy/M/d H:m:s", CultureInfo.InvariantCulture) + "#" + key + + "#" + + DateTime.UtcNow.AddMinutes(10).ToString("yyyy/M/d H:m:s", CultureInfo.InvariantCulture); + } + + var token = Encrypt(tempToken, secret); + var hash = CreateMd5(token); + return token + "*" + hash; + } + return string.Empty; + } + + private const string InitVector = "tu89geji340t89u2"; + + // This constant is used to determine the keysize of the encryption algorithm. + private const int Keysize = 256; + + private static string Encrypt(string plainText, string passPhrase) + { + Aes aesAlg = Aes.Create(); + byte[] toBytes = Encoding.ASCII.GetBytes(InitVector); + aesAlg.IV = toBytes; + byte[] plainTextBytes = Encoding.UTF8.GetBytes(plainText); + var password = new Rfc2898DeriveBytes(passPhrase, new byte[8], 10000); + byte[] keyBytes = password.GetBytes(Keysize / 8); + ICryptoTransform encryptor = aesAlg.CreateEncryptor(keyBytes, aesAlg.IV); + var memoryStream = new MemoryStream(); + var cryptoStream = new CryptoStream(memoryStream, encryptor, CryptoStreamMode.Write); + cryptoStream.Write(plainTextBytes, 0, plainTextBytes.Length); + cryptoStream.FlushFinalBlock(); + byte[] cipherTextBytes = memoryStream.ToArray(); + memoryStream.Flush(); + cryptoStream.Flush(); + return Convert.ToBase64String(cipherTextBytes); + } + + private static string CreateMd5(string input) + { + byte[] inputBytes = Encoding.ASCII.GetBytes(input); + return CreateMd5(inputBytes); + } + + private static string CreateMd5(byte[] inputBytes) + { + // Use input string to calculate MD5 hash + var md5 = MD5.Create(); + byte[] hashBytes = md5.ComputeHash(inputBytes); + + var sb = new StringBuilder(); + foreach (byte t in hashBytes) + { + sb.Append(t.ToString("x2")); + } + return sb.ToString(); + } + } +} diff --git a/Source/LoginRadiusSDK.V2/Common/Sott.cs b/Source/LoginRadiusSDK.V2/Common/Sott.cs new file mode 100644 index 0000000..f6f8dbb --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Common/Sott.cs @@ -0,0 +1,24 @@ +namespace LoginRadiusSDK.V2.Common +{ + + public class SottDetails + { + public string ServerLocation { get; set; } + public string ServerName { get; set; } + public string CurrentTime { get; set; } + public Sott Sott { get; set; } + } + + public class Sott + { + public string StartTime { get; set; } + public string EndTime { get; set; } + public string TimeDifference { get; set; } + } + + public class SottRequest : Sott + { + public string Sott { get; set; } + } + } + diff --git a/Source/LoginRadiusSDK.V2/Models/ValidationErrors.cs b/Source/LoginRadiusSDK.V2/Common/ValidationErrors.cs old mode 100755 new mode 100644 similarity index 89% rename from Source/LoginRadiusSDK.V2/Models/ValidationErrors.cs rename to Source/LoginRadiusSDK.V2/Common/ValidationErrors.cs index ad9437d..4b7c328 --- a/Source/LoginRadiusSDK.V2/Models/ValidationErrors.cs +++ b/Source/LoginRadiusSDK.V2/Common/ValidationErrors.cs @@ -1,4 +1,4 @@ -namespace LoginRadiusSDK.V2.Models +namespace LoginRadiusSDK.V2.Common { public class ValidationErrors { @@ -12,4 +12,4 @@ public class ValidationErrors /// </summary> public string ErrorMessage { get; set; } } -} \ No newline at end of file +} diff --git a/Source/LoginRadiusSDK.V2/Exception/LoginRadiusException.cs b/Source/LoginRadiusSDK.V2/Exception/LoginRadiusException.cs index 30dc5d0..3fbbd1d 100755 --- a/Source/LoginRadiusSDK.V2/Exception/LoginRadiusException.cs +++ b/Source/LoginRadiusSDK.V2/Exception/LoginRadiusException.cs @@ -1,10 +1,10 @@ -using LoginRadiusSDK.V2.Models; +using LoginRadiusSDK.V2.Common; using LoginRadiusSDK.V2.Util.Serialization; namespace LoginRadiusSDK.V2.Exception { /// <summary> - /// The LoginRadiusException class is used to handle exception while loginradius api is executing. + /// The LoginRadiusException class is used to handle exception while loginRadius API is executing. /// </summary> public class LoginRadiusException : System.Exception { @@ -29,12 +29,12 @@ public ApiExceptionResponse ErrorResponse } /// <summary> - /// + /// LoginRadiusException /// </summary> public LoginRadiusException(){} /// <summary> - /// + /// LoginRadiusException /// </summary> /// <param name="message"></param> public LoginRadiusException(string message) @@ -43,7 +43,7 @@ public LoginRadiusException(string message) } /// <summary> - /// + /// LoginRadiusException /// </summary> /// <param name="message"></param> /// <param name="innerException"></param> @@ -69,7 +69,7 @@ protected virtual string ExceptionMessagePrefix } /// <summary> - /// + /// LoginRadiusException /// </summary> /// <param name="message"></param> /// <param name="innerException"></param> diff --git a/Source/LoginRadiusSDK.V2/Http/HttpConnection.cs b/Source/LoginRadiusSDK.V2/Http/HttpConnection.cs index a0fd774..77c5955 100755 --- a/Source/LoginRadiusSDK.V2/Http/HttpConnection.cs +++ b/Source/LoginRadiusSDK.V2/Http/HttpConnection.cs @@ -1,6 +1,4 @@ using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Globalization; using System.IO; using System.Net; using LoginRadiusSDK.V2.Exception; @@ -127,10 +125,9 @@ private HttpWebRequest CopyRequest(HttpWebRequest httpRequest, ConcurrentDiction HttpWebRequest newHttpRequest = connMngr.GetConnection(config, url); newHttpRequest.Method = httpRequest.Method; - newHttpRequest.Accept = httpRequest.Accept; + newHttpRequest.Accept = httpRequest.Accept; newHttpRequest.ContentType = httpRequest.ContentType; - #if !NETSTANDARD1_3 if (httpRequest.ContentLength > 0) { @@ -188,9 +185,8 @@ private HttpWebRequest CopyHttpWebRequestHeaders(HttpWebRequest httpRequest, Htt /// <returns>A string containing the response from the remote host.</returns> public string Execute(string payLoad, HttpWebRequest httpRequest, int contentLength) { - int retriesInt; - int retriesConfigured = _config.ContainsKey(BaseConstants.HttpConnectionRetryConfig) - && int.TryParse(_config[BaseConstants.HttpConnectionRetryConfig], out retriesInt) + int retriesConfigured = _config.ContainsKey(LRConfigConstants.HttpConnectionRetryConfig) + && int.TryParse(_config[LRConfigConstants.HttpConnectionRetryConfig], out int retriesInt) ? retriesInt : 0; int retries = 0; diff --git a/Source/LoginRadiusSDK.V2/LRConfigConstants.cs b/Source/LoginRadiusSDK.V2/LRConfigConstants.cs new file mode 100644 index 0000000..f2728f3 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/LRConfigConstants.cs @@ -0,0 +1,66 @@ +namespace LoginRadiusSDK.V2 +{ + /// <summary> + /// Configuration Constants that are used by the LoginRadius SDK. + /// </summary> + public static class LRConfigConstants + { + /// <summary> + /// Configuration key for HTTP Proxy Address + /// </summary> + public const string HttpProxyAddressConfig = "proxyAddress"; + + /// <summary> + /// Configuration key for HTTP Proxy Credential + /// </summary> + public const string HttpProxyCredentialConfig = "proxyCredentials"; + + /// <summary> + /// Configuration key for HTTP Connection Timeout + /// </summary> + public const string HttpConnectionTimeoutConfig = "connectionTimeout"; + + /// <summary> + /// Configuration key for HTTP Connection Retry + /// </summary> + public const string HttpConnectionRetryConfig = "requestRetries"; + + /// <summary> + /// Configuration LoginRadius API Key + /// </summary> + public const string LoginRadiusApiKey = "apiKey"; + + /// <summary> + /// Configuration LoginRadius APP Name + /// </summary> + public const string LoginRadiusAppName = "appName"; + + /// <summary> + /// Configuration LoginRadius API Secret + /// </summary> + public const string LoginRadiusApiSecret = "apiSecret"; + + /// <summary> + /// Configuration LoginRadius ApiRequestSigning Key + /// </summary> + public const string ApiRequestSigning = "apiRequestSigning"; + + /// <summary> + /// Configuration and Credentials of LoginRadius App + /// </summary> + public const string ConfigSection = "loginradius"; + + + /// <summary> + /// The new domain name + /// </summary> + public const string DomainName = "domainName"; + + /// <summary> + /// The region name + /// </summary> + public const string ApiRegion = "apiRegion"; + + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/LoginRadiusSDK.V2.csproj b/Source/LoginRadiusSDK.V2/LoginRadiusSDK.V2.csproj index 3a6860c..49a2de9 100755 --- a/Source/LoginRadiusSDK.V2/LoginRadiusSDK.V2.csproj +++ b/Source/LoginRadiusSDK.V2/LoginRadiusSDK.V2.csproj @@ -1,4 +1,4 @@ -<Project Sdk="Microsoft.NET.Sdk"> +<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFrameworks>netstandard1.3;netstandard2.0;net45;net40</TargetFrameworks> @@ -25,9 +25,9 @@ <RepositoryType>Github</RepositoryType> <Company>LoginRadius Inc.</Company> <GeneratePackageOnBuild>True</GeneratePackageOnBuild> - <Version>5.2.2</Version> - <AssemblyVersion>5.2.2</AssemblyVersion> - <FileVersion>5.2.2</FileVersion> + <Version>10.0.0-beta</Version> + <AssemblyVersion>10.0.0.0</AssemblyVersion> + <FileVersion>10.0.0.0</FileVersion> <RepositoryUrl>https://github.com/LoginRadius/dot-net-sdk</RepositoryUrl> </PropertyGroup> @@ -49,7 +49,7 @@ </ItemGroup> <ItemGroup> - <PackageReference Include="Newtonsoft.Json" Version="11.0.2" /> + <PackageReference Include="Newtonsoft.Json" Version="12.0.2" /> </ItemGroup> <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0'"> diff --git a/Source/LoginRadiusSDK.V2/LoginRadiusSDKGlobalConfig.cs b/Source/LoginRadiusSDK.V2/LoginRadiusSDKGlobalConfig.cs index 4916202..866176c 100755 --- a/Source/LoginRadiusSDK.V2/LoginRadiusSDKGlobalConfig.cs +++ b/Source/LoginRadiusSDK.V2/LoginRadiusSDKGlobalConfig.cs @@ -1,4 +1,4 @@ -using LoginRadiusSDK.V2.Api; +using LoginRadiusSDK.V2.Common; namespace LoginRadiusSDK.V2 { @@ -8,6 +8,7 @@ public static class LoginRadiusSdkGlobalConfig public static string ProxyCredentials { get; set; } public static int ConnectionTimeout { get; set; } public static int RequestRetries { get; set; } + public static string ApiRegion { get; set; } private static string _apiKey; @@ -17,7 +18,7 @@ public static string ApiKey { return string.IsNullOrWhiteSpace(_apiKey) && LoginRadiusResource.ConfigDictionary != null - ? LoginRadiusResource.ConfigDictionary[BaseConstants.LoginRadiusApiKey] + ? LoginRadiusResource.ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] : _apiKey; } set { _apiKey = value; } @@ -33,7 +34,7 @@ public static string AppName get { return string.IsNullOrWhiteSpace(_appName) && LoginRadiusResource.ConfigDictionary != null - ? LoginRadiusResource.ConfigDictionary[BaseConstants.LoginRadiusAppName] + ? LoginRadiusResource.ConfigDictionary[LRConfigConstants.LoginRadiusAppName] : _appName; } set { _appName = value; } @@ -46,7 +47,7 @@ public static string DomainName get { return string.IsNullOrWhiteSpace(_domainName) && LoginRadiusResource.ConfigDictionary != null - ? LoginRadiusResource.ConfigDictionary[BaseConstants.DomainName] + ? LoginRadiusResource.ConfigDictionary[LRConfigConstants.DomainName] : _domainName; } set { _domainName = value; } diff --git a/Source/LoginRadiusSDK.V2/Manager/ConfigManager.cs b/Source/LoginRadiusSDK.V2/Manager/ConfigManager.cs index 769a7fa..11598ae 100755 --- a/Source/LoginRadiusSDK.V2/Manager/ConfigManager.cs +++ b/Source/LoginRadiusSDK.V2/Manager/ConfigManager.cs @@ -1,5 +1,5 @@ -using System.Collections.Concurrent; using System.Collections.Generic; +using System.Collections.Concurrent; #if NetFramework using System.Configuration; #endif @@ -29,14 +29,14 @@ static ConfigManager() // Default connection timeout in milliseconds DefaultConfig = new Dictionary<string, string> { - [BaseConstants.HttpConnectionTimeoutConfig] = "30000", - [BaseConstants.HttpConnectionRetryConfig] = "3" + [LRConfigConstants.HttpConnectionTimeoutConfig] = "30000", + [LRConfigConstants.HttpConnectionRetryConfig] = "3" }; try { #if NetFramework - _sdkConfigHandler = ConfigurationManager.GetSection(BaseConstants.ConfigSection) as SDKConfigHandler ?? new SDKConfigHandler(); + _sdkConfigHandler = ConfigurationManager.GetSection(LRConfigConstants.ConfigSection) as SDKConfigHandler ?? new SDKConfigHandler(); #else _sdkConfigHandler.GetSection(); #endif @@ -118,50 +118,55 @@ internal ConcurrentDictionary<string, string> GetConfiguration() _configValues = new ConcurrentDictionary<string, string>(); var valStr = string.IsNullOrWhiteSpace(LoginRadiusSdkGlobalConfig.ApiKey) - ? _sdkConfigHandler.Setting(BaseConstants.LoginRadiusApiKey) + ? _sdkConfigHandler.Setting(LRConfigConstants.LoginRadiusApiKey) : LoginRadiusSdkGlobalConfig.ApiKey; - _configValues.TryAdd(BaseConstants.LoginRadiusApiKey, valStr); + _configValues.TryAdd(LRConfigConstants.LoginRadiusApiKey, valStr); valStr = string.IsNullOrWhiteSpace(LoginRadiusSdkGlobalConfig.ApiSecret) - ? _sdkConfigHandler.Setting(BaseConstants.LoginRadiusApiSecret) + ? _sdkConfigHandler.Setting(LRConfigConstants.LoginRadiusApiSecret) : LoginRadiusSdkGlobalConfig.ApiSecret; - _configValues.TryAdd(BaseConstants.LoginRadiusApiSecret, valStr); + _configValues.TryAdd(LRConfigConstants.LoginRadiusApiSecret, valStr); valStr = string.IsNullOrWhiteSpace(LoginRadiusSdkGlobalConfig.ProxyAddress) - ? _sdkConfigHandler.Setting(BaseConstants.HttpProxyAddressConfig) + ? _sdkConfigHandler.Setting(LRConfigConstants.HttpProxyAddressConfig) : LoginRadiusSdkGlobalConfig.ProxyAddress; - _configValues.TryAdd(BaseConstants.HttpProxyAddressConfig, valStr); + _configValues.TryAdd(LRConfigConstants.HttpProxyAddressConfig, valStr); valStr = string.IsNullOrWhiteSpace(LoginRadiusSdkGlobalConfig.ProxyCredentials) - ? _sdkConfigHandler.Setting(BaseConstants.HttpProxyCredentialConfig) + ? _sdkConfigHandler.Setting(LRConfigConstants.HttpProxyCredentialConfig) : LoginRadiusSdkGlobalConfig.ProxyCredentials; - _configValues.TryAdd(BaseConstants.HttpProxyCredentialConfig, valStr); + _configValues.TryAdd(LRConfigConstants.HttpProxyCredentialConfig, valStr); valStr = LoginRadiusSdkGlobalConfig.ConnectionTimeout <= 0 - ? _sdkConfigHandler.Setting(BaseConstants.HttpConnectionTimeoutConfig) + ? _sdkConfigHandler.Setting(LRConfigConstants.HttpConnectionTimeoutConfig) : LoginRadiusSdkGlobalConfig.ConnectionTimeout.ToString(); - _configValues.TryAdd(BaseConstants.HttpConnectionTimeoutConfig, valStr); + _configValues.TryAdd(LRConfigConstants.HttpConnectionTimeoutConfig, valStr); valStr = LoginRadiusSdkGlobalConfig.RequestRetries <= 0 - ? _sdkConfigHandler.Setting(BaseConstants.HttpConnectionRetryConfig) + ? _sdkConfigHandler.Setting(LRConfigConstants.HttpConnectionRetryConfig) : LoginRadiusSdkGlobalConfig.RequestRetries.ToString(); - _configValues.TryAdd(BaseConstants.HttpConnectionRetryConfig, valStr); + _configValues.TryAdd(LRConfigConstants.HttpConnectionRetryConfig, valStr); valStr = string.IsNullOrWhiteSpace(LoginRadiusSdkGlobalConfig.AppName) - ? _sdkConfigHandler.Setting(BaseConstants.LoginRadiusAppName) + ? _sdkConfigHandler.Setting(LRConfigConstants.LoginRadiusAppName) : LoginRadiusSdkGlobalConfig.AppName; - _configValues.TryAdd(BaseConstants.LoginRadiusAppName, valStr); + _configValues.TryAdd(LRConfigConstants.LoginRadiusAppName, valStr); valStr = string.IsNullOrWhiteSpace(LoginRadiusSdkGlobalConfig.ApiRequestSigning) - ? _sdkConfigHandler.Setting(BaseConstants.ApiRequestSigning) + ? _sdkConfigHandler.Setting(LRConfigConstants.ApiRequestSigning) : LoginRadiusSdkGlobalConfig.ApiRequestSigning; - _configValues.TryAdd(BaseConstants.ApiRequestSigning, valStr); + _configValues.TryAdd(LRConfigConstants.ApiRequestSigning, valStr); valStr = string.IsNullOrWhiteSpace(LoginRadiusSdkGlobalConfig.DomainName) - ? _sdkConfigHandler.Setting(BaseConstants.DomainName) - : LoginRadiusSdkGlobalConfig.DomainName; - _configValues.TryAdd(BaseConstants.DomainName, valStr); + ? _sdkConfigHandler.Setting(LRConfigConstants.DomainName) + :LoginRadiusSdkGlobalConfig.DomainName; + _configValues.TryAdd(LRConfigConstants.DomainName, valStr); + + valStr = string.IsNullOrWhiteSpace(LoginRadiusSdkGlobalConfig.ApiRegion) + ? _sdkConfigHandler.Setting(LRConfigConstants.ApiRegion) + : LoginRadiusSdkGlobalConfig.ApiRegion; + _configValues.TryAdd(LRConfigConstants.ApiRegion, valStr); return _configValues; } diff --git a/Source/LoginRadiusSDK.V2/Manager/ConnectionManager.cs b/Source/LoginRadiusSDK.V2/Manager/ConnectionManager.cs index 7ab3b1a..cb01cf8 100755 --- a/Source/LoginRadiusSDK.V2/Manager/ConnectionManager.cs +++ b/Source/LoginRadiusSDK.V2/Manager/ConnectionManager.cs @@ -1,6 +1,6 @@ using System; -using System.Collections.Concurrent; using System.Collections.Generic; +using System.Collections.Concurrent; using System.Linq; using System.Net; #if !NET_40 @@ -49,11 +49,9 @@ public HttpWebRequest GetConnection(ConcurrentDictionary<string, string> config, } // Set connection timeout - int connectionTimeout; - if (!config.ContainsKey(BaseConstants.HttpConnectionTimeoutConfig) || - !int.TryParse(config[BaseConstants.HttpConnectionTimeoutConfig], out connectionTimeout)) + if (!config.ContainsKey(LRConfigConstants.HttpConnectionTimeoutConfig) || !int.TryParse(config[LRConfigConstants.HttpConnectionTimeoutConfig], out int connectionTimeout)) { - int.TryParse(ConfigManager.GetDefault(BaseConstants.HttpConnectionTimeoutConfig), + int.TryParse(ConfigManager.GetDefault(LRConfigConstants.HttpConnectionTimeoutConfig), out connectionTimeout); } @@ -62,14 +60,14 @@ public HttpWebRequest GetConnection(ConcurrentDictionary<string, string> config, // Set request proxy for tunnelling http requests via a proxy server Uri proxyUri; - if (config.ContainsKey(BaseConstants.HttpProxyAddressConfig) && - !string.IsNullOrWhiteSpace(config[BaseConstants.HttpProxyAddressConfig]) && - Uri.TryCreate(config[BaseConstants.HttpProxyAddressConfig], UriKind.Absolute, out proxyUri)) + if (config.ContainsKey(LRConfigConstants.HttpProxyAddressConfig) && + !string.IsNullOrWhiteSpace(config[LRConfigConstants.HttpProxyAddressConfig]) && + Uri.TryCreate(config[LRConfigConstants.HttpProxyAddressConfig], UriKind.Absolute, out proxyUri)) { - WebProxy requestProxy = new WebProxy {Address = new Uri(config[BaseConstants.HttpProxyAddressConfig])}; - if (config.ContainsKey(BaseConstants.HttpProxyCredentialConfig)) + WebProxy requestProxy = new WebProxy {Address = new Uri(config[LRConfigConstants.HttpProxyAddressConfig])}; + if (config.ContainsKey(LRConfigConstants.HttpProxyCredentialConfig) && !string.IsNullOrWhiteSpace(config[LRConfigConstants.HttpProxyCredentialConfig])) { - string proxyCredentials = config[BaseConstants.HttpProxyCredentialConfig]; + string proxyCredentials = config[LRConfigConstants.HttpProxyCredentialConfig]; string[] proxyDetails = proxyCredentials.Split(':'); if (proxyDetails.Length == 2) { diff --git a/Source/LoginRadiusSDK.V2/Manager/SDKConfigHandler.cs b/Source/LoginRadiusSDK.V2/Manager/SDKConfigHandler.cs index 6ef0a67..46634b8 100755 --- a/Source/LoginRadiusSDK.V2/Manager/SDKConfigHandler.cs +++ b/Source/LoginRadiusSDK.V2/Manager/SDKConfigHandler.cs @@ -66,7 +66,7 @@ public SDKConfigHandler() public void GetSection() { _loginRadiusSettings = new Dictionary<string, string>(); - Configuration.GetSection(BaseConstants.ConfigSection).Bind(_loginRadiusSettings); + Configuration.GetSection(LRConfigConstants.ConfigSection).Bind(_loginRadiusSettings); } public string Setting(string name) diff --git a/Source/LoginRadiusSDK.V2/Models/AdvancedSocial/ActiveSessionDetails.cs b/Source/LoginRadiusSDK.V2/Models/AdvancedSocial/ActiveSessionDetails.cs deleted file mode 100644 index fcb8182..0000000 --- a/Source/LoginRadiusSDK.V2/Models/AdvancedSocial/ActiveSessionDetails.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Collections.Generic; - -namespace LoginRadiusSDK.V2.Models -{ - public class ActiveSessionDetails - { - public List<LoginRadiusQueryDataModel> data { get; set; } - public int nextcursor { get; set; } - } -} diff --git a/Source/LoginRadiusSDK.V2/Models/AdvancedSocial/LoginRadiusStatusStats.cs b/Source/LoginRadiusSDK.V2/Models/AdvancedSocial/LoginRadiusStatusStats.cs deleted file mode 100755 index 7bc5ba6..0000000 --- a/Source/LoginRadiusSDK.V2/Models/AdvancedSocial/LoginRadiusStatusStats.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace LoginRadiusSDK.V2.Models -{ - public class LoginRadiusStatusStats - { - public int ?Shares { get; set; } - public int ?Likes { get; set; } - public int ?Comments { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/AdvancedSocial/ShortUrlResponse.cs b/Source/LoginRadiusSDK.V2/Models/AdvancedSocial/ShortUrlResponse.cs deleted file mode 100755 index 2bd75f7..0000000 --- a/Source/LoginRadiusSDK.V2/Models/AdvancedSocial/ShortUrlResponse.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace LoginRadiusSDK.V2.Models -{ - public class ShortUrlResponse - { - public long UrlKey { get; set; } - public string UrlBase36Key { get; set; } - public string ShortUrl { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/AdvancedSocial/TrackableStatusPostResponse.cs b/Source/LoginRadiusSDK.V2/Models/AdvancedSocial/TrackableStatusPostResponse.cs deleted file mode 100755 index d78f096..0000000 --- a/Source/LoginRadiusSDK.V2/Models/AdvancedSocial/TrackableStatusPostResponse.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace LoginRadiusSDK.V2.Models -{ - public class TrackableStatusPostResponse - { - public string Id { get; set; } - public ShortUrlResponse Url { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/AdvancedSocial/TrackableStatusUpdateModel.cs b/Source/LoginRadiusSDK.V2/Models/AdvancedSocial/TrackableStatusUpdateModel.cs deleted file mode 100755 index e27060d..0000000 --- a/Source/LoginRadiusSDK.V2/Models/AdvancedSocial/TrackableStatusUpdateModel.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace LoginRadiusSDK.V2.Models -{ - public class TrackableStatusUpdateModel : StatusUpdateModel - { - public string ShortUrl { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ApiOptionalParamsModel.cs b/Source/LoginRadiusSDK.V2/Models/ApiOptionalParamsModel.cs deleted file mode 100755 index 71dfbed..0000000 --- a/Source/LoginRadiusSDK.V2/Models/ApiOptionalParamsModel.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System.Collections.Generic; - -namespace LoginRadiusSDK.V2.Models -{ - /// <summary> - /// Provider getter and setter for common proprties for LoginRadius API calls. - /// </summary> - public class LoginRadiusApiOptionalParams : Dictionary<string, string> - { - /// <summary> - /// Gets or sets verification URL property for LoginRadius API call. - /// Default settings are automatically used by API i.e. empty string, - /// </summary> - public string VerificationUrl { get; set; } - - /// <summary> - /// Gets or sets Email Template property for LoginRadius API call. - /// Default settings are automatically used by API i.e. empty string, - /// </summary> - public string EmailTemplate { get; set; } - - /// <summary> - /// Gets or sets SMS Template property for LoginRadius API call. - /// Default settings are automatically used by API i.e. empty string, - /// </summary> - public string SmsTemplate { get; set; } - - /// <summary> - /// Gets or sets Login URL property for LoginRadius API call. - /// Default settings are automatically used by API i.e. empty string. - /// </summary> - public string LoginUrl { get; set; } - - /// <summary> - /// Gets or sets Delete URL property for LoginRadius API call. - /// Default settings are automatically used by API i.e. empty string. - /// URL of the site where logic of confirm deletion is handled. - /// </summary> - public string DeleteUrl { get; set; } - - /// <summary> - /// Gets or sets 2FA SMS Template property for LoginRadius API call. - /// Default settings are automatically used by API i.e. empty string. - /// </summary> - public string SmsTemplate2Fa { get; set; } - - /// <summary> - /// Gets or sets Reset Password URL property for LoginRadius API call. - /// Default settings are automatically used by API i.e. empty string. - /// </summary> - public string ResetPasswordUrl { get; set; } - - /// <summary> - /// Gets or sets Google Recaptcha Response property for LoginRadius API call. - /// Default settings are automatically used by API i.e. empty string. - /// </summary> - public string G_Recaptcha_Response { get; set; } - - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/BackupCodes/CustomerRegistrationBackupCodeResponse.cs b/Source/LoginRadiusSDK.V2/Models/BackupCodes/CustomerRegistrationBackupCodeResponse.cs deleted file mode 100755 index 7fd99d8..0000000 --- a/Source/LoginRadiusSDK.V2/Models/BackupCodes/CustomerRegistrationBackupCodeResponse.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Collections.Generic; - -namespace LoginRadiusSDK.V2.Models.BackupCodes -{ - public class CustomerRegistrationBackupCodeResponse - { - public List<string> BackUpCodes { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CloudStorageModel/LoginRadiusIdentityModel.cs b/Source/LoginRadiusSDK.V2/Models/CloudStorageModel/LoginRadiusIdentityModel.cs deleted file mode 100755 index 936c7e5..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CloudStorageModel/LoginRadiusIdentityModel.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Collections.Generic; -using LoginRadiusSDK.V2.Models.UserProfile; - -namespace LoginRadiusSDK.V2.Models -{ - public class LoginRadiusIdentityModel : LoginRadiusUserIdentity - { - public bool ?IsBlocked { get; set; } - } - - public class LoginRadiusIdentityUserList - { - public List<LoginRadiusIdentityModel> UserProfile { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CloudStorageModel/LoginRadiusQueryDataModel.cs b/Source/LoginRadiusSDK.V2/Models/CloudStorageModel/LoginRadiusQueryDataModel.cs deleted file mode 100755 index ff3237f..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CloudStorageModel/LoginRadiusQueryDataModel.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace LoginRadiusSDK.V2.Models -{ - public class LoginRadiusQueryDataModel - { - public object AccessToken { get; set; } - public object DeviceType { get; set; } - public object Os { get; set; } - public object Browser { get; set; } - public object Device { get; set; } - public object Country { get; set; } - public object City { get; set; } - public object Provider { get; set; } - public object EmailType { get; set; } - public object FriendsCount { get; set; } - public object Ip { get; set; } - public object LoginDate { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/Configuration/ApiVersion.cs b/Source/LoginRadiusSDK.V2/Models/Configuration/ApiVersion.cs deleted file mode 100755 index eb2c2ec..0000000 --- a/Source/LoginRadiusSDK.V2/Models/Configuration/ApiVersion.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace LoginRadiusSDK.V2.Models.Configuration -{ - public class ApiVersion - { - public bool v1 { get; set; } - public bool v2 { get; set; } - } -} diff --git a/Source/LoginRadiusSDK.V2/Models/Configuration/ConfigurationResponse.cs b/Source/LoginRadiusSDK.V2/Models/Configuration/ConfigurationResponse.cs deleted file mode 100755 index 9f55f07..0000000 --- a/Source/LoginRadiusSDK.V2/Models/Configuration/ConfigurationResponse.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace LoginRadiusSDK.V2.Models.Configuration -{ - public class ConfigurationResponse - { - public SocialSchema SocialSchema { get; set; } - public List<RegistrationFormSchema> RegistrationFormSchema { get; set; } - public SecurityQuestions SecurityQuestions { get; set; } - public bool IsHttps { get; set; } - public string AppName { get; set; } - public bool IsCustomerRegistration { get; set; } - public ApiVersion ApiVersion { get; set; } - public string EmailVerificationFlow { get; set; } - public bool IsPhoneLogin { get; set; } - public bool IsDisabledSocialRegistration { get; set; } - public bool IsDisabledAccountLinking { get; set; } - public bool IsAgeRestriction { get; set; } - public bool IsSecurityQuestion { get; set; } - public bool AskRequiredFieldsOnTraditionalLogin { get; set; } - public bool IsLogoutOnEmailVerification { get; set; } - public bool IsNoCallbackForSocialLogin { get; set; } - public bool IsUserNameLogin { get; set; } - public bool IsMobileCallbackForSocialLogin { get; set; } - public bool IsInvisibleRecaptcha { get; set; } - public bool AskPasswordOnSocialLogin { get; set; } - public bool AskEmailIdForUnverifiedUserLogin { get; set; } - public bool AskOptionalFieldsOnSocialSignup { get; set; } - public bool IsRiskBasedAuthentication { get; set; } - public bool IsV2Recaptcha { get; set; } - public bool CheckPhoneNoAvailabilityOnRegistration { get; set; } - public bool DuplicateEmailWithUniqueUsername { get; set; } - public bool StoreOnlyRegistrationFormFieldsForSocial { get; set; } - public bool OTPEmailVerification { get; set; } - public LoginLockedConfiguration LoginLockedConfiguration { get; set; } - public IsInstantSignin IsInstantSignin { get; set; } - public bool IsLoginOnEmailVerification { get; set; } - public TwoFactorAuthenticationData TwoFactorAuthentication { get; set; } - public bool IsRememberMe { get; set; } - public string V2RecaptchaSiteKey { get; set; } - public string QQTencentCaptchaKey { get; set; } - public bool NoRegistration { get; set; } - public object CustomDomain { get; set; } - public PrivacyPolicyConfiguration PrivacyPolicyConfiguration { get; set; } - } -} diff --git a/Source/LoginRadiusSDK.V2/Models/Configuration/IsInstantSignin.cs b/Source/LoginRadiusSDK.V2/Models/Configuration/IsInstantSignin.cs deleted file mode 100755 index 6d1f08f..0000000 --- a/Source/LoginRadiusSDK.V2/Models/Configuration/IsInstantSignin.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace LoginRadiusSDK.V2.Models.Configuration -{ - public class IsInstantSignin - { - public bool EmailLink { get; set; } - public bool SmsOtp { get; set; } - } -} diff --git a/Source/LoginRadiusSDK.V2/Models/Configuration/LoginLockedConfiguration.cs b/Source/LoginRadiusSDK.V2/Models/Configuration/LoginLockedConfiguration.cs deleted file mode 100755 index 0352c85..0000000 --- a/Source/LoginRadiusSDK.V2/Models/Configuration/LoginLockedConfiguration.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace LoginRadiusSDK.V2.Models.Configuration -{ - public class LoginLockedConfiguration - { - public string LoginLockedType { get; set; } - public int MaximumFailedLoginAttempts { get; set; } - public SuspendConfiguration SuspendConfiguration { get; set; } - } -} diff --git a/Source/LoginRadiusSDK.V2/Models/Configuration/PrivacyPolicyConfiguration.cs b/Source/LoginRadiusSDK.V2/Models/Configuration/PrivacyPolicyConfiguration.cs deleted file mode 100755 index 668daa8..0000000 --- a/Source/LoginRadiusSDK.V2/Models/Configuration/PrivacyPolicyConfiguration.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace LoginRadiusSDK.V2.Models.Configuration -{ - public class PrivacyPolicyConfiguration - { - } -} diff --git a/Source/LoginRadiusSDK.V2/Models/Configuration/RegistrationFormSchema.cs b/Source/LoginRadiusSDK.V2/Models/Configuration/RegistrationFormSchema.cs deleted file mode 100755 index 7260fcc..0000000 --- a/Source/LoginRadiusSDK.V2/Models/Configuration/RegistrationFormSchema.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace LoginRadiusSDK.V2.Models.Configuration -{ - public class RegistrationFormSchema - { - public bool Checked { get; set; } - public string type { get; set; } - public string name { get; set; } - public string display { get; set; } - public string rules { get; set; } - public List<Options> options { get; set; } - public string permission { get; set; } - public object DataSource { get; set; } - public string Parent { get; set; } - public object ParentDataSource { get; set; } - - } - - public class Options - { - public string value { get; set; } - public string text { get; set; } - } -} diff --git a/Source/LoginRadiusSDK.V2/Models/Configuration/SecurityQuestions.cs b/Source/LoginRadiusSDK.V2/Models/Configuration/SecurityQuestions.cs deleted file mode 100755 index e9cdf9b..0000000 --- a/Source/LoginRadiusSDK.V2/Models/Configuration/SecurityQuestions.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace LoginRadiusSDK.V2.Models.Configuration -{ - public class SecurityQuestions - { - public List<SecurityQuestionGet> Questions { get; set; } - } - - public class SecurityQuestionGet - { - public string QuestionID { get; set; } - public string Question { get; set; } - } -} diff --git a/Source/LoginRadiusSDK.V2/Models/Configuration/SocialSchema.cs b/Source/LoginRadiusSDK.V2/Models/Configuration/SocialSchema.cs deleted file mode 100755 index f6bfda0..0000000 --- a/Source/LoginRadiusSDK.V2/Models/Configuration/SocialSchema.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace LoginRadiusSDK.V2.Models.Configuration -{ - public class SocialSchema - { - public List<Provider> Providers { get; set; } - } - public class Provider - { - public string Name { get; set; } - public string Endpoint { get; set; } - } -} diff --git a/Source/LoginRadiusSDK.V2/Models/Configuration/SuspendConfiguration.cs b/Source/LoginRadiusSDK.V2/Models/Configuration/SuspendConfiguration.cs deleted file mode 100755 index 044c856..0000000 --- a/Source/LoginRadiusSDK.V2/Models/Configuration/SuspendConfiguration.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace LoginRadiusSDK.V2.Models.Configuration -{ - public class SuspendConfiguration - { - } -} diff --git a/Source/LoginRadiusSDK.V2/Models/Configuration/TwoFactorAuthenticationData.cs b/Source/LoginRadiusSDK.V2/Models/Configuration/TwoFactorAuthenticationData.cs deleted file mode 100755 index 45c32e9..0000000 --- a/Source/LoginRadiusSDK.V2/Models/Configuration/TwoFactorAuthenticationData.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace LoginRadiusSDK.V2.Models.Configuration -{ - public class TwoFactorAuthenticationData - { - public bool IsEnabled { get; set; } - public bool IsRequired { get; set; } - public bool IsGoogleAuthenticator { get; set; } - } -} diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/2FA/MultifactorAuthenticationResponse.cs b/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/2FA/MultifactorAuthenticationResponse.cs deleted file mode 100644 index 9f6cb3f..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/2FA/MultifactorAuthenticationResponse.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; - -namespace LoginRadiusSDK.V2.Models -{ - public class MultifactorAuthenticationResponse<T> - { - public MultifactorAuthenticationSettings SecondFactorAuthentication { get; set; } - public T Profile { get; set; } - public Guid access_token { get; set; } - public DateTime ExpiresIn { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/2FA/MultifactorAuthenticationSettings.cs b/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/2FA/MultifactorAuthenticationSettings.cs deleted file mode 100644 index ea9c872..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/2FA/MultifactorAuthenticationSettings.cs +++ /dev/null @@ -1,41 +0,0 @@ -namespace LoginRadiusSDK.V2.Models -{ - public class MultifactorAuthenticationSettings - { - public string SecondFactorAuthenticationToken { get; set; } - public string ExpireIn { get; set; } - public string QRCode { get; set; } - public string ManualEntryCode { get; set; } - public bool ?IsGoogleAuthenticatorVerified { get; set; } - public bool ?IsOTPAuthenticatorVerified { get; set; } - public string OTPPhoneNo { get; set; } - public SmsResponseData OTPStatus { get; set; } - } - - public class SecondFactorAuthenticationSettings - { - public string QRCode { get; set; } - public string ManualEntryCode { get; set; } - public bool ?IsGoogleAuthenticatorVerified { get; set; } - public bool ?IsOTPAuthenticatorVerified { get; set; } - public string OTPPhoneNo { get; set; } - public SmsSendResponse OTPStatus { get; set; } - } - - public class ResendOtpResponse : LoginRadiusPostResponse - { - public SmsSendResponse Data { get; set; } - } - - public class SmsSendResponse - { - public string AccountSid { get; set; } - public string Sid { get; set; } - } - - public class UpdatePhoneResponse - { - public SmsSendResponse Data { get; set; } - public string IsPosted { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/2FA/MultifactorUpdateSettingsModel.cs b/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/2FA/MultifactorUpdateSettingsModel.cs deleted file mode 100644 index de5c306..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/2FA/MultifactorUpdateSettingsModel.cs +++ /dev/null @@ -1,19 +0,0 @@ -using LoginRadiusSDK.V2.Util.Serialization; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; - -namespace LoginRadiusSDK.V2.Models.CustomerAuthentication._2FA -{ - public class MultifactorUpdateSettingsModel : LoginRadiusSerializableObject - { - public Dictionary<string, string> SecurityAnswer { get; set; } - public string otp { get; set; } - public string qq_captcha_ticket { get; set; } - public string qq_captcha_randstr { get; set; } - - [JsonProperty("g-recaptcha-response")] - public string g_recaptcha_response { get; set; } - } -} diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/2FA/RemoveOrResetMultifactorAuthentication.cs b/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/2FA/RemoveOrResetMultifactorAuthentication.cs deleted file mode 100644 index 886d862..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/2FA/RemoveOrResetMultifactorAuthentication.cs +++ /dev/null @@ -1,10 +0,0 @@ -using LoginRadiusSDK.V2.Util.Serialization; - -namespace LoginRadiusSDK.V2.Models.CustomerAuthentication._2FA -{ - public class RemoveOrResetMultifactorAuthentication : LoginRadiusSerializableObject - { - public bool ?otpauthenticator { get; set; } - public bool ?googleauthenticator { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/2FA/TwoFactorLoginAuthenticationModel.cs b/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/2FA/TwoFactorLoginAuthenticationModel.cs deleted file mode 100755 index 1691e70..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/2FA/TwoFactorLoginAuthenticationModel.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace LoginRadiusSDK.V2.Models -{ - public class TwoFactorLoginAuthenticationModel : Dictionary<String, String> - { - public string Otp { get; set; } - public string GoogleAuthenticatorCode { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/2FA/ValidateMultifactorResponse.cs b/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/2FA/ValidateMultifactorResponse.cs deleted file mode 100644 index dcc02c8..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/2FA/ValidateMultifactorResponse.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace LoginRadiusSDK.V2.Models.CustomerAuthentication._2FA -{ - public class ValidateMultifactorResponse - { - public string SecondFactorValidationToken { get; set; } - public bool Status { get; set; } - public DateTime ExpireIn { get; set; } - } -} diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/2FA/ValidateTwoFactorByPasswordModel.cs b/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/2FA/ValidateTwoFactorByPasswordModel.cs deleted file mode 100755 index dbaa0cf..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/2FA/ValidateTwoFactorByPasswordModel.cs +++ /dev/null @@ -1,20 +0,0 @@ -using LoginRadiusSDK.V2.Util.Serialization; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; - -namespace LoginRadiusSDK.V2.Models.CustomerAuthentication._2FA -{ - public class ValidateTwoFactorByPasswordModel : LoginRadiusSerializableObject - { - public Dictionary<string, string> SecurityAnswer { get; set; } - public string password { get; set; } - public string qq_captcha_ticket { get; set; } - public string qq_captcha_randstr { get; set; } - - [JsonProperty("g-recaptcha-response")] - public string g_recaptcha_response { get; set; } - } - -} diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Account/AccountIdentities.cs b/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Account/AccountIdentities.cs deleted file mode 100755 index 142a4db..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Account/AccountIdentities.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Collections.Generic; -using LoginRadiusSDK.V2.Models.UserProfile; - -namespace LoginRadiusSDK.V2.Models.CustomerAuthentication.Account -{ - public class AccountIdentities - { - public List<LoginRadiusUserIdentity> Data { get; set; } - } -} diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Account/MultifactorAuthentication.cs b/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Account/MultifactorAuthentication.cs deleted file mode 100644 index 073d1cc..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Account/MultifactorAuthentication.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace LoginRadiusSDK.V2.Models -{ - public class MultifactorAuthentication - { - public string QrCode { get; set; } - public string ManualEntryCode { get; set; } - public bool ?IsGoogleAuthenticatorVerified { get; set; } - public bool ?IsOtpAuthenticatorVerified { get; set; } - public string OtpPhoneNo { get; set; } - public SmsResponseData OtpStatus { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Account/SmsResponseData.cs b/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Account/SmsResponseData.cs deleted file mode 100755 index 947d32e..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Account/SmsResponseData.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace LoginRadiusSDK.V2.Models -{ - public class SmsResponseData : PhoneUpsertResponse - { - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Account/TwoFactorAuthModel.cs b/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Account/TwoFactorAuthModel.cs deleted file mode 100755 index e6f3248..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Account/TwoFactorAuthModel.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.Collections.Generic; - -namespace LoginRadiusSDK.V2.Models -{ - public class TwoFactorAuthModel : Dictionary<string, string> - { - /// <summary> - /// - /// </summary> - public string Otp { get; set; } - - /// <summary> - /// - /// </summary> - public string GoogleAuthenticatorCode { get; set; } - - - /// <summary> - /// - /// </summary> - public string SecondFactorAuthenticationToken { get; set; } - } - - public class TwoFactorPhoneAuthModel : Util.Serialization.LoginRadiusSerializableObject - { - /// <summary> - /// - /// </summary> - public string PhoneNo2Fa { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Auth/Auth.cs b/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Auth/Auth.cs deleted file mode 100755 index a53c603..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Auth/Auth.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.CustomerAuthentication.Auth -{ - public class Auth - { - public string access_token { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/CustomObject/CustomObjectResponse.cs b/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/CustomObject/CustomObjectResponse.cs deleted file mode 100755 index f936db5..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/CustomObject/CustomObjectResponse.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; - -namespace LoginRadiusSDK.V2.Models.CustomObject -{ - public class CustomObjectResponse - { - public string Id { get; set; } - public bool ?IsActive { get; set; } - public DateTime DateCreated { get; set; } - public DateTime DateModified { get; set; } - public bool ?IsDeleted { get; set; } - - public string Uid { get; set; } - - public dynamic CustomObject { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Email/AddEmail.cs b/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Email/AddEmail.cs deleted file mode 100755 index 4ece44f..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Email/AddEmail.cs +++ /dev/null @@ -1,10 +0,0 @@ -using LoginRadiusSDK.V2.Util.Serialization; - -namespace LoginRadiusSDK.V2.Models.Email -{ - public class AddEmail : LoginRadiusSerializableObject - { - public string Email { get; set; } - public string Type { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Email/VerifyEmailModel.cs b/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Email/VerifyEmailModel.cs deleted file mode 100755 index 08f418c..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Email/VerifyEmailModel.cs +++ /dev/null @@ -1,20 +0,0 @@ -using LoginRadiusSDK.V2.Util.Serialization; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; - -namespace LoginRadiusSDK.V2.Models.CustomerAuthentication.Email -{ - public class VerifyEmailModel : LoginRadiusSerializableObject - { - public Dictionary<string, string> SecurityAnswer { get; set; } - public string otp { get; set; } - public string email { get; set; } - public string qq_captcha_ticket { get; set; } - public string qq_captcha_randstr { get; set; } - - [JsonProperty("g-recaptcha-response")] - public string g_recaptcha_response { get; set; } -} -} diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Login/LoginModel.cs b/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Login/LoginModel.cs deleted file mode 100755 index 1c2165e..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Login/LoginModel.cs +++ /dev/null @@ -1,31 +0,0 @@ -using LoginRadiusSDK.V2.Util.Serialization; -using System; -using System.Collections.Generic; -using System.Text; - -namespace LoginRadiusSDK.V2.Models.CustomerAuthentication.Login -{ - public class LoginModel : LoginRadiusSerializableObject - { - public Dictionary<string, string> SecurityAnswer { get; set; } - public string password { get; set; } - } - - public class EmailLoginModel : LoginModel - { - - public string email { get; set; } - } - - public class UserNameLoginModel : LoginModel - { - - public string username { get; set; } - } - - public class PhoneLoginModel : LoginModel - { - - public string phone { get; set; } - } -} diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Login/LoginResponse.cs b/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Login/LoginResponse.cs deleted file mode 100755 index 3d716d9..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Login/LoginResponse.cs +++ /dev/null @@ -1,20 +0,0 @@ -using LoginRadiusSDK.V2.Models.UserProfile; - -namespace LoginRadiusSDK.V2.Models -{ - public class LoginResponse - { - public string access_token { get; set; } - public string refresh_token { get; set; } - public string expires_in { get; set; } - public LoginRadiusUserIdentity Profile { get; set; } - } - - public class LoginResponse<T> - { - public string access_token { get; set; } - public string refresh_token { get; set; } - public string expires_in { get; set; } - public T Profile { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Login/OneTouchLoginModel.cs b/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Login/OneTouchLoginModel.cs deleted file mode 100644 index 0f51183..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Login/OneTouchLoginModel.cs +++ /dev/null @@ -1,35 +0,0 @@ -using LoginRadiusSDK.V2.Util.Serialization; -using System; -using System.Collections.Generic; -using System.Text; -using Newtonsoft.Json; - -namespace LoginRadiusSDK.V2.Models.CustomerAuthentication.Login -{ - public class OneTouchLoginModel : LoginRadiusSerializableObject - { - public string name { get; set; } - public string qq_captcha_ticket { get; set; } - public string qq_captcha_randstr { get; set; } - - [JsonProperty("g-recaptcha-response")] - public string g_recaptcha_response { get; set; } - } - - public class OneTouchEmailLoginModel : OneTouchLoginModel - { - public string clientguid { get; set; } - public string email { get; set; } - } - - public class OneTouchPhoneLoginModel : OneTouchLoginModel - { - public string phone { get; set; } - } - - public class OneTouchEmailVerificationModel - { - public bool? IsPosted { get; set; } - public bool? IsVerified { get; set; } - } -} diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Password/ChangePasswordModel.cs b/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Password/ChangePasswordModel.cs deleted file mode 100755 index e4826a2..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Password/ChangePasswordModel.cs +++ /dev/null @@ -1,16 +0,0 @@ -using LoginRadiusSDK.V2.Util.Serialization; - -namespace LoginRadiusSDK.V2.Models.Password -{ - public class ChangePasswordModel : LoginRadiusSerializableObject - { - public string OldPassword { get; set; } - public string NewPassword { get; set; } - } - - public class ChangePasswordModels - { - public string OldPassword { get; set; } - public string NewPassword { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Password/ReSetPasswordModel.cs b/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Password/ReSetPasswordModel.cs deleted file mode 100755 index c00d320..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Password/ReSetPasswordModel.cs +++ /dev/null @@ -1,12 +0,0 @@ -using LoginRadiusSDK.V2.Util.Serialization; - -namespace LoginRadiusSDK.V2.Models.Password -{ - public class ResetPasswordModel : LoginRadiusSerializableObject - { - public string VToken { get; set; } - public string ResetToken { get; set; } - public string Password { get; set; } - public string WelcomeEmailTemplate { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Password/ResetPasswordByEmailAndOtpModel.cs b/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Password/ResetPasswordByEmailAndOtpModel.cs deleted file mode 100755 index cf023b5..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Password/ResetPasswordByEmailAndOtpModel.cs +++ /dev/null @@ -1,17 +0,0 @@ -using LoginRadiusSDK.V2.Util.Serialization; -using System; -using System.Collections.Generic; -using System.Text; - -namespace LoginRadiusSDK.V2.Models.CustomerAuthentication.Password -{ - public class ResetPasswordByEmailAndOtpModel : LoginRadiusSerializableObject - - { - public string password { get; set; } - public string welcomeemailtemplate { get; set; } - public string resetpasswordemailtemplate { get; set; } - public string email { get; set; } - public string otp { get; set; } - } -} diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Password/ResetPasswordBySecurityAnswerModel.cs b/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Password/ResetPasswordBySecurityAnswerModel.cs deleted file mode 100755 index faf1374..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Password/ResetPasswordBySecurityAnswerModel.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Collections.Generic; -using LoginRadiusSDK.V2.Util.Serialization; - -namespace LoginRadiusSDK.V2.Models.Password -{ - public class ResetPasswordBySecurityAnswerModel : LoginRadiusSerializableObject - { - public Dictionary<string, string> SecurityAnswer { get; set; } - public string email { get; set; } - public string password { get; set; } - public string resetpasswordemailtemplate { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Password/ResetPasswordBySecurityAnswerModelAndEmail.cs b/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Password/ResetPasswordBySecurityAnswerModelAndEmail.cs deleted file mode 100755 index 1993630..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Password/ResetPasswordBySecurityAnswerModelAndEmail.cs +++ /dev/null @@ -1,15 +0,0 @@ -using LoginRadiusSDK.V2.Util.Serialization; -using System; -using System.Collections.Generic; -using System.Text; - -namespace LoginRadiusSDK.V2.Models.CustomerAuthentication.Password -{ - public class ResetPasswordBySecurityAnswerModelAndEmail : LoginRadiusSerializableObject - { - public Dictionary<string, string> SecurityAnswer { get; set; } - public string Email { get; set; } - public string Password { get; set; } - public string ResetPasswordEmailTemplate { get; set; } - } -} diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Password/ResetPasswordBySecurityAnswerModelAndPhone.cs b/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Password/ResetPasswordBySecurityAnswerModelAndPhone.cs deleted file mode 100755 index 31049e0..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Password/ResetPasswordBySecurityAnswerModelAndPhone.cs +++ /dev/null @@ -1,15 +0,0 @@ -using LoginRadiusSDK.V2.Util.Serialization; -using System; -using System.Collections.Generic; -using System.Text; - -namespace LoginRadiusSDK.V2.Models.CustomerAuthentication.Password -{ - public class ResetPasswordBySecurityAnswerModelAndPhone : LoginRadiusSerializableObject - { - public Dictionary<string, string> SecurityAnswer { get; set; } - public string Phone { get; set; } - public string Password { get; set; } - public string ResetPasswordEmailTemplate { get; set; } - } -} diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Password/ResetPasswordBySecurityAnswerModelAndUserName.cs b/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Password/ResetPasswordBySecurityAnswerModelAndUserName.cs deleted file mode 100755 index a171f44..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Password/ResetPasswordBySecurityAnswerModelAndUserName.cs +++ /dev/null @@ -1,15 +0,0 @@ -using LoginRadiusSDK.V2.Util.Serialization; -using System; -using System.Collections.Generic; -using System.Text; - -namespace LoginRadiusSDK.V2.Models.CustomerAuthentication.Password -{ - public class ResetPasswordBySecurityAnswerModelAndUserName : LoginRadiusSerializableObject - { - public Dictionary<string, string> SecurityAnswer { get; set; } - public string Username { get; set; } - public string Password { get; set; } - public string ResetPasswordEmailTemplate { get; set; } - } -} diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Password/ResetPasswordbyOTPModel.cs b/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Password/ResetPasswordbyOTPModel.cs deleted file mode 100755 index 4aa9c91..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Password/ResetPasswordbyOTPModel.cs +++ /dev/null @@ -1,12 +0,0 @@ -using LoginRadiusSDK.V2.Util.Serialization; - -namespace LoginRadiusSDK.V2.Models.Password -{ - public class ResetPasswordByOtpModel : LoginRadiusSerializableObject - { - public string Otp { get; set; } - public string Password { get; set; } - public string Phone { get; set; } - public string SmsTemplate { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Phone/PhoneOtpModel.cs b/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Phone/PhoneOtpModel.cs deleted file mode 100755 index c28877d..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Phone/PhoneOtpModel.cs +++ /dev/null @@ -1,21 +0,0 @@ -using LoginRadiusSDK.V2.Util.Serialization; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; - -namespace LoginRadiusSDK.V2.Models.CustomerAuthentication.Phone -{ - public class PhoneOtpModel : LoginRadiusSerializableObject - { - public Dictionary<string, string> SecurityAnswer { get; set; } - public string otp { get; set; } - public string phone { get; set; } - public string qq_captcha_ticket { get; set; } - public string qq_captcha_randstr { get; set; } - - [JsonProperty("g-recaptcha-response")] - public string g_recaptcha_response { get; set; } -} - -} diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Phone/PhoneUpsertResponse.cs b/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Phone/PhoneUpsertResponse.cs deleted file mode 100755 index e1dacf7..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/Phone/PhoneUpsertResponse.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace LoginRadiusSDK.V2.Models -{ - public class PhoneUpsertResponse - { - public string AccountSid { get; set; } - public string Sid { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/SocialIdentity/UnlinkProfileModel.cs b/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/SocialIdentity/UnlinkProfileModel.cs deleted file mode 100755 index df62de4..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerAuthentication/SocialIdentity/UnlinkProfileModel.cs +++ /dev/null @@ -1,10 +0,0 @@ -using LoginRadiusSDK.V2.Util.Serialization; - -namespace LoginRadiusSDK.V2.Models -{ - public class UnlinkProfileModel : LoginRadiusSerializableObject - { - public string Provider { get; set; } - public string ProviderId { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/Identity/AccessTokenUID.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/Identity/AccessTokenUID.cs deleted file mode 100755 index 64c28ac..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/Identity/AccessTokenUID.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.Identity -{ - public class AccessTokenResponse - { - public string access_token { get; set; } - public string refresh_token { get; set; } - public string expires_in { get; set; } - public string provider { get; set; } - public bool isrememberme { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/Identity/LoginRadiusPassword.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/Identity/LoginRadiusPassword.cs deleted file mode 100755 index 14163d7..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/Identity/LoginRadiusPassword.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.Identity -{ - public class ForgotPasswordToken - { - public string ForgotToken { get; set; } - public string[] IdentityProviders { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/Identity/LoginRadiusVerification.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/Identity/LoginRadiusVerification.cs deleted file mode 100755 index 42f800a..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/Identity/LoginRadiusVerification.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.Identity -{ - public class LoginRadiusVerification - { - public string VerificationToken { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/Object/CustomObjectResponse.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/Object/CustomObjectResponse.cs deleted file mode 100755 index 7610f37..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/Object/CustomObjectResponse.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace LoginRadiusSDK.V2.Models.Object -{ - public class CustomObjectprop - { - public string Id { get; set; } - public bool ?IsActive { get; set; } - public DateTime DateCreated { get; set; } - public DateTime DateModified { get; set; } - public bool ?IsDeleted { get; set; } - public string Uid { get; set; } - public object CustomObject { get; set; } - } - - public class CustomObjectResponse - { - public List<CustomObjectprop> data { get; set; } - public string count { get; set; } - } - - - - -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/Object/CustomObjectStats.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/Object/CustomObjectStats.cs deleted file mode 100755 index 6b87c5a..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/Object/CustomObjectStats.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.Object -{ - public class CustomObjectStats - { - public string TotalUsedMemory { get; set; } - public string RemainingMemory { get; set; } - public string TotalRecords { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/Object/HashPassword.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/Object/HashPassword.cs deleted file mode 100755 index 0fa0694..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/Object/HashPassword.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.Object -{ - public class HashPassword - { - public string PasswordHash { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/Post/LoginRadiusPost.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/Post/LoginRadiusPost.cs deleted file mode 100755 index c7bd3d1..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/Post/LoginRadiusPost.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; - -namespace LoginRadiusSDK.V2.Models -{ - public class LoginRadiusPost - { - public string ID { get; set; } - - public string Name { get; set; } - public string Title { get; set; } - - public string StartTime { get; set; } - public string UpdateTime { get; set; } - - - public string Message { get; set; } - public string Place { get; set; } - public string Picture { get; set; } - - public Int32? Likes { get; set; } - public Int32? Share { get; set; } - - public string Type { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/Roles/AccountRoles/LoginRadiusAccountRoles.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/Roles/AccountRoles/LoginRadiusAccountRoles.cs deleted file mode 100755 index edf2081..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/Roles/AccountRoles/LoginRadiusAccountRoles.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System.Collections.Generic; -using LoginRadiusSDK.V2.Util.Serialization; - -namespace LoginRadiusSDK.V2.Models -{ - public class LoginRadiusAccountRolesResponse - { - public List<string> Data { get; set; } - public bool ?SignIn { get; set; } - } - - public class LoginRadiusAccountRolesUpsert : LoginRadiusSerializableObject - { - public List<string> roles { get; set; } - } - - public class LoginRadiusUserRoles : LoginRadiusSerializableObject - { - public string[] Roles { get; set; } - } - - public class AdditionalRolePermissions : LoginRadiusSerializableObject - { - public List<string> AdditionalPermissions { get; set; } - } - - public class RoleContextRoleModel : LoginRadiusSerializableObject - { - public string Context { get; set; } - public List<string> Roles { get; set; } - public List<string> AdditionalPermissions { get; set; } - } - - public class AccountRoleContextModel : LoginRadiusSerializableObject - { - public List<RoleContextRoleModel> RoleContext { get; set; } - } - - public class RoleContextData: LoginRadiusSerializableObject - { - public List<RoleContextRoleModel> Data { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/Roles/LoginRadiusRoles.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/Roles/LoginRadiusRoles.cs deleted file mode 100755 index 79737ff..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/Roles/LoginRadiusRoles.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.Collections.Generic; -using LoginRadiusSDK.V2.Util.Serialization; - -namespace LoginRadiusSDK.V2.Models -{ - public class LoginRadiusRolesResponse - { - public List<LoginRadiusRoles> data { get; set; } - public string Count { get; set; } - } - - public class LoginRadiusRoles : LoginRadiusRolePermissions - { - public string Name { get; set; } - } - - public class LoginRadiusRolePermissions : LoginRadiusSerializableObject - { - public Dictionary<string, bool> Permissions { get; set; } - } - - public class LoginRadiusRolesCreate : LoginRadiusSerializableObject - { - public List<LoginRadiusRoles> Roles { get; set; } - } - - - public class LoginRadiusDeleteRolePermissions : LoginRadiusSerializableObject - { - public string[] Permissions { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/LoginRadiusAccountUpdateModel.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/LoginRadiusAccountUpdateModel.cs deleted file mode 100755 index 2f1873b..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/LoginRadiusAccountUpdateModel.cs +++ /dev/null @@ -1,133 +0,0 @@ -using System; -using System.Collections.Generic; -using LoginRadiusSDK.V2.Util.Serialization; - -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusAccountUpdateModel : LoginRadiusSerializableObject - { - public string Prefix { get; set; } - public string FirstName { get; set; } - public string MiddleName { get; set; } - public string LastName { get; set; } - public string Suffix { get; set; } - public string FullName { get; set; } - public string NickName { get; set; } - public string ProfileName { get; set; } - public string BirthDate { get; set; } - public string Gender { get; set; } - public string Website { get; set; } - public List<LoginRadiusEmail> Email { get; set; } - public LoginRadiusCountry Country { get; set; } - public string ThumbnailImageUrl { get; set; } - public string ImageUrl { get; set; } - public string Favicon { get; set; } - public string ProfileUrl { get; set; } - public string HomeTown { get; set; } - public string State { get; set; } - public string City { get; set; } - public string Industry { get; set; } - public string About { get; set; } - public string TimeZone { get; set; } - public string LocalLanguage { get; set; } - public string CoverPhoto { get; set; } - public string TagLine { get; set; } - public List<LoginRadiusPosition> Positions { get; set; } - public List<LoginRadiusEducation> Educations { get; set; } - public List<LoginRadiusPhoneNumber> PhoneNumbers { get; set; } - public List<LoginRadiusIMAccount> IMAccounts { get; set; } - public List<LoginRadiusAddress> Addresses { get; set; } - public string MainAddress { get; set; } - public string LocalCity { get; set; } - public string ProfileCity { get; set; } - public string LocalCountry { get; set; } - public string ProfileCountry { get; set; } - public bool ?IsProtected { get; set; } - public string RelationshipStatus { get; set; } - public string Quota { get; set; } - public List<string> InterestedIn { get; set; } - public List<LoginRadiusInterest> Interests { get; set; } - public string Religion { get; set; } - public string Political { get; set; } - public List<LoginRadiusSport> Sports { get; set; } - public List<LoginRadiusInspirationalPeople> InspirationalPeople { get; set; } - public string HttpsImageUrl { get; set; } - public int ?FollowersCount { get; set; } - public int ?FriendsCount { get; set; } - public string IsGeoEnabled { get; set; } - public int ?TotalStatusesCount { get; set; } - public string Associations { get; set; } - public int ?NumRecommenders { get; set; } - public string Honors { get; set; } - public List<LoginRadiusAward> Awards { get; set; } - public List<LoginRadiusSkill> Skills { get; set; } - public List<LoginRadiusCurrentStatus> CurrentStatus { get; set; } - public List<LoginRadiusCertification> Certifications { get; set; } - public List<LoginRadiusCourse> Courses { get; set; } - public List<LoginRadiusVolunteer> Volunteer { get; set; } - public List<LoginRadiusRecommendationReceived> RecommendationsReceived { get; set; } - public List<LoginRadiusLanguage> Languages { get; set; } - public List<LoginRadiusProject> Projects { get; set; } - public List<LoginRadiusGame> Games { get; set; } - public List<LoginRadiusFamily> Family { get; set; } - public List<LoginRadiusTelevisionShow> TeleVisionShow { get; set; } - public List<LoginRadiusMutualFriend> MutualFriends { get; set; } - public List<LoginRadiusMovie> Movies { get; set; } - public List<LoginRadiusBook> Books { get; set; } - public LoginRadiusAgeRange AgeRange { get; set; } - public string PublicRepository { get; set; } - public Boolean ?Hireable { get; set; } - public string RepositoryUrl { get; set; } - public string Age { get; set; } - public List<LoginRadiusPatent> Patents { get; set; } - public List<LoginRadiusFavoriteThing> FavoriteThings { get; set; } - public string ProfessionalHeadline { get; set; } - public ProviderAccessCredential ProviderAccessCredential { get; set; } - public List<LoginRadiusRelatedProfileViews> RelatedProfileViews { get; set; } - public LoginRadiusKloutProfile KloutScore { get; set; } - public List<LoginRadiusPlaceLived> PlacesLived { get; set; } - public List<LoginRadiusPublication> Publications { get; set; } - public List<LoginRadiusJobBookmark> JobBookmarks { get; set; } - public LoginRadiusSuggestion Suggestions { get; set; } - public List<LoginRadiusBadge> Badges { get; set; } - public List<LoginRadiusMemberUrlResource> MemberUrlResources { get; set; } - public List<LoginRadiusExternalIds> ExternalIds { get; set; } - public int ?TotalPrivateRepository { get; set; } - public string Currency { get; set; } - public string StarredUrl { get; set; } - public string GistsUrl { get; set; } - public int ?PublicGists { get; set; } - public int ?PrivateGists { get; set; } - public LoginRadiusUserSubscription Subscription { get; set; } - public string Company { get; set; } - public string GravatarImageUrl { get; set; } - public Dictionary<string, string> ProfileImageUrls { get; set; } - public Dictionary<string, string> WebProfiles { get; set; } - public string Password { get; set; } - public Dictionary<string, string> CustomFields { get; set; } - public bool ?IsEmailSubscribed { get; set; } - public string UserName { get; set; } - public string PhoneId { get; set; } - public bool ?PhoneIdVerified { get; set; } - public bool ?EmailVerified { get; set; } - public bool ?IsDeleted { get; set; } - } - - - public class SecurityQuestion: LoginRadiusSerializableObject - { - - public Dictionary<string, string> SecurityQuestionAnswer { get; set; } - } - - - public class SecurityQuestionAnswerPost : LoginRadiusSerializableObject - { - public Dictionary<string, string> SecurityQuestionAnswer { get; set; } - } - public class SecurityQuestionAnswer: LoginRadiusSerializableObject - { - public string MiddleName { get; set; } - public string PetName { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/LoginRadiusSocialUserProfile.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/LoginRadiusSocialUserProfile.cs deleted file mode 100755 index 999e467..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/LoginRadiusSocialUserProfile.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusSocialUserProfile : UserIdentityCreateModel - { - public string ID { get; set; } - public string Provider { get; set; } - public string Language { get; set; } - public string Verified { get; set; } - public string UpdatedTime { get; set; } - public string Created { get; set; } - public string PasswordExpirationDate { get; set; } - public string IsActive { get; set; } - public List<string> PreviousUids { get; set; } - public int ?PinsCount { get; set; } - public int ?BoardsCount { get; set; } - public int ?LikesCount { get; set; } - public DateTime SignupDate { get; set; } - public DateTime LastLoginDate { get; set; } - public bool? FirstLogin { get; set; } - public string LastLoginLocation { get; set; } - public string IsCustomUid { get; set; } - public string RegistrationProvider { get; set; } - public string RegistrationSource { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/LoginRadiusTraditionalUserProfile.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/LoginRadiusTraditionalUserProfile.cs deleted file mode 100755 index cca1a22..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/LoginRadiusTraditionalUserProfile.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusTraditionalUserProfile : LoginRadiusSocialUserProfile - { - public bool EmailVerified { get; set; } - public bool IsDeleted { get; set; } - public int NoOfLogins { get; set; } - public bool PhoneIdVerified { get; set; } - } -} diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/LoginRadiusUserIdentity.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/LoginRadiusUserIdentity.cs deleted file mode 100755 index 47d013e..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/LoginRadiusUserIdentity.cs +++ /dev/null @@ -1,163 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusUserIdentity : NullUpdate - { - - public string Password { get; set; } - public object LastPasswordChangeDate { get; set; } - public object PasswordExpirationDate { get; set; } - public object LastPasswordChangeToken { get; set; } - public bool EmailVerified { get; set; } - public bool IsActive { get; set; } - public bool IsDeleted { get; set; } - public string Uid { get; set; } - public Dictionary<string, string> CustomFields { get; set; } - public bool IsEmailSubscribed { get; set; } - public object UserName { get; set; } - public int NoOfLogins { get; set; } - public object PreviousUids { get; set; } - public object PhoneId { get; set; } - public bool PhoneIdVerified { get; set; } - public object ExternalUserLoginId { get; set; } - public string RegistrationProvider { get; set; } - public bool IsLoginLocked { get; set; } - public string LoginLockedType { get; set; } - public string LastLoginLocation { get; set; } - public string RegistrationSource { get; set; } - public bool IsCustomUid { get; set; } - public List<LoginRadiusEmail> UnverifiedEmail { get; set; } - public object IsSecurePassword { get; set; } - public PrivacyPolicy PrivacyPolicy { get; set; } - public List<LoginRadiusExternalIds> ExternalIds { get; set; } - public string ID { get; set; } - public string Provider { get; set; } - public string Prefix { get; set; } - public string FirstName { get; set; } - public string MiddleName { get; set; } - public string LastName { get; set; } - public object Suffix { get; set; } - public string FullName { get; set; } - public string NickName { get; set; } - public string ProfileName { get; set; } - public string BirthDate { get; set; } - public string Gender { get; set; } - public string Website { get; set; } - public List<LoginRadiusEmail> Email { get; set; } - public object Country { get; set; } - public string ThumbnailImageUrl { get; set; } - public string ImageUrl { get; set; } - public object Favicon { get; set; } - public string ProfileUrl { get; set; } - public string HomeTown { get; set; } - public object State { get; set; } - public string City { get; set; } - public object Industry { get; set; } - public string About { get; set; } - public string TimeZone { get; set; } - public string LocalLanguage { get; set; } - public string CoverPhoto { get; set; } - public object TagLine { get; set; } - public string Language { get; set; } - public string Verified { get; set; } - public string UpdatedTime { get; set; } - public List<LoginRadiusPosition> Positions { get; set; } - public List<LoginRadiusEducation> Educations { get; set; } - public object PhoneNumbers { get; set; } - public object IMAccounts { get; set; } - public object Addresses { get; set; } - public object MainAddress { get; set; } - public object Created { get; set; } - public DateTime CreatedDate { get; set; } - public DateTime ModifiedDate { get; set; } - public DateTime ProfileModifiedDate { get; set; } - public string LocalCity { get; set; } - public string ProfileCity { get; set; } - public string LocalCountry { get; set; } - public object ProfileCountry { get; set; } - public bool FirstLogin { get; set; } - public bool IsProtected { get; set; } - public string RelationshipStatus { get; set; } - public string Quota { get; set; } - public string Quote { get; set; } - public List<string> InterestedIn { get; set; } - public object Interests { get; set; } - public string Religion { get; set; } - public string Political { get; set; } - public List<LoginRadiusSport> Sports { get; set; } - public object InspirationalPeople { get; set; } - public string HttpsImageUrl { get; set; } - public int FollowersCount { get; set; } - public int FriendsCount { get; set; } - public object IsGeoEnabled { get; set; } - public int TotalStatusesCount { get; set; } - public object Associations { get; set; } - public int NumRecommenders { get; set; } - public object Honors { get; set; } - public object Awards { get; set; } - public object Skills { get; set; } - public object CurrentStatus { get; set; } - public object Certifications { get; set; } - public object Courses { get; set; } - public object Volunteer { get; set; } - public object RecommendationsReceived { get; set; } - public List<RemoveLanguage> Languages { get; set; } - public List<object> Projects { get; set; } - public List<LoginRadiusGame> Games { get; set; } - public object Family { get; set; } - public List<LoginRadiusTelevisionShow> TeleVisionShow { get; set; } - public object MutualFriends { get; set; } - public List<LoginRadiusMovie> Movies { get; set; } - public List<LoginRadiusBook> Books { get; set; } - public LoginRadiusAgeRange AgeRange { get; set; } - public object PublicRepository { get; set; } - public bool Hireable { get; set; } - public object RepositoryUrl { get; set; } - public string Age { get; set; } - public object Patents { get; set; } - public List<LoginRadiusFavoriteThing> FavoriteThings { get; set; } - public object ProfessionalHeadline { get; set; } - public ProviderAccessCredential ProviderAccessCredential { get; set; } - public object RelatedProfileViews { get; set; } - public object KloutScore { get; set; } - public object LRUserID { get; set; } - public object PlacesLived { get; set; } - public object Publications { get; set; } - public object JobBookmarks { get; set; } - public object Suggestions { get; set; } - public object Badges { get; set; } - public object MemberUrlResources { get; set; } - public int TotalPrivateRepository { get; set; } - public string Currency { get; set; } - public object StarredUrl { get; set; } - public object GistsUrl { get; set; } - public int PublicGists { get; set; } - public int PrivateGists { get; set; } - public object Subscription { get; set; } - public object Company { get; set; } - public string GravatarImageUrl { get; set; } - public Dictionary<string, string> ProfileImageUrls { get; set; } - public object WebProfiles { get; set; } - public int PinsCount { get; set; } - public int BoardsCount { get; set; } - public int LikesCount { get; set; } - public DateTime SignupDate { get; set; } - public DateTime LastLoginDate { get; set; } - public List<LoginRadiusSocialUserProfile> Identities { get; set; } - } - - - public class NullUpdate : LoginRadiusSocialUserProfile - { - public bool NullSupport { get; set; } - } - - public class PrivacyPolicy - { - public string Version { get; set; } - public string AcceptSource { get; set; } - public DateTime AcceptDateTime { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserIdentityCreateModel.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserIdentityCreateModel.cs deleted file mode 100755 index a71b4c0..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserIdentityCreateModel.cs +++ /dev/null @@ -1,121 +0,0 @@ -using System; -using System.Collections.Generic; -using LoginRadiusSDK.V2.Util.Serialization; - -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class UserIdentityCreateModel : LoginRadiusSerializableObject - { - public string Prefix { get; set; } - public string FirstName { get; set; } - public string MiddleName { get; set; } - public string LastName { get; set; } - public string Suffix { get; set; } - public string FullName { get; set; } - public string NickName { get; set; } - public string ProfileName { get; set; } - public string BirthDate { get; set; } - public string Gender { get; set; } - public string Website { get; set; } - public List<LoginRadiusEmail> Email { get; set; } - public List<LoginRadiusEmail> UnverifiedEmail { get; set; } - public LoginRadiusCountry Country { get; set; } - public string ThumbnailImageUrl { get; set; } - public string ImageUrl { get; set; } - public string Favicon { get; set; } - public string ProfileUrl { get; set; } - public string HomeTown { get; set; } - public string State { get; set; } - public string City { get; set; } - public string Industry { get; set; } - public string About { get; set; } - public string TimeZone { get; set; } - public string LocalLanguage { get; set; } - public string CoverPhoto { get; set; } - public string TagLine { get; set; } - public List<LoginRadiusPosition> Positions { get; set; } - public List<LoginRadiusEducation> Educations { get; set; } - public List<LoginRadiusPhoneNumber> PhoneNumbers { get; set; } - public List<LoginRadiusIMAccount> ImAccounts { get; set; } - public List<LoginRadiusAddress> Addresses { get; set; } - public string MainAddress { get; set; } - public string LocalCity { get; set; } - public string ProfileCity { get; set; } - public string LocalCountry { get; set; } - public string ProfileCountry { get; set; } - public bool IsProtected { get; set; } - public string RelationshipStatus { get; set; } - public string Quota { get; set; } - public List<string> InterestedIn { get; set; } - public List<LoginRadiusInterest> Interests { get; set; } - public string Religion { get; set; } - public string Political { get; set; } - public List<LoginRadiusSport> Sports { get; set; } - public List<LoginRadiusInspirationalPeople> InspirationalPeople { get; set; } - - public string HttpsImageUrl { get; set; } - public int FollowersCount { get; set; } - public int FriendsCount { get; set; } - public string IsGeoEnabled { get; set; } - public int TotalStatusesCount { get; set; } - public string Associations { get; set; } - public int NumRecommenders { get; set; } - public string Honors { get; set; } - public List<LoginRadiusAward> Awards { get; set; } - public List<LoginRadiusSkill> Skills { get; set; } - public List<LoginRadiusCurrentStatus> CurrentStatus { get; set; } - public List<LoginRadiusCertification> Certifications { get; set; } - public List<LoginRadiusCourse> Courses { get; set; } - public List<LoginRadiusVolunteer> Volunteer { get; set; } - public List<LoginRadiusRecommendationReceived> RecommendationsReceived { get; set; } - //public List<LoginRadiusLanguage> Languages { get; set; } - public virtual List<RemoveLanguage> Languages { get; set; } - public List<LoginRadiusProject> Projects { get; set; } - public List<LoginRadiusGame> Games { get; set; } - public List<LoginRadiusFamily> Family { get; set; } - public List<LoginRadiusTelevisionShow> TeleVisionShow { get; set; } - public List<LoginRadiusMutualFriend> MutualFriends { get; set; } - public List<LoginRadiusMovie> Movies { get; set; } - public List<LoginRadiusBook> Books { get; set; } - public LoginRadiusAgeRange AgeRange { get; set; } - public string PublicRepository { get; set; } - public Boolean ? Hireable { get; set; } - public string RepositoryUrl { get; set; } - public string Age { get; set; } - public List<LoginRadiusPatent> Patents { get; set; } - public List<LoginRadiusFavoriteThing> FavoriteThings { get; set; } - public string ProfessionalHeadline { get; set; } - public ProviderAccessCredential ProviderAccessCredential { get; set; } - public List<LoginRadiusRelatedProfileViews> RelatedProfileViews { get; set; } - public LoginRadiusKloutProfile KloutScore { get; set; } - public List<LoginRadiusPlaceLived> PlacesLived { get; set; } - public List<LoginRadiusPublication> Publications { get; set; } - public List<LoginRadiusJobBookmark> JobBookmarks { get; set; } - public LoginRadiusSuggestion Suggestions { get; set; } - public List<LoginRadiusBadge> Badges { get; set; } - public List<LoginRadiusMemberUrlResource> MemberUrlResources { get; set; } - public int TotalPrivateRepository { get; set; } - public string Currency { get; set; } - public string StarredUrl { get; set; } - public string GistsUrl { get; set; } - public int PublicGists { get; set; } - public int PrivateGists { get; set; } - public LoginRadiusUserSubscription Subscription { get; set; } - public string Company { get; set; } - public string GravatarImageUrl { get; set; } - public Dictionary<string, string> ProfileImageUrls { get; set; } - public Dictionary<string, string> WebProfiles { get; set; } - public string Password { get; set; } - public string Uid { get; set; } - public Dictionary<string, string> CustomFields { get; set; } - public bool? IsEmailSubscribed { get; set; } - public string UserName { get; set; } - public string PhoneId { get; set; } - public Dictionary<string, string> SecurityQuestionAnswer { get; set; } - public bool IsTwoFactorAuthenticationEnabled { get; set; } - public string ExternalUserLoginId { get; set; } - public bool? AcceptPrivacyPolicy { get; set; } - public bool EmailVerified { get; set; } - public bool PhoneIdVerified { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusAddress.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusAddress.cs deleted file mode 100755 index 8017c56..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusAddress.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusAddress - { - public string Type { get; set; } - public string Address1 { get; set; } - public string Address2 { get; set; } - public string City { get; set; } - public string State { get; set; } - public string PostalCode { get; set; } - public string Region { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusAgeRange.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusAgeRange.cs deleted file mode 100755 index 20c133d..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusAgeRange.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusAgeRange - { - public int ?Min { get; set; } - public int ?Max { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusAward.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusAward.cs deleted file mode 100755 index b4b3935..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusAward.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusAward - { - /// <summary> - /// Linkedin : <id/> node - /// </summary> - public string Id { get; set; } - - /// <summary> - /// Linkedin : <name/> node - /// </summary> - public string Name { get; set; } - - /// <summary> - /// Linkedin : <proficiency/> node - /// </summary> - public string Issuer { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusBadge.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusBadge.cs deleted file mode 100755 index da6e995..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusBadge.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusBadge - { - public string BageId { get; set; } - public string Name { get; set; } - public string BageMessage { get; set; } - public string Description { get; set; } - public string ImageUrl { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusBook.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusBook.cs deleted file mode 100755 index a008239..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusBook.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusBook - { - public string Id { get; set; } - public string Category { get; set; } - public string Name { get; set; } - public string CreatedDate { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusCertification.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusCertification.cs deleted file mode 100755 index 5d5bd63..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusCertification.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusCertification - { - public string Id { get; set; } - public string Name { get; set; } - public string Authority { get; set; } - public string Number { get; set; } - public string StartDate { get; set; } - public string EndDate { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusCountry.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusCountry.cs deleted file mode 100755 index e1def87..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusCountry.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusCountry - { - public string Code { get; set; } - public string Name { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusCourse.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusCourse.cs deleted file mode 100755 index ff484f5..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusCourse.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusCourse - { - public string Id { get; set; } - public string Name { get; set; } - public string Number { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusCurrentStatus.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusCurrentStatus.cs deleted file mode 100755 index 3e623f8..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusCurrentStatus.cs +++ /dev/null @@ -1,25 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusCurrentStatus - { - /// <summary> - /// Linkedin : <id/> node - /// </summary> - public string Id { get; set; } - - /// <summary> - /// Linkedin : <name/> node - /// </summary> - public string Text { get; set; } - - /// <summary> - /// Linkedin : <proficiency/> node - /// </summary> - public string Source { get; set; } - - /// <summary> - /// Linkedin : <proficiency/> node - /// </summary> - public string CreatedDate { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusEducation.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusEducation.cs deleted file mode 100755 index 161eed1..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusEducation.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusEducation - { - public string School { get; set; } - public string Year { get; set; } - public string Type { get; set; } - public string Notes { get; set; } - public string Activities { get; set; } - public string Degree { get; set; } - public string FieldOfStudy { get; set; } - public string StartDate { get; set; } - public string EndDate { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusEmail.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusEmail.cs deleted file mode 100755 index c251354..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusEmail.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusEmail - { - public string Type { get; set; } - public string Value { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusExternalIds.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusExternalIds.cs deleted file mode 100644 index 52f10c1..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusExternalIds.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusExternalIds - { - public string SourceId { get; set; } - public string Source { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusFamily.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusFamily.cs deleted file mode 100755 index 3a9f604..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusFamily.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusFamily - { - public string Id { get; set; } - public string Relationship { get; set; } - public string Name { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusFavoriteAthlete.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusFavoriteAthlete.cs deleted file mode 100755 index 0bec776..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusFavoriteAthlete.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusFavoriteAthlete - { - public string Id { get; set; } - public string Name { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusFavoriteTeam.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusFavoriteTeam.cs deleted file mode 100755 index ac56cc2..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusFavoriteTeam.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusFavoriteTeam - { - public string Id { get; set; } - public string Name { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusFavoriteThing.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusFavoriteThing.cs deleted file mode 100755 index e44abf0..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusFavoriteThing.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusFavoriteThing - { - public string Id { get; set; } - public string Name { get; set; } - public string Type { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusGame.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusGame.cs deleted file mode 100755 index 3f3285f..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusGame.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusGame - { - public string Id { get; set; } - public string Category { get; set; } - public string Name { get; set; } - public string CreatedDate { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusIMAccount.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusIMAccount.cs deleted file mode 100755 index 662542a..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusIMAccount.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusIMAccount - { - public string AccountType { get; set; } - public string AccountName { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusInterest.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusInterest.cs deleted file mode 100755 index 880bc4c..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusInterest.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusInterest - { - public string InterestedType { get; set; } - public string InterestedName { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusJobBookmark.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusJobBookmark.cs deleted file mode 100755 index e1e2ed3..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusJobBookmark.cs +++ /dev/null @@ -1,32 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusJobBookmark - { - public bool ?IsApplied { get; set; } - public string ApplyTimestamp { get; set; } - public bool ?IsSaved { get; set; } - public string SavedTimestamp { get; set; } - public LoginRadiusJob Job { get; set; } - } - - public class LoginRadiusJob - { - public bool ?Active { get; set; } - public string Id { get; set; } - public string DescriptionSnippet { get; set; } - public LoginRadiusJobBookmarkCompany Compony { get; set; } - public LoginRadiusJobBookmarkPosition Position { get; set; } - public string PostingTimestamp { get; set; } - } - - public class LoginRadiusJobBookmarkCompany - { - public string Id { get; set; } - public string Name { get; set; } - } - - public class LoginRadiusJobBookmarkPosition - { - public string Title { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusKloutProfile.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusKloutProfile.cs deleted file mode 100755 index 04ee84c..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusKloutProfile.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusKloutProfile - { - public string KloutId { get; set; } - public double Score { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusLanguage.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusLanguage.cs deleted file mode 100755 index 7ec502f..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusLanguage.cs +++ /dev/null @@ -1,26 +0,0 @@ -using LoginRadiusSDK.V2.Models.CustomerManagement.UserProfile.UserProfileSubModels; - -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusLanguage - { - public string Id { get; set; } - public string Name { get; set; } - public string proficiency { get; set; } - } - - public class RemoveLanguage : LoginRadiusLanguage - { - public string op { get; set; } - } - - - public class PostResponse - { - public string IsPosted { get; set; } - public LoginRadiusUpdateProfileResponse Data { get; set; } - } - - -} - diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusMemberUrlResource.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusMemberUrlResource.cs deleted file mode 100755 index f0c41a4..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusMemberUrlResource.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusMemberUrlResource - { - public string Url { get; set; } - public string UrlName { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusMovie.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusMovie.cs deleted file mode 100755 index c6f9410..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusMovie.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusMovie - { - public string Id { get; set; } - public string Category { get; set; } - public string Name { get; set; } - public string CreatedDate { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusMutualFriend.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusMutualFriend.cs deleted file mode 100755 index 8b1bae6..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusMutualFriend.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusMutualFriend - { - public string Id { get; set; } - public string Name { get; set; } - public string FirstName { get; set; } - public string LastName { get; set; } - public string Birthday { get; set; } - public string Hometown { get; set; } - public string Link { get; set; } - public string Gender { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusNameId.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusNameId.cs deleted file mode 100755 index 7782917..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusNameId.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusNameId - { - public string Id { get; set; } - public string Name { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusPatent.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusPatent.cs deleted file mode 100755 index 3fb8306..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusPatent.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusPatent - { - /// <summary> - /// Linkedin : <id/> node - /// </summary> - public string Id { get; set; } - - /// <summary> - /// Linkedin : <title/> node - /// </summary> - public string Title { get; set; } - - /// <summary> - /// Linkedin : <date/> node - /// </summary> - public string Date { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusPhoneNumber.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusPhoneNumber.cs deleted file mode 100755 index 9d39a1b..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusPhoneNumber.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusPhoneNumber - { - public string PhoneType { get; set; } - - public string PhoneNumber { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusPlaceLived.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusPlaceLived.cs deleted file mode 100755 index 24daf47..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusPlaceLived.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusPlaceLived - { - public string Name { get; set; } - public bool ?IsPrimary { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusPosition.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusPosition.cs deleted file mode 100755 index 9601f3e..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusPosition.cs +++ /dev/null @@ -1,43 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusPosition - { - /// <summary> - /// Facebook : position and Linkedin : <title/> node - /// </summary> - public string Position { get; set; } - - /// <summary/> - /// Facebook : description and Linkedin : <summary> node - /// </summary> - public string Summary { get; set; } - - /// <summary> - /// Facebook : start_date and Linkedin : <start-date/> node - /// </summary> - public string StartDate { get; set; } - - /// <summary> - /// Facebook : end_date and Linkedin : <end-date/> node - /// </summary> - public string EndDate { get; set; } - - /// <summary> - /// Facebook : logic (if end date is null then isCurrent true) and Linkedin : <is-current/> node - /// </summary> - public string IsCurrent { get; set; } - - public LoginRadiusPositionCompany Comapny { get; set; } - - public LoginRadiusPositionCompany Company - { - get { return Comapny; } - set { Comapny = value; } - } - - /// <summary> - /// Facebook : work.location - /// </summary> - public string Location { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusPositionCompany.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusPositionCompany.cs deleted file mode 100755 index 30598a2..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusPositionCompany.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusPositionCompany - { - /// <summary> - /// Facebook : employer and Linkedin : <company/><name/> node - /// </summary> - public string Name { get; set; } - - /// <summary> - /// Linkedin : <company/><type/> node - /// </summary> - public string Type { get; set; } - - /// <summary> - /// Linkedin : <company/><industry/> node - /// </summary> - public string Industry { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusProfileImageUrls.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusProfileImageUrls.cs deleted file mode 100755 index 1e171c8..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusProfileImageUrls.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusProfileImageUrls - { - public string Small { get; set; } - public string Square { get; set; } - public string Large { get; set; } - public string Profile { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusProject.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusProject.cs deleted file mode 100755 index b3a6ce2..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusProject.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Collections.Generic; - -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusProject - { - public string Id { get; set; } - public string Name { get; set; } - public string Summary { get; set; } - public List<LoginRadiusNameId> With { get; set; } - public string StartDate { get; set; } - public string EndDate { get; set; } - public string IsCurrent { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusPublication.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusPublication.cs deleted file mode 100755 index 5f8c755..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusPublication.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.Collections.Generic; - -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusPublication - { - public string Id { get; set; } - - public string Title { get; set; } - - public string Publisher { get; set; } - - public List<LoginRadiusPublicationsAuthors> Authors { get; set; } - - public string Date { get; set; } - - public string Url { get; set; } - - public string Summary { get; set; } - } - - public class LoginRadiusPublicationsAuthors - { - public string Id { get; set; } - - public string Name { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusRecommendationReceived.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusRecommendationReceived.cs deleted file mode 100755 index 58ab408..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusRecommendationReceived.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusRecommendationReceived - { - public string Id { get; set; } - public string RecommendationType { get; set; } - public string RecommendationText { get; set; } - public string Recommender { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusRelatedProfileViews.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusRelatedProfileViews.cs deleted file mode 100755 index a087a42..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusRelatedProfileViews.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusRelatedProfileViews - { - public string FirstName { get; set; } - public string LastName { get; set; } - public string Id { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusSkill.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusSkill.cs deleted file mode 100755 index 8009060..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusSkill.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusSkill - { - /// <summary> - /// Linkedin : <id/> node - /// </summary> - public string Id { get; set; } - - /// <summary> - /// Linkedin : <name/> node - /// </summary> - public string Name { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusSport.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusSport.cs deleted file mode 100755 index 3add039..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusSport.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusSport - { - public string Id { get; set; } - public string Name { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusSuggestion.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusSuggestion.cs deleted file mode 100755 index 9fa471c..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusSuggestion.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Collections.Generic; - -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusSuggestion - { - public List<LoginRadiusNameId> CompaniestoFollow { get; set; } - public List<LoginRadiusNameId> IndustriestoFollow { get; set; } - public List<LoginRadiusNameId> NewssourcetoFollow { get; set; } - public List<LoginRadiusNameId> PeopletoFollow { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusTelevisionShow.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusTelevisionShow.cs deleted file mode 100755 index 435ac1b..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusTelevisionShow.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusTelevisionShow - { - public string Id { get; set; } - public string Category { get; set; } - public string Name { get; set; } - public string CreatedDate { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusUpdateProfileResponse.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusUpdateProfileResponse.cs deleted file mode 100755 index 4b26675..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusUpdateProfileResponse.cs +++ /dev/null @@ -1,138 +0,0 @@ -using LoginRadiusSDK.V2.Models.UserProfile; -using System; -using System.Collections.Generic; - -namespace LoginRadiusSDK.V2.Models.CustomerManagement.UserProfile.UserProfileSubModels -{ - public class LoginRadiusUpdateProfileResponse - { - public bool ?EmailVerified { get; set; } - public bool ?IsDeleted { get; set; } - public int ?NoOfLogins { get; set; } - public bool ?PhoneIdVerified { get; set; } - public string ID { get; set; } - public string Provider { get; set; } - public string Language { get; set; } - public string Verified { get; set; } - public string UpdatedTime { get; set; } - public string Created { get; set; } - public string PasswordExpirationDate { get; set; } - public string IsActive { get; set; } - public List<string> PreviousUids { get; set; } - public int ?PinsCount { get; set; } - public int ?BoardsCount { get; set; } - public int ?LikesCount { get; set; } - public DateTime SignupDate { get; set; } - public DateTime LastLoginDate { get; set; } - public bool ?FirstLogin { get; set; } - public string LastLoginLocation { get; set; } - public string IsCustomUid { get; set; } - public string RegistrationProvider { get; set; } - public string RegistrationSource { get; set; } - public string Prefix { get; set; } - public string FirstName { get; set; } - public string MiddleName { get; set; } - public string LastName { get; set; } - public string Suffix { get; set; } - public string FullName { get; set; } - public string NickName { get; set; } - public string ProfileName { get; set; } - public string BirthDate { get; set; } - public string Gender { get; set; } - public string Website { get; set; } - public List<LoginRadiusEmail> Email { get; set; } - public List<LoginRadiusEmail> UnverifiedEmail { get; set; } - public LoginRadiusCountry Country { get; set; } - public string ThumbnailImageUrl { get; set; } - public string ImageUrl { get; set; } - public string Favicon { get; set; } - public string ProfileUrl { get; set; } - public string HomeTown { get; set; } - public string State { get; set; } - public string City { get; set; } - public string Industry { get; set; } - public string About { get; set; } - public string TimeZone { get; set; } - public string LocalLanguage { get; set; } - public string CoverPhoto { get; set; } - public string TagLine { get; set; } - public List<LoginRadiusPosition> Positions { get; set; } - public List<LoginRadiusEducation> Educations { get; set; } - public List<LoginRadiusPhoneNumber> PhoneNumbers { get; set; } - public List<LoginRadiusIMAccount> ImAccounts { get; set; } - public List<LoginRadiusAddress> Addresses { get; set; } - public string MainAddress { get; set; } - public string LocalCity { get; set; } - public string ProfileCity { get; set; } - public string LocalCountry { get; set; } - public string ProfileCountry { get; set; } - public bool ?IsProtected { get; set; } - public string RelationshipStatus { get; set; } - public string Quota { get; set; } - public List<string> InterestedIn { get; set; } - public List<LoginRadiusInterest> Interests { get; set; } - public string Religion { get; set; } - public string Political { get; set; } - public List<LoginRadiusSport> Sports { get; set; } - public List<LoginRadiusInspirationalPeople> InspirationalPeople { get; set; } - public string HttpsImageUrl { get; set; } - public int ?FollowersCount { get; set; } - public int ?FriendsCount { get; set; } - public string IsGeoEnabled { get; set; } - public int ?TotalStatusesCount { get; set; } - public string Associations { get; set; } - public int ?NumRecommenders { get; set; } - public string Honors { get; set; } - public List<LoginRadiusAward> Awards { get; set; } - public List<LoginRadiusSkill> Skills { get; set; } - public List<LoginRadiusCurrentStatus> CurrentStatus { get; set; } - public List<LoginRadiusCertification> Certifications { get; set; } - public List<LoginRadiusCourse> Courses { get; set; } - public List<LoginRadiusVolunteer> Volunteer { get; set; } - public List<LoginRadiusRecommendationReceived> RecommendationsReceived { get; set; } - public List<LoginRadiusLanguage> Languages { get; set; } - public List<LoginRadiusProject> Projects { get; set; } - public List<LoginRadiusGame> Games { get; set; } - public List<LoginRadiusFamily> Family { get; set; } - public List<LoginRadiusTelevisionShow> TeleVisionShow { get; set; } - public List<LoginRadiusMutualFriend> MutualFriends { get; set; } - public List<LoginRadiusMovie> Movies { get; set; } - public List<LoginRadiusBook> Books { get; set; } - public LoginRadiusAgeRange AgeRange { get; set; } - public string PublicRepository { get; set; } - public Boolean ?Hireable { get; set; } - public string RepositoryUrl { get; set; } - public string Age { get; set; } - public List<LoginRadiusPatent> Patents { get; set; } - public List<LoginRadiusFavoriteThing> FavoriteThings { get; set; } - public string ProfessionalHeadline { get; set; } - public ProviderAccessCredential ProviderAccessCredential { get; set; } - public List<LoginRadiusRelatedProfileViews> RelatedProfileViews { get; set; } - public LoginRadiusKloutProfile KloutScore { get; set; } - public List<LoginRadiusPlaceLived> PlacesLived { get; set; } - public List<LoginRadiusPublication> Publications { get; set; } - public List<LoginRadiusJobBookmark> JobBookmarks { get; set; } - public LoginRadiusSuggestion Suggestions { get; set; } - public List<LoginRadiusBadge> Badges { get; set; } - public List<LoginRadiusMemberUrlResource> MemberUrlResources { get; set; } - public int ?TotalPrivateRepository { get; set; } - public string Currency { get; set; } - public string StarredUrl { get; set; } - public string GistsUrl { get; set; } - public int ?PublicGists { get; set; } - public int ?PrivateGists { get; set; } - public LoginRadiusUserSubscription Subscription { get; set; } - public string Company { get; set; } - public string GravatarImageUrl { get; set; } - public Dictionary<string, string> ProfileImageUrls { get; set; } - public Dictionary<string, string> WebProfiles { get; set; } - public string Password { get; set; } - public string Uid { get; set; } - public Dictionary<string, string> CustomFields { get; set; } - public bool ?IsEmailSubscribed { get; set; } - public string UserName { get; set; } - public string PhoneId { get; set; } - public Dictionary<string, string> SecurityQuestionAnswer { get; set; } - public bool ?IsTwoFactorAuthenticationEnabled { get; set; } - } -} diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusUserSubscription.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusUserSubscription.cs deleted file mode 100755 index 47c68f9..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginRadiusUserSubscription.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusUserSubscription - { - public string Name { get; set; } - public string Space { get; set; } - public string PrivateRepos { get; set; } - public string Collaborators { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginradiusInspirationalPeople.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginradiusInspirationalPeople.cs deleted file mode 100755 index 2c295b2..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginradiusInspirationalPeople.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusInspirationalPeople - { - public string Id { get; set; } - public string Name { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginradiusInterested.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginradiusInterested.cs deleted file mode 100755 index d0cf120..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginradiusInterested.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusInterested - { - public string InterestedIn { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginradiusVolunteer.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginradiusVolunteer.cs deleted file mode 100755 index 4f24c71..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/LoginradiusVolunteer.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class LoginRadiusVolunteer - { - public string Id { get; set; } - public string Role { get; set; } - public string Organization { get; set; } - public string Cause { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/ProviderAccessCredential.cs b/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/ProviderAccessCredential.cs deleted file mode 100755 index 1f7ac79..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerManagement/UserProfile/UserProfileSubModels/ProviderAccessCredential.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.UserProfile -{ - public class ProviderAccessCredential - { - public string AccessToken { get; set; } - public string TokenSecret { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/CustomerRegistrationAuthentication.cs b/Source/LoginRadiusSDK.V2/Models/CustomerRegistrationAuthentication.cs deleted file mode 100755 index 0e9088a..0000000 --- a/Source/LoginRadiusSDK.V2/Models/CustomerRegistrationAuthentication.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace LoginRadiusSDK.V2.Models -{ - public class CustomerRegistrationAuthentication - { - public string UserRegistrationKey { get; set; } - public string UserRegistrationSecret { get; set; } - public string UserRegistrationApiRequestSigning { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/Enums/CustomObjectUpdateOperationType.cs b/Source/LoginRadiusSDK.V2/Models/Enums/CustomObjectUpdateOperationType.cs new file mode 100644 index 0000000..e10cd2f --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/Enums/CustomObjectUpdateOperationType.cs @@ -0,0 +1,23 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +namespace LoginRadiusSDK.V2.Models.Enums + +{ + + /// <summary> + /// Enum Custom Object Operation Type to define the type of update + /// </summary> + public enum CustomObjectUpdateOperationType + { + Default, + + Replace, + + PartialReplace + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/Enums/OperationType.cs b/Source/LoginRadiusSDK.V2/Models/Enums/OperationType.cs new file mode 100644 index 0000000..ad4461e --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/Enums/OperationType.cs @@ -0,0 +1,19 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +namespace LoginRadiusSDK.V2.Models.Enums + +{ + + /// <summary> + /// Enum Operation Type to define the type of operation on parameters like address, phone etc + /// </summary> + public enum OperationType + { + delete + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/LoginRadiusApiResponse.cs b/Source/LoginRadiusSDK.V2/Models/LoginRadiusApiResponse.cs deleted file mode 100755 index 2c83c80..0000000 --- a/Source/LoginRadiusSDK.V2/Models/LoginRadiusApiResponse.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace LoginRadiusSDK.V2.Models -{ - public class LoginRadiusApiResponse<T> where T : class - { - public T data { get; set; } - public bool? signin { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/LoginRadiusBlockUnblockModel.cs b/Source/LoginRadiusSDK.V2/Models/LoginRadiusBlockUnblockModel.cs deleted file mode 100755 index ae84af0..0000000 --- a/Source/LoginRadiusSDK.V2/Models/LoginRadiusBlockUnblockModel.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace LoginRadiusSDK.V2.Models -{ - public class LoginRadiusBlockUnblockModel - { - public bool? IsBlock { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/LoginRadiusCountResponse.cs b/Source/LoginRadiusSDK.V2/Models/LoginRadiusCountResponse.cs deleted file mode 100755 index c245104..0000000 --- a/Source/LoginRadiusSDK.V2/Models/LoginRadiusCountResponse.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace LoginRadiusSDK.V2.Models -{ - public class LoginRadiusCountResponse<T> where T : class - { - public int? Count { get; set; } - public T Data { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/LoginRadiusCursorResponse.cs b/Source/LoginRadiusSDK.V2/Models/LoginRadiusCursorResponse.cs deleted file mode 100755 index a69104b..0000000 --- a/Source/LoginRadiusSDK.V2/Models/LoginRadiusCursorResponse.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Collections.Generic; - -namespace LoginRadiusSDK.V2.Models -{ - public class LoginRadiusCursorResponse<T> - { - public List<T> Data { get; set; } - public string NextCursor { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/LoginRadiusDeleteResponse.cs b/Source/LoginRadiusSDK.V2/Models/LoginRadiusDeleteResponse.cs deleted file mode 100755 index 6f4b8cc..0000000 --- a/Source/LoginRadiusSDK.V2/Models/LoginRadiusDeleteResponse.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace LoginRadiusSDK.V2.Models -{ - public class LoginRadiusDeleteResponse - { - public bool IsDeleted { get; set; } - } - - - public class CustomerRegistrationDeleteResponse - { - public string IsDeleteRequestAccepted { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/LoginRadiusExistsResponse.cs b/Source/LoginRadiusSDK.V2/Models/LoginRadiusExistsResponse.cs deleted file mode 100644 index ca90d87..0000000 --- a/Source/LoginRadiusSDK.V2/Models/LoginRadiusExistsResponse.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace LoginRadiusSDK.V2.Models -{ - public class LoginRadiusExistsResponse - { - public bool? IsExist { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/LoginRadiusPostResponse.cs b/Source/LoginRadiusSDK.V2/Models/LoginRadiusPostResponse.cs deleted file mode 100755 index 15bfe4e..0000000 --- a/Source/LoginRadiusSDK.V2/Models/LoginRadiusPostResponse.cs +++ /dev/null @@ -1,24 +0,0 @@ -using LoginRadiusSDK.V2.Models.UserProfile; - -namespace LoginRadiusSDK.V2.Models -{ - public class LoginRadiusPostResponse - { - public bool IsPosted { get; set; } - } - - public class LoginRadiusPostResponse<T> : LoginRadiusPostResponse - { - public T Data { get; set; } - } - - - public class Data - { - public string Email { get; set; } - public LoginRadiusUserIdentity Profile { get; set; } - public string access_token { get; set; } - public string refresh_token { get; set; } - public string expires_in { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RegistrationData/AddRegistrationDataModel.cs b/Source/LoginRadiusSDK.V2/Models/RegistrationData/AddRegistrationDataModel.cs deleted file mode 100755 index 3791ac9..0000000 --- a/Source/LoginRadiusSDK.V2/Models/RegistrationData/AddRegistrationDataModel.cs +++ /dev/null @@ -1,22 +0,0 @@ -using LoginRadiusSDK.V2.Util.Serialization; -using System; -using System.Collections.Generic; -using System.Text; - -namespace LoginRadiusSDK.V2.Models.RegistrationData -{ - - public class data { - public string Type { get; set; } - public string Key { get; set; } - public string Value { get; set; } - public object ParentId { get; set; } - public string Code { get; set; } - public bool IsActive { get; set; } - } - - public class AddRegistrationDataModel : LoginRadiusSerializableObject - { - public List<data> Data { get; set; } - } -} diff --git a/Source/LoginRadiusSDK.V2/Models/RegistrationData/GetRegistrationDataResponse.cs b/Source/LoginRadiusSDK.V2/Models/RegistrationData/GetRegistrationDataResponse.cs deleted file mode 100755 index c51a537..0000000 --- a/Source/LoginRadiusSDK.V2/Models/RegistrationData/GetRegistrationDataResponse.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace LoginRadiusSDK.V2.Models.RegistrationData -{ - public class GetRegistrationDataResponse - { - public string Code { get; set; } - public string Id { get; set; } - public DateTime DateCreated { get; set; } - public DateTime DateModified { get; set; } - public bool IsActive { get; set; } - public string Type { get; set; } - public string Key { get; set; } - public string Value { get; set; } - public object ParentId { get; set; } - public object ParentType { get; set; } - } -} diff --git a/Source/LoginRadiusSDK.V2/Models/RegistrationData/UpdateRegistrationDataModel.cs b/Source/LoginRadiusSDK.V2/Models/RegistrationData/UpdateRegistrationDataModel.cs deleted file mode 100755 index f718600..0000000 --- a/Source/LoginRadiusSDK.V2/Models/RegistrationData/UpdateRegistrationDataModel.cs +++ /dev/null @@ -1,19 +0,0 @@ -using LoginRadiusSDK.V2.Util.Serialization; -using System; -using System.Collections.Generic; -using System.Text; - -namespace LoginRadiusSDK.V2.Models.RegistrationData -{ - public class UpdateRegistrationDataModel : LoginRadiusSerializableObject - { - - public string Type { get; set; } - public string Key { get; set; } - public string Value { get; set; } - public object ParentId { get; set; } - public string Code { get; set; } - public bool IsActive { get; set; } - - } -} diff --git a/Source/LoginRadiusSDK.V2/Models/RegistrationData/UpdateRegistrationDataResponse.cs b/Source/LoginRadiusSDK.V2/Models/RegistrationData/UpdateRegistrationDataResponse.cs deleted file mode 100755 index e1a22c2..0000000 --- a/Source/LoginRadiusSDK.V2/Models/RegistrationData/UpdateRegistrationDataResponse.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace LoginRadiusSDK.V2.Models.RegistrationData -{ - public class Data - { - public string Code { get; set; } - public string Id { get; set; } - public DateTime DateCreated { get; set; } - public DateTime DateModified { get; set; } - public bool IsActive { get; set; } - public string Type { get; set; } - public string Key { get; set; } - public string Value { get; set; } - public object ParentId { get; set; } - public object ParentType { get; set; } - } - - public class UpdateRegistrationDataResponse - { - public bool IsPosted { get; set; } - public Data Data { get; set; } - } -} diff --git a/Source/LoginRadiusSDK.V2/Models/RegistrationData/ValidateSecretCodeResponse.cs b/Source/LoginRadiusSDK.V2/Models/RegistrationData/ValidateSecretCodeResponse.cs deleted file mode 100755 index d635d78..0000000 --- a/Source/LoginRadiusSDK.V2/Models/RegistrationData/ValidateSecretCodeResponse.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace LoginRadiusSDK.V2.Models.RegistrationData -{ - public class ValidateSecretCodeResponse - { - public bool IsValid { get; set; } - } -} diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/AccountCreateModel.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/AccountCreateModel.cs new file mode 100644 index 0000000..738d45b --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/AccountCreateModel.cs @@ -0,0 +1,49 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition of payload for Account Create API + /// </summary> + public class AccountCreateModel:AuthUserRegistrationModel + { + /// <summary> + /// To disable traditional login for user + /// </summary> + [JsonProperty(PropertyName = "DisableLogin")] + public bool? DisableLogin {get;set;} + + /// <summary> + /// boolean type value, default is true + /// </summary> + [JsonProperty(PropertyName = "EmailVerified")] + public bool? EmailVerified {get;set;} + + /// <summary> + /// boolean type value, default is false + /// </summary> + [JsonProperty(PropertyName = "PhoneIdVerified")] + public bool? PhoneIdVerified {get;set;} + + /// <summary> + /// Object type by default false, string represents Version, AcceptSource and datetime represents AcceptDateTime + /// </summary> + [JsonProperty(PropertyName = "PrivacyPolicy")] + public PrivacyPolicy PrivacyPolicy {get;set;} + + /// <summary> + /// URL of the webproperty from where the user is registered. + /// </summary> + [JsonProperty(PropertyName = "RegistrationSource")] + public string RegistrationSource {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/AccountRoleContextModel.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/AccountRoleContextModel.cs new file mode 100644 index 0000000..1bcfa13 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/AccountRoleContextModel.cs @@ -0,0 +1,26 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System.Collections.Generic; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition of RoleContext payload + /// </summary> + public class AccountRoleContextModel + { + /// <summary> + /// Array of RoleContext object, see body tab for structure + /// </summary> + [JsonProperty(PropertyName = "RoleContext")] + public List<RoleContextRoleModel> RoleContext {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/AccountRolesModel.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/AccountRolesModel.cs new file mode 100644 index 0000000..ead6f59 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/AccountRolesModel.cs @@ -0,0 +1,26 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System.Collections.Generic; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition of payload for Create Role API + /// </summary> + public class AccountRolesModel + { + /// <summary> + /// Array of String, which represents the role name + /// </summary> + [JsonProperty(PropertyName = "Roles")] + public List<string> Roles {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/AccountUserProfileUpdateModel.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/AccountUserProfileUpdateModel.cs new file mode 100644 index 0000000..89e83a2 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/AccountUserProfileUpdateModel.cs @@ -0,0 +1,74 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System.Collections.Generic; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition of payload for Account Update API + /// </summary> + public class AccountUserProfileUpdateModel:UserProfileUpdateModel + { + /// <summary> + /// To disable traditional login for user + /// </summary> + [JsonProperty(PropertyName = "DisableLogin")] + public bool? DisableLogin {get;set;} + + /// <summary> + /// boolean type value, default is true + /// </summary> + [JsonProperty(PropertyName = "EmailVerified")] + public bool? EmailVerified {get;set;} + + /// <summary> + /// Array of Objects,string represents SourceId,Source + /// </summary> + [JsonProperty(PropertyName = "ExternalIds")] + public List<ExternalIds> ExternalIds {get;set;} + + /// <summary> + /// boolean type value, default is true + /// </summary> + [JsonProperty(PropertyName = "IsActive")] + public bool? IsActive {get;set;} + + /// <summary> + /// boolean type value, default is true + /// </summary> + [JsonProperty(PropertyName = "IsDeleted")] + public bool? IsDeleted {get;set;} + + /// <summary> + /// Pass true if wants to lock the user's Login field else false. + /// </summary> + [JsonProperty(PropertyName = "IsLoginLocked")] + public bool? IsLoginLocked {get;set;} + + /// <summary> + /// boolean type value, default is false + /// </summary> + [JsonProperty(PropertyName = "PhoneIdVerified")] + public bool? PhoneIdVerified {get;set;} + + /// <summary> + /// Object type by default false, string represents Version, AcceptSource and datetime represents AcceptDateTime + /// </summary> + [JsonProperty(PropertyName = "PrivacyPolicy")] + public PrivacyPolicy PrivacyPolicy {get;set;} + + /// <summary> + /// URL of the webproperty from where the user is registered. + /// </summary> + [JsonProperty(PropertyName = "RegistrationSource")] + public string RegistrationSource {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/Address.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/Address.cs new file mode 100644 index 0000000..213e487 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/Address.cs @@ -0,0 +1,74 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +using LoginRadiusSDK.V2.Models.Enums; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for Address Property + /// </summary> + public class Address + { + /// <summary> + /// Address field value that needs to be updated + /// </summary> + [JsonProperty(PropertyName = "Address1")] + public string Address1 {get;set;} + + /// <summary> + /// Address field value that needs to be updated + /// </summary> + [JsonProperty(PropertyName = "Address2")] + public string Address2 {get;set;} + + /// <summary> + /// user's city + /// </summary> + [JsonProperty(PropertyName = "City")] + public string City {get;set;} + + /// <summary> + /// Country of the user + /// </summary> + [JsonProperty(PropertyName = "Country")] + public string Country {get;set;} + + /// <summary> + /// operation type + /// </summary> + [JsonProperty(PropertyName = "op")] + public OperationType? Op {get;set;} + + /// <summary> + /// Postal code value that need to be updated + /// </summary> + [JsonProperty(PropertyName = "PostalCode")] + public string PostalCode {get;set;} + + /// <summary> + /// Region + /// </summary> + [JsonProperty(PropertyName = "Region")] + public string Region {get;set;} + + /// <summary> + /// State of the user + /// </summary> + [JsonProperty(PropertyName = "State")] + public string State {get;set;} + + /// <summary> + /// String to identify the type of parameter + /// </summary> + [JsonProperty(PropertyName = "Type")] + public string Type {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/AgeRange.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/AgeRange.cs new file mode 100644 index 0000000..5398e6c --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/AgeRange.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for Age Range Property + /// </summary> + public class AgeRange + { + /// <summary> + /// Maximum Value Range + /// </summary> + [JsonProperty(PropertyName = "Max")] + public int? Max {get;set;} + + /// <summary> + /// Minimum Value Range + /// </summary> + [JsonProperty(PropertyName = "Min")] + public int? Min {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/AuthUserRegistrationModel.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/AuthUserRegistrationModel.cs new file mode 100644 index 0000000..4a0e08d --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/AuthUserRegistrationModel.cs @@ -0,0 +1,656 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System.Collections.Generic; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition of payload for Auth User Registration API + /// </summary> + public class AuthUserRegistrationModel + { + /// <summary> + /// About value that need to be inserted + /// </summary> + [JsonProperty(PropertyName = "About")] + public string About {get;set;} + + /// <summary> + /// caption to accept the privacy policy + /// </summary> + [JsonProperty(PropertyName = "AcceptPrivacyPolicy")] + public bool? AcceptPrivacyPolicy {get;set;} + + /// <summary> + /// Array of objects,String represents address of user + /// </summary> + [JsonProperty(PropertyName = "Addresses")] + public List<Address> Addresses {get;set;} + + /// <summary> + /// User's Age + /// </summary> + [JsonProperty(PropertyName = "Age")] + public string Age {get;set;} + + /// <summary> + /// user's age range. + /// </summary> + [JsonProperty(PropertyName = "AgeRange")] + public AgeRange AgeRange {get;set;} + + /// <summary> + /// Organization a person is assosciated with + /// </summary> + [JsonProperty(PropertyName = "Associations")] + public string Associations {get;set;} + + /// <summary> + /// Array of Objects,String represents Id, Name and Issuer + /// </summary> + [JsonProperty(PropertyName = "Awards")] + public List<Awards> Awards {get;set;} + + /// <summary> + /// User's Badges. + /// </summary> + [JsonProperty(PropertyName = "Badges")] + public List<Badges> Badges {get;set;} + + /// <summary> + /// user's birthdate + /// </summary> + [JsonProperty(PropertyName = "BirthDate")] + public string BirthDate {get;set;} + + /// <summary> + /// Array of Objects,String represents Id,Name,Category,CreatedDate + /// </summary> + [JsonProperty(PropertyName = "Books")] + public List<Books> Books {get;set;} + + /// <summary> + /// Array of Objects,string represents Id,Name,Authority Number,StartDate,EndDate + /// </summary> + [JsonProperty(PropertyName = "Certifications")] + public List<Certifications> Certifications {get;set;} + + /// <summary> + /// user's city + /// </summary> + [JsonProperty(PropertyName = "City")] + public string City {get;set;} + + /// <summary> + /// users company name + /// </summary> + [JsonProperty(PropertyName = "Company")] + public string Company {get;set;} + + /// <summary> + /// Country of the user + /// </summary> + [JsonProperty(PropertyName = "Country")] + public Country Country {get;set;} + + /// <summary> + /// users course information + /// </summary> + [JsonProperty(PropertyName = "Courses")] + public List<Courses> Courses {get;set;} + + /// <summary> + /// URL of the photo that need to be inserted + /// </summary> + [JsonProperty(PropertyName = "CoverPhoto")] + public string CoverPhoto {get;set;} + + /// <summary> + /// Currency + /// </summary> + [JsonProperty(PropertyName = "Currency")] + public string Currency {get;set;} + + /// <summary> + /// Array of Objects,String represents id ,Text ,Source and CreatedDate + /// </summary> + [JsonProperty(PropertyName = "CurrentStatus")] + public List<CurrentStatus> CurrentStatus {get;set;} + + /// <summary> + /// Custom fields as user set on LoginRadius Admin Console. + /// </summary> + [JsonProperty(PropertyName = "CustomFields")] + public Dictionary<string,string> CustomFields {get;set;} + + /// <summary> + /// Array of Objects,which represents the educations record + /// </summary> + [JsonProperty(PropertyName = "Educations")] + public List<Education> Educations {get;set;} + + /// <summary> + /// boolean type value, default is true + /// </summary> + [JsonProperty(PropertyName = "Email")] + public List<EmailModel> Email {get;set;} + + /// <summary> + /// External User Login Id + /// </summary> + [JsonProperty(PropertyName = "ExternalUserLoginId")] + public string ExternalUserLoginId {get;set;} + + /// <summary> + /// user's family + /// </summary> + [JsonProperty(PropertyName = "Family")] + public List<Family> Family {get;set;} + + /// <summary> + /// URL of the favicon that need to be inserted + /// </summary> + [JsonProperty(PropertyName = "Favicon")] + public string Favicon {get;set;} + + /// <summary> + /// Array of Objects,strings represents Id ,Name ,Type + /// </summary> + [JsonProperty(PropertyName = "FavoriteThings")] + public List<FavoriteThings> FavoriteThings {get;set;} + + /// <summary> + /// user's first name + /// </summary> + [JsonProperty(PropertyName = "FirstName")] + public string FirstName {get;set;} + + /// <summary> + /// user's followers count + /// </summary> + [JsonProperty(PropertyName = "FollowersCount")] + public int? FollowersCount {get;set;} + + /// <summary> + /// users friends count + /// </summary> + [JsonProperty(PropertyName = "FriendsCount")] + public int? FriendsCount {get;set;} + + /// <summary> + /// Users complete name + /// </summary> + [JsonProperty(PropertyName = "FullName")] + public string FullName {get;set;} + + /// <summary> + /// Array of Objects,string represents Id,Name,Category,CreatedDate + /// </summary> + [JsonProperty(PropertyName = "Games")] + public List<Games> Games {get;set;} + + /// <summary> + /// user's gender + /// </summary> + [JsonProperty(PropertyName = "Gender")] + public string Gender {get;set;} + + /// <summary> + /// + /// </summary> + [JsonProperty(PropertyName = "GistsUrl")] + public string GistsUrl {get;set;} + + /// <summary> + /// URL of image that need to be inserted + /// </summary> + [JsonProperty(PropertyName = "GravatarImageUrl")] + public string GravatarImageUrl {get;set;} + + /// <summary> + /// boolean type value, default value is true + /// </summary> + [JsonProperty(PropertyName = "Hireable")] + public bool? Hireable {get;set;} + + /// <summary> + /// user's home town name + /// </summary> + [JsonProperty(PropertyName = "HomeTown")] + public string HomeTown {get;set;} + + /// <summary> + /// Awards lists from the social provider + /// </summary> + [JsonProperty(PropertyName = "Honors")] + public string Honors {get;set;} + + /// <summary> + /// URL of the Image that need to be inserted + /// </summary> + [JsonProperty(PropertyName = "HttpsImageUrl")] + public string HttpsImageUrl {get;set;} + + /// <summary> + /// Array of objects, String represents account type and account name. + /// </summary> + [JsonProperty(PropertyName = "IMAccounts")] + public List<IMAccount> IMAccounts {get;set;} + + /// <summary> + /// image URL should be absolute and has HTTPS domain + /// </summary> + [JsonProperty(PropertyName = "ImageUrl")] + public string ImageUrl {get;set;} + + /// <summary> + /// Industry name + /// </summary> + [JsonProperty(PropertyName = "Industry")] + public string Industry {get;set;} + + /// <summary> + /// Array of Objects,string represents Id and Name + /// </summary> + [JsonProperty(PropertyName = "InspirationalPeople")] + public List<InspirationalPeople> InspirationalPeople {get;set;} + + /// <summary> + /// array of string represents interest + /// </summary> + [JsonProperty(PropertyName = "InterestedIn")] + public List<string> InterestedIn {get;set;} + + /// <summary> + /// Array of objects, string shows InterestedType and InterestedName + /// </summary> + [JsonProperty(PropertyName = "Interests")] + public List<Interests> Interests {get;set;} + + /// <summary> + /// boolean type value, default is true + /// </summary> + [JsonProperty(PropertyName = "IsEmailSubscribed")] + public bool? IsEmailSubscribed {get;set;} + + /// <summary> + /// boolean type value, default is true + /// </summary> + [JsonProperty(PropertyName = "IsGeoEnabled")] + public string IsGeoEnabled {get;set;} + + /// <summary> + /// boolean type value, default is true + /// </summary> + [JsonProperty(PropertyName = "IsProtected")] + public bool? IsProtected {get;set;} + + /// <summary> + /// boolean type value, true if MFA enables otherwise false + /// </summary> + [JsonProperty(PropertyName = "IsTwoFactorAuthenticationEnabled")] + public bool? IsTwoFactorAuthenticationEnabled {get;set;} + + /// <summary> + /// Array of Objects,Strings,boolean,object represents IsApplied,ApplyTimestamp,IsSaved,SavedTimestamp,Job + /// </summary> + [JsonProperty(PropertyName = "JobBookmarks")] + public List<JobBookmarks> JobBookmarks {get;set;} + + /// <summary> + /// Object, string represents KloutId and double represents Score + /// </summary> + [JsonProperty(PropertyName = "KloutScore")] + public KloutProfile KloutScore {get;set;} + + /// <summary> + /// language known by user's + /// </summary> + [JsonProperty(PropertyName = "Languages")] + public List<Languages> Languages {get;set;} + + /// <summary> + /// user's last name + /// </summary> + [JsonProperty(PropertyName = "LastName")] + public string LastName {get;set;} + + /// <summary> + /// Local City of the user + /// </summary> + [JsonProperty(PropertyName = "LocalCity")] + public string LocalCity {get;set;} + + /// <summary> + /// Local country of the user + /// </summary> + [JsonProperty(PropertyName = "LocalCountry")] + public string LocalCountry {get;set;} + + /// <summary> + /// Local language of the user + /// </summary> + [JsonProperty(PropertyName = "LocalLanguage")] + public string LocalLanguage {get;set;} + + /// <summary> + /// Main address of the user + /// </summary> + [JsonProperty(PropertyName = "MainAddress")] + public string MainAddress {get;set;} + + /// <summary> + /// Array of Objects,String represents Url,UrlName + /// </summary> + [JsonProperty(PropertyName = "MemberUrlResources")] + public List<Memberurlresources> MemberUrlResources {get;set;} + + /// <summary> + /// user's middle name + /// </summary> + [JsonProperty(PropertyName = "MiddleName")] + public string MiddleName {get;set;} + + /// <summary> + /// Array of Objects,strings represents Id,Name,Category,CreatedDate + /// </summary> + [JsonProperty(PropertyName = "Movies")] + public List<Movies> Movies {get;set;} + + /// <summary> + /// Array of Objects, strings represents Id,Name,FirstName,LastName,Birthday,Hometown,Link,Gender + /// </summary> + [JsonProperty(PropertyName = "MutualFriends")] + public List<MutualFriends> MutualFriends {get;set;} + + /// <summary> + /// Nick name of the user + /// </summary> + [JsonProperty(PropertyName = "NickName")] + public string NickName {get;set;} + + /// <summary> + /// Count for the user profile recommended + /// </summary> + [JsonProperty(PropertyName = "NumRecommenders")] + public int? NumRecommenders {get;set;} + + /// <summary> + /// Password for the email + /// </summary> + [JsonProperty(PropertyName = "Password")] + public string Password {get;set;} + + /// <summary> + /// Patents Registered + /// </summary> + [JsonProperty(PropertyName = "Patents")] + public List<Patents> Patents {get;set;} + + /// <summary> + /// Phone ID (Unique Phone Number Identifier of the user) + /// </summary> + [JsonProperty(PropertyName = "PhoneId")] + public string PhoneId {get;set;} + + /// <summary> + /// Users Phone Number + /// </summary> + [JsonProperty(PropertyName = "PhoneNumbers")] + public List<Phone> PhoneNumbers {get;set;} + + /// <summary> + /// Array of Objects,strings Name and boolean IsPrimary + /// </summary> + [JsonProperty(PropertyName = "PlacesLived")] + public List<PlacesLived> PlacesLived {get;set;} + + /// <summary> + /// List of Political interest + /// </summary> + [JsonProperty(PropertyName = "Political")] + public string Political {get;set;} + + /// <summary> + /// Array of Objects,which represents the PositionSummary,StartDate,EndDate,IsCurrent,Company,Location + /// </summary> + [JsonProperty(PropertyName = "Positions")] + public List<ProfessionalPosition> Positions {get;set;} + + /// <summary> + /// Prefix for FirstName + /// </summary> + [JsonProperty(PropertyName = "Prefix")] + public string Prefix {get;set;} + + /// <summary> + /// user private Repository Urls + /// </summary> + [JsonProperty(PropertyName = "PrivateGists")] + public int? PrivateGists {get;set;} + + /// <summary> + /// This field provide by linkedin.contain our linkedin profile headline + /// </summary> + [JsonProperty(PropertyName = "ProfessionalHeadline")] + public string ProfessionalHeadline {get;set;} + + /// <summary> + /// ProfileCity value that need to be inserted + /// </summary> + [JsonProperty(PropertyName = "ProfileCity")] + public string ProfileCity {get;set;} + + /// <summary> + /// ProfileCountry value that need to be inserted + /// </summary> + [JsonProperty(PropertyName = "ProfileCountry")] + public string ProfileCountry {get;set;} + + /// <summary> + /// ProfileImageUrls that need to be inserted + /// </summary> + [JsonProperty(PropertyName = "ProfileImageUrls")] + public Dictionary<string,string> ProfileImageUrls {get;set;} + + /// <summary> + /// ProfileName value field that need to be inserted + /// </summary> + [JsonProperty(PropertyName = "ProfileName")] + public string ProfileName {get;set;} + + /// <summary> + /// User profile url like facebook profile Url + /// </summary> + [JsonProperty(PropertyName = "ProfileUrl")] + public string ProfileUrl {get;set;} + + /// <summary> + /// Array of Objects,string represents Id,Name,Summary With StartDate,EndDate,IsCurrent + /// </summary> + [JsonProperty(PropertyName = "Projects")] + public List<Projects> Projects {get;set;} + + /// <summary> + /// Object,string represents AccessToken,TokenSecret + /// </summary> + [JsonProperty(PropertyName = "ProviderAccessCredential")] + public ProviderAccessCredential ProviderAccessCredential {get;set;} + + /// <summary> + /// Array of Objects,string represents Id,Title,Publisher,Authors,Date,Url,Summary + /// </summary> + [JsonProperty(PropertyName = "Publications")] + public List<Publications> Publications {get;set;} + + /// <summary> + /// gist is a Git repository, which means that it can be forked and cloned. + /// </summary> + [JsonProperty(PropertyName = "PublicGists")] + public int? PublicGists {get;set;} + + /// <summary> + /// user public Repository Urls + /// </summary> + [JsonProperty(PropertyName = "PublicRepository")] + public string PublicRepository {get;set;} + + /// <summary> + /// Quota + /// </summary> + [JsonProperty(PropertyName = "Quota")] + public string Quota {get;set;} + + /// <summary> + /// Array of Objects,string represents Id,RecommendationType,RecommendationText,Recommender + /// </summary> + [JsonProperty(PropertyName = "RecommendationsReceived")] + public List<RecommendationsReceived> RecommendationsReceived {get;set;} + + /// <summary> + /// Array of Objects,String represents Id,FirstName,LastName + /// </summary> + [JsonProperty(PropertyName = "RelatedProfileViews")] + public List<RelatedProfileViews> RelatedProfileViews {get;set;} + + /// <summary> + /// user's relationship status + /// </summary> + [JsonProperty(PropertyName = "RelationshipStatus")] + public string RelationshipStatus {get;set;} + + /// <summary> + /// String shows users religion + /// </summary> + [JsonProperty(PropertyName = "Religion")] + public string Religion {get;set;} + + /// <summary> + /// Repository URL + /// </summary> + [JsonProperty(PropertyName = "RepositoryUrl")] + public string RepositoryUrl {get;set;} + + /// <summary> + /// Valid JSON object of Unique Security Question ID and Answer of set Security Question + /// </summary> + [JsonProperty(PropertyName = "SecurityQuestionAnswer")] + public Dictionary<string,string> SecurityQuestionAnswer {get;set;} + + /// <summary> + /// Array of objects, String represents ID and Name + /// </summary> + [JsonProperty(PropertyName = "Skills")] + public List<Skills> Skills {get;set;} + + /// <summary> + /// Array of objects, String represents ID and Name + /// </summary> + [JsonProperty(PropertyName = "Sports")] + public List<Sports> Sports {get;set;} + + /// <summary> + /// Git users bookmark repositories + /// </summary> + [JsonProperty(PropertyName = "StarredUrl")] + public string StarredUrl {get;set;} + + /// <summary> + /// State of the user + /// </summary> + [JsonProperty(PropertyName = "State")] + public string State {get;set;} + + /// <summary> + /// Object,string represents Name,Space,PrivateRepos,Collaborators + /// </summary> + [JsonProperty(PropertyName = "Subscription")] + public GitHubPlan Subscription {get;set;} + + /// <summary> + /// Suffix for the User. + /// </summary> + [JsonProperty(PropertyName = "Suffix")] + public string Suffix {get;set;} + + /// <summary> + /// Object,array of objects represents CompaniestoFollow,IndustriestoFollow,NewssourcetoFollow,PeopletoFollow + /// </summary> + [JsonProperty(PropertyName = "Suggestions")] + public Suggestions Suggestions {get;set;} + + /// <summary> + /// Tagline that need to be inserted + /// </summary> + [JsonProperty(PropertyName = "TagLine")] + public string TagLine {get;set;} + + /// <summary> + /// Array of Objects,string represents Id,Name,Category,CreatedDate + /// </summary> + [JsonProperty(PropertyName = "TeleVisionShow")] + public List<Television> TeleVisionShow {get;set;} + + /// <summary> + /// URL for the Thumbnail + /// </summary> + [JsonProperty(PropertyName = "ThumbnailImageUrl")] + public string ThumbnailImageUrl {get;set;} + + /// <summary> + /// The Current Time Zone. + /// </summary> + [JsonProperty(PropertyName = "TimeZone")] + public string TimeZone {get;set;} + + /// <summary> + /// Total Private repository + /// </summary> + [JsonProperty(PropertyName = "TotalPrivateRepository")] + public int? TotalPrivateRepository {get;set;} + + /// <summary> + /// Count of Total status + /// </summary> + [JsonProperty(PropertyName = "TotalStatusesCount")] + public int? TotalStatusesCount {get;set;} + + /// <summary> + /// UID, the unified identifier for each user account + /// </summary> + [JsonProperty(PropertyName = "Uid")] + public string Uid {get;set;} + + /// <summary> + /// Username of the user + /// </summary> + [JsonProperty(PropertyName = "UserName")] + public string UserName {get;set;} + + /// <summary> + /// Array of Objects,string represents Id,Role,Organization,Cause + /// </summary> + [JsonProperty(PropertyName = "Volunteer")] + public List<Volunteer> Volunteer {get;set;} + + /// <summary> + /// Twitter, Facebook ProfileUrls + /// </summary> + [JsonProperty(PropertyName = "WebProfiles")] + public Dictionary<string,string> WebProfiles {get;set;} + + /// <summary> + /// Personal Website a User has + /// </summary> + [JsonProperty(PropertyName = "Website")] + public string Website {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/AuthUserRegistrationModelWithCaptcha.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/AuthUserRegistrationModelWithCaptcha.cs new file mode 100644 index 0000000..0689c01 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/AuthUserRegistrationModelWithCaptcha.cs @@ -0,0 +1,49 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition of payload for Auth User Registration by Recaptcha API + /// </summary> + public class AuthUserRegistrationModelWithCaptcha:AuthUserRegistrationModel + { + /// <summary> + /// The acknowledgement received by Google in Google recaptcha authorisation process. + /// </summary> + [JsonProperty(PropertyName = "g-recaptcha-response")] + public string G_recaptcha_response {get;set;} + + /// <summary> + /// the value of the user's random string retrieved from the QQ captcha + /// </summary> + [JsonProperty(PropertyName = "qq_captcha_randstr")] + public string Qq_captcha_randstr {get;set;} + + /// <summary> + /// QQ Captcha ticket received from QQ in the QQ Captcha authorization process + /// </summary> + [JsonProperty(PropertyName = "qq_captcha_ticket")] + public string Qq_captcha_ticket {get;set;} + + /// <summary> + /// V1 recaptcha field (optional in case of V2 recaptcha) + /// </summary> + [JsonProperty(PropertyName = "recaptcha_challenge_field")] + public string Recaptcha_challenge_field {get;set;} + + /// <summary> + /// V1 recaptcha field (optional in case of V2 recaptcha) + /// </summary> + [JsonProperty(PropertyName = "recaptcha_response_field")] + public string Recaptcha_response_field {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/Awards.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/Awards.cs new file mode 100644 index 0000000..025f0dc --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/Awards.cs @@ -0,0 +1,37 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for Awards Property + /// </summary> + public class Awards + { + /// <summary> + /// Id of the Awards + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// Award issuer details + /// </summary> + [JsonProperty(PropertyName = "Issuer")] + public string Issuer {get;set;} + + /// <summary> + /// Award name + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/Badges.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/Badges.cs new file mode 100644 index 0000000..415fe8d --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/Badges.cs @@ -0,0 +1,61 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for Badges Property + /// </summary> + public class Badges + { + /// <summary> + /// Badge ID + /// </summary> + [JsonProperty(PropertyName = "BadgeId")] + public string BadgeId {get;set;} + + /// <summary> + /// Badge Message + /// </summary> + [JsonProperty(PropertyName = "BadgeMessage")] + public string BadgeMessage {get;set;} + + /// <summary> + /// Bage Id + /// </summary> + [JsonProperty(PropertyName = "BageId")] + public string BageId {get;set;} + + /// <summary> + /// Bage Message + /// </summary> + [JsonProperty(PropertyName = "BageMessage")] + public string BageMessage {get;set;} + + /// <summary> + /// detailed information + /// </summary> + [JsonProperty(PropertyName = "Description")] + public string Description {get;set;} + + /// <summary> + /// image URL should be absolute and has HTTPS domain + /// </summary> + [JsonProperty(PropertyName = "ImageUrl")] + public string ImageUrl {get;set;} + + /// <summary> + /// Badge Name + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/Books.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/Books.cs new file mode 100644 index 0000000..7da67c7 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/Books.cs @@ -0,0 +1,43 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for Books Property + /// </summary> + public class Books + { + /// <summary> + /// Book category + /// </summary> + [JsonProperty(PropertyName = "Category")] + public string Category {get;set;} + + /// <summary> + /// Date of Creation of Profile + /// </summary> + [JsonProperty(PropertyName = "CreatedDate")] + public string CreatedDate {get;set;} + + /// <summary> + /// Id of book + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// book name + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/Certifications.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/Certifications.cs new file mode 100644 index 0000000..9e0794a --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/Certifications.cs @@ -0,0 +1,55 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for Certifications Property + /// </summary> + public class Certifications + { + /// <summary> + /// Authority of certifications + /// </summary> + [JsonProperty(PropertyName = "Authority")] + public string Authority {get;set;} + + /// <summary> + /// Certification end date + /// </summary> + [JsonProperty(PropertyName = "EndDate")] + public string EndDate {get;set;} + + /// <summary> + /// Certification id + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// Certification name + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + /// <summary> + /// Certification number + /// </summary> + [JsonProperty(PropertyName = "Number")] + public string Number {get;set;} + + /// <summary> + /// Certification start date + /// </summary> + [JsonProperty(PropertyName = "StartDate")] + public string StartDate {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/Country.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/Country.cs new file mode 100644 index 0000000..b230805 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/Country.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for Country Property + /// </summary> + public class Country + { + /// <summary> + /// Country code + /// </summary> + [JsonProperty(PropertyName = "Code")] + public string Code {get;set;} + + /// <summary> + /// Country name + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/Courses.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/Courses.cs new file mode 100644 index 0000000..04f2471 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/Courses.cs @@ -0,0 +1,37 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for Courses Property + /// </summary> + public class Courses + { + /// <summary> + /// Course id + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// Course name + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + /// <summary> + /// Course number + /// </summary> + [JsonProperty(PropertyName = "Number")] + public string Number {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/CurrentStatus.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/CurrentStatus.cs new file mode 100644 index 0000000..837235a --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/CurrentStatus.cs @@ -0,0 +1,43 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for Current Status Property + /// </summary> + public class CurrentStatus + { + /// <summary> + /// Current status created date + /// </summary> + [JsonProperty(PropertyName = "CreatedDate")] + public string CreatedDate {get;set;} + + /// <summary> + /// Current status id + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// Current status source + /// </summary> + [JsonProperty(PropertyName = "Source")] + public string Source {get;set;} + + /// <summary> + /// Current status text + /// </summary> + [JsonProperty(PropertyName = "Text")] + public string Text {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/Education.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/Education.cs new file mode 100644 index 0000000..941a34d --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/Education.cs @@ -0,0 +1,73 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for Education Property + /// </summary> + public class Education + { + /// <summary> + /// Activities + /// </summary> + [JsonProperty(PropertyName = "activities")] + public string Activities {get;set;} + + /// <summary> + /// Degree + /// </summary> + [JsonProperty(PropertyName = "degree")] + public string Degree {get;set;} + + /// <summary> + /// Education End Date + /// </summary> + [JsonProperty(PropertyName = "EndDate")] + public string EndDate {get;set;} + + /// <summary> + /// Fields of study + /// </summary> + [JsonProperty(PropertyName = "fieldofstudy")] + public string Fieldofstudy {get;set;} + + /// <summary> + /// Notes + /// </summary> + [JsonProperty(PropertyName = "notes")] + public string Notes {get;set;} + + /// <summary> + /// School of the user + /// </summary> + [JsonProperty(PropertyName = "School")] + public string School {get;set;} + + /// <summary> + /// Start date of Education of user + /// </summary> + [JsonProperty(PropertyName = "StartDate")] + public string StartDate {get;set;} + + /// <summary> + /// Type + /// </summary> + [JsonProperty(PropertyName = "type")] + public string Type {get;set;} + + /// <summary> + /// Year of Education + /// </summary> + [JsonProperty(PropertyName = "year")] + public string Year {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/Email.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/Email.cs new file mode 100644 index 0000000..ed7d436 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/Email.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for Email Property + /// </summary> + public class Email + { + /// <summary> + /// type of email id + /// </summary> + [JsonProperty(PropertyName = "Type")] + public string Type {get;set;} + + /// <summary> + /// Email address + /// </summary> + [JsonProperty(PropertyName = "Value")] + public string Value {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/EmailAuthenticationModel.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/EmailAuthenticationModel.cs new file mode 100644 index 0000000..b94f0d8 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/EmailAuthenticationModel.cs @@ -0,0 +1,38 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System.Collections.Generic; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition of payload for Email Authentication API + /// </summary> + public class EmailAuthenticationModel:ReCaptchaModel + { + /// <summary> + /// user's email + /// </summary> + [JsonProperty(PropertyName = "email")] + public string Email {get;set;} + + /// <summary> + /// Password for the email + /// </summary> + [JsonProperty(PropertyName = "password")] + public string Password {get;set;} + + /// <summary> + /// Valid JSON object of Unique Security Question ID and Answer of set Security Question. It is only required for locked accounts when logging in. Details about this feature + /// </summary> + [JsonProperty(PropertyName = "SecurityAnswer")] + public Dictionary<string,string> SecurityAnswer {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/EmailModel.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/EmailModel.cs new file mode 100644 index 0000000..5c32464 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/EmailModel.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for EmailModel Property + /// </summary> + public class EmailModel + { + /// <summary> + /// String to identify the type of parameter + /// </summary> + [JsonProperty(PropertyName = "Type")] + public string Type {get;set;} + + /// <summary> + /// Value of the dropdown member + /// </summary> + [JsonProperty(PropertyName = "Value")] + public string Value {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/EmailVerificationByOtpModel.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/EmailVerificationByOtpModel.cs new file mode 100644 index 0000000..45f0ea3 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/EmailVerificationByOtpModel.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for EmailVerificationByOtpModel API + /// </summary> + public class EmailVerificationByOtpModel:LockoutModel + { + /// <summary> + /// user's email + /// </summary> + [JsonProperty(PropertyName = "Email")] + public string Email {get;set;} + + /// <summary> + /// The Verification Code + /// </summary> + [JsonProperty(PropertyName = "Otp")] + public string Otp {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/ExternalIds.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/ExternalIds.cs new file mode 100644 index 0000000..4391260 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/ExternalIds.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for Externallds Property + /// </summary> + public class ExternalIds + { + /// <summary> + /// ExternalId source + /// </summary> + [JsonProperty(PropertyName = "Source")] + public string Source {get;set;} + + /// <summary> + /// External source id + /// </summary> + [JsonProperty(PropertyName = "SourceId")] + public string SourceId {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/Family.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/Family.cs new file mode 100644 index 0000000..b963de5 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/Family.cs @@ -0,0 +1,37 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for Family Property + /// </summary> + public class Family + { + /// <summary> + /// Family id + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// Family name + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + /// <summary> + /// Family relationship + /// </summary> + [JsonProperty(PropertyName = "Relationship")] + public string Relationship {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/FavoriteThings.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/FavoriteThings.cs new file mode 100644 index 0000000..72f6741 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/FavoriteThings.cs @@ -0,0 +1,37 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for FavoriteThings Property + /// </summary> + public class FavoriteThings + { + /// <summary> + /// Id of favorite things + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// Name of favorite things + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + /// <summary> + /// Type of favorite things + /// </summary> + [JsonProperty(PropertyName = "Type")] + public string Type {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/Games.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/Games.cs new file mode 100644 index 0000000..5d8aad8 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/Games.cs @@ -0,0 +1,43 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for Games Property + /// </summary> + public class Games + { + /// <summary> + /// Category of game + /// </summary> + [JsonProperty(PropertyName = "Category")] + public string Category {get;set;} + + /// <summary> + /// Game created date + /// </summary> + [JsonProperty(PropertyName = "CreatedDate")] + public string CreatedDate {get;set;} + + /// <summary> + /// Id of game + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// Game name + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/GitHubPlan.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/GitHubPlan.cs new file mode 100644 index 0000000..95d1a26 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/GitHubPlan.cs @@ -0,0 +1,43 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for GitHubPlan Property + /// </summary> + public class GitHubPlan + { + /// <summary> + /// Github plan collaborators + /// </summary> + [JsonProperty(PropertyName = "Collaborators")] + public string Collaborators {get;set;} + + /// <summary> + /// Github plan name + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + /// <summary> + /// Private repos of github + /// </summary> + [JsonProperty(PropertyName = "PrivateRepos")] + public string PrivateRepos {get;set;} + + /// <summary> + /// Github plan space + /// </summary> + [JsonProperty(PropertyName = "Space")] + public string Space {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/IMAccount.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/IMAccount.cs new file mode 100644 index 0000000..8b4045e --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/IMAccount.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for IMAccount Property + /// </summary> + public class IMAccount + { + /// <summary> + /// Name of account + /// </summary> + [JsonProperty(PropertyName = "AccountName")] + public string AccountName {get;set;} + + /// <summary> + /// Type of account + /// </summary> + [JsonProperty(PropertyName = "AccountType")] + public string AccountType {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/InspirationalPeople.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/InspirationalPeople.cs new file mode 100644 index 0000000..8ffb00e --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/InspirationalPeople.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for InspirationalPeople Property + /// </summary> + public class InspirationalPeople + { + /// <summary> + /// ID of inspirational people + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// name of inspirational people + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/Interests.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/Interests.cs new file mode 100644 index 0000000..91c31f3 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/Interests.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for Interests Property + /// </summary> + public class Interests + { + /// <summary> + /// Name of interested + /// </summary> + [JsonProperty(PropertyName = "InterestedName")] + public string InterestedName {get;set;} + + /// <summary> + /// Type of interested + /// </summary> + [JsonProperty(PropertyName = "InterestedType")] + public string InterestedType {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/Job.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/Job.cs new file mode 100644 index 0000000..69f1d85 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/Job.cs @@ -0,0 +1,55 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for Job Property + /// </summary> + public class Job + { + /// <summary> + /// Is active or not + /// </summary> + [JsonProperty(PropertyName = "Active")] + public bool? Active {get;set;} + + /// <summary> + /// Job company + /// </summary> + [JsonProperty(PropertyName = "Company")] + public JobBookmarkCompany Company {get;set;} + + /// <summary> + /// Job description + /// </summary> + [JsonProperty(PropertyName = "DescriptionSnippet")] + public string DescriptionSnippet {get;set;} + + /// <summary> + /// Job id + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// Position of job + /// </summary> + [JsonProperty(PropertyName = "Position")] + public JobBookmarkPosition Position {get;set;} + + /// <summary> + /// Job posting timestamp + /// </summary> + [JsonProperty(PropertyName = "PostingTimestamp")] + public string PostingTimestamp {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/JobBookmarkCompany.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/JobBookmarkCompany.cs new file mode 100644 index 0000000..2ce9cb4 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/JobBookmarkCompany.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for JobBookmarkCompany Property + /// </summary> + public class JobBookmarkCompany + { + /// <summary> + /// Company id + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// Company name + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/JobBookmarkPosition.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/JobBookmarkPosition.cs new file mode 100644 index 0000000..911a26e --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/JobBookmarkPosition.cs @@ -0,0 +1,25 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for JobBookmarkPosition Property + /// </summary> + public class JobBookmarkPosition + { + /// <summary> + /// Position title + /// </summary> + [JsonProperty(PropertyName = "Title")] + public string Title {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/JobBookmarks.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/JobBookmarks.cs new file mode 100644 index 0000000..97baca0 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/JobBookmarks.cs @@ -0,0 +1,49 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for JobBookmarks Property + /// </summary> + public class JobBookmarks + { + /// <summary> + /// Job Bookmarks Apply Timestamp + /// </summary> + [JsonProperty(PropertyName = "ApplyTimestamp")] + public string ApplyTimestamp {get;set;} + + /// <summary> + /// Job bookmark is applied or not + /// </summary> + [JsonProperty(PropertyName = "IsApplied")] + public bool? IsApplied {get;set;} + + /// <summary> + /// Job bookmark is saved or not + /// </summary> + [JsonProperty(PropertyName = "IsSaved")] + public bool? IsSaved {get;set;} + + /// <summary> + /// Job + /// </summary> + [JsonProperty(PropertyName = "Job")] + public Job Job {get;set;} + + /// <summary> + /// Saved time stamp of Job bookmarks + /// </summary> + [JsonProperty(PropertyName = "SavedTimestamp")] + public string SavedTimestamp {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/KloutProfile.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/KloutProfile.cs new file mode 100644 index 0000000..fdb9bdb --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/KloutProfile.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for KloutProfile Property + /// </summary> + public class KloutProfile + { + /// <summary> + /// Id of klout + /// </summary> + [JsonProperty(PropertyName = "KloutId")] + public string KloutId {get;set;} + + /// <summary> + /// Object, string represents KloutId and double represents Score + /// </summary> + [JsonProperty(PropertyName = "Score")] + public double? Score {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/Languages.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/Languages.cs new file mode 100644 index 0000000..c934e22 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/Languages.cs @@ -0,0 +1,44 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +using LoginRadiusSDK.V2.Models.Enums; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for Languages Property + /// </summary> + public class Languages + { + /// <summary> + /// Language id + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// Name of language + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + /// <summary> + /// Languages operation Type + /// </summary> + [JsonProperty(PropertyName = "op")] + public OperationType? Op {get;set;} + + /// <summary> + /// Proficiency in language + /// </summary> + [JsonProperty(PropertyName = "Proficiency")] + public string Proficiency {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/LockoutModel.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/LockoutModel.cs new file mode 100644 index 0000000..1784f6f --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/LockoutModel.cs @@ -0,0 +1,26 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System.Collections.Generic; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for LockoutModel Property + /// </summary> + public class LockoutModel:ReCaptchaModel + { + /// <summary> + /// Valid JSON object of Unique Security Question ID and Answer of set Security Question. It is only required for locked accounts when logging in. Details about this feature + /// </summary> + [JsonProperty(PropertyName = "SecurityAnswer")] + public Dictionary<string,string> SecurityAnswer {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/Memberurlresources.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/Memberurlresources.cs new file mode 100644 index 0000000..43b6b0f --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/Memberurlresources.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for Memberurlresources Property + /// </summary> + public class Memberurlresources + { + /// <summary> + /// String represents website url + /// </summary> + [JsonProperty(PropertyName = "Url")] + public string Url {get;set;} + + /// <summary> + /// URL name + /// </summary> + [JsonProperty(PropertyName = "UrlName")] + public string UrlName {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/Movies.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/Movies.cs new file mode 100644 index 0000000..dcb4c4c --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/Movies.cs @@ -0,0 +1,43 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for Movies Property + /// </summary> + public class Movies + { + /// <summary> + /// Category of movie + /// </summary> + [JsonProperty(PropertyName = "Category")] + public string Category {get;set;} + + /// <summary> + /// Movie created date + /// </summary> + [JsonProperty(PropertyName = "CreatedDate")] + public string CreatedDate {get;set;} + + /// <summary> + /// Id of movie + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// Name of movie + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/MultiFactorAuthModelByBackupCode.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/MultiFactorAuthModelByBackupCode.cs new file mode 100644 index 0000000..409bf43 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/MultiFactorAuthModelByBackupCode.cs @@ -0,0 +1,25 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition of payload for MultiFactorAuth By BackupCode API + /// </summary> + public class MultiFactorAuthModelByBackupCode + { + /// <summary> + /// The Code generated as a recourse + /// </summary> + [JsonProperty(PropertyName = "BackupCode")] + public string BackupCode {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/MultiFactorAuthModelByGoogleAuthenticatorCode.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/MultiFactorAuthModelByGoogleAuthenticatorCode.cs new file mode 100644 index 0000000..4a4f54c --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/MultiFactorAuthModelByGoogleAuthenticatorCode.cs @@ -0,0 +1,25 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition of payload for MultiFactorAuthModel By GoogleAuthenticator Code API + /// </summary> + public class MultiFactorAuthModelByGoogleAuthenticatorCode + { + /// <summary> + /// The code generated by google authenticator app after scanning QR code + /// </summary> + [JsonProperty(PropertyName = "GoogleAuthenticatorCode")] + public string GoogleAuthenticatorCode {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/MultiFactorAuthModelWithLockout.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/MultiFactorAuthModelWithLockout.cs new file mode 100644 index 0000000..19b31e8 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/MultiFactorAuthModelWithLockout.cs @@ -0,0 +1,25 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition of payload for MultiFactorAuthModel With Lockout API + /// </summary> + public class MultiFactorAuthModelWithLockout:LockoutModel + { + /// <summary> + /// The Verification Code + /// </summary> + [JsonProperty(PropertyName = "Otp")] + public string Otp {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/MutualFriends.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/MutualFriends.cs new file mode 100644 index 0000000..b053cb5 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/MutualFriends.cs @@ -0,0 +1,67 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for MutualFriends Property + /// </summary> + public class MutualFriends + { + /// <summary> + /// Birthday of mutual friend + /// </summary> + [JsonProperty(PropertyName = "Birthday")] + public string Birthday {get;set;} + + /// <summary> + /// first name of mutual friend + /// </summary> + [JsonProperty(PropertyName = "FirstName")] + public string FirstName {get;set;} + + /// <summary> + /// Gender of mutual friend + /// </summary> + [JsonProperty(PropertyName = "Gender")] + public string Gender {get;set;} + + /// <summary> + /// Hometown of mutual friend + /// </summary> + [JsonProperty(PropertyName = "Hometown")] + public string Hometown {get;set;} + + /// <summary> + /// Id of mutual friend + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// Last name of mutual friend + /// </summary> + [JsonProperty(PropertyName = "LastName")] + public string LastName {get;set;} + + /// <summary> + /// Link of mutual friend + /// </summary> + [JsonProperty(PropertyName = "Link")] + public string Link {get;set;} + + /// <summary> + /// Name of mutual friend + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/NameId.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/NameId.cs new file mode 100644 index 0000000..7c30038 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/NameId.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for NameId Property + /// </summary> + public class NameId + { + /// <summary> + /// Id + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// Name + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/OneTouchLoginByEmailModel.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/OneTouchLoginByEmailModel.cs new file mode 100644 index 0000000..c43b3ba --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/OneTouchLoginByEmailModel.cs @@ -0,0 +1,37 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition of payload for OneTouchLogin By EmailModel API + /// </summary> + public class OneTouchLoginByEmailModel:ReCaptchaBodyModel + { + /// <summary> + /// Unique ID generated by client + /// </summary> + [JsonProperty(PropertyName = "clientguid")] + public string Clientguid {get;set;} + + /// <summary> + /// user's email + /// </summary> + [JsonProperty(PropertyName = "Email")] + public string Email {get;set;} + + /// <summary> + /// Name of the customer + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/OneTouchLoginByPhoneModel.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/OneTouchLoginByPhoneModel.cs new file mode 100644 index 0000000..d25fe94 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/OneTouchLoginByPhoneModel.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition of payload for OneTouchLogin By PhoneModel API + /// </summary> + public class OneTouchLoginByPhoneModel:ReCaptchaBodyModel + { + /// <summary> + /// Name of the customer + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + /// <summary> + /// New Phone Number + /// </summary> + [JsonProperty(PropertyName = "Phone")] + public string Phone {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/OptionalReCaptchaModel.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/OptionalReCaptchaModel.cs new file mode 100644 index 0000000..649e98a --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/OptionalReCaptchaModel.cs @@ -0,0 +1,18 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for OptionalReCaptcha Property + /// </summary> + public class OptionalReCaptchaModel:ReCaptchaModel + { + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/PasswordEventBasedAuthModelWithLockout.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/PasswordEventBasedAuthModelWithLockout.cs new file mode 100644 index 0000000..f914c9f --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/PasswordEventBasedAuthModelWithLockout.cs @@ -0,0 +1,25 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition of payload for PasswordEventBasedAuthModel with Lockout API + /// </summary> + public class PasswordEventBasedAuthModelWithLockout:LockoutModel + { + /// <summary> + /// Password for the email + /// </summary> + [JsonProperty(PropertyName = "password")] + public string Password {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/PasswordLessLoginOtpModel.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/PasswordLessLoginOtpModel.cs new file mode 100644 index 0000000..bfefe50 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/PasswordLessLoginOtpModel.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition of payload for PasswordLessLoginOtpModel API + /// </summary> + public class PasswordLessLoginOtpModel:LockoutModel + { + /// <summary> + /// The Verification Code + /// </summary> + [JsonProperty(PropertyName = "Otp")] + public string Otp {get;set;} + + /// <summary> + /// New Phone Number + /// </summary> + [JsonProperty(PropertyName = "Phone")] + public string Phone {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/Patents.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/Patents.cs new file mode 100644 index 0000000..0f45e75 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/Patents.cs @@ -0,0 +1,37 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for Patents Property + /// </summary> + public class Patents + { + /// <summary> + /// Date of patents + /// </summary> + [JsonProperty(PropertyName = "Date")] + public string Date {get;set;} + + /// <summary> + /// Id of the patents + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// Title of the patents + /// </summary> + [JsonProperty(PropertyName = "Title")] + public string Title {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/PermissionsModel.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/PermissionsModel.cs new file mode 100644 index 0000000..838b8ff --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/PermissionsModel.cs @@ -0,0 +1,26 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System.Collections.Generic; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for PermissionsModel Property + /// </summary> + public class PermissionsModel + { + /// <summary> + /// Any Permission name for the role + /// </summary> + [JsonProperty(PropertyName = "Permissions")] + public List<string> Permissions {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/Phone.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/Phone.cs new file mode 100644 index 0000000..ae2e29f --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/Phone.cs @@ -0,0 +1,38 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +using LoginRadiusSDK.V2.Models.Enums; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for Phone Property + /// </summary> + public class Phone + { + /// <summary> + /// operation type + /// </summary> + [JsonProperty(PropertyName = "op")] + public OperationType? Op {get;set;} + + /// <summary> + /// Phone number + /// </summary> + [JsonProperty(PropertyName = "PhoneNumber")] + public string PhoneNumber {get;set;} + + /// <summary> + /// Phone type + /// </summary> + [JsonProperty(PropertyName = "PhoneType")] + public string PhoneType {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/PhoneAuthenticationModel.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/PhoneAuthenticationModel.cs new file mode 100644 index 0000000..f48ba0f --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/PhoneAuthenticationModel.cs @@ -0,0 +1,38 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System.Collections.Generic; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition of payload for PhoneAuthenticationModel API + /// </summary> + public class PhoneAuthenticationModel:ReCaptchaModel + { + /// <summary> + /// Password for the email + /// </summary> + [JsonProperty(PropertyName = "password")] + public string Password {get;set;} + + /// <summary> + /// New Phone Number + /// </summary> + [JsonProperty(PropertyName = "phone")] + public string Phone {get;set;} + + /// <summary> + /// Valid JSON object of Unique Security Question ID and Answer of set Security Question. It is only required for locked accounts when logging in. Details about this feature + /// </summary> + [JsonProperty(PropertyName = "SecurityAnswer")] + public Dictionary<string,string> SecurityAnswer {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/PlacesLived.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/PlacesLived.cs new file mode 100644 index 0000000..798fd97 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/PlacesLived.cs @@ -0,0 +1,38 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +using LoginRadiusSDK.V2.Models.Enums; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for PlacesLived Property + /// </summary> + public class PlacesLived + { + /// <summary> + /// place is primary or not + /// </summary> + [JsonProperty(PropertyName = "IsPrimary")] + public bool? IsPrimary {get;set;} + + /// <summary> + /// Name of lived place + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + /// <summary> + /// Places Lived Operation type + /// </summary> + [JsonProperty(PropertyName = "op")] + public OperationType? Op {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/PositionCompany.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/PositionCompany.cs new file mode 100644 index 0000000..6591abe --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/PositionCompany.cs @@ -0,0 +1,37 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for PositionCompany Property + /// </summary> + public class PositionCompany + { + /// <summary> + /// position company industry + /// </summary> + [JsonProperty(PropertyName = "Industry")] + public string Industry {get;set;} + + /// <summary> + /// position company name + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + /// <summary> + /// position company type + /// </summary> + [JsonProperty(PropertyName = "Type")] + public string Type {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/PrivacyPolicy.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/PrivacyPolicy.cs new file mode 100644 index 0000000..9cd4697 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/PrivacyPolicy.cs @@ -0,0 +1,25 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for PrivacyPolicy Property + /// </summary> + public class PrivacyPolicy + { + /// <summary> + /// Privacy policy version + /// </summary> + [JsonProperty(PropertyName = "Version")] + public string Version {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/ProfessionalPosition.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/ProfessionalPosition.cs new file mode 100644 index 0000000..dc1fafb --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/ProfessionalPosition.cs @@ -0,0 +1,61 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for ProfessionalPosition Property + /// </summary> + public class ProfessionalPosition + { + /// <summary> + /// Company of the professional position + /// </summary> + [JsonProperty(PropertyName = "Company")] + public PositionCompany Company {get;set;} + + /// <summary> + /// End date of the professional position + /// </summary> + [JsonProperty(PropertyName = "EndDate")] + public string EndDate {get;set;} + + /// <summary> + /// Is current or not + /// </summary> + [JsonProperty(PropertyName = "IsCurrent")] + public string IsCurrent {get;set;} + + /// <summary> + /// Location of the professional position + /// </summary> + [JsonProperty(PropertyName = "Location")] + public string Location {get;set;} + + /// <summary> + /// Position + /// </summary> + [JsonProperty(PropertyName = "Position")] + public string Position {get;set;} + + /// <summary> + /// Start date of the professional position + /// </summary> + [JsonProperty(PropertyName = "StartDate")] + public string StartDate {get;set;} + + /// <summary> + /// Summary of the professional position + /// </summary> + [JsonProperty(PropertyName = "Summary")] + public string Summary {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/Projects.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/Projects.cs new file mode 100644 index 0000000..84a9bff --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/Projects.cs @@ -0,0 +1,62 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System.Collections.Generic; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for Projects Property + /// </summary> + public class Projects + { + /// <summary> + /// End date of the project + /// </summary> + [JsonProperty(PropertyName = "EndDate")] + public string EndDate {get;set;} + + /// <summary> + /// Id of the project + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// is current or not + /// </summary> + [JsonProperty(PropertyName = "IsCurrent")] + public string IsCurrent {get;set;} + + /// <summary> + /// Name of the project + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + /// <summary> + /// Start date of the project + /// </summary> + [JsonProperty(PropertyName = "StartDate")] + public string StartDate {get;set;} + + /// <summary> + /// Summary of the project + /// </summary> + [JsonProperty(PropertyName = "Summary")] + public string Summary {get;set;} + + /// <summary> + /// Projects done with + /// </summary> + [JsonProperty(PropertyName = "With")] + public List<NameId> With {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/ProviderAccessCredential.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/ProviderAccessCredential.cs new file mode 100644 index 0000000..947d275 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/ProviderAccessCredential.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for ProviderAccessCredential Property + /// </summary> + public class ProviderAccessCredential + { + /// <summary> + /// Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + /// </summary> + [JsonProperty(PropertyName = "AccessToken")] + public string AccessToken {get;set;} + + /// <summary> + /// secret token of the provider + /// </summary> + [JsonProperty(PropertyName = "TokenSecret")] + public string TokenSecret {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/Publications.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/Publications.cs new file mode 100644 index 0000000..06b951a --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/Publications.cs @@ -0,0 +1,62 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System.Collections.Generic; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for Publications Property + /// </summary> + public class Publications + { + /// <summary> + /// Author of the publication + /// </summary> + [JsonProperty(PropertyName = "Authors")] + public List<PublicationsAuthors> Authors {get;set;} + + /// <summary> + /// Date of the publication + /// </summary> + [JsonProperty(PropertyName = "Date")] + public string Date {get;set;} + + /// <summary> + /// Id of the Publication + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// Publisher of the Publication + /// </summary> + [JsonProperty(PropertyName = "Publisher")] + public string Publisher {get;set;} + + /// <summary> + /// Summary of the publication + /// </summary> + [JsonProperty(PropertyName = "Summary")] + public string Summary {get;set;} + + /// <summary> + /// Title of the publication + /// </summary> + [JsonProperty(PropertyName = "Title")] + public string Title {get;set;} + + /// <summary> + /// Publication url + /// </summary> + [JsonProperty(PropertyName = "Url")] + public string Url {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/PublicationsAuthors.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/PublicationsAuthors.cs new file mode 100644 index 0000000..e99adf2 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/PublicationsAuthors.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for PublicationsAuthors Property + /// </summary> + public class PublicationsAuthors + { + /// <summary> + /// Author id of the publication + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// Author name + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/ReCaptchaBodyModel.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/ReCaptchaBodyModel.cs new file mode 100644 index 0000000..58c06f6 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/ReCaptchaBodyModel.cs @@ -0,0 +1,37 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for ReCaptchaBodyModel Property + /// </summary> + public class ReCaptchaBodyModel + { + /// <summary> + /// The acknowledgement received by Google in Google recaptcha authorisation process. + /// </summary> + [JsonProperty(PropertyName = "g-recaptcha-response")] + public string G_recaptcha_response {get;set;} + + /// <summary> + /// the value of the user's random string retrieved from the QQ captcha + /// </summary> + [JsonProperty(PropertyName = "qq_captcha_randstr")] + public string Qq_captcha_randstr {get;set;} + + /// <summary> + /// QQ Captcha ticket received from QQ in the QQ Captcha authorization process + /// </summary> + [JsonProperty(PropertyName = "qq_captcha_ticket")] + public string Qq_captcha_ticket {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/ReCaptchaModel.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/ReCaptchaModel.cs new file mode 100644 index 0000000..88a6851 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/ReCaptchaModel.cs @@ -0,0 +1,37 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for ReCaptchaBodyModel Property + /// </summary> + public class ReCaptchaModel + { + /// <summary> + /// The acknowledgement received by Google in Google recaptcha authorisation process. + /// </summary> + [JsonProperty(PropertyName = "g-recaptcha-response")] + public string G_recaptcha_response {get;set;} + + /// <summary> + /// the value of the user's random string retrieved from the QQ captcha + /// </summary> + [JsonProperty(PropertyName = "qq_captcha_randstr")] + public string Qq_captcha_randstr {get;set;} + + /// <summary> + /// QQ Captcha ticket received from QQ in the QQ Captcha authorization process + /// </summary> + [JsonProperty(PropertyName = "qq_captcha_ticket")] + public string Qq_captcha_ticket {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/ReauthByBackupCodeModel.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/ReauthByBackupCodeModel.cs new file mode 100644 index 0000000..0249610 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/ReauthByBackupCodeModel.cs @@ -0,0 +1,25 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for MFA Reauthentication by Backup code + /// </summary> + public class ReauthByBackupCodeModel + { + /// <summary> + /// The Code generated as a recourse + /// </summary> + [JsonProperty(PropertyName = "BackupCode")] + public string BackupCode {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/ReauthByGoogleAuthenticatorCodeModel.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/ReauthByGoogleAuthenticatorCodeModel.cs new file mode 100644 index 0000000..d52056a --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/ReauthByGoogleAuthenticatorCodeModel.cs @@ -0,0 +1,25 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for MFA Reauthentication by Google Authenticator + /// </summary> + public class ReauthByGoogleAuthenticatorCodeModel + { + /// <summary> + /// The code generated by google authenticator app after scanning QR code + /// </summary> + [JsonProperty(PropertyName = "GoogleAuthenticatorCode")] + public string GoogleAuthenticatorCode {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/ReauthByOtpModel.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/ReauthByOtpModel.cs new file mode 100644 index 0000000..869fdab --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/ReauthByOtpModel.cs @@ -0,0 +1,25 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for MFA Reauthentication by OTP + /// </summary> + public class ReauthByOtpModel:LockoutModel + { + /// <summary> + /// The Verification Code + /// </summary> + [JsonProperty(PropertyName = "Otp")] + public string Otp {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/RecommendationsReceived.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/RecommendationsReceived.cs new file mode 100644 index 0000000..571eb94 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/RecommendationsReceived.cs @@ -0,0 +1,43 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for RecommendationsReceived + /// </summary> + public class RecommendationsReceived + { + /// <summary> + /// Recommendation id + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// Recommendation text + /// </summary> + [JsonProperty(PropertyName = "RecommendationText")] + public string RecommendationText {get;set;} + + /// <summary> + /// Recommendation type + /// </summary> + [JsonProperty(PropertyName = "RecommendationType")] + public string RecommendationType {get;set;} + + /// <summary> + /// Recommender + /// </summary> + [JsonProperty(PropertyName = "Recommender")] + public string Recommender {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/RegistrationDataCreateModel.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/RegistrationDataCreateModel.cs new file mode 100644 index 0000000..90fe282 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/RegistrationDataCreateModel.cs @@ -0,0 +1,55 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition of payload for Registration Data create API + /// </summary> + public class RegistrationDataCreateModel + { + /// <summary> + /// Validation Code/Secret Code,Code Parameter, given when Login Dialog is performed + /// </summary> + [JsonProperty(PropertyName = "Code")] + public string Code {get;set;} + + /// <summary> + /// boolean type value, default is true + /// </summary> + [JsonProperty(PropertyName = "IsActive")] + public bool? IsActive {get;set;} + + /// <summary> + /// Text to display for the dropdown member + /// </summary> + [JsonProperty(PropertyName = "Key")] + public string Key {get;set;} + + /// <summary> + /// Id of parent dropdown member + /// </summary> + [JsonProperty(PropertyName = "ParentId")] + public string ParentId {get;set;} + + /// <summary> + /// String to identify the type of parameter + /// </summary> + [JsonProperty(PropertyName = "Type")] + public string Type {get;set;} + + /// <summary> + /// Value of the dropdown member + /// </summary> + [JsonProperty(PropertyName = "Value")] + public string Value {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/RegistrationDataCreateModelList.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/RegistrationDataCreateModelList.cs new file mode 100644 index 0000000..82bb254 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/RegistrationDataCreateModelList.cs @@ -0,0 +1,26 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System.Collections.Generic; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition of List of Registration Data + /// </summary> + public class RegistrationDataCreateModelList + { + /// <summary> + /// Data + /// </summary> + [JsonProperty(PropertyName = "Data")] + public List<RegistrationDataCreateModel> Data {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/RegistrationDataUpdateModel.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/RegistrationDataUpdateModel.cs new file mode 100644 index 0000000..45cd0f0 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/RegistrationDataUpdateModel.cs @@ -0,0 +1,61 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition of payload for Registration Data update API + /// </summary> + public class RegistrationDataUpdateModel + { + /// <summary> + /// Validation Code/Secret Code,Code Parameter, given when Login Dialog is performed + /// </summary> + [JsonProperty(PropertyName = "Code")] + public string Code {get;set;} + + /// <summary> + /// ID of the User + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// boolean type value, default is true + /// </summary> + [JsonProperty(PropertyName = "IsActive")] + public bool? IsActive {get;set;} + + /// <summary> + /// Text to display for the dropdown member + /// </summary> + [JsonProperty(PropertyName = "Key")] + public string Key {get;set;} + + /// <summary> + /// Id of parent dropdown member + /// </summary> + [JsonProperty(PropertyName = "ParentId")] + public string ParentId {get;set;} + + /// <summary> + /// String to identify the type of parameter + /// </summary> + [JsonProperty(PropertyName = "Type")] + public string Type {get;set;} + + /// <summary> + /// Value of the dropdown member + /// </summary> + [JsonProperty(PropertyName = "Value")] + public string Value {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/RelatedProfileViews.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/RelatedProfileViews.cs new file mode 100644 index 0000000..5a97444 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/RelatedProfileViews.cs @@ -0,0 +1,37 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition of payload for RelatedProfileViews Property + /// </summary> + public class RelatedProfileViews + { + /// <summary> + /// user's first name + /// </summary> + [JsonProperty(PropertyName = "FirstName")] + public string FirstName {get;set;} + + /// <summary> + /// ID of the User + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// user's last name + /// </summary> + [JsonProperty(PropertyName = "LastName")] + public string LastName {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/ResetPasswordByEmailAndOtpModel.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/ResetPasswordByEmailAndOtpModel.cs new file mode 100644 index 0000000..bc0491a --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/ResetPasswordByEmailAndOtpModel.cs @@ -0,0 +1,49 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition of payload for ResetPasswordByEmailAndOtp API + /// </summary> + public class ResetPasswordByEmailAndOtpModel:LockoutModel + { + /// <summary> + /// user's email + /// </summary> + [JsonProperty(PropertyName = "Email")] + public string Email {get;set;} + + /// <summary> + /// The Verification Code + /// </summary> + [JsonProperty(PropertyName = "Otp")] + public string Otp {get;set;} + + /// <summary> + /// Password for the email + /// </summary> + [JsonProperty(PropertyName = "Password")] + public string Password {get;set;} + + /// <summary> + /// If you are sending an email via the sendemail parameter, this parameter allows you to specify which reset Password email template you would like to use. + /// </summary> + [JsonProperty(PropertyName = "ResetPasswordEmailTemplate")] + public string ResetPasswordEmailTemplate {get;set;} + + /// <summary> + /// If you are sending an email via the sendemail parameter, this parameter allows you to specify which welcome email template you would like to use. + /// </summary> + [JsonProperty(PropertyName = "WelcomeEmailTemplate")] + public string WelcomeEmailTemplate {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/ResetPasswordByOTPModel.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/ResetPasswordByOTPModel.cs new file mode 100644 index 0000000..0bba06f --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/ResetPasswordByOTPModel.cs @@ -0,0 +1,49 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition of payload for ResetPasswordByOTP API + /// </summary> + public class ResetPasswordByOTPModel:LockoutModel + { + /// <summary> + /// The Verification Code + /// </summary> + [JsonProperty(PropertyName = "otp")] + public string Otp {get;set;} + + /// <summary> + /// Password for the email + /// </summary> + [JsonProperty(PropertyName = "password")] + public string Password {get;set;} + + /// <summary> + /// New Phone Number + /// </summary> + [JsonProperty(PropertyName = "Phone")] + public string Phone {get;set;} + + /// <summary> + /// If you are sending an sms via the sendsms parameter, this parameter allows you to specify which reset password sms template you would like to use. + /// </summary> + [JsonProperty(PropertyName = "ResetPasswordSmsTemplate")] + public string ResetPasswordSmsTemplate {get;set;} + + /// <summary> + /// SMS template name + /// </summary> + [JsonProperty(PropertyName = "smsTemplate")] + public string SmsTemplate {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/ResetPasswordByResetTokenModel.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/ResetPasswordByResetTokenModel.cs new file mode 100644 index 0000000..3fbbd40 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/ResetPasswordByResetTokenModel.cs @@ -0,0 +1,43 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition of payload for ResetToken API + /// </summary> + public class ResetPasswordByResetTokenModel:LockoutModel + { + /// <summary> + /// Password for the email + /// </summary> + [JsonProperty(PropertyName = "Password")] + public string Password {get;set;} + + /// <summary> + /// If you are sending an email via the sendemail parameter, this parameter allows you to specify which reset Password email template you would like to use. + /// </summary> + [JsonProperty(PropertyName = "ResetPasswordEmailTemplate")] + public string ResetPasswordEmailTemplate {get;set;} + + /// <summary> + /// reset token received in the email + /// </summary> + [JsonProperty(PropertyName = "ResetToken")] + public string ResetToken {get;set;} + + /// <summary> + /// If you are sending an email via the sendemail parameter, this parameter allows you to specify which welcome email template you would like to use. + /// </summary> + [JsonProperty(PropertyName = "WelcomeEmailTemplate")] + public string WelcomeEmailTemplate {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/ResetPasswordBySecurityAnswerAndEmailModel.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/ResetPasswordBySecurityAnswerAndEmailModel.cs new file mode 100644 index 0000000..e0f7e57 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/ResetPasswordBySecurityAnswerAndEmailModel.cs @@ -0,0 +1,44 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System.Collections.Generic; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition of payload for ResetPasswordBySecurityAnswerAndEmail API + /// </summary> + public class ResetPasswordBySecurityAnswerAndEmailModel + { + /// <summary> + /// LoginRadius user identifier (if phone no login then phone no and if email login then email id) + /// </summary> + [JsonProperty(PropertyName = "Email")] + public string Email {get;set;} + + /// <summary> + /// Password for the email + /// </summary> + [JsonProperty(PropertyName = "password")] + public string Password {get;set;} + + /// <summary> + /// If you are sending an email via the sendemail parameter, this parameter allows you to specify which reset Password email template you would like to use. + /// </summary> + [JsonProperty(PropertyName = "ResetPasswordEmailTemplate")] + public string ResetPasswordEmailTemplate {get;set;} + + /// <summary> + /// Valid JSON object of Unique Security Question ID and Answer of set Security Question. It is only required for locked accounts when logging in. Details about this feature + /// </summary> + [JsonProperty(PropertyName = "SecurityAnswer")] + public Dictionary<string,string> SecurityAnswer {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/ResetPasswordBySecurityAnswerAndPhoneModel.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/ResetPasswordBySecurityAnswerAndPhoneModel.cs new file mode 100644 index 0000000..c1610ed --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/ResetPasswordBySecurityAnswerAndPhoneModel.cs @@ -0,0 +1,44 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System.Collections.Generic; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition of payload for ResetPasswordBySecurityAnswerAndPhone API + /// </summary> + public class ResetPasswordBySecurityAnswerAndPhoneModel + { + /// <summary> + /// Password for the email + /// </summary> + [JsonProperty(PropertyName = "password")] + public string Password {get;set;} + + /// <summary> + /// New Phone Number + /// </summary> + [JsonProperty(PropertyName = "Phone")] + public string Phone {get;set;} + + /// <summary> + /// If you are sending an email via the sendemail parameter, this parameter allows you to specify which reset Password email template you would like to use. + /// </summary> + [JsonProperty(PropertyName = "ResetPasswordEmailTemplate")] + public string ResetPasswordEmailTemplate {get;set;} + + /// <summary> + /// Valid JSON object of Unique Security Question ID and Answer of set Security Question. It is only required for locked accounts when logging in. Details about this feature + /// </summary> + [JsonProperty(PropertyName = "SecurityAnswer")] + public Dictionary<string,string> SecurityAnswer {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/ResetPasswordBySecurityAnswerAndUserNameModel.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/ResetPasswordBySecurityAnswerAndUserNameModel.cs new file mode 100644 index 0000000..6afabbf --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/ResetPasswordBySecurityAnswerAndUserNameModel.cs @@ -0,0 +1,44 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System.Collections.Generic; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition of payload for ResetPasswordBySecurityAnswerAndUserName API + /// </summary> + public class ResetPasswordBySecurityAnswerAndUserNameModel + { + /// <summary> + /// Password for the email + /// </summary> + [JsonProperty(PropertyName = "password")] + public string Password {get;set;} + + /// <summary> + /// If you are sending an email via the sendemail parameter, this parameter allows you to specify which reset Password email template you would like to use. + /// </summary> + [JsonProperty(PropertyName = "ResetPasswordEmailTemplate")] + public string ResetPasswordEmailTemplate {get;set;} + + /// <summary> + /// Valid JSON object of Unique Security Question ID and Answer of set Security Question. It is only required for locked accounts when logging in. Details about this feature + /// </summary> + [JsonProperty(PropertyName = "SecurityAnswer")] + public Dictionary<string,string> SecurityAnswer {get;set;} + + /// <summary> + /// Username of the user + /// </summary> + [JsonProperty(PropertyName = "UserName")] + public string UserName {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/ResetPasswordByUserNameModel.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/ResetPasswordByUserNameModel.cs new file mode 100644 index 0000000..bb5e83a --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/ResetPasswordByUserNameModel.cs @@ -0,0 +1,49 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition of payload for ResetPasswordByUserName API + /// </summary> + public class ResetPasswordByUserNameModel:LockoutModel + { + /// <summary> + /// The Verification Code + /// </summary> + [JsonProperty(PropertyName = "Otp")] + public string Otp {get;set;} + + /// <summary> + /// Password for the email + /// </summary> + [JsonProperty(PropertyName = "Password")] + public string Password {get;set;} + + /// <summary> + /// If you are sending an email via the sendemail parameter, this parameter allows you to specify which reset Password email template you would like to use. + /// </summary> + [JsonProperty(PropertyName = "ResetPasswordEmailTemplate")] + public string ResetPasswordEmailTemplate {get;set;} + + /// <summary> + /// Username of the user + /// </summary> + [JsonProperty(PropertyName = "UserName")] + public string UserName {get;set;} + + /// <summary> + /// If you are sending an email via the sendemail parameter, this parameter allows you to specify which welcome email template you would like to use. + /// </summary> + [JsonProperty(PropertyName = "WelcomeEmailTemplate")] + public string WelcomeEmailTemplate {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/RoleContextAdditionalPermissionRemoveRoleModel.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/RoleContextAdditionalPermissionRemoveRoleModel.cs new file mode 100644 index 0000000..63712e0 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/RoleContextAdditionalPermissionRemoveRoleModel.cs @@ -0,0 +1,26 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System.Collections.Generic; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition of payload for RoleContextAdditionalPermissionRemoveRole API + /// </summary> + public class RoleContextAdditionalPermissionRemoveRoleModel + { + /// <summary> + /// Array of String, which represents the additional permissions + /// </summary> + [JsonProperty(PropertyName = "AdditionalPermissions")] + public List<string> AdditionalPermissions {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/RoleContextRemoveRoleModel.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/RoleContextRemoveRoleModel.cs new file mode 100644 index 0000000..48df62d --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/RoleContextRemoveRoleModel.cs @@ -0,0 +1,26 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System.Collections.Generic; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition of payload for RoleContextRemoveRole API + /// </summary> + public class RoleContextRemoveRoleModel + { + /// <summary> + /// Array of String, which represents the role name + /// </summary> + [JsonProperty(PropertyName = "Roles")] + public List<string> Roles {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/RoleContextRoleModel.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/RoleContextRoleModel.cs new file mode 100644 index 0000000..a40a246 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/RoleContextRoleModel.cs @@ -0,0 +1,44 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System.Collections.Generic; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition of payload for RoleContextRole API + /// </summary> + public class RoleContextRoleModel + { + /// <summary> + /// Array of String, which represents the additional permissions + /// </summary> + [JsonProperty(PropertyName = "AdditionalPermissions")] + public List<string> AdditionalPermissions {get;set;} + + /// <summary> + /// Array of RoleContext object, see body tab for structure + /// </summary> + [JsonProperty(PropertyName = "Context")] + public string Context {get;set;} + + /// <summary> + /// Role expiration date + /// </summary> + [JsonProperty(PropertyName = "Expiration")] + public string Expiration {get;set;} + + /// <summary> + /// Array of String, which represents the role name + /// </summary> + [JsonProperty(PropertyName = "Roles")] + public List<string> Roles {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/RoleModel.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/RoleModel.cs new file mode 100644 index 0000000..9491659 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/RoleModel.cs @@ -0,0 +1,32 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System.Collections.Generic; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition of payload for Roles API + /// </summary> + public class RoleModel + { + /// <summary> + /// Name of role + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + /// <summary> + /// Any Permission name for the role + /// </summary> + [JsonProperty(PropertyName = "Permissions")] + public Dictionary<string,bool> Permissions {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/RolesModel.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/RolesModel.cs new file mode 100644 index 0000000..888977c --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/RolesModel.cs @@ -0,0 +1,26 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System.Collections.Generic; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition of payload for Roles API + /// </summary> + public class RolesModel + { + /// <summary> + /// Array of String, which represents the role name + /// </summary> + [JsonProperty(PropertyName = "Roles")] + public List<LoginRadiusSDK.V2.Models.RequestModels.RoleModel> Roles {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/Skills.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/Skills.cs new file mode 100644 index 0000000..ef40463 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/Skills.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition of payload for Skills Property + /// </summary> + public class Skills + { + /// <summary> + /// id of skill + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// name of skills + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/Sports.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/Sports.cs new file mode 100644 index 0000000..059577b --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/Sports.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition of payload for Sports Property + /// </summary> + public class Sports + { + /// <summary> + /// Id of sport + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// Name of sport + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/StatusModel.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/StatusModel.cs new file mode 100644 index 0000000..be7d832 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/StatusModel.cs @@ -0,0 +1,61 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition of payload for Status API + /// </summary> + public class StatusModel + { + /// <summary> + /// Message displayed below the description(Requires URL, Under 70 Characters). + /// </summary> + [JsonProperty(PropertyName = "caption")] + public string Caption {get;set;} + + /// <summary> + /// Description of the displayed URL and Image + /// </summary> + [JsonProperty(PropertyName = "description")] + public string Description {get;set;} + + /// <summary> + /// image URL should be absolute and has HTTPS domain + /// </summary> + [JsonProperty(PropertyName = "imageurl")] + public string Imageurl {get;set;} + + /// <summary> + /// short url + /// </summary> + [JsonProperty(PropertyName = "shorturl")] + public string Shorturl {get;set;} + + /// <summary> + /// Main body of the Status update. + /// </summary> + [JsonProperty(PropertyName = "status")] + public string Status {get;set;} + + /// <summary> + /// Title of Linked URL + /// </summary> + [JsonProperty(PropertyName = "title")] + public string Title {get;set;} + + /// <summary> + /// String represents website url + /// </summary> + [JsonProperty(PropertyName = "url")] + public string Url {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/Suggestions.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/Suggestions.cs new file mode 100644 index 0000000..0c57ddc --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/Suggestions.cs @@ -0,0 +1,44 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System.Collections.Generic; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition of payload for Suggestions Property + /// </summary> + public class Suggestions + { + /// <summary> + /// Companies needs to follow + /// </summary> + [JsonProperty(PropertyName = "CompaniestoFollow")] + public List<NameId> CompaniestoFollow {get;set;} + + /// <summary> + /// Industries needs to follow + /// </summary> + [JsonProperty(PropertyName = "IndustriestoFollow")] + public List<NameId> IndustriestoFollow {get;set;} + + /// <summary> + /// News sources needs to follow + /// </summary> + [JsonProperty(PropertyName = "NewssourcetoFollow")] + public List<NameId> NewssourcetoFollow {get;set;} + + /// <summary> + /// People needs to follow + /// </summary> + [JsonProperty(PropertyName = "PeopletoFollow")] + public List<NameId> PeopletoFollow {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/Television.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/Television.cs new file mode 100644 index 0000000..5816035 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/Television.cs @@ -0,0 +1,43 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition of payload for Television Property + /// </summary> + public class Television + { + /// <summary> + /// Television category + /// </summary> + [JsonProperty(PropertyName = "Category")] + public string Category {get;set;} + + /// <summary> + /// Date + /// </summary> + [JsonProperty(PropertyName = "CreatedDate")] + public string CreatedDate {get;set;} + + /// <summary> + /// ID of the User + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// Name of the customer + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/UnlockProfileModel.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/UnlockProfileModel.cs new file mode 100644 index 0000000..c3984a5 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/UnlockProfileModel.cs @@ -0,0 +1,18 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Payload containing Unlock Profile API + /// </summary> + public class UnlockProfileModel:LockoutModel + { + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/UpsertEmailModel.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/UpsertEmailModel.cs new file mode 100644 index 0000000..e97ce65 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/UpsertEmailModel.cs @@ -0,0 +1,26 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System.Collections.Generic; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition of payload for UpsertEmail Property + /// </summary> + public class UpsertEmailModel + { + /// <summary> + /// user's email + /// </summary> + [JsonProperty(PropertyName = "Email")] + public List<EmailModel> Email {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/UserNameAuthenticationModel.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/UserNameAuthenticationModel.cs new file mode 100644 index 0000000..459a728 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/UserNameAuthenticationModel.cs @@ -0,0 +1,38 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System.Collections.Generic; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition of payload for Username Authentication API + /// </summary> + public class UserNameAuthenticationModel:ReCaptchaModel + { + /// <summary> + /// Password for the email + /// </summary> + [JsonProperty(PropertyName = "password")] + public string Password {get;set;} + + /// <summary> + /// Valid JSON object of Unique Security Question ID and Answer of set Security Question. It is only required for locked accounts when logging in. Details about this feature + /// </summary> + [JsonProperty(PropertyName = "SecurityAnswer")] + public Dictionary<string,string> SecurityAnswer {get;set;} + + /// <summary> + /// Username of the user + /// </summary> + [JsonProperty(PropertyName = "username")] + public string Username {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/UserProfileUpdateModel.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/UserProfileUpdateModel.cs new file mode 100644 index 0000000..716c280 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/UserProfileUpdateModel.cs @@ -0,0 +1,650 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System.Collections.Generic; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition of payload for User Profile update API + /// </summary> + public class UserProfileUpdateModel:OptionalReCaptchaModel + { + /// <summary> + /// About value that need to be inserted + /// </summary> + [JsonProperty(PropertyName = "About")] + public string About {get;set;} + + /// <summary> + /// Array of objects,String represents address of user + /// </summary> + [JsonProperty(PropertyName = "Addresses")] + public List<Address> Addresses {get;set;} + + /// <summary> + /// User's Age + /// </summary> + [JsonProperty(PropertyName = "Age")] + public string Age {get;set;} + + /// <summary> + /// user's age range. + /// </summary> + [JsonProperty(PropertyName = "AgeRange")] + public AgeRange AgeRange {get;set;} + + /// <summary> + /// Organization a person is assosciated with + /// </summary> + [JsonProperty(PropertyName = "Associations")] + public string Associations {get;set;} + + /// <summary> + /// Array of Objects,String represents Id, Name and Issuer + /// </summary> + [JsonProperty(PropertyName = "Awards")] + public List<Awards> Awards {get;set;} + + /// <summary> + /// User's Badges. + /// </summary> + [JsonProperty(PropertyName = "Badges")] + public List<Badges> Badges {get;set;} + + /// <summary> + /// user's birthdate + /// </summary> + [JsonProperty(PropertyName = "BirthDate")] + public string BirthDate {get;set;} + + /// <summary> + /// Array of Objects,String represents Id,Name,Category,CreatedDate + /// </summary> + [JsonProperty(PropertyName = "Books")] + public List<Books> Books {get;set;} + + /// <summary> + /// Array of Objects,string represents Id,Name,Authority Number,StartDate,EndDate + /// </summary> + [JsonProperty(PropertyName = "Certifications")] + public List<Certifications> Certifications {get;set;} + + /// <summary> + /// user's city + /// </summary> + [JsonProperty(PropertyName = "City")] + public string City {get;set;} + + /// <summary> + /// users company name + /// </summary> + [JsonProperty(PropertyName = "Company")] + public string Company {get;set;} + + /// <summary> + /// Country of the user + /// </summary> + [JsonProperty(PropertyName = "Country")] + public Country Country {get;set;} + + /// <summary> + /// users course information + /// </summary> + [JsonProperty(PropertyName = "Courses")] + public List<Courses> Courses {get;set;} + + /// <summary> + /// URL of the photo that need to be inserted + /// </summary> + [JsonProperty(PropertyName = "CoverPhoto")] + public string CoverPhoto {get;set;} + + /// <summary> + /// Currency + /// </summary> + [JsonProperty(PropertyName = "Currency")] + public string Currency {get;set;} + + /// <summary> + /// Array of Objects,String represents id ,Text ,Source and CreatedDate + /// </summary> + [JsonProperty(PropertyName = "CurrentStatus")] + public List<CurrentStatus> CurrentStatus {get;set;} + + /// <summary> + /// Custom fields as user set on LoginRadius Admin Console. + /// </summary> + [JsonProperty(PropertyName = "CustomFields")] + public Dictionary<string,string> CustomFields {get;set;} + + /// <summary> + /// Array of Objects,which represents the educations record + /// </summary> + [JsonProperty(PropertyName = "Educations")] + public List<Education> Educations {get;set;} + + /// <summary> + /// user's email + /// </summary> + [JsonProperty(PropertyName = "Email")] + public List<Email> Email {get;set;} + + /// <summary> + /// External User Login Id + /// </summary> + [JsonProperty(PropertyName = "ExternalUserLoginId")] + public string ExternalUserLoginId {get;set;} + + /// <summary> + /// user's family + /// </summary> + [JsonProperty(PropertyName = "Family")] + public List<Family> Family {get;set;} + + /// <summary> + /// URL of the favicon that need to be inserted + /// </summary> + [JsonProperty(PropertyName = "Favicon")] + public string Favicon {get;set;} + + /// <summary> + /// Array of Objects,strings represents Id ,Name ,Type + /// </summary> + [JsonProperty(PropertyName = "FavoriteThings")] + public List<FavoriteThings> FavoriteThings {get;set;} + + /// <summary> + /// user's first name + /// </summary> + [JsonProperty(PropertyName = "FirstName")] + public string FirstName {get;set;} + + /// <summary> + /// user's followers count + /// </summary> + [JsonProperty(PropertyName = "FollowersCount")] + public int? FollowersCount {get;set;} + + /// <summary> + /// users friends count + /// </summary> + [JsonProperty(PropertyName = "FriendsCount")] + public int? FriendsCount {get;set;} + + /// <summary> + /// Users complete name + /// </summary> + [JsonProperty(PropertyName = "FullName")] + public string FullName {get;set;} + + /// <summary> + /// + /// </summary> + [JsonProperty(PropertyName = "Games")] + public List<Games> Games {get;set;} + + /// <summary> + /// user's gender + /// </summary> + [JsonProperty(PropertyName = "Gender")] + public string Gender {get;set;} + + /// <summary> + /// Git Repository URL + /// </summary> + [JsonProperty(PropertyName = "GistsUrl")] + public string GistsUrl {get;set;} + + /// <summary> + /// URL of image that need to be inserted + /// </summary> + [JsonProperty(PropertyName = "GravatarImageUrl")] + public string GravatarImageUrl {get;set;} + + /// <summary> + /// boolean type value, default value is true + /// </summary> + [JsonProperty(PropertyName = "Hireable")] + public bool? Hireable {get;set;} + + /// <summary> + /// user's home town name + /// </summary> + [JsonProperty(PropertyName = "HomeTown")] + public string HomeTown {get;set;} + + /// <summary> + /// Awards lists from the social provider + /// </summary> + [JsonProperty(PropertyName = "Honors")] + public string Honors {get;set;} + + /// <summary> + /// URL of the Image that need to be inserted + /// </summary> + [JsonProperty(PropertyName = "HttpsImageUrl")] + public string HttpsImageUrl {get;set;} + + /// <summary> + /// Array of objects, String represents account type and account name. + /// </summary> + [JsonProperty(PropertyName = "IMAccounts")] + public List<IMAccount> IMAccounts {get;set;} + + /// <summary> + /// image URL should be absolute and has HTTPS domain + /// </summary> + [JsonProperty(PropertyName = "ImageUrl")] + public string ImageUrl {get;set;} + + /// <summary> + /// Industry name + /// </summary> + [JsonProperty(PropertyName = "Industry")] + public string Industry {get;set;} + + /// <summary> + /// Array of Objects,string represents Id and Name + /// </summary> + [JsonProperty(PropertyName = "InspirationalPeople")] + public List<InspirationalPeople> InspirationalPeople {get;set;} + + /// <summary> + /// array of string represents interest + /// </summary> + [JsonProperty(PropertyName = "InterestedIn")] + public List<string> InterestedIn {get;set;} + + /// <summary> + /// Array of objects, string shows InterestedType and InterestedName + /// </summary> + [JsonProperty(PropertyName = "Interests")] + public List<Interests> Interests {get;set;} + + /// <summary> + /// boolean type value, default is true + /// </summary> + [JsonProperty(PropertyName = "IsEmailSubscribed")] + public bool? IsEmailSubscribed {get;set;} + + /// <summary> + /// boolean type value, default is true + /// </summary> + [JsonProperty(PropertyName = "IsGeoEnabled")] + public string IsGeoEnabled {get;set;} + + /// <summary> + /// boolean type value, default is true + /// </summary> + [JsonProperty(PropertyName = "IsProtected")] + public bool? IsProtected {get;set;} + + /// <summary> + /// Array of Objects,Strings,boolean,object represents IsApplied,ApplyTimestamp,IsSaved,SavedTimestamp,Job + /// </summary> + [JsonProperty(PropertyName = "JobBookmarks")] + public List<JobBookmarks> JobBookmarks {get;set;} + + /// <summary> + /// Object, string represents KloutId and double represents Score + /// </summary> + [JsonProperty(PropertyName = "KloutScore")] + public KloutProfile KloutScore {get;set;} + + /// <summary> + /// language known by user's + /// </summary> + [JsonProperty(PropertyName = "Languages")] + public List<Languages> Languages {get;set;} + + /// <summary> + /// user's last name + /// </summary> + [JsonProperty(PropertyName = "LastName")] + public string LastName {get;set;} + + /// <summary> + /// Local City of the user + /// </summary> + [JsonProperty(PropertyName = "LocalCity")] + public string LocalCity {get;set;} + + /// <summary> + /// Local country of the user + /// </summary> + [JsonProperty(PropertyName = "LocalCountry")] + public string LocalCountry {get;set;} + + /// <summary> + /// Local language of the user + /// </summary> + [JsonProperty(PropertyName = "LocalLanguage")] + public string LocalLanguage {get;set;} + + /// <summary> + /// Main address of the user + /// </summary> + [JsonProperty(PropertyName = "MainAddress")] + public string MainAddress {get;set;} + + /// <summary> + /// Array of Objects,String represents Url,UrlName + /// </summary> + [JsonProperty(PropertyName = "MemberUrlResources")] + public List<Memberurlresources> MemberUrlResources {get;set;} + + /// <summary> + /// user's middle name + /// </summary> + [JsonProperty(PropertyName = "MiddleName")] + public string MiddleName {get;set;} + + /// <summary> + /// Array of Objects,strings represents Id,Name,Category,CreatedDate + /// </summary> + [JsonProperty(PropertyName = "Movies")] + public List<Movies> Movies {get;set;} + + /// <summary> + /// Array of Objects, strings represents Id,Name,FirstName,LastName,Birthday,Hometown,Link,Gender + /// </summary> + [JsonProperty(PropertyName = "MutualFriends")] + public List<MutualFriends> MutualFriends {get;set;} + + /// <summary> + /// Nick name of the user + /// </summary> + [JsonProperty(PropertyName = "NickName")] + public string NickName {get;set;} + + /// <summary> + /// Boolean, pass true if you wish to update any user profile field with a NULL value, You can get the details + /// </summary> + [JsonProperty(PropertyName = "NullSupport")] + public bool? NullSupport {get;set;} + + /// <summary> + /// Count for the user profile recommended + /// </summary> + [JsonProperty(PropertyName = "NumRecommenders")] + public int? NumRecommenders {get;set;} + + /// <summary> + /// Password for the email + /// </summary> + [JsonProperty(PropertyName = "Password")] + public string Password {get;set;} + + /// <summary> + /// Patents Registered + /// </summary> + [JsonProperty(PropertyName = "Patents")] + public List<Patents> Patents {get;set;} + + /// <summary> + /// Phone ID (Unique Phone Number Identifier of the user) + /// </summary> + [JsonProperty(PropertyName = "PhoneId")] + public string PhoneId {get;set;} + + /// <summary> + /// Users Phone Number + /// </summary> + [JsonProperty(PropertyName = "PhoneNumbers")] + public List<Phone> PhoneNumbers {get;set;} + + /// <summary> + /// Array of Objects,strings Name and boolean IsPrimary + /// </summary> + [JsonProperty(PropertyName = "PlacesLived")] + public List<PlacesLived> PlacesLived {get;set;} + + /// <summary> + /// List of Political interest + /// </summary> + [JsonProperty(PropertyName = "Political")] + public string Political {get;set;} + + /// <summary> + /// Array of Objects,which represents the PositionSummary,StartDate,EndDate,IsCurrent,Company,Location + /// </summary> + [JsonProperty(PropertyName = "Positions")] + public List<ProfessionalPosition> Positions {get;set;} + + /// <summary> + /// Prefix for FirstName + /// </summary> + [JsonProperty(PropertyName = "Prefix")] + public string Prefix {get;set;} + + /// <summary> + /// user private Repository Urls + /// </summary> + [JsonProperty(PropertyName = "PrivateGists")] + public int? PrivateGists {get;set;} + + /// <summary> + /// This field provide by linkedin.contain our linkedin profile headline + /// </summary> + [JsonProperty(PropertyName = "ProfessionalHeadline")] + public string ProfessionalHeadline {get;set;} + + /// <summary> + /// ProfileCity value that need to be inserted + /// </summary> + [JsonProperty(PropertyName = "ProfileCity")] + public string ProfileCity {get;set;} + + /// <summary> + /// ProfileCountry value that need to be inserted + /// </summary> + [JsonProperty(PropertyName = "ProfileCountry")] + public string ProfileCountry {get;set;} + + /// <summary> + /// ProfileImageUrls that need to be inserted + /// </summary> + [JsonProperty(PropertyName = "ProfileImageUrls")] + public Dictionary<string,string> ProfileImageUrls {get;set;} + + /// <summary> + /// ProfileName value field that need to be inserted + /// </summary> + [JsonProperty(PropertyName = "ProfileName")] + public string ProfileName {get;set;} + + /// <summary> + /// User profile url like facebook profile Url + /// </summary> + [JsonProperty(PropertyName = "ProfileUrl")] + public string ProfileUrl {get;set;} + + /// <summary> + /// Array of Objects,string represents Id,Name,Summary With StartDate,EndDate,IsCurrent + /// </summary> + [JsonProperty(PropertyName = "Projects")] + public List<Projects> Projects {get;set;} + + /// <summary> + /// Object,string represents AccessToken,TokenSecret + /// </summary> + [JsonProperty(PropertyName = "ProviderAccessCredential")] + public ProviderAccessCredential ProviderAccessCredential {get;set;} + + /// <summary> + /// Array of Objects,string represents Id,Title,Publisher,Authors,Date,Url,Summary + /// </summary> + [JsonProperty(PropertyName = "Publications")] + public List<Publications> Publications {get;set;} + + /// <summary> + /// gist is a Git repository, which means that it can be forked and cloned. + /// </summary> + [JsonProperty(PropertyName = "PublicGists")] + public int? PublicGists {get;set;} + + /// <summary> + /// user public Repository Urls + /// </summary> + [JsonProperty(PropertyName = "PublicRepository")] + public string PublicRepository {get;set;} + + /// <summary> + /// Quota + /// </summary> + [JsonProperty(PropertyName = "Quota")] + public string Quota {get;set;} + + /// <summary> + /// Array of Objects,string represents Id,RecommendationType,RecommendationText,Recommender + /// </summary> + [JsonProperty(PropertyName = "RecommendationsReceived")] + public List<RecommendationsReceived> RecommendationsReceived {get;set;} + + /// <summary> + /// Array of Objects,String represents Id,FirstName,LastName + /// </summary> + [JsonProperty(PropertyName = "RelatedProfileViews")] + public List<RelatedProfileViews> RelatedProfileViews {get;set;} + + /// <summary> + /// user's relationship status + /// </summary> + [JsonProperty(PropertyName = "RelationshipStatus")] + public string RelationshipStatus {get;set;} + + /// <summary> + /// String shows users religion + /// </summary> + [JsonProperty(PropertyName = "Religion")] + public string Religion {get;set;} + + /// <summary> + /// Repository URL + /// </summary> + [JsonProperty(PropertyName = "RepositoryUrl")] + public string RepositoryUrl {get;set;} + + /// <summary> + /// Valid JSON object of Unique Security Question ID and Answer of set Security Question + /// </summary> + [JsonProperty(PropertyName = "SecurityQuestionAnswer")] + public Dictionary<string,string> SecurityQuestionAnswer {get;set;} + + /// <summary> + /// Array of objects, String represents ID and Name + /// </summary> + [JsonProperty(PropertyName = "Skills")] + public List<Skills> Skills {get;set;} + + /// <summary> + /// Array of objects, String represents ID and Name + /// </summary> + [JsonProperty(PropertyName = "Sports")] + public List<Sports> Sports {get;set;} + + /// <summary> + /// Git users bookmark repositories + /// </summary> + [JsonProperty(PropertyName = "StarredUrl")] + public string StarredUrl {get;set;} + + /// <summary> + /// State of the user + /// </summary> + [JsonProperty(PropertyName = "State")] + public string State {get;set;} + + /// <summary> + /// Object,string represents Name,Space,PrivateRepos,Collaborators + /// </summary> + [JsonProperty(PropertyName = "Subscription")] + public GitHubPlan Subscription {get;set;} + + /// <summary> + /// Suffix for the User. + /// </summary> + [JsonProperty(PropertyName = "Suffix")] + public string Suffix {get;set;} + + /// <summary> + /// Object,array of objects represents CompaniestoFollow,IndustriestoFollow,NewssourcetoFollow,PeopletoFollow + /// </summary> + [JsonProperty(PropertyName = "Suggestions")] + public Suggestions Suggestions {get;set;} + + /// <summary> + /// Tagline that need to be inserted + /// </summary> + [JsonProperty(PropertyName = "TagLine")] + public string TagLine {get;set;} + + /// <summary> + /// Array of Objects,string represents Id,Name,Category,CreatedDate + /// </summary> + [JsonProperty(PropertyName = "TeleVisionShow")] + public List<Television> TeleVisionShow {get;set;} + + /// <summary> + /// URL for the Thumbnail + /// </summary> + [JsonProperty(PropertyName = "ThumbnailImageUrl")] + public string ThumbnailImageUrl {get;set;} + + /// <summary> + /// The Current Time Zone. + /// </summary> + [JsonProperty(PropertyName = "TimeZone")] + public string TimeZone {get;set;} + + /// <summary> + /// Total Private repository + /// </summary> + [JsonProperty(PropertyName = "TotalPrivateRepository")] + public int? TotalPrivateRepository {get;set;} + + /// <summary> + /// Count of Total status + /// </summary> + [JsonProperty(PropertyName = "TotalStatusesCount")] + public int? TotalStatusesCount {get;set;} + + /// <summary> + /// UID, the unified identifier for each user account + /// </summary> + [JsonProperty(PropertyName = "Uid")] + public string Uid {get;set;} + + /// <summary> + /// Username of the user + /// </summary> + [JsonProperty(PropertyName = "UserName")] + public string UserName {get;set;} + + /// <summary> + /// Array of Objects,string represents Id,Role,Organization,Cause + /// </summary> + [JsonProperty(PropertyName = "Volunteer")] + public List<Volunteer> Volunteer {get;set;} + + /// <summary> + /// Twitter, Facebook ProfileUrls + /// </summary> + [JsonProperty(PropertyName = "WebProfiles")] + public Dictionary<string,string> WebProfiles {get;set;} + + /// <summary> + /// Personal Website a User has + /// </summary> + [JsonProperty(PropertyName = "Website")] + public string Website {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/Volunteer.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/Volunteer.cs new file mode 100644 index 0000000..716af2b --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/Volunteer.cs @@ -0,0 +1,43 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition for Volunteer Property + /// </summary> + public class Volunteer + { + /// <summary> + /// Cause of volunteer + /// </summary> + [JsonProperty(PropertyName = "Cause")] + public string Cause {get;set;} + + /// <summary> + /// Volunteer Id + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// Volunteer organization + /// </summary> + [JsonProperty(PropertyName = "Organization")] + public string Organization {get;set;} + + /// <summary> + /// Volunteer role + /// </summary> + [JsonProperty(PropertyName = "Role")] + public string Role {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RequestModels/WebHookSubscribeModel.cs b/Source/LoginRadiusSDK.V2/Models/RequestModels/WebHookSubscribeModel.cs new file mode 100644 index 0000000..1dd99c9 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/RequestModels/WebHookSubscribeModel.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.RequestModels + +{ + + /// <summary> + /// Model Class containing Definition of payload for Webhook Subscribe API + /// </summary> + public class WebHookSubscribeModel + { + /// <summary> + /// Allowed events: Login, Register, UpdateProfile, ResetPassword, ChangePassword, emailVerification, AddEmail, RemoveEmail, BlockAccount, DeleteAccount, SetUsername, AssignRoles, UnassignRoles, SetPassword, LinkAccount, UnlinkAccount, UpdatePhoneId, VerifyPhoneNumber, CreateCustomObject, UpdateCustomobject, DeleteCustomObject + /// </summary> + [JsonProperty(PropertyName = "Event")] + public string Event {get;set;} + + /// <summary> + /// URL where trigger will send data when it invoke + /// </summary> + [JsonProperty(PropertyName = "TargetUrl")] + public string TargetUrl {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/AccessToken.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/AccessToken.cs new file mode 100644 index 0000000..8685698 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/AccessToken.cs @@ -0,0 +1,51 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels + +{ + + /// <summary> + /// Response containing Definition of Complete Token data + /// </summary> + public class AccessToken + { + /// <summary> + /// Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + /// </summary> + [JsonProperty(PropertyName = "access_token")] + public Guid Access_Token {get;set;} + + /// <summary> + /// Expiration time of Access Token + /// </summary> + [JsonProperty(PropertyName = "expires_in")] + public DateTime Expires_In {get;set;} + + /// <summary> + /// refresh token to refresh access token + /// </summary> + [JsonProperty(PropertyName = "refresh_token")] + public Guid? Refresh_Token {get;set;} + + } + + /// <summary> + /// Response containing Definition of Complete Profile data + /// </summary> + public class AccessToken<T>:AccessToken + { + /// <summary> + /// Complete user profile data + /// </summary> + [JsonProperty(PropertyName = "Profile")] + public T Profile {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/ActiveSessionDetail.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/ActiveSessionDetail.cs new file mode 100644 index 0000000..e3ff185 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/ActiveSessionDetail.cs @@ -0,0 +1,74 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels + +{ + + /// <summary> + /// Response containing Definition of Complete ActiveSession data + /// </summary> + public class ActiveSessionDetail + { + /// <summary> + /// Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + /// </summary> + [JsonProperty(PropertyName = "AccessToken")] + public string AccessToken {get;set;} + + /// <summary> + /// Browser details of user + /// </summary> + [JsonProperty(PropertyName = "Browser")] + public string Browser {get;set;} + + /// <summary> + /// user's city + /// </summary> + [JsonProperty(PropertyName = "City")] + public string City {get;set;} + + /// <summary> + /// Country of the user + /// </summary> + [JsonProperty(PropertyName = "Country")] + public string Country {get;set;} + + /// <summary> + /// Device of user + /// </summary> + [JsonProperty(PropertyName = "Device")] + public string Device {get;set;} + + /// <summary> + /// type of device + /// </summary> + [JsonProperty(PropertyName = "DeviceType")] + public string DeviceType {get;set;} + + /// <summary> + /// IP of user + /// </summary> + [JsonProperty(PropertyName = "Ip")] + public string Ip {get;set;} + + /// <summary> + /// last login date + /// </summary> + [JsonProperty(PropertyName = "LoginDate")] + public DateTime LoginDate {get;set;} + + /// <summary> + /// Os Details of user + /// </summary> + [JsonProperty(PropertyName = "Os")] + public string Os {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/EntityPermissionAcknowledgement.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/EntityPermissionAcknowledgement.cs new file mode 100644 index 0000000..de2f64f --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/EntityPermissionAcknowledgement.cs @@ -0,0 +1,25 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels + +{ + + /// <summary> + /// Response containing Definition of Complete Validation data + /// </summary> + public class EntityPermissionAcknowledgement + { + /// <summary> + /// Webhook is allowed or not + /// </summary> + [JsonProperty(PropertyName = "IsAllowed")] + public bool IsAllowed {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/EventBasedMultiFactorAuthenticationToken.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/EventBasedMultiFactorAuthenticationToken.cs new file mode 100644 index 0000000..e12d302 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/EventBasedMultiFactorAuthenticationToken.cs @@ -0,0 +1,32 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels + +{ + + /// <summary> + /// Response containing Definition response of MFA reauthentication + /// </summary> + public class EventBasedMultiFactorAuthenticationToken + { + /// <summary> + /// Expiration time of Access Token + /// </summary> + [JsonProperty(PropertyName = "ExpireIn")] + public DateTime ExpireIn {get;set;} + + /// <summary> + /// second factor validation token + /// </summary> + [JsonProperty(PropertyName = "SecondFactorValidationToken")] + public Guid SecondFactorValidationToken {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/ListData.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/ListData.cs new file mode 100644 index 0000000..3b29a64 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/ListData.cs @@ -0,0 +1,32 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System.Collections.Generic; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels + +{ + + /// <summary> + /// Response containing Definition of Complete List data + /// </summary> + public class ListData<T> + { + /// <summary> + /// count + /// </summary> + [JsonProperty(PropertyName = "Count")] + public int Count {get;set;} + + /// <summary> + /// Data + /// </summary> + [JsonProperty(PropertyName = "data")] + public List<T> Data {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/ListReturn.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/ListReturn.cs new file mode 100644 index 0000000..50d5a94 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/ListReturn.cs @@ -0,0 +1,26 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System.Collections.Generic; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels + +{ + + /// <summary> + /// Response containing Definition of Complete List data + /// </summary> + public class ListReturn<T> + { + /// <summary> + /// Data + /// </summary> + [JsonProperty(PropertyName = "Data")] + public List<T> Data {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/MultiFactorAuthenticationResponse.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/MultiFactorAuthenticationResponse.cs new file mode 100644 index 0000000..2efe02b --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/MultiFactorAuthenticationResponse.cs @@ -0,0 +1,50 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels + +{ + + /// <summary> + /// Response containing Definition of Complete Multi-Factor Authentication data + /// </summary> + public class MultiFactorAuthenticationResponse<T> + { + /// <summary> + /// Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + /// </summary> + [JsonProperty(PropertyName = "access_token")] + public Guid Access_Token {get;set;} + + /// <summary> + /// Expiration time of Access Token + /// </summary> + [JsonProperty(PropertyName = "expires_in")] + public DateTime Expires_In {get;set;} + + /// <summary> + /// Complete user profile data + /// </summary> + [JsonProperty(PropertyName = "Profile")] + public T Profile {get;set;} + + /// <summary> + /// refresh token to refresh access token + /// </summary> + [JsonProperty(PropertyName = "refresh_token")] + public Guid? Refresh_Token {get;set;} + + /// <summary> + /// second factor authentication + /// </summary> + [JsonProperty(PropertyName = "SecondFactorAuthentication")] + public MultiFactorAuthenticationToken SecondFactorAuthentication {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/MultiFactorAuthenticationSettingsResponse.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/MultiFactorAuthenticationSettingsResponse.cs new file mode 100644 index 0000000..1c6f62b --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/MultiFactorAuthenticationSettingsResponse.cs @@ -0,0 +1,55 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels + +{ + + /// <summary> + /// Response containing Definition of Complete Multi-Factor Authentication Settings data + /// </summary> + public class MultiFactorAuthenticationSettingsResponse + { + /// <summary> + /// google authenticator verified or not + /// </summary> + [JsonProperty(PropertyName = "IsGoogleAuthenticatorVerified")] + public bool IsGoogleAuthenticatorVerified {get;set;} + + /// <summary> + /// OTP authenticator verified or not + /// </summary> + [JsonProperty(PropertyName = "IsOTPAuthenticatorVerified")] + public bool IsOTPAuthenticatorVerified {get;set;} + + /// <summary> + /// Manual entry code + /// </summary> + [JsonProperty(PropertyName = "ManualEntryCode")] + public string ManualEntryCode {get;set;} + + /// <summary> + /// Otp phone number + /// </summary> + [JsonProperty(PropertyName = "OTPPhoneNo")] + public string OTPPhoneNo {get;set;} + + /// <summary> + /// OTP status + /// </summary> + [JsonProperty(PropertyName = "OTPStatus")] + public SMSResponseData OTPStatus {get;set;} + + /// <summary> + /// QR code + /// </summary> + [JsonProperty(PropertyName = "QRCode")] + public string QRCode {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/MultiFactorAuthenticationToken.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/MultiFactorAuthenticationToken.cs new file mode 100644 index 0000000..728f542 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/MultiFactorAuthenticationToken.cs @@ -0,0 +1,32 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels + +{ + + /// <summary> + /// Response containing Definition for Complete MFAuthentication Token + /// </summary> + public class MultiFactorAuthenticationToken:MultiFactorAuthenticationSettingsResponse + { + /// <summary> + /// Expiration time of Access Token + /// </summary> + [JsonProperty(PropertyName = "ExpireIn")] + public DateTime ExpireIn {get;set;} + + /// <summary> + /// second factor authentication token + /// </summary> + [JsonProperty(PropertyName = "SecondFactorAuthenticationToken")] + public Guid SecondFactorAuthenticationToken {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/AccountRolesModel.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/AccountRolesModel.cs new file mode 100644 index 0000000..7fcc35d --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/AccountRolesModel.cs @@ -0,0 +1,26 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System.Collections.Generic; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Response containing Definition of Complete Roles data + /// </summary> + public class AccountRolesModel + { + /// <summary> + /// Array of String, which represents the role name + /// </summary> + [JsonProperty(PropertyName = "Roles")] + public List<string> Roles {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/Album.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/Album.cs new file mode 100644 index 0000000..0e3bf44 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/Album.cs @@ -0,0 +1,91 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Response containing Definition of Complete Album data + /// </summary> + public class Album + { + /// <summary> + /// Image url + /// </summary> + [JsonProperty(PropertyName = "CoverImageUrl")] + public string CoverImageUrl {get;set;} + + /// <summary> + /// Date of Creation of Profile + /// </summary> + [JsonProperty(PropertyName = "CreatedDate")] + public string CreatedDate {get;set;} + + /// <summary> + /// detailed information + /// </summary> + [JsonProperty(PropertyName = "Description")] + public string Description {get;set;} + + /// <summary> + /// Directory's url + /// </summary> + [JsonProperty(PropertyName = "DirectoryUrl")] + public string DirectoryUrl {get;set;} + + /// <summary> + /// ID of the User + /// </summary> + [JsonProperty(PropertyName = "ID")] + public string ID {get;set;} + + /// <summary> + /// Number of images + /// </summary> + [JsonProperty(PropertyName = "ImageCount")] + public string ImageCount {get;set;} + + /// <summary> + /// user's location + /// </summary> + [JsonProperty(PropertyName = "Location")] + public string Location {get;set;} + + /// <summary> + /// ID of account owner + /// </summary> + [JsonProperty(PropertyName = "OwnerId")] + public string OwnerId {get;set;} + + /// <summary> + /// Name of account owner + /// </summary> + [JsonProperty(PropertyName = "OwnerName")] + public string OwnerName {get;set;} + + /// <summary> + /// Title of Linked URL + /// </summary> + [JsonProperty(PropertyName = "Title")] + public string Title {get;set;} + + /// <summary> + /// String to identify the type of parameter + /// </summary> + [JsonProperty(PropertyName = "Type")] + public string Type {get;set;} + + /// <summary> + /// Updated date + /// </summary> + [JsonProperty(PropertyName = "UpdatedDate")] + public string UpdatedDate {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/Audio.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/Audio.cs new file mode 100644 index 0000000..293c455 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/Audio.cs @@ -0,0 +1,73 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Response containing Definition of Complete Audio data + /// </summary> + public class Audio + { + /// <summary> + /// Artist + /// </summary> + [JsonProperty(PropertyName = "Artist")] + public string Artist {get;set;} + + /// <summary> + /// Date of Creation of Profile + /// </summary> + [JsonProperty(PropertyName = "CreatedDate")] + public string CreatedDate {get;set;} + + /// <summary> + /// Total time of audio + /// </summary> + [JsonProperty(PropertyName = "Duration")] + public string Duration {get;set;} + + /// <summary> + /// Id of audio file + /// </summary> + [JsonProperty(PropertyName = "ID")] + public string ID {get;set;} + + /// <summary> + /// ID of account owner + /// </summary> + [JsonProperty(PropertyName = "OwnerId")] + public string OwnerId {get;set;} + + /// <summary> + /// Name of account owner + /// </summary> + [JsonProperty(PropertyName = "OwnerName")] + public string OwnerName {get;set;} + + /// <summary> + /// Title of audio file + /// </summary> + [JsonProperty(PropertyName = "Title")] + public string Title {get;set;} + + /// <summary> + /// Updated date + /// </summary> + [JsonProperty(PropertyName = "UpdatedDate")] + public string UpdatedDate {get;set;} + + /// <summary> + /// String represents website url + /// </summary> + [JsonProperty(PropertyName = "Url")] + public string Url {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/BackupCodeResponse.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/BackupCodeResponse.cs new file mode 100644 index 0000000..eb514d2 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/BackupCodeResponse.cs @@ -0,0 +1,26 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System.Collections.Generic; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Response containing Definition of Complete Backup Code data + /// </summary> + public class BackupCodeResponse + { + /// <summary> + /// The Code generated as a recourse + /// </summary> + [JsonProperty(PropertyName = "BackUpCodes")] + public List<string> BackUpCodes {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/CheckIn.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/CheckIn.cs new file mode 100644 index 0000000..8d01e30 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/CheckIn.cs @@ -0,0 +1,103 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Response containing Definition of Complete CheckIn data + /// </summary> + public class CheckIn + { + /// <summary> + /// Array of objects,String represents address of user + /// </summary> + [JsonProperty(PropertyName = "Address")] + public string Address {get;set;} + + /// <summary> + /// user's city + /// </summary> + [JsonProperty(PropertyName = "City")] + public string City {get;set;} + + /// <summary> + /// Country of the user + /// </summary> + [JsonProperty(PropertyName = "Country")] + public string Country {get;set;} + + /// <summary> + /// Date of Creation of Profile + /// </summary> + [JsonProperty(PropertyName = "CreatedDate")] + public string CreatedDate {get;set;} + + /// <summary> + /// distance + /// </summary> + [JsonProperty(PropertyName = "Distance")] + public string Distance {get;set;} + + /// <summary> + /// ID of the User + /// </summary> + [JsonProperty(PropertyName = "ID")] + public string ID {get;set;} + + /// <summary> + /// image URL should be absolute and has HTTPS domain + /// </summary> + [JsonProperty(PropertyName = "ImageUrl")] + public string ImageUrl {get;set;} + + /// <summary> + /// The Latitude + /// </summary> + [JsonProperty(PropertyName = "Latitude")] + public string Latitude {get;set;} + + /// <summary> + /// The Longitude + /// </summary> + [JsonProperty(PropertyName = "Longitude")] + public string Longitude {get;set;} + + /// <summary> + /// message + /// </summary> + [JsonProperty(PropertyName = "Message")] + public string Message {get;set;} + + /// <summary> + /// ID of account owner + /// </summary> + [JsonProperty(PropertyName = "OwnerId")] + public string OwnerId {get;set;} + + /// <summary> + /// Name of account owner + /// </summary> + [JsonProperty(PropertyName = "OwnerName")] + public string OwnerName {get;set;} + + /// <summary> + /// The place title + /// </summary> + [JsonProperty(PropertyName = "PlaceTitle")] + public string PlaceTitle {get;set;} + + /// <summary> + /// String to identify the type of parameter + /// </summary> + [JsonProperty(PropertyName = "Type")] + public string Type {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/Contact.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/Contact.cs new file mode 100644 index 0000000..3002950 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/Contact.cs @@ -0,0 +1,91 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Response containing Definition of Complete Contact data + /// </summary> + public class Contact + { + /// <summary> + /// Country of the user + /// </summary> + [JsonProperty(PropertyName = "Country")] + public string Country {get;set;} + + /// <summary> + /// user's date of birth + /// </summary> + [JsonProperty(PropertyName = "DateOfBirth")] + public string DateOfBirth {get;set;} + + /// <summary> + /// user's email address + /// </summary> + [JsonProperty(PropertyName = "EmailID")] + public string EmailID {get;set;} + + /// <summary> + /// user's gender + /// </summary> + [JsonProperty(PropertyName = "Gender")] + public string Gender {get;set;} + + /// <summary> + /// Contact ID + /// </summary> + [JsonProperty(PropertyName = "ID")] + public string ID {get;set;} + + /// <summary> + /// image URL should be absolute and has HTTPS domain + /// </summary> + [JsonProperty(PropertyName = "ImageUrl")] + public string ImageUrl {get;set;} + + /// <summary> + /// Industry name + /// </summary> + [JsonProperty(PropertyName = "Industry")] + public string Industry {get;set;} + + /// <summary> + /// Contact location + /// </summary> + [JsonProperty(PropertyName = "Location")] + public string Location {get;set;} + + /// <summary> + /// Contact's name + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + /// <summary> + /// Phone number of contact + /// </summary> + [JsonProperty(PropertyName = "PhoneNumber")] + public string PhoneNumber {get;set;} + + /// <summary> + /// Profile URL + /// </summary> + [JsonProperty(PropertyName = "ProfileUrl")] + public string ProfileUrl {get;set;} + + /// <summary> + /// Main body of the Status update. + /// </summary> + [JsonProperty(PropertyName = "Status")] + public string Status {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/CountryCodeName.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/CountryCodeName.cs new file mode 100644 index 0000000..ceed40a --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/CountryCodeName.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Response containing Definition of Complete Country Code data + /// </summary> + public class CountryCodeName + { + /// <summary> + /// Country code + /// </summary> + [JsonProperty(PropertyName = "Code")] + public string Code {get;set;} + + /// <summary> + /// Country name + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/CursorResponse.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/CursorResponse.cs new file mode 100644 index 0000000..bf9b740 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/CursorResponse.cs @@ -0,0 +1,32 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System.Collections.Generic; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Response containing Definition of Complete Cursor data + /// </summary> + public class CursorResponse<T> + { + /// <summary> + /// Data + /// </summary> + [JsonProperty(PropertyName = "Data")] + public List<T> Data {get;set;} + + /// <summary> + /// Cursor value if not all contacts can be retrieved once. + /// </summary> + [JsonProperty(PropertyName = "NextCursor")] + public string NextCursor {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/DeleteRequestAcceptResponse.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/DeleteRequestAcceptResponse.cs new file mode 100644 index 0000000..485a5a9 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/DeleteRequestAcceptResponse.cs @@ -0,0 +1,25 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Response containing Definition of Delete Request + /// </summary> + public class DeleteRequestAcceptResponse + { + /// <summary> + /// Is Delete Request Accepted + /// </summary> + [JsonProperty(PropertyName = "IsDeleteRequestAccepted")] + public bool IsDeleteRequestAccepted {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/DeleteResponse.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/DeleteResponse.cs new file mode 100644 index 0000000..1480601 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/DeleteResponse.cs @@ -0,0 +1,25 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Response containing Definition of Delete Request + /// </summary> + public class DeleteResponse + { + /// <summary> + /// boolean type value, default is true + /// </summary> + [JsonProperty(PropertyName = "IsDeleted")] + public bool IsDeleted {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/EmailVerificationTokenResponse.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/EmailVerificationTokenResponse.cs new file mode 100644 index 0000000..a9649bc --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/EmailVerificationTokenResponse.cs @@ -0,0 +1,25 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Response containing Definition of Complete Verification data + /// </summary> + public class EmailVerificationTokenResponse + { + /// <summary> + /// Verification token received in the email + /// </summary> + [JsonProperty(PropertyName = "VerificationToken")] + public string VerificationToken {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/Events.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/Events.cs new file mode 100644 index 0000000..5bd344e --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/Events.cs @@ -0,0 +1,85 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Response containing Definition of Complete Events data + /// </summary> + public class Events + { + /// <summary> + /// detailed information + /// </summary> + [JsonProperty(PropertyName = "Description")] + public string Description {get;set;} + + /// <summary> + /// EndTime + /// </summary> + [JsonProperty(PropertyName = "EndTime")] + public string EndTime {get;set;} + + /// <summary> + /// ID of the User + /// </summary> + [JsonProperty(PropertyName = "ID")] + public string ID {get;set;} + + /// <summary> + /// Event Location + /// </summary> + [JsonProperty(PropertyName = "Location")] + public string Location {get;set;} + + /// <summary> + /// Event name + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + /// <summary> + /// ID of account owner + /// </summary> + [JsonProperty(PropertyName = "OwnerId")] + public string OwnerId {get;set;} + + /// <summary> + /// Name of account owner + /// </summary> + [JsonProperty(PropertyName = "OwnerName")] + public string OwnerName {get;set;} + + /// <summary> + /// Privacy + /// </summary> + [JsonProperty(PropertyName = "Privacy")] + public string Privacy {get;set;} + + /// <summary> + /// RsvpStatus + /// </summary> + [JsonProperty(PropertyName = "RsvpStatus")] + public string RsvpStatus {get;set;} + + /// <summary> + /// Start time + /// </summary> + [JsonProperty(PropertyName = "StartTime")] + public string StartTime {get;set;} + + /// <summary> + /// Updated date + /// </summary> + [JsonProperty(PropertyName = "UpdatedDate")] + public string UpdatedDate {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/ExistResponse.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/ExistResponse.cs new file mode 100644 index 0000000..c4b778a --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/ExistResponse.cs @@ -0,0 +1,25 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Response containing Definition Complete ExistResponse data + /// </summary> + public class ExistResponse + { + /// <summary> + /// IsExist + /// </summary> + [JsonProperty(PropertyName = "IsExist")] + public bool IsExist {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/FacebookAlbumImages.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/FacebookAlbumImages.cs new file mode 100644 index 0000000..004eaaa --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/FacebookAlbumImages.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Response containing Definition of Complete Album data + /// </summary> + public class FacebookAlbumImages + { + /// <summary> + /// Photo dimensions + /// </summary> + [JsonProperty(PropertyName = "Dimensions")] + public string Dimensions {get;set;} + + /// <summary> + /// Images + /// </summary> + [JsonProperty(PropertyName = "Image")] + public string Image {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/ForgotPasswordResponse.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/ForgotPasswordResponse.cs new file mode 100644 index 0000000..730d579 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/ForgotPasswordResponse.cs @@ -0,0 +1,32 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System.Collections.Generic; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Response containing Definition of Complete Forgot Password data + /// </summary> + public class ForgotPasswordResponse + { + /// <summary> + /// Forgot token + /// </summary> + [JsonProperty(PropertyName = "ForgotToken")] + public string ForgotToken {get;set;} + + /// <summary> + /// Identity providers + /// </summary> + [JsonProperty(PropertyName = "IdentityProviders")] + public List<string> IdentityProviders {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/GetResponse.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/GetResponse.cs new file mode 100644 index 0000000..47ca515 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/GetResponse.cs @@ -0,0 +1,25 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Response containing Definition of Complete GetType data + /// </summary> + public class GetResponse<T> + { + /// <summary> + /// Data + /// </summary> + [JsonProperty(PropertyName = "Data")] + public T Data {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/Group.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/Group.cs new file mode 100644 index 0000000..c372501 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/Group.cs @@ -0,0 +1,79 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Response containing Definition of Complete group data + /// </summary> + public class Group + { + /// <summary> + /// Country of the user + /// </summary> + [JsonProperty(PropertyName = "Country")] + public string Country {get;set;} + + /// <summary> + /// detailed information + /// </summary> + [JsonProperty(PropertyName = "Description")] + public string Description {get;set;} + + /// <summary> + /// user's email + /// </summary> + [JsonProperty(PropertyName = "Email")] + public string Email {get;set;} + + /// <summary> + /// Identity providers + /// </summary> + [JsonProperty(PropertyName = "ID")] + public string ID {get;set;} + + /// <summary> + /// Images + /// </summary> + [JsonProperty(PropertyName = "Image")] + public string Image {get;set;} + + /// <summary> + /// logo + /// </summary> + [JsonProperty(PropertyName = "Logo")] + public string Logo {get;set;} + + /// <summary> + /// Number of members + /// </summary> + [JsonProperty(PropertyName = "MemberCount")] + public string MemberCount {get;set;} + + /// <summary> + /// Name of the customer + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + /// <summary> + /// Postal code value that need to be updated + /// </summary> + [JsonProperty(PropertyName = "PostalCode")] + public string PostalCode {get;set;} + + /// <summary> + /// String to identify the type of parameter + /// </summary> + [JsonProperty(PropertyName = "Type")] + public string Type {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/Like.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/Like.cs new file mode 100644 index 0000000..489b802 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/Like.cs @@ -0,0 +1,55 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Response containing Definition of Complete like data + /// </summary> + public class Like + { + /// <summary> + /// Like category + /// </summary> + [JsonProperty(PropertyName = "Category")] + public string Category {get;set;} + + /// <summary> + /// Date of Creation of Profile + /// </summary> + [JsonProperty(PropertyName = "CreatedDate")] + public string CreatedDate {get;set;} + + /// <summary> + /// detailed information + /// </summary> + [JsonProperty(PropertyName = "Description")] + public string Description {get;set;} + + /// <summary> + /// ID of the User + /// </summary> + [JsonProperty(PropertyName = "ID")] + public string ID {get;set;} + + /// <summary> + /// Name of the customer + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + /// <summary> + /// Personal Website a User has + /// </summary> + [JsonProperty(PropertyName = "Website")] + public string Website {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/Page.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/Page.cs new file mode 100644 index 0000000..452fa5f --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/Page.cs @@ -0,0 +1,182 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System.Collections.Generic; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Response containing Definition of Complete page data + /// </summary> + public class Page + { + /// <summary> + /// About value that need to be inserted + /// </summary> + [JsonProperty(PropertyName = "About")] + public string About {get;set;} + + /// <summary> + /// Array of Objects,String represents Id, Name and Issuer + /// </summary> + [JsonProperty(PropertyName = "Awards")] + public string Awards {get;set;} + + /// <summary> + /// Page category + /// </summary> + [JsonProperty(PropertyName = "Category")] + public string Category {get;set;} + + /// <summary> + /// Category list + /// </summary> + [JsonProperty(PropertyName = "CategoryList")] + public List<PageCategoryList> CategoryList {get;set;} + + /// <summary> + /// checkin count + /// </summary> + [JsonProperty(PropertyName = "CheckinCount")] + public string CheckinCount {get;set;} + + /// <summary> + /// Image url + /// </summary> + [JsonProperty(PropertyName = "CoverImage")] + public PageCover CoverImage {get;set;} + + /// <summary> + /// detailed information + /// </summary> + [JsonProperty(PropertyName = "Description")] + public string Description {get;set;} + + /// <summary> + /// Employee count range + /// </summary> + [JsonProperty(PropertyName = "EmployeeCountRange")] + public PageCodeName EmployeeCountRange {get;set;} + + /// <summary> + /// Founded + /// </summary> + [JsonProperty(PropertyName = "Founded")] + public string Founded {get;set;} + + /// <summary> + /// Page id + /// </summary> + [JsonProperty(PropertyName = "ID")] + public string ID {get;set;} + + /// <summary> + /// Image url + /// </summary> + [JsonProperty(PropertyName = "Image")] + public string Image {get;set;} + + /// <summary> + /// List of Industries + /// </summary> + [JsonProperty(PropertyName = "Industries")] + public List<PageCodeName> Industries {get;set;} + + /// <summary> + /// Page likes + /// </summary> + [JsonProperty(PropertyName = "Likes")] + public string Likes {get;set;} + + /// <summary> + /// Location of page + /// </summary> + [JsonProperty(PropertyName = "Locations")] + public List<PageLocations> Locations {get;set;} + + /// <summary> + /// Page mission + /// </summary> + [JsonProperty(PropertyName = "Mission")] + public string Mission {get;set;} + + /// <summary> + /// Page name + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + /// <summary> + /// New Phone Number + /// </summary> + [JsonProperty(PropertyName = "Phone")] + public string Phone {get;set;} + + /// <summary> + /// Products + /// </summary> + [JsonProperty(PropertyName = "Products")] + public string Products {get;set;} + + /// <summary> + /// Published + /// </summary> + [JsonProperty(PropertyName = "Published")] + public bool Published {get;set;} + + /// <summary> + /// Release Date + /// </summary> + [JsonProperty(PropertyName = "ReleaseDate")] + public string ReleaseDate {get;set;} + + /// <summary> + /// Specialties + /// </summary> + [JsonProperty(PropertyName = "Specialties")] + public Speciality Specialties {get;set;} + + /// <summary> + /// Page Status + /// </summary> + [JsonProperty(PropertyName = "Status")] + public PageCodeName Status {get;set;} + + /// <summary> + /// Stock Exchange + /// </summary> + [JsonProperty(PropertyName = "StockExchange")] + public PageCodeName StockExchange {get;set;} + + /// <summary> + /// Talking About Count + /// </summary> + [JsonProperty(PropertyName = "TalkingAboutCount")] + public string TalkingAboutCount {get;set;} + + /// <summary> + /// String represents website url + /// </summary> + [JsonProperty(PropertyName = "Url")] + public string Url {get;set;} + + /// <summary> + /// Username of the user + /// </summary> + [JsonProperty(PropertyName = "UserName")] + public string UserName {get;set;} + + /// <summary> + /// Personal Website a User has + /// </summary> + [JsonProperty(PropertyName = "Website")] + public string Website {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/PageCategoryList.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/PageCategoryList.cs new file mode 100644 index 0000000..846feb1 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/PageCategoryList.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Response containing Definition of Complete Page Category data + /// </summary> + public class PageCategoryList + { + /// <summary> + /// Page category id + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// Page category name + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/PageCodeName.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/PageCodeName.cs new file mode 100644 index 0000000..47c1ad1 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/PageCodeName.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Response containing Definition of Complete Page Category data + /// </summary> + public class PageCodeName + { + /// <summary> + /// page code + /// </summary> + [JsonProperty(PropertyName = "Code")] + public string Code {get;set;} + + /// <summary> + /// page code name + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/PageCover.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/PageCover.cs new file mode 100644 index 0000000..01b69a1 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/PageCover.cs @@ -0,0 +1,43 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Response containing Definition of Complete Page Cover data + /// </summary> + public class PageCover + { + /// <summary> + /// Page cover id + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// Page cover offset X + /// </summary> + [JsonProperty(PropertyName = "OffsetX")] + public string OffsetX {get;set;} + + /// <summary> + /// Page cover offset Y + /// </summary> + [JsonProperty(PropertyName = "OffsetY")] + public string OffsetY {get;set;} + + /// <summary> + /// Page cover source + /// </summary> + [JsonProperty(PropertyName = "Source")] + public string Source {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/PageLocations.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/PageLocations.cs new file mode 100644 index 0000000..2368ef3 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/PageLocations.cs @@ -0,0 +1,67 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Response containing Definition of Complete Page data + /// </summary> + public class PageLocations + { + /// <summary> + /// user's city + /// </summary> + [JsonProperty(PropertyName = "City")] + public string City {get;set;} + + /// <summary> + /// Country of the user + /// </summary> + [JsonProperty(PropertyName = "Country")] + public CountryCodeName Country {get;set;} + + /// <summary> + /// The Latitude + /// </summary> + [JsonProperty(PropertyName = "Latitude")] + public double Latitude {get;set;} + + /// <summary> + /// The Longitude + /// </summary> + [JsonProperty(PropertyName = "Longitude")] + public double Longitude {get;set;} + + /// <summary> + /// New Phone Number + /// </summary> + [JsonProperty(PropertyName = "Phone")] + public string Phone {get;set;} + + /// <summary> + /// State of the user + /// </summary> + [JsonProperty(PropertyName = "State")] + public string State {get;set;} + + /// <summary> + /// Street of the user + /// </summary> + [JsonProperty(PropertyName = "Street")] + public string Street {get;set;} + + /// <summary> + /// ZipCode of the user + /// </summary> + [JsonProperty(PropertyName = "Zip")] + public string Zip {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/Photo.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/Photo.cs new file mode 100644 index 0000000..e4a04af --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/Photo.cs @@ -0,0 +1,110 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System.Collections.Generic; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Response containing Definition of Complete Photo data + /// </summary> + public class Photo + { + /// <summary> + /// User's Album Id + /// </summary> + [JsonProperty(PropertyName = "AlbumId")] + public string AlbumId {get;set;} + + /// <summary> + /// Date of Creation of Profile + /// </summary> + [JsonProperty(PropertyName = "CreatedDate")] + public string CreatedDate {get;set;} + + /// <summary> + /// detailed information + /// </summary> + [JsonProperty(PropertyName = "Description")] + public string Description {get;set;} + + /// <summary> + /// DirectUrl + /// </summary> + [JsonProperty(PropertyName = "DirectUrl")] + public string DirectUrl {get;set;} + + /// <summary> + /// Height of the image + /// </summary> + [JsonProperty(PropertyName = "Height")] + public string Height {get;set;} + + /// <summary> + /// Id of the image + /// </summary> + [JsonProperty(PropertyName = "ID")] + public string ID {get;set;} + + /// <summary> + /// Images + /// </summary> + [JsonProperty(PropertyName = "Images")] + public List<FacebookAlbumImages> Images {get;set;} + + /// <summary> + /// image URL should be absolute and has HTTPS domain + /// </summary> + [JsonProperty(PropertyName = "ImageUrl")] + public string ImageUrl {get;set;} + + /// <summary> + /// Image's link + /// </summary> + [JsonProperty(PropertyName = "Link")] + public string Link {get;set;} + + /// <summary> + /// Photo Location + /// </summary> + [JsonProperty(PropertyName = "Location")] + public string Location {get;set;} + + /// <summary> + /// Name of the image + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + /// <summary> + /// ID of account owner + /// </summary> + [JsonProperty(PropertyName = "OwnerId")] + public string OwnerId {get;set;} + + /// <summary> + /// Name of account owner + /// </summary> + [JsonProperty(PropertyName = "OwnerName")] + public string OwnerName {get;set;} + + /// <summary> + /// Updated date + /// </summary> + [JsonProperty(PropertyName = "UpdatedDate")] + public string UpdatedDate {get;set;} + + /// <summary> + /// Width of the image + /// </summary> + [JsonProperty(PropertyName = "Width")] + public string Width {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/Post.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/Post.cs new file mode 100644 index 0000000..eb0612d --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/Post.cs @@ -0,0 +1,85 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Response containing Definition of Complete Post data + /// </summary> + public class Post + { + /// <summary> + /// ID of the User + /// </summary> + [JsonProperty(PropertyName = "ID")] + public string ID {get;set;} + + /// <summary> + /// Likes + /// </summary> + [JsonProperty(PropertyName = "Likes")] + public int Likes {get;set;} + + /// <summary> + /// message + /// </summary> + [JsonProperty(PropertyName = "Message")] + public string Message {get;set;} + + /// <summary> + /// Name of the customer + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + /// <summary> + /// Images + /// </summary> + [JsonProperty(PropertyName = "Picture")] + public string Picture {get;set;} + + /// <summary> + /// Location of user + /// </summary> + [JsonProperty(PropertyName = "Place")] + public string Place {get;set;} + + /// <summary> + /// share + /// </summary> + [JsonProperty(PropertyName = "Share")] + public int Share {get;set;} + + /// <summary> + /// Start time + /// </summary> + [JsonProperty(PropertyName = "StartTime")] + public string StartTime {get;set;} + + /// <summary> + /// Title of Linked URL + /// </summary> + [JsonProperty(PropertyName = "Title")] + public string Title {get;set;} + + /// <summary> + /// String to identify the type of parameter + /// </summary> + [JsonProperty(PropertyName = "Type")] + public string Type {get;set;} + + /// <summary> + /// last update time + /// </summary> + [JsonProperty(PropertyName = "UpdateTime")] + public string UpdateTime {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/PostResponse.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/PostResponse.cs new file mode 100644 index 0000000..568d796 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/PostResponse.cs @@ -0,0 +1,25 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Response containing Definition of Complete Validation data + /// </summary> + public class PostResponse + { + /// <summary> + /// check data is posted + /// </summary> + [JsonProperty(PropertyName = "IsPosted")] + public bool IsPosted {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/PostValidationResponse.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/PostValidationResponse.cs new file mode 100644 index 0000000..229672b --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/PostValidationResponse.cs @@ -0,0 +1,25 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Response containing Definition of Complete Validation data + /// </summary> + public class PostValidationResponse + { + /// <summary> + /// check data is validate + /// </summary> + [JsonProperty(PropertyName = "IsValid")] + public bool IsValid {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/PrivacyPolicyHistoryResponse.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/PrivacyPolicyHistoryResponse.cs new file mode 100644 index 0000000..8faabd0 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/PrivacyPolicyHistoryResponse.cs @@ -0,0 +1,39 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System.Collections.Generic; +using Newtonsoft.Json; +using LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Response containing Definition of Complete PrivacyPolicyHistory + /// </summary> + public class PrivacyPolicyHistoryResponse + { + /// <summary> + /// Current privacy policy + /// </summary> + [JsonProperty(PropertyName = "Current")] + public AcceptedPrivacyPolicy Current {get;set;} + + /// <summary> + /// Privacy policy history + /// </summary> + [JsonProperty(PropertyName = "History")] + public List<AcceptedPrivacyPolicy> History {get;set;} + + /// <summary> + /// UID, the unified identifier for each user account + /// </summary> + [JsonProperty(PropertyName = "Uid")] + public string Uid {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/RegistrationDataField.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/RegistrationDataField.cs new file mode 100644 index 0000000..fea8c86 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/RegistrationDataField.cs @@ -0,0 +1,25 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Response containing Definition of Custom registration data object + /// </summary> + public class RegistrationDataField:RegistrationDataFieldBasic + { + /// <summary> + /// Validation Code/Secret Code,Code Parameter, given when Login Dialog is performed + /// </summary> + [JsonProperty(PropertyName = "Code")] + public string Code {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/RegistrationDataFieldBasic.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/RegistrationDataFieldBasic.cs new file mode 100644 index 0000000..2183c10 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/RegistrationDataFieldBasic.cs @@ -0,0 +1,74 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Response containing Definition of Complete Registration Data Basic Field + /// </summary> + public class RegistrationDataFieldBasic + { + /// <summary> + /// Creation data + /// </summary> + [JsonProperty(PropertyName = "DateCreated")] + public DateTime DateCreated {get;set;} + + /// <summary> + /// Any modification date + /// </summary> + [JsonProperty(PropertyName = "DateModified")] + public DateTime DateModified {get;set;} + + /// <summary> + /// ID of the User + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// boolean type value, default is true + /// </summary> + [JsonProperty(PropertyName = "IsActive")] + public bool IsActive {get;set;} + + /// <summary> + /// Text to display for the dropdown member + /// </summary> + [JsonProperty(PropertyName = "Key")] + public string Key {get;set;} + + /// <summary> + /// Id of parent dropdown member + /// </summary> + [JsonProperty(PropertyName = "ParentId")] + public string ParentId {get;set;} + + /// <summary> + /// Parent type + /// </summary> + [JsonProperty(PropertyName = "ParentType")] + public string ParentType {get;set;} + + /// <summary> + /// String to identify the type of parameter + /// </summary> + [JsonProperty(PropertyName = "Type")] + public string Type {get;set;} + + /// <summary> + /// Value of the dropdown member + /// </summary> + [JsonProperty(PropertyName = "Value")] + public string Value {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/RoleContextResponse.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/RoleContextResponse.cs new file mode 100644 index 0000000..6ce1494 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/RoleContextResponse.cs @@ -0,0 +1,39 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Response containing Definition of RoleContext + /// </summary> + public class RoleContextResponse + { + /// <summary> + /// Array of String, which represents the additional permissions + /// </summary> + [JsonProperty(PropertyName = "AdditionalPermissions")] + public List<string> AdditionalPermissions {get;set;} + + /// <summary> + /// Role expiration date + /// </summary> + [JsonProperty(PropertyName = "Expiration")] + public DateTime? Expiration {get;set;} + + /// <summary> + /// Array of String, which represents the role name + /// </summary> + [JsonProperty(PropertyName = "Roles")] + public List<string> Roles {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/RoleContextResponseModel.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/RoleContextResponseModel.cs new file mode 100644 index 0000000..ae0da61 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/RoleContextResponseModel.cs @@ -0,0 +1,58 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using Newtonsoft.Json; +using LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Response containing Definition of RoleContext Profile + /// </summary> + public class RoleContextResponseModel + { + /// <summary> + /// user's email + /// </summary> + [JsonProperty(PropertyName = "Email")] + public List<Email> Email {get;set;} + + /// <summary> + /// Users complete name + /// </summary> + [JsonProperty(PropertyName = "FullName")] + public string FullName {get;set;} + + /// <summary> + /// image URL should be absolute and has HTTPS domain + /// </summary> + [JsonProperty(PropertyName = "ImageUrl")] + public string ImageUrl {get;set;} + + /// <summary> + /// last login date + /// </summary> + [JsonProperty(PropertyName = "LastLoginDate")] + public DateTime LastLoginDate {get;set;} + + /// <summary> + /// Array of RoleContext object, see body tab for structure + /// </summary> + [JsonProperty(PropertyName = "RoleContext")] + public RoleContextResponse RoleContext {get;set;} + + /// <summary> + /// UID, the unified identifier for each user account + /// </summary> + [JsonProperty(PropertyName = "Uid")] + public string Uid {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/RoleModel.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/RoleModel.cs new file mode 100644 index 0000000..ab5c7d0 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/RoleModel.cs @@ -0,0 +1,32 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System.Collections.Generic; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Response containing Definition of Complete role data + /// </summary> + public class RoleModel + { + /// <summary> + /// Array of String, which represents the role name + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + /// <summary> + /// Any Permission name for the role + /// </summary> + [JsonProperty(PropertyName = "Permissions")] + public Dictionary<string,bool> Permissions {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/ServiceInfoModel.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/ServiceInfoModel.cs new file mode 100644 index 0000000..64cae04 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/ServiceInfoModel.cs @@ -0,0 +1,177 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System.Collections.Generic; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + public class ConfigResponseModel + { + public SocialSchema SocialSchema { get; set; } + public List<RegistrationFormSchema> RegistrationFormSchema { get; set; } + public SecurityQuestionsBase SecurityQuestions { get; set; } + public bool IsHttps { get; set; } + public string AppName { get; set; } + public bool IsCustomerRegistration { get; set; } + public ApiVersion ApiVersion { get; set; } + public string EmailVerificationFlow { get; set; } + public bool IsPhoneLogin { get; set; } + public bool IsDisabledSocialRegistration { get; set; } + public bool IsDisabledAccountLinking { get; set; } + public bool IsAgeRestriction { get; set; } + public bool IsSecurityQuestion { get; set; } + public bool AskRequiredFieldsOnTraditionalLogin { get; set; } + public bool IsLogoutOnEmailVerification { get; set; } + public bool IsNoCallbackForSocialLogin { get; set; } + public bool IsUserNameLogin { get; set; } + public bool IsMobileCallbackForSocialLogin { get; set; } + public bool IsInvisibleRecaptcha { get; set; } + public bool IsBackendJobEnabled { get; set; } + public bool AskPasswordOnSocialLogin { get; set; } + public bool AskEmailIdForUnverifiedUserLogin { get; set; } + public bool AskOptionalFieldsOnSocialSignup { get; set; } + public bool IsRiskBasedAuthentication { get; set; } + public bool IsV2Recaptcha { get; set; } + public bool CheckPhoneNoAvailabilityOnRegistration { get; set; } + public bool DuplicateEmailWithUniqueUsername { get; set; } + public bool StoreOnlyRegistrationFormFieldsForSocial { get; set; } + public bool OTPEmailVerification { get; set; } + public LoginLockedConfiguration LoginLockedConfiguration { get; set; } + public IsInstantSignin IsInstantSignin { get; set; } + public bool IsLoginOnEmailVerification { get; set; } + public TwoFactorAuthentication TwoFactorAuthentication { get; set; } + public bool IsRememberMe { get; set; } + public string V2RecaptchaSiteKey { get; set; } + public string QQTencentCaptchaKey { get; set; } + public bool NoRegistration { get; set; } + public object CustomDomain { get; set; } + public PrivacyPolicyConfiguration PrivacyPolicyConfiguration { get; set; } + public OptionalRecaptchaConfiguration OptionalRecaptchaConfiguration { get; set; } + public ApiRequestSigningConfig ApiRequestSigningConfig { get; set; } + } + public class Provider + { + public string Name { get; set; } + public string Endpoint { get; set; } + } + + public class SocialSchema + { + public List<Provider> Providers { get; set; } + } + + public class RegistrationFormSchema + { + public bool Checked { get; set; } + public string type { get; set; } + public string name { get; set; } + public string display { get; set; } + public string rules { get; set; } + public object options { get; set; } + public string permission { get; set; } + public object DataSource { get; set; } + public string Parent { get; set; } + public object ParentDataSource { get; set; } + } + + public class SecurityQuestionsBase + { + public List<object> Questions { get; set; } + public int SecurityQuestionCount { get; set; } + } + + public class ApiVersion + { + public bool v1 { get; set; } + public bool v2 { get; set; } + } + + public class SuspendConfiguration + { + public int EffectivePeriodInSeconds { get; set; } + } + + public class LoginLockedConfiguration + { + public string LoginLockedType { get; set; } + public int MaximumFailedLoginAttempts { get; set; } + public SuspendConfiguration SuspendConfiguration { get; set; } + } + + public class IsInstantSignin + { + public bool EmailLink { get; set; } + public bool SmsOtp { get; set; } + } + + public class TwoFactorAuthentication + { + public bool IsEnabled { get; set; } + public bool IsRequired { get; set; } + public bool IsGoogleAuthenticator { get; set; } + } + + public class PrivacyPolicyConfiguration + { + } + + public class Apis + { + public bool PostForgotPasswordByEmail { get; set; } + public bool PostForgotPasswordByPhone { get; set; } + public bool PutChangePassword { get; set; } + public bool PostLoginByEmailAndPassword { get; set; } + public bool PostLoginByUserNameAndPassword { get; set; } + public bool PostLoginByPhoneAndPassword { get; set; } + public bool PutUpdateProfile { get; set; } + } + + public class OptionalRecaptchaConfiguration + { + public bool IsEnabled { get; set; } + public Apis Apis { get; set; } + } + + public class ApiRequestSigningConfig + { + public bool IsEnabled { get; set; } + public string Mode { get; set; } + } + + /// <summary> + /// Response containing Definition of Complete service info data + /// </summary> + public class ServiceInfoModel + { + /// <summary> + /// Current time + /// </summary> + [JsonProperty(PropertyName = "CurrentTime")] + public string CurrentTime {get;set;} + + /// <summary> + /// Location of server + /// </summary> + [JsonProperty(PropertyName = "ServerLocation")] + public string ServerLocation {get;set;} + + /// <summary> + /// server name + /// </summary> + [JsonProperty(PropertyName = "ServerName")] + public string ServerName {get;set;} + + /// <summary> + /// SOTT is a secure one time token + /// </summary> + [JsonProperty(PropertyName = "Sott")] + public ServiceSottInfo Sott {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/ServiceSottInfo.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/ServiceSottInfo.cs new file mode 100644 index 0000000..bd1f1ed --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/ServiceSottInfo.cs @@ -0,0 +1,49 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Response containing Definition of Complete Sott data + /// </summary> + public class ServiceSottInfo + { + /// <summary> + /// EndTime + /// </summary> + [JsonProperty(PropertyName = "EndTime")] + public string EndTime {get;set;} + + /// <summary> + /// Forwarded IP + /// </summary> + [JsonProperty(PropertyName = "ForWardedIP")] + public string ForWardedIP {get;set;} + + /// <summary> + /// users ip address + /// </summary> + [JsonProperty(PropertyName = "IP")] + public string IP {get;set;} + + /// <summary> + /// Start time + /// </summary> + [JsonProperty(PropertyName = "StartTime")] + public string StartTime {get;set;} + + /// <summary> + /// Difference between start time and end time + /// </summary> + [JsonProperty(PropertyName = "TimeDifference")] + public string TimeDifference {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/Speciality.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/Speciality.cs new file mode 100644 index 0000000..69405cb --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/Speciality.cs @@ -0,0 +1,32 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System.Collections.Generic; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Response containing Definition of Complete Speciality data + /// </summary> + public class Speciality + { + /// <summary> + /// User's speciality names + /// </summary> + [JsonProperty(PropertyName = "SpecialityNames")] + public List<string> SpecialityNames {get;set;} + + /// <summary> + /// Total User's speciality + /// </summary> + [JsonProperty(PropertyName = "Total")] + public int Total {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/Status.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/Status.cs new file mode 100644 index 0000000..d35d6f1 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/Status.cs @@ -0,0 +1,73 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Response containing Definition of Complete Status data + /// </summary> + public class Status + { + /// <summary> + /// Status date and time + /// </summary> + [JsonProperty(PropertyName = "DateTime")] + public string DateTime {get;set;} + + /// <summary> + /// ID of the User + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// image URL should be absolute and has HTTPS domain + /// </summary> + [JsonProperty(PropertyName = "ImageUrl")] + public string ImageUrl {get;set;} + + /// <summary> + /// Likes + /// </summary> + [JsonProperty(PropertyName = "Likes")] + public int Likes {get;set;} + + /// <summary> + /// Status Link URL + /// </summary> + [JsonProperty(PropertyName = "LinkUrl")] + public string LinkUrl {get;set;} + + /// <summary> + /// Name of the customer + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + /// <summary> + /// Status Place + /// </summary> + [JsonProperty(PropertyName = "Place")] + public string Place {get;set;} + + /// <summary> + /// Status Source + /// </summary> + [JsonProperty(PropertyName = "Source")] + public string Source {get;set;} + + /// <summary> + /// text user + /// </summary> + [JsonProperty(PropertyName = "Text")] + public string Text {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/StatusUpdateStats.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/StatusUpdateStats.cs new file mode 100644 index 0000000..a345cb0 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/StatusUpdateStats.cs @@ -0,0 +1,37 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Response containing Definition of Complete Status Update data + /// </summary> + public class StatusUpdateStats + { + /// <summary> + /// Comments + /// </summary> + [JsonProperty(PropertyName = "Comments")] + public int Comments {get;set;} + + /// <summary> + /// Likes + /// </summary> + [JsonProperty(PropertyName = "Likes")] + public int Likes {get;set;} + + /// <summary> + /// share + /// </summary> + [JsonProperty(PropertyName = "Shares")] + public int Shares {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/TokenInfoResponseModel.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/TokenInfoResponseModel.cs new file mode 100644 index 0000000..d274178 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/TokenInfoResponseModel.cs @@ -0,0 +1,38 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Response containing Definition of Token Information + /// </summary> + public class TokenInfoResponseModel + { + /// <summary> + /// Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + /// </summary> + [JsonProperty(PropertyName = "access_token")] + public Guid Access_Token {get;set;} + + /// <summary> + /// is remember login or not + /// </summary> + [JsonProperty(PropertyName = "isrememberme")] + public bool IsRememberMe {get;set;} + + /// <summary> + /// Name of the provider + /// </summary> + [JsonProperty(PropertyName = "provider")] + public string Provider {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/UserProfilePostResponse.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/UserProfilePostResponse.cs new file mode 100644 index 0000000..9b41804 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/UserProfilePostResponse.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Response containing Definition of Complete Validation and UserProfile data + /// </summary> + public class UserProfilePostResponse<T> + { + /// <summary> + /// Data + /// </summary> + [JsonProperty(PropertyName = "Data")] + public T Data {get;set;} + + /// <summary> + /// check data is posted + /// </summary> + [JsonProperty(PropertyName = "IsPosted")] + public bool IsPosted {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/VerifiedResponse.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/VerifiedResponse.cs new file mode 100644 index 0000000..b427c40 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/VerifiedResponse.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Complete verified response data + /// </summary> + public class VerifiedResponse + { + /// <summary> + /// check data is posted + /// </summary> + [JsonProperty(PropertyName = "IsPosted")] + public bool IsPosted {get;set;} + + /// <summary> + /// is verified or not + /// </summary> + [JsonProperty(PropertyName = "IsVerified")] + public bool IsVerified {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/Video.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/Video.cs new file mode 100644 index 0000000..4e63024 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/Video.cs @@ -0,0 +1,91 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Response containing Definition for Complete Video data + /// </summary> + public class Video + { + /// <summary> + /// Date of Creation of Profile + /// </summary> + [JsonProperty(PropertyName = "CreatedDate")] + public string CreatedDate {get;set;} + + /// <summary> + /// detailed information + /// </summary> + [JsonProperty(PropertyName = "Description")] + public string Description {get;set;} + + /// <summary> + /// Video direct link + /// </summary> + [JsonProperty(PropertyName = "DirectLink")] + public string DirectLink {get;set;} + + /// <summary> + /// Video duration + /// </summary> + [JsonProperty(PropertyName = "Duration")] + public string Duration {get;set;} + + /// <summary> + /// Embed html of video + /// </summary> + [JsonProperty(PropertyName = "EmbedHtml")] + public string EmbedHtml {get;set;} + + /// <summary> + /// Video id + /// </summary> + [JsonProperty(PropertyName = "ID")] + public string ID {get;set;} + + /// <summary> + /// image URL should be absolute and has HTTPS domain + /// </summary> + [JsonProperty(PropertyName = "Image")] + public string Image {get;set;} + + /// <summary> + /// Video name + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + /// <summary> + /// Video owner id + /// </summary> + [JsonProperty(PropertyName = "OwnerId")] + public string OwnerId {get;set;} + + /// <summary> + /// Video owner name + /// </summary> + [JsonProperty(PropertyName = "OwnerName")] + public string OwnerName {get;set;} + + /// <summary> + /// Source of video + /// </summary> + [JsonProperty(PropertyName = "Source")] + public string Source {get;set;} + + /// <summary> + /// Updated date + /// </summary> + [JsonProperty(PropertyName = "UpdatedDate")] + public string UpdatedDate {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/WebHookSubscribeModel.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/WebHookSubscribeModel.cs new file mode 100644 index 0000000..32cdb89 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/OtherObjects/WebHookSubscribeModel.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects + +{ + + /// <summary> + /// Response containing Definition for Complete WebHook data + /// </summary> + public class WebHookSubscribeModel + { + /// <summary> + /// Allowed events: Login, Register, UpdateProfile, ResetPassword, ChangePassword, emailVerification, AddEmail, RemoveEmail, BlockAccount, DeleteAccount, SetUsername, AssignRoles, UnassignRoles, SetPassword, LinkAccount, UnlinkAccount, UpdatePhoneId, VerifyPhoneNumber, CreateCustomObject, UpdateCustomobject, DeleteCustomObject + /// </summary> + [JsonProperty(PropertyName = "Event")] + public string Event {get;set;} + + /// <summary> + /// URL where trigger will send data when it invoke + /// </summary> + [JsonProperty(PropertyName = "TargetUrl")] + public string TargetUrl {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/PostMethodResponse.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/PostMethodResponse.cs new file mode 100644 index 0000000..a2f4104 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/PostMethodResponse.cs @@ -0,0 +1,44 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels + +{ + + /// <summary> + /// Response containing Definition for Complete Validation data + /// </summary> + public class PostMethodResponse + { + /// <summary> + /// check data is posted + /// </summary> + [JsonProperty(PropertyName = "isPosted")] + public bool IsPosted {get;set;} + + } + + /// <summary> + /// Response containing Definition for Complete Validation and profile data + /// </summary> + public class PostMethodResponse<T> + { + /// <summary> + /// Complete user profile data + /// </summary> + [JsonProperty(PropertyName = "data")] + public T Data {get;set;} + + /// <summary> + /// check data is posted + /// </summary> + [JsonProperty(PropertyName = "isPosted")] + public bool IsPosted {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/SMSResponseData.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/SMSResponseData.cs new file mode 100644 index 0000000..5581d54 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/SMSResponseData.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels + +{ + + /// <summary> + /// Response containing Definition for Complete SMS data + /// </summary> + public class SMSResponseData + { + /// <summary> + /// Account Sid + /// </summary> + [JsonProperty(PropertyName = "AccountSid")] + public string AccountSid {get;set;} + + /// <summary> + /// Sid + /// </summary> + [JsonProperty(PropertyName = "Sid")] + public string Sid {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/SecurityQuestions.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/SecurityQuestions.cs new file mode 100644 index 0000000..03e840c --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/SecurityQuestions.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels + +{ + + /// <summary> + /// Response containing Definition for Complete SecurityQuestions data + /// </summary> + public class SecurityQuestions + { + /// <summary> + /// Question + /// </summary> + [JsonProperty(PropertyName = "Question")] + public string Question {get;set;} + + /// <summary> + /// Id of question + /// </summary> + [JsonProperty(PropertyName = "QuestionId")] + public string QuestionId {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/ShortUrlResponse.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/ShortUrlResponse.cs new file mode 100644 index 0000000..876afa7 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/ShortUrlResponse.cs @@ -0,0 +1,37 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels + +{ + + /// <summary> + /// Response containing Definition for Complete ShortUrl data + /// </summary> + public class ShortUrlResponse + { + /// <summary> + /// short url + /// </summary> + [JsonProperty(PropertyName = "ShortUrl")] + public string ShortUrl {get;set;} + + /// <summary> + /// Base 36 key of url + /// </summary> + [JsonProperty(PropertyName = "UrlBase36Key")] + public string UrlBase36Key {get;set;} + + /// <summary> + /// Url key + /// </summary> + [JsonProperty(PropertyName = "UrlKey")] + public long UrlKey {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/SottResponseData.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/SottResponseData.cs new file mode 100644 index 0000000..53551cc --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/SottResponseData.cs @@ -0,0 +1,32 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels + +{ + + /// <summary> + /// Response containing Definition for Complete Sott data + /// </summary> + public class SottResponseData + { + /// <summary> + /// Sott expiry time + /// </summary> + [JsonProperty(PropertyName = "ExpiryTime")] + public DateTime ExpiryTime {get;set;} + + /// <summary> + /// SOTT is a secure one time token + /// </summary> + [JsonProperty(PropertyName = "Sott")] + public string Sott {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/StatusUpdateResponse.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/StatusUpdateResponse.cs new file mode 100644 index 0000000..59c8c42 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/StatusUpdateResponse.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels + +{ + + /// <summary> + /// Response containing Definition for Complete status data + /// </summary> + public class StatusUpdateResponse + { + /// <summary> + /// Status id + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// String represents website url + /// </summary> + [JsonProperty(PropertyName = "Url")] + public ShortUrlResponse Url {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserActiveSession.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserActiveSession.cs new file mode 100644 index 0000000..e5312e3 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserActiveSession.cs @@ -0,0 +1,32 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System.Collections.Generic; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels + +{ + + /// <summary> + /// Response containing Definition for Complete active sessions + /// </summary> + public class UserActiveSession + { + /// <summary> + /// Data + /// </summary> + [JsonProperty(PropertyName = "data")] + public List<ActiveSessionDetail> Data {get;set;} + + /// <summary> + /// Cursor value if not all contacts can be retrieved once. + /// </summary> + [JsonProperty(PropertyName = "nextcursor")] + public int Nextcursor {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserCustomObjectData.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserCustomObjectData.cs new file mode 100644 index 0000000..a526096 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserCustomObjectData.cs @@ -0,0 +1,62 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels + +{ + + /// <summary> + /// Response containing Definition for Complete user custom object data + /// </summary> + public class UserCustomObjectData + { + /// <summary> + /// custom object + /// </summary> + [JsonProperty(PropertyName = "CustomObject")] + public object CustomObject {get;set;} + + /// <summary> + /// Custom object created date + /// </summary> + [JsonProperty(PropertyName = "DateCreated")] + public DateTime DateCreated {get;set;} + + /// <summary> + /// Custom object modified date + /// </summary> + [JsonProperty(PropertyName = "DateModified")] + public DateTime DateModified {get;set;} + + /// <summary> + /// Custom object id + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// boolean type value, default is true + /// </summary> + [JsonProperty(PropertyName = "IsActive")] + public bool IsActive {get;set;} + + /// <summary> + /// boolean type value, default is true + /// </summary> + [JsonProperty(PropertyName = "IsDeleted")] + public bool IsDeleted {get;set;} + + /// <summary> + /// UID, the unified identifier for each user account + /// </summary> + [JsonProperty(PropertyName = "Uid")] + public string Uid {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserPasswordHash.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserPasswordHash.cs new file mode 100644 index 0000000..9e5bad3 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserPasswordHash.cs @@ -0,0 +1,25 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels + +{ + + /// <summary> + /// Response containing Definition for Complete PasswordHash data + /// </summary> + public class UserPasswordHash + { + /// <summary> + /// Password hash + /// </summary> + [JsonProperty(PropertyName = "PasswordHash")] + public string PasswordHash {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Identity.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Identity.cs new file mode 100644 index 0000000..037b388 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Identity.cs @@ -0,0 +1,26 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System.Collections.Generic; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile + +{ + + /// <summary> + /// Response containing Definition for Complete profile data + /// </summary> + public class Identity:UserProfile + { + /// <summary> + /// User Identities list + /// </summary> + [JsonProperty(PropertyName = "Identities")] + public List<SocialUserProfile> Identities {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/AcceptedPrivacyPolicy.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/AcceptedPrivacyPolicy.cs new file mode 100644 index 0000000..32d48b5 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/AcceptedPrivacyPolicy.cs @@ -0,0 +1,38 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete privacy policy data + /// </summary> + public class AcceptedPrivacyPolicy + { + /// <summary> + /// Privacy policy accept date time + /// </summary> + [JsonProperty(PropertyName = "AcceptDateTime")] + public DateTime? AcceptDateTime {get;set;} + + /// <summary> + /// Privacy policy accept source + /// </summary> + [JsonProperty(PropertyName = "AcceptSource")] + public string AcceptSource {get;set;} + + /// <summary> + /// Privacy policy version + /// </summary> + [JsonProperty(PropertyName = "Version")] + public string Version {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Address.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Address.cs new file mode 100644 index 0000000..771cafe --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Address.cs @@ -0,0 +1,67 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete Address data + /// </summary> + public class Address + { + /// <summary> + /// Address field value that needs to be updated + /// </summary> + [JsonProperty(PropertyName = "Address1")] + public string Address1 {get;set;} + + /// <summary> + /// Address field value that needs to be updated + /// </summary> + [JsonProperty(PropertyName = "Address2")] + public string Address2 {get;set;} + + /// <summary> + /// user's city + /// </summary> + [JsonProperty(PropertyName = "City")] + public string City {get;set;} + + /// <summary> + /// Country of the user + /// </summary> + [JsonProperty(PropertyName = "Country")] + public string Country {get;set;} + + /// <summary> + /// Postal code value that need to be updated + /// </summary> + [JsonProperty(PropertyName = "PostalCode")] + public string PostalCode {get;set;} + + /// <summary> + /// Region + /// </summary> + [JsonProperty(PropertyName = "Region")] + public string Region {get;set;} + + /// <summary> + /// State of the user + /// </summary> + [JsonProperty(PropertyName = "State")] + public string State {get;set;} + + /// <summary> + /// type of address + /// </summary> + [JsonProperty(PropertyName = "Type")] + public string Type {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/AgeRange.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/AgeRange.cs new file mode 100644 index 0000000..b4905c0 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/AgeRange.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete Age data + /// </summary> + public class AgeRange + { + /// <summary> + /// Maximum Value Range + /// </summary> + [JsonProperty(PropertyName = "Max")] + public int? Max {get;set;} + + /// <summary> + /// Minimum Value Range + /// </summary> + [JsonProperty(PropertyName = "Min")] + public int? Min {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Awards.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Awards.cs new file mode 100644 index 0000000..b9b453b --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Awards.cs @@ -0,0 +1,37 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete Awards data + /// </summary> + public class Awards + { + /// <summary> + /// Id of the Awards + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// Award issuer details + /// </summary> + [JsonProperty(PropertyName = "Issuer")] + public string Issuer {get;set;} + + /// <summary> + /// Award name + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Badges.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Badges.cs new file mode 100644 index 0000000..758c144 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Badges.cs @@ -0,0 +1,61 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete Badges data + /// </summary> + public class Badges + { + /// <summary> + /// Badge ID + /// </summary> + [JsonProperty(PropertyName = "BadgeId")] + public string BadgeId {get;set;} + + /// <summary> + /// Badge Message + /// </summary> + [JsonProperty(PropertyName = "BadgeMessage")] + public string BadgeMessage {get;set;} + + /// <summary> + /// Badge ID + /// </summary> + [JsonProperty(PropertyName = "BageId")] + public string BageId {get;set;} + + /// <summary> + /// Badge Message + /// </summary> + [JsonProperty(PropertyName = "BageMessage")] + public string BageMessage {get;set;} + + /// <summary> + /// detailed information + /// </summary> + [JsonProperty(PropertyName = "Description")] + public string Description {get;set;} + + /// <summary> + /// image URL should be absolute and has HTTPS domain + /// </summary> + [JsonProperty(PropertyName = "ImageUrl")] + public string ImageUrl {get;set;} + + /// <summary> + /// Badge Name + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Books.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Books.cs new file mode 100644 index 0000000..9bfa771 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Books.cs @@ -0,0 +1,43 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete Books data + /// </summary> + public class Books + { + /// <summary> + /// Book category + /// </summary> + [JsonProperty(PropertyName = "Category")] + public string Category {get;set;} + + /// <summary> + /// Date of Creation of Profile + /// </summary> + [JsonProperty(PropertyName = "CreatedDate")] + public string CreatedDate {get;set;} + + /// <summary> + /// Id of book + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// book name + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Certifications.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Certifications.cs new file mode 100644 index 0000000..5da1286 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Certifications.cs @@ -0,0 +1,55 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete Certifications data + /// </summary> + public class Certifications + { + /// <summary> + /// Authority of certifications + /// </summary> + [JsonProperty(PropertyName = "Authority")] + public string Authority {get;set;} + + /// <summary> + /// Certification end date + /// </summary> + [JsonProperty(PropertyName = "EndDate")] + public string EndDate {get;set;} + + /// <summary> + /// Certification id + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// Certification name + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + /// <summary> + /// Certification number + /// </summary> + [JsonProperty(PropertyName = "Number")] + public string Number {get;set;} + + /// <summary> + /// Certification start date + /// </summary> + [JsonProperty(PropertyName = "StartDate")] + public string StartDate {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Country.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Country.cs new file mode 100644 index 0000000..d7367d5 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Country.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete Country data + /// </summary> + public class Country + { + /// <summary> + /// Country code + /// </summary> + [JsonProperty(PropertyName = "Code")] + public string Code {get;set;} + + /// <summary> + /// Country name + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Courses.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Courses.cs new file mode 100644 index 0000000..7902153 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Courses.cs @@ -0,0 +1,37 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete Courses data + /// </summary> + public class Courses + { + /// <summary> + /// Course id + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// Course name + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + /// <summary> + /// Course number + /// </summary> + [JsonProperty(PropertyName = "Number")] + public string Number {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/CurrentStatus.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/CurrentStatus.cs new file mode 100644 index 0000000..6416309 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/CurrentStatus.cs @@ -0,0 +1,43 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete CurrentStatus data + /// </summary> + public class CurrentStatus + { + /// <summary> + /// Current status created date + /// </summary> + [JsonProperty(PropertyName = "CreatedDate")] + public string CreatedDate {get;set;} + + /// <summary> + /// Current status id + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// Current status source + /// </summary> + [JsonProperty(PropertyName = "Source")] + public string Source {get;set;} + + /// <summary> + /// Current status text + /// </summary> + [JsonProperty(PropertyName = "Text")] + public string Text {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Education.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Education.cs new file mode 100644 index 0000000..7b67869 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Education.cs @@ -0,0 +1,73 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete Education data + /// </summary> + public class Education + { + /// <summary> + /// Activities + /// </summary> + [JsonProperty(PropertyName = "activities")] + public string Activities {get;set;} + + /// <summary> + /// Degree + /// </summary> + [JsonProperty(PropertyName = "degree")] + public string Degree {get;set;} + + /// <summary> + /// Education End Date + /// </summary> + [JsonProperty(PropertyName = "EndDate")] + public string EndDate {get;set;} + + /// <summary> + /// Fields of study + /// </summary> + [JsonProperty(PropertyName = "fieldofstudy")] + public string Fieldofstudy {get;set;} + + /// <summary> + /// Notes + /// </summary> + [JsonProperty(PropertyName = "notes")] + public string Notes {get;set;} + + /// <summary> + /// School of the user + /// </summary> + [JsonProperty(PropertyName = "School")] + public string School {get;set;} + + /// <summary> + /// Start date of Education of user + /// </summary> + [JsonProperty(PropertyName = "StartDate")] + public string StartDate {get;set;} + + /// <summary> + /// Type + /// </summary> + [JsonProperty(PropertyName = "type")] + public string Type {get;set;} + + /// <summary> + /// Year of Education + /// </summary> + [JsonProperty(PropertyName = "year")] + public string Year {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Email.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Email.cs new file mode 100644 index 0000000..06e39cf --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Email.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete Email data + /// </summary> + public class Email + { + /// <summary> + /// type of email id + /// </summary> + [JsonProperty(PropertyName = "Type")] + public string Type {get;set;} + + /// <summary> + /// Email address + /// </summary> + [JsonProperty(PropertyName = "Value")] + public string Value {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/ExternalIds.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/ExternalIds.cs new file mode 100644 index 0000000..11bf743 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/ExternalIds.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete Externalids data + /// </summary> + public class ExternalIds + { + /// <summary> + /// ExternalId source + /// </summary> + [JsonProperty(PropertyName = "Source")] + public string Source {get;set;} + + /// <summary> + /// External source id + /// </summary> + [JsonProperty(PropertyName = "SourceId")] + public string SourceId {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Family.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Family.cs new file mode 100644 index 0000000..3eb5d9b --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Family.cs @@ -0,0 +1,37 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete Family data + /// </summary> + public class Family + { + /// <summary> + /// Family id + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// Family name + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + /// <summary> + /// Family relationship + /// </summary> + [JsonProperty(PropertyName = "Relationship")] + public string Relationship {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/FavoriteThings.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/FavoriteThings.cs new file mode 100644 index 0000000..ce1c9a1 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/FavoriteThings.cs @@ -0,0 +1,37 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete Favorite data + /// </summary> + public class FavoriteThings + { + /// <summary> + /// Id of favorite things + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// Name of favorite things + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + /// <summary> + /// Type of favorite things + /// </summary> + [JsonProperty(PropertyName = "Type")] + public string Type {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Games.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Games.cs new file mode 100644 index 0000000..d3bc0cc --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Games.cs @@ -0,0 +1,43 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete Games data + /// </summary> + public class Games + { + /// <summary> + /// Category of game + /// </summary> + [JsonProperty(PropertyName = "Category")] + public string Category {get;set;} + + /// <summary> + /// Game created date + /// </summary> + [JsonProperty(PropertyName = "CreatedDate")] + public string CreatedDate {get;set;} + + /// <summary> + /// Id of game + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// Game name + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/GitHubPlan.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/GitHubPlan.cs new file mode 100644 index 0000000..6866088 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/GitHubPlan.cs @@ -0,0 +1,43 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete GitHubPlan data + /// </summary> + public class GitHubPlan + { + /// <summary> + /// Github plan collaborators + /// </summary> + [JsonProperty(PropertyName = "Collaborators")] + public string Collaborators {get;set;} + + /// <summary> + /// Github plan name + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + /// <summary> + /// Private repos of github + /// </summary> + [JsonProperty(PropertyName = "PrivateRepos")] + public string PrivateRepos {get;set;} + + /// <summary> + /// Github plan space + /// </summary> + [JsonProperty(PropertyName = "Space")] + public string Space {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/IMAccount.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/IMAccount.cs new file mode 100644 index 0000000..6e4907a --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/IMAccount.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete IMAccount data + /// </summary> + public class IMAccount + { + /// <summary> + /// Name of account + /// </summary> + [JsonProperty(PropertyName = "AccountName")] + public string AccountName {get;set;} + + /// <summary> + /// Type of account + /// </summary> + [JsonProperty(PropertyName = "AccountType")] + public string AccountType {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/InspirationalPeople.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/InspirationalPeople.cs new file mode 100644 index 0000000..0d1e1c1 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/InspirationalPeople.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete Inspirational People data + /// </summary> + public class InspirationalPeople + { + /// <summary> + /// ID of inspirational people + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// name of inspirational people + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Interests.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Interests.cs new file mode 100644 index 0000000..97e2dae --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Interests.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete Interests data + /// </summary> + public class Interests + { + /// <summary> + /// Name of interested + /// </summary> + [JsonProperty(PropertyName = "InterestedName")] + public string InterestedName {get;set;} + + /// <summary> + /// Type of interested + /// </summary> + [JsonProperty(PropertyName = "InterestedType")] + public string InterestedType {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Job.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Job.cs new file mode 100644 index 0000000..fb45de5 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Job.cs @@ -0,0 +1,55 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete Job data + /// </summary> + public class Job + { + /// <summary> + /// Is active or not + /// </summary> + [JsonProperty(PropertyName = "Active")] + public bool? Active {get;set;} + + /// <summary> + /// Job company + /// </summary> + [JsonProperty(PropertyName = "Company")] + public JobBookmarkCompany Company {get;set;} + + /// <summary> + /// Job description + /// </summary> + [JsonProperty(PropertyName = "DescriptionSnippet")] + public string DescriptionSnippet {get;set;} + + /// <summary> + /// Job id + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// Position of job + /// </summary> + [JsonProperty(PropertyName = "Position")] + public JobBookmarkPosition Position {get;set;} + + /// <summary> + /// Job posting timestamp + /// </summary> + [JsonProperty(PropertyName = "PostingTimestamp")] + public string PostingTimestamp {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/JobBookmarkCompany.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/JobBookmarkCompany.cs new file mode 100644 index 0000000..2926d70 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/JobBookmarkCompany.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete Job Bookmark Company data + /// </summary> + public class JobBookmarkCompany + { + /// <summary> + /// Company id + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// Company name + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/JobBookmarkPosition.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/JobBookmarkPosition.cs new file mode 100644 index 0000000..bb1b0a3 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/JobBookmarkPosition.cs @@ -0,0 +1,25 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete Job Bookmark Position data + /// </summary> + public class JobBookmarkPosition + { + /// <summary> + /// Position title + /// </summary> + [JsonProperty(PropertyName = "Title")] + public string Title {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/JobBookmarks.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/JobBookmarks.cs new file mode 100644 index 0000000..90c76d4 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/JobBookmarks.cs @@ -0,0 +1,49 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete Job Bookmark data + /// </summary> + public class JobBookmarks + { + /// <summary> + /// Job Bookmarks Apply Timestamp + /// </summary> + [JsonProperty(PropertyName = "ApplyTimestamp")] + public string ApplyTimestamp {get;set;} + + /// <summary> + /// Job bookmark is applied or not + /// </summary> + [JsonProperty(PropertyName = "IsApplied")] + public bool? IsApplied {get;set;} + + /// <summary> + /// Job bookmark is saved or not + /// </summary> + [JsonProperty(PropertyName = "IsSaved")] + public bool? IsSaved {get;set;} + + /// <summary> + /// Job + /// </summary> + [JsonProperty(PropertyName = "Job")] + public Job Job {get;set;} + + /// <summary> + /// Saved time stamp of Job bookmarks + /// </summary> + [JsonProperty(PropertyName = "SavedTimestamp")] + public string SavedTimestamp {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/KloutProfile.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/KloutProfile.cs new file mode 100644 index 0000000..6196048 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/KloutProfile.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete Klout Profile data + /// </summary> + public class KloutProfile + { + /// <summary> + /// Id of klout + /// </summary> + [JsonProperty(PropertyName = "KloutId")] + public string KloutId {get;set;} + + /// <summary> + /// Object, string represents KloutId and double represents Score + /// </summary> + [JsonProperty(PropertyName = "Score")] + public double? Score {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Languages.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Languages.cs new file mode 100644 index 0000000..aec2445 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Languages.cs @@ -0,0 +1,37 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete Languages data + /// </summary> + public class Languages + { + /// <summary> + /// Language id + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// Name of language + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + /// <summary> + /// Proficiency in language + /// </summary> + [JsonProperty(PropertyName = "Proficiency")] + public string Proficiency {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Memberurlresources.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Memberurlresources.cs new file mode 100644 index 0000000..6afd2ad --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Memberurlresources.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete Member url resources data + /// </summary> + public class Memberurlresources + { + /// <summary> + /// String represents website url + /// </summary> + [JsonProperty(PropertyName = "Url")] + public string Url {get;set;} + + /// <summary> + /// URL name + /// </summary> + [JsonProperty(PropertyName = "UrlName")] + public string UrlName {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Movies.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Movies.cs new file mode 100644 index 0000000..ee2a1c5 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Movies.cs @@ -0,0 +1,43 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete Movies data + /// </summary> + public class Movies + { + /// <summary> + /// Category of movie + /// </summary> + [JsonProperty(PropertyName = "Category")] + public string Category {get;set;} + + /// <summary> + /// Movie created date + /// </summary> + [JsonProperty(PropertyName = "CreatedDate")] + public string CreatedDate {get;set;} + + /// <summary> + /// Id of movie + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// Name of movie + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/MutualFriends.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/MutualFriends.cs new file mode 100644 index 0000000..5ae4f48 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/MutualFriends.cs @@ -0,0 +1,67 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete MutualFriends data + /// </summary> + public class MutualFriends + { + /// <summary> + /// Birthday of mutual friend + /// </summary> + [JsonProperty(PropertyName = "Birthday")] + public string Birthday {get;set;} + + /// <summary> + /// first name of mutual friend + /// </summary> + [JsonProperty(PropertyName = "FirstName")] + public string FirstName {get;set;} + + /// <summary> + /// Gender of mutual friend + /// </summary> + [JsonProperty(PropertyName = "Gender")] + public string Gender {get;set;} + + /// <summary> + /// Hometown of mutual friend + /// </summary> + [JsonProperty(PropertyName = "Hometown")] + public string Hometown {get;set;} + + /// <summary> + /// Id of mutual friend + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// Last name of mutual friend + /// </summary> + [JsonProperty(PropertyName = "LastName")] + public string LastName {get;set;} + + /// <summary> + /// Link of mutual friend + /// </summary> + [JsonProperty(PropertyName = "Link")] + public string Link {get;set;} + + /// <summary> + /// Name of mutual friend + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/NameId.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/NameId.cs new file mode 100644 index 0000000..d7741c9 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/NameId.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete NameId data + /// </summary> + public class NameId + { + /// <summary> + /// Id + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// Name + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Patents.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Patents.cs new file mode 100644 index 0000000..9ec3e9b --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Patents.cs @@ -0,0 +1,37 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete Patents data + /// </summary> + public class Patents + { + /// <summary> + /// Date of patents + /// </summary> + [JsonProperty(PropertyName = "Date")] + public string Date {get;set;} + + /// <summary> + /// Id of the patents + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// Title of the patents + /// </summary> + [JsonProperty(PropertyName = "Title")] + public string Title {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Phone.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Phone.cs new file mode 100644 index 0000000..a9d2e26 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Phone.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete Phone data + /// </summary> + public class Phone + { + /// <summary> + /// Phone number + /// </summary> + [JsonProperty(PropertyName = "PhoneNumber")] + public string PhoneNumber {get;set;} + + /// <summary> + /// Phone type + /// </summary> + [JsonProperty(PropertyName = "PhoneType")] + public string PhoneType {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/PlacesLived.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/PlacesLived.cs new file mode 100644 index 0000000..851e0c8 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/PlacesLived.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete PlacesLived data + /// </summary> + public class PlacesLived + { + /// <summary> + /// place is primary or not + /// </summary> + [JsonProperty(PropertyName = "IsPrimary")] + public bool? IsPrimary {get;set;} + + /// <summary> + /// Name of lived place + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/PositionCompany.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/PositionCompany.cs new file mode 100644 index 0000000..778494c --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/PositionCompany.cs @@ -0,0 +1,37 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete Position Company data + /// </summary> + public class PositionCompany + { + /// <summary> + /// position company industry + /// </summary> + [JsonProperty(PropertyName = "Industry")] + public string Industry {get;set;} + + /// <summary> + /// position company name + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + /// <summary> + /// position company type + /// </summary> + [JsonProperty(PropertyName = "Type")] + public string Type {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/ProfessionalPosition.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/ProfessionalPosition.cs new file mode 100644 index 0000000..62a383e --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/ProfessionalPosition.cs @@ -0,0 +1,61 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete Professional Position data + /// </summary> + public class ProfessionalPosition + { + /// <summary> + /// Company of the professional position + /// </summary> + [JsonProperty(PropertyName = "Company")] + public PositionCompany Company {get;set;} + + /// <summary> + /// End date of the professional position + /// </summary> + [JsonProperty(PropertyName = "EndDate")] + public string EndDate {get;set;} + + /// <summary> + /// Is current or not + /// </summary> + [JsonProperty(PropertyName = "IsCurrent")] + public string IsCurrent {get;set;} + + /// <summary> + /// Location of the professional position + /// </summary> + [JsonProperty(PropertyName = "Location")] + public string Location {get;set;} + + /// <summary> + /// Position + /// </summary> + [JsonProperty(PropertyName = "Position")] + public string Position {get;set;} + + /// <summary> + /// Start date of the professional position + /// </summary> + [JsonProperty(PropertyName = "StartDate")] + public string StartDate {get;set;} + + /// <summary> + /// Summary of the professional position + /// </summary> + [JsonProperty(PropertyName = "Summary")] + public string Summary {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Projects.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Projects.cs new file mode 100644 index 0000000..9f16486 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Projects.cs @@ -0,0 +1,62 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System.Collections.Generic; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete Projects data + /// </summary> + public class Projects + { + /// <summary> + /// End date of the project + /// </summary> + [JsonProperty(PropertyName = "EndDate")] + public string EndDate {get;set;} + + /// <summary> + /// Id of the project + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// is current or not + /// </summary> + [JsonProperty(PropertyName = "IsCurrent")] + public string IsCurrent {get;set;} + + /// <summary> + /// Name of the project + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + /// <summary> + /// Start date of the project + /// </summary> + [JsonProperty(PropertyName = "StartDate")] + public string StartDate {get;set;} + + /// <summary> + /// Summary of the project + /// </summary> + [JsonProperty(PropertyName = "Summary")] + public string Summary {get;set;} + + /// <summary> + /// Projects done with + /// </summary> + [JsonProperty(PropertyName = "With")] + public List<NameId> With {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/ProviderAccessCredential.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/ProviderAccessCredential.cs new file mode 100644 index 0000000..7529f29 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/ProviderAccessCredential.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete Provider Access Credential data + /// </summary> + public class ProviderAccessCredential + { + /// <summary> + /// Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + /// </summary> + [JsonProperty(PropertyName = "AccessToken")] + public string AccessToken {get;set;} + + /// <summary> + /// secret token of the provider + /// </summary> + [JsonProperty(PropertyName = "TokenSecret")] + public string TokenSecret {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Publications.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Publications.cs new file mode 100644 index 0000000..56bb369 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Publications.cs @@ -0,0 +1,62 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System.Collections.Generic; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete Publications data + /// </summary> + public class Publications + { + /// <summary> + /// Author of the publication + /// </summary> + [JsonProperty(PropertyName = "Authors")] + public List<PublicationsAuthors> Authors {get;set;} + + /// <summary> + /// Date of the publication + /// </summary> + [JsonProperty(PropertyName = "Date")] + public string Date {get;set;} + + /// <summary> + /// Id of the Publication + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// Publisher of the Publication + /// </summary> + [JsonProperty(PropertyName = "Publisher")] + public string Publisher {get;set;} + + /// <summary> + /// Summary of the publication + /// </summary> + [JsonProperty(PropertyName = "Summary")] + public string Summary {get;set;} + + /// <summary> + /// Title of the publication + /// </summary> + [JsonProperty(PropertyName = "Title")] + public string Title {get;set;} + + /// <summary> + /// Publication url + /// </summary> + [JsonProperty(PropertyName = "Url")] + public string Url {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/PublicationsAuthors.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/PublicationsAuthors.cs new file mode 100644 index 0000000..fe0d4d1 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/PublicationsAuthors.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete Publications Authors data + /// </summary> + public class PublicationsAuthors + { + /// <summary> + /// Author id of the publication + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// Author name + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/RecommendationsReceived.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/RecommendationsReceived.cs new file mode 100644 index 0000000..0541807 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/RecommendationsReceived.cs @@ -0,0 +1,43 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete Recommendations Received data + /// </summary> + public class RecommendationsReceived + { + /// <summary> + /// Recommendation id + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// Recommendation text + /// </summary> + [JsonProperty(PropertyName = "RecommendationText")] + public string RecommendationText {get;set;} + + /// <summary> + /// Recommendation type + /// </summary> + [JsonProperty(PropertyName = "RecommendationType")] + public string RecommendationType {get;set;} + + /// <summary> + /// Recommender + /// </summary> + [JsonProperty(PropertyName = "Recommender")] + public string Recommender {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/RelatedProfileViews.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/RelatedProfileViews.cs new file mode 100644 index 0000000..1138fc6 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/RelatedProfileViews.cs @@ -0,0 +1,37 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete Related profileviews data + /// </summary> + public class RelatedProfileViews + { + /// <summary> + /// user's first name + /// </summary> + [JsonProperty(PropertyName = "FirstName")] + public string FirstName {get;set;} + + /// <summary> + /// Id of profile view + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// user's last name + /// </summary> + [JsonProperty(PropertyName = "LastName")] + public string LastName {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/RoleContext.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/RoleContext.cs new file mode 100644 index 0000000..50118e8 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/RoleContext.cs @@ -0,0 +1,45 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete RoleContext data + /// </summary> + public class RoleContext + { + /// <summary> + /// Array of String, which represents the additional permissions + /// </summary> + [JsonProperty(PropertyName = "AdditionalPermissions")] + public List<string> AdditionalPermissions {get;set;} + + /// <summary> + /// Array of RoleContext object, see body tab for structure + /// </summary> + [JsonProperty(PropertyName = "Context")] + public string Context {get;set;} + + /// <summary> + /// Role expiration date + /// </summary> + [JsonProperty(PropertyName = "Expiration")] + public DateTime? Expiration {get;set;} + + /// <summary> + /// Array of String, which represents the role name + /// </summary> + [JsonProperty(PropertyName = "Roles")] + public List<string> Roles {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Skills.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Skills.cs new file mode 100644 index 0000000..c7b14f5 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Skills.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete Skills data + /// </summary> + public class Skills + { + /// <summary> + /// id of skill + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// name of skills + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Sports.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Sports.cs new file mode 100644 index 0000000..fec413e --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Sports.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete Sports data + /// </summary> + public class Sports + { + /// <summary> + /// Id of sport + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// Name of sport + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Suggestions.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Suggestions.cs new file mode 100644 index 0000000..5f45d38 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Suggestions.cs @@ -0,0 +1,44 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System.Collections.Generic; +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete Suggestions data + /// </summary> + public class Suggestions + { + /// <summary> + /// Companies needs to follow + /// </summary> + [JsonProperty(PropertyName = "CompaniestoFollow")] + public List<NameId> CompaniestoFollow {get;set;} + + /// <summary> + /// Industries needs to follow + /// </summary> + [JsonProperty(PropertyName = "IndustriestoFollow")] + public List<NameId> IndustriestoFollow {get;set;} + + /// <summary> + /// News sources needs to follow + /// </summary> + [JsonProperty(PropertyName = "NewssourcetoFollow")] + public List<NameId> NewssourcetoFollow {get;set;} + + /// <summary> + /// People needs to follow + /// </summary> + [JsonProperty(PropertyName = "PeopletoFollow")] + public List<NameId> PeopletoFollow {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Television.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Television.cs new file mode 100644 index 0000000..b9266a3 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Television.cs @@ -0,0 +1,43 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete Television data + /// </summary> + public class Television + { + /// <summary> + /// Television category + /// </summary> + [JsonProperty(PropertyName = "Category")] + public string Category {get;set;} + + /// <summary> + /// Date + /// </summary> + [JsonProperty(PropertyName = "CreatedDate")] + public string CreatedDate {get;set;} + + /// <summary> + /// Id of television + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// Name of volunteer + /// </summary> + [JsonProperty(PropertyName = "Name")] + public string Name {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Volunteer.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Volunteer.cs new file mode 100644 index 0000000..84a68b0 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/Objects/Volunteer.cs @@ -0,0 +1,43 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using Newtonsoft.Json; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects + +{ + + /// <summary> + /// Response containing Definition for Complete Volunteer data + /// </summary> + public class Volunteer + { + /// <summary> + /// Cause of volunteer + /// </summary> + [JsonProperty(PropertyName = "Cause")] + public string Cause {get;set;} + + /// <summary> + /// Volunteer Id + /// </summary> + [JsonProperty(PropertyName = "Id")] + public string Id {get;set;} + + /// <summary> + /// name + /// </summary> + [JsonProperty(PropertyName = "Organization")] + public string Organization {get;set;} + + /// <summary> + /// Name of role + /// </summary> + [JsonProperty(PropertyName = "Role")] + public string Role {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/SocialUserProfile.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/SocialUserProfile.cs new file mode 100644 index 0000000..e0eb72d --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/SocialUserProfile.cs @@ -0,0 +1,706 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using Newtonsoft.Json; +using LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile + +{ + + /// <summary> + /// Response containing Definition for Complete SocialUserProfile data + /// </summary> + public class SocialUserProfile + { + /// <summary> + /// About value that need to be inserted + /// </summary> + [JsonProperty(PropertyName = "About")] + public string About {get;set;} + + /// <summary> + /// Array of objects,String represents address of user + /// </summary> + [JsonProperty(PropertyName = "Addresses")] + public List<Address> Addresses {get;set;} + + /// <summary> + /// User's Age + /// </summary> + [JsonProperty(PropertyName = "Age")] + public string Age {get;set;} + + /// <summary> + /// user's age range. + /// </summary> + [JsonProperty(PropertyName = "AgeRange")] + public AgeRange AgeRange {get;set;} + + /// <summary> + /// Organization a person is assosciated with + /// </summary> + [JsonProperty(PropertyName = "Associations")] + public string Associations {get;set;} + + /// <summary> + /// Array of Objects,String represents Id, Name and Issuer + /// </summary> + [JsonProperty(PropertyName = "Awards")] + public List<Awards> Awards {get;set;} + + /// <summary> + /// User's Badges. + /// </summary> + [JsonProperty(PropertyName = "Badges")] + public List<Badges> Badges {get;set;} + + /// <summary> + /// user's birthdate + /// </summary> + [JsonProperty(PropertyName = "BirthDate")] + public string BirthDate {get;set;} + + /// <summary> + /// boards count + /// </summary> + [JsonProperty(PropertyName = "BoardsCount")] + public int? BoardsCount {get;set;} + + /// <summary> + /// Array of Objects,String represents Id,Name,Category,CreatedDate + /// </summary> + [JsonProperty(PropertyName = "Books")] + public List<Books> Books {get;set;} + + /// <summary> + /// Array of Objects,string represents Id,Name,Authority Number,StartDate,EndDate + /// </summary> + [JsonProperty(PropertyName = "Certifications")] + public List<Certifications> Certifications {get;set;} + + /// <summary> + /// user's city + /// </summary> + [JsonProperty(PropertyName = "City")] + public string City {get;set;} + + /// <summary> + /// users company name + /// </summary> + [JsonProperty(PropertyName = "Company")] + public string Company {get;set;} + + /// <summary> + /// Country of the user + /// </summary> + [JsonProperty(PropertyName = "Country")] + public Country Country {get;set;} + + /// <summary> + /// users course information + /// </summary> + [JsonProperty(PropertyName = "Courses")] + public List<Courses> Courses {get;set;} + + /// <summary> + /// URL of the photo that need to be inserted + /// </summary> + [JsonProperty(PropertyName = "CoverPhoto")] + public string CoverPhoto {get;set;} + + /// <summary> + /// created + /// </summary> + [JsonProperty(PropertyName = "Created")] + public string Created {get;set;} + + /// <summary> + /// Date of Creation of Profile + /// </summary> + [JsonProperty(PropertyName = "CreatedDate")] + public DateTime? CreatedDate {get;set;} + + /// <summary> + /// Currency + /// </summary> + [JsonProperty(PropertyName = "Currency")] + public string Currency {get;set;} + + /// <summary> + /// Array of Objects,String represents id ,Text ,Source and CreatedDate + /// </summary> + [JsonProperty(PropertyName = "CurrentStatus")] + public List<CurrentStatus> CurrentStatus {get;set;} + + /// <summary> + /// Array of Objects,which represents the educations record + /// </summary> + [JsonProperty(PropertyName = "Educations")] + public List<Education> Educations {get;set;} + + /// <summary> + /// user's email + /// </summary> + [JsonProperty(PropertyName = "Email")] + public List<Email> Email {get;set;} + + /// <summary> + /// user's family + /// </summary> + [JsonProperty(PropertyName = "Family")] + public List<Family> Family {get;set;} + + /// <summary> + /// URL of the favicon that need to be inserted + /// </summary> + [JsonProperty(PropertyName = "Favicon")] + public string Favicon {get;set;} + + /// <summary> + /// Array of Objects,strings represents Id ,Name ,Type + /// </summary> + [JsonProperty(PropertyName = "FavoriteThings")] + public List<FavoriteThings> FavoriteThings {get;set;} + + /// <summary> + /// first login + /// </summary> + [JsonProperty(PropertyName = "FirstLogin")] + public bool? FirstLogin {get;set;} + + /// <summary> + /// user's first name + /// </summary> + [JsonProperty(PropertyName = "FirstName")] + public string FirstName {get;set;} + + /// <summary> + /// user's followers count + /// </summary> + [JsonProperty(PropertyName = "FollowersCount")] + public int? FollowersCount {get;set;} + + /// <summary> + /// users friends count + /// </summary> + [JsonProperty(PropertyName = "FriendsCount")] + public int? FriendsCount {get;set;} + + /// <summary> + /// Users complete name + /// </summary> + [JsonProperty(PropertyName = "FullName")] + public string FullName {get;set;} + + /// <summary> + /// Array of Objects,string represents Id,Name,Category,CreatedDate + /// </summary> + [JsonProperty(PropertyName = "Games")] + public List<Games> Games {get;set;} + + /// <summary> + /// user's gender + /// </summary> + [JsonProperty(PropertyName = "Gender")] + public string Gender {get;set;} + + /// <summary> + /// Git Repository URL + /// </summary> + [JsonProperty(PropertyName = "GistsUrl")] + public string GistsUrl {get;set;} + + /// <summary> + /// URL of image that need to be inserted + /// </summary> + [JsonProperty(PropertyName = "GravatarImageUrl")] + public string GravatarImageUrl {get;set;} + + /// <summary> + /// boolean type value, default value is true + /// </summary> + [JsonProperty(PropertyName = "Hireable")] + public bool? Hireable {get;set;} + + /// <summary> + /// user's home town name + /// </summary> + [JsonProperty(PropertyName = "HomeTown")] + public string HomeTown {get;set;} + + /// <summary> + /// Awards lists from the social provider + /// </summary> + [JsonProperty(PropertyName = "Honors")] + public string Honors {get;set;} + + /// <summary> + /// URL of the Image that need to be inserted + /// </summary> + [JsonProperty(PropertyName = "HttpsImageUrl")] + public string HttpsImageUrl {get;set;} + + /// <summary> + /// ID of the User + /// </summary> + [JsonProperty(PropertyName = "ID")] + public string ID {get;set;} + + /// <summary> + /// Array of objects, String represents account type and account name. + /// </summary> + [JsonProperty(PropertyName = "IMAccounts")] + public List<IMAccount> IMAccounts {get;set;} + + /// <summary> + /// image URL should be absolute and has HTTPS domain + /// </summary> + [JsonProperty(PropertyName = "ImageUrl")] + public string ImageUrl {get;set;} + + /// <summary> + /// Industry name + /// </summary> + [JsonProperty(PropertyName = "Industry")] + public string Industry {get;set;} + + /// <summary> + /// Array of Objects,string represents Id and Name + /// </summary> + [JsonProperty(PropertyName = "InspirationalPeople")] + public List<InspirationalPeople> InspirationalPeople {get;set;} + + /// <summary> + /// array of string represents interest + /// </summary> + [JsonProperty(PropertyName = "InterestedIn")] + public List<string> InterestedIn {get;set;} + + /// <summary> + /// Array of objects, string shows InterestedType and InterestedName + /// </summary> + [JsonProperty(PropertyName = "Interests")] + public List<Interests> Interests {get;set;} + + /// <summary> + /// boolean type value, default is true + /// </summary> + [JsonProperty(PropertyName = "IsGeoEnabled")] + public string IsGeoEnabled {get;set;} + + /// <summary> + /// boolean type value, default is true + /// </summary> + [JsonProperty(PropertyName = "IsProtected")] + public bool? IsProtected {get;set;} + + /// <summary> + /// Array of Objects,Strings,boolean,object represents IsApplied,ApplyTimestamp,IsSaved,SavedTimestamp,Job + /// </summary> + [JsonProperty(PropertyName = "JobBookmarks")] + public List<JobBookmarks> JobBookmarks {get;set;} + + /// <summary> + /// Object, string represents KloutId and double represents Score + /// </summary> + [JsonProperty(PropertyName = "KloutScore")] + public KloutProfile KloutScore {get;set;} + + /// <summary> + /// language known by user's + /// </summary> + [JsonProperty(PropertyName = "Language")] + public string Language {get;set;} + + /// <summary> + /// language known by user's + /// </summary> + [JsonProperty(PropertyName = "Languages")] + public List<Languages> Languages {get;set;} + + /// <summary> + /// last login date + /// </summary> + [JsonProperty(PropertyName = "LastLoginDate")] + public DateTime? LastLoginDate {get;set;} + + /// <summary> + /// user's last name + /// </summary> + [JsonProperty(PropertyName = "LastName")] + public string LastName {get;set;} + + /// <summary> + /// likes count + /// </summary> + [JsonProperty(PropertyName = "LikesCount")] + public int? LikesCount {get;set;} + + /// <summary> + /// Local City of the user + /// </summary> + [JsonProperty(PropertyName = "LocalCity")] + public string LocalCity {get;set;} + + /// <summary> + /// Local country of the user + /// </summary> + [JsonProperty(PropertyName = "LocalCountry")] + public string LocalCountry {get;set;} + + /// <summary> + /// Local language of the user + /// </summary> + [JsonProperty(PropertyName = "LocalLanguage")] + public string LocalLanguage {get;set;} + + /// <summary> + /// LR user id + /// </summary> + [JsonProperty(PropertyName = "LRUserID")] + public string LRUserID {get;set;} + + /// <summary> + /// Main address of the user + /// </summary> + [JsonProperty(PropertyName = "MainAddress")] + public string MainAddress {get;set;} + + /// <summary> + /// Array of Objects,String represents Url,UrlName + /// </summary> + [JsonProperty(PropertyName = "MemberUrlResources")] + public List<Memberurlresources> MemberUrlResources {get;set;} + + /// <summary> + /// user's middle name + /// </summary> + [JsonProperty(PropertyName = "MiddleName")] + public string MiddleName {get;set;} + + /// <summary> + /// profile updated date + /// </summary> + [JsonProperty(PropertyName = "ModifiedDate")] + public DateTime? ModifiedDate {get;set;} + + /// <summary> + /// Array of Objects,strings represents Id,Name,Category,CreatedDate + /// </summary> + [JsonProperty(PropertyName = "Movies")] + public List<Movies> Movies {get;set;} + + /// <summary> + /// Array of Objects, strings represents Id,Name,FirstName,LastName,Birthday,Hometown,Link,Gender + /// </summary> + [JsonProperty(PropertyName = "MutualFriends")] + public List<MutualFriends> MutualFriends {get;set;} + + /// <summary> + /// Nick name of the user + /// </summary> + [JsonProperty(PropertyName = "NickName")] + public string NickName {get;set;} + + /// <summary> + /// Count for the user profile recommended + /// </summary> + [JsonProperty(PropertyName = "NumRecommenders")] + public int? NumRecommenders {get;set;} + + /// <summary> + /// Patents Registered + /// </summary> + [JsonProperty(PropertyName = "Patents")] + public List<Patents> Patents {get;set;} + + /// <summary> + /// Users Phone Number + /// </summary> + [JsonProperty(PropertyName = "PhoneNumbers")] + public List<Phone> PhoneNumbers {get;set;} + + /// <summary> + /// count of pins + /// </summary> + [JsonProperty(PropertyName = "PinsCount")] + public int? PinsCount {get;set;} + + /// <summary> + /// Array of Objects,strings Name and boolean IsPrimary + /// </summary> + [JsonProperty(PropertyName = "PlacesLived")] + public List<PlacesLived> PlacesLived {get;set;} + + /// <summary> + /// List of Political interest + /// </summary> + [JsonProperty(PropertyName = "Political")] + public string Political {get;set;} + + /// <summary> + /// Array of Objects,which represents the PositionSummary,StartDate,EndDate,IsCurrent,Company,Location + /// </summary> + [JsonProperty(PropertyName = "Positions")] + public List<ProfessionalPosition> Positions {get;set;} + + /// <summary> + /// Prefix for FirstName + /// </summary> + [JsonProperty(PropertyName = "Prefix")] + public string Prefix {get;set;} + + /// <summary> + /// previous ids + /// </summary> + [JsonProperty(PropertyName = "PreviousUids")] + public List<string> PreviousUids {get;set;} + + /// <summary> + /// user private Repository Urls + /// </summary> + [JsonProperty(PropertyName = "PrivateGists")] + public int? PrivateGists {get;set;} + + /// <summary> + /// This field provide by linkedin.contain our linkedin profile headline + /// </summary> + [JsonProperty(PropertyName = "ProfessionalHeadline")] + public string ProfessionalHeadline {get;set;} + + /// <summary> + /// ProfileCity value that need to be inserted + /// </summary> + [JsonProperty(PropertyName = "ProfileCity")] + public string ProfileCity {get;set;} + + /// <summary> + /// ProfileCountry value that need to be inserted + /// </summary> + [JsonProperty(PropertyName = "ProfileCountry")] + public string ProfileCountry {get;set;} + + /// <summary> + /// ProfileImageUrls that need to be inserted + /// </summary> + [JsonProperty(PropertyName = "ProfileImageUrls")] + public Dictionary<string,string> ProfileImageUrls {get;set;} + + /// <summary> + /// profile updated date + /// </summary> + [JsonProperty(PropertyName = "ProfileModifiedDate")] + public DateTime? ProfileModifiedDate {get;set;} + + /// <summary> + /// ProfileName value field that need to be inserted + /// </summary> + [JsonProperty(PropertyName = "ProfileName")] + public string ProfileName {get;set;} + + /// <summary> + /// User profile url like facebook profile Url + /// </summary> + [JsonProperty(PropertyName = "ProfileUrl")] + public string ProfileUrl {get;set;} + + /// <summary> + /// Array of Objects,string represents Id,Name,Summary With StartDate,EndDate,IsCurrent + /// </summary> + [JsonProperty(PropertyName = "Projects")] + public List<Projects> Projects {get;set;} + + /// <summary> + /// Name of the provider + /// </summary> + [JsonProperty(PropertyName = "Provider")] + public string Provider {get;set;} + + /// <summary> + /// Object,string represents AccessToken,TokenSecret + /// </summary> + [JsonProperty(PropertyName = "ProviderAccessCredential")] + public ProviderAccessCredential ProviderAccessCredential {get;set;} + + /// <summary> + /// Array of Objects,string represents Id,Title,Publisher,Authors,Date,Url,Summary + /// </summary> + [JsonProperty(PropertyName = "Publications")] + public List<Publications> Publications {get;set;} + + /// <summary> + /// gist is a Git repository, which means that it can be forked and cloned. + /// </summary> + [JsonProperty(PropertyName = "PublicGists")] + public int? PublicGists {get;set;} + + /// <summary> + /// user public Repository Urls + /// </summary> + [JsonProperty(PropertyName = "PublicRepository")] + public string PublicRepository {get;set;} + + /// <summary> + /// Quota + /// </summary> + [JsonProperty(PropertyName = "Quota")] + public string Quota {get;set;} + + /// <summary> + /// quote + /// </summary> + [JsonProperty(PropertyName = "Quote")] + public string Quote {get;set;} + + /// <summary> + /// Array of Objects,string represents Id,RecommendationType,RecommendationText,Recommender + /// </summary> + [JsonProperty(PropertyName = "RecommendationsReceived")] + public List<RecommendationsReceived> RecommendationsReceived {get;set;} + + /// <summary> + /// Array of Objects,String represents Id,FirstName,LastName + /// </summary> + [JsonProperty(PropertyName = "RelatedProfileViews")] + public List<RelatedProfileViews> RelatedProfileViews {get;set;} + + /// <summary> + /// user's relationship status + /// </summary> + [JsonProperty(PropertyName = "RelationshipStatus")] + public string RelationshipStatus {get;set;} + + /// <summary> + /// String shows users religion + /// </summary> + [JsonProperty(PropertyName = "Religion")] + public string Religion {get;set;} + + /// <summary> + /// Repository URL + /// </summary> + [JsonProperty(PropertyName = "RepositoryUrl")] + public string RepositoryUrl {get;set;} + + /// <summary> + /// Signup date + /// </summary> + [JsonProperty(PropertyName = "SignupDate")] + public DateTime? SignupDate {get;set;} + + /// <summary> + /// Array of objects, String represents ID and Name + /// </summary> + [JsonProperty(PropertyName = "Skills")] + public List<Skills> Skills {get;set;} + + /// <summary> + /// Array of objects, String represents ID and Name + /// </summary> + [JsonProperty(PropertyName = "Sports")] + public List<Sports> Sports {get;set;} + + /// <summary> + /// Git users bookmark repositories + /// </summary> + [JsonProperty(PropertyName = "StarredUrl")] + public string StarredUrl {get;set;} + + /// <summary> + /// State of the user + /// </summary> + [JsonProperty(PropertyName = "State")] + public string State {get;set;} + + /// <summary> + /// Object,string represents Name,Space,PrivateRepos,Collaborators + /// </summary> + [JsonProperty(PropertyName = "Subscription")] + public GitHubPlan Subscription {get;set;} + + /// <summary> + /// Suffix for the User. + /// </summary> + [JsonProperty(PropertyName = "Suffix")] + public string Suffix {get;set;} + + /// <summary> + /// Object,array of objects represents CompaniestoFollow,IndustriestoFollow,NewssourcetoFollow,PeopletoFollow + /// </summary> + [JsonProperty(PropertyName = "Suggestions")] + public Suggestions Suggestions {get;set;} + + /// <summary> + /// Tagline that need to be inserted + /// </summary> + [JsonProperty(PropertyName = "TagLine")] + public string TagLine {get;set;} + + /// <summary> + /// Array of Objects,string represents Id,Name,Category,CreatedDate + /// </summary> + [JsonProperty(PropertyName = "TeleVisionShow")] + public List<Television> TeleVisionShow {get;set;} + + /// <summary> + /// URL for the Thumbnail + /// </summary> + [JsonProperty(PropertyName = "ThumbnailImageUrl")] + public string ThumbnailImageUrl {get;set;} + + /// <summary> + /// The Current Time Zone. + /// </summary> + [JsonProperty(PropertyName = "TimeZone")] + public string TimeZone {get;set;} + + /// <summary> + /// Total Private repository + /// </summary> + [JsonProperty(PropertyName = "TotalPrivateRepository")] + public int? TotalPrivateRepository {get;set;} + + /// <summary> + /// Count of Total status + /// </summary> + [JsonProperty(PropertyName = "TotalStatusesCount")] + public int? TotalStatusesCount {get;set;} + + /// <summary> + /// updated date + /// </summary> + [JsonProperty(PropertyName = "UpdatedTime")] + public string UpdatedTime {get;set;} + + /// <summary> + /// verified + /// </summary> + [JsonProperty(PropertyName = "Verified")] + public string Verified {get;set;} + + /// <summary> + /// Array of Objects,string represents Id,Role,Organization,Cause + /// </summary> + [JsonProperty(PropertyName = "Volunteer")] + public List<Volunteer> Volunteer {get;set;} + + /// <summary> + /// Twitter, Facebook ProfileUrls + /// </summary> + [JsonProperty(PropertyName = "WebProfiles")] + public Dictionary<string,string> WebProfiles {get;set;} + + /// <summary> + /// Personal Website a User has + /// </summary> + [JsonProperty(PropertyName = "Website")] + public string Website {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/UserProfile.cs b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/UserProfile.cs new file mode 100644 index 0000000..14c3079 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Models/ResponseModels/UserProfile/UserProfile.cs @@ -0,0 +1,178 @@ +//----------------------------------------------------------------------- +// <copyright file="ModelClass" company="LoginRadius"> +// Created by LoginRadius Development Team +// Copyright 2019 LoginRadius Inc. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using Newtonsoft.Json; +using LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects; +namespace LoginRadiusSDK.V2.Models.ResponseModels.UserProfile + +{ + + /// <summary> + /// Response containing Definition for Complete UserProfile data + /// </summary> + public class UserProfile:SocialUserProfile + { + /// <summary> + /// Custom fields as user set on LoginRadius Admin Console. + /// </summary> + [JsonProperty(PropertyName = "CustomFields")] + public Dictionary<string,string> CustomFields {get;set;} + + /// <summary> + /// boolean type value, default is true + /// </summary> + [JsonProperty(PropertyName = "EmailVerified")] + public bool? EmailVerified {get;set;} + + /// <summary> + /// Array of Objects,string represents SourceId,Source + /// </summary> + [JsonProperty(PropertyName = "ExternalIds")] + public List<ExternalIds> ExternalIds {get;set;} + + /// <summary> + /// External User Login Id + /// </summary> + [JsonProperty(PropertyName = "ExternalUserLoginId")] + public string ExternalUserLoginId {get;set;} + + /// <summary> + /// boolean type value, default is true + /// </summary> + [JsonProperty(PropertyName = "IsActive")] + public bool? IsActive {get;set;} + + /// <summary> + /// id is custom of not + /// </summary> + [JsonProperty(PropertyName = "IsCustomUid")] + public bool? IsCustomUid {get;set;} + + /// <summary> + /// boolean type value, default is true + /// </summary> + [JsonProperty(PropertyName = "IsDeleted")] + public bool? IsDeleted {get;set;} + + /// <summary> + /// boolean type value, default is true + /// </summary> + [JsonProperty(PropertyName = "IsEmailSubscribed")] + public bool? IsEmailSubscribed {get;set;} + + /// <summary> + /// Pass true if wants to lock the user's Login field else false. + /// </summary> + [JsonProperty(PropertyName = "IsLoginLocked")] + public bool? IsLoginLocked {get;set;} + + /// <summary> + /// Required fields filled once or not + /// </summary> + [JsonProperty(PropertyName = "IsRequiredFieldsFilledOnce")] + public bool? IsRequiredFieldsFilledOnce {get;set;} + + /// <summary> + /// Is secure password or not + /// </summary> + [JsonProperty(PropertyName = "IsSecurePassword")] + public bool? IsSecurePassword {get;set;} + + /// <summary> + /// Last login location + /// </summary> + [JsonProperty(PropertyName = "LastLoginLocation")] + public string LastLoginLocation {get;set;} + + /// <summary> + /// Last password change date + /// </summary> + [JsonProperty(PropertyName = "LastPasswordChangeDate")] + public DateTime? LastPasswordChangeDate {get;set;} + + /// <summary> + /// Last password change token + /// </summary> + [JsonProperty(PropertyName = "LastPasswordChangeToken")] + public string LastPasswordChangeToken {get;set;} + + /// <summary> + /// Type of Lockout + /// </summary> + [JsonProperty(PropertyName = "LoginLockedType")] + public string LoginLockedType {get;set;} + + /// <summary> + /// Number of Logins + /// </summary> + [JsonProperty(PropertyName = "NoOfLogins")] + public int? NoOfLogins {get;set;} + + /// <summary> + /// Password for the email + /// </summary> + [JsonProperty(PropertyName = "Password")] + public string Password {get;set;} + + /// <summary> + /// Date of password expiration + /// </summary> + [JsonProperty(PropertyName = "PasswordExpirationDate")] + public DateTime? PasswordExpirationDate {get;set;} + + /// <summary> + /// Phone ID (Unique Phone Number Identifier of the user) + /// </summary> + [JsonProperty(PropertyName = "PhoneId")] + public string PhoneId {get;set;} + + /// <summary> + /// boolean type value, default is false + /// </summary> + [JsonProperty(PropertyName = "PhoneIdVerified")] + public bool? PhoneIdVerified {get;set;} + + /// <summary> + /// Object type by default false, string represents Version, AcceptSource and datetime represents AcceptDateTime + /// </summary> + [JsonProperty(PropertyName = "PrivacyPolicy")] + public AcceptedPrivacyPolicy PrivacyPolicy {get;set;} + + /// <summary> + /// Provider with which user registered + /// </summary> + [JsonProperty(PropertyName = "RegistrationProvider")] + public string RegistrationProvider {get;set;} + + /// <summary> + /// URL of the webproperty from where the user is registered. + /// </summary> + [JsonProperty(PropertyName = "RegistrationSource")] + public string RegistrationSource {get;set;} + + /// <summary> + /// UID, the unified identifier for each user account + /// </summary> + [JsonProperty(PropertyName = "Uid")] + public string Uid {get;set;} + + /// <summary> + /// Unverified Email Address + /// </summary> + [JsonProperty(PropertyName = "UnverifiedEmail")] + public List<Email> UnverifiedEmail {get;set;} + + /// <summary> + /// Username of the user + /// </summary> + [JsonProperty(PropertyName = "UserName")] + public string UserName {get;set;} + + } +} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RestHook/LoginRadiusRestHookUserProfile.cs b/Source/LoginRadiusSDK.V2/Models/RestHook/LoginRadiusRestHookUserProfile.cs deleted file mode 100755 index ff826d8..0000000 --- a/Source/LoginRadiusSDK.V2/Models/RestHook/LoginRadiusRestHookUserProfile.cs +++ /dev/null @@ -1,118 +0,0 @@ -using System.Collections.Generic; -using LoginRadiusSDK.V2.Models.UserProfile; - -namespace LoginRadiusSDK.V2.Models -{ - public class LoginRadiusRestHookUserProfile - { - public string ID { get; set; } - public string Provider { get; set; } - public string Prefix { get; set; } - public string FirstName { get; set; } - public string MiddleName { get; set; } - public string LastName { get; set; } - public string Suffix { get; set; } - public string FullName { get; set; } - public string NickName { get; set; } - public string ProfileName { get; set; } - public string BirthDate { get; set; } - public string Gender { get; set; } - public string Website { get; set; } - public string Email { get; set; } - public LoginRadiusCountry Country { get; set; } - public string ThumbnailImageUrl { get; set; } - public string ImageUrl { get; set; } - public string Favicon { get; set; } - public string ProfileUrl { get; set; } - public string HomeTown { get; set; } - public string State { get; set; } - public string City { get; set; } - public string Industry { get; set; } - public string About { get; set; } - public string TimeZone { get; set; } - public string LocalLanguage { get; set; } - public string CoverPhoto { get; set; } - public string TagLine { get; set; } - public string Language { get; set; } - public string Verified { get; set; } - public string UpdatedTime { get; set; } - public string Positions { get; set; } - public string Educations { get; set; } - public string PhoneNumbers { get; set; } - public string IMAccounts { get; set; } - public string Addresses { get; set; } - public string MainAddress { get; set; } - public string Created { get; set; } - public string LocalCity { get; set; } - public string ProfileCity { get; set; } - public string LocalCountry { get; set; } - public string ProfileCountry { get; set; } - public bool ?IsProtected { get; set; } - public string RelationshipStatus { get; set; } - public string Quote { get; set; } - public string InterestedIn { get; set; } - public string Interests { get; set; } - public string Religion { get; set; } - public string Political { get; set; } - public string Sports { get; set; } - public string InspirationalPeople { get; set; } - public string HttpsImageUrl { get; set; } - public int ?FollowersCount { get; set; } - public int ?FriendsCount { get; set; } - public string IsGeoEnabled { get; set; } - public int ?TotalStatusesCount { get; set; } - public string Associations { get; set; } - public int ?NumRecommenders { get; set; } - public string Honors { get; set; } - public string Awards { get; set; } - public string Skills { get; set; } - public string CurrentStatus { get; set; } - public string Certifications { get; set; } - public string Courses { get; set; } - public string Volunteer { get; set; } - public string RecommendationsReceived { get; set; } - public string Languages { get; set; } - public string Projects { get; set; } - public string Games { get; set; } - public string Family { get; set; } - public string TeleVisionShow { get; set; } - public string MutualFriends { get; set; } - public string Movies { get; set; } - public string Books { get; set; } - public LoginRadiusAgeRange AgeRange { get; set; } - public string PublicRepository { get; set; } - public bool ?Hireable { get; set; } - public string RepositoryUrl { get; set; } - public string Age { get; set; } - public string Patents { get; set; } - public string FavoriteThings { get; set; } - public string ProfessionalHeadline { get; set; } - public string RelatedProfileViews { get; set; } - public LoginRadiusKloutProfile KloutScore { get; set; } - public string LRUserID { get; set; } - public string PlacesLived { get; set; } - public string Publications { get; set; } - public string JobBookmarks { get; set; } - public string Suggestions { get; set; } - public string Badges { get; set; } - public string MemberUrlResources { get; set; } - public int ?TotalPrivateRepository { get; set; } - public string Currency { get; set; } - public string StarredUrl { get; set; } - public string GistsUrl { get; set; } - public int ?PublicGists { get; set; } - public int ?PrivateGists { get; set; } - public LoginRadiusUserSubscription Subscription { get; set; } - public string Company { get; set; } - public bool ?EmailVerified { get; set; } - public bool ?IsActive { get; set; } - public bool ?IsDeleted { get; set; } - public string Uid { get; set; } - public Dictionary<string, string> CustomFields { get; set; } - public bool ?IsEmailSubscribed { get; set; } - public List<string> PreviousUids { get; set; } - public string PhoneId { get; set; } - public bool ?PhoneIdVerified { get; set; } - public Dictionary<string, string> SecurityQuestionAnswer { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RestHook/RestHookSubscribeModel.cs b/Source/LoginRadiusSDK.V2/Models/RestHook/RestHookSubscribeModel.cs deleted file mode 100755 index e2eef8e..0000000 --- a/Source/LoginRadiusSDK.V2/Models/RestHook/RestHookSubscribeModel.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace LoginRadiusSDK.V2.Models -{ - public class RestHookSubscribeModel : RestHookUnsubscribeModel - { - public string @event { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/RestHook/RestHookUnsubscribeModel.cs b/Source/LoginRadiusSDK.V2/Models/RestHook/RestHookUnsubscribeModel.cs deleted file mode 100755 index 52755fd..0000000 --- a/Source/LoginRadiusSDK.V2/Models/RestHook/RestHookUnsubscribeModel.cs +++ /dev/null @@ -1,9 +0,0 @@ -using LoginRadiusSDK.V2.Util; - -namespace LoginRadiusSDK.V2.Models -{ - public class RestHookUnsubscribeModel : BodyParameters - { - public string target_url { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/Social/Activity/LoginRadiusActivity.cs b/Source/LoginRadiusSDK.V2/Models/Social/Activity/LoginRadiusActivity.cs deleted file mode 100755 index 272c0f0..0000000 --- a/Source/LoginRadiusSDK.V2/Models/Social/Activity/LoginRadiusActivity.cs +++ /dev/null @@ -1,50 +0,0 @@ -// ----------------------------------------------------------------------- -// <copyright file="LoginRadiusContact.cs" company=""> -// TODO: Update copyright text. -// </copyright> -// ----------------------------------------------------------------------- - -using System.Collections.Generic; - -namespace LoginRadiusSDK.V2.Models.Activity -{ - /// <summary> - /// TODO: Update summary. - /// </summary> - public class LoginRadiusActivity - { - public string ActivityId { get; set; } - public string ActivityUrl { get; set; } - public string Title { get; set; } - - public string Published { get; set; } - public string Updated { get; set; } - - public string Name { get; set; } - - public string ProfileUrl { get; set; } - - public string ImageUrl { get; set; } - - public string TotalReply { get; set; } - public string ReplyUrl { get; set; } - - - public string TotalPlusOneRs { get; set; } - public string PlusOneRsUrl { get; set; } - - - public string TotalReShares { get; set; } - public string ReShareUrl { get; set; } - public string UserId { get; set; } - public string Source { get; set; } - public List<Attchments> Attchments { get; set; } - } - - public class Attchments - { - public string AttchmentType { get; set; } - public string AttchmentName { get; set; } - public string AttchmentUrl { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/Social/Album/LoginRadiusAlbum.cs b/Source/LoginRadiusSDK.V2/Models/Social/Album/LoginRadiusAlbum.cs deleted file mode 100755 index 7350caf..0000000 --- a/Source/LoginRadiusSDK.V2/Models/Social/Album/LoginRadiusAlbum.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.Collections.Generic; - -namespace LoginRadiusSDK.V2.Models.Album -{ - public class LoginRadiusAlbum - { - public string ID { get; set; } - public string OwnerId { get; set; } - public string OwnerName { get; set; } - public string Title { get; set; } - public string Description { get; set; } - public string Location { get; set; } - public string Type { get; set; } - public string CreatedDate { get; set; } - public string UpdatedDate { get; set; } - public string CoverImageUrl { get; set; } - public string ImageCount { get; set; } - public string DirectoryUrl { get; set; } - } - - public class ListLoginRadiusAlbum - { - public List<LoginRadiusAlbum> Data { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/Social/Audio/LoginRadiusAudio.cs b/Source/LoginRadiusSDK.V2/Models/Social/Audio/LoginRadiusAudio.cs deleted file mode 100755 index 314d769..0000000 --- a/Source/LoginRadiusSDK.V2/Models/Social/Audio/LoginRadiusAudio.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.Audio -{ - public class LoginRadiusAudio - { - public string ID { get; set; } - - public string OwnerId { get; set; } - public string OwnerName { get; set; } - public string Artist { get; set; } - public string Title { get; set; } - public string Duration { get; set; } - public string Url { get; set; } - public string CreatedDate { get; set; } - public string UpdatedDate { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/Social/CheckIn/LoginRadiusCheckIn.cs b/Source/LoginRadiusSDK.V2/Models/Social/CheckIn/LoginRadiusCheckIn.cs deleted file mode 100755 index b509757..0000000 --- a/Source/LoginRadiusSDK.V2/Models/Social/CheckIn/LoginRadiusCheckIn.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.CheckIn -{ - public class LoginRadiusCheckIn - { - public string ID { get; set; } - - public string CreatedDate { get; set; } - - public string OwnerId { get; set; } - public string OwnerName { get; set; } - public string Latitude { get; set; } - public string Longitude { get; set; } - public string Message { get; set; } - public string PlaceTitle { get; set; } - public string Address { get; set; } - public string Distance { get; set; } - public string Type { get; set; } - - public string ImageUrl { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/Social/Comment/LoginRadiusComment.cs b/Source/LoginRadiusSDK.V2/Models/Social/Comment/LoginRadiusComment.cs deleted file mode 100755 index 71991e9..0000000 --- a/Source/LoginRadiusSDK.V2/Models/Social/Comment/LoginRadiusComment.cs +++ /dev/null @@ -1,39 +0,0 @@ -// ----------------------------------------------------------------------- -// <copyright file="LoginRadiusContact.cs" company=""> -// TODO: Update copyright text. -// </copyright> -// ----------------------------------------------------------------------- - -using System.Collections.Generic; - -namespace LoginRadiusSDK.V2.Models.Comment -{ - /// <summary> - /// TODO: Update summary. - /// </summary> - public class LoginRadiusComment - { - public string CommentId { get; set; } - - public string Published { get; set; } - public string Updated { get; set; } - - public string Name { get; set; } - - public string ProfileUrl { get; set; } - - public string ImageUrl { get; set; } - - public string UserId { get; set; } - public string Type { get; set; } - public string Comment { get; set; } - - public List<ReplyList> ReplyList { get; set; } - } - - public class ReplyList - { - public string ReplyId { get; set; } - public string ReplyUrl { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/Social/Company/LoginRadiusCompany.cs b/Source/LoginRadiusSDK.V2/Models/Social/Company/LoginRadiusCompany.cs deleted file mode 100755 index f22cd95..0000000 --- a/Source/LoginRadiusSDK.V2/Models/Social/Company/LoginRadiusCompany.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.Company -{ - public class LoginRadiusCompany - { - public string ID { get; set; } - - public string Name { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/Social/Contact/LoginRadiusContact.cs b/Source/LoginRadiusSDK.V2/Models/Social/Contact/LoginRadiusContact.cs deleted file mode 100755 index aee5fad..0000000 --- a/Source/LoginRadiusSDK.V2/Models/Social/Contact/LoginRadiusContact.cs +++ /dev/null @@ -1,35 +0,0 @@ -// ----------------------------------------------------------------------- -// <copyright file="LoginRadiusContact.cs" company=""> -// TODO: Update copyright text. -// </copyright> -// ----------------------------------------------------------------------- - -using System.Collections.Generic; - -namespace LoginRadiusSDK.V2.Models.Contact -{ - /// <summary> - /// TODO: Update summary. - /// </summary> - public class LoginRadiusContact - { - public string NextCursor { get; set; } - public List<Data> Data { get; set; } - } - - public class Data - { - public string Name { get; set; } - public string EmailID { get; set; } - public string PhoneNumber { get; set; } - public string ID { get; set; } - public string ProfileUrl { get; set; } - public string ImageUrl { get; set; } - public string Status { get; set; } - public string Industry { get; set; } - public string Country { get; set; } - public string Location { get; set; } - public string Gender { get; set; } - public string DateOfBirth { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/Social/Event/LoginRadiusEvent.cs b/Source/LoginRadiusSDK.V2/Models/Social/Event/LoginRadiusEvent.cs deleted file mode 100755 index 9156f85..0000000 --- a/Source/LoginRadiusSDK.V2/Models/Social/Event/LoginRadiusEvent.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Collections.Generic; - -namespace LoginRadiusSDK.V2.Models.Event -{ - public class LoginRadiusEvent - { - public string Name { get; set; } - public string Privacy { get; set; } - public string OwnerName { get; set; } - public string RsvpStatus { get; set; } - public string UpdatedDate { get; set; } - public string Location { get; set; } - public string StartTime { get; set; } - public string OwnerId { get; set; } - public string EndTime { get; set; } - public string ID { get; set; } - public string Description { get; set; } - } - - public class ListLoginRadiusEvent - { - public List<LoginRadiusEvent> Data { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/Social/Following/LoginRadiusFollowing.cs b/Source/LoginRadiusSDK.V2/Models/Social/Following/LoginRadiusFollowing.cs deleted file mode 100755 index e3bd91c..0000000 --- a/Source/LoginRadiusSDK.V2/Models/Social/Following/LoginRadiusFollowing.cs +++ /dev/null @@ -1,27 +0,0 @@ -// ----------------------------------------------------------------------- -// <copyright file="LoginRadiusContact.cs" company=""> -// TODO: Update copyright text. -// </copyright> -// ----------------------------------------------------------------------- - -namespace LoginRadiusSDK.V2.Models.Following -{ - /// <summary> - /// TODO: Update summary. - /// </summary> - public class LoginRadiusFollowing - { - public string Name { get; set; } - public string EmailID { get; set; } - public string PhoneNumber { get; set; } - public string ID { get; set; } - public string ProfileUrl { get; set; } - public string ImageUrl { get; set; } - public string Status { get; set; } - public string Industry { get; set; } - public string Country { get; set; } - public string Location { get; set; } - public string Gender { get; set; } - public string DateOfBirth { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/Social/Group/LoginRadiusGroup.cs b/Source/LoginRadiusSDK.V2/Models/Social/Group/LoginRadiusGroup.cs deleted file mode 100755 index 240a7e2..0000000 --- a/Source/LoginRadiusSDK.V2/Models/Social/Group/LoginRadiusGroup.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Collections.Generic; - -namespace LoginRadiusSDK.V2.Models.Group -{ - public class LoginRadiusGroup - { - public string Description { get; set; } - public object MemberCount { get; set; } - public string Country { get; set; } - public string Image { get; set; } - public string Email { get; set; } - public string PostalCode { get; set; } - public string Logo { get; set; } - public string Type { get; set; } - public string ID { get; set; } - public string Name { get; set; } - } - - public class ListLoginRadiusGroup - { - public List<LoginRadiusGroup> Data { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/Social/Like/LoginRadiusLike.cs b/Source/LoginRadiusSDK.V2/Models/Social/Like/LoginRadiusLike.cs deleted file mode 100755 index b32ef59..0000000 --- a/Source/LoginRadiusSDK.V2/Models/Social/Like/LoginRadiusLike.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.Collections.Generic; - -namespace LoginRadiusSDK.V2.Models.Like -{ - public class LoginRadiusLike - { - public string Category { get; set; } - public string Website { get; set; } - public string Name { get; set; } - public string CreatedDate { get; set; } - public string ID { get; set; } - public string Description { get; set; } - } - - public class ListLoginRadiusLike - { - public List<LoginRadiusLike> Data { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/Social/Mention/LoginRadiusMention.cs b/Source/LoginRadiusSDK.V2/Models/Social/Mention/LoginRadiusMention.cs deleted file mode 100755 index 291f19e..0000000 --- a/Source/LoginRadiusSDK.V2/Models/Social/Mention/LoginRadiusMention.cs +++ /dev/null @@ -1,24 +0,0 @@ -// ----------------------------------------------------------------------- -// <copyright file="LoginRadiusContact.cs" company=""> -// TODO: Update copyright text. -// </copyright> -// ----------------------------------------------------------------------- - -namespace LoginRadiusSDK.V2.Models.Mention -{ - /// <summary> - /// TODO: Update summary. - /// </summary> - public class LoginRadiusMention - { - public string Name { get; set; } - public string Text { get; set; } - public object ImageUrl { get; set; } - public string DateTime { get; set; } - public string Source { get; set; } - public string Place { get; set; } - public int ?Likes { get; set; } - public object LinkUrl { get; set; } - public string Id { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/Social/Page/LoginRadiusCountryCodeName.cs b/Source/LoginRadiusSDK.V2/Models/Social/Page/LoginRadiusCountryCodeName.cs deleted file mode 100755 index 1e79293..0000000 --- a/Source/LoginRadiusSDK.V2/Models/Social/Page/LoginRadiusCountryCodeName.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.Page -{ - public class LoginRadiusCountryCodeName - { - public string Code { get; set; } - public string Name { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/Social/Page/LoginRadiusPage.cs b/Source/LoginRadiusSDK.V2/Models/Social/Page/LoginRadiusPage.cs deleted file mode 100755 index 5db905c..0000000 --- a/Source/LoginRadiusSDK.V2/Models/Social/Page/LoginRadiusPage.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System.Collections.Generic; - -namespace LoginRadiusSDK.V2.Models.Page -{ - public class LoginRadiusPage - { - public string ID { get; set; } - - public string Name { get; set; } - - public string Url { get; set; } - - public string Category { get; set; } - - public string Likes { get; set; } - public string Phone { get; set; } - - public string Image { get; set; } - - public string Website { get; set; } - public string About { get; set; } - public string Description { get; set; } - public string Awards { get; set; } - public string CheckinCount { get; set; } - public string Founded { get; set; } - public string Mission { get; set; } - public string Products { get; set; } - public string ReleaseDate { get; set; } - public string TalkingAboutCount { get; set; } - - public bool ?Published { get; set; } - - public string UserName { get; set; } - - public List<LoginRadiusPageLocations> Locations { get; set; } - public List<LoginRadiusPageCategoryList> CategoryList { get; set; } - public LoginRadiusPageCover CoverImage { get; set; } - public LoginRadiusPageCodeName EmployeeCountRange { get; set; } - public List<LoginRadiusPageCodeName> Industries { get; set; } - public Specility Specialties { get; set; } - public LoginRadiusPageCodeName Status { get; set; } - public LoginRadiusPageCodeName StockExchange { get; set; } - } - - public class Specility - { - public int ?Total { get; set; } - public List<string>SpecialityNames { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/Social/Page/LoginRadiusPageCategoryList.cs b/Source/LoginRadiusSDK.V2/Models/Social/Page/LoginRadiusPageCategoryList.cs deleted file mode 100755 index 46a0d66..0000000 --- a/Source/LoginRadiusSDK.V2/Models/Social/Page/LoginRadiusPageCategoryList.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.Page -{ - public class LoginRadiusPageCategoryList - { - public string Id { get; set; } - public string Name { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/Social/Page/LoginRadiusPageCodeName.cs b/Source/LoginRadiusSDK.V2/Models/Social/Page/LoginRadiusPageCodeName.cs deleted file mode 100755 index 7ecbb4a..0000000 --- a/Source/LoginRadiusSDK.V2/Models/Social/Page/LoginRadiusPageCodeName.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.Page -{ - public class LoginRadiusPageCodeName - { - public string Code { get; set; } - public string Name { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/Social/Page/LoginRadiusPageCover.cs b/Source/LoginRadiusSDK.V2/Models/Social/Page/LoginRadiusPageCover.cs deleted file mode 100755 index 2849709..0000000 --- a/Source/LoginRadiusSDK.V2/Models/Social/Page/LoginRadiusPageCover.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.Page -{ - public class LoginRadiusPageCover - { - public string Id { get; set; } - public string Source { get; set; } - public string OffsetY { get; set; } - public string OffsetX { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/Social/Page/LoginRadiusPageLocation.cs b/Source/LoginRadiusSDK.V2/Models/Social/Page/LoginRadiusPageLocation.cs deleted file mode 100755 index 2654a57..0000000 --- a/Source/LoginRadiusSDK.V2/Models/Social/Page/LoginRadiusPageLocation.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.Page -{ - public class LoginRadiusPageLocation - { - public string Street { get; set; } - public string City { get; set; } - public string State { get; set; } - public LoginRadiusCountryCodeName Country { get; set; } - public string Zip { get; set; } - public double Latitude { get; set; } - public double Longitude { get; set; } - public string Phone { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/Social/Page/LoginRadiusPageLocations.cs b/Source/LoginRadiusSDK.V2/Models/Social/Page/LoginRadiusPageLocations.cs deleted file mode 100755 index 71e12b7..0000000 --- a/Source/LoginRadiusSDK.V2/Models/Social/Page/LoginRadiusPageLocations.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.Page -{ - public class LoginRadiusPageLocations - { - public string Street { get; set; } - public string City { get; set; } - public string State { get; set; } - public LoginRadiusCountryCodeName Country { get; set; } - public string Zip { get; set; } - public double Latitude { get; set; } - public double Longitude { get; set; } - public string Phone { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/Social/Page/LoginRadiusPages.cs b/Source/LoginRadiusSDK.V2/Models/Social/Page/LoginRadiusPages.cs deleted file mode 100755 index fbd8641..0000000 --- a/Source/LoginRadiusSDK.V2/Models/Social/Page/LoginRadiusPages.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System.Collections.Generic; - -namespace LoginRadiusSDK.V2.Models.Page -{ - public class LoginRadiusPages - { - public string ID { get; set; } - - public string Name { get; set; } - - public string Url { get; set; } - - public string Category { get; set; } - - public string Likes { get; set; } - public string Phone { get; set; } - - public string Image { get; set; } - - public string Website { get; set; } - public string About { get; set; } - public string Description { get; set; } - public string Awards { get; set; } - public string CheckinCount { get; set; } - public string Founded { get; set; } - public string Mission { get; set; } - public string Products { get; set; } - public string ReleaseDate { get; set; } - public string TalkingAboutCount { get; set; } - - public bool? Published { get; set; } - - public string UserName { get; set; } - - public List<LoginRadiusPageLocations> Locations { get; set; } - public List<LoginRadiusPageCategoryList> CategoryList { get; set; } - public LoginRadiusPageCover CoverImage { get; set; } - public LoginRadiusPageCodeName EmployeeCountRange { get; set; } - public List<LoginRadiusPageCodeName> Industries { get; set; } - public Specility Specialties { get; set; } - public LoginRadiusPageCodeName Status { get; set; } - public LoginRadiusPageCodeName StockExchange { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/Social/Photo/FacebookAlbumImages.cs b/Source/LoginRadiusSDK.V2/Models/Social/Photo/FacebookAlbumImages.cs deleted file mode 100755 index 242af9a..0000000 --- a/Source/LoginRadiusSDK.V2/Models/Social/Photo/FacebookAlbumImages.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace LoginRadiusSDK.V2.Models.Photo -{ - public class FacebookAlbumImages - { - public string Dimensions { get; set; } - public string Image { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/Social/Photo/LoginRadiusPhoto.cs b/Source/LoginRadiusSDK.V2/Models/Social/Photo/LoginRadiusPhoto.cs deleted file mode 100755 index b6d984c..0000000 --- a/Source/LoginRadiusSDK.V2/Models/Social/Photo/LoginRadiusPhoto.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.Collections.Generic; - -namespace LoginRadiusSDK.V2.Models.Photo -{ - public class LoginRadiusPhoto - { - public string ID { get; set; } - public string AlbumId { get; set; } - public string OwnerId { get; set; } - public string OwnerName { get; set; } - - public string Name { get; set; } - - public string DirectUrl { get; set; } - - public string ImageUrl { get; set; } - - public string Location { get; set; } - - public string Link { get; set; } - - public string Description { get; set; } - - public string Height { get; set; } - public string Width { get; set; } - public string CreatedDate { get; set; } - public string UpdatedDate { get; set; } - public List<FacebookAlbumImages> Images { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/Social/Status/LoginRadiusStatus.cs b/Source/LoginRadiusSDK.V2/Models/Social/Status/LoginRadiusStatus.cs deleted file mode 100755 index 728faa2..0000000 --- a/Source/LoginRadiusSDK.V2/Models/Social/Status/LoginRadiusStatus.cs +++ /dev/null @@ -1,22 +0,0 @@ -namespace LoginRadiusSDK.V2.Models -{ - public class LoginRadiusStatus - { - public string Id { get; set; } - - public string Text { get; set; } - - public string DateTime { get; set; } - - public int? Likes { get; set; } - - public string Place { get; set; } - - public string Source { get; set; } - - public string ImageUrl { get; set; } - - public string LinkUrl { get; set; } - public string Name { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/Social/Status/StatusUpdateModel.cs b/Source/LoginRadiusSDK.V2/Models/Social/Status/StatusUpdateModel.cs deleted file mode 100755 index 9bb5ac4..0000000 --- a/Source/LoginRadiusSDK.V2/Models/Social/Status/StatusUpdateModel.cs +++ /dev/null @@ -1,71 +0,0 @@ -using LoginRadiusSDK.V2.Util.Serialization; - -namespace LoginRadiusSDK.V2.Models -{ - public class StatusUpdateModel : LoginRadiusSerializableObject - { - /// <summary> - /// A title for status message. - /// </summary> - public string Title { get; set; } - - /// <summary> - /// A web link of the status message - /// </summary> - public string Url { get; set; } - - /// <summary> - /// An image URL of the status message - /// </summary> - public string Imageurl { get; set; } - - /// <summary> - /// The status message text - /// </summary> - public string status { get; set; } - - /// <summary> - /// A caption of the status message - /// </summary> - public string Caption { get; set; } - - /// <summary> - /// A description of the status message - /// </summary> - public string Description { get; set; } - } - - - public class PostStatus - { - /// <summary> - /// A title for status message. - /// </summary> - public string Title { get; set; } - - /// <summary> - /// A web link of the status message - /// </summary> - public string Url { get; set; } - - /// <summary> - /// An image URL of the status message - /// </summary> - public string Imageurl { get; set; } - - /// <summary> - /// The status message text - /// </summary> - public string Status { get; set; } - - /// <summary> - /// A caption of the status message - /// </summary> - public string Caption { get; set; } - - /// <summary> - /// A description of the status message - /// </summary> - public string Description { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/Social/Video/LoginRadiusVideo.cs b/Source/LoginRadiusSDK.V2/Models/Social/Video/LoginRadiusVideo.cs deleted file mode 100755 index ce78436..0000000 --- a/Source/LoginRadiusSDK.V2/Models/Social/Video/LoginRadiusVideo.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System.Collections.Generic; - -namespace LoginRadiusSDK.V2.Models.Video -{ - public class Data - { - public string EmbedHtml { get; set; } - public string Description { get; set; } - public string Image { get; set; } - public object DirectLink { get; set; } - public string Source { get; set; } - public string UpdatedDate { get; set; } - public string OwnerName { get; set; } - public string CreatedDate { get; set; } - public object Duration { get; set; } - public string OwnerId { get; set; } - public string ID { get; set; } - public string Name { get; set; } - } - - - public class UserProfile - { - public string EmbedHtml { get; set; } - public string Description { get; set; } - public string Image { get; set; } - public object DirectLink { get; set; } - public string Source { get; set; } - public string UpdatedDate { get; set; } - public string OwnerName { get; set; } - public string CreatedDate { get; set; } - public object Duration { get; set; } - public string OwnerId { get; set; } - public string ID { get; set; } - public string Name { get; set; } - } - - public class LoginRadiusVideo - { - public List<Data> Data { get; set; } - public string NextCursor { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/Sott.cs b/Source/LoginRadiusSDK.V2/Models/Sott.cs deleted file mode 100755 index 2255179..0000000 --- a/Source/LoginRadiusSDK.V2/Models/Sott.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; - -namespace LoginRadiusSDK.V2.Models -{ - public class SottDetails - { - public string ServerLocation { get; set; } - public string ServerName { get; set; } - public string CurrentTime { get; set; } - public Sott Sott { get; set; } - } - - public class Sott - { - public string StartTime { get; set; } - public string EndTime { get; set; } - public string TimeDifference { get; set; } - } - - public class SottResponseData - { - public string Sott { get; set; } - public DateTime ExpiryTime { get; set; } - } - - public class SottRequest : Sott - { - public string Sott { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Models/webhook/webhook.cs b/Source/LoginRadiusSDK.V2/Models/webhook/webhook.cs deleted file mode 100755 index bb0d8e1..0000000 --- a/Source/LoginRadiusSDK.V2/Models/webhook/webhook.cs +++ /dev/null @@ -1,33 +0,0 @@ -using LoginRadiusSDK.V2.Util.Serialization; -using System.Collections.Generic; - -namespace LoginRadiusSDK.V2.Models.webhook -{ - public class webhookPost : LoginRadiusSerializableObject - { - public string TargetUrl { get; set; } - public string Event { get; set; } - } - - - public class LoginRadiouswebhookEvent - { - public string Count { get; set; } - public List<webhookPost> data { get; set; } - } - - - - public class LoginRadiusWebhookSubscribe - { - public bool? IsPosted { get; set; } - } - public class LoginRadiusWebhookUnSubscribe - { - public bool? IsDeleted{ get; set; } - } - public class LoginRadiusWebhookTestResponse - { - public bool? IsAllowed { get; set; } - } -} \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Util/QueryParameters.cs b/Source/LoginRadiusSDK.V2/Util/QueryParameters.cs index 97f2b4d..3505c3b 100755 --- a/Source/LoginRadiusSDK.V2/Util/QueryParameters.cs +++ b/Source/LoginRadiusSDK.V2/Util/QueryParameters.cs @@ -3,7 +3,6 @@ #if !NETSTANDARD1_3 using System.Web; #endif -using LoginRadiusSDK.V2.Models; using LoginRadiusSDK.V2.Util.Serialization; namespace LoginRadiusSDK.V2.Util @@ -49,29 +48,8 @@ public void AddRange<T>(ICollection<T> target, IEnumerable<T> source) target.Add(element); } - public void AddOptionalParamsRange(LoginRadiusApiOptionalParams source) - { - if (!string.IsNullOrWhiteSpace(source.SmsTemplate)) Add(nameof(source.SmsTemplate), source.SmsTemplate); - if (!string.IsNullOrWhiteSpace(source.DeleteUrl)) Add(nameof(source.DeleteUrl), source.DeleteUrl); - if (!string.IsNullOrWhiteSpace(source.EmailTemplate)) Add(nameof(source.EmailTemplate), source.EmailTemplate); - if (!string.IsNullOrWhiteSpace(source.LoginUrl)) Add(nameof(source.LoginUrl), source.LoginUrl); - if (!string.IsNullOrWhiteSpace(source.SmsTemplate2Fa)) Add(nameof(source.SmsTemplate2Fa), source.SmsTemplate2Fa); - if (!string.IsNullOrWhiteSpace(source.VerificationUrl)) Add(nameof(source.VerificationUrl), source.VerificationUrl); - if (!string.IsNullOrWhiteSpace(source.G_Recaptcha_Response)) Add(nameof(source.G_Recaptcha_Response), source.G_Recaptcha_Response); - } - - public void AddOptionalParamsRange(TwoFactorAuthModel source) - { - if (!string.IsNullOrWhiteSpace(source.GoogleAuthenticatorCode)) - Add(nameof(source.GoogleAuthenticatorCode), source.GoogleAuthenticatorCode); + - if (!string.IsNullOrWhiteSpace(source.Otp)) Add(nameof(source.Otp), source.Otp); - } - - public void AddOptionalParamsRange(TwoFactorPhoneAuthModel source) - { - if (!string.IsNullOrWhiteSpace(source.PhoneNo2Fa)) Add(nameof(source.PhoneNo2Fa), source.PhoneNo2Fa); - } public void TryAdd(string key, string value) { @@ -79,7 +57,7 @@ public void TryAdd(string key, string value) } } - public class BodyParameters : Dictionary<string, string> + public class BodyParameters : Dictionary<string, object> { /// <summary> /// Converts this object to a JSON string. diff --git a/Source/LoginRadiusSDK.V2/Util/SDKUtil.cs b/Source/LoginRadiusSDK.V2/Util/SDKUtil.cs index 0b34573..3236e9e 100755 --- a/Source/LoginRadiusSDK.V2/Util/SDKUtil.cs +++ b/Source/LoginRadiusSDK.V2/Util/SDKUtil.cs @@ -2,11 +2,10 @@ using System.Collections.Generic; using System.Collections.Specialized; using System.Text; -using System.Text.RegularExpressions; #if !NETSTANDARD1_3 using System.Web; #endif -using LoginRadiusSDK.V2.Entity; + using LoginRadiusSDK.V2.Exception; using Microsoft.Win32; @@ -43,10 +42,7 @@ public static string FormatURIPath(string pattern, object[] parameters) /// <param name="pattern"></param> /// <param name="parameters"></param> /// <returns></returns> - public static string FormatURIPath(LoginRadiusResourcePath pattern, object[] parameters) - { - return FormatURIPath(pattern.ToString(), parameters); - } + /// <summary> /// Formats the URI path for REST calls. Replaces any occurrences of the form diff --git a/Source/LoginRadiusSDK.V2/Util/Serialization/LoginRadiusSerializableObject.cs b/Source/LoginRadiusSDK.V2/Util/Serialization/LoginRadiusSerializableObject.cs index e194c02..bc7c815 100755 --- a/Source/LoginRadiusSDK.V2/Util/Serialization/LoginRadiusSerializableObject.cs +++ b/Source/LoginRadiusSDK.V2/Util/Serialization/LoginRadiusSerializableObject.cs @@ -10,5 +10,14 @@ public virtual string ConvertToJson() { return JsonFormatter.ConvertToJson(this); } + + /// <summary> + /// Converts this object to a JSON string. + /// </summary> + /// <returns>A JSON-formatted string.</returns> + public static string ConvertToJson<T>(T obj) + { + return JsonFormatter.ConvertToJson(obj); + } } } \ No newline at end of file