Class: MicrosoftGraph::Models::AttributeDefinition

Inherits:
Object
  • Object
show all
Includes:
MicrosoftKiotaAbstractions::AdditionalDataHolder, MicrosoftKiotaAbstractions::Parsable
Defined in:
lib/models/attribute_definition.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeObject

Instantiates a new attributeDefinition and sets the default values.



115
116
117
# File 'lib/models/attribute_definition.rb', line 115

def initialize()
    @additional_data = Hash.new
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 attribute_definition

Raises:

  • (StandardError)


123
124
125
126
# File 'lib/models/attribute_definition.rb', line 123

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

Instance Method Details

#additional_dataObject

Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.

Returns:

  • a i_dictionary



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

def additional_data
    return @additional_data
end

#additional_data=(value) ⇒ Object

Sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.

Parameters:

  • value

    Value to set for the additionalData property.

Returns:

  • a void



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

def additional_data=(value)
    @additional_data = value
end

#anchorObject

Gets the anchor property value. true if the attribute should be used as the anchor for the object. Anchor attributes must have a unique value identifying an object, and must be immutable. Default is false. One, and only one, of the object’s attributes must be designated as the anchor to support synchronization.

Returns:

  • a boolean



70
71
72
# File 'lib/models/attribute_definition.rb', line 70

def anchor
    return @anchor
end

#anchor=(value) ⇒ Object

Sets the anchor property value. true if the attribute should be used as the anchor for the object. Anchor attributes must have a unique value identifying an object, and must be immutable. Default is false. One, and only one, of the object’s attributes must be designated as the anchor to support synchronization.

Parameters:

  • value

    Value to set for the anchor property.

Returns:

  • a void



78
79
80
# File 'lib/models/attribute_definition.rb', line 78

def anchor=(value)
    @anchor = value
end

#api_expressionsObject

Gets the apiExpressions property value. The apiExpressions property

Returns:

  • a string_key_string_value_pair



85
86
87
# File 'lib/models/attribute_definition.rb', line 85

def api_expressions
    return @api_expressions
end

#api_expressions=(value) ⇒ Object

Sets the apiExpressions property value. The apiExpressions property

Parameters:

  • value

    Value to set for the apiExpressions property.

Returns:

  • a void



93
94
95
# File 'lib/models/attribute_definition.rb', line 93

def api_expressions=(value)
    @api_expressions = value
end

#case_exactObject

Gets the caseExact property value. true if value of this attribute should be treated as case-sensitive. This setting affects how the synchronization engine detects changes for the attribute.

Returns:

  • a boolean



100
101
102
# File 'lib/models/attribute_definition.rb', line 100

def case_exact
    return @case_exact
end

#case_exact=(value) ⇒ Object

Sets the caseExact property value. true if value of this attribute should be treated as case-sensitive. This setting affects how the synchronization engine detects changes for the attribute.

Parameters:

  • value

    Value to set for the caseExact property.

Returns:

  • a void



108
109
110
# File 'lib/models/attribute_definition.rb', line 108

def case_exact=(value)
    @case_exact = value
end

#default_valueObject

Gets the defaultValue property value. The defaultValue property

Returns:

  • a string



131
132
133
# File 'lib/models/attribute_definition.rb', line 131

def default_value
    return @default_value
end

#default_value=(value) ⇒ Object

Sets the defaultValue property value. The defaultValue property

Parameters:

  • value

    Value to set for the defaultValue property.

Returns:

  • a void



139
140
141
# File 'lib/models/attribute_definition.rb', line 139

def default_value=(value)
    @default_value = value
end

#flow_null_valuesObject

Gets the flowNullValues property value. ‘true’ to allow null values for attributes.

Returns:

  • a boolean



146
147
148
# File 'lib/models/attribute_definition.rb', line 146

def flow_null_values
    return @flow_null_values
end

#flow_null_values=(value) ⇒ Object

Sets the flowNullValues property value. ‘true’ to allow null values for attributes.

Parameters:

  • value

    Value to set for the flowNullValues property.

Returns:

  • a void



154
155
156
# File 'lib/models/attribute_definition.rb', line 154

def flow_null_values=(value)
    @flow_null_values = value
end

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# File 'lib/models/attribute_definition.rb', line 161

def get_field_deserializers()
    return {
        "anchor" => lambda {|n| @anchor = n.get_boolean_value() },
        "apiExpressions" => lambda {|n| @api_expressions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::StringKeyStringValuePair.create_from_discriminator_value(pn) }) },
        "caseExact" => lambda {|n| @case_exact = n.get_boolean_value() },
        "defaultValue" => lambda {|n| @default_value = n.get_string_value() },
        "flowNullValues" => lambda {|n| @flow_null_values = n.get_boolean_value() },
        "metadata" => lambda {|n|  = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AttributeDefinitionMetadataEntry.create_from_discriminator_value(pn) }) },
        "multivalued" => lambda {|n| @multivalued = n.get_boolean_value() },
        "mutability" => lambda {|n| @mutability = n.get_enum_value(MicrosoftGraph::Models::Mutability) },
        "name" => lambda {|n| @name = n.get_string_value() },
        "@odata.type" => lambda {|n| @odata_type = n.get_string_value() },
        "referencedObjects" => lambda {|n| @referenced_objects = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ReferencedObject.create_from_discriminator_value(pn) }) },
        "required" => lambda {|n| @required = n.get_boolean_value() },
        "type" => lambda {|n| @type = n.get_enum_value(MicrosoftGraph::Models::AttributeType) },
    }
end

#metadataObject

Gets the metadata property value. Metadata for the given object.

Returns:

  • a attribute_definition_metadata_entry



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

def 
    return 
end

#metadata=(value) ⇒ Object

Sets the metadata property value. Metadata for the given object.

Parameters:

  • value

    Value to set for the metadata property.

Returns:

  • a void



190
191
192
# File 'lib/models/attribute_definition.rb', line 190

def metadata=(value)
     = value
end

#multivaluedObject

Gets the multivalued property value. true if an attribute can have multiple values. Default is false.

Returns:

  • a boolean



197
198
199
# File 'lib/models/attribute_definition.rb', line 197

def multivalued
    return @multivalued
end

#multivalued=(value) ⇒ Object

Sets the multivalued property value. true if an attribute can have multiple values. Default is false.

Parameters:

  • value

    Value to set for the multivalued property.

Returns:

  • a void



205
206
207
# File 'lib/models/attribute_definition.rb', line 205

def multivalued=(value)
    @multivalued = value
end

#mutabilityObject

Gets the mutability property value. The mutability property

Returns:

  • a mutability



212
213
214
# File 'lib/models/attribute_definition.rb', line 212

def mutability
    return @mutability
end

#mutability=(value) ⇒ Object

Sets the mutability property value. The mutability property

Parameters:

  • value

    Value to set for the mutability property.

Returns:

  • a void



220
221
222
# File 'lib/models/attribute_definition.rb', line 220

def mutability=(value)
    @mutability = value
end

#nameObject

Gets the name property value. Name of the attribute. Must be unique within the object definition. Not nullable.

Returns:

  • a string



227
228
229
# File 'lib/models/attribute_definition.rb', line 227

def name
    return @name
end

#name=(value) ⇒ Object

Sets the name property value. Name of the attribute. Must be unique within the object definition. Not nullable.

Parameters:

  • value

    Value to set for the name property.

Returns:

  • a void



235
236
237
# File 'lib/models/attribute_definition.rb', line 235

def name=(value)
    @name = value
end

#odata_typeObject

Gets the @odata.type property value. The OdataType property

Returns:

  • a string



242
243
244
# File 'lib/models/attribute_definition.rb', line 242

def odata_type
    return @odata_type
end

#odata_type=(value) ⇒ Object

Sets the @odata.type property value. The OdataType property

Parameters:

  • value

    Value to set for the @odata.type property.

Returns:

  • a void



250
251
252
# File 'lib/models/attribute_definition.rb', line 250

def odata_type=(value)
    @odata_type = value
end

#referenced_objectsObject

Gets the referencedObjects property value. For attributes with reference type, lists referenced objects (for example, the manager attribute would list User as the referenced object).

Returns:

  • a referenced_object



257
258
259
# File 'lib/models/attribute_definition.rb', line 257

def referenced_objects
    return @referenced_objects
end

#referenced_objects=(value) ⇒ Object

Sets the referencedObjects property value. For attributes with reference type, lists referenced objects (for example, the manager attribute would list User as the referenced object).

Parameters:

  • value

    Value to set for the referencedObjects property.

Returns:

  • a void



265
266
267
# File 'lib/models/attribute_definition.rb', line 265

def referenced_objects=(value)
    @referenced_objects = value
end

#requiredObject

Gets the required property value. true if attribute is required. Object can not be created if any of the required attributes are missing. If during synchronization, the required attribute has no value, the default value will be used. If default the value was not set, synchronization will record an error.

Returns:

  • a boolean



272
273
274
# File 'lib/models/attribute_definition.rb', line 272

def required
    return @required
end

#required=(value) ⇒ Object

Sets the required property value. true if attribute is required. Object can not be created if any of the required attributes are missing. If during synchronization, the required attribute has no value, the default value will be used. If default the value was not set, synchronization will record an error.

Parameters:

  • value

    Value to set for the required property.

Returns:

  • a void



280
281
282
# File 'lib/models/attribute_definition.rb', line 280

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


288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
# File 'lib/models/attribute_definition.rb', line 288

def serialize(writer)
    raise StandardError, 'writer cannot be null' if writer.nil?
    writer.write_boolean_value("anchor", @anchor)
    writer.write_collection_of_object_values("apiExpressions", @api_expressions)
    writer.write_boolean_value("caseExact", @case_exact)
    writer.write_string_value("defaultValue", @default_value)
    writer.write_boolean_value("flowNullValues", @flow_null_values)
    writer.write_collection_of_object_values("metadata", )
    writer.write_boolean_value("multivalued", @multivalued)
    writer.write_enum_value("mutability", @mutability)
    writer.write_string_value("name", @name)
    writer.write_string_value("@odata.type", @odata_type)
    writer.write_collection_of_object_values("referencedObjects", @referenced_objects)
    writer.write_boolean_value("required", @required)
    writer.write_enum_value("type", @type)
    writer.write_additional_data(@additional_data)
end

#typeObject

Gets the type property value. The type property

Returns:

  • a attribute_type



309
310
311
# File 'lib/models/attribute_definition.rb', line 309

def type
    return @type
end

#type=(value) ⇒ Object

Sets the type property value. The type property

Parameters:

  • value

    Value to set for the type property.

Returns:

  • a void



317
318
319
# File 'lib/models/attribute_definition.rb', line 317

def type=(value)
    @type = value
end