-
Notifications
You must be signed in to change notification settings - Fork 0
/
workbook_worksheet_protection.go
95 lines (93 loc) · 3.76 KB
/
workbook_worksheet_protection.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
package models
import (
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization"
)
// WorkbookWorksheetProtection
type WorkbookWorksheetProtection struct {
Entity
// Sheet protection options. Read-only.
options WorkbookWorksheetProtectionOptionsable
// Indicates if the worksheet is protected. Read-only.
protected *bool
}
// NewWorkbookWorksheetProtection instantiates a new workbookWorksheetProtection and sets the default values.
func NewWorkbookWorksheetProtection()(*WorkbookWorksheetProtection) {
m := &WorkbookWorksheetProtection{
Entity: *NewEntity(),
}
return m
}
// CreateWorkbookWorksheetProtectionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
func CreateWorkbookWorksheetProtectionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
return NewWorkbookWorksheetProtection(), nil
}
// GetFieldDeserializers the deserialization information for the current model
func (m *WorkbookWorksheetProtection) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
res := m.Entity.GetFieldDeserializers()
res["options"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetObjectValue(CreateWorkbookWorksheetProtectionOptionsFromDiscriminatorValue)
if err != nil {
return err
}
if val != nil {
m.SetOptions(val.(WorkbookWorksheetProtectionOptionsable))
}
return nil
}
res["protected"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetBoolValue()
if err != nil {
return err
}
if val != nil {
m.SetProtected(val)
}
return nil
}
return res
}
// GetOptions gets the options property value. Sheet protection options. Read-only.
func (m *WorkbookWorksheetProtection) GetOptions()(WorkbookWorksheetProtectionOptionsable) {
return m.options
}
// GetProtected gets the protected property value. Indicates if the worksheet is protected. Read-only.
func (m *WorkbookWorksheetProtection) GetProtected()(*bool) {
return m.protected
}
// Serialize serializes information the current object
func (m *WorkbookWorksheetProtection) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
err := m.Entity.Serialize(writer)
if err != nil {
return err
}
{
err = writer.WriteObjectValue("options", m.GetOptions())
if err != nil {
return err
}
}
{
err = writer.WriteBoolValue("protected", m.GetProtected())
if err != nil {
return err
}
}
return nil
}
// SetOptions sets the options property value. Sheet protection options. Read-only.
func (m *WorkbookWorksheetProtection) SetOptions(value WorkbookWorksheetProtectionOptionsable)() {
m.options = value
}
// SetProtected sets the protected property value. Indicates if the worksheet is protected. Read-only.
func (m *WorkbookWorksheetProtection) SetProtected(value *bool)() {
m.protected = value
}
// WorkbookWorksheetProtectionable
type WorkbookWorksheetProtectionable interface {
Entityable
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
GetOptions()(WorkbookWorksheetProtectionOptionsable)
GetProtected()(*bool)
SetOptions(value WorkbookWorksheetProtectionOptionsable)()
SetProtected(value *bool)()
}