Exemplo n.º 1
0
        /// <summary>
        /// Enable or Disable a Guardian factor.
        /// </summary>
        /// <param name="request">The <see cref="UpdateGuardianFactorRequest" /> containing the details of the factor to update.</param>
        /// <returns>The <see cref="UpdateGuardianFactorResponse" /> indicating the status of the factor.</returns>
        public Task <UpdateGuardianFactorResponse> UpdateFactorAsync(UpdateGuardianFactorRequest request)
        {
            var name = request.Factor == GuardianFactorName.PushNotifications ? "push-notification" : "sms";

            return(Connection
                   .SendAsync <UpdateGuardianFactorResponse>(
                       HttpMethod.Put,
                       BuildUri($"guardian/factors/{name}"),
                       new { enabled = request.IsEnabled },
                       DefaultHeaders));
        }
Exemplo n.º 2
0
        public Task <UpdateGuardianFactorResponse> UpdateFactorAsync(UpdateGuardianFactorRequest request)
        {
            var name = request.Factor == GuardianFactorName.PushNotifications ? "push-notification" : "sms";

            return(Connection
                   .PutAsync <UpdateGuardianFactorResponse>(
                       "guardian/factors/{name}",
                       new { enabled = request.IsEnabled },
                       null, null,
                       new Dictionary <string, string> {
                { "name", name }
            },
                       null, null));
        }