d2d.pb.swift 135 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119
  1. // _____ _
  2. // |_ _| |_ _ _ ___ ___ _ __ __ _
  3. // | | | ' \| '_/ -_) -_) ' \/ _` |_
  4. // |_| |_||_|_| \___\___|_|_|_\__,_(_)
  5. //
  6. // Threema iOS Client
  7. // Copyright (c) 2020 Threema GmbH
  8. //
  9. // This program is free software: you can redistribute it and/or modify
  10. // it under the terms of the GNU Affero General Public License, version 3,
  11. // as published by the Free Software Foundation.
  12. //
  13. // This program is distributed in the hope that it will be useful,
  14. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. // GNU Affero General Public License for more details.
  17. //
  18. // You should have received a copy of the GNU Affero General Public License
  19. // along with this program. If not, see <https://www.gnu.org/licenses/>.
  20. import Foundation
  21. import SwiftProtobuf
  22. // If the compiler emits an error on this type, it is because this file
  23. // was generated by a version of the `protoc` Swift plug-in that is
  24. // incompatible with the version of SwiftProtobuf to which you are linking.
  25. // Please ensure that you are building against the same version of the API
  26. // that was used to generate this file.
  27. fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
  28. struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
  29. typealias Version = _2
  30. }
  31. /// Message type as defined by the Chat Server Protocol.
  32. enum D2d_MessageType: SwiftProtobuf.Enum {
  33. typealias RawValue = Int
  34. /// Invalid message type
  35. case invalid // = 0
  36. /// Text message
  37. case text // = 1
  38. /// Image message (deprecated, use `FILE_MESSAGE`)
  39. case image // = 2
  40. /// Location message
  41. case location // = 16
  42. /// Audio message (deprecated, use `FILE_MESSAGE`)
  43. case audio // = 20
  44. /// Video message (deprecated, use `FILE_MESSAGE`)
  45. case video // = 19
  46. /// File message
  47. case file // = 23
  48. /// Create a poll
  49. case pollCreate // = 21
  50. /// Cast a vote on a poll
  51. case pollVote // = 22
  52. /// Call offer
  53. case callOffer // = 96
  54. /// Call answer
  55. case callAnswer // = 97
  56. /// Call ICE Candidate
  57. case callIceCandidate // = 98
  58. /// Call hangup
  59. case callHangup // = 99
  60. /// Call ringing
  61. case callRinging // = 100
  62. /// Call missed
  63. case callMissed // = 101
  64. /// Delivery receipt
  65. case deliveryReceipt // = 128
  66. /// Typing indicator
  67. case typingIndicator // = 144
  68. /// Set profile picture of a contact
  69. case contactSetProfilePicture // = 24
  70. /// Delete profile picture of a contact
  71. case contactDeleteProfilePicture // = 25
  72. /// Request profile picture of a contact
  73. case contactRequestProfilePicture // = 26
  74. /// Create a group
  75. case groupCreate // = 74
  76. /// Rename a group
  77. case groupRename // = 75
  78. /// Leave a group
  79. case groupLeave // = 76
  80. /// Set a group's profile picture
  81. case groupSetProfilePicture // = 80
  82. /// Delete a group's profile picture
  83. case groupDeleteProfilePicture // = 84
  84. /// Request group synchronisation
  85. case groupRequestSync // = 81
  86. /// Group text message
  87. case groupText // = 65
  88. /// Group location message
  89. case groupLocation // = 66
  90. /// Group image message
  91. case groupImage // = 67
  92. /// Group audio message
  93. case groupAudio // = 69
  94. /// Group video message
  95. case groupVideo // = 68
  96. /// Group file message
  97. case groupFile // = 70
  98. /// Create a group poll
  99. case groupPollCreate // = 82
  100. /// Cast a vote on a group poll
  101. case groupPollVote // = 83
  102. case UNRECOGNIZED(Int)
  103. init() {
  104. self = .invalid
  105. }
  106. init?(rawValue: Int) {
  107. switch rawValue {
  108. case 0: self = .invalid
  109. case 1: self = .text
  110. case 2: self = .image
  111. case 16: self = .location
  112. case 19: self = .video
  113. case 20: self = .audio
  114. case 21: self = .pollCreate
  115. case 22: self = .pollVote
  116. case 23: self = .file
  117. case 24: self = .contactSetProfilePicture
  118. case 25: self = .contactDeleteProfilePicture
  119. case 26: self = .contactRequestProfilePicture
  120. case 65: self = .groupText
  121. case 66: self = .groupLocation
  122. case 67: self = .groupImage
  123. case 68: self = .groupVideo
  124. case 69: self = .groupAudio
  125. case 70: self = .groupFile
  126. case 74: self = .groupCreate
  127. case 75: self = .groupRename
  128. case 76: self = .groupLeave
  129. case 80: self = .groupSetProfilePicture
  130. case 81: self = .groupRequestSync
  131. case 82: self = .groupPollCreate
  132. case 83: self = .groupPollVote
  133. case 84: self = .groupDeleteProfilePicture
  134. case 96: self = .callOffer
  135. case 97: self = .callAnswer
  136. case 98: self = .callIceCandidate
  137. case 99: self = .callHangup
  138. case 100: self = .callRinging
  139. case 101: self = .callMissed
  140. case 128: self = .deliveryReceipt
  141. case 144: self = .typingIndicator
  142. default: self = .UNRECOGNIZED(rawValue)
  143. }
  144. }
  145. var rawValue: Int {
  146. switch self {
  147. case .invalid: return 0
  148. case .text: return 1
  149. case .image: return 2
  150. case .location: return 16
  151. case .video: return 19
  152. case .audio: return 20
  153. case .pollCreate: return 21
  154. case .pollVote: return 22
  155. case .file: return 23
  156. case .contactSetProfilePicture: return 24
  157. case .contactDeleteProfilePicture: return 25
  158. case .contactRequestProfilePicture: return 26
  159. case .groupText: return 65
  160. case .groupLocation: return 66
  161. case .groupImage: return 67
  162. case .groupVideo: return 68
  163. case .groupAudio: return 69
  164. case .groupFile: return 70
  165. case .groupCreate: return 74
  166. case .groupRename: return 75
  167. case .groupLeave: return 76
  168. case .groupSetProfilePicture: return 80
  169. case .groupRequestSync: return 81
  170. case .groupPollCreate: return 82
  171. case .groupPollVote: return 83
  172. case .groupDeleteProfilePicture: return 84
  173. case .callOffer: return 96
  174. case .callAnswer: return 97
  175. case .callIceCandidate: return 98
  176. case .callHangup: return 99
  177. case .callRinging: return 100
  178. case .callMissed: return 101
  179. case .deliveryReceipt: return 128
  180. case .typingIndicator: return 144
  181. case .UNRECOGNIZED(let i): return i
  182. }
  183. }
  184. }
  185. #if swift(>=4.2)
  186. extension D2d_MessageType: CaseIterable {
  187. // The compiler won't synthesize support with the UNRECOGNIZED case.
  188. static var allCases: [D2d_MessageType] = [
  189. .invalid,
  190. .text,
  191. .image,
  192. .location,
  193. .audio,
  194. .video,
  195. .file,
  196. .pollCreate,
  197. .pollVote,
  198. .callOffer,
  199. .callAnswer,
  200. .callIceCandidate,
  201. .callHangup,
  202. .callRinging,
  203. .callMissed,
  204. .deliveryReceipt,
  205. .typingIndicator,
  206. .contactSetProfilePicture,
  207. .contactDeleteProfilePicture,
  208. .contactRequestProfilePicture,
  209. .groupCreate,
  210. .groupRename,
  211. .groupLeave,
  212. .groupSetProfilePicture,
  213. .groupDeleteProfilePicture,
  214. .groupRequestSync,
  215. .groupText,
  216. .groupLocation,
  217. .groupImage,
  218. .groupAudio,
  219. .groupVideo,
  220. .groupFile,
  221. .groupPollCreate,
  222. .groupPollVote,
  223. ]
  224. }
  225. #endif // swift(>=4.2)
  226. /// Initial data sent to a device that wants to participate in the device
  227. /// group (i.e. a new device to be added by the user).
  228. struct D2d_InitialData {
  229. // SwiftProtobuf.Message conformance is added in an extension below. See the
  230. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  231. // methods supported on all messages.
  232. /// Threema Safe Backup
  233. var backup: Safe_Backup {
  234. get {return _backup ?? Safe_Backup()}
  235. set {_backup = newValue}
  236. }
  237. /// Returns true if `backup` has been explicitly set.
  238. var hasBackup: Bool {return self._backup != nil}
  239. /// Clears the value of `backup`. Subsequent reads from it will return its default value.
  240. mutating func clearBackup() {self._backup = nil}
  241. var unknownFields = SwiftProtobuf.UnknownStorage()
  242. init() {}
  243. fileprivate var _backup: Safe_Backup? = nil
  244. }
  245. /// Data shared across all devices and transmitted during the handshake.
  246. struct D2d_SharedDeviceData {
  247. // SwiftProtobuf.Message conformance is added in an extension below. See the
  248. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  249. // methods supported on all messages.
  250. /// Random amount of padding, ignored by the receiver
  251. var padding: Data = SwiftProtobuf.Internal.emptyData
  252. /// MDM parameters to be applied on all devices
  253. var mdmParameters: D2d_MdmParameters {
  254. get {return _mdmParameters ?? D2d_MdmParameters()}
  255. set {_mdmParameters = newValue}
  256. }
  257. /// Returns true if `mdmParameters` has been explicitly set.
  258. var hasMdmParameters: Bool {return self._mdmParameters != nil}
  259. /// Clears the value of `mdmParameters`. Subsequent reads from it will return its default value.
  260. mutating func clearMdmParameters() {self._mdmParameters = nil}
  261. var unknownFields = SwiftProtobuf.UnknownStorage()
  262. init() {}
  263. fileprivate var _mdmParameters: D2d_MdmParameters? = nil
  264. }
  265. /// Metadata about a device, determined by the device itself.
  266. struct D2d_DeviceInfo {
  267. // SwiftProtobuf.Message conformance is added in an extension below. See the
  268. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  269. // methods supported on all messages.
  270. /// Random amount of padding, ignored by the receiver
  271. var padding: Data = SwiftProtobuf.Internal.emptyData
  272. var platform: D2d_DeviceInfo.Platform = .unspecified
  273. /// App version
  274. var appVersion: String = String()
  275. /// Device description (smartphone model / browser)
  276. var description_p: String = String()
  277. var unknownFields = SwiftProtobuf.UnknownStorage()
  278. /// Platform
  279. enum Platform: SwiftProtobuf.Enum {
  280. typealias RawValue = Int
  281. /// Unknown platform
  282. case unspecified // = 0
  283. /// Android
  284. case android // = 1
  285. /// Apple iOS
  286. case ios // = 2
  287. /// Web application
  288. case web // = 3
  289. case UNRECOGNIZED(Int)
  290. init() {
  291. self = .unspecified
  292. }
  293. init?(rawValue: Int) {
  294. switch rawValue {
  295. case 0: self = .unspecified
  296. case 1: self = .android
  297. case 2: self = .ios
  298. case 3: self = .web
  299. default: self = .UNRECOGNIZED(rawValue)
  300. }
  301. }
  302. var rawValue: Int {
  303. switch self {
  304. case .unspecified: return 0
  305. case .android: return 1
  306. case .ios: return 2
  307. case .web: return 3
  308. case .UNRECOGNIZED(let i): return i
  309. }
  310. }
  311. }
  312. init() {}
  313. }
  314. #if swift(>=4.2)
  315. extension D2d_DeviceInfo.Platform: CaseIterable {
  316. // The compiler won't synthesize support with the UNRECOGNIZED case.
  317. static var allCases: [D2d_DeviceInfo.Platform] = [
  318. .unspecified,
  319. .android,
  320. .ios,
  321. .web,
  322. ]
  323. }
  324. #endif // swift(>=4.2)
  325. /// A transaction scope. Used in the d2m transaction messages.
  326. struct D2d_TransactionScope {
  327. // SwiftProtobuf.Message conformance is added in an extension below. See the
  328. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  329. // methods supported on all messages.
  330. var scope: D2d_TransactionScope.Scope = .userProfileSync
  331. var unknownFields = SwiftProtobuf.UnknownStorage()
  332. enum Scope: SwiftProtobuf.Enum {
  333. typealias RawValue = Int
  334. case userProfileSync // = 0
  335. case contactSync // = 1
  336. case groupSync // = 2
  337. case distributionListSync // = 3
  338. case settingsSync // = 4
  339. case UNRECOGNIZED(Int)
  340. init() {
  341. self = .userProfileSync
  342. }
  343. init?(rawValue: Int) {
  344. switch rawValue {
  345. case 0: self = .userProfileSync
  346. case 1: self = .contactSync
  347. case 2: self = .groupSync
  348. case 3: self = .distributionListSync
  349. case 4: self = .settingsSync
  350. default: self = .UNRECOGNIZED(rawValue)
  351. }
  352. }
  353. var rawValue: Int {
  354. switch self {
  355. case .userProfileSync: return 0
  356. case .contactSync: return 1
  357. case .groupSync: return 2
  358. case .distributionListSync: return 3
  359. case .settingsSync: return 4
  360. case .UNRECOGNIZED(let i): return i
  361. }
  362. }
  363. }
  364. init() {}
  365. }
  366. #if swift(>=4.2)
  367. extension D2d_TransactionScope.Scope: CaseIterable {
  368. // The compiler won't synthesize support with the UNRECOGNIZED case.
  369. static var allCases: [D2d_TransactionScope.Scope] = [
  370. .userProfileSync,
  371. .contactSync,
  372. .groupSync,
  373. .distributionListSync,
  374. .settingsSync,
  375. ]
  376. }
  377. #endif // swift(>=4.2)
  378. /// Root message
  379. struct D2d_Envelope {
  380. // SwiftProtobuf.Message conformance is added in an extension below. See the
  381. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  382. // methods supported on all messages.
  383. /// Random amount of padding, ignored by the receiver
  384. var padding: Data = SwiftProtobuf.Internal.emptyData
  385. /// The enveloped reflected message
  386. var content: D2d_Envelope.OneOf_Content? = nil
  387. var outgoingMessage: D2d_OutgoingMessage {
  388. get {
  389. if case .outgoingMessage(let v)? = content {return v}
  390. return D2d_OutgoingMessage()
  391. }
  392. set {content = .outgoingMessage(newValue)}
  393. }
  394. var incomingMessage: D2d_IncomingMessage {
  395. get {
  396. if case .incomingMessage(let v)? = content {return v}
  397. return D2d_IncomingMessage()
  398. }
  399. set {content = .incomingMessage(newValue)}
  400. }
  401. var userProfileSync: D2d_UserProfileSync {
  402. get {
  403. if case .userProfileSync(let v)? = content {return v}
  404. return D2d_UserProfileSync()
  405. }
  406. set {content = .userProfileSync(newValue)}
  407. }
  408. var contactSync: D2d_ContactSync {
  409. get {
  410. if case .contactSync(let v)? = content {return v}
  411. return D2d_ContactSync()
  412. }
  413. set {content = .contactSync(newValue)}
  414. }
  415. var groupSync: D2d_GroupSync {
  416. get {
  417. if case .groupSync(let v)? = content {return v}
  418. return D2d_GroupSync()
  419. }
  420. set {content = .groupSync(newValue)}
  421. }
  422. var distributionListSync: D2d_DistributionListSync {
  423. get {
  424. if case .distributionListSync(let v)? = content {return v}
  425. return D2d_DistributionListSync()
  426. }
  427. set {content = .distributionListSync(newValue)}
  428. }
  429. var settingsSync: D2d_SettingsSync {
  430. get {
  431. if case .settingsSync(let v)? = content {return v}
  432. return D2d_SettingsSync()
  433. }
  434. set {content = .settingsSync(newValue)}
  435. }
  436. var mdmParameters: D2d_MdmParameters {
  437. get {
  438. if case .mdmParameters(let v)? = content {return v}
  439. return D2d_MdmParameters()
  440. }
  441. set {content = .mdmParameters(newValue)}
  442. }
  443. var unknownFields = SwiftProtobuf.UnknownStorage()
  444. /// The enveloped reflected message
  445. enum OneOf_Content: Equatable {
  446. case outgoingMessage(D2d_OutgoingMessage)
  447. case incomingMessage(D2d_IncomingMessage)
  448. case userProfileSync(D2d_UserProfileSync)
  449. case contactSync(D2d_ContactSync)
  450. case groupSync(D2d_GroupSync)
  451. case distributionListSync(D2d_DistributionListSync)
  452. case settingsSync(D2d_SettingsSync)
  453. case mdmParameters(D2d_MdmParameters)
  454. #if !swift(>=4.1)
  455. static func ==(lhs: D2d_Envelope.OneOf_Content, rhs: D2d_Envelope.OneOf_Content) -> Bool {
  456. switch (lhs, rhs) {
  457. case (.outgoingMessage(let l), .outgoingMessage(let r)): return l == r
  458. case (.incomingMessage(let l), .incomingMessage(let r)): return l == r
  459. case (.userProfileSync(let l), .userProfileSync(let r)): return l == r
  460. case (.contactSync(let l), .contactSync(let r)): return l == r
  461. case (.groupSync(let l), .groupSync(let r)): return l == r
  462. case (.distributionListSync(let l), .distributionListSync(let r)): return l == r
  463. case (.settingsSync(let l), .settingsSync(let r)): return l == r
  464. case (.mdmParameters(let l), .mdmParameters(let r)): return l == r
  465. default: return false
  466. }
  467. }
  468. #endif
  469. }
  470. init() {}
  471. }
  472. /// Mobile device management parameters shared across Threema Work devices.
  473. ///
  474. /// More detailed parameter information is available here:
  475. /// https://work.threema.ch/en/docs/mdm_configuration
  476. struct D2d_MdmParameters {
  477. // SwiftProtobuf.Message conformance is added in an extension below. See the
  478. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  479. // methods supported on all messages.
  480. /// Username required for activation of the app
  481. /// References: `th_license_username`
  482. var licenseUsername: OneOf_LicenseUsername? {
  483. get {return _storage._licenseUsername}
  484. set {_uniqueStorage()._licenseUsername = newValue}
  485. }
  486. var licenseUsernameValue: String {
  487. get {
  488. if case .licenseUsernameValue(let v)? = _storage._licenseUsername {return v}
  489. return String()
  490. }
  491. set {_uniqueStorage()._licenseUsername = .licenseUsernameValue(newValue)}
  492. }
  493. /// Password required for activation of the app
  494. /// References: `th_license_password`
  495. var licensePassword: OneOf_LicensePassword? {
  496. get {return _storage._licensePassword}
  497. set {_uniqueStorage()._licensePassword = newValue}
  498. }
  499. var licensePasswordValue: String {
  500. get {
  501. if case .licensePasswordValue(let v)? = _storage._licensePassword {return v}
  502. return String()
  503. }
  504. set {_uniqueStorage()._licensePassword = .licensePasswordValue(newValue)}
  505. }
  506. /// Nickname to be used
  507. /// References: `th_nickname`
  508. var nickname: OneOf_Nickname? {
  509. get {return _storage._nickname}
  510. set {_uniqueStorage()._nickname = newValue}
  511. }
  512. var nicknameValue: String {
  513. get {
  514. if case .nicknameValue(let v)? = _storage._nickname {return v}
  515. return String()
  516. }
  517. set {_uniqueStorage()._nickname = .nicknameValue(newValue)}
  518. }
  519. /// First name of the user
  520. /// References: `th_firstname`
  521. var firstName: OneOf_FirstName? {
  522. get {return _storage._firstName}
  523. set {_uniqueStorage()._firstName = newValue}
  524. }
  525. var firstNameValue: String {
  526. get {
  527. if case .firstNameValue(let v)? = _storage._firstName {return v}
  528. return String()
  529. }
  530. set {_uniqueStorage()._firstName = .firstNameValue(newValue)}
  531. }
  532. /// Last name of the user
  533. /// References: `th_lastname`
  534. var lastName: OneOf_LastName? {
  535. get {return _storage._lastName}
  536. set {_uniqueStorage()._lastName = newValue}
  537. }
  538. var lastNameValue: String {
  539. get {
  540. if case .lastNameValue(let v)? = _storage._lastName {return v}
  541. return String()
  542. }
  543. set {_uniqueStorage()._lastName = .lastNameValue(newValue)}
  544. }
  545. /// Customer specific identifier
  546. /// References: `th_csi`
  547. var customerSpecificID: OneOf_CustomerSpecificID? {
  548. get {return _storage._customerSpecificID}
  549. set {_uniqueStorage()._customerSpecificID = newValue}
  550. }
  551. var customerSpecificIDValue: String {
  552. get {
  553. if case .customerSpecificIDValue(let v)? = _storage._customerSpecificID {return v}
  554. return String()
  555. }
  556. set {_uniqueStorage()._customerSpecificID = .customerSpecificIDValue(newValue)}
  557. }
  558. /// User category
  559. /// References: `th_category`
  560. var category: OneOf_Category? {
  561. get {return _storage._category}
  562. set {_uniqueStorage()._category = newValue}
  563. }
  564. var categoryValue: String {
  565. get {
  566. if case .categoryValue(let v)? = _storage._category {return v}
  567. return String()
  568. }
  569. set {_uniqueStorage()._category = .categoryValue(newValue)}
  570. }
  571. /// Email address linked to the ID
  572. /// References: `th_linked_email`
  573. var linkedEmail: OneOf_LinkedEmail? {
  574. get {return _storage._linkedEmail}
  575. set {_uniqueStorage()._linkedEmail = newValue}
  576. }
  577. var linkedEmailValue: String {
  578. get {
  579. if case .linkedEmailValue(let v)? = _storage._linkedEmail {return v}
  580. return String()
  581. }
  582. set {_uniqueStorage()._linkedEmail = .linkedEmailValue(newValue)}
  583. }
  584. /// Phone number linked to the ID
  585. /// References: `th_linked_phone`
  586. var linkedPhone: OneOf_LinkedPhone? {
  587. get {return _storage._linkedPhone}
  588. set {_uniqueStorage()._linkedPhone = newValue}
  589. }
  590. var linkedPhoneValue: String {
  591. get {
  592. if case .linkedPhoneValue(let v)? = _storage._linkedPhone {return v}
  593. return String()
  594. }
  595. set {_uniqueStorage()._linkedPhone = .linkedPhoneValue(newValue)}
  596. }
  597. /// Restore a Threema ID
  598. /// References: `th_id_backup`
  599. var identityRestore: OneOf_IdentityRestore? {
  600. get {return _storage._identityRestore}
  601. set {_uniqueStorage()._identityRestore = newValue}
  602. }
  603. var identityRestoreValue: String {
  604. get {
  605. if case .identityRestoreValue(let v)? = _storage._identityRestore {return v}
  606. return String()
  607. }
  608. set {_uniqueStorage()._identityRestore = .identityRestoreValue(newValue)}
  609. }
  610. /// Password for restoring a Threema ID
  611. /// References: `th_id_backup_password`
  612. var identityRestorePassword: OneOf_IdentityRestorePassword? {
  613. get {return _storage._identityRestorePassword}
  614. set {_uniqueStorage()._identityRestorePassword = newValue}
  615. }
  616. var identityRestorePasswordValue: String {
  617. get {
  618. if case .identityRestorePasswordValue(let v)? = _storage._identityRestorePassword {return v}
  619. return String()
  620. }
  621. set {_uniqueStorage()._identityRestorePassword = .identityRestorePasswordValue(newValue)}
  622. }
  623. var threemaSafePolicy: D2d_MdmParameters.ThreemaSafePolicy {
  624. get {return _storage._threemaSafePolicy}
  625. set {_uniqueStorage()._threemaSafePolicy = newValue}
  626. }
  627. /// Threema Safe password (predefined)
  628. /// References: `th_safe_password`
  629. var threemaSafePassword: OneOf_ThreemaSafePassword? {
  630. get {return _storage._threemaSafePassword}
  631. set {_uniqueStorage()._threemaSafePassword = newValue}
  632. }
  633. var threemaSafePasswordValue: String {
  634. get {
  635. if case .threemaSafePasswordValue(let v)? = _storage._threemaSafePassword {return v}
  636. return String()
  637. }
  638. set {_uniqueStorage()._threemaSafePassword = .threemaSafePasswordValue(newValue)}
  639. }
  640. /// Threema Safe password pattern
  641. /// References: `th_safe_password_pattern`
  642. var threemaSafePasswordPattern: OneOf_ThreemaSafePasswordPattern? {
  643. get {return _storage._threemaSafePasswordPattern}
  644. set {_uniqueStorage()._threemaSafePasswordPattern = newValue}
  645. }
  646. var threemaSafePasswordPatternValue: String {
  647. get {
  648. if case .threemaSafePasswordPatternValue(let v)? = _storage._threemaSafePasswordPattern {return v}
  649. return String()
  650. }
  651. set {_uniqueStorage()._threemaSafePasswordPattern = .threemaSafePasswordPatternValue(newValue)}
  652. }
  653. /// Threema Safe password pattern error (mismatch) message
  654. /// References: `th_safe_password_message`
  655. var threemaSafePasswordPatternErrorMessage: OneOf_ThreemaSafePasswordPatternErrorMessage? {
  656. get {return _storage._threemaSafePasswordPatternErrorMessage}
  657. set {_uniqueStorage()._threemaSafePasswordPatternErrorMessage = newValue}
  658. }
  659. var threemaSafePasswordPatternErrorMessageValue: String {
  660. get {
  661. if case .threemaSafePasswordPatternErrorMessageValue(let v)? = _storage._threemaSafePasswordPatternErrorMessage {return v}
  662. return String()
  663. }
  664. set {_uniqueStorage()._threemaSafePasswordPatternErrorMessage = .threemaSafePasswordPatternErrorMessageValue(newValue)}
  665. }
  666. /// Threema Safe server URL
  667. /// References: `th_safe_server_url`
  668. var threemaSafeServerURL: OneOf_ThreemaSafeServerURL? {
  669. get {return _storage._threemaSafeServerURL}
  670. set {_uniqueStorage()._threemaSafeServerURL = newValue}
  671. }
  672. var threemaSafeServerURLValue: String {
  673. get {
  674. if case .threemaSafeServerURLValue(let v)? = _storage._threemaSafeServerURL {return v}
  675. return String()
  676. }
  677. set {_uniqueStorage()._threemaSafeServerURL = .threemaSafeServerURLValue(newValue)}
  678. }
  679. /// Threema Safe server username for authentication
  680. /// References: `th_safe_server_username`
  681. var threemaSafeServerUsername: OneOf_ThreemaSafeServerUsername? {
  682. get {return _storage._threemaSafeServerUsername}
  683. set {_uniqueStorage()._threemaSafeServerUsername = newValue}
  684. }
  685. var threemaSafeServerUsernameValue: String {
  686. get {
  687. if case .threemaSafeServerUsernameValue(let v)? = _storage._threemaSafeServerUsername {return v}
  688. return String()
  689. }
  690. set {_uniqueStorage()._threemaSafeServerUsername = .threemaSafeServerUsernameValue(newValue)}
  691. }
  692. /// Threema Safe server password for authentication
  693. /// References: `th_safe_server_password`
  694. var threemaSafeServerPassword: OneOf_ThreemaSafeServerPassword? {
  695. get {return _storage._threemaSafeServerPassword}
  696. set {_uniqueStorage()._threemaSafeServerPassword = newValue}
  697. }
  698. var threemaSafeServerPasswordValue: String {
  699. get {
  700. if case .threemaSafeServerPasswordValue(let v)? = _storage._threemaSafeServerPassword {return v}
  701. return String()
  702. }
  703. set {_uniqueStorage()._threemaSafeServerPassword = .threemaSafeServerPasswordValue(newValue)}
  704. }
  705. var threemaSafeRestorePolicy: D2d_MdmParameters.ThreemaSafeRestorePolicy {
  706. get {return _storage._threemaSafeRestorePolicy}
  707. set {_uniqueStorage()._threemaSafeRestorePolicy = newValue}
  708. }
  709. /// Threema ID to be restored from Threema Safe
  710. /// References: `th_safe_restore_id`
  711. var threemaSafeRestoreIdentity: OneOf_ThreemaSafeRestoreIdentity? {
  712. get {return _storage._threemaSafeRestoreIdentity}
  713. set {_uniqueStorage()._threemaSafeRestoreIdentity = newValue}
  714. }
  715. var threemaSafeRestoreIdentityValue: String {
  716. get {
  717. if case .threemaSafeRestoreIdentityValue(let v)? = _storage._threemaSafeRestoreIdentity {return v}
  718. return String()
  719. }
  720. set {_uniqueStorage()._threemaSafeRestoreIdentity = .threemaSafeRestoreIdentityValue(newValue)}
  721. }
  722. var overridePolicy: D2d_MdmParameters.OverridePolicy {
  723. get {return _storage._overridePolicy}
  724. set {_uniqueStorage()._overridePolicy = newValue}
  725. }
  726. var contactSyncPolicy: D2d_MdmParameters.ContactSyncPolicy {
  727. get {return _storage._contactSyncPolicy}
  728. set {_uniqueStorage()._contactSyncPolicy = newValue}
  729. }
  730. var inactiveIdentityDisplayPolicy: D2d_MdmParameters.InactiveIdentityDisplayPolicy {
  731. get {return _storage._inactiveIdentityDisplayPolicy}
  732. set {_uniqueStorage()._inactiveIdentityDisplayPolicy = newValue}
  733. }
  734. var unknownContactPolicy: D2d_MdmParameters.UnknownContactPolicy {
  735. get {return _storage._unknownContactPolicy}
  736. set {_uniqueStorage()._unknownContactPolicy = newValue}
  737. }
  738. var autoSaveMediaPolicy: D2d_MdmParameters.AutoSaveMediaPolicy {
  739. get {return _storage._autoSaveMediaPolicy}
  740. set {_uniqueStorage()._autoSaveMediaPolicy = newValue}
  741. }
  742. var screenshotPolicy: D2d_MdmParameters.ScreenshotPolicy {
  743. get {return _storage._screenshotPolicy}
  744. set {_uniqueStorage()._screenshotPolicy = newValue}
  745. }
  746. var addContactPolicy: D2d_MdmParameters.AddContactPolicy {
  747. get {return _storage._addContactPolicy}
  748. set {_uniqueStorage()._addContactPolicy = newValue}
  749. }
  750. var chatExportPolicy: D2d_MdmParameters.ChatExportPolicy {
  751. get {return _storage._chatExportPolicy}
  752. set {_uniqueStorage()._chatExportPolicy = newValue}
  753. }
  754. var backupPolicy: D2d_MdmParameters.BackupPolicy {
  755. get {return _storage._backupPolicy}
  756. set {_uniqueStorage()._backupPolicy = newValue}
  757. }
  758. var identityExportPolicy: D2d_MdmParameters.IdentityExportPolicy {
  759. get {return _storage._identityExportPolicy}
  760. set {_uniqueStorage()._identityExportPolicy = newValue}
  761. }
  762. var dataBackupPolicy: D2d_MdmParameters.DataBackupPolicy {
  763. get {return _storage._dataBackupPolicy}
  764. set {_uniqueStorage()._dataBackupPolicy = newValue}
  765. }
  766. var systemBackupPolicy: D2d_MdmParameters.SystemBackupPolicy {
  767. get {return _storage._systemBackupPolicy}
  768. set {_uniqueStorage()._systemBackupPolicy = newValue}
  769. }
  770. var messagePreviewPolicy: D2d_MdmParameters.MessagePreviewPolicy {
  771. get {return _storage._messagePreviewPolicy}
  772. set {_uniqueStorage()._messagePreviewPolicy = newValue}
  773. }
  774. var profilePictureSharePolicy: D2d_MdmParameters.ProfilePictureSharePolicy {
  775. get {return _storage._profilePictureSharePolicy}
  776. set {_uniqueStorage()._profilePictureSharePolicy = newValue}
  777. }
  778. var callPolicy: D2d_MdmParameters.CallPolicy {
  779. get {return _storage._callPolicy}
  780. set {_uniqueStorage()._callPolicy = newValue}
  781. }
  782. var setupWizardPolicy: D2d_MdmParameters.SetupWizardPolicy {
  783. get {return _storage._setupWizardPolicy}
  784. set {_uniqueStorage()._setupWizardPolicy = newValue}
  785. }
  786. var createGroupPolicy: D2d_MdmParameters.CreateGroupPolicy {
  787. get {return _storage._createGroupPolicy}
  788. set {_uniqueStorage()._createGroupPolicy = newValue}
  789. }
  790. var shareMediaPolicy: D2d_MdmParameters.ShareMediaPolicy {
  791. get {return _storage._shareMediaPolicy}
  792. set {_uniqueStorage()._shareMediaPolicy = newValue}
  793. }
  794. var unknownFields = SwiftProtobuf.UnknownStorage()
  795. /// Username required for activation of the app
  796. /// References: `th_license_username`
  797. enum OneOf_LicenseUsername: Equatable {
  798. case licenseUsernameValue(String)
  799. #if !swift(>=4.1)
  800. static func ==(lhs: D2d_MdmParameters.OneOf_LicenseUsername, rhs: D2d_MdmParameters.OneOf_LicenseUsername) -> Bool {
  801. switch (lhs, rhs) {
  802. case (.licenseUsernameValue(let l), .licenseUsernameValue(let r)): return l == r
  803. }
  804. }
  805. #endif
  806. }
  807. /// Password required for activation of the app
  808. /// References: `th_license_password`
  809. enum OneOf_LicensePassword: Equatable {
  810. case licensePasswordValue(String)
  811. #if !swift(>=4.1)
  812. static func ==(lhs: D2d_MdmParameters.OneOf_LicensePassword, rhs: D2d_MdmParameters.OneOf_LicensePassword) -> Bool {
  813. switch (lhs, rhs) {
  814. case (.licensePasswordValue(let l), .licensePasswordValue(let r)): return l == r
  815. }
  816. }
  817. #endif
  818. }
  819. /// Nickname to be used
  820. /// References: `th_nickname`
  821. enum OneOf_Nickname: Equatable {
  822. case nicknameValue(String)
  823. #if !swift(>=4.1)
  824. static func ==(lhs: D2d_MdmParameters.OneOf_Nickname, rhs: D2d_MdmParameters.OneOf_Nickname) -> Bool {
  825. switch (lhs, rhs) {
  826. case (.nicknameValue(let l), .nicknameValue(let r)): return l == r
  827. }
  828. }
  829. #endif
  830. }
  831. /// First name of the user
  832. /// References: `th_firstname`
  833. enum OneOf_FirstName: Equatable {
  834. case firstNameValue(String)
  835. #if !swift(>=4.1)
  836. static func ==(lhs: D2d_MdmParameters.OneOf_FirstName, rhs: D2d_MdmParameters.OneOf_FirstName) -> Bool {
  837. switch (lhs, rhs) {
  838. case (.firstNameValue(let l), .firstNameValue(let r)): return l == r
  839. }
  840. }
  841. #endif
  842. }
  843. /// Last name of the user
  844. /// References: `th_lastname`
  845. enum OneOf_LastName: Equatable {
  846. case lastNameValue(String)
  847. #if !swift(>=4.1)
  848. static func ==(lhs: D2d_MdmParameters.OneOf_LastName, rhs: D2d_MdmParameters.OneOf_LastName) -> Bool {
  849. switch (lhs, rhs) {
  850. case (.lastNameValue(let l), .lastNameValue(let r)): return l == r
  851. }
  852. }
  853. #endif
  854. }
  855. /// Customer specific identifier
  856. /// References: `th_csi`
  857. enum OneOf_CustomerSpecificID: Equatable {
  858. case customerSpecificIDValue(String)
  859. #if !swift(>=4.1)
  860. static func ==(lhs: D2d_MdmParameters.OneOf_CustomerSpecificID, rhs: D2d_MdmParameters.OneOf_CustomerSpecificID) -> Bool {
  861. switch (lhs, rhs) {
  862. case (.customerSpecificIDValue(let l), .customerSpecificIDValue(let r)): return l == r
  863. }
  864. }
  865. #endif
  866. }
  867. /// User category
  868. /// References: `th_category`
  869. enum OneOf_Category: Equatable {
  870. case categoryValue(String)
  871. #if !swift(>=4.1)
  872. static func ==(lhs: D2d_MdmParameters.OneOf_Category, rhs: D2d_MdmParameters.OneOf_Category) -> Bool {
  873. switch (lhs, rhs) {
  874. case (.categoryValue(let l), .categoryValue(let r)): return l == r
  875. }
  876. }
  877. #endif
  878. }
  879. /// Email address linked to the ID
  880. /// References: `th_linked_email`
  881. enum OneOf_LinkedEmail: Equatable {
  882. case linkedEmailValue(String)
  883. #if !swift(>=4.1)
  884. static func ==(lhs: D2d_MdmParameters.OneOf_LinkedEmail, rhs: D2d_MdmParameters.OneOf_LinkedEmail) -> Bool {
  885. switch (lhs, rhs) {
  886. case (.linkedEmailValue(let l), .linkedEmailValue(let r)): return l == r
  887. }
  888. }
  889. #endif
  890. }
  891. /// Phone number linked to the ID
  892. /// References: `th_linked_phone`
  893. enum OneOf_LinkedPhone: Equatable {
  894. case linkedPhoneValue(String)
  895. #if !swift(>=4.1)
  896. static func ==(lhs: D2d_MdmParameters.OneOf_LinkedPhone, rhs: D2d_MdmParameters.OneOf_LinkedPhone) -> Bool {
  897. switch (lhs, rhs) {
  898. case (.linkedPhoneValue(let l), .linkedPhoneValue(let r)): return l == r
  899. }
  900. }
  901. #endif
  902. }
  903. /// Restore a Threema ID
  904. /// References: `th_id_backup`
  905. enum OneOf_IdentityRestore: Equatable {
  906. case identityRestoreValue(String)
  907. #if !swift(>=4.1)
  908. static func ==(lhs: D2d_MdmParameters.OneOf_IdentityRestore, rhs: D2d_MdmParameters.OneOf_IdentityRestore) -> Bool {
  909. switch (lhs, rhs) {
  910. case (.identityRestoreValue(let l), .identityRestoreValue(let r)): return l == r
  911. }
  912. }
  913. #endif
  914. }
  915. /// Password for restoring a Threema ID
  916. /// References: `th_id_backup_password`
  917. enum OneOf_IdentityRestorePassword: Equatable {
  918. case identityRestorePasswordValue(String)
  919. #if !swift(>=4.1)
  920. static func ==(lhs: D2d_MdmParameters.OneOf_IdentityRestorePassword, rhs: D2d_MdmParameters.OneOf_IdentityRestorePassword) -> Bool {
  921. switch (lhs, rhs) {
  922. case (.identityRestorePasswordValue(let l), .identityRestorePasswordValue(let r)): return l == r
  923. }
  924. }
  925. #endif
  926. }
  927. /// Threema Safe password (predefined)
  928. /// References: `th_safe_password`
  929. enum OneOf_ThreemaSafePassword: Equatable {
  930. case threemaSafePasswordValue(String)
  931. #if !swift(>=4.1)
  932. static func ==(lhs: D2d_MdmParameters.OneOf_ThreemaSafePassword, rhs: D2d_MdmParameters.OneOf_ThreemaSafePassword) -> Bool {
  933. switch (lhs, rhs) {
  934. case (.threemaSafePasswordValue(let l), .threemaSafePasswordValue(let r)): return l == r
  935. }
  936. }
  937. #endif
  938. }
  939. /// Threema Safe password pattern
  940. /// References: `th_safe_password_pattern`
  941. enum OneOf_ThreemaSafePasswordPattern: Equatable {
  942. case threemaSafePasswordPatternValue(String)
  943. #if !swift(>=4.1)
  944. static func ==(lhs: D2d_MdmParameters.OneOf_ThreemaSafePasswordPattern, rhs: D2d_MdmParameters.OneOf_ThreemaSafePasswordPattern) -> Bool {
  945. switch (lhs, rhs) {
  946. case (.threemaSafePasswordPatternValue(let l), .threemaSafePasswordPatternValue(let r)): return l == r
  947. }
  948. }
  949. #endif
  950. }
  951. /// Threema Safe password pattern error (mismatch) message
  952. /// References: `th_safe_password_message`
  953. enum OneOf_ThreemaSafePasswordPatternErrorMessage: Equatable {
  954. case threemaSafePasswordPatternErrorMessageValue(String)
  955. #if !swift(>=4.1)
  956. static func ==(lhs: D2d_MdmParameters.OneOf_ThreemaSafePasswordPatternErrorMessage, rhs: D2d_MdmParameters.OneOf_ThreemaSafePasswordPatternErrorMessage) -> Bool {
  957. switch (lhs, rhs) {
  958. case (.threemaSafePasswordPatternErrorMessageValue(let l), .threemaSafePasswordPatternErrorMessageValue(let r)): return l == r
  959. }
  960. }
  961. #endif
  962. }
  963. /// Threema Safe server URL
  964. /// References: `th_safe_server_url`
  965. enum OneOf_ThreemaSafeServerURL: Equatable {
  966. case threemaSafeServerURLValue(String)
  967. #if !swift(>=4.1)
  968. static func ==(lhs: D2d_MdmParameters.OneOf_ThreemaSafeServerURL, rhs: D2d_MdmParameters.OneOf_ThreemaSafeServerURL) -> Bool {
  969. switch (lhs, rhs) {
  970. case (.threemaSafeServerURLValue(let l), .threemaSafeServerURLValue(let r)): return l == r
  971. }
  972. }
  973. #endif
  974. }
  975. /// Threema Safe server username for authentication
  976. /// References: `th_safe_server_username`
  977. enum OneOf_ThreemaSafeServerUsername: Equatable {
  978. case threemaSafeServerUsernameValue(String)
  979. #if !swift(>=4.1)
  980. static func ==(lhs: D2d_MdmParameters.OneOf_ThreemaSafeServerUsername, rhs: D2d_MdmParameters.OneOf_ThreemaSafeServerUsername) -> Bool {
  981. switch (lhs, rhs) {
  982. case (.threemaSafeServerUsernameValue(let l), .threemaSafeServerUsernameValue(let r)): return l == r
  983. }
  984. }
  985. #endif
  986. }
  987. /// Threema Safe server password for authentication
  988. /// References: `th_safe_server_password`
  989. enum OneOf_ThreemaSafeServerPassword: Equatable {
  990. case threemaSafeServerPasswordValue(String)
  991. #if !swift(>=4.1)
  992. static func ==(lhs: D2d_MdmParameters.OneOf_ThreemaSafeServerPassword, rhs: D2d_MdmParameters.OneOf_ThreemaSafeServerPassword) -> Bool {
  993. switch (lhs, rhs) {
  994. case (.threemaSafeServerPasswordValue(let l), .threemaSafeServerPasswordValue(let r)): return l == r
  995. }
  996. }
  997. #endif
  998. }
  999. /// Threema ID to be restored from Threema Safe
  1000. /// References: `th_safe_restore_id`
  1001. enum OneOf_ThreemaSafeRestoreIdentity: Equatable {
  1002. case threemaSafeRestoreIdentityValue(String)
  1003. #if !swift(>=4.1)
  1004. static func ==(lhs: D2d_MdmParameters.OneOf_ThreemaSafeRestoreIdentity, rhs: D2d_MdmParameters.OneOf_ThreemaSafeRestoreIdentity) -> Bool {
  1005. switch (lhs, rhs) {
  1006. case (.threemaSafeRestoreIdentityValue(let l), .threemaSafeRestoreIdentityValue(let r)): return l == r
  1007. }
  1008. }
  1009. #endif
  1010. }
  1011. /// Threema Safe configuration
  1012. /// References: `th_safe_enable`
  1013. enum ThreemaSafePolicy: SwiftProtobuf.Enum {
  1014. typealias RawValue = Int
  1015. /// Configurable by the user
  1016. case safeOptional // = 0
  1017. /// Forcibly enabled
  1018. case safeMandatory // = 1
  1019. /// Forcibly disabled
  1020. case safeDisabled // = 2
  1021. case UNRECOGNIZED(Int)
  1022. init() {
  1023. self = .safeOptional
  1024. }
  1025. init?(rawValue: Int) {
  1026. switch rawValue {
  1027. case 0: self = .safeOptional
  1028. case 1: self = .safeMandatory
  1029. case 2: self = .safeDisabled
  1030. default: self = .UNRECOGNIZED(rawValue)
  1031. }
  1032. }
  1033. var rawValue: Int {
  1034. switch self {
  1035. case .safeOptional: return 0
  1036. case .safeMandatory: return 1
  1037. case .safeDisabled: return 2
  1038. case .UNRECOGNIZED(let i): return i
  1039. }
  1040. }
  1041. }
  1042. /// Restore policy for restoring from a Threema Safe backup
  1043. /// References: `th_safe_restore_enable`
  1044. enum ThreemaSafeRestorePolicy: SwiftProtobuf.Enum {
  1045. typealias RawValue = Int
  1046. /// Choosable by the user
  1047. case safeRestoreOptional // = 0
  1048. /// Automatic restore
  1049. case safeRestoreMandatory // = 1
  1050. /// Forcibly disabled
  1051. case safeRestoreDisabled // = 2
  1052. case UNRECOGNIZED(Int)
  1053. init() {
  1054. self = .safeRestoreOptional
  1055. }
  1056. init?(rawValue: Int) {
  1057. switch rawValue {
  1058. case 0: self = .safeRestoreOptional
  1059. case 1: self = .safeRestoreMandatory
  1060. case 2: self = .safeRestoreDisabled
  1061. default: self = .UNRECOGNIZED(rawValue)
  1062. }
  1063. }
  1064. var rawValue: Int {
  1065. switch self {
  1066. case .safeRestoreOptional: return 0
  1067. case .safeRestoreMandatory: return 1
  1068. case .safeRestoreDisabled: return 2
  1069. case .UNRECOGNIZED(let i): return i
  1070. }
  1071. }
  1072. }
  1073. /// Override policy in regards to MDM parameters (profile, settings, ...)
  1074. /// References: `th_readonly_profile`
  1075. enum OverridePolicy: SwiftProtobuf.Enum {
  1076. typealias RawValue = Int
  1077. /// Allows the user to override some of the MDM parameter presets
  1078. case loose // = 0
  1079. /// The user may not override any MDM parameter presets
  1080. case strict // = 1
  1081. case UNRECOGNIZED(Int)
  1082. init() {
  1083. self = .loose
  1084. }
  1085. init?(rawValue: Int) {
  1086. switch rawValue {
  1087. case 0: self = .loose
  1088. case 1: self = .strict
  1089. default: self = .UNRECOGNIZED(rawValue)
  1090. }
  1091. }
  1092. var rawValue: Int {
  1093. switch self {
  1094. case .loose: return 0
  1095. case .strict: return 1
  1096. case .UNRECOGNIZED(let i): return i
  1097. }
  1098. }
  1099. }
  1100. /// Contact synchronisation policy
  1101. /// References: `th_contact_sync`
  1102. enum ContactSyncPolicy: SwiftProtobuf.Enum {
  1103. typealias RawValue = Int
  1104. /// Not synced
  1105. case notSynced // = 0
  1106. /// Synced
  1107. case sync // = 1
  1108. case UNRECOGNIZED(Int)
  1109. init() {
  1110. self = .notSynced
  1111. }
  1112. init?(rawValue: Int) {
  1113. switch rawValue {
  1114. case 0: self = .notSynced
  1115. case 1: self = .sync
  1116. default: self = .UNRECOGNIZED(rawValue)
  1117. }
  1118. }
  1119. var rawValue: Int {
  1120. switch self {
  1121. case .notSynced: return 0
  1122. case .sync: return 1
  1123. case .UNRECOGNIZED(let i): return i
  1124. }
  1125. }
  1126. }
  1127. /// Inactive Threema ID display policy
  1128. /// References: `th_hide_inactive_ids`
  1129. enum InactiveIdentityDisplayPolicy: SwiftProtobuf.Enum {
  1130. typealias RawValue = Int
  1131. /// Show inactive IDs
  1132. case showInactive // = 0
  1133. /// Hide inactive IDs
  1134. case hideInactive // = 1
  1135. case UNRECOGNIZED(Int)
  1136. init() {
  1137. self = .showInactive
  1138. }
  1139. init?(rawValue: Int) {
  1140. switch rawValue {
  1141. case 0: self = .showInactive
  1142. case 1: self = .hideInactive
  1143. default: self = .UNRECOGNIZED(rawValue)
  1144. }
  1145. }
  1146. var rawValue: Int {
  1147. switch self {
  1148. case .showInactive: return 0
  1149. case .hideInactive: return 1
  1150. case .UNRECOGNIZED(let i): return i
  1151. }
  1152. }
  1153. }
  1154. /// Unknown contacts policy
  1155. /// References: `th_block_unknown`
  1156. enum UnknownContactPolicy: SwiftProtobuf.Enum {
  1157. typealias RawValue = Int
  1158. /// Allowed to contact the user
  1159. case allowUnknown // = 0
  1160. /// Will be blocked by the user
  1161. case blockUnknown // = 1
  1162. case UNRECOGNIZED(Int)
  1163. init() {
  1164. self = .allowUnknown
  1165. }
  1166. init?(rawValue: Int) {
  1167. switch rawValue {
  1168. case 0: self = .allowUnknown
  1169. case 1: self = .blockUnknown
  1170. default: self = .UNRECOGNIZED(rawValue)
  1171. }
  1172. }
  1173. var rawValue: Int {
  1174. switch self {
  1175. case .allowUnknown: return 0
  1176. case .blockUnknown: return 1
  1177. case .UNRECOGNIZED(let i): return i
  1178. }
  1179. }
  1180. }
  1181. /// Auto-save media policy
  1182. /// References: `th_disable_save_to_gallery`
  1183. enum AutoSaveMediaPolicy: SwiftProtobuf.Enum {
  1184. typealias RawValue = Int
  1185. /// Allow auto-saving, configurable by the user
  1186. case allowAutoSave // = 0
  1187. /// Deny auto-saving
  1188. case denyAutoSave // = 1
  1189. case UNRECOGNIZED(Int)
  1190. init() {
  1191. self = .allowAutoSave
  1192. }
  1193. init?(rawValue: Int) {
  1194. switch rawValue {
  1195. case 0: self = .allowAutoSave
  1196. case 1: self = .denyAutoSave
  1197. default: self = .UNRECOGNIZED(rawValue)
  1198. }
  1199. }
  1200. var rawValue: Int {
  1201. switch self {
  1202. case .allowAutoSave: return 0
  1203. case .denyAutoSave: return 1
  1204. case .UNRECOGNIZED(let i): return i
  1205. }
  1206. }
  1207. }
  1208. /// Screenshot policy
  1209. /// References: `th_disable_screenshots`
  1210. enum ScreenshotPolicy: SwiftProtobuf.Enum {
  1211. typealias RawValue = Int
  1212. /// Allow taking screenshots
  1213. case allowScreenshot // = 0
  1214. /// Deny taking screenshots, if possible
  1215. case denyScreenshot // = 1
  1216. case UNRECOGNIZED(Int)
  1217. init() {
  1218. self = .allowScreenshot
  1219. }
  1220. init?(rawValue: Int) {
  1221. switch rawValue {
  1222. case 0: self = .allowScreenshot
  1223. case 1: self = .denyScreenshot
  1224. default: self = .UNRECOGNIZED(rawValue)
  1225. }
  1226. }
  1227. var rawValue: Int {
  1228. switch self {
  1229. case .allowScreenshot: return 0
  1230. case .denyScreenshot: return 1
  1231. case .UNRECOGNIZED(let i): return i
  1232. }
  1233. }
  1234. }
  1235. /// Add contact policy
  1236. /// References: `th_disable_add_contact`
  1237. enum AddContactPolicy: SwiftProtobuf.Enum {
  1238. typealias RawValue = Int
  1239. /// Allow manually adding contacts
  1240. case allowAddContact // = 0
  1241. /// Deny manually adding contacts
  1242. case denyAddContact // = 1
  1243. case UNRECOGNIZED(Int)
  1244. init() {
  1245. self = .allowAddContact
  1246. }
  1247. init?(rawValue: Int) {
  1248. switch rawValue {
  1249. case 0: self = .allowAddContact
  1250. case 1: self = .denyAddContact
  1251. default: self = .UNRECOGNIZED(rawValue)
  1252. }
  1253. }
  1254. var rawValue: Int {
  1255. switch self {
  1256. case .allowAddContact: return 0
  1257. case .denyAddContact: return 1
  1258. case .UNRECOGNIZED(let i): return i
  1259. }
  1260. }
  1261. }
  1262. /// Chat export policy
  1263. /// References: `th_disable_export`
  1264. enum ChatExportPolicy: SwiftProtobuf.Enum {
  1265. typealias RawValue = Int
  1266. /// Allow exporting chats
  1267. case allowChatExport // = 0
  1268. /// Deny exporting of chats
  1269. case denyChatExport // = 1
  1270. case UNRECOGNIZED(Int)
  1271. init() {
  1272. self = .allowChatExport
  1273. }
  1274. init?(rawValue: Int) {
  1275. switch rawValue {
  1276. case 0: self = .allowChatExport
  1277. case 1: self = .denyChatExport
  1278. default: self = .UNRECOGNIZED(rawValue)
  1279. }
  1280. }
  1281. var rawValue: Int {
  1282. switch self {
  1283. case .allowChatExport: return 0
  1284. case .denyChatExport: return 1
  1285. case .UNRECOGNIZED(let i): return i
  1286. }
  1287. }
  1288. }
  1289. /// Backup policy
  1290. /// References: `th_disable_backups`
  1291. enum BackupPolicy: SwiftProtobuf.Enum {
  1292. typealias RawValue = Int
  1293. /// Generally allow backups to be made
  1294. case allowBackup // = 0
  1295. /// Deny creating backups
  1296. case denyBackup // = 1
  1297. case UNRECOGNIZED(Int)
  1298. init() {
  1299. self = .allowBackup
  1300. }
  1301. init?(rawValue: Int) {
  1302. switch rawValue {
  1303. case 0: self = .allowBackup
  1304. case 1: self = .denyBackup
  1305. default: self = .UNRECOGNIZED(rawValue)
  1306. }
  1307. }
  1308. var rawValue: Int {
  1309. switch self {
  1310. case .allowBackup: return 0
  1311. case .denyBackup: return 1
  1312. case .UNRECOGNIZED(let i): return i
  1313. }
  1314. }
  1315. }
  1316. /// Threema ID export policy
  1317. /// References: `th_disable_id_export`
  1318. enum IdentityExportPolicy: SwiftProtobuf.Enum {
  1319. typealias RawValue = Int
  1320. /// Allow exporting of the Threema ID
  1321. case allowIdentityExport // = 0
  1322. /// Deny exporting of the Threema ID
  1323. case denyIdentityExport // = 1
  1324. case UNRECOGNIZED(Int)
  1325. init() {
  1326. self = .allowIdentityExport
  1327. }
  1328. init?(rawValue: Int) {
  1329. switch rawValue {
  1330. case 0: self = .allowIdentityExport
  1331. case 1: self = .denyIdentityExport
  1332. default: self = .UNRECOGNIZED(rawValue)
  1333. }
  1334. }
  1335. var rawValue: Int {
  1336. switch self {
  1337. case .allowIdentityExport: return 0
  1338. case .denyIdentityExport: return 1
  1339. case .UNRECOGNIZED(let i): return i
  1340. }
  1341. }
  1342. }
  1343. /// Data backup policy
  1344. /// References: `th_disable_data_backups`
  1345. enum DataBackupPolicy: SwiftProtobuf.Enum {
  1346. typealias RawValue = Int
  1347. /// Allow creating data backups
  1348. case allowDataBackup // = 0
  1349. /// Deny creating data backups
  1350. case denyDataBackup // = 1
  1351. case UNRECOGNIZED(Int)
  1352. init() {
  1353. self = .allowDataBackup
  1354. }
  1355. init?(rawValue: Int) {
  1356. switch rawValue {
  1357. case 0: self = .allowDataBackup
  1358. case 1: self = .denyDataBackup
  1359. default: self = .UNRECOGNIZED(rawValue)
  1360. }
  1361. }
  1362. var rawValue: Int {
  1363. switch self {
  1364. case .allowDataBackup: return 0
  1365. case .denyDataBackup: return 1
  1366. case .UNRECOGNIZED(let i): return i
  1367. }
  1368. }
  1369. }
  1370. /// System backup policy
  1371. /// References: `th_disable_system_backups`
  1372. enum SystemBackupPolicy: SwiftProtobuf.Enum {
  1373. typealias RawValue = Int
  1374. /// The system may include app data
  1375. case allowSystemBackup // = 0
  1376. /// The system is denied from including app data
  1377. case denySystemBackup // = 1
  1378. case UNRECOGNIZED(Int)
  1379. init() {
  1380. self = .allowSystemBackup
  1381. }
  1382. init?(rawValue: Int) {
  1383. switch rawValue {
  1384. case 0: self = .allowSystemBackup
  1385. case 1: self = .denySystemBackup
  1386. default: self = .UNRECOGNIZED(rawValue)
  1387. }
  1388. }
  1389. var rawValue: Int {
  1390. switch self {
  1391. case .allowSystemBackup: return 0
  1392. case .denySystemBackup: return 1
  1393. case .UNRECOGNIZED(let i): return i
  1394. }
  1395. }
  1396. }
  1397. /// Message preview (in notifications)
  1398. /// References: `th_disable_message_preview`
  1399. enum MessagePreviewPolicy: SwiftProtobuf.Enum {
  1400. typealias RawValue = Int
  1401. /// Allow showing a message preview
  1402. case allowPreview // = 0
  1403. /// Deny showing a message preview
  1404. case denyPreview // = 1
  1405. case UNRECOGNIZED(Int)
  1406. init() {
  1407. self = .allowPreview
  1408. }
  1409. init?(rawValue: Int) {
  1410. switch rawValue {
  1411. case 0: self = .allowPreview
  1412. case 1: self = .denyPreview
  1413. default: self = .UNRECOGNIZED(rawValue)
  1414. }
  1415. }
  1416. var rawValue: Int {
  1417. switch self {
  1418. case .allowPreview: return 0
  1419. case .denyPreview: return 1
  1420. case .UNRECOGNIZED(let i): return i
  1421. }
  1422. }
  1423. }
  1424. /// Profile picture sharing policy
  1425. /// References: `th_disable_send_profile_picture`
  1426. enum ProfilePictureSharePolicy: SwiftProtobuf.Enum {
  1427. typealias RawValue = Int
  1428. /// Allow the profile picture to be shared with contacts
  1429. case allowShare // = 0
  1430. /// Denied from sharing the profile picture with contacts
  1431. case denyShare // = 1
  1432. case UNRECOGNIZED(Int)
  1433. init() {
  1434. self = .allowShare
  1435. }
  1436. init?(rawValue: Int) {
  1437. switch rawValue {
  1438. case 0: self = .allowShare
  1439. case 1: self = .denyShare
  1440. default: self = .UNRECOGNIZED(rawValue)
  1441. }
  1442. }
  1443. var rawValue: Int {
  1444. switch self {
  1445. case .allowShare: return 0
  1446. case .denyShare: return 1
  1447. case .UNRECOGNIZED(let i): return i
  1448. }
  1449. }
  1450. }
  1451. /// Threema Call policy
  1452. /// References: `th_disable_calls`
  1453. enum CallPolicy: SwiftProtobuf.Enum {
  1454. typealias RawValue = Int
  1455. /// Allow creating/receiving Threema Calls
  1456. case allowCall // = 0
  1457. /// Denied from creating/receiving any Threema Calls
  1458. case denyCall // = 1
  1459. case UNRECOGNIZED(Int)
  1460. init() {
  1461. self = .allowCall
  1462. }
  1463. init?(rawValue: Int) {
  1464. switch rawValue {
  1465. case 0: self = .allowCall
  1466. case 1: self = .denyCall
  1467. default: self = .UNRECOGNIZED(rawValue)
  1468. }
  1469. }
  1470. var rawValue: Int {
  1471. switch self {
  1472. case .allowCall: return 0
  1473. case .denyCall: return 1
  1474. case .UNRECOGNIZED(let i): return i
  1475. }
  1476. }
  1477. }
  1478. /// Setup wizard policy
  1479. /// References: `th_skip_wizard`
  1480. enum SetupWizardPolicy: SwiftProtobuf.Enum {
  1481. typealias RawValue = Int
  1482. /// Show the setup wizard
  1483. case showWizard // = 0
  1484. /// Skip the setup wizard (restores an ID or a backup and sets up the
  1485. /// profile automatically).
  1486. case skipWizard // = 1
  1487. case UNRECOGNIZED(Int)
  1488. init() {
  1489. self = .showWizard
  1490. }
  1491. init?(rawValue: Int) {
  1492. switch rawValue {
  1493. case 0: self = .showWizard
  1494. case 1: self = .skipWizard
  1495. default: self = .UNRECOGNIZED(rawValue)
  1496. }
  1497. }
  1498. var rawValue: Int {
  1499. switch self {
  1500. case .showWizard: return 0
  1501. case .skipWizard: return 1
  1502. case .UNRECOGNIZED(let i): return i
  1503. }
  1504. }
  1505. }
  1506. /// Group creation policy
  1507. /// References: `th_disable_create_group`
  1508. enum CreateGroupPolicy: SwiftProtobuf.Enum {
  1509. typealias RawValue = Int
  1510. /// Allow manually creating groups
  1511. case allowCreateGroup // = 0
  1512. /// Deny manually creating groups
  1513. case denyCreateGroup // = 1
  1514. case UNRECOGNIZED(Int)
  1515. init() {
  1516. self = .allowCreateGroup
  1517. }
  1518. init?(rawValue: Int) {
  1519. switch rawValue {
  1520. case 0: self = .allowCreateGroup
  1521. case 1: self = .denyCreateGroup
  1522. default: self = .UNRECOGNIZED(rawValue)
  1523. }
  1524. }
  1525. var rawValue: Int {
  1526. switch self {
  1527. case .allowCreateGroup: return 0
  1528. case .denyCreateGroup: return 1
  1529. case .UNRECOGNIZED(let i): return i
  1530. }
  1531. }
  1532. }
  1533. /// Share media policy
  1534. /// References: `th_disable_share_media`
  1535. enum ShareMediaPolicy: SwiftProtobuf.Enum {
  1536. typealias RawValue = Int
  1537. /// Allow unrestricted sharing of media
  1538. case allowShareMedia // = 0
  1539. /// Deny sharing of media outside of Threema, if possible
  1540. case denyOutsideApp // = 1
  1541. case UNRECOGNIZED(Int)
  1542. init() {
  1543. self = .allowShareMedia
  1544. }
  1545. init?(rawValue: Int) {
  1546. switch rawValue {
  1547. case 0: self = .allowShareMedia
  1548. case 1: self = .denyOutsideApp
  1549. default: self = .UNRECOGNIZED(rawValue)
  1550. }
  1551. }
  1552. var rawValue: Int {
  1553. switch self {
  1554. case .allowShareMedia: return 0
  1555. case .denyOutsideApp: return 1
  1556. case .UNRECOGNIZED(let i): return i
  1557. }
  1558. }
  1559. }
  1560. init() {}
  1561. fileprivate var _storage = _StorageClass.defaultInstance
  1562. }
  1563. #if swift(>=4.2)
  1564. extension D2d_MdmParameters.ThreemaSafePolicy: CaseIterable {
  1565. // The compiler won't synthesize support with the UNRECOGNIZED case.
  1566. static var allCases: [D2d_MdmParameters.ThreemaSafePolicy] = [
  1567. .safeOptional,
  1568. .safeMandatory,
  1569. .safeDisabled,
  1570. ]
  1571. }
  1572. extension D2d_MdmParameters.ThreemaSafeRestorePolicy: CaseIterable {
  1573. // The compiler won't synthesize support with the UNRECOGNIZED case.
  1574. static var allCases: [D2d_MdmParameters.ThreemaSafeRestorePolicy] = [
  1575. .safeRestoreOptional,
  1576. .safeRestoreMandatory,
  1577. .safeRestoreDisabled,
  1578. ]
  1579. }
  1580. extension D2d_MdmParameters.OverridePolicy: CaseIterable {
  1581. // The compiler won't synthesize support with the UNRECOGNIZED case.
  1582. static var allCases: [D2d_MdmParameters.OverridePolicy] = [
  1583. .loose,
  1584. .strict,
  1585. ]
  1586. }
  1587. extension D2d_MdmParameters.ContactSyncPolicy: CaseIterable {
  1588. // The compiler won't synthesize support with the UNRECOGNIZED case.
  1589. static var allCases: [D2d_MdmParameters.ContactSyncPolicy] = [
  1590. .notSynced,
  1591. .sync,
  1592. ]
  1593. }
  1594. extension D2d_MdmParameters.InactiveIdentityDisplayPolicy: CaseIterable {
  1595. // The compiler won't synthesize support with the UNRECOGNIZED case.
  1596. static var allCases: [D2d_MdmParameters.InactiveIdentityDisplayPolicy] = [
  1597. .showInactive,
  1598. .hideInactive,
  1599. ]
  1600. }
  1601. extension D2d_MdmParameters.UnknownContactPolicy: CaseIterable {
  1602. // The compiler won't synthesize support with the UNRECOGNIZED case.
  1603. static var allCases: [D2d_MdmParameters.UnknownContactPolicy] = [
  1604. .allowUnknown,
  1605. .blockUnknown,
  1606. ]
  1607. }
  1608. extension D2d_MdmParameters.AutoSaveMediaPolicy: CaseIterable {
  1609. // The compiler won't synthesize support with the UNRECOGNIZED case.
  1610. static var allCases: [D2d_MdmParameters.AutoSaveMediaPolicy] = [
  1611. .allowAutoSave,
  1612. .denyAutoSave,
  1613. ]
  1614. }
  1615. extension D2d_MdmParameters.ScreenshotPolicy: CaseIterable {
  1616. // The compiler won't synthesize support with the UNRECOGNIZED case.
  1617. static var allCases: [D2d_MdmParameters.ScreenshotPolicy] = [
  1618. .allowScreenshot,
  1619. .denyScreenshot,
  1620. ]
  1621. }
  1622. extension D2d_MdmParameters.AddContactPolicy: CaseIterable {
  1623. // The compiler won't synthesize support with the UNRECOGNIZED case.
  1624. static var allCases: [D2d_MdmParameters.AddContactPolicy] = [
  1625. .allowAddContact,
  1626. .denyAddContact,
  1627. ]
  1628. }
  1629. extension D2d_MdmParameters.ChatExportPolicy: CaseIterable {
  1630. // The compiler won't synthesize support with the UNRECOGNIZED case.
  1631. static var allCases: [D2d_MdmParameters.ChatExportPolicy] = [
  1632. .allowChatExport,
  1633. .denyChatExport,
  1634. ]
  1635. }
  1636. extension D2d_MdmParameters.BackupPolicy: CaseIterable {
  1637. // The compiler won't synthesize support with the UNRECOGNIZED case.
  1638. static var allCases: [D2d_MdmParameters.BackupPolicy] = [
  1639. .allowBackup,
  1640. .denyBackup,
  1641. ]
  1642. }
  1643. extension D2d_MdmParameters.IdentityExportPolicy: CaseIterable {
  1644. // The compiler won't synthesize support with the UNRECOGNIZED case.
  1645. static var allCases: [D2d_MdmParameters.IdentityExportPolicy] = [
  1646. .allowIdentityExport,
  1647. .denyIdentityExport,
  1648. ]
  1649. }
  1650. extension D2d_MdmParameters.DataBackupPolicy: CaseIterable {
  1651. // The compiler won't synthesize support with the UNRECOGNIZED case.
  1652. static var allCases: [D2d_MdmParameters.DataBackupPolicy] = [
  1653. .allowDataBackup,
  1654. .denyDataBackup,
  1655. ]
  1656. }
  1657. extension D2d_MdmParameters.SystemBackupPolicy: CaseIterable {
  1658. // The compiler won't synthesize support with the UNRECOGNIZED case.
  1659. static var allCases: [D2d_MdmParameters.SystemBackupPolicy] = [
  1660. .allowSystemBackup,
  1661. .denySystemBackup,
  1662. ]
  1663. }
  1664. extension D2d_MdmParameters.MessagePreviewPolicy: CaseIterable {
  1665. // The compiler won't synthesize support with the UNRECOGNIZED case.
  1666. static var allCases: [D2d_MdmParameters.MessagePreviewPolicy] = [
  1667. .allowPreview,
  1668. .denyPreview,
  1669. ]
  1670. }
  1671. extension D2d_MdmParameters.ProfilePictureSharePolicy: CaseIterable {
  1672. // The compiler won't synthesize support with the UNRECOGNIZED case.
  1673. static var allCases: [D2d_MdmParameters.ProfilePictureSharePolicy] = [
  1674. .allowShare,
  1675. .denyShare,
  1676. ]
  1677. }
  1678. extension D2d_MdmParameters.CallPolicy: CaseIterable {
  1679. // The compiler won't synthesize support with the UNRECOGNIZED case.
  1680. static var allCases: [D2d_MdmParameters.CallPolicy] = [
  1681. .allowCall,
  1682. .denyCall,
  1683. ]
  1684. }
  1685. extension D2d_MdmParameters.SetupWizardPolicy: CaseIterable {
  1686. // The compiler won't synthesize support with the UNRECOGNIZED case.
  1687. static var allCases: [D2d_MdmParameters.SetupWizardPolicy] = [
  1688. .showWizard,
  1689. .skipWizard,
  1690. ]
  1691. }
  1692. extension D2d_MdmParameters.CreateGroupPolicy: CaseIterable {
  1693. // The compiler won't synthesize support with the UNRECOGNIZED case.
  1694. static var allCases: [D2d_MdmParameters.CreateGroupPolicy] = [
  1695. .allowCreateGroup,
  1696. .denyCreateGroup,
  1697. ]
  1698. }
  1699. extension D2d_MdmParameters.ShareMediaPolicy: CaseIterable {
  1700. // The compiler won't synthesize support with the UNRECOGNIZED case.
  1701. static var allCases: [D2d_MdmParameters.ShareMediaPolicy] = [
  1702. .allowShareMedia,
  1703. .denyOutsideApp,
  1704. ]
  1705. }
  1706. #endif // swift(>=4.2)
  1707. /// A message receiver can be a single user or a group.
  1708. struct D2d_MessageReceiver {
  1709. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1710. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1711. // methods supported on all messages.
  1712. /// The recipient's Threema ID or a group identity.
  1713. var receiver: D2d_MessageReceiver.OneOf_Receiver? = nil
  1714. var identity: String {
  1715. get {
  1716. if case .identity(let v)? = receiver {return v}
  1717. return String()
  1718. }
  1719. set {receiver = .identity(newValue)}
  1720. }
  1721. var group: Common_GroupIdentity {
  1722. get {
  1723. if case .group(let v)? = receiver {return v}
  1724. return Common_GroupIdentity()
  1725. }
  1726. set {receiver = .group(newValue)}
  1727. }
  1728. var unknownFields = SwiftProtobuf.UnknownStorage()
  1729. /// The recipient's Threema ID or a group identity.
  1730. enum OneOf_Receiver: Equatable {
  1731. case identity(String)
  1732. case group(Common_GroupIdentity)
  1733. #if !swift(>=4.1)
  1734. static func ==(lhs: D2d_MessageReceiver.OneOf_Receiver, rhs: D2d_MessageReceiver.OneOf_Receiver) -> Bool {
  1735. switch (lhs, rhs) {
  1736. case (.identity(let l), .identity(let r)): return l == r
  1737. case (.group(let l), .group(let r)): return l == r
  1738. default: return false
  1739. }
  1740. }
  1741. #endif
  1742. }
  1743. init() {}
  1744. }
  1745. /// An outgoing message, reflected to other devices.
  1746. struct D2d_OutgoingMessage {
  1747. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1748. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1749. // methods supported on all messages.
  1750. /// Recipient of the enclosed message.
  1751. ///
  1752. /// Note: If the receiver is a group identity, group and group creator id of
  1753. /// the enclosed message must match the values of the supplied group
  1754. /// identity. Otherwise, the message must be considered invalid.
  1755. var receiver: D2d_MessageReceiver {
  1756. get {return _receiver ?? D2d_MessageReceiver()}
  1757. set {_receiver = newValue}
  1758. }
  1759. /// Returns true if `receiver` has been explicitly set.
  1760. var hasReceiver: Bool {return self._receiver != nil}
  1761. /// Clears the value of `receiver`. Subsequent reads from it will return its default value.
  1762. mutating func clearReceiver() {self._receiver = nil}
  1763. /// Unique ID of the enclosed message
  1764. var messageID: UInt64 = 0
  1765. /// Unix-ish timestamp in milliseconds for when the message has been created
  1766. var createdAt: UInt64 = 0
  1767. /// Enclosed message's type
  1768. var type: D2d_MessageType = .invalid
  1769. /// The message's body as defined for `Message` (0x01/0x02) of the Chat
  1770. /// Server Protocol.
  1771. var body: Data = SwiftProtobuf.Internal.emptyData
  1772. var unknownFields = SwiftProtobuf.UnknownStorage()
  1773. init() {}
  1774. fileprivate var _receiver: D2d_MessageReceiver? = nil
  1775. }
  1776. /// An outgoing message has been delivered to the chat server.
  1777. ///
  1778. /// Note: This indicates that the message has been successfully stored in the
  1779. /// message queue of the server. It does NOT indicate that the message has
  1780. /// been delivered to the intended receiver.
  1781. struct D2d_OutgoingMessageDelivered {
  1782. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1783. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1784. // methods supported on all messages.
  1785. /// Recipient of the delivered message.
  1786. var receiver: D2d_MessageReceiver {
  1787. get {return _receiver ?? D2d_MessageReceiver()}
  1788. set {_receiver = newValue}
  1789. }
  1790. /// Returns true if `receiver` has been explicitly set.
  1791. var hasReceiver: Bool {return self._receiver != nil}
  1792. /// Clears the value of `receiver`. Subsequent reads from it will return its default value.
  1793. mutating func clearReceiver() {self._receiver = nil}
  1794. /// Unique ID of the delivered message
  1795. var messageID: UInt64 = 0
  1796. var unknownFields = SwiftProtobuf.UnknownStorage()
  1797. init() {}
  1798. fileprivate var _receiver: D2d_MessageReceiver? = nil
  1799. }
  1800. /// An incoming message, reflected to other devices.
  1801. struct D2d_IncomingMessage {
  1802. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1803. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1804. // methods supported on all messages.
  1805. /// Sender's Threema ID
  1806. var senderIdentity: String = String()
  1807. /// Sender's public nickname
  1808. var senderNickname: String = String()
  1809. /// Unique ID of the enclosed message
  1810. var messageID: UInt64 = 0
  1811. /// Unix-ish timestamp in milliseconds for when the message has been created
  1812. var createdAt: UInt64 = 0
  1813. /// Enclosed message's type
  1814. var type: D2d_MessageType = .invalid
  1815. /// The message's body as defined for `Message` (0x01/0x02) of the Chat
  1816. /// Server Protocol.
  1817. var body: Data = SwiftProtobuf.Internal.emptyData
  1818. var unknownFields = SwiftProtobuf.UnknownStorage()
  1819. init() {}
  1820. }
  1821. /// User profile synchronisation message.
  1822. struct D2d_UserProfileSync {
  1823. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1824. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1825. // methods supported on all messages.
  1826. /// Synchronisation type
  1827. var action: D2d_UserProfileSync.OneOf_Action? = nil
  1828. var set: D2d_UserProfileSync.Set {
  1829. get {
  1830. if case .set(let v)? = action {return v}
  1831. return D2d_UserProfileSync.Set()
  1832. }
  1833. set {action = .set(newValue)}
  1834. }
  1835. var unknownFields = SwiftProtobuf.UnknownStorage()
  1836. /// Synchronisation type
  1837. enum OneOf_Action: Equatable {
  1838. case set(D2d_UserProfileSync.Set)
  1839. #if !swift(>=4.1)
  1840. static func ==(lhs: D2d_UserProfileSync.OneOf_Action, rhs: D2d_UserProfileSync.OneOf_Action) -> Bool {
  1841. switch (lhs, rhs) {
  1842. case (.set(let l), .set(let r)): return l == r
  1843. }
  1844. }
  1845. #endif
  1846. }
  1847. /// Update the user's profile
  1848. struct Set {
  1849. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1850. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1851. // methods supported on all messages.
  1852. var userProfile: Safe_UserProfile {
  1853. get {return _userProfile ?? Safe_UserProfile()}
  1854. set {_userProfile = newValue}
  1855. }
  1856. /// Returns true if `userProfile` has been explicitly set.
  1857. var hasUserProfile: Bool {return self._userProfile != nil}
  1858. /// Clears the value of `userProfile`. Subsequent reads from it will return its default value.
  1859. mutating func clearUserProfile() {self._userProfile = nil}
  1860. var unknownFields = SwiftProtobuf.UnknownStorage()
  1861. init() {}
  1862. fileprivate var _userProfile: Safe_UserProfile? = nil
  1863. }
  1864. init() {}
  1865. }
  1866. /// Contact synchronisation message.
  1867. struct D2d_ContactSync {
  1868. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1869. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1870. // methods supported on all messages.
  1871. /// Synchronisation type
  1872. var action: D2d_ContactSync.OneOf_Action? = nil
  1873. var set: D2d_ContactSync.Set {
  1874. get {
  1875. if case .set(let v)? = action {return v}
  1876. return D2d_ContactSync.Set()
  1877. }
  1878. set {action = .set(newValue)}
  1879. }
  1880. var delete: D2d_ContactSync.Delete {
  1881. get {
  1882. if case .delete(let v)? = action {return v}
  1883. return D2d_ContactSync.Delete()
  1884. }
  1885. set {action = .delete(newValue)}
  1886. }
  1887. var unknownFields = SwiftProtobuf.UnknownStorage()
  1888. /// Synchronisation type
  1889. enum OneOf_Action: Equatable {
  1890. case set(D2d_ContactSync.Set)
  1891. case delete(D2d_ContactSync.Delete)
  1892. #if !swift(>=4.1)
  1893. static func ==(lhs: D2d_ContactSync.OneOf_Action, rhs: D2d_ContactSync.OneOf_Action) -> Bool {
  1894. switch (lhs, rhs) {
  1895. case (.set(let l), .set(let r)): return l == r
  1896. case (.delete(let l), .delete(let r)): return l == r
  1897. default: return false
  1898. }
  1899. }
  1900. #endif
  1901. }
  1902. /// Set a Threema contact
  1903. struct Set {
  1904. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1905. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1906. // methods supported on all messages.
  1907. var contact: Safe_Contact {
  1908. get {return _contact ?? Safe_Contact()}
  1909. set {_contact = newValue}
  1910. }
  1911. /// Returns true if `contact` has been explicitly set.
  1912. var hasContact: Bool {return self._contact != nil}
  1913. /// Clears the value of `contact`. Subsequent reads from it will return its default value.
  1914. mutating func clearContact() {self._contact = nil}
  1915. var unknownFields = SwiftProtobuf.UnknownStorage()
  1916. init() {}
  1917. fileprivate var _contact: Safe_Contact? = nil
  1918. }
  1919. /// Delete a Threema contact
  1920. struct Delete {
  1921. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1922. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1923. // methods supported on all messages.
  1924. var deleteIdentity: String = String()
  1925. var unknownFields = SwiftProtobuf.UnknownStorage()
  1926. init() {}
  1927. }
  1928. init() {}
  1929. }
  1930. /// Group synchronisation message.
  1931. struct D2d_GroupSync {
  1932. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1933. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1934. // methods supported on all messages.
  1935. /// Synchronisation type
  1936. var action: D2d_GroupSync.OneOf_Action? = nil
  1937. var set: D2d_GroupSync.Set {
  1938. get {
  1939. if case .set(let v)? = action {return v}
  1940. return D2d_GroupSync.Set()
  1941. }
  1942. set {action = .set(newValue)}
  1943. }
  1944. var delete: D2d_GroupSync.Delete {
  1945. get {
  1946. if case .delete(let v)? = action {return v}
  1947. return D2d_GroupSync.Delete()
  1948. }
  1949. set {action = .delete(newValue)}
  1950. }
  1951. var unknownFields = SwiftProtobuf.UnknownStorage()
  1952. /// Synchronisation type
  1953. enum OneOf_Action: Equatable {
  1954. case set(D2d_GroupSync.Set)
  1955. case delete(D2d_GroupSync.Delete)
  1956. #if !swift(>=4.1)
  1957. static func ==(lhs: D2d_GroupSync.OneOf_Action, rhs: D2d_GroupSync.OneOf_Action) -> Bool {
  1958. switch (lhs, rhs) {
  1959. case (.set(let l), .set(let r)): return l == r
  1960. case (.delete(let l), .delete(let r)): return l == r
  1961. default: return false
  1962. }
  1963. }
  1964. #endif
  1965. }
  1966. /// Set a group
  1967. struct Set {
  1968. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1969. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1970. // methods supported on all messages.
  1971. var group: Safe_Group {
  1972. get {return _group ?? Safe_Group()}
  1973. set {_group = newValue}
  1974. }
  1975. /// Returns true if `group` has been explicitly set.
  1976. var hasGroup: Bool {return self._group != nil}
  1977. /// Clears the value of `group`. Subsequent reads from it will return its default value.
  1978. mutating func clearGroup() {self._group = nil}
  1979. var unknownFields = SwiftProtobuf.UnknownStorage()
  1980. init() {}
  1981. fileprivate var _group: Safe_Group? = nil
  1982. }
  1983. /// Delete a group
  1984. struct Delete {
  1985. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1986. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1987. // methods supported on all messages.
  1988. /// Unique group identity
  1989. var groupIdentity: Common_GroupIdentity {
  1990. get {return _groupIdentity ?? Common_GroupIdentity()}
  1991. set {_groupIdentity = newValue}
  1992. }
  1993. /// Returns true if `groupIdentity` has been explicitly set.
  1994. var hasGroupIdentity: Bool {return self._groupIdentity != nil}
  1995. /// Clears the value of `groupIdentity`. Subsequent reads from it will return its default value.
  1996. mutating func clearGroupIdentity() {self._groupIdentity = nil}
  1997. var unknownFields = SwiftProtobuf.UnknownStorage()
  1998. init() {}
  1999. fileprivate var _groupIdentity: Common_GroupIdentity? = nil
  2000. }
  2001. init() {}
  2002. }
  2003. /// Distribution list synchronisation message.
  2004. struct D2d_DistributionListSync {
  2005. // SwiftProtobuf.Message conformance is added in an extension below. See the
  2006. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  2007. // methods supported on all messages.
  2008. /// Synchronisation type
  2009. var action: D2d_DistributionListSync.OneOf_Action? = nil
  2010. var set: D2d_DistributionListSync.Set {
  2011. get {
  2012. if case .set(let v)? = action {return v}
  2013. return D2d_DistributionListSync.Set()
  2014. }
  2015. set {action = .set(newValue)}
  2016. }
  2017. var delete: D2d_DistributionListSync.Delete {
  2018. get {
  2019. if case .delete(let v)? = action {return v}
  2020. return D2d_DistributionListSync.Delete()
  2021. }
  2022. set {action = .delete(newValue)}
  2023. }
  2024. var unknownFields = SwiftProtobuf.UnknownStorage()
  2025. /// Synchronisation type
  2026. enum OneOf_Action: Equatable {
  2027. case set(D2d_DistributionListSync.Set)
  2028. case delete(D2d_DistributionListSync.Delete)
  2029. #if !swift(>=4.1)
  2030. static func ==(lhs: D2d_DistributionListSync.OneOf_Action, rhs: D2d_DistributionListSync.OneOf_Action) -> Bool {
  2031. switch (lhs, rhs) {
  2032. case (.set(let l), .set(let r)): return l == r
  2033. case (.delete(let l), .delete(let r)): return l == r
  2034. default: return false
  2035. }
  2036. }
  2037. #endif
  2038. }
  2039. /// Set a distribution list
  2040. struct Set {
  2041. // SwiftProtobuf.Message conformance is added in an extension below. See the
  2042. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  2043. // methods supported on all messages.
  2044. var distributionList: Safe_DistributionList {
  2045. get {return _distributionList ?? Safe_DistributionList()}
  2046. set {_distributionList = newValue}
  2047. }
  2048. /// Returns true if `distributionList` has been explicitly set.
  2049. var hasDistributionList: Bool {return self._distributionList != nil}
  2050. /// Clears the value of `distributionList`. Subsequent reads from it will return its default value.
  2051. mutating func clearDistributionList() {self._distributionList = nil}
  2052. var unknownFields = SwiftProtobuf.UnknownStorage()
  2053. init() {}
  2054. fileprivate var _distributionList: Safe_DistributionList? = nil
  2055. }
  2056. /// Delete a group
  2057. struct Delete {
  2058. // SwiftProtobuf.Message conformance is added in an extension below. See the
  2059. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  2060. // methods supported on all messages.
  2061. /// Unique ID of the distribution list
  2062. var distributionListID: UInt64 = 0
  2063. var unknownFields = SwiftProtobuf.UnknownStorage()
  2064. init() {}
  2065. }
  2066. init() {}
  2067. }
  2068. /// Settings synchronisation message.
  2069. struct D2d_SettingsSync {
  2070. // SwiftProtobuf.Message conformance is added in an extension below. See the
  2071. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  2072. // methods supported on all messages.
  2073. /// Synchronisation type
  2074. var action: D2d_SettingsSync.OneOf_Action? = nil
  2075. var set: D2d_SettingsSync.Set {
  2076. get {
  2077. if case .set(let v)? = action {return v}
  2078. return D2d_SettingsSync.Set()
  2079. }
  2080. set {action = .set(newValue)}
  2081. }
  2082. var unknownFields = SwiftProtobuf.UnknownStorage()
  2083. /// Synchronisation type
  2084. enum OneOf_Action: Equatable {
  2085. case set(D2d_SettingsSync.Set)
  2086. #if !swift(>=4.1)
  2087. static func ==(lhs: D2d_SettingsSync.OneOf_Action, rhs: D2d_SettingsSync.OneOf_Action) -> Bool {
  2088. switch (lhs, rhs) {
  2089. case (.set(let l), .set(let r)): return l == r
  2090. }
  2091. }
  2092. #endif
  2093. }
  2094. /// Apply settings
  2095. struct Set {
  2096. // SwiftProtobuf.Message conformance is added in an extension below. See the
  2097. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  2098. // methods supported on all messages.
  2099. var settings: Safe_Settings {
  2100. get {return _settings ?? Safe_Settings()}
  2101. set {_settings = newValue}
  2102. }
  2103. /// Returns true if `settings` has been explicitly set.
  2104. var hasSettings: Bool {return self._settings != nil}
  2105. /// Clears the value of `settings`. Subsequent reads from it will return its default value.
  2106. mutating func clearSettings() {self._settings = nil}
  2107. var unknownFields = SwiftProtobuf.UnknownStorage()
  2108. init() {}
  2109. fileprivate var _settings: Safe_Settings? = nil
  2110. }
  2111. init() {}
  2112. }
  2113. // MARK: - Code below here is support for the SwiftProtobuf runtime.
  2114. fileprivate let _protobuf_package = "d2d"
  2115. extension D2d_MessageType: SwiftProtobuf._ProtoNameProviding {
  2116. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2117. 0: .same(proto: "INVALID"),
  2118. 1: .same(proto: "TEXT"),
  2119. 2: .same(proto: "IMAGE"),
  2120. 16: .same(proto: "LOCATION"),
  2121. 19: .same(proto: "VIDEO"),
  2122. 20: .same(proto: "AUDIO"),
  2123. 21: .same(proto: "POLL_CREATE"),
  2124. 22: .same(proto: "POLL_VOTE"),
  2125. 23: .same(proto: "FILE"),
  2126. 24: .same(proto: "CONTACT_SET_PROFILE_PICTURE"),
  2127. 25: .same(proto: "CONTACT_DELETE_PROFILE_PICTURE"),
  2128. 26: .same(proto: "CONTACT_REQUEST_PROFILE_PICTURE"),
  2129. 65: .same(proto: "GROUP_TEXT"),
  2130. 66: .same(proto: "GROUP_LOCATION"),
  2131. 67: .same(proto: "GROUP_IMAGE"),
  2132. 68: .same(proto: "GROUP_VIDEO"),
  2133. 69: .same(proto: "GROUP_AUDIO"),
  2134. 70: .same(proto: "GROUP_FILE"),
  2135. 74: .same(proto: "GROUP_CREATE"),
  2136. 75: .same(proto: "GROUP_RENAME"),
  2137. 76: .same(proto: "GROUP_LEAVE"),
  2138. 80: .same(proto: "GROUP_SET_PROFILE_PICTURE"),
  2139. 81: .same(proto: "GROUP_REQUEST_SYNC"),
  2140. 82: .same(proto: "GROUP_POLL_CREATE"),
  2141. 83: .same(proto: "GROUP_POLL_VOTE"),
  2142. 84: .same(proto: "GROUP_DELETE_PROFILE_PICTURE"),
  2143. 96: .same(proto: "CALL_OFFER"),
  2144. 97: .same(proto: "CALL_ANSWER"),
  2145. 98: .same(proto: "CALL_ICE_CANDIDATE"),
  2146. 99: .same(proto: "CALL_HANGUP"),
  2147. 100: .same(proto: "CALL_RINGING"),
  2148. 101: .same(proto: "CALL_MISSED"),
  2149. 128: .same(proto: "DELIVERY_RECEIPT"),
  2150. 144: .same(proto: "TYPING_INDICATOR"),
  2151. ]
  2152. }
  2153. extension D2d_InitialData: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2154. static let protoMessageName: String = _protobuf_package + ".InitialData"
  2155. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2156. 1: .same(proto: "backup"),
  2157. ]
  2158. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2159. while let fieldNumber = try decoder.nextFieldNumber() {
  2160. switch fieldNumber {
  2161. case 1: try decoder.decodeSingularMessageField(value: &self._backup)
  2162. default: break
  2163. }
  2164. }
  2165. }
  2166. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2167. if let v = self._backup {
  2168. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  2169. }
  2170. try unknownFields.traverse(visitor: &visitor)
  2171. }
  2172. static func ==(lhs: D2d_InitialData, rhs: D2d_InitialData) -> Bool {
  2173. if lhs._backup != rhs._backup {return false}
  2174. if lhs.unknownFields != rhs.unknownFields {return false}
  2175. return true
  2176. }
  2177. }
  2178. extension D2d_SharedDeviceData: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2179. static let protoMessageName: String = _protobuf_package + ".SharedDeviceData"
  2180. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2181. 1: .same(proto: "padding"),
  2182. 2: .standard(proto: "mdm_parameters"),
  2183. ]
  2184. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2185. while let fieldNumber = try decoder.nextFieldNumber() {
  2186. switch fieldNumber {
  2187. case 1: try decoder.decodeSingularBytesField(value: &self.padding)
  2188. case 2: try decoder.decodeSingularMessageField(value: &self._mdmParameters)
  2189. default: break
  2190. }
  2191. }
  2192. }
  2193. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2194. if !self.padding.isEmpty {
  2195. try visitor.visitSingularBytesField(value: self.padding, fieldNumber: 1)
  2196. }
  2197. if let v = self._mdmParameters {
  2198. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  2199. }
  2200. try unknownFields.traverse(visitor: &visitor)
  2201. }
  2202. static func ==(lhs: D2d_SharedDeviceData, rhs: D2d_SharedDeviceData) -> Bool {
  2203. if lhs.padding != rhs.padding {return false}
  2204. if lhs._mdmParameters != rhs._mdmParameters {return false}
  2205. if lhs.unknownFields != rhs.unknownFields {return false}
  2206. return true
  2207. }
  2208. }
  2209. extension D2d_DeviceInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2210. static let protoMessageName: String = _protobuf_package + ".DeviceInfo"
  2211. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2212. 1: .same(proto: "padding"),
  2213. 2: .same(proto: "platform"),
  2214. 3: .standard(proto: "app_version"),
  2215. 4: .same(proto: "description"),
  2216. ]
  2217. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2218. while let fieldNumber = try decoder.nextFieldNumber() {
  2219. switch fieldNumber {
  2220. case 1: try decoder.decodeSingularBytesField(value: &self.padding)
  2221. case 2: try decoder.decodeSingularEnumField(value: &self.platform)
  2222. case 3: try decoder.decodeSingularStringField(value: &self.appVersion)
  2223. case 4: try decoder.decodeSingularStringField(value: &self.description_p)
  2224. default: break
  2225. }
  2226. }
  2227. }
  2228. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2229. if !self.padding.isEmpty {
  2230. try visitor.visitSingularBytesField(value: self.padding, fieldNumber: 1)
  2231. }
  2232. if self.platform != .unspecified {
  2233. try visitor.visitSingularEnumField(value: self.platform, fieldNumber: 2)
  2234. }
  2235. if !self.appVersion.isEmpty {
  2236. try visitor.visitSingularStringField(value: self.appVersion, fieldNumber: 3)
  2237. }
  2238. if !self.description_p.isEmpty {
  2239. try visitor.visitSingularStringField(value: self.description_p, fieldNumber: 4)
  2240. }
  2241. try unknownFields.traverse(visitor: &visitor)
  2242. }
  2243. static func ==(lhs: D2d_DeviceInfo, rhs: D2d_DeviceInfo) -> Bool {
  2244. if lhs.padding != rhs.padding {return false}
  2245. if lhs.platform != rhs.platform {return false}
  2246. if lhs.appVersion != rhs.appVersion {return false}
  2247. if lhs.description_p != rhs.description_p {return false}
  2248. if lhs.unknownFields != rhs.unknownFields {return false}
  2249. return true
  2250. }
  2251. }
  2252. extension D2d_DeviceInfo.Platform: SwiftProtobuf._ProtoNameProviding {
  2253. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2254. 0: .same(proto: "UNSPECIFIED"),
  2255. 1: .same(proto: "ANDROID"),
  2256. 2: .same(proto: "IOS"),
  2257. 3: .same(proto: "WEB"),
  2258. ]
  2259. }
  2260. extension D2d_TransactionScope: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2261. static let protoMessageName: String = _protobuf_package + ".TransactionScope"
  2262. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2263. 1: .same(proto: "scope"),
  2264. ]
  2265. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2266. while let fieldNumber = try decoder.nextFieldNumber() {
  2267. switch fieldNumber {
  2268. case 1: try decoder.decodeSingularEnumField(value: &self.scope)
  2269. default: break
  2270. }
  2271. }
  2272. }
  2273. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2274. if self.scope != .userProfileSync {
  2275. try visitor.visitSingularEnumField(value: self.scope, fieldNumber: 1)
  2276. }
  2277. try unknownFields.traverse(visitor: &visitor)
  2278. }
  2279. static func ==(lhs: D2d_TransactionScope, rhs: D2d_TransactionScope) -> Bool {
  2280. if lhs.scope != rhs.scope {return false}
  2281. if lhs.unknownFields != rhs.unknownFields {return false}
  2282. return true
  2283. }
  2284. }
  2285. extension D2d_TransactionScope.Scope: SwiftProtobuf._ProtoNameProviding {
  2286. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2287. 0: .same(proto: "USER_PROFILE_SYNC"),
  2288. 1: .same(proto: "CONTACT_SYNC"),
  2289. 2: .same(proto: "GROUP_SYNC"),
  2290. 3: .same(proto: "DISTRIBUTION_LIST_SYNC"),
  2291. 4: .same(proto: "SETTINGS_SYNC"),
  2292. ]
  2293. }
  2294. extension D2d_Envelope: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2295. static let protoMessageName: String = _protobuf_package + ".Envelope"
  2296. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2297. 1: .same(proto: "padding"),
  2298. 2: .standard(proto: "outgoing_message"),
  2299. 3: .standard(proto: "incoming_message"),
  2300. 4: .standard(proto: "user_profile_sync"),
  2301. 5: .standard(proto: "contact_sync"),
  2302. 6: .standard(proto: "group_sync"),
  2303. 7: .standard(proto: "distribution_list_sync"),
  2304. 8: .standard(proto: "settings_sync"),
  2305. 9999: .standard(proto: "mdm_parameters"),
  2306. ]
  2307. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2308. while let fieldNumber = try decoder.nextFieldNumber() {
  2309. switch fieldNumber {
  2310. case 1: try decoder.decodeSingularBytesField(value: &self.padding)
  2311. case 2:
  2312. var v: D2d_OutgoingMessage?
  2313. if let current = self.content {
  2314. try decoder.handleConflictingOneOf()
  2315. if case .outgoingMessage(let m) = current {v = m}
  2316. }
  2317. try decoder.decodeSingularMessageField(value: &v)
  2318. if let v = v {self.content = .outgoingMessage(v)}
  2319. case 3:
  2320. var v: D2d_IncomingMessage?
  2321. if let current = self.content {
  2322. try decoder.handleConflictingOneOf()
  2323. if case .incomingMessage(let m) = current {v = m}
  2324. }
  2325. try decoder.decodeSingularMessageField(value: &v)
  2326. if let v = v {self.content = .incomingMessage(v)}
  2327. case 4:
  2328. var v: D2d_UserProfileSync?
  2329. if let current = self.content {
  2330. try decoder.handleConflictingOneOf()
  2331. if case .userProfileSync(let m) = current {v = m}
  2332. }
  2333. try decoder.decodeSingularMessageField(value: &v)
  2334. if let v = v {self.content = .userProfileSync(v)}
  2335. case 5:
  2336. var v: D2d_ContactSync?
  2337. if let current = self.content {
  2338. try decoder.handleConflictingOneOf()
  2339. if case .contactSync(let m) = current {v = m}
  2340. }
  2341. try decoder.decodeSingularMessageField(value: &v)
  2342. if let v = v {self.content = .contactSync(v)}
  2343. case 6:
  2344. var v: D2d_GroupSync?
  2345. if let current = self.content {
  2346. try decoder.handleConflictingOneOf()
  2347. if case .groupSync(let m) = current {v = m}
  2348. }
  2349. try decoder.decodeSingularMessageField(value: &v)
  2350. if let v = v {self.content = .groupSync(v)}
  2351. case 7:
  2352. var v: D2d_DistributionListSync?
  2353. if let current = self.content {
  2354. try decoder.handleConflictingOneOf()
  2355. if case .distributionListSync(let m) = current {v = m}
  2356. }
  2357. try decoder.decodeSingularMessageField(value: &v)
  2358. if let v = v {self.content = .distributionListSync(v)}
  2359. case 8:
  2360. var v: D2d_SettingsSync?
  2361. if let current = self.content {
  2362. try decoder.handleConflictingOneOf()
  2363. if case .settingsSync(let m) = current {v = m}
  2364. }
  2365. try decoder.decodeSingularMessageField(value: &v)
  2366. if let v = v {self.content = .settingsSync(v)}
  2367. case 9999:
  2368. var v: D2d_MdmParameters?
  2369. if let current = self.content {
  2370. try decoder.handleConflictingOneOf()
  2371. if case .mdmParameters(let m) = current {v = m}
  2372. }
  2373. try decoder.decodeSingularMessageField(value: &v)
  2374. if let v = v {self.content = .mdmParameters(v)}
  2375. default: break
  2376. }
  2377. }
  2378. }
  2379. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2380. if !self.padding.isEmpty {
  2381. try visitor.visitSingularBytesField(value: self.padding, fieldNumber: 1)
  2382. }
  2383. switch self.content {
  2384. case .outgoingMessage(let v)?:
  2385. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  2386. case .incomingMessage(let v)?:
  2387. try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
  2388. case .userProfileSync(let v)?:
  2389. try visitor.visitSingularMessageField(value: v, fieldNumber: 4)
  2390. case .contactSync(let v)?:
  2391. try visitor.visitSingularMessageField(value: v, fieldNumber: 5)
  2392. case .groupSync(let v)?:
  2393. try visitor.visitSingularMessageField(value: v, fieldNumber: 6)
  2394. case .distributionListSync(let v)?:
  2395. try visitor.visitSingularMessageField(value: v, fieldNumber: 7)
  2396. case .settingsSync(let v)?:
  2397. try visitor.visitSingularMessageField(value: v, fieldNumber: 8)
  2398. case .mdmParameters(let v)?:
  2399. try visitor.visitSingularMessageField(value: v, fieldNumber: 9999)
  2400. case nil: break
  2401. }
  2402. try unknownFields.traverse(visitor: &visitor)
  2403. }
  2404. static func ==(lhs: D2d_Envelope, rhs: D2d_Envelope) -> Bool {
  2405. if lhs.padding != rhs.padding {return false}
  2406. if lhs.content != rhs.content {return false}
  2407. if lhs.unknownFields != rhs.unknownFields {return false}
  2408. return true
  2409. }
  2410. }
  2411. extension D2d_MdmParameters: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2412. static let protoMessageName: String = _protobuf_package + ".MdmParameters"
  2413. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2414. 1: .standard(proto: "license_username_value"),
  2415. 2: .standard(proto: "license_password_value"),
  2416. 3: .standard(proto: "nickname_value"),
  2417. 4: .standard(proto: "first_name_value"),
  2418. 5: .standard(proto: "last_name_value"),
  2419. 6: .standard(proto: "customer_specific_id_value"),
  2420. 7: .standard(proto: "category_value"),
  2421. 8: .standard(proto: "linked_email_value"),
  2422. 9: .standard(proto: "linked_phone_value"),
  2423. 10: .standard(proto: "identity_restore_value"),
  2424. 11: .standard(proto: "identity_restore_password_value"),
  2425. 12: .standard(proto: "threema_safe_policy"),
  2426. 13: .standard(proto: "threema_safe_password_value"),
  2427. 14: .standard(proto: "threema_safe_password_pattern_value"),
  2428. 15: .standard(proto: "threema_safe_password_pattern_error_message_value"),
  2429. 16: .standard(proto: "threema_safe_server_url_value"),
  2430. 17: .standard(proto: "threema_safe_server_username_value"),
  2431. 18: .standard(proto: "threema_safe_server_password_value"),
  2432. 19: .standard(proto: "threema_safe_restore_policy"),
  2433. 20: .standard(proto: "threema_safe_restore_identity_value"),
  2434. 21: .standard(proto: "override_policy"),
  2435. 22: .standard(proto: "contact_sync_policy"),
  2436. 23: .standard(proto: "inactive_identity_display_policy"),
  2437. 24: .standard(proto: "unknown_contact_policy"),
  2438. 25: .standard(proto: "auto_save_media_policy"),
  2439. 26: .standard(proto: "screenshot_policy"),
  2440. 27: .standard(proto: "add_contact_policy"),
  2441. 28: .standard(proto: "chat_export_policy"),
  2442. 29: .standard(proto: "backup_policy"),
  2443. 30: .standard(proto: "identity_export_policy"),
  2444. 31: .standard(proto: "data_backup_policy"),
  2445. 32: .standard(proto: "system_backup_policy"),
  2446. 33: .standard(proto: "message_preview_policy"),
  2447. 34: .standard(proto: "profile_picture_share_policy"),
  2448. 35: .standard(proto: "call_policy"),
  2449. 36: .standard(proto: "setup_wizard_policy"),
  2450. 37: .standard(proto: "create_group_policy"),
  2451. 38: .standard(proto: "share_media_policy"),
  2452. ]
  2453. fileprivate class _StorageClass {
  2454. var _licenseUsername: D2d_MdmParameters.OneOf_LicenseUsername?
  2455. var _licensePassword: D2d_MdmParameters.OneOf_LicensePassword?
  2456. var _nickname: D2d_MdmParameters.OneOf_Nickname?
  2457. var _firstName: D2d_MdmParameters.OneOf_FirstName?
  2458. var _lastName: D2d_MdmParameters.OneOf_LastName?
  2459. var _customerSpecificID: D2d_MdmParameters.OneOf_CustomerSpecificID?
  2460. var _category: D2d_MdmParameters.OneOf_Category?
  2461. var _linkedEmail: D2d_MdmParameters.OneOf_LinkedEmail?
  2462. var _linkedPhone: D2d_MdmParameters.OneOf_LinkedPhone?
  2463. var _identityRestore: D2d_MdmParameters.OneOf_IdentityRestore?
  2464. var _identityRestorePassword: D2d_MdmParameters.OneOf_IdentityRestorePassword?
  2465. var _threemaSafePolicy: D2d_MdmParameters.ThreemaSafePolicy = .safeOptional
  2466. var _threemaSafePassword: D2d_MdmParameters.OneOf_ThreemaSafePassword?
  2467. var _threemaSafePasswordPattern: D2d_MdmParameters.OneOf_ThreemaSafePasswordPattern?
  2468. var _threemaSafePasswordPatternErrorMessage: D2d_MdmParameters.OneOf_ThreemaSafePasswordPatternErrorMessage?
  2469. var _threemaSafeServerURL: D2d_MdmParameters.OneOf_ThreemaSafeServerURL?
  2470. var _threemaSafeServerUsername: D2d_MdmParameters.OneOf_ThreemaSafeServerUsername?
  2471. var _threemaSafeServerPassword: D2d_MdmParameters.OneOf_ThreemaSafeServerPassword?
  2472. var _threemaSafeRestorePolicy: D2d_MdmParameters.ThreemaSafeRestorePolicy = .safeRestoreOptional
  2473. var _threemaSafeRestoreIdentity: D2d_MdmParameters.OneOf_ThreemaSafeRestoreIdentity?
  2474. var _overridePolicy: D2d_MdmParameters.OverridePolicy = .loose
  2475. var _contactSyncPolicy: D2d_MdmParameters.ContactSyncPolicy = .notSynced
  2476. var _inactiveIdentityDisplayPolicy: D2d_MdmParameters.InactiveIdentityDisplayPolicy = .showInactive
  2477. var _unknownContactPolicy: D2d_MdmParameters.UnknownContactPolicy = .allowUnknown
  2478. var _autoSaveMediaPolicy: D2d_MdmParameters.AutoSaveMediaPolicy = .allowAutoSave
  2479. var _screenshotPolicy: D2d_MdmParameters.ScreenshotPolicy = .allowScreenshot
  2480. var _addContactPolicy: D2d_MdmParameters.AddContactPolicy = .allowAddContact
  2481. var _chatExportPolicy: D2d_MdmParameters.ChatExportPolicy = .allowChatExport
  2482. var _backupPolicy: D2d_MdmParameters.BackupPolicy = .allowBackup
  2483. var _identityExportPolicy: D2d_MdmParameters.IdentityExportPolicy = .allowIdentityExport
  2484. var _dataBackupPolicy: D2d_MdmParameters.DataBackupPolicy = .allowDataBackup
  2485. var _systemBackupPolicy: D2d_MdmParameters.SystemBackupPolicy = .allowSystemBackup
  2486. var _messagePreviewPolicy: D2d_MdmParameters.MessagePreviewPolicy = .allowPreview
  2487. var _profilePictureSharePolicy: D2d_MdmParameters.ProfilePictureSharePolicy = .allowShare
  2488. var _callPolicy: D2d_MdmParameters.CallPolicy = .allowCall
  2489. var _setupWizardPolicy: D2d_MdmParameters.SetupWizardPolicy = .showWizard
  2490. var _createGroupPolicy: D2d_MdmParameters.CreateGroupPolicy = .allowCreateGroup
  2491. var _shareMediaPolicy: D2d_MdmParameters.ShareMediaPolicy = .allowShareMedia
  2492. static let defaultInstance = _StorageClass()
  2493. private init() {}
  2494. init(copying source: _StorageClass) {
  2495. _licenseUsername = source._licenseUsername
  2496. _licensePassword = source._licensePassword
  2497. _nickname = source._nickname
  2498. _firstName = source._firstName
  2499. _lastName = source._lastName
  2500. _customerSpecificID = source._customerSpecificID
  2501. _category = source._category
  2502. _linkedEmail = source._linkedEmail
  2503. _linkedPhone = source._linkedPhone
  2504. _identityRestore = source._identityRestore
  2505. _identityRestorePassword = source._identityRestorePassword
  2506. _threemaSafePolicy = source._threemaSafePolicy
  2507. _threemaSafePassword = source._threemaSafePassword
  2508. _threemaSafePasswordPattern = source._threemaSafePasswordPattern
  2509. _threemaSafePasswordPatternErrorMessage = source._threemaSafePasswordPatternErrorMessage
  2510. _threemaSafeServerURL = source._threemaSafeServerURL
  2511. _threemaSafeServerUsername = source._threemaSafeServerUsername
  2512. _threemaSafeServerPassword = source._threemaSafeServerPassword
  2513. _threemaSafeRestorePolicy = source._threemaSafeRestorePolicy
  2514. _threemaSafeRestoreIdentity = source._threemaSafeRestoreIdentity
  2515. _overridePolicy = source._overridePolicy
  2516. _contactSyncPolicy = source._contactSyncPolicy
  2517. _inactiveIdentityDisplayPolicy = source._inactiveIdentityDisplayPolicy
  2518. _unknownContactPolicy = source._unknownContactPolicy
  2519. _autoSaveMediaPolicy = source._autoSaveMediaPolicy
  2520. _screenshotPolicy = source._screenshotPolicy
  2521. _addContactPolicy = source._addContactPolicy
  2522. _chatExportPolicy = source._chatExportPolicy
  2523. _backupPolicy = source._backupPolicy
  2524. _identityExportPolicy = source._identityExportPolicy
  2525. _dataBackupPolicy = source._dataBackupPolicy
  2526. _systemBackupPolicy = source._systemBackupPolicy
  2527. _messagePreviewPolicy = source._messagePreviewPolicy
  2528. _profilePictureSharePolicy = source._profilePictureSharePolicy
  2529. _callPolicy = source._callPolicy
  2530. _setupWizardPolicy = source._setupWizardPolicy
  2531. _createGroupPolicy = source._createGroupPolicy
  2532. _shareMediaPolicy = source._shareMediaPolicy
  2533. }
  2534. }
  2535. fileprivate mutating func _uniqueStorage() -> _StorageClass {
  2536. if !isKnownUniquelyReferenced(&_storage) {
  2537. _storage = _StorageClass(copying: _storage)
  2538. }
  2539. return _storage
  2540. }
  2541. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2542. _ = _uniqueStorage()
  2543. try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
  2544. while let fieldNumber = try decoder.nextFieldNumber() {
  2545. switch fieldNumber {
  2546. case 1:
  2547. if _storage._licenseUsername != nil {try decoder.handleConflictingOneOf()}
  2548. var v: String?
  2549. try decoder.decodeSingularStringField(value: &v)
  2550. if let v = v {_storage._licenseUsername = .licenseUsernameValue(v)}
  2551. case 2:
  2552. if _storage._licensePassword != nil {try decoder.handleConflictingOneOf()}
  2553. var v: String?
  2554. try decoder.decodeSingularStringField(value: &v)
  2555. if let v = v {_storage._licensePassword = .licensePasswordValue(v)}
  2556. case 3:
  2557. if _storage._nickname != nil {try decoder.handleConflictingOneOf()}
  2558. var v: String?
  2559. try decoder.decodeSingularStringField(value: &v)
  2560. if let v = v {_storage._nickname = .nicknameValue(v)}
  2561. case 4:
  2562. if _storage._firstName != nil {try decoder.handleConflictingOneOf()}
  2563. var v: String?
  2564. try decoder.decodeSingularStringField(value: &v)
  2565. if let v = v {_storage._firstName = .firstNameValue(v)}
  2566. case 5:
  2567. if _storage._lastName != nil {try decoder.handleConflictingOneOf()}
  2568. var v: String?
  2569. try decoder.decodeSingularStringField(value: &v)
  2570. if let v = v {_storage._lastName = .lastNameValue(v)}
  2571. case 6:
  2572. if _storage._customerSpecificID != nil {try decoder.handleConflictingOneOf()}
  2573. var v: String?
  2574. try decoder.decodeSingularStringField(value: &v)
  2575. if let v = v {_storage._customerSpecificID = .customerSpecificIDValue(v)}
  2576. case 7:
  2577. if _storage._category != nil {try decoder.handleConflictingOneOf()}
  2578. var v: String?
  2579. try decoder.decodeSingularStringField(value: &v)
  2580. if let v = v {_storage._category = .categoryValue(v)}
  2581. case 8:
  2582. if _storage._linkedEmail != nil {try decoder.handleConflictingOneOf()}
  2583. var v: String?
  2584. try decoder.decodeSingularStringField(value: &v)
  2585. if let v = v {_storage._linkedEmail = .linkedEmailValue(v)}
  2586. case 9:
  2587. if _storage._linkedPhone != nil {try decoder.handleConflictingOneOf()}
  2588. var v: String?
  2589. try decoder.decodeSingularStringField(value: &v)
  2590. if let v = v {_storage._linkedPhone = .linkedPhoneValue(v)}
  2591. case 10:
  2592. if _storage._identityRestore != nil {try decoder.handleConflictingOneOf()}
  2593. var v: String?
  2594. try decoder.decodeSingularStringField(value: &v)
  2595. if let v = v {_storage._identityRestore = .identityRestoreValue(v)}
  2596. case 11:
  2597. if _storage._identityRestorePassword != nil {try decoder.handleConflictingOneOf()}
  2598. var v: String?
  2599. try decoder.decodeSingularStringField(value: &v)
  2600. if let v = v {_storage._identityRestorePassword = .identityRestorePasswordValue(v)}
  2601. case 12: try decoder.decodeSingularEnumField(value: &_storage._threemaSafePolicy)
  2602. case 13:
  2603. if _storage._threemaSafePassword != nil {try decoder.handleConflictingOneOf()}
  2604. var v: String?
  2605. try decoder.decodeSingularStringField(value: &v)
  2606. if let v = v {_storage._threemaSafePassword = .threemaSafePasswordValue(v)}
  2607. case 14:
  2608. if _storage._threemaSafePasswordPattern != nil {try decoder.handleConflictingOneOf()}
  2609. var v: String?
  2610. try decoder.decodeSingularStringField(value: &v)
  2611. if let v = v {_storage._threemaSafePasswordPattern = .threemaSafePasswordPatternValue(v)}
  2612. case 15:
  2613. if _storage._threemaSafePasswordPatternErrorMessage != nil {try decoder.handleConflictingOneOf()}
  2614. var v: String?
  2615. try decoder.decodeSingularStringField(value: &v)
  2616. if let v = v {_storage._threemaSafePasswordPatternErrorMessage = .threemaSafePasswordPatternErrorMessageValue(v)}
  2617. case 16:
  2618. if _storage._threemaSafeServerURL != nil {try decoder.handleConflictingOneOf()}
  2619. var v: String?
  2620. try decoder.decodeSingularStringField(value: &v)
  2621. if let v = v {_storage._threemaSafeServerURL = .threemaSafeServerURLValue(v)}
  2622. case 17:
  2623. if _storage._threemaSafeServerUsername != nil {try decoder.handleConflictingOneOf()}
  2624. var v: String?
  2625. try decoder.decodeSingularStringField(value: &v)
  2626. if let v = v {_storage._threemaSafeServerUsername = .threemaSafeServerUsernameValue(v)}
  2627. case 18:
  2628. if _storage._threemaSafeServerPassword != nil {try decoder.handleConflictingOneOf()}
  2629. var v: String?
  2630. try decoder.decodeSingularStringField(value: &v)
  2631. if let v = v {_storage._threemaSafeServerPassword = .threemaSafeServerPasswordValue(v)}
  2632. case 19: try decoder.decodeSingularEnumField(value: &_storage._threemaSafeRestorePolicy)
  2633. case 20:
  2634. if _storage._threemaSafeRestoreIdentity != nil {try decoder.handleConflictingOneOf()}
  2635. var v: String?
  2636. try decoder.decodeSingularStringField(value: &v)
  2637. if let v = v {_storage._threemaSafeRestoreIdentity = .threemaSafeRestoreIdentityValue(v)}
  2638. case 21: try decoder.decodeSingularEnumField(value: &_storage._overridePolicy)
  2639. case 22: try decoder.decodeSingularEnumField(value: &_storage._contactSyncPolicy)
  2640. case 23: try decoder.decodeSingularEnumField(value: &_storage._inactiveIdentityDisplayPolicy)
  2641. case 24: try decoder.decodeSingularEnumField(value: &_storage._unknownContactPolicy)
  2642. case 25: try decoder.decodeSingularEnumField(value: &_storage._autoSaveMediaPolicy)
  2643. case 26: try decoder.decodeSingularEnumField(value: &_storage._screenshotPolicy)
  2644. case 27: try decoder.decodeSingularEnumField(value: &_storage._addContactPolicy)
  2645. case 28: try decoder.decodeSingularEnumField(value: &_storage._chatExportPolicy)
  2646. case 29: try decoder.decodeSingularEnumField(value: &_storage._backupPolicy)
  2647. case 30: try decoder.decodeSingularEnumField(value: &_storage._identityExportPolicy)
  2648. case 31: try decoder.decodeSingularEnumField(value: &_storage._dataBackupPolicy)
  2649. case 32: try decoder.decodeSingularEnumField(value: &_storage._systemBackupPolicy)
  2650. case 33: try decoder.decodeSingularEnumField(value: &_storage._messagePreviewPolicy)
  2651. case 34: try decoder.decodeSingularEnumField(value: &_storage._profilePictureSharePolicy)
  2652. case 35: try decoder.decodeSingularEnumField(value: &_storage._callPolicy)
  2653. case 36: try decoder.decodeSingularEnumField(value: &_storage._setupWizardPolicy)
  2654. case 37: try decoder.decodeSingularEnumField(value: &_storage._createGroupPolicy)
  2655. case 38: try decoder.decodeSingularEnumField(value: &_storage._shareMediaPolicy)
  2656. default: break
  2657. }
  2658. }
  2659. }
  2660. }
  2661. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2662. try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
  2663. if case .licenseUsernameValue(let v)? = _storage._licenseUsername {
  2664. try visitor.visitSingularStringField(value: v, fieldNumber: 1)
  2665. }
  2666. if case .licensePasswordValue(let v)? = _storage._licensePassword {
  2667. try visitor.visitSingularStringField(value: v, fieldNumber: 2)
  2668. }
  2669. if case .nicknameValue(let v)? = _storage._nickname {
  2670. try visitor.visitSingularStringField(value: v, fieldNumber: 3)
  2671. }
  2672. if case .firstNameValue(let v)? = _storage._firstName {
  2673. try visitor.visitSingularStringField(value: v, fieldNumber: 4)
  2674. }
  2675. if case .lastNameValue(let v)? = _storage._lastName {
  2676. try visitor.visitSingularStringField(value: v, fieldNumber: 5)
  2677. }
  2678. if case .customerSpecificIDValue(let v)? = _storage._customerSpecificID {
  2679. try visitor.visitSingularStringField(value: v, fieldNumber: 6)
  2680. }
  2681. if case .categoryValue(let v)? = _storage._category {
  2682. try visitor.visitSingularStringField(value: v, fieldNumber: 7)
  2683. }
  2684. if case .linkedEmailValue(let v)? = _storage._linkedEmail {
  2685. try visitor.visitSingularStringField(value: v, fieldNumber: 8)
  2686. }
  2687. if case .linkedPhoneValue(let v)? = _storage._linkedPhone {
  2688. try visitor.visitSingularStringField(value: v, fieldNumber: 9)
  2689. }
  2690. if case .identityRestoreValue(let v)? = _storage._identityRestore {
  2691. try visitor.visitSingularStringField(value: v, fieldNumber: 10)
  2692. }
  2693. if case .identityRestorePasswordValue(let v)? = _storage._identityRestorePassword {
  2694. try visitor.visitSingularStringField(value: v, fieldNumber: 11)
  2695. }
  2696. if _storage._threemaSafePolicy != .safeOptional {
  2697. try visitor.visitSingularEnumField(value: _storage._threemaSafePolicy, fieldNumber: 12)
  2698. }
  2699. if case .threemaSafePasswordValue(let v)? = _storage._threemaSafePassword {
  2700. try visitor.visitSingularStringField(value: v, fieldNumber: 13)
  2701. }
  2702. if case .threemaSafePasswordPatternValue(let v)? = _storage._threemaSafePasswordPattern {
  2703. try visitor.visitSingularStringField(value: v, fieldNumber: 14)
  2704. }
  2705. if case .threemaSafePasswordPatternErrorMessageValue(let v)? = _storage._threemaSafePasswordPatternErrorMessage {
  2706. try visitor.visitSingularStringField(value: v, fieldNumber: 15)
  2707. }
  2708. if case .threemaSafeServerURLValue(let v)? = _storage._threemaSafeServerURL {
  2709. try visitor.visitSingularStringField(value: v, fieldNumber: 16)
  2710. }
  2711. if case .threemaSafeServerUsernameValue(let v)? = _storage._threemaSafeServerUsername {
  2712. try visitor.visitSingularStringField(value: v, fieldNumber: 17)
  2713. }
  2714. if case .threemaSafeServerPasswordValue(let v)? = _storage._threemaSafeServerPassword {
  2715. try visitor.visitSingularStringField(value: v, fieldNumber: 18)
  2716. }
  2717. if _storage._threemaSafeRestorePolicy != .safeRestoreOptional {
  2718. try visitor.visitSingularEnumField(value: _storage._threemaSafeRestorePolicy, fieldNumber: 19)
  2719. }
  2720. if case .threemaSafeRestoreIdentityValue(let v)? = _storage._threemaSafeRestoreIdentity {
  2721. try visitor.visitSingularStringField(value: v, fieldNumber: 20)
  2722. }
  2723. if _storage._overridePolicy != .loose {
  2724. try visitor.visitSingularEnumField(value: _storage._overridePolicy, fieldNumber: 21)
  2725. }
  2726. if _storage._contactSyncPolicy != .notSynced {
  2727. try visitor.visitSingularEnumField(value: _storage._contactSyncPolicy, fieldNumber: 22)
  2728. }
  2729. if _storage._inactiveIdentityDisplayPolicy != .showInactive {
  2730. try visitor.visitSingularEnumField(value: _storage._inactiveIdentityDisplayPolicy, fieldNumber: 23)
  2731. }
  2732. if _storage._unknownContactPolicy != .allowUnknown {
  2733. try visitor.visitSingularEnumField(value: _storage._unknownContactPolicy, fieldNumber: 24)
  2734. }
  2735. if _storage._autoSaveMediaPolicy != .allowAutoSave {
  2736. try visitor.visitSingularEnumField(value: _storage._autoSaveMediaPolicy, fieldNumber: 25)
  2737. }
  2738. if _storage._screenshotPolicy != .allowScreenshot {
  2739. try visitor.visitSingularEnumField(value: _storage._screenshotPolicy, fieldNumber: 26)
  2740. }
  2741. if _storage._addContactPolicy != .allowAddContact {
  2742. try visitor.visitSingularEnumField(value: _storage._addContactPolicy, fieldNumber: 27)
  2743. }
  2744. if _storage._chatExportPolicy != .allowChatExport {
  2745. try visitor.visitSingularEnumField(value: _storage._chatExportPolicy, fieldNumber: 28)
  2746. }
  2747. if _storage._backupPolicy != .allowBackup {
  2748. try visitor.visitSingularEnumField(value: _storage._backupPolicy, fieldNumber: 29)
  2749. }
  2750. if _storage._identityExportPolicy != .allowIdentityExport {
  2751. try visitor.visitSingularEnumField(value: _storage._identityExportPolicy, fieldNumber: 30)
  2752. }
  2753. if _storage._dataBackupPolicy != .allowDataBackup {
  2754. try visitor.visitSingularEnumField(value: _storage._dataBackupPolicy, fieldNumber: 31)
  2755. }
  2756. if _storage._systemBackupPolicy != .allowSystemBackup {
  2757. try visitor.visitSingularEnumField(value: _storage._systemBackupPolicy, fieldNumber: 32)
  2758. }
  2759. if _storage._messagePreviewPolicy != .allowPreview {
  2760. try visitor.visitSingularEnumField(value: _storage._messagePreviewPolicy, fieldNumber: 33)
  2761. }
  2762. if _storage._profilePictureSharePolicy != .allowShare {
  2763. try visitor.visitSingularEnumField(value: _storage._profilePictureSharePolicy, fieldNumber: 34)
  2764. }
  2765. if _storage._callPolicy != .allowCall {
  2766. try visitor.visitSingularEnumField(value: _storage._callPolicy, fieldNumber: 35)
  2767. }
  2768. if _storage._setupWizardPolicy != .showWizard {
  2769. try visitor.visitSingularEnumField(value: _storage._setupWizardPolicy, fieldNumber: 36)
  2770. }
  2771. if _storage._createGroupPolicy != .allowCreateGroup {
  2772. try visitor.visitSingularEnumField(value: _storage._createGroupPolicy, fieldNumber: 37)
  2773. }
  2774. if _storage._shareMediaPolicy != .allowShareMedia {
  2775. try visitor.visitSingularEnumField(value: _storage._shareMediaPolicy, fieldNumber: 38)
  2776. }
  2777. }
  2778. try unknownFields.traverse(visitor: &visitor)
  2779. }
  2780. static func ==(lhs: D2d_MdmParameters, rhs: D2d_MdmParameters) -> Bool {
  2781. if lhs._storage !== rhs._storage {
  2782. let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
  2783. let _storage = _args.0
  2784. let rhs_storage = _args.1
  2785. if _storage._licenseUsername != rhs_storage._licenseUsername {return false}
  2786. if _storage._licensePassword != rhs_storage._licensePassword {return false}
  2787. if _storage._nickname != rhs_storage._nickname {return false}
  2788. if _storage._firstName != rhs_storage._firstName {return false}
  2789. if _storage._lastName != rhs_storage._lastName {return false}
  2790. if _storage._customerSpecificID != rhs_storage._customerSpecificID {return false}
  2791. if _storage._category != rhs_storage._category {return false}
  2792. if _storage._linkedEmail != rhs_storage._linkedEmail {return false}
  2793. if _storage._linkedPhone != rhs_storage._linkedPhone {return false}
  2794. if _storage._identityRestore != rhs_storage._identityRestore {return false}
  2795. if _storage._identityRestorePassword != rhs_storage._identityRestorePassword {return false}
  2796. if _storage._threemaSafePolicy != rhs_storage._threemaSafePolicy {return false}
  2797. if _storage._threemaSafePassword != rhs_storage._threemaSafePassword {return false}
  2798. if _storage._threemaSafePasswordPattern != rhs_storage._threemaSafePasswordPattern {return false}
  2799. if _storage._threemaSafePasswordPatternErrorMessage != rhs_storage._threemaSafePasswordPatternErrorMessage {return false}
  2800. if _storage._threemaSafeServerURL != rhs_storage._threemaSafeServerURL {return false}
  2801. if _storage._threemaSafeServerUsername != rhs_storage._threemaSafeServerUsername {return false}
  2802. if _storage._threemaSafeServerPassword != rhs_storage._threemaSafeServerPassword {return false}
  2803. if _storage._threemaSafeRestorePolicy != rhs_storage._threemaSafeRestorePolicy {return false}
  2804. if _storage._threemaSafeRestoreIdentity != rhs_storage._threemaSafeRestoreIdentity {return false}
  2805. if _storage._overridePolicy != rhs_storage._overridePolicy {return false}
  2806. if _storage._contactSyncPolicy != rhs_storage._contactSyncPolicy {return false}
  2807. if _storage._inactiveIdentityDisplayPolicy != rhs_storage._inactiveIdentityDisplayPolicy {return false}
  2808. if _storage._unknownContactPolicy != rhs_storage._unknownContactPolicy {return false}
  2809. if _storage._autoSaveMediaPolicy != rhs_storage._autoSaveMediaPolicy {return false}
  2810. if _storage._screenshotPolicy != rhs_storage._screenshotPolicy {return false}
  2811. if _storage._addContactPolicy != rhs_storage._addContactPolicy {return false}
  2812. if _storage._chatExportPolicy != rhs_storage._chatExportPolicy {return false}
  2813. if _storage._backupPolicy != rhs_storage._backupPolicy {return false}
  2814. if _storage._identityExportPolicy != rhs_storage._identityExportPolicy {return false}
  2815. if _storage._dataBackupPolicy != rhs_storage._dataBackupPolicy {return false}
  2816. if _storage._systemBackupPolicy != rhs_storage._systemBackupPolicy {return false}
  2817. if _storage._messagePreviewPolicy != rhs_storage._messagePreviewPolicy {return false}
  2818. if _storage._profilePictureSharePolicy != rhs_storage._profilePictureSharePolicy {return false}
  2819. if _storage._callPolicy != rhs_storage._callPolicy {return false}
  2820. if _storage._setupWizardPolicy != rhs_storage._setupWizardPolicy {return false}
  2821. if _storage._createGroupPolicy != rhs_storage._createGroupPolicy {return false}
  2822. if _storage._shareMediaPolicy != rhs_storage._shareMediaPolicy {return false}
  2823. return true
  2824. }
  2825. if !storagesAreEqual {return false}
  2826. }
  2827. if lhs.unknownFields != rhs.unknownFields {return false}
  2828. return true
  2829. }
  2830. }
  2831. extension D2d_MdmParameters.ThreemaSafePolicy: SwiftProtobuf._ProtoNameProviding {
  2832. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2833. 0: .same(proto: "SAFE_OPTIONAL"),
  2834. 1: .same(proto: "SAFE_MANDATORY"),
  2835. 2: .same(proto: "SAFE_DISABLED"),
  2836. ]
  2837. }
  2838. extension D2d_MdmParameters.ThreemaSafeRestorePolicy: SwiftProtobuf._ProtoNameProviding {
  2839. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2840. 0: .same(proto: "SAFE_RESTORE_OPTIONAL"),
  2841. 1: .same(proto: "SAFE_RESTORE_MANDATORY"),
  2842. 2: .same(proto: "SAFE_RESTORE_DISABLED"),
  2843. ]
  2844. }
  2845. extension D2d_MdmParameters.OverridePolicy: SwiftProtobuf._ProtoNameProviding {
  2846. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2847. 0: .same(proto: "LOOSE"),
  2848. 1: .same(proto: "STRICT"),
  2849. ]
  2850. }
  2851. extension D2d_MdmParameters.ContactSyncPolicy: SwiftProtobuf._ProtoNameProviding {
  2852. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2853. 0: .same(proto: "NOT_SYNCED"),
  2854. 1: .same(proto: "SYNC"),
  2855. ]
  2856. }
  2857. extension D2d_MdmParameters.InactiveIdentityDisplayPolicy: SwiftProtobuf._ProtoNameProviding {
  2858. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2859. 0: .same(proto: "SHOW_INACTIVE"),
  2860. 1: .same(proto: "HIDE_INACTIVE"),
  2861. ]
  2862. }
  2863. extension D2d_MdmParameters.UnknownContactPolicy: SwiftProtobuf._ProtoNameProviding {
  2864. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2865. 0: .same(proto: "ALLOW_UNKNOWN"),
  2866. 1: .same(proto: "BLOCK_UNKNOWN"),
  2867. ]
  2868. }
  2869. extension D2d_MdmParameters.AutoSaveMediaPolicy: SwiftProtobuf._ProtoNameProviding {
  2870. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2871. 0: .same(proto: "ALLOW_AUTO_SAVE"),
  2872. 1: .same(proto: "DENY_AUTO_SAVE"),
  2873. ]
  2874. }
  2875. extension D2d_MdmParameters.ScreenshotPolicy: SwiftProtobuf._ProtoNameProviding {
  2876. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2877. 0: .same(proto: "ALLOW_SCREENSHOT"),
  2878. 1: .same(proto: "DENY_SCREENSHOT"),
  2879. ]
  2880. }
  2881. extension D2d_MdmParameters.AddContactPolicy: SwiftProtobuf._ProtoNameProviding {
  2882. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2883. 0: .same(proto: "ALLOW_ADD_CONTACT"),
  2884. 1: .same(proto: "DENY_ADD_CONTACT"),
  2885. ]
  2886. }
  2887. extension D2d_MdmParameters.ChatExportPolicy: SwiftProtobuf._ProtoNameProviding {
  2888. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2889. 0: .same(proto: "ALLOW_CHAT_EXPORT"),
  2890. 1: .same(proto: "DENY_CHAT_EXPORT"),
  2891. ]
  2892. }
  2893. extension D2d_MdmParameters.BackupPolicy: SwiftProtobuf._ProtoNameProviding {
  2894. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2895. 0: .same(proto: "ALLOW_BACKUP"),
  2896. 1: .same(proto: "DENY_BACKUP"),
  2897. ]
  2898. }
  2899. extension D2d_MdmParameters.IdentityExportPolicy: SwiftProtobuf._ProtoNameProviding {
  2900. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2901. 0: .same(proto: "ALLOW_IDENTITY_EXPORT"),
  2902. 1: .same(proto: "DENY_IDENTITY_EXPORT"),
  2903. ]
  2904. }
  2905. extension D2d_MdmParameters.DataBackupPolicy: SwiftProtobuf._ProtoNameProviding {
  2906. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2907. 0: .same(proto: "ALLOW_DATA_BACKUP"),
  2908. 1: .same(proto: "DENY_DATA_BACKUP"),
  2909. ]
  2910. }
  2911. extension D2d_MdmParameters.SystemBackupPolicy: SwiftProtobuf._ProtoNameProviding {
  2912. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2913. 0: .same(proto: "ALLOW_SYSTEM_BACKUP"),
  2914. 1: .same(proto: "DENY_SYSTEM_BACKUP"),
  2915. ]
  2916. }
  2917. extension D2d_MdmParameters.MessagePreviewPolicy: SwiftProtobuf._ProtoNameProviding {
  2918. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2919. 0: .same(proto: "ALLOW_PREVIEW"),
  2920. 1: .same(proto: "DENY_PREVIEW"),
  2921. ]
  2922. }
  2923. extension D2d_MdmParameters.ProfilePictureSharePolicy: SwiftProtobuf._ProtoNameProviding {
  2924. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2925. 0: .same(proto: "ALLOW_SHARE"),
  2926. 1: .same(proto: "DENY_SHARE"),
  2927. ]
  2928. }
  2929. extension D2d_MdmParameters.CallPolicy: SwiftProtobuf._ProtoNameProviding {
  2930. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2931. 0: .same(proto: "ALLOW_CALL"),
  2932. 1: .same(proto: "DENY_CALL"),
  2933. ]
  2934. }
  2935. extension D2d_MdmParameters.SetupWizardPolicy: SwiftProtobuf._ProtoNameProviding {
  2936. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2937. 0: .same(proto: "SHOW_WIZARD"),
  2938. 1: .same(proto: "SKIP_WIZARD"),
  2939. ]
  2940. }
  2941. extension D2d_MdmParameters.CreateGroupPolicy: SwiftProtobuf._ProtoNameProviding {
  2942. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2943. 0: .same(proto: "ALLOW_CREATE_GROUP"),
  2944. 1: .same(proto: "DENY_CREATE_GROUP"),
  2945. ]
  2946. }
  2947. extension D2d_MdmParameters.ShareMediaPolicy: SwiftProtobuf._ProtoNameProviding {
  2948. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2949. 0: .same(proto: "ALLOW_SHARE_MEDIA"),
  2950. 1: .same(proto: "DENY_OUTSIDE_APP"),
  2951. ]
  2952. }
  2953. extension D2d_MessageReceiver: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2954. static let protoMessageName: String = _protobuf_package + ".MessageReceiver"
  2955. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2956. 1: .same(proto: "identity"),
  2957. 2: .same(proto: "group"),
  2958. ]
  2959. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2960. while let fieldNumber = try decoder.nextFieldNumber() {
  2961. switch fieldNumber {
  2962. case 1:
  2963. if self.receiver != nil {try decoder.handleConflictingOneOf()}
  2964. var v: String?
  2965. try decoder.decodeSingularStringField(value: &v)
  2966. if let v = v {self.receiver = .identity(v)}
  2967. case 2:
  2968. var v: Common_GroupIdentity?
  2969. if let current = self.receiver {
  2970. try decoder.handleConflictingOneOf()
  2971. if case .group(let m) = current {v = m}
  2972. }
  2973. try decoder.decodeSingularMessageField(value: &v)
  2974. if let v = v {self.receiver = .group(v)}
  2975. default: break
  2976. }
  2977. }
  2978. }
  2979. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2980. switch self.receiver {
  2981. case .identity(let v)?:
  2982. try visitor.visitSingularStringField(value: v, fieldNumber: 1)
  2983. case .group(let v)?:
  2984. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  2985. case nil: break
  2986. }
  2987. try unknownFields.traverse(visitor: &visitor)
  2988. }
  2989. static func ==(lhs: D2d_MessageReceiver, rhs: D2d_MessageReceiver) -> Bool {
  2990. if lhs.receiver != rhs.receiver {return false}
  2991. if lhs.unknownFields != rhs.unknownFields {return false}
  2992. return true
  2993. }
  2994. }
  2995. extension D2d_OutgoingMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2996. static let protoMessageName: String = _protobuf_package + ".OutgoingMessage"
  2997. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2998. 1: .same(proto: "receiver"),
  2999. 2: .standard(proto: "message_id"),
  3000. 3: .standard(proto: "created_at"),
  3001. 4: .same(proto: "type"),
  3002. 5: .same(proto: "body"),
  3003. ]
  3004. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3005. while let fieldNumber = try decoder.nextFieldNumber() {
  3006. switch fieldNumber {
  3007. case 1: try decoder.decodeSingularMessageField(value: &self._receiver)
  3008. case 2: try decoder.decodeSingularFixed64Field(value: &self.messageID)
  3009. case 3: try decoder.decodeSingularUInt64Field(value: &self.createdAt)
  3010. case 4: try decoder.decodeSingularEnumField(value: &self.type)
  3011. case 5: try decoder.decodeSingularBytesField(value: &self.body)
  3012. default: break
  3013. }
  3014. }
  3015. }
  3016. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3017. if let v = self._receiver {
  3018. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  3019. }
  3020. if self.messageID != 0 {
  3021. try visitor.visitSingularFixed64Field(value: self.messageID, fieldNumber: 2)
  3022. }
  3023. if self.createdAt != 0 {
  3024. try visitor.visitSingularUInt64Field(value: self.createdAt, fieldNumber: 3)
  3025. }
  3026. if self.type != .invalid {
  3027. try visitor.visitSingularEnumField(value: self.type, fieldNumber: 4)
  3028. }
  3029. if !self.body.isEmpty {
  3030. try visitor.visitSingularBytesField(value: self.body, fieldNumber: 5)
  3031. }
  3032. try unknownFields.traverse(visitor: &visitor)
  3033. }
  3034. static func ==(lhs: D2d_OutgoingMessage, rhs: D2d_OutgoingMessage) -> Bool {
  3035. if lhs._receiver != rhs._receiver {return false}
  3036. if lhs.messageID != rhs.messageID {return false}
  3037. if lhs.createdAt != rhs.createdAt {return false}
  3038. if lhs.type != rhs.type {return false}
  3039. if lhs.body != rhs.body {return false}
  3040. if lhs.unknownFields != rhs.unknownFields {return false}
  3041. return true
  3042. }
  3043. }
  3044. extension D2d_OutgoingMessageDelivered: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3045. static let protoMessageName: String = _protobuf_package + ".OutgoingMessageDelivered"
  3046. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3047. 1: .same(proto: "receiver"),
  3048. 2: .standard(proto: "message_id"),
  3049. ]
  3050. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3051. while let fieldNumber = try decoder.nextFieldNumber() {
  3052. switch fieldNumber {
  3053. case 1: try decoder.decodeSingularMessageField(value: &self._receiver)
  3054. case 2: try decoder.decodeSingularFixed64Field(value: &self.messageID)
  3055. default: break
  3056. }
  3057. }
  3058. }
  3059. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3060. if let v = self._receiver {
  3061. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  3062. }
  3063. if self.messageID != 0 {
  3064. try visitor.visitSingularFixed64Field(value: self.messageID, fieldNumber: 2)
  3065. }
  3066. try unknownFields.traverse(visitor: &visitor)
  3067. }
  3068. static func ==(lhs: D2d_OutgoingMessageDelivered, rhs: D2d_OutgoingMessageDelivered) -> Bool {
  3069. if lhs._receiver != rhs._receiver {return false}
  3070. if lhs.messageID != rhs.messageID {return false}
  3071. if lhs.unknownFields != rhs.unknownFields {return false}
  3072. return true
  3073. }
  3074. }
  3075. extension D2d_IncomingMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3076. static let protoMessageName: String = _protobuf_package + ".IncomingMessage"
  3077. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3078. 1: .standard(proto: "sender_identity"),
  3079. 2: .standard(proto: "sender_nickname"),
  3080. 3: .standard(proto: "message_id"),
  3081. 4: .standard(proto: "created_at"),
  3082. 5: .same(proto: "type"),
  3083. 6: .same(proto: "body"),
  3084. ]
  3085. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3086. while let fieldNumber = try decoder.nextFieldNumber() {
  3087. switch fieldNumber {
  3088. case 1: try decoder.decodeSingularStringField(value: &self.senderIdentity)
  3089. case 2: try decoder.decodeSingularStringField(value: &self.senderNickname)
  3090. case 3: try decoder.decodeSingularFixed64Field(value: &self.messageID)
  3091. case 4: try decoder.decodeSingularUInt64Field(value: &self.createdAt)
  3092. case 5: try decoder.decodeSingularEnumField(value: &self.type)
  3093. case 6: try decoder.decodeSingularBytesField(value: &self.body)
  3094. default: break
  3095. }
  3096. }
  3097. }
  3098. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3099. if !self.senderIdentity.isEmpty {
  3100. try visitor.visitSingularStringField(value: self.senderIdentity, fieldNumber: 1)
  3101. }
  3102. if !self.senderNickname.isEmpty {
  3103. try visitor.visitSingularStringField(value: self.senderNickname, fieldNumber: 2)
  3104. }
  3105. if self.messageID != 0 {
  3106. try visitor.visitSingularFixed64Field(value: self.messageID, fieldNumber: 3)
  3107. }
  3108. if self.createdAt != 0 {
  3109. try visitor.visitSingularUInt64Field(value: self.createdAt, fieldNumber: 4)
  3110. }
  3111. if self.type != .invalid {
  3112. try visitor.visitSingularEnumField(value: self.type, fieldNumber: 5)
  3113. }
  3114. if !self.body.isEmpty {
  3115. try visitor.visitSingularBytesField(value: self.body, fieldNumber: 6)
  3116. }
  3117. try unknownFields.traverse(visitor: &visitor)
  3118. }
  3119. static func ==(lhs: D2d_IncomingMessage, rhs: D2d_IncomingMessage) -> Bool {
  3120. if lhs.senderIdentity != rhs.senderIdentity {return false}
  3121. if lhs.senderNickname != rhs.senderNickname {return false}
  3122. if lhs.messageID != rhs.messageID {return false}
  3123. if lhs.createdAt != rhs.createdAt {return false}
  3124. if lhs.type != rhs.type {return false}
  3125. if lhs.body != rhs.body {return false}
  3126. if lhs.unknownFields != rhs.unknownFields {return false}
  3127. return true
  3128. }
  3129. }
  3130. extension D2d_UserProfileSync: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3131. static let protoMessageName: String = _protobuf_package + ".UserProfileSync"
  3132. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3133. 1: .same(proto: "set"),
  3134. ]
  3135. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3136. while let fieldNumber = try decoder.nextFieldNumber() {
  3137. switch fieldNumber {
  3138. case 1:
  3139. var v: D2d_UserProfileSync.Set?
  3140. if let current = self.action {
  3141. try decoder.handleConflictingOneOf()
  3142. if case .set(let m) = current {v = m}
  3143. }
  3144. try decoder.decodeSingularMessageField(value: &v)
  3145. if let v = v {self.action = .set(v)}
  3146. default: break
  3147. }
  3148. }
  3149. }
  3150. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3151. if case .set(let v)? = self.action {
  3152. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  3153. }
  3154. try unknownFields.traverse(visitor: &visitor)
  3155. }
  3156. static func ==(lhs: D2d_UserProfileSync, rhs: D2d_UserProfileSync) -> Bool {
  3157. if lhs.action != rhs.action {return false}
  3158. if lhs.unknownFields != rhs.unknownFields {return false}
  3159. return true
  3160. }
  3161. }
  3162. extension D2d_UserProfileSync.Set: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3163. static let protoMessageName: String = D2d_UserProfileSync.protoMessageName + ".Set"
  3164. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3165. 1: .standard(proto: "user_profile"),
  3166. ]
  3167. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3168. while let fieldNumber = try decoder.nextFieldNumber() {
  3169. switch fieldNumber {
  3170. case 1: try decoder.decodeSingularMessageField(value: &self._userProfile)
  3171. default: break
  3172. }
  3173. }
  3174. }
  3175. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3176. if let v = self._userProfile {
  3177. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  3178. }
  3179. try unknownFields.traverse(visitor: &visitor)
  3180. }
  3181. static func ==(lhs: D2d_UserProfileSync.Set, rhs: D2d_UserProfileSync.Set) -> Bool {
  3182. if lhs._userProfile != rhs._userProfile {return false}
  3183. if lhs.unknownFields != rhs.unknownFields {return false}
  3184. return true
  3185. }
  3186. }
  3187. extension D2d_ContactSync: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3188. static let protoMessageName: String = _protobuf_package + ".ContactSync"
  3189. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3190. 1: .same(proto: "set"),
  3191. 2: .same(proto: "delete"),
  3192. ]
  3193. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3194. while let fieldNumber = try decoder.nextFieldNumber() {
  3195. switch fieldNumber {
  3196. case 1:
  3197. var v: D2d_ContactSync.Set?
  3198. if let current = self.action {
  3199. try decoder.handleConflictingOneOf()
  3200. if case .set(let m) = current {v = m}
  3201. }
  3202. try decoder.decodeSingularMessageField(value: &v)
  3203. if let v = v {self.action = .set(v)}
  3204. case 2:
  3205. var v: D2d_ContactSync.Delete?
  3206. if let current = self.action {
  3207. try decoder.handleConflictingOneOf()
  3208. if case .delete(let m) = current {v = m}
  3209. }
  3210. try decoder.decodeSingularMessageField(value: &v)
  3211. if let v = v {self.action = .delete(v)}
  3212. default: break
  3213. }
  3214. }
  3215. }
  3216. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3217. switch self.action {
  3218. case .set(let v)?:
  3219. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  3220. case .delete(let v)?:
  3221. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  3222. case nil: break
  3223. }
  3224. try unknownFields.traverse(visitor: &visitor)
  3225. }
  3226. static func ==(lhs: D2d_ContactSync, rhs: D2d_ContactSync) -> Bool {
  3227. if lhs.action != rhs.action {return false}
  3228. if lhs.unknownFields != rhs.unknownFields {return false}
  3229. return true
  3230. }
  3231. }
  3232. extension D2d_ContactSync.Set: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3233. static let protoMessageName: String = D2d_ContactSync.protoMessageName + ".Set"
  3234. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3235. 1: .same(proto: "contact"),
  3236. ]
  3237. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3238. while let fieldNumber = try decoder.nextFieldNumber() {
  3239. switch fieldNumber {
  3240. case 1: try decoder.decodeSingularMessageField(value: &self._contact)
  3241. default: break
  3242. }
  3243. }
  3244. }
  3245. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3246. if let v = self._contact {
  3247. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  3248. }
  3249. try unknownFields.traverse(visitor: &visitor)
  3250. }
  3251. static func ==(lhs: D2d_ContactSync.Set, rhs: D2d_ContactSync.Set) -> Bool {
  3252. if lhs._contact != rhs._contact {return false}
  3253. if lhs.unknownFields != rhs.unknownFields {return false}
  3254. return true
  3255. }
  3256. }
  3257. extension D2d_ContactSync.Delete: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3258. static let protoMessageName: String = D2d_ContactSync.protoMessageName + ".Delete"
  3259. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3260. 1: .standard(proto: "delete_identity"),
  3261. ]
  3262. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3263. while let fieldNumber = try decoder.nextFieldNumber() {
  3264. switch fieldNumber {
  3265. case 1: try decoder.decodeSingularStringField(value: &self.deleteIdentity)
  3266. default: break
  3267. }
  3268. }
  3269. }
  3270. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3271. if !self.deleteIdentity.isEmpty {
  3272. try visitor.visitSingularStringField(value: self.deleteIdentity, fieldNumber: 1)
  3273. }
  3274. try unknownFields.traverse(visitor: &visitor)
  3275. }
  3276. static func ==(lhs: D2d_ContactSync.Delete, rhs: D2d_ContactSync.Delete) -> Bool {
  3277. if lhs.deleteIdentity != rhs.deleteIdentity {return false}
  3278. if lhs.unknownFields != rhs.unknownFields {return false}
  3279. return true
  3280. }
  3281. }
  3282. extension D2d_GroupSync: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3283. static let protoMessageName: String = _protobuf_package + ".GroupSync"
  3284. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3285. 1: .same(proto: "set"),
  3286. 2: .same(proto: "delete"),
  3287. ]
  3288. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3289. while let fieldNumber = try decoder.nextFieldNumber() {
  3290. switch fieldNumber {
  3291. case 1:
  3292. var v: D2d_GroupSync.Set?
  3293. if let current = self.action {
  3294. try decoder.handleConflictingOneOf()
  3295. if case .set(let m) = current {v = m}
  3296. }
  3297. try decoder.decodeSingularMessageField(value: &v)
  3298. if let v = v {self.action = .set(v)}
  3299. case 2:
  3300. var v: D2d_GroupSync.Delete?
  3301. if let current = self.action {
  3302. try decoder.handleConflictingOneOf()
  3303. if case .delete(let m) = current {v = m}
  3304. }
  3305. try decoder.decodeSingularMessageField(value: &v)
  3306. if let v = v {self.action = .delete(v)}
  3307. default: break
  3308. }
  3309. }
  3310. }
  3311. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3312. switch self.action {
  3313. case .set(let v)?:
  3314. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  3315. case .delete(let v)?:
  3316. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  3317. case nil: break
  3318. }
  3319. try unknownFields.traverse(visitor: &visitor)
  3320. }
  3321. static func ==(lhs: D2d_GroupSync, rhs: D2d_GroupSync) -> Bool {
  3322. if lhs.action != rhs.action {return false}
  3323. if lhs.unknownFields != rhs.unknownFields {return false}
  3324. return true
  3325. }
  3326. }
  3327. extension D2d_GroupSync.Set: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3328. static let protoMessageName: String = D2d_GroupSync.protoMessageName + ".Set"
  3329. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3330. 1: .same(proto: "group"),
  3331. ]
  3332. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3333. while let fieldNumber = try decoder.nextFieldNumber() {
  3334. switch fieldNumber {
  3335. case 1: try decoder.decodeSingularMessageField(value: &self._group)
  3336. default: break
  3337. }
  3338. }
  3339. }
  3340. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3341. if let v = self._group {
  3342. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  3343. }
  3344. try unknownFields.traverse(visitor: &visitor)
  3345. }
  3346. static func ==(lhs: D2d_GroupSync.Set, rhs: D2d_GroupSync.Set) -> Bool {
  3347. if lhs._group != rhs._group {return false}
  3348. if lhs.unknownFields != rhs.unknownFields {return false}
  3349. return true
  3350. }
  3351. }
  3352. extension D2d_GroupSync.Delete: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3353. static let protoMessageName: String = D2d_GroupSync.protoMessageName + ".Delete"
  3354. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3355. 1: .standard(proto: "group_identity"),
  3356. ]
  3357. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3358. while let fieldNumber = try decoder.nextFieldNumber() {
  3359. switch fieldNumber {
  3360. case 1: try decoder.decodeSingularMessageField(value: &self._groupIdentity)
  3361. default: break
  3362. }
  3363. }
  3364. }
  3365. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3366. if let v = self._groupIdentity {
  3367. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  3368. }
  3369. try unknownFields.traverse(visitor: &visitor)
  3370. }
  3371. static func ==(lhs: D2d_GroupSync.Delete, rhs: D2d_GroupSync.Delete) -> Bool {
  3372. if lhs._groupIdentity != rhs._groupIdentity {return false}
  3373. if lhs.unknownFields != rhs.unknownFields {return false}
  3374. return true
  3375. }
  3376. }
  3377. extension D2d_DistributionListSync: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3378. static let protoMessageName: String = _protobuf_package + ".DistributionListSync"
  3379. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3380. 1: .same(proto: "set"),
  3381. 2: .same(proto: "delete"),
  3382. ]
  3383. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3384. while let fieldNumber = try decoder.nextFieldNumber() {
  3385. switch fieldNumber {
  3386. case 1:
  3387. var v: D2d_DistributionListSync.Set?
  3388. if let current = self.action {
  3389. try decoder.handleConflictingOneOf()
  3390. if case .set(let m) = current {v = m}
  3391. }
  3392. try decoder.decodeSingularMessageField(value: &v)
  3393. if let v = v {self.action = .set(v)}
  3394. case 2:
  3395. var v: D2d_DistributionListSync.Delete?
  3396. if let current = self.action {
  3397. try decoder.handleConflictingOneOf()
  3398. if case .delete(let m) = current {v = m}
  3399. }
  3400. try decoder.decodeSingularMessageField(value: &v)
  3401. if let v = v {self.action = .delete(v)}
  3402. default: break
  3403. }
  3404. }
  3405. }
  3406. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3407. switch self.action {
  3408. case .set(let v)?:
  3409. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  3410. case .delete(let v)?:
  3411. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  3412. case nil: break
  3413. }
  3414. try unknownFields.traverse(visitor: &visitor)
  3415. }
  3416. static func ==(lhs: D2d_DistributionListSync, rhs: D2d_DistributionListSync) -> Bool {
  3417. if lhs.action != rhs.action {return false}
  3418. if lhs.unknownFields != rhs.unknownFields {return false}
  3419. return true
  3420. }
  3421. }
  3422. extension D2d_DistributionListSync.Set: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3423. static let protoMessageName: String = D2d_DistributionListSync.protoMessageName + ".Set"
  3424. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3425. 1: .standard(proto: "distribution_list"),
  3426. ]
  3427. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3428. while let fieldNumber = try decoder.nextFieldNumber() {
  3429. switch fieldNumber {
  3430. case 1: try decoder.decodeSingularMessageField(value: &self._distributionList)
  3431. default: break
  3432. }
  3433. }
  3434. }
  3435. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3436. if let v = self._distributionList {
  3437. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  3438. }
  3439. try unknownFields.traverse(visitor: &visitor)
  3440. }
  3441. static func ==(lhs: D2d_DistributionListSync.Set, rhs: D2d_DistributionListSync.Set) -> Bool {
  3442. if lhs._distributionList != rhs._distributionList {return false}
  3443. if lhs.unknownFields != rhs.unknownFields {return false}
  3444. return true
  3445. }
  3446. }
  3447. extension D2d_DistributionListSync.Delete: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3448. static let protoMessageName: String = D2d_DistributionListSync.protoMessageName + ".Delete"
  3449. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3450. 1: .standard(proto: "distribution_list_id"),
  3451. ]
  3452. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3453. while let fieldNumber = try decoder.nextFieldNumber() {
  3454. switch fieldNumber {
  3455. case 1: try decoder.decodeSingularFixed64Field(value: &self.distributionListID)
  3456. default: break
  3457. }
  3458. }
  3459. }
  3460. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3461. if self.distributionListID != 0 {
  3462. try visitor.visitSingularFixed64Field(value: self.distributionListID, fieldNumber: 1)
  3463. }
  3464. try unknownFields.traverse(visitor: &visitor)
  3465. }
  3466. static func ==(lhs: D2d_DistributionListSync.Delete, rhs: D2d_DistributionListSync.Delete) -> Bool {
  3467. if lhs.distributionListID != rhs.distributionListID {return false}
  3468. if lhs.unknownFields != rhs.unknownFields {return false}
  3469. return true
  3470. }
  3471. }
  3472. extension D2d_SettingsSync: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3473. static let protoMessageName: String = _protobuf_package + ".SettingsSync"
  3474. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3475. 1: .same(proto: "set"),
  3476. ]
  3477. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3478. while let fieldNumber = try decoder.nextFieldNumber() {
  3479. switch fieldNumber {
  3480. case 1:
  3481. var v: D2d_SettingsSync.Set?
  3482. if let current = self.action {
  3483. try decoder.handleConflictingOneOf()
  3484. if case .set(let m) = current {v = m}
  3485. }
  3486. try decoder.decodeSingularMessageField(value: &v)
  3487. if let v = v {self.action = .set(v)}
  3488. default: break
  3489. }
  3490. }
  3491. }
  3492. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3493. if case .set(let v)? = self.action {
  3494. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  3495. }
  3496. try unknownFields.traverse(visitor: &visitor)
  3497. }
  3498. static func ==(lhs: D2d_SettingsSync, rhs: D2d_SettingsSync) -> Bool {
  3499. if lhs.action != rhs.action {return false}
  3500. if lhs.unknownFields != rhs.unknownFields {return false}
  3501. return true
  3502. }
  3503. }
  3504. extension D2d_SettingsSync.Set: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3505. static let protoMessageName: String = D2d_SettingsSync.protoMessageName + ".Set"
  3506. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3507. 1: .same(proto: "settings"),
  3508. ]
  3509. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3510. while let fieldNumber = try decoder.nextFieldNumber() {
  3511. switch fieldNumber {
  3512. case 1: try decoder.decodeSingularMessageField(value: &self._settings)
  3513. default: break
  3514. }
  3515. }
  3516. }
  3517. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3518. if let v = self._settings {
  3519. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  3520. }
  3521. try unknownFields.traverse(visitor: &visitor)
  3522. }
  3523. static func ==(lhs: D2d_SettingsSync.Set, rhs: D2d_SettingsSync.Set) -> Bool {
  3524. if lhs._settings != rhs._settings {return false}
  3525. if lhs.unknownFields != rhs.unknownFields {return false}
  3526. return true
  3527. }
  3528. }