Class: MicrosoftGraph::Models::AuthenticationMethodTarget

Inherits:
Entity
  • Object
show all
Includes:
MicrosoftKiotaAbstractions::Parsable
Defined in:
lib/models/authentication_method_target.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Entity

#additional_data, #additional_data=, #id, #id=, #odata_type, #odata_type=

Constructor Details

#initializeObject

Instantiates a new authenticationMethodTarget and sets the default values.



19
20
21
# File 'lib/models/authentication_method_target.rb', line 19

def initialize()
    super
end

Class Method Details

.create_from_discriminator_value(parse_node) ⇒ Object

Creates a new instance of the appropriate class based on discriminator value

Parameters:

  • parse_node

    The parse node to use to read the discriminator value and create the object

Returns:

  • a authentication_method_target

Raises:

  • (StandardError)


27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/models/authentication_method_target.rb', line 27

def self.create_from_discriminator_value(parse_node)
    raise StandardError, 'parse_node cannot be null' if parse_node.nil?
    mapping_value_node = parse_node.get_child_node("@odata.type")
    unless mapping_value_node.nil? then
        mapping_value = mapping_value_node.get_string_value
        case mapping_value
            when "#microsoft.graph.microsoftAuthenticatorAuthenticationMethodTarget"
                return MicrosoftAuthenticatorAuthenticationMethodTarget.new
            when "#microsoft.graph.smsAuthenticationMethodTarget"
                return SmsAuthenticationMethodTarget.new
        end
    end
    return AuthenticationMethodTarget.new
end

Instance Method Details

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



45
46
47
48
49
50
# File 'lib/models/authentication_method_target.rb', line 45

def get_field_deserializers()
    return super.merge({
        "isRegistrationRequired" => lambda {|n| @is_registration_required = n.get_boolean_value() },
        "targetType" => lambda {|n| @target_type = n.get_enum_value(MicrosoftGraph::Models::AuthenticationMethodTargetType) },
    })
end

#is_registration_requiredObject

Gets the isRegistrationRequired property value. Determines if the user is enforced to register the authentication method.

Returns:

  • a boolean



55
56
57
# File 'lib/models/authentication_method_target.rb', line 55

def is_registration_required
    return @is_registration_required
end

#is_registration_required=(value) ⇒ Object

Sets the isRegistrationRequired property value. Determines if the user is enforced to register the authentication method.

Parameters:

  • value

    Value to set for the isRegistrationRequired property.

Returns:

  • a void



63
64
65
# File 'lib/models/authentication_method_target.rb', line 63

def is_registration_required=(value)
    @is_registration_required = value
end

#serialize(writer) ⇒ Object

Serializes information the current object

Parameters:

  • writer

    Serialization writer to use to serialize this model

Returns:

  • a void

Raises:

  • (StandardError)


71
72
73
74
75
76
# File 'lib/models/authentication_method_target.rb', line 71

def serialize(writer)
    raise StandardError, 'writer cannot be null' if writer.nil?
    super
    writer.write_boolean_value("isRegistrationRequired", @is_registration_required)
    writer.write_enum_value("targetType", @target_type)
end

#target_typeObject

Gets the targetType property value. The targetType property

Returns:

  • a authentication_method_target_type



81
82
83
# File 'lib/models/authentication_method_target.rb', line 81

def target_type
    return @target_type
end

#target_type=(value) ⇒ Object

Sets the targetType property value. The targetType property

Parameters:

  • value

    Value to set for the targetType property.

Returns:

  • a void



89
90
91
# File 'lib/models/authentication_method_target.rb', line 89

def target_type=(value)
    @target_type = value
end