identityProviderHref() public static method

Helper method returns properly formatted identity_provider_href
public static identityProviderHref ( string objectID ) : string
objectID string ID of the Identity Provider being referenced
return string
Ejemplo n.º 1
0
        /// <summary>
        /// Update a user's information, including SSO information. In order to update a user, they must be linked to one of the identity
        /// </summary>
        /// <param name="userID">ID of the user being updated</param>
        /// <param name="currentEmail">The existing email of this user.</param>
        /// <param name="newEmail">The updated email of this user.</param>
        /// <param name="firstName">Updated First Name for user</param>
        /// <param name="lastName">Updated Last Name for user</param>
        /// <param name="phone">Updated phone for user</param>
        /// <param name="identityProviderID">The updated RightScale API href ID of the associated Identity Provider.</param>
        /// <param name="password">Updated password for user</param>
        /// <param name="principalUid">The updated principal identifier (SAML NameID or OpenID identity URL) of this user</param>
        /// <returns></returns>
        public static bool update(string userID, string currentEmail, string newEmail, string firstName, string lastName, string phone, string identityProviderID, string password, string principalUid)
        {
            string putHref = string.Format(APIHrefs.UserByID, userID);
            List <KeyValuePair <string, string> > paramSet = new List <KeyValuePair <string, string> >();

            Utility.CheckStringHasValue(currentEmail);
            Utility.addParameter(currentEmail, "user[current_email]", paramSet);
            Utility.addParameter(newEmail, "user[new_email]", paramSet);
            Utility.addParameter(firstName, "user[first_name]", paramSet);
            Utility.addParameter(lastName, "user[last_name]", paramSet);
            Utility.addParameter(phone, "user[phone]", paramSet);
            Utility.addParameter(Utility.identityProviderHref(identityProviderID), "user[identity_provider_href]", paramSet);
            Utility.addParameter(password, "user[password]", paramSet);
            Utility.addParameter(principalUid, "user[principal_uid]", paramSet);
            return(Core.APIClient.Instance.Put(putHref, paramSet));
        }