/
githubmirror
/
origin
Обзор
Документация
Войти
/
githubmirror
/
origin
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
vendor/github.com/microsoftgraph/msgraph-sdk-go/models/schema_extension.go
245 строк
11 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" ) type SchemaExtension struct { Entity } // NewSchemaExtension instantiates a new SchemaExtension and sets the default values. func NewSchemaExtension()(*SchemaExtension) { m := &SchemaExtension{ Entity: *NewEntity(), } return m } // CreateSchemaExtensionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value // returns a Parsable when successful func CreateSchemaExtensionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { return NewSchemaExtension(), nil } // GetDescription gets the description property value. Description for the schema extension. // returns a *string when successful func (m *SchemaExtension) GetDescription()(*string) { val, err := m.GetBackingStore().Get("description") if err != nil { panic(err) } if val != nil { return val.(*string) } return nil } // GetFieldDeserializers the deserialization information for the current model // returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful func (m *SchemaExtension) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { res := m.Entity.GetFieldDeserializers() res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetStringValue() if err != nil { return err } if val != nil { m.SetDescription(val) } return nil } res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetStringValue() if err != nil { return err } if val != nil { m.SetOwner(val) } return nil } res["properties"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetCollectionOfObjectValues(CreateExtensionSchemaPropertyFromDiscriminatorValue) if err != nil { return err } if val != nil { res := make([]ExtensionSchemaPropertyable, len(val)) for i, v := range val { if v != nil { res[i] = v.(ExtensionSchemaPropertyable) } } m.SetProperties(res) } return nil } res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetStringValue() if err != nil { return err } if val != nil { m.SetStatus(val) } return nil } res["targetTypes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetCollectionOfPrimitiveValues("string") if err != nil { return err } if val != nil { res := make([]string, len(val)) for i, v := range val { if v != nil { res[i] = *(v.(*string)) } } m.SetTargetTypes(res) } return nil } return res } // GetOwner gets the owner property value. The appId of the application that is the owner of the schema extension. The owner of the schema definition must be explicitly specified during the Create and Update operations, or it will be implied and auto-assigned by Microsoft Entra ID as follows: In delegated access: The signed-in user must be the owner of the app that calls Microsoft Graph to create the schema extension definition. If the signed-in user isn't the owner of the calling app, they must explicitly specify the owner property, and assign it the appId of an app that they own. In app-only access: The owner property isn't required in the request body. Instead, the calling app is assigned ownership of the schema extension. So, for example, if creating a new schema extension definition using Graph Explorer, you must supply the owner property. Once set, this property is read-only and cannot be changed. Supports $filter (eq). // returns a *string when successful func (m *SchemaExtension) GetOwner()(*string) { val, err := m.GetBackingStore().Get("owner") if err != nil { panic(err) } if val != nil { return val.(*string) } return nil } // GetProperties gets the properties property value. The collection of property names and types that make up the schema extension definition. // returns a []ExtensionSchemaPropertyable when successful func (m *SchemaExtension) GetProperties()([]ExtensionSchemaPropertyable) { val, err := m.GetBackingStore().Get("properties") if err != nil { panic(err) } if val != nil { return val.([]ExtensionSchemaPropertyable) } return nil } // GetStatus gets the status property value. The lifecycle state of the schema extension. Possible states are InDevelopment, Available, and Deprecated. Automatically set to InDevelopment on creation. For more information about the possible state transitions and behaviors, see Schema extensions lifecycle. Supports $filter (eq). // returns a *string when successful func (m *SchemaExtension) GetStatus()(*string) { val, err := m.GetBackingStore().Get("status") if err != nil { panic(err) } if val != nil { return val.(*string) } return nil } // GetTargetTypes gets the targetTypes property value. Set of Microsoft Graph types (that can support extensions) that the schema extension can be applied to. Select from administrativeUnit, contact, device, event, group, message, organization, post, todoTask, todoTaskList, or user. // returns a []string when successful func (m *SchemaExtension) GetTargetTypes()([]string) { val, err := m.GetBackingStore().Get("targetTypes") if err != nil { panic(err) } if val != nil { return val.([]string) } return nil } // Serialize serializes information the current object func (m *SchemaExtension) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { err := m.Entity.Serialize(writer) if err != nil { return err } { err = writer.WriteStringValue("description", m.GetDescription()) if err != nil { return err } } { err = writer.WriteStringValue("owner", m.GetOwner()) if err != nil { return err } } if m.GetProperties() != nil { cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetProperties())) for i, v := range m.GetProperties() { if v != nil { cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) } } err = writer.WriteCollectionOfObjectValues("properties", cast) if err != nil { return err } } { err = writer.WriteStringValue("status", m.GetStatus()) if err != nil { return err } } if m.GetTargetTypes() != nil { err = writer.WriteCollectionOfStringValues("targetTypes", m.GetTargetTypes()) if err != nil { return err } } return nil } // SetDescription sets the description property value. Description for the schema extension. func (m *SchemaExtension) SetDescription(value *string)() { err := m.GetBackingStore().Set("description", value) if err != nil { panic(err) } } // SetOwner sets the owner property value. The appId of the application that is the owner of the schema extension. The owner of the schema definition must be explicitly specified during the Create and Update operations, or it will be implied and auto-assigned by Microsoft Entra ID as follows: In delegated access: The signed-in user must be the owner of the app that calls Microsoft Graph to create the schema extension definition. If the signed-in user isn't the owner of the calling app, they must explicitly specify the owner property, and assign it the appId of an app that they own. In app-only access: The owner property isn't required in the request body. Instead, the calling app is assigned ownership of the schema extension. So, for example, if creating a new schema extension definition using Graph Explorer, you must supply the owner property. Once set, this property is read-only and cannot be changed. Supports $filter (eq). func (m *SchemaExtension) SetOwner(value *string)() { err := m.GetBackingStore().Set("owner", value) if err != nil { panic(err) } } // SetProperties sets the properties property value. The collection of property names and types that make up the schema extension definition. func (m *SchemaExtension) SetProperties(value []ExtensionSchemaPropertyable)() { err := m.GetBackingStore().Set("properties", value) if err != nil { panic(err) } } // SetStatus sets the status property value. The lifecycle state of the schema extension. Possible states are InDevelopment, Available, and Deprecated. Automatically set to InDevelopment on creation. For more information about the possible state transitions and behaviors, see Schema extensions lifecycle. Supports $filter (eq). func (m *SchemaExtension) SetStatus(value *string)() { err := m.GetBackingStore().Set("status", value) if err != nil { panic(err) } } // SetTargetTypes sets the targetTypes property value. Set of Microsoft Graph types (that can support extensions) that the schema extension can be applied to. Select from administrativeUnit, contact, device, event, group, message, organization, post, todoTask, todoTaskList, or user. func (m *SchemaExtension) SetTargetTypes(value []string)() { err := m.GetBackingStore().Set("targetTypes", value) if err != nil { panic(err) } } type SchemaExtensionable interface { Entityable i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable GetDescription()(*string) GetOwner()(*string) GetProperties()([]ExtensionSchemaPropertyable) GetStatus()(*string) GetTargetTypes()([]string) SetDescription(value *string)() SetOwner(value *string)() SetProperties(value []ExtensionSchemaPropertyable)() SetStatus(value *string)() SetTargetTypes(value []string)() }