private PSResourceModel SetResourceModel()
        {
            var encryptedSecret =
                DataBoxEdgeManagementClient.Devices.GetAsymmetricEncryptedSecret(
                    this.DeviceName,
                    this.ResourceGroupName,
                    this.Password.ConvertToString(),
                    this.GetKeyForEncryption()
                    );

            return(new PSResourceModel(
                       UsersOperationsExtensions.CreateOrUpdate(
                           this.DataBoxEdgeManagementClient.Users,
                           this.DeviceName,
                           this.Name,
                           this.ResourceGroupName,
                           encryptedSecret
                           )));
        }
        private PSResourceModel CreateResourceModel()
        {
            var password = this.Password.ConvertToString();

            PasswordUtility.ValidateUserPasswordPattern(nameof(this.Password), password);
            var encryptedSecret =
                DataBoxEdgeManagementClient.Devices.GetAsymmetricEncryptedSecret(
                    this.DeviceName,
                    this.ResourceGroupName,
                    password,
                    this.GetKeyForEncryption()
                    );

            return(new PSResourceModel(
                       UsersOperationsExtensions.CreateOrUpdate(
                           this.DataBoxEdgeManagementClient.Users,
                           this.DeviceName,
                           this.Name,
                           this.ResourceGroupName,
                           encryptedSecret
                           )));
        }