AdminDisableUserRequest

We found 10 examples in language CSharp for this search. You will see 17 fragments of code.
        /// <summary>
        /// Marshaller the request object to the HTTP request.
        /// </summary>  
        /// <param name="input"></param>
        /// <returns></returns>
        public IRequest Marshall(AmazonWebServiceRequest input)
        {
            return this.Marshall((AdminDisableUserRequest)input);
        }

        /// <summary>
        /// Marshaller the request object to the HTTP request.
        /// </summary>  
        /// <param name="input"></param>
        /// <returns></returns>
        public IRequest Marshall(AmazonWebServiceRequest input)
        {
            return this.Marshall((AdminDisableUserRequest)input);
        }

        /// <summary>
        /// Marshaller the request object to the HTTP request.
        /// </summary>  
        /// <param name="input"></param>
        /// <returns></returns>
        public IRequest Marshall(AmazonWebServiceRequest input)
        {
            return this.Marshall((AdminDisableUserRequest)input);
        }

        /// <summary>
        /// Marshaller the request object to the HTTP request.
        /// </summary>  
        /// <param name="input"></param>
        /// <returns></returns>
        public IRequest Marshall(AmazonWebServiceRequest input)
        {
            return this.Marshall((AdminDisableUserRequest)input);
        }

        /// <summary>
        /// Marshaller the request object to the HTTP request.
        /// </summary>  
        /// <param name="input"></param>
        /// <returns></returns>
        public IRequest Marshall(AmazonWebServiceRequest input)
        {
            return this.Marshall((AdminDisableUserRequest)input);
        }

        /// <summary>
        /// Marshaller the request object to the HTTP request.
        /// </summary>  
        /// <param name="input"></param>
        /// <returns></returns>
        public IRequest Marshall(AmazonWebServiceRequest input)
        {
            return this.Marshall((AdminDisableUserRequest)input);
        }

        /// <summary>
        /// Marshaller the request object to the HTTP request.
        /// </summary>  
        /// <param name="input"></param>
        /// <returns></returns>
        public IRequest Marshall(AmazonWebServiceRequest input)
        {
            return this.Marshall((AdminDisableUserRequest)input);
        }


    public async Task DeactivateUserAsync(string userName)
    {
      await _provider.AdminDisableUserAsync(new AdminDisableUserRequest
      {
        UserPoolId = _config.PoolId,
        Username = userName
      });
    }

    public async Task DisabledUserAsync(string userName)
    {
      var request = new AdminDisableUserRequest
      {
        Username = userName,
        UserPoolId = _config.PoolId
      };

      await _provider.AdminDisableUserAsync(request);
    }


        public async Task<Guid> CreateAsync(Profile profile)
        {
            var request = CreateUser(profile);

            AdminCreateUserResponse result = null;

            try
            {
                result = await _provider.AdminCreateUserAsync(request);
            }
            catch (Exception e)
            {
                Console.WriteLine($"Exception: {e.Message}");
            }

            return Guid.Parse(result.User.Attributes.FirstOrDefault(a => a.Name == "sub").Value);
        }

        public async Task<HttpStatusCode> AdminUpdateUserAttributesAsync(Profile profile)
        {
            var request = new AdminUpdateUserAttributesRequest
            {
                UserPoolId = _cognito.UserPool.Id,
                Username = $"{profile.Email}",
                UserAttributes = profile.GetCognitoAttributes().ToList()
            };

            AdminUpdateUserAttributesResponse response;
            
            try
            {
                response = await _provider.AdminUpdateUserAttributesAsync(request);
            }
            catch (Exception e)
            {
                Console.WriteLine($"Exception: {e}");
                throw new Exception();
            }

            return response.HttpStatusCode;
        }

        public async Task DisableUserAsync(Guid key)
        {
            var request = new AdminDisableUserRequest
            {
                Username = $"{key}",
                UserPoolId = _cognito.UserPool.Id
            };

            await _provider.AdminDisableUserAsync(request);
        }

        public async Task EnableUserAsync(Guid key)
        {
            var request = new AdminEnableUserRequest
            {
                Username = $"{key}",
                UserPoolId = _cognito.UserPool.Id
            };

            await _provider.AdminEnableUserAsync(request);
        }

        public async Task AdminResetUserPassword(Guid key)
        {
            var request = new AdminResetUserPasswordRequest
            {
                Username = $"{key}",
                UserPoolId = _cognito.UserPool.Id
            };

            await _provider.AdminResetUserPasswordAsync(request);
        }

        AdminCreateUserRequest CreateUser(Profile profile)
        {
            // TODO: remove 
            var password = $"RSC-{Guid.NewGuid()}";
            Console.WriteLine([email protected]"PASSWORD: {password}");

            return new AdminCreateUserRequest
            {
                UserPoolId = _cognito.UserPool.Id,
                Username = profile.Email,
                TemporaryPassword = password,
                MessageAction = MessageActionType.SUPPRESS,
                UserAttributes = profile.GetCognitoAttributes().ToList(),
            };
        }


        // Check to see if Username property is set
        internal bool IsSetUsername()
        {
            return this._username != null;
        }

        // Check to see if UserPoolId property is set
        internal bool IsSetUserPoolId()
        {
            return this._userPoolId != null;
        }

Amazon.CognitoIdentityProvider.Model.AdminDisableUserRequest : IAmazonWebServiceRequest

Constructors :

public AdminDisableUserRequest()

Methods :

public String get_Username()
public Void set_Username(String value = )
public String get_UserPoolId()
public Void set_UserPoolId(String value = )
public Type GetType()
public String ToString()
public Boolean Equals(Object obj = )
public Int32 GetHashCode()