Class: AWS::IAM::MFADevice
- Inherits:
-
Object
- Object
- AWS::IAM::MFADevice
- Defined in:
- lib/aws/iam/mfa_device.rb
Instance Attribute Summary collapse
-
#serial_number ⇒ String
readonly
Returns the MFA device’s serial number.
-
#user ⇒ User
readonly
Returns the MFA device’s user.
Instance Method Summary collapse
-
#deactivate ⇒ nil
(also: #delete)
Deactivates the MFA device and removes it from association with the user for which it was originally enabled.
-
#initialize(user, serial_number, options = {}) ⇒ MFADevice
constructor
A new instance of MFADevice.
Constructor Details
#initialize(user, serial_number, options = {}) ⇒ MFADevice
Returns a new instance of MFADevice.
22 23 24 25 26 |
# File 'lib/aws/iam/mfa_device.rb', line 22 def initialize user, serial_number, = {} @user = user @serial_number = serial_number super end |
Instance Attribute Details
#serial_number ⇒ String (readonly)
Returns the MFA device’s serial number
32 33 34 |
# File 'lib/aws/iam/mfa_device.rb', line 32 def serial_number @serial_number end |
#user ⇒ User (readonly)
Returns the MFA device’s user.
29 30 31 |
# File 'lib/aws/iam/mfa_device.rb', line 29 def user @user end |
Instance Method Details
#deactivate ⇒ nil Also known as: delete
Deactivates the MFA device and removes it from association with the user for which it was originally enabled. You must call AWS::IAM::MFADeviceCollection#enable to enable the device again.
39 40 41 42 43 44 45 |
# File 'lib/aws/iam/mfa_device.rb', line 39 def deactivate client.deactivate_mfa_device({ :user_name => user.name, :serial_number => serial_number, }) nil end |