Class: MicrosoftGraph::Models::BaseItem

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

Direct Known Subclasses

Drive, DriveItem, List, ListItem, SharedDriveItem, Site

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



47
48
49
# File 'lib/models/base_item.rb', line 47

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

Raises:

  • (StandardError)


100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/models/base_item.rb', line 100

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.drive"
                return Drive.new
            when "#microsoft.graph.driveItem"
                return DriveItem.new
            when "#microsoft.graph.list"
                return List.new
            when "#microsoft.graph.listItem"
                return ListItem.new
            when "#microsoft.graph.sharedDriveItem"
                return SharedDriveItem.new
            when "#microsoft.graph.site"
                return Site.new
        end
    end
    return BaseItem.new
end

Instance Method Details

#created_byObject

Gets the createdBy property value. Identity of the user, device, or application which created the item. Read-only.

Returns:

  • a identity_set



54
55
56
# File 'lib/models/base_item.rb', line 54

def created_by
    return @created_by
end

#created_by=(value) ⇒ Object

Sets the createdBy property value. Identity of the user, device, or application which created the item. Read-only.

Parameters:

  • value

    Value to set for the createdBy property.

Returns:

  • a void



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

def created_by=(value)
    @created_by = value
end

#created_by_userObject

Gets the createdByUser property value. Identity of the user who created the item. Read-only.

Returns:

  • a user



69
70
71
# File 'lib/models/base_item.rb', line 69

def created_by_user
    return @created_by_user
end

#created_by_user=(value) ⇒ Object

Sets the createdByUser property value. Identity of the user who created the item. Read-only.

Parameters:

  • value

    Value to set for the createdByUser property.

Returns:

  • a void



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

def created_by_user=(value)
    @created_by_user = value
end

#created_date_timeObject

Gets the createdDateTime property value. Date and time of item creation. Read-only.

Returns:

  • a date_time



84
85
86
# File 'lib/models/base_item.rb', line 84

def created_date_time
    return @created_date_time
end

#created_date_time=(value) ⇒ Object

Sets the createdDateTime property value. Date and time of item creation. Read-only.

Parameters:

  • value

    Value to set for the createdDateTime property.

Returns:

  • a void



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

def created_date_time=(value)
    @created_date_time = value
end

#descriptionObject

Gets the description property value. Provides a user-visible description of the item. Optional.

Returns:

  • a string



126
127
128
# File 'lib/models/base_item.rb', line 126

def description
    return @description
end

#description=(value) ⇒ Object

Sets the description property value. Provides a user-visible description of the item. Optional.

Parameters:

  • value

    Value to set for the description property.

Returns:

  • a void



134
135
136
# File 'lib/models/base_item.rb', line 134

def description=(value)
    @description = value
end

#e_tagObject

Gets the eTag property value. ETag for the item. Read-only.

Returns:

  • a string



141
142
143
# File 'lib/models/base_item.rb', line 141

def e_tag
    return @e_tag
end

#e_tag=(value) ⇒ Object

Sets the eTag property value. ETag for the item. Read-only.

Parameters:

  • value

    Value to set for the eTag property.

Returns:

  • a void



149
150
151
# File 'lib/models/base_item.rb', line 149

def e_tag=(value)
    @e_tag = value
end

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# File 'lib/models/base_item.rb', line 156

def get_field_deserializers()
    return super.merge({
        "createdBy" => lambda {|n| @created_by = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::IdentitySet.create_from_discriminator_value(pn) }) },
        "createdByUser" => lambda {|n| @created_by_user = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::User.create_from_discriminator_value(pn) }) },
        "createdDateTime" => lambda {|n| @created_date_time = n.get_date_time_value() },
        "description" => lambda {|n| @description = n.get_string_value() },
        "eTag" => lambda {|n| @e_tag = n.get_string_value() },
        "lastModifiedBy" => lambda {|n| @last_modified_by = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::IdentitySet.create_from_discriminator_value(pn) }) },
        "lastModifiedByUser" => lambda {|n| @last_modified_by_user = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::User.create_from_discriminator_value(pn) }) },
        "lastModifiedDateTime" => lambda {|n| @last_modified_date_time = n.get_date_time_value() },
        "name" => lambda {|n| @name = n.get_string_value() },
        "parentReference" => lambda {|n| @parent_reference = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ItemReference.create_from_discriminator_value(pn) }) },
        "webUrl" => lambda {|n| @web_url = n.get_string_value() },
    })
end

#last_modified_byObject

Gets the lastModifiedBy property value. Identity of the user, device, and application which last modified the item. Read-only.

Returns:

  • a identity_set



175
176
177
# File 'lib/models/base_item.rb', line 175

def last_modified_by
    return @last_modified_by
end

#last_modified_by=(value) ⇒ Object

Sets the lastModifiedBy property value. Identity of the user, device, and application which last modified the item. Read-only.

Parameters:

  • value

    Value to set for the lastModifiedBy property.

Returns:

  • a void



183
184
185
# File 'lib/models/base_item.rb', line 183

def last_modified_by=(value)
    @last_modified_by = value
end

#last_modified_by_userObject

Gets the lastModifiedByUser property value. Identity of the user who last modified the item. Read-only.

Returns:

  • a user



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

def last_modified_by_user
    return @last_modified_by_user
end

#last_modified_by_user=(value) ⇒ Object

Sets the lastModifiedByUser property value. Identity of the user who last modified the item. Read-only.

Parameters:

  • value

    Value to set for the lastModifiedByUser property.

Returns:

  • a void



198
199
200
# File 'lib/models/base_item.rb', line 198

def last_modified_by_user=(value)
    @last_modified_by_user = value
end

#last_modified_date_timeObject

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

Returns:

  • a date_time



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

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 item was last modified. Read-only.

Parameters:

  • value

    Value to set for the lastModifiedDateTime property.

Returns:

  • a void



213
214
215
# File 'lib/models/base_item.rb', line 213

def last_modified_date_time=(value)
    @last_modified_date_time = value
end

#nameObject

Gets the name property value. The name of the item. Read-write.

Returns:

  • a string



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

def name
    return @name
end

#name=(value) ⇒ Object

Sets the name property value. The name of the item. Read-write.

Parameters:

  • value

    Value to set for the name property.

Returns:

  • a void



228
229
230
# File 'lib/models/base_item.rb', line 228

def name=(value)
    @name = value
end

#parent_referenceObject

Gets the parentReference property value. Parent information, if the item has a parent. Read-write.

Returns:

  • a item_reference



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

def parent_reference
    return @parent_reference
end

#parent_reference=(value) ⇒ Object

Sets the parentReference property value. Parent information, if the item has a parent. Read-write.

Parameters:

  • value

    Value to set for the parentReference property.

Returns:

  • a void



243
244
245
# File 'lib/models/base_item.rb', line 243

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


251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
# File 'lib/models/base_item.rb', line 251

def serialize(writer)
    raise StandardError, 'writer cannot be null' if writer.nil?
    super
    writer.write_object_value("createdBy", @created_by)
    writer.write_object_value("createdByUser", @created_by_user)
    writer.write_date_time_value("createdDateTime", @created_date_time)
    writer.write_string_value("description", @description)
    writer.write_string_value("eTag", @e_tag)
    writer.write_object_value("lastModifiedBy", @last_modified_by)
    writer.write_object_value("lastModifiedByUser", @last_modified_by_user)
    writer.write_date_time_value("lastModifiedDateTime", @last_modified_date_time)
    writer.write_string_value("name", @name)
    writer.write_object_value("parentReference", @parent_reference)
    writer.write_string_value("webUrl", @web_url)
end

#web_urlObject

Gets the webUrl property value. URL that displays the resource in the browser. Read-only.

Returns:

  • a string



270
271
272
# File 'lib/models/base_item.rb', line 270

def web_url
    return @web_url
end

#web_url=(value) ⇒ Object

Sets the webUrl property value. URL that displays the resource in the browser. Read-only.

Parameters:

  • value

    Value to set for the webUrl property.

Returns:

  • a void



278
279
280
# File 'lib/models/base_item.rb', line 278

def web_url=(value)
    @web_url = value
end