/
githubmirror
/
origin
Обзор
Документация
Войти
/
githubmirror
/
origin
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
vendor/github.com/microsoftgraph/msgraph-sdk-go/models/permission_scope.go
450 строк
19 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 ( i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22 "github.com/google/uuid" i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" ) type PermissionScope struct { // Stores model information. backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore } // NewPermissionScope instantiates a new PermissionScope and sets the default values. func NewPermissionScope()(*PermissionScope) { m := &PermissionScope{ } m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance(); m.SetAdditionalData(make(map[string]any)) return m } // CreatePermissionScopeFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value // returns a Parsable when successful func CreatePermissionScopeFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { return NewPermissionScope(), 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 *PermissionScope) 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) } // GetAdminConsentDescription gets the adminConsentDescription property value. A description of the delegated permissions, intended to be read by an administrator granting the permission on behalf of all users. This text appears in tenant-wide admin consent experiences. // returns a *string when successful func (m *PermissionScope) GetAdminConsentDescription()(*string) { val, err := m.GetBackingStore().Get("adminConsentDescription") if err != nil { panic(err) } if val != nil { return val.(*string) } return nil } // GetAdminConsentDisplayName gets the adminConsentDisplayName property value. The permission's title, intended to be read by an administrator granting the permission on behalf of all users. // returns a *string when successful func (m *PermissionScope) GetAdminConsentDisplayName()(*string) { val, err := m.GetBackingStore().Get("adminConsentDisplayName") if err != nil { panic(err) } if val != nil { return val.(*string) } return nil } // GetBackingStore gets the BackingStore property value. Stores model information. // returns a BackingStore when successful func (m *PermissionScope) 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 *PermissionScope) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) res["adminConsentDescription"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetStringValue() if err != nil { return err } if val != nil { m.SetAdminConsentDescription(val) } return nil } res["adminConsentDisplayName"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetStringValue() if err != nil { return err } if val != nil { m.SetAdminConsentDisplayName(val) } return nil } res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetUUIDValue() if err != nil { return err } if val != nil { m.SetId(val) } return nil } res["isEnabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetBoolValue() if err != nil { return err } if val != nil { m.SetIsEnabled(val) } 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["origin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetStringValue() if err != nil { return err } if val != nil { m.SetOrigin(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["userConsentDescription"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetStringValue() if err != nil { return err } if val != nil { m.SetUserConsentDescription(val) } return nil } res["userConsentDisplayName"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetStringValue() if err != nil { return err } if val != nil { m.SetUserConsentDisplayName(val) } return nil } res["value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetStringValue() if err != nil { return err } if val != nil { m.SetValue(val) } return nil } return res } // GetId gets the id property value. Unique delegated permission identifier inside the collection of delegated permissions defined for a resource application. // returns a *UUID when successful func (m *PermissionScope) GetId()(*i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID) { val, err := m.GetBackingStore().Get("id") if err != nil { panic(err) } if val != nil { return val.(*i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID) } return nil } // GetIsEnabled gets the isEnabled property value. When you create or update a permission, this property must be set to true (which is the default). To delete a permission, this property must first be set to false. At that point, in a subsequent call, the permission may be removed. // returns a *bool when successful func (m *PermissionScope) GetIsEnabled()(*bool) { val, err := m.GetBackingStore().Get("isEnabled") if err != nil { panic(err) } if val != nil { return val.(*bool) } return nil } // GetOdataType gets the @odata.type property value. The OdataType property // returns a *string when successful func (m *PermissionScope) GetOdataType()(*string) { val, err := m.GetBackingStore().Get("odataType") if err != nil { panic(err) } if val != nil { return val.(*string) } return nil } // GetOrigin gets the origin property value. The origin property // returns a *string when successful func (m *PermissionScope) GetOrigin()(*string) { val, err := m.GetBackingStore().Get("origin") if err != nil { panic(err) } if val != nil { return val.(*string) } return nil } // GetTypeEscaped gets the type property value. The possible values are: User and Admin. Specifies whether this delegated permission should be considered safe for non-admin users to consent to on behalf of themselves, or whether an administrator consent should always be required. While Microsoft Graph defines the default consent requirement for each permission, the tenant administrator may override the behavior in their organization (by allowing, restricting, or limiting user consent to this delegated permission). For more information, see Configure how users consent to applications. // returns a *string when successful func (m *PermissionScope) GetTypeEscaped()(*string) { val, err := m.GetBackingStore().Get("typeEscaped") if err != nil { panic(err) } if val != nil { return val.(*string) } return nil } // GetUserConsentDescription gets the userConsentDescription property value. A description of the delegated permissions, intended to be read by a user granting the permission on their own behalf. This text appears in consent experiences where the user is consenting only on behalf of themselves. // returns a *string when successful func (m *PermissionScope) GetUserConsentDescription()(*string) { val, err := m.GetBackingStore().Get("userConsentDescription") if err != nil { panic(err) } if val != nil { return val.(*string) } return nil } // GetUserConsentDisplayName gets the userConsentDisplayName property value. A title for the permission, intended to be read by a user granting the permission on their own behalf. This text appears in consent experiences where the user is consenting only on behalf of themselves. // returns a *string when successful func (m *PermissionScope) GetUserConsentDisplayName()(*string) { val, err := m.GetBackingStore().Get("userConsentDisplayName") if err != nil { panic(err) } if val != nil { return val.(*string) } return nil } // GetValue gets the value property value. Specifies the value to include in the scp (scope) claim in access tokens. Must not exceed 120 characters in length. Allowed characters are : ! # $ % & ' ( ) * + , - . / : ; = ? @ [ ] ^ + _ { } ~, and characters in the ranges 0-9, A-Z and a-z. Any other character, including the space character, aren't allowed. May not begin with .. // returns a *string when successful func (m *PermissionScope) GetValue()(*string) { val, err := m.GetBackingStore().Get("value") if err != nil { panic(err) } if val != nil { return val.(*string) } return nil } // Serialize serializes information the current object func (m *PermissionScope) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { { err := writer.WriteStringValue("adminConsentDescription", m.GetAdminConsentDescription()) if err != nil { return err } } { err := writer.WriteStringValue("adminConsentDisplayName", m.GetAdminConsentDisplayName()) if err != nil { return err } } { err := writer.WriteUUIDValue("id", m.GetId()) if err != nil { return err } } { err := writer.WriteBoolValue("isEnabled", m.GetIsEnabled()) if err != nil { return err } } { err := writer.WriteStringValue("@odata.type", m.GetOdataType()) if err != nil { return err } } { err := writer.WriteStringValue("origin", m.GetOrigin()) if err != nil { return err } } { err := writer.WriteStringValue("type", m.GetTypeEscaped()) if err != nil { return err } } { err := writer.WriteStringValue("userConsentDescription", m.GetUserConsentDescription()) if err != nil { return err } } { err := writer.WriteStringValue("userConsentDisplayName", m.GetUserConsentDisplayName()) if err != nil { return err } } { err := writer.WriteStringValue("value", m.GetValue()) 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 *PermissionScope) SetAdditionalData(value map[string]any)() { err := m.GetBackingStore().Set("additionalData", value) if err != nil { panic(err) } } // SetAdminConsentDescription sets the adminConsentDescription property value. A description of the delegated permissions, intended to be read by an administrator granting the permission on behalf of all users. This text appears in tenant-wide admin consent experiences. func (m *PermissionScope) SetAdminConsentDescription(value *string)() { err := m.GetBackingStore().Set("adminConsentDescription", value) if err != nil { panic(err) } } // SetAdminConsentDisplayName sets the adminConsentDisplayName property value. The permission's title, intended to be read by an administrator granting the permission on behalf of all users. func (m *PermissionScope) SetAdminConsentDisplayName(value *string)() { err := m.GetBackingStore().Set("adminConsentDisplayName", value) if err != nil { panic(err) } } // SetBackingStore sets the BackingStore property value. Stores model information. func (m *PermissionScope) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore)() { m.backingStore = value } // SetId sets the id property value. Unique delegated permission identifier inside the collection of delegated permissions defined for a resource application. func (m *PermissionScope) SetId(value *i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID)() { err := m.GetBackingStore().Set("id", value) if err != nil { panic(err) } } // SetIsEnabled sets the isEnabled property value. When you create or update a permission, this property must be set to true (which is the default). To delete a permission, this property must first be set to false. At that point, in a subsequent call, the permission may be removed. func (m *PermissionScope) SetIsEnabled(value *bool)() { err := m.GetBackingStore().Set("isEnabled", value) if err != nil { panic(err) } } // SetOdataType sets the @odata.type property value. The OdataType property func (m *PermissionScope) SetOdataType(value *string)() { err := m.GetBackingStore().Set("odataType", value) if err != nil { panic(err) } } // SetOrigin sets the origin property value. The origin property func (m *PermissionScope) SetOrigin(value *string)() { err := m.GetBackingStore().Set("origin", value) if err != nil { panic(err) } } // SetTypeEscaped sets the type property value. The possible values are: User and Admin. Specifies whether this delegated permission should be considered safe for non-admin users to consent to on behalf of themselves, or whether an administrator consent should always be required. While Microsoft Graph defines the default consent requirement for each permission, the tenant administrator may override the behavior in their organization (by allowing, restricting, or limiting user consent to this delegated permission). For more information, see Configure how users consent to applications. func (m *PermissionScope) SetTypeEscaped(value *string)() { err := m.GetBackingStore().Set("typeEscaped", value) if err != nil { panic(err) } } // SetUserConsentDescription sets the userConsentDescription property value. A description of the delegated permissions, intended to be read by a user granting the permission on their own behalf. This text appears in consent experiences where the user is consenting only on behalf of themselves. func (m *PermissionScope) SetUserConsentDescription(value *string)() { err := m.GetBackingStore().Set("userConsentDescription", value) if err != nil { panic(err) } } // SetUserConsentDisplayName sets the userConsentDisplayName property value. A title for the permission, intended to be read by a user granting the permission on their own behalf. This text appears in consent experiences where the user is consenting only on behalf of themselves. func (m *PermissionScope) SetUserConsentDisplayName(value *string)() { err := m.GetBackingStore().Set("userConsentDisplayName", value) if err != nil { panic(err) } } // SetValue sets the value property value. Specifies the value to include in the scp (scope) claim in access tokens. Must not exceed 120 characters in length. Allowed characters are : ! # $ % & ' ( ) * + , - . / : ; = ? @ [ ] ^ + _ { } ~, and characters in the ranges 0-9, A-Z and a-z. Any other character, including the space character, aren't allowed. May not begin with .. func (m *PermissionScope) SetValue(value *string)() { err := m.GetBackingStore().Set("value", value) if err != nil { panic(err) } } type PermissionScopeable interface { i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable GetAdminConsentDescription()(*string) GetAdminConsentDisplayName()(*string) GetBackingStore()(ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) GetId()(*i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID) GetIsEnabled()(*bool) GetOdataType()(*string) GetOrigin()(*string) GetTypeEscaped()(*string) GetUserConsentDescription()(*string) GetUserConsentDisplayName()(*string) GetValue()(*string) SetAdminConsentDescription(value *string)() SetAdminConsentDisplayName(value *string)() SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore)() SetId(value *i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID)() SetIsEnabled(value *bool)() SetOdataType(value *string)() SetOrigin(value *string)() SetTypeEscaped(value *string)() SetUserConsentDescription(value *string)() SetUserConsentDisplayName(value *string)() SetValue(value *string)() }