Class: MicrosoftGraph::Models::Notebook

Inherits:
OnenoteEntityHierarchyModel show all
Includes:
MicrosoftKiotaAbstractions::Parsable
Defined in:
lib/models/notebook.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from OnenoteEntityHierarchyModel

#created_by, #created_by=, #display_name, #display_name=, #last_modified_by, #last_modified_by=, #last_modified_date_time, #last_modified_date_time=

Methods inherited from OnenoteEntitySchemaObjectModel

#created_date_time, #created_date_time=

Methods inherited from OnenoteEntityBaseModel

#self_escaped, #self_escaped=

Methods inherited from Entity

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

Constructor Details

#initializeObject

Instantiates a new notebook and sets the default values.



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

def initialize()
    super
    @odata_type = "#microsoft.graph.notebook"
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 notebook

Raises:

  • (StandardError)


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

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

Instance Method Details

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/models/notebook.rb', line 54

def get_field_deserializers()
    return super.merge({
        "isDefault" => lambda {|n| @is_default = n.get_boolean_value() },
        "isShared" => lambda {|n| @is_shared = n.get_boolean_value() },
        "links" => lambda {|n| @links = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::NotebookLinks.create_from_discriminator_value(pn) }) },
        "sectionGroups" => lambda {|n| @section_groups = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::SectionGroup.create_from_discriminator_value(pn) }) },
        "sectionGroupsUrl" => lambda {|n| @section_groups_url = n.get_string_value() },
        "sections" => lambda {|n| @sections = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::OnenoteSection.create_from_discriminator_value(pn) }) },
        "sectionsUrl" => lambda {|n| @sections_url = n.get_string_value() },
        "userRole" => lambda {|n| @user_role = n.get_enum_value(MicrosoftGraph::Models::OnenoteUserRole) },
    })
end

#is_defaultObject

Gets the isDefault property value. Indicates whether this is the user’s default notebook. Read-only.

Returns:

  • a boolean



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

def is_default
    return @is_default
end

#is_default=(value) ⇒ Object

Sets the isDefault property value. Indicates whether this is the user’s default notebook. Read-only.

Parameters:

  • value

    Value to set for the isDefault property.

Returns:

  • a void



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

def is_default=(value)
    @is_default = value
end

#is_sharedObject

Gets the isShared property value. Indicates whether the notebook is shared. If true, the contents of the notebook can be seen by people other than the owner. Read-only.

Returns:

  • a boolean



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

def is_shared
    return @is_shared
end

#is_shared=(value) ⇒ Object

Sets the isShared property value. Indicates whether the notebook is shared. If true, the contents of the notebook can be seen by people other than the owner. Read-only.

Parameters:

  • value

    Value to set for the isShared property.

Returns:

  • a void



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

def is_shared=(value)
    @is_shared = value
end

Gets the links property value. Links for opening the notebook. The oneNoteClientURL link opens the notebook in the OneNote native client if it’s installed. The oneNoteWebURL link opens the notebook in OneNote on the web.

Returns:

  • a notebook_links



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

def links
    return @links
end

#links=(value) ⇒ Object

Sets the links property value. Links for opening the notebook. The oneNoteClientURL link opens the notebook in the OneNote native client if it’s installed. The oneNoteWebURL link opens the notebook in OneNote on the web.

Parameters:

  • value

    Value to set for the links property.

Returns:

  • a void



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

def links=(value)
    @links = value
end

#section_groupsObject

Gets the sectionGroups property value. The section groups in the notebook. Read-only. Nullable.

Returns:

  • a section_group



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

def section_groups
    return @section_groups
end

#section_groups=(value) ⇒ Object

Sets the sectionGroups property value. The section groups in the notebook. Read-only. Nullable.

Parameters:

  • value

    Value to set for the sectionGroups property.

Returns:

  • a void



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

def section_groups=(value)
    @section_groups = value
end

#section_groups_urlObject

Gets the sectionGroupsUrl property value. The URL for the sectionGroups navigation property, which returns all the section groups in the notebook. Read-only.

Returns:

  • a string



130
131
132
# File 'lib/models/notebook.rb', line 130

def section_groups_url
    return @section_groups_url
end

#section_groups_url=(value) ⇒ Object

Sets the sectionGroupsUrl property value. The URL for the sectionGroups navigation property, which returns all the section groups in the notebook. Read-only.

Parameters:

  • value

    Value to set for the sectionGroupsUrl property.

Returns:

  • a void



138
139
140
# File 'lib/models/notebook.rb', line 138

def section_groups_url=(value)
    @section_groups_url = value
end

#sectionsObject

Gets the sections property value. The sections in the notebook. Read-only. Nullable.

Returns:

  • a onenote_section



145
146
147
# File 'lib/models/notebook.rb', line 145

def sections
    return @sections
end

#sections=(value) ⇒ Object

Sets the sections property value. The sections in the notebook. Read-only. Nullable.

Parameters:

  • value

    Value to set for the sections property.

Returns:

  • a void



153
154
155
# File 'lib/models/notebook.rb', line 153

def sections=(value)
    @sections = value
end

#sections_urlObject

Gets the sectionsUrl property value. The URL for the sections navigation property, which returns all the sections in the notebook. Read-only.

Returns:

  • a string



160
161
162
# File 'lib/models/notebook.rb', line 160

def sections_url
    return @sections_url
end

#sections_url=(value) ⇒ Object

Sets the sectionsUrl property value. The URL for the sections navigation property, which returns all the sections in the notebook. Read-only.

Parameters:

  • value

    Value to set for the sectionsUrl property.

Returns:

  • a void



168
169
170
# File 'lib/models/notebook.rb', line 168

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


176
177
178
179
180
181
182
183
184
185
186
187
# File 'lib/models/notebook.rb', line 176

def serialize(writer)
    raise StandardError, 'writer cannot be null' if writer.nil?
    super
    writer.write_boolean_value("isDefault", @is_default)
    writer.write_boolean_value("isShared", @is_shared)
    writer.write_object_value("links", @links)
    writer.write_collection_of_object_values("sectionGroups", @section_groups)
    writer.write_string_value("sectionGroupsUrl", @section_groups_url)
    writer.write_collection_of_object_values("sections", @sections)
    writer.write_string_value("sectionsUrl", @sections_url)
    writer.write_enum_value("userRole", @user_role)
end

#user_roleObject

Gets the userRole property value. Possible values are: Owner, Contributor, Reader, None. Owner represents owner-level access to the notebook. Contributor represents read/write access to the notebook. Reader represents read-only access to the notebook. Read-only.

Returns:

  • a onenote_user_role



192
193
194
# File 'lib/models/notebook.rb', line 192

def user_role
    return @user_role
end

#user_role=(value) ⇒ Object

Sets the userRole property value. Possible values are: Owner, Contributor, Reader, None. Owner represents owner-level access to the notebook. Contributor represents read/write access to the notebook. Reader represents read-only access to the notebook. Read-only.

Parameters:

  • value

    Value to set for the userRole property.

Returns:

  • a void



200
201
202
# File 'lib/models/notebook.rb', line 200

def user_role=(value)
    @user_role = value
end