Class: MicrosoftGraph::Models::BaseItemVersion

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

Direct Known Subclasses

DriveItemVersion, ListItemVersion

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 baseItemVersion and sets the default values.



23
24
25
# File 'lib/models/base_item_version.rb', line 23

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 base_item_version

Raises:

  • (StandardError)


31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/models/base_item_version.rb', line 31

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.documentSetVersion"
                return DocumentSetVersion.new
            when "#microsoft.graph.driveItemVersion"
                return DriveItemVersion.new
            when "#microsoft.graph.listItemVersion"
                return ListItemVersion.new
        end
    end
    return BaseItemVersion.new
end

Instance Method Details

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



51
52
53
54
55
56
57
# File 'lib/models/base_item_version.rb', line 51

def get_field_deserializers()
    return super.merge({
        "lastModifiedBy" => lambda {|n| @last_modified_by = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::IdentitySet.create_from_discriminator_value(pn) }) },
        "lastModifiedDateTime" => lambda {|n| @last_modified_date_time = n.get_date_time_value() },
        "publication" => lambda {|n| @publication = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::PublicationFacet.create_from_discriminator_value(pn) }) },
    })
end

#last_modified_byObject

Gets the lastModifiedBy property value. Identity of the user which last modified the version. Read-only.

Returns:

  • a identity_set



62
63
64
# File 'lib/models/base_item_version.rb', line 62

def last_modified_by
    return @last_modified_by
end

#last_modified_by=(value) ⇒ Object

Sets the lastModifiedBy property value. Identity of the user which last modified the version. Read-only.

Parameters:

  • value

    Value to set for the lastModifiedBy property.

Returns:

  • a void



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

def last_modified_by=(value)
    @last_modified_by = value
end

#last_modified_date_timeObject

Gets the lastModifiedDateTime property value. Date and time the version was last modified. Read-only.

Returns:

  • a date_time



77
78
79
# File 'lib/models/base_item_version.rb', line 77

def last_modified_date_time
    return @last_modified_date_time
end

#last_modified_date_time=(value) ⇒ Object

Sets the lastModifiedDateTime property value. Date and time the version was last modified. Read-only.

Parameters:

  • value

    Value to set for the lastModifiedDateTime property.

Returns:

  • a void



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

def last_modified_date_time=(value)
    @last_modified_date_time = value
end

#publicationObject

Gets the publication property value. Indicates the publication status of this particular version. Read-only.

Returns:

  • a publication_facet



92
93
94
# File 'lib/models/base_item_version.rb', line 92

def publication
    return @publication
end

#publication=(value) ⇒ Object

Sets the publication property value. Indicates the publication status of this particular version. Read-only.

Parameters:

  • value

    Value to set for the publication property.

Returns:

  • a void



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

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


108
109
110
111
112
113
114
# File 'lib/models/base_item_version.rb', line 108

def serialize(writer)
    raise StandardError, 'writer cannot be null' if writer.nil?
    super
    writer.write_object_value("lastModifiedBy", @last_modified_by)
    writer.write_date_time_value("lastModifiedDateTime", @last_modified_date_time)
    writer.write_object_value("publication", @publication)
end