Class: MicrosoftGraph::Models::MessageRule

Inherits:
Entity
  • Object
show all
Includes:
MicrosoftKiotaAbstractions::Parsable
Defined in:
lib/models/message_rule.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 messageRule and sets the default values.



67
68
69
# File 'lib/models/message_rule.rb', line 67

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 message_rule

Raises:

  • (StandardError)


75
76
77
78
# File 'lib/models/message_rule.rb', line 75

def self.create_from_discriminator_value(parse_node)
    raise StandardError, 'parse_node cannot be null' if parse_node.nil?
    return MessageRule.new
end

Instance Method Details

#actionsObject

Gets the actions property value. Actions to be taken on a message when the corresponding conditions are fulfilled.

Returns:

  • a message_rule_actions



37
38
39
# File 'lib/models/message_rule.rb', line 37

def actions
    return @actions
end

#actions=(value) ⇒ Object

Sets the actions property value. Actions to be taken on a message when the corresponding conditions are fulfilled.

Parameters:

  • value

    Value to set for the actions property.

Returns:

  • a void



45
46
47
# File 'lib/models/message_rule.rb', line 45

def actions=(value)
    @actions = value
end

#conditionsObject

Gets the conditions property value. Conditions that when fulfilled, will trigger the corresponding actions for that rule.

Returns:

  • a message_rule_predicates



52
53
54
# File 'lib/models/message_rule.rb', line 52

def conditions
    return @conditions
end

#conditions=(value) ⇒ Object

Sets the conditions property value. Conditions that when fulfilled, will trigger the corresponding actions for that rule.

Parameters:

  • value

    Value to set for the conditions property.

Returns:

  • a void



60
61
62
# File 'lib/models/message_rule.rb', line 60

def conditions=(value)
    @conditions = value
end

#display_nameObject

Gets the displayName property value. The display name of the rule.

Returns:

  • a string



83
84
85
# File 'lib/models/message_rule.rb', line 83

def display_name
    return @display_name
end

#display_name=(value) ⇒ Object

Sets the displayName property value. The display name of the rule.

Parameters:

  • value

    Value to set for the displayName property.

Returns:

  • a void



91
92
93
# File 'lib/models/message_rule.rb', line 91

def display_name=(value)
    @display_name = value
end

#exceptionsObject

Gets the exceptions property value. Exception conditions for the rule.

Returns:

  • a message_rule_predicates



98
99
100
# File 'lib/models/message_rule.rb', line 98

def exceptions
    return @exceptions
end

#exceptions=(value) ⇒ Object

Sets the exceptions property value. Exception conditions for the rule.

Parameters:

  • value

    Value to set for the exceptions property.

Returns:

  • a void



106
107
108
# File 'lib/models/message_rule.rb', line 106

def exceptions=(value)
    @exceptions = value
end

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/models/message_rule.rb', line 113

def get_field_deserializers()
    return super.merge({
        "actions" => lambda {|n| @actions = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::MessageRuleActions.create_from_discriminator_value(pn) }) },
        "conditions" => lambda {|n| @conditions = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::MessageRulePredicates.create_from_discriminator_value(pn) }) },
        "displayName" => lambda {|n| @display_name = n.get_string_value() },
        "exceptions" => lambda {|n| @exceptions = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::MessageRulePredicates.create_from_discriminator_value(pn) }) },
        "hasError" => lambda {|n| @has_error = n.get_boolean_value() },
        "isEnabled" => lambda {|n| @is_enabled = n.get_boolean_value() },
        "isReadOnly" => lambda {|n| @is_read_only = n.get_boolean_value() },
        "sequence" => lambda {|n| @sequence = n.get_number_value() },
    })
end

#has_errorObject

Gets the hasError property value. Indicates whether the rule is in an error condition. Read-only.

Returns:

  • a boolean



129
130
131
# File 'lib/models/message_rule.rb', line 129

def has_error
    return @has_error
end

#has_error=(value) ⇒ Object

Sets the hasError property value. Indicates whether the rule is in an error condition. Read-only.

Parameters:

  • value

    Value to set for the hasError property.

Returns:

  • a void



137
138
139
# File 'lib/models/message_rule.rb', line 137

def has_error=(value)
    @has_error = value
end

#is_enabledObject

Gets the isEnabled property value. Indicates whether the rule is enabled to be applied to messages.

Returns:

  • a boolean



144
145
146
# File 'lib/models/message_rule.rb', line 144

def is_enabled
    return @is_enabled
end

#is_enabled=(value) ⇒ Object

Sets the isEnabled property value. Indicates whether the rule is enabled to be applied to messages.

Parameters:

  • value

    Value to set for the isEnabled property.

Returns:

  • a void



152
153
154
# File 'lib/models/message_rule.rb', line 152

def is_enabled=(value)
    @is_enabled = value
end

#is_read_onlyObject

Gets the isReadOnly property value. Indicates if the rule is read-only and cannot be modified or deleted by the rules REST API.

Returns:

  • a boolean



159
160
161
# File 'lib/models/message_rule.rb', line 159

def is_read_only
    return @is_read_only
end

#is_read_only=(value) ⇒ Object

Sets the isReadOnly property value. Indicates if the rule is read-only and cannot be modified or deleted by the rules REST API.

Parameters:

  • value

    Value to set for the isReadOnly property.

Returns:

  • a void



167
168
169
# File 'lib/models/message_rule.rb', line 167

def is_read_only=(value)
    @is_read_only = value
end

#sequenceObject

Gets the sequence property value. Indicates the order in which the rule is executed, among other rules.

Returns:

  • a integer



174
175
176
# File 'lib/models/message_rule.rb', line 174

def sequence
    return @sequence
end

#sequence=(value) ⇒ Object

Sets the sequence property value. Indicates the order in which the rule is executed, among other rules.

Parameters:

  • value

    Value to set for the sequence property.

Returns:

  • a void



182
183
184
# File 'lib/models/message_rule.rb', line 182

def sequence=(value)
    @sequence = 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)


190
191
192
193
194
195
196
197
198
199
200
201
# File 'lib/models/message_rule.rb', line 190

def serialize(writer)
    raise StandardError, 'writer cannot be null' if writer.nil?
    super
    writer.write_object_value("actions", @actions)
    writer.write_object_value("conditions", @conditions)
    writer.write_string_value("displayName", @display_name)
    writer.write_object_value("exceptions", @exceptions)
    writer.write_boolean_value("hasError", @has_error)
    writer.write_boolean_value("isEnabled", @is_enabled)
    writer.write_boolean_value("isReadOnly", @is_read_only)
    writer.write_number_value("sequence", @sequence)
end