/
githubmirror
/
origin
Обзор
Документация
Войти
/
githubmirror
/
origin
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
vendor/github.com/microsoftgraph/msgraph-sdk-go/models/sharing_link.go
338 строк
12 KB
Justin Pierce
Add compat_otp package with openshift-tests-private (OTP) util implementations
11 авг 2025, 18:00
11 авг 2025, 18:00
80ac5c1
Код
Авторство
О чём код?
// Code generated by Microsoft Kiota - DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. package models import ( i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" ) type SharingLink struct { // Stores model information. backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore } // NewSharingLink instantiates a new SharingLink and sets the default values. func NewSharingLink()(*SharingLink) { m := &SharingLink{ } m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance(); m.SetAdditionalData(make(map[string]any)) return m } // CreateSharingLinkFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value // returns a Parsable when successful func CreateSharingLinkFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { return NewSharingLink(), nil } // GetAdditionalData 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 map[string]any when successful func (m *SharingLink) GetAdditionalData()(map[string]any) { val , err := m.backingStore.Get("additionalData") if err != nil { panic(err) } if val == nil { var value = make(map[string]any); m.SetAdditionalData(value); } return val.(map[string]any) } // GetApplication gets the application property value. The app the link is associated with. // returns a Identityable when successful func (m *SharingLink) GetApplication()(Identityable) { val, err := m.GetBackingStore().Get("application") if err != nil { panic(err) } if val != nil { return val.(Identityable) } return nil } // GetBackingStore gets the BackingStore property value. Stores model information. // returns a BackingStore when successful func (m *SharingLink) GetBackingStore()(ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { return m.backingStore } // GetFieldDeserializers the deserialization information for the current model // returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful func (m *SharingLink) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) res["application"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetObjectValue(CreateIdentityFromDiscriminatorValue) if err != nil { return err } if val != nil { m.SetApplication(val.(Identityable)) } return nil } res["@odata.type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetStringValue() if err != nil { return err } if val != nil { m.SetOdataType(val) } return nil } res["preventsDownload"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetBoolValue() if err != nil { return err } if val != nil { m.SetPreventsDownload(val) } return nil } res["scope"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetStringValue() if err != nil { return err } if val != nil { m.SetScope(val) } return nil } res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetStringValue() if err != nil { return err } if val != nil { m.SetTypeEscaped(val) } return nil } res["webHtml"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetStringValue() if err != nil { return err } if val != nil { m.SetWebHtml(val) } return nil } res["webUrl"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetStringValue() if err != nil { return err } if val != nil { m.SetWebUrl(val) } return nil } return res } // GetOdataType gets the @odata.type property value. The OdataType property // returns a *string when successful func (m *SharingLink) GetOdataType()(*string) { val, err := m.GetBackingStore().Get("odataType") if err != nil { panic(err) } if val != nil { return val.(*string) } return nil } // GetPreventsDownload gets the preventsDownload property value. If true then the user can only use this link to view the item on the web, and cannot use it to download the contents of the item. Only for OneDrive for Business and SharePoint. // returns a *bool when successful func (m *SharingLink) GetPreventsDownload()(*bool) { val, err := m.GetBackingStore().Get("preventsDownload") if err != nil { panic(err) } if val != nil { return val.(*bool) } return nil } // GetScope gets the scope property value. The scope of the link represented by this permission. Value anonymous indicates the link is usable by anyone, organization indicates the link is only usable for users signed into the same tenant. // returns a *string when successful func (m *SharingLink) GetScope()(*string) { val, err := m.GetBackingStore().Get("scope") if err != nil { panic(err) } if val != nil { return val.(*string) } return nil } // GetTypeEscaped gets the type property value. The type of the link created. // returns a *string when successful func (m *SharingLink) GetTypeEscaped()(*string) { val, err := m.GetBackingStore().Get("typeEscaped") if err != nil { panic(err) } if val != nil { return val.(*string) } return nil } // GetWebHtml gets the webHtml property value. For embed links, this property contains the HTML code for an <iframe> element that will embed the item in a webpage. // returns a *string when successful func (m *SharingLink) GetWebHtml()(*string) { val, err := m.GetBackingStore().Get("webHtml") if err != nil { panic(err) } if val != nil { return val.(*string) } return nil } // GetWebUrl gets the webUrl property value. A URL that opens the item in the browser on the OneDrive website. // returns a *string when successful func (m *SharingLink) GetWebUrl()(*string) { val, err := m.GetBackingStore().Get("webUrl") if err != nil { panic(err) } if val != nil { return val.(*string) } return nil } // Serialize serializes information the current object func (m *SharingLink) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { { err := writer.WriteObjectValue("application", m.GetApplication()) if err != nil { return err } } { err := writer.WriteStringValue("@odata.type", m.GetOdataType()) if err != nil { return err } } { err := writer.WriteBoolValue("preventsDownload", m.GetPreventsDownload()) if err != nil { return err } } { err := writer.WriteStringValue("scope", m.GetScope()) if err != nil { return err } } { err := writer.WriteStringValue("type", m.GetTypeEscaped()) if err != nil { return err } } { err := writer.WriteStringValue("webHtml", m.GetWebHtml()) if err != nil { return err } } { err := writer.WriteStringValue("webUrl", m.GetWebUrl()) if err != nil { return err } } { err := writer.WriteAdditionalData(m.GetAdditionalData()) if err != nil { return err } } return nil } // SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. func (m *SharingLink) SetAdditionalData(value map[string]any)() { err := m.GetBackingStore().Set("additionalData", value) if err != nil { panic(err) } } // SetApplication sets the application property value. The app the link is associated with. func (m *SharingLink) SetApplication(value Identityable)() { err := m.GetBackingStore().Set("application", value) if err != nil { panic(err) } } // SetBackingStore sets the BackingStore property value. Stores model information. func (m *SharingLink) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore)() { m.backingStore = value } // SetOdataType sets the @odata.type property value. The OdataType property func (m *SharingLink) SetOdataType(value *string)() { err := m.GetBackingStore().Set("odataType", value) if err != nil { panic(err) } } // SetPreventsDownload sets the preventsDownload property value. If true then the user can only use this link to view the item on the web, and cannot use it to download the contents of the item. Only for OneDrive for Business and SharePoint. func (m *SharingLink) SetPreventsDownload(value *bool)() { err := m.GetBackingStore().Set("preventsDownload", value) if err != nil { panic(err) } } // SetScope sets the scope property value. The scope of the link represented by this permission. Value anonymous indicates the link is usable by anyone, organization indicates the link is only usable for users signed into the same tenant. func (m *SharingLink) SetScope(value *string)() { err := m.GetBackingStore().Set("scope", value) if err != nil { panic(err) } } // SetTypeEscaped sets the type property value. The type of the link created. func (m *SharingLink) SetTypeEscaped(value *string)() { err := m.GetBackingStore().Set("typeEscaped", value) if err != nil { panic(err) } } // SetWebHtml sets the webHtml property value. For embed links, this property contains the HTML code for an <iframe> element that will embed the item in a webpage. func (m *SharingLink) SetWebHtml(value *string)() { err := m.GetBackingStore().Set("webHtml", value) if err != nil { panic(err) } } // SetWebUrl sets the webUrl property value. A URL that opens the item in the browser on the OneDrive website. func (m *SharingLink) SetWebUrl(value *string)() { err := m.GetBackingStore().Set("webUrl", value) if err != nil { panic(err) } } type SharingLinkable interface { i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable GetApplication()(Identityable) GetBackingStore()(ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) GetOdataType()(*string) GetPreventsDownload()(*bool) GetScope()(*string) GetTypeEscaped()(*string) GetWebHtml()(*string) GetWebUrl()(*string) SetApplication(value Identityable)() SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore)() SetOdataType(value *string)() SetPreventsDownload(value *bool)() SetScope(value *string)() SetTypeEscaped(value *string)() SetWebHtml(value *string)() SetWebUrl(value *string)() }