package Ġcom . gitlab . k ord lib . common . entity Ċ Ċ import Ġkotlinx . serialization .* Ċ import Ġkotlinx . serialization . descriptors . Primitive Kind Ċ import Ġkotlinx . serialization . descriptors . Primitive Serial Descriptor Ċ import Ġkotlinx . serialization . descriptors . Serial Descriptor Ċ import Ġkotlinx . serialization . encoding . Decoder Ċ import Ġkotlinx . serialization . encoding . Encoder Ċ import Ġkotlin . contracts . Experimental Contracts Ċ import Ġkotlin . contracts . Invocation Kind Ċ import Ġkotlin . contracts . contract Ċ Ċ @ Serializable ( with Ġ= ĠPermissions . Companion :: class ) Ċ class ĠPermissions Ġconstructor ( val Ġcode : ĠInt ) Ġ{ ĊĊĠĠĠ Ġoperator Ġfun Ġplus ( permission : ĠPermission ): ĠPermissions Ġ= ĠPermissions ( this . code Ġor Ġpermission . code ) ĊĊĊĠĠĠ Ġoperator Ġfun Ġminus ( permission : ĠPermission ): ĠPermissions Ġ= ĠPermissions ( code Ġxor Ġ( code Ġand Ġpermission . code )) ĊĊĊĠĠĠ Ġoperator Ġfun Ġcontains ( permission : ĠPermission ): ĠBoolean Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġthis . code Ġand Ġpermission . code Ġ== Ġpermission . code ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Opt In ( Experimental Contracts :: class ) ĊĠĠĠ Ġinline Ġfun Ġcopy ( block : ĠPermissions Builder . () Ġ-> ĠUnit ): ĠPermissions Ġ{ ĊĠĠĠĠĠĠĠ Ġcontract Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcalls In Place ( block , ĠInvocation Kind . EX ACT LY _ ON CE ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġval Ġbuilder Ġ= ĠPermissions Builder ( code ) ĊĠĠĠĠĠĠĠ Ġbuilder . apply ( block ) ĊĠĠĠĠĠĠĠ Ġreturn Ġbuilder . permissions () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Serializer ( for Class Ġ= ĠPermissions :: class ) ĊĠĠĠ Ġcompanion Ġobject Ġ: ĠK Serializer < Permissions > Ġ{ ĊĊĠĠĠĠĠĠĠ Ġinline Ġoperator Ġfun Ġinvoke ( block : ĠPermissions Builder . () Ġ-> ĠUnit Ġ= Ġ{} ): ĠPermissions Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġbuilder Ġ= ĠPermissions Builder () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġbuilder . apply ( block ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn Ġbuilder . permissions () ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġoverride Ġval Ġdescriptor : ĠSerial Descriptor ĊĠĠĠĠĠĠĠĠĠĠĠ Ġget () Ġ= ĠPrimitive Serial Descriptor (" permission ", ĠPrimitive Kind . INT ) ĊĊĠĠĠĠĠĠĠ Ġoverride Ġfun Ġdeserialize ( decoder : ĠDecoder ): ĠPermissions Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn ĠPermissions ( decoder . decode Int ()) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġoverride Ġfun Ġserialize ( encoder : ĠEncoder , Ġvalue : ĠPermissions ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġencoder . encode Int ( value . code ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġclass ĠPermissions Builder ( internal Ġvar Ġcode : ĠInt Ġ= Ġ 0 ) Ġ{ ĊĠĠĠĠĠĠĠ Ġoperator Ġfun ĠPermissions . unary Plus () Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġthis @ Permissions Builder . code Ġ= Ġthis @ Permissions Builder . code Ġor Ġcode ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġoperator Ġfun ĠPermissions . unary Minus () Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġthis @ Permissions Builder . code Ġ= Ġthis @ Permissions Builder . code Ġxor Ġ( this @ Permissions Builder . code Ġand Ġcode ) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġoperator Ġfun ĠPermission . unary Plus () Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġthis @ Permissions Builder . code Ġ= Ġthis @ Permissions Builder . code Ġor Ġcode ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġoperator Ġfun ĠPermission . unary Minus () Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġthis @ Permissions Builder . code Ġ= Ġthis @ Permissions Builder . code Ġxor Ġ( this @ Permissions Builder . code Ġand Ġcode ) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġfun Ġpermissions () Ġ= ĠPermissions ( code ) ĊĠĠĠ Ġ} Ċ Ċ } Ċ Ċ enum Ġclass ĠPermission ( val Ġcode : ĠInt Ġ= Ġ 0 ) Ġ{ ĊĠĠĠ ĠCreate Instant Invite ( 0 x 0 0 0 0 0 0 0 1 ), ĊĠĠĠ ĠK ick Members ( 0 x 0 0 0 0 0 0 0 2 ), ĊĠĠĠ ĠB an Members ( 0 x 0 0 0 0 0 0 0 4 ), ĊĠĠĠ ĠAdministrator ( 0 x 0 0 0 0 0 0 0 8 ), ĊĠĠĠ ĠManage Channels ( 0 x 0 0 0 0 0 0 1 0 ), ĊĠĠĠ ĠManage Guild ( 0 x 0 0 0 0 0 0 2 0 ), ĊĠĠĠ ĠAdd Re actions ( 0 x 0 0 0 0 0 0 4 0 ), ĊĠĠĠ ĠView Audit Log ( 0 x 0 0 0 0 0 0 8 0 ), ĊĠĠĠ ĠView Channel ( 0 x 0 0 0 0 0 4 0 0 ), ĊĠĠĠ ĠSend Messages ( 0 x 0 0 0 0 0 8 0 0 ), ĊĠĠĠ ĠSend TT S Messages ( 0 x 0 0 0 0 1 0 0 0 ), ĊĠĠĠ ĠManage Messages ( 0 x 0 0 0 0 2 0 0 0 ), ĊĠĠĠ ĠEmbed Links ( 0 x 0 0 0 0 4 0 0 0 ), ĊĠĠĠ ĠAttach Files ( 0 x 0 0 0 0 8 0 0 0 ), ĊĠĠĠ ĠRead Message History ( 0 x 0 0 0 1 0 0 0 0 ), ĊĠĠĠ ĠM ention Every one ( 0 x 0 0 0 2 0 0 0 0 ), ĊĠĠĠ ĠUse External E moj is ( 0 x 0 0 0 4 0 0 0 0 ), ĊĠĠĠ ĠView Guild Insights ( 0 x 0 0 0 8 0 0 0 0 ), ĊĠĠĠ ĠConnect ( 0 x 0 0 1 0 0 0 0 0 ), ĊĠĠĠ ĠS peak ( 0 x 0 0 2 0 0 0 0 0 ), ĊĠĠĠ ĠM ute Members ( 0 x 0 0 4 0 0 0 0 0 ), ĊĠĠĠ ĠDe af en Members ( 0 x 0 0 8 0 0 0 0 0 ), ĊĠĠĠ ĠMove Members ( 0 x 0 1 0 0 0 0 0 0 ), ĊĠĠĠ ĠUse V AD ( 0 x 0 2 0 0 0 0 0 0 ), ĊĠĠĠ ĠPriority Speaker ( 0 x 0 0 0 0 0 1 0 0 ), ĊĠĠĠ ĠChange Nick name ( 0 x 0 4 0 0 0 0 0 0 ), ĊĠĠĠ ĠManage Nick names ( 0 x 0 8 0 0 0 0 0 0 ), ĊĠĠĠ ĠManage Roles ( 0 x 1 0 0 0 0 0 0 0 ), ĊĠĠĠ ĠManage Web hooks ( 0 x 2 0 0 0 0 0 0 0 ), ĊĠĠĠ ĠManage E moj is ( 0 x 4 0 0 0 0 0 0 0 ), ĊĠĠĠ ĠAll ( 0 x 7 FFFF D FF ) Ċ }