private Request GetInternal(Authentications authentications, bool includeEnrollment)
        {
            authentications.SetRequiredFields(new List <string> {
                GlobalConstants.Id
            });
            authentications.CheckRequiredFields();

            Dictionary <string, string> queryStr = new Dictionary <string, string>();
            StringBuilder toInclude = new StringBuilder();

            if (includeEnrollment)
            {
                toInclude.Append("enrollmentchecks");
            }
            queryStr.Add("fields", toInclude.ToString());

            return(new Request(
                       uri: PrepareUri("/accounts/" + _client.Account() + "/authentications/" + authentications.Id()),
                       queryString: queryStr
                       ));
        }
예제 #2
0
        /// <summary>
        /// Get an authentication usind id
        /// </summary>
        /// <param name="auth">Authentications</param>
        /// <returns>Authentications</returns>
        public Authentications Get(Authentications authentications, bool includeEnrollment = false)
        {
            authentications.SetRequiredFields(new List <string> {
                GlobalConstants.Id
            });
            authentications.CheckRequiredFields();

            Dictionary <string, string> queryStr = new Dictionary <string, string>();
            StringBuilder toInclude = new StringBuilder();

            if (includeEnrollment)
            {
                toInclude.Append("enrollmentchecks");
            }
            queryStr.Add("fields", toInclude.ToString());

            Request request = new Request(
                uri: PrepareUri("/accounts/" + _client.Account() + "/authentications/" + authentications.Id()),
                queryString: queryStr
                );

            dynamic response = _client.ProcessRequest(request);

            return(new Authentications(response));
        }