language_service.pb.swift 144 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261
  1. // DO NOT EDIT.
  2. // swift-format-ignore-file
  3. //
  4. // Generated by the Swift generator plugin for the protocol buffer compiler.
  5. // Source: google/cloud/language/v1/language_service.proto
  6. //
  7. // For information on using the generated types, please see the documentation:
  8. // https://github.com/apple/swift-protobuf/
  9. // Copyright 2019 Google LLC.
  10. //
  11. // Licensed under the Apache License, Version 2.0 (the "License");
  12. // you may not use this file except in compliance with the License.
  13. // You may obtain a copy of the License at
  14. //
  15. // http://www.apache.org/licenses/LICENSE-2.0
  16. //
  17. // Unless required by applicable law or agreed to in writing, software
  18. // distributed under the License is distributed on an "AS IS" BASIS,
  19. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  20. // See the License for the specific language governing permissions and
  21. // limitations under the License.
  22. import Foundation
  23. import SwiftProtobuf
  24. // If the compiler emits an error on this type, it is because this file
  25. // was generated by a version of the `protoc` Swift plug-in that is
  26. // incompatible with the version of SwiftProtobuf to which you are linking.
  27. // Please ensure that you are building against the same version of the API
  28. // that was used to generate this file.
  29. fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
  30. struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
  31. typealias Version = _2
  32. }
  33. /// Represents the text encoding that the caller uses to process the output.
  34. /// Providing an `EncodingType` is recommended because the API provides the
  35. /// beginning offsets for various outputs, such as tokens and mentions, and
  36. /// languages that natively use different text encodings may access offsets
  37. /// differently.
  38. enum Google_Cloud_Language_V1_EncodingType: SwiftProtobuf.Enum {
  39. typealias RawValue = Int
  40. /// If `EncodingType` is not specified, encoding-dependent information (such as
  41. /// `begin_offset`) will be set at `-1`.
  42. case none // = 0
  43. /// Encoding-dependent information (such as `begin_offset`) is calculated based
  44. /// on the UTF-8 encoding of the input. C++ and Go are examples of languages
  45. /// that use this encoding natively.
  46. case utf8 // = 1
  47. /// Encoding-dependent information (such as `begin_offset`) is calculated based
  48. /// on the UTF-16 encoding of the input. Java and JavaScript are examples of
  49. /// languages that use this encoding natively.
  50. case utf16 // = 2
  51. /// Encoding-dependent information (such as `begin_offset`) is calculated based
  52. /// on the UTF-32 encoding of the input. Python is an example of a language
  53. /// that uses this encoding natively.
  54. case utf32 // = 3
  55. case UNRECOGNIZED(Int)
  56. init() {
  57. self = .none
  58. }
  59. init?(rawValue: Int) {
  60. switch rawValue {
  61. case 0: self = .none
  62. case 1: self = .utf8
  63. case 2: self = .utf16
  64. case 3: self = .utf32
  65. default: self = .UNRECOGNIZED(rawValue)
  66. }
  67. }
  68. var rawValue: Int {
  69. switch self {
  70. case .none: return 0
  71. case .utf8: return 1
  72. case .utf16: return 2
  73. case .utf32: return 3
  74. case .UNRECOGNIZED(let i): return i
  75. }
  76. }
  77. }
  78. #if swift(>=4.2)
  79. extension Google_Cloud_Language_V1_EncodingType: CaseIterable {
  80. // The compiler won't synthesize support with the UNRECOGNIZED case.
  81. static var allCases: [Google_Cloud_Language_V1_EncodingType] = [
  82. .none,
  83. .utf8,
  84. .utf16,
  85. .utf32,
  86. ]
  87. }
  88. #endif // swift(>=4.2)
  89. /// ################################################################ #
  90. ///
  91. /// Represents the input to API methods.
  92. struct Google_Cloud_Language_V1_Document {
  93. // SwiftProtobuf.Message conformance is added in an extension below. See the
  94. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  95. // methods supported on all messages.
  96. /// Required. If the type is not set or is `TYPE_UNSPECIFIED`,
  97. /// returns an `INVALID_ARGUMENT` error.
  98. var type: Google_Cloud_Language_V1_Document.TypeEnum = .unspecified
  99. /// The source of the document: a string containing the content or a
  100. /// Google Cloud Storage URI.
  101. var source: Google_Cloud_Language_V1_Document.OneOf_Source? = nil
  102. /// The content of the input in string format.
  103. /// Cloud audit logging exempt since it is based on user data.
  104. var content: String {
  105. get {
  106. if case .content(let v)? = source {return v}
  107. return String()
  108. }
  109. set {source = .content(newValue)}
  110. }
  111. /// The Google Cloud Storage URI where the file content is located.
  112. /// This URI must be of the form: gs://bucket_name/object_name. For more
  113. /// details, see https://cloud.google.com/storage/docs/reference-uris.
  114. /// NOTE: Cloud Storage object versioning is not supported.
  115. var gcsContentUri: String {
  116. get {
  117. if case .gcsContentUri(let v)? = source {return v}
  118. return String()
  119. }
  120. set {source = .gcsContentUri(newValue)}
  121. }
  122. /// The language of the document (if not specified, the language is
  123. /// automatically detected). Both ISO and BCP-47 language codes are
  124. /// accepted.<br>
  125. /// [Language
  126. /// Support](https://cloud.google.com/natural-language/docs/languages) lists
  127. /// currently supported languages for each API method. If the language (either
  128. /// specified by the caller or automatically detected) is not supported by the
  129. /// called API method, an `INVALID_ARGUMENT` error is returned.
  130. var language: String = String()
  131. var unknownFields = SwiftProtobuf.UnknownStorage()
  132. /// The source of the document: a string containing the content or a
  133. /// Google Cloud Storage URI.
  134. enum OneOf_Source: Equatable {
  135. /// The content of the input in string format.
  136. /// Cloud audit logging exempt since it is based on user data.
  137. case content(String)
  138. /// The Google Cloud Storage URI where the file content is located.
  139. /// This URI must be of the form: gs://bucket_name/object_name. For more
  140. /// details, see https://cloud.google.com/storage/docs/reference-uris.
  141. /// NOTE: Cloud Storage object versioning is not supported.
  142. case gcsContentUri(String)
  143. #if !swift(>=4.1)
  144. static func ==(lhs: Google_Cloud_Language_V1_Document.OneOf_Source, rhs: Google_Cloud_Language_V1_Document.OneOf_Source) -> Bool {
  145. // The use of inline closures is to circumvent an issue where the compiler
  146. // allocates stack space for every case branch when no optimizations are
  147. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  148. switch (lhs, rhs) {
  149. case (.content, .content): return {
  150. guard case .content(let l) = lhs, case .content(let r) = rhs else { preconditionFailure() }
  151. return l == r
  152. }()
  153. case (.gcsContentUri, .gcsContentUri): return {
  154. guard case .gcsContentUri(let l) = lhs, case .gcsContentUri(let r) = rhs else { preconditionFailure() }
  155. return l == r
  156. }()
  157. default: return false
  158. }
  159. }
  160. #endif
  161. }
  162. /// The document types enum.
  163. enum TypeEnum: SwiftProtobuf.Enum {
  164. typealias RawValue = Int
  165. /// The content type is not specified.
  166. case unspecified // = 0
  167. /// Plain text
  168. case plainText // = 1
  169. /// HTML
  170. case html // = 2
  171. case UNRECOGNIZED(Int)
  172. init() {
  173. self = .unspecified
  174. }
  175. init?(rawValue: Int) {
  176. switch rawValue {
  177. case 0: self = .unspecified
  178. case 1: self = .plainText
  179. case 2: self = .html
  180. default: self = .UNRECOGNIZED(rawValue)
  181. }
  182. }
  183. var rawValue: Int {
  184. switch self {
  185. case .unspecified: return 0
  186. case .plainText: return 1
  187. case .html: return 2
  188. case .UNRECOGNIZED(let i): return i
  189. }
  190. }
  191. }
  192. init() {}
  193. }
  194. #if swift(>=4.2)
  195. extension Google_Cloud_Language_V1_Document.TypeEnum: CaseIterable {
  196. // The compiler won't synthesize support with the UNRECOGNIZED case.
  197. static var allCases: [Google_Cloud_Language_V1_Document.TypeEnum] = [
  198. .unspecified,
  199. .plainText,
  200. .html,
  201. ]
  202. }
  203. #endif // swift(>=4.2)
  204. /// Represents a sentence in the input document.
  205. struct Google_Cloud_Language_V1_Sentence {
  206. // SwiftProtobuf.Message conformance is added in an extension below. See the
  207. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  208. // methods supported on all messages.
  209. /// The sentence text.
  210. var text: Google_Cloud_Language_V1_TextSpan {
  211. get {return _text ?? Google_Cloud_Language_V1_TextSpan()}
  212. set {_text = newValue}
  213. }
  214. /// Returns true if `text` has been explicitly set.
  215. var hasText: Bool {return self._text != nil}
  216. /// Clears the value of `text`. Subsequent reads from it will return its default value.
  217. mutating func clearText() {self._text = nil}
  218. /// For calls to [AnalyzeSentiment][] or if
  219. /// [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
  220. /// is set to true, this field will contain the sentiment for the sentence.
  221. var sentiment: Google_Cloud_Language_V1_Sentiment {
  222. get {return _sentiment ?? Google_Cloud_Language_V1_Sentiment()}
  223. set {_sentiment = newValue}
  224. }
  225. /// Returns true if `sentiment` has been explicitly set.
  226. var hasSentiment: Bool {return self._sentiment != nil}
  227. /// Clears the value of `sentiment`. Subsequent reads from it will return its default value.
  228. mutating func clearSentiment() {self._sentiment = nil}
  229. var unknownFields = SwiftProtobuf.UnknownStorage()
  230. init() {}
  231. fileprivate var _text: Google_Cloud_Language_V1_TextSpan? = nil
  232. fileprivate var _sentiment: Google_Cloud_Language_V1_Sentiment? = nil
  233. }
  234. /// Represents a phrase in the text that is a known entity, such as
  235. /// a person, an organization, or location. The API associates information, such
  236. /// as salience and mentions, with entities.
  237. struct Google_Cloud_Language_V1_Entity {
  238. // SwiftProtobuf.Message conformance is added in an extension below. See the
  239. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  240. // methods supported on all messages.
  241. /// The representative name for the entity.
  242. var name: String = String()
  243. /// The entity type.
  244. var type: Google_Cloud_Language_V1_Entity.TypeEnum = .unknown
  245. /// Metadata associated with the entity.
  246. ///
  247. /// For most entity types, the metadata is a Wikipedia URL (`wikipedia_url`)
  248. /// and Knowledge Graph MID (`mid`), if they are available. For the metadata
  249. /// associated with other entity types, see the Type table below.
  250. var metadata: Dictionary<String,String> = [:]
  251. /// The salience score associated with the entity in the [0, 1.0] range.
  252. ///
  253. /// The salience score for an entity provides information about the
  254. /// importance or centrality of that entity to the entire document text.
  255. /// Scores closer to 0 are less salient, while scores closer to 1.0 are highly
  256. /// salient.
  257. var salience: Float = 0
  258. /// The mentions of this entity in the input document. The API currently
  259. /// supports proper noun mentions.
  260. var mentions: [Google_Cloud_Language_V1_EntityMention] = []
  261. /// For calls to [AnalyzeEntitySentiment][] or if
  262. /// [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
  263. /// is set to true, this field will contain the aggregate sentiment expressed
  264. /// for this entity in the provided document.
  265. var sentiment: Google_Cloud_Language_V1_Sentiment {
  266. get {return _sentiment ?? Google_Cloud_Language_V1_Sentiment()}
  267. set {_sentiment = newValue}
  268. }
  269. /// Returns true if `sentiment` has been explicitly set.
  270. var hasSentiment: Bool {return self._sentiment != nil}
  271. /// Clears the value of `sentiment`. Subsequent reads from it will return its default value.
  272. mutating func clearSentiment() {self._sentiment = nil}
  273. var unknownFields = SwiftProtobuf.UnknownStorage()
  274. /// The type of the entity. For most entity types, the associated metadata is a
  275. /// Wikipedia URL (`wikipedia_url`) and Knowledge Graph MID (`mid`). The table
  276. /// below lists the associated fields for entities that have different
  277. /// metadata.
  278. enum TypeEnum: SwiftProtobuf.Enum {
  279. typealias RawValue = Int
  280. /// Unknown
  281. case unknown // = 0
  282. /// Person
  283. case person // = 1
  284. /// Location
  285. case location // = 2
  286. /// Organization
  287. case organization // = 3
  288. /// Event
  289. case event // = 4
  290. /// Artwork
  291. case workOfArt // = 5
  292. /// Consumer product
  293. case consumerGood // = 6
  294. /// Other types of entities
  295. case other // = 7
  296. /// Phone number
  297. ///
  298. /// The metadata lists the phone number, formatted according to local
  299. /// convention, plus whichever additional elements appear in the text:
  300. ///
  301. /// * `number` - the actual number, broken down into sections as per local
  302. /// convention
  303. /// * `national_prefix` - country code, if detected
  304. /// * `area_code` - region or area code, if detected
  305. /// * `extension` - phone extension (to be dialed after connection), if
  306. /// detected
  307. case phoneNumber // = 9
  308. /// Address
  309. ///
  310. /// The metadata identifies the street number and locality plus whichever
  311. /// additional elements appear in the text:
  312. ///
  313. /// * `street_number` - street number
  314. /// * `locality` - city or town
  315. /// * `street_name` - street/route name, if detected
  316. /// * `postal_code` - postal code, if detected
  317. /// * `country` - country, if detected<
  318. /// * `broad_region` - administrative area, such as the state, if detected
  319. /// * `narrow_region` - smaller administrative area, such as county, if
  320. /// detected
  321. /// * `sublocality` - used in Asian addresses to demark a district within a
  322. /// city, if detected
  323. case address // = 10
  324. /// Date
  325. ///
  326. /// The metadata identifies the components of the date:
  327. ///
  328. /// * `year` - four digit year, if detected
  329. /// * `month` - two digit month number, if detected
  330. /// * `day` - two digit day number, if detected
  331. case date // = 11
  332. /// Number
  333. ///
  334. /// The metadata is the number itself.
  335. case number // = 12
  336. /// Price
  337. ///
  338. /// The metadata identifies the `value` and `currency`.
  339. case price // = 13
  340. case UNRECOGNIZED(Int)
  341. init() {
  342. self = .unknown
  343. }
  344. init?(rawValue: Int) {
  345. switch rawValue {
  346. case 0: self = .unknown
  347. case 1: self = .person
  348. case 2: self = .location
  349. case 3: self = .organization
  350. case 4: self = .event
  351. case 5: self = .workOfArt
  352. case 6: self = .consumerGood
  353. case 7: self = .other
  354. case 9: self = .phoneNumber
  355. case 10: self = .address
  356. case 11: self = .date
  357. case 12: self = .number
  358. case 13: self = .price
  359. default: self = .UNRECOGNIZED(rawValue)
  360. }
  361. }
  362. var rawValue: Int {
  363. switch self {
  364. case .unknown: return 0
  365. case .person: return 1
  366. case .location: return 2
  367. case .organization: return 3
  368. case .event: return 4
  369. case .workOfArt: return 5
  370. case .consumerGood: return 6
  371. case .other: return 7
  372. case .phoneNumber: return 9
  373. case .address: return 10
  374. case .date: return 11
  375. case .number: return 12
  376. case .price: return 13
  377. case .UNRECOGNIZED(let i): return i
  378. }
  379. }
  380. }
  381. init() {}
  382. fileprivate var _sentiment: Google_Cloud_Language_V1_Sentiment? = nil
  383. }
  384. #if swift(>=4.2)
  385. extension Google_Cloud_Language_V1_Entity.TypeEnum: CaseIterable {
  386. // The compiler won't synthesize support with the UNRECOGNIZED case.
  387. static var allCases: [Google_Cloud_Language_V1_Entity.TypeEnum] = [
  388. .unknown,
  389. .person,
  390. .location,
  391. .organization,
  392. .event,
  393. .workOfArt,
  394. .consumerGood,
  395. .other,
  396. .phoneNumber,
  397. .address,
  398. .date,
  399. .number,
  400. .price,
  401. ]
  402. }
  403. #endif // swift(>=4.2)
  404. /// Represents the smallest syntactic building block of the text.
  405. struct Google_Cloud_Language_V1_Token {
  406. // SwiftProtobuf.Message conformance is added in an extension below. See the
  407. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  408. // methods supported on all messages.
  409. /// The token text.
  410. var text: Google_Cloud_Language_V1_TextSpan {
  411. get {return _storage._text ?? Google_Cloud_Language_V1_TextSpan()}
  412. set {_uniqueStorage()._text = newValue}
  413. }
  414. /// Returns true if `text` has been explicitly set.
  415. var hasText: Bool {return _storage._text != nil}
  416. /// Clears the value of `text`. Subsequent reads from it will return its default value.
  417. mutating func clearText() {_uniqueStorage()._text = nil}
  418. /// Parts of speech tag for this token.
  419. var partOfSpeech: Google_Cloud_Language_V1_PartOfSpeech {
  420. get {return _storage._partOfSpeech ?? Google_Cloud_Language_V1_PartOfSpeech()}
  421. set {_uniqueStorage()._partOfSpeech = newValue}
  422. }
  423. /// Returns true if `partOfSpeech` has been explicitly set.
  424. var hasPartOfSpeech: Bool {return _storage._partOfSpeech != nil}
  425. /// Clears the value of `partOfSpeech`. Subsequent reads from it will return its default value.
  426. mutating func clearPartOfSpeech() {_uniqueStorage()._partOfSpeech = nil}
  427. /// Dependency tree parse for this token.
  428. var dependencyEdge: Google_Cloud_Language_V1_DependencyEdge {
  429. get {return _storage._dependencyEdge ?? Google_Cloud_Language_V1_DependencyEdge()}
  430. set {_uniqueStorage()._dependencyEdge = newValue}
  431. }
  432. /// Returns true if `dependencyEdge` has been explicitly set.
  433. var hasDependencyEdge: Bool {return _storage._dependencyEdge != nil}
  434. /// Clears the value of `dependencyEdge`. Subsequent reads from it will return its default value.
  435. mutating func clearDependencyEdge() {_uniqueStorage()._dependencyEdge = nil}
  436. /// [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token.
  437. var lemma: String {
  438. get {return _storage._lemma}
  439. set {_uniqueStorage()._lemma = newValue}
  440. }
  441. var unknownFields = SwiftProtobuf.UnknownStorage()
  442. init() {}
  443. fileprivate var _storage = _StorageClass.defaultInstance
  444. }
  445. /// Represents the feeling associated with the entire text or entities in
  446. /// the text.
  447. struct Google_Cloud_Language_V1_Sentiment {
  448. // SwiftProtobuf.Message conformance is added in an extension below. See the
  449. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  450. // methods supported on all messages.
  451. /// A non-negative number in the [0, +inf) range, which represents
  452. /// the absolute magnitude of sentiment regardless of score (positive or
  453. /// negative).
  454. var magnitude: Float = 0
  455. /// Sentiment score between -1.0 (negative sentiment) and 1.0
  456. /// (positive sentiment).
  457. var score: Float = 0
  458. var unknownFields = SwiftProtobuf.UnknownStorage()
  459. init() {}
  460. }
  461. /// Represents part of speech information for a token. Parts of speech
  462. /// are as defined in
  463. /// http://www.lrec-conf.org/proceedings/lrec2012/pdf/274_Paper.pdf
  464. struct Google_Cloud_Language_V1_PartOfSpeech {
  465. // SwiftProtobuf.Message conformance is added in an extension below. See the
  466. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  467. // methods supported on all messages.
  468. /// The part of speech tag.
  469. var tag: Google_Cloud_Language_V1_PartOfSpeech.Tag = .unknown
  470. /// The grammatical aspect.
  471. var aspect: Google_Cloud_Language_V1_PartOfSpeech.Aspect = .unknown
  472. /// The grammatical case.
  473. var `case`: Google_Cloud_Language_V1_PartOfSpeech.Case = .unknown
  474. /// The grammatical form.
  475. var form: Google_Cloud_Language_V1_PartOfSpeech.Form = .unknown
  476. /// The grammatical gender.
  477. var gender: Google_Cloud_Language_V1_PartOfSpeech.Gender = .unknown
  478. /// The grammatical mood.
  479. var mood: Google_Cloud_Language_V1_PartOfSpeech.Mood = .unknown
  480. /// The grammatical number.
  481. var number: Google_Cloud_Language_V1_PartOfSpeech.Number = .unknown
  482. /// The grammatical person.
  483. var person: Google_Cloud_Language_V1_PartOfSpeech.Person = .unknown
  484. /// The grammatical properness.
  485. var proper: Google_Cloud_Language_V1_PartOfSpeech.Proper = .unknown
  486. /// The grammatical reciprocity.
  487. var reciprocity: Google_Cloud_Language_V1_PartOfSpeech.Reciprocity = .unknown
  488. /// The grammatical tense.
  489. var tense: Google_Cloud_Language_V1_PartOfSpeech.Tense = .unknown
  490. /// The grammatical voice.
  491. var voice: Google_Cloud_Language_V1_PartOfSpeech.Voice = .unknown
  492. var unknownFields = SwiftProtobuf.UnknownStorage()
  493. /// The part of speech tags enum.
  494. enum Tag: SwiftProtobuf.Enum {
  495. typealias RawValue = Int
  496. /// Unknown
  497. case unknown // = 0
  498. /// Adjective
  499. case adj // = 1
  500. /// Adposition (preposition and postposition)
  501. case adp // = 2
  502. /// Adverb
  503. case adv // = 3
  504. /// Conjunction
  505. case conj // = 4
  506. /// Determiner
  507. case det // = 5
  508. /// Noun (common and proper)
  509. case noun // = 6
  510. /// Cardinal number
  511. case num // = 7
  512. /// Pronoun
  513. case pron // = 8
  514. /// Particle or other function word
  515. case prt // = 9
  516. /// Punctuation
  517. case punct // = 10
  518. /// Verb (all tenses and modes)
  519. case verb // = 11
  520. /// Other: foreign words, typos, abbreviations
  521. case x // = 12
  522. /// Affix
  523. case affix // = 13
  524. case UNRECOGNIZED(Int)
  525. init() {
  526. self = .unknown
  527. }
  528. init?(rawValue: Int) {
  529. switch rawValue {
  530. case 0: self = .unknown
  531. case 1: self = .adj
  532. case 2: self = .adp
  533. case 3: self = .adv
  534. case 4: self = .conj
  535. case 5: self = .det
  536. case 6: self = .noun
  537. case 7: self = .num
  538. case 8: self = .pron
  539. case 9: self = .prt
  540. case 10: self = .punct
  541. case 11: self = .verb
  542. case 12: self = .x
  543. case 13: self = .affix
  544. default: self = .UNRECOGNIZED(rawValue)
  545. }
  546. }
  547. var rawValue: Int {
  548. switch self {
  549. case .unknown: return 0
  550. case .adj: return 1
  551. case .adp: return 2
  552. case .adv: return 3
  553. case .conj: return 4
  554. case .det: return 5
  555. case .noun: return 6
  556. case .num: return 7
  557. case .pron: return 8
  558. case .prt: return 9
  559. case .punct: return 10
  560. case .verb: return 11
  561. case .x: return 12
  562. case .affix: return 13
  563. case .UNRECOGNIZED(let i): return i
  564. }
  565. }
  566. }
  567. /// The characteristic of a verb that expresses time flow during an event.
  568. enum Aspect: SwiftProtobuf.Enum {
  569. typealias RawValue = Int
  570. /// Aspect is not applicable in the analyzed language or is not predicted.
  571. case unknown // = 0
  572. /// Perfective
  573. case perfective // = 1
  574. /// Imperfective
  575. case imperfective // = 2
  576. /// Progressive
  577. case progressive // = 3
  578. case UNRECOGNIZED(Int)
  579. init() {
  580. self = .unknown
  581. }
  582. init?(rawValue: Int) {
  583. switch rawValue {
  584. case 0: self = .unknown
  585. case 1: self = .perfective
  586. case 2: self = .imperfective
  587. case 3: self = .progressive
  588. default: self = .UNRECOGNIZED(rawValue)
  589. }
  590. }
  591. var rawValue: Int {
  592. switch self {
  593. case .unknown: return 0
  594. case .perfective: return 1
  595. case .imperfective: return 2
  596. case .progressive: return 3
  597. case .UNRECOGNIZED(let i): return i
  598. }
  599. }
  600. }
  601. /// The grammatical function performed by a noun or pronoun in a phrase,
  602. /// clause, or sentence. In some languages, other parts of speech, such as
  603. /// adjective and determiner, take case inflection in agreement with the noun.
  604. enum Case: SwiftProtobuf.Enum {
  605. typealias RawValue = Int
  606. /// Case is not applicable in the analyzed language or is not predicted.
  607. case unknown // = 0
  608. /// Accusative
  609. case accusative // = 1
  610. /// Adverbial
  611. case adverbial // = 2
  612. /// Complementive
  613. case complementive // = 3
  614. /// Dative
  615. case dative // = 4
  616. /// Genitive
  617. case genitive // = 5
  618. /// Instrumental
  619. case instrumental // = 6
  620. /// Locative
  621. case locative // = 7
  622. /// Nominative
  623. case nominative // = 8
  624. /// Oblique
  625. case oblique // = 9
  626. /// Partitive
  627. case partitive // = 10
  628. /// Prepositional
  629. case prepositional // = 11
  630. /// Reflexive
  631. case reflexiveCase // = 12
  632. /// Relative
  633. case relativeCase // = 13
  634. /// Vocative
  635. case vocative // = 14
  636. case UNRECOGNIZED(Int)
  637. init() {
  638. self = .unknown
  639. }
  640. init?(rawValue: Int) {
  641. switch rawValue {
  642. case 0: self = .unknown
  643. case 1: self = .accusative
  644. case 2: self = .adverbial
  645. case 3: self = .complementive
  646. case 4: self = .dative
  647. case 5: self = .genitive
  648. case 6: self = .instrumental
  649. case 7: self = .locative
  650. case 8: self = .nominative
  651. case 9: self = .oblique
  652. case 10: self = .partitive
  653. case 11: self = .prepositional
  654. case 12: self = .reflexiveCase
  655. case 13: self = .relativeCase
  656. case 14: self = .vocative
  657. default: self = .UNRECOGNIZED(rawValue)
  658. }
  659. }
  660. var rawValue: Int {
  661. switch self {
  662. case .unknown: return 0
  663. case .accusative: return 1
  664. case .adverbial: return 2
  665. case .complementive: return 3
  666. case .dative: return 4
  667. case .genitive: return 5
  668. case .instrumental: return 6
  669. case .locative: return 7
  670. case .nominative: return 8
  671. case .oblique: return 9
  672. case .partitive: return 10
  673. case .prepositional: return 11
  674. case .reflexiveCase: return 12
  675. case .relativeCase: return 13
  676. case .vocative: return 14
  677. case .UNRECOGNIZED(let i): return i
  678. }
  679. }
  680. }
  681. /// Depending on the language, Form can be categorizing different forms of
  682. /// verbs, adjectives, adverbs, etc. For example, categorizing inflected
  683. /// endings of verbs and adjectives or distinguishing between short and long
  684. /// forms of adjectives and participles
  685. enum Form: SwiftProtobuf.Enum {
  686. typealias RawValue = Int
  687. /// Form is not applicable in the analyzed language or is not predicted.
  688. case unknown // = 0
  689. /// Adnomial
  690. case adnomial // = 1
  691. /// Auxiliary
  692. case auxiliary // = 2
  693. /// Complementizer
  694. case complementizer // = 3
  695. /// Final ending
  696. case finalEnding // = 4
  697. /// Gerund
  698. case gerund // = 5
  699. /// Realis
  700. case realis // = 6
  701. /// Irrealis
  702. case irrealis // = 7
  703. /// Short form
  704. case short // = 8
  705. /// Long form
  706. case long // = 9
  707. /// Order form
  708. case order // = 10
  709. /// Specific form
  710. case specific // = 11
  711. case UNRECOGNIZED(Int)
  712. init() {
  713. self = .unknown
  714. }
  715. init?(rawValue: Int) {
  716. switch rawValue {
  717. case 0: self = .unknown
  718. case 1: self = .adnomial
  719. case 2: self = .auxiliary
  720. case 3: self = .complementizer
  721. case 4: self = .finalEnding
  722. case 5: self = .gerund
  723. case 6: self = .realis
  724. case 7: self = .irrealis
  725. case 8: self = .short
  726. case 9: self = .long
  727. case 10: self = .order
  728. case 11: self = .specific
  729. default: self = .UNRECOGNIZED(rawValue)
  730. }
  731. }
  732. var rawValue: Int {
  733. switch self {
  734. case .unknown: return 0
  735. case .adnomial: return 1
  736. case .auxiliary: return 2
  737. case .complementizer: return 3
  738. case .finalEnding: return 4
  739. case .gerund: return 5
  740. case .realis: return 6
  741. case .irrealis: return 7
  742. case .short: return 8
  743. case .long: return 9
  744. case .order: return 10
  745. case .specific: return 11
  746. case .UNRECOGNIZED(let i): return i
  747. }
  748. }
  749. }
  750. /// Gender classes of nouns reflected in the behaviour of associated words.
  751. enum Gender: SwiftProtobuf.Enum {
  752. typealias RawValue = Int
  753. /// Gender is not applicable in the analyzed language or is not predicted.
  754. case unknown // = 0
  755. /// Feminine
  756. case feminine // = 1
  757. /// Masculine
  758. case masculine // = 2
  759. /// Neuter
  760. case neuter // = 3
  761. case UNRECOGNIZED(Int)
  762. init() {
  763. self = .unknown
  764. }
  765. init?(rawValue: Int) {
  766. switch rawValue {
  767. case 0: self = .unknown
  768. case 1: self = .feminine
  769. case 2: self = .masculine
  770. case 3: self = .neuter
  771. default: self = .UNRECOGNIZED(rawValue)
  772. }
  773. }
  774. var rawValue: Int {
  775. switch self {
  776. case .unknown: return 0
  777. case .feminine: return 1
  778. case .masculine: return 2
  779. case .neuter: return 3
  780. case .UNRECOGNIZED(let i): return i
  781. }
  782. }
  783. }
  784. /// The grammatical feature of verbs, used for showing modality and attitude.
  785. enum Mood: SwiftProtobuf.Enum {
  786. typealias RawValue = Int
  787. /// Mood is not applicable in the analyzed language or is not predicted.
  788. case unknown // = 0
  789. /// Conditional
  790. case conditionalMood // = 1
  791. /// Imperative
  792. case imperative // = 2
  793. /// Indicative
  794. case indicative // = 3
  795. /// Interrogative
  796. case interrogative // = 4
  797. /// Jussive
  798. case jussive // = 5
  799. /// Subjunctive
  800. case subjunctive // = 6
  801. case UNRECOGNIZED(Int)
  802. init() {
  803. self = .unknown
  804. }
  805. init?(rawValue: Int) {
  806. switch rawValue {
  807. case 0: self = .unknown
  808. case 1: self = .conditionalMood
  809. case 2: self = .imperative
  810. case 3: self = .indicative
  811. case 4: self = .interrogative
  812. case 5: self = .jussive
  813. case 6: self = .subjunctive
  814. default: self = .UNRECOGNIZED(rawValue)
  815. }
  816. }
  817. var rawValue: Int {
  818. switch self {
  819. case .unknown: return 0
  820. case .conditionalMood: return 1
  821. case .imperative: return 2
  822. case .indicative: return 3
  823. case .interrogative: return 4
  824. case .jussive: return 5
  825. case .subjunctive: return 6
  826. case .UNRECOGNIZED(let i): return i
  827. }
  828. }
  829. }
  830. /// Count distinctions.
  831. enum Number: SwiftProtobuf.Enum {
  832. typealias RawValue = Int
  833. /// Number is not applicable in the analyzed language or is not predicted.
  834. case unknown // = 0
  835. /// Singular
  836. case singular // = 1
  837. /// Plural
  838. case plural // = 2
  839. /// Dual
  840. case dual // = 3
  841. case UNRECOGNIZED(Int)
  842. init() {
  843. self = .unknown
  844. }
  845. init?(rawValue: Int) {
  846. switch rawValue {
  847. case 0: self = .unknown
  848. case 1: self = .singular
  849. case 2: self = .plural
  850. case 3: self = .dual
  851. default: self = .UNRECOGNIZED(rawValue)
  852. }
  853. }
  854. var rawValue: Int {
  855. switch self {
  856. case .unknown: return 0
  857. case .singular: return 1
  858. case .plural: return 2
  859. case .dual: return 3
  860. case .UNRECOGNIZED(let i): return i
  861. }
  862. }
  863. }
  864. /// The distinction between the speaker, second person, third person, etc.
  865. enum Person: SwiftProtobuf.Enum {
  866. typealias RawValue = Int
  867. /// Person is not applicable in the analyzed language or is not predicted.
  868. case unknown // = 0
  869. /// First
  870. case first // = 1
  871. /// Second
  872. case second // = 2
  873. /// Third
  874. case third // = 3
  875. /// Reflexive
  876. case reflexivePerson // = 4
  877. case UNRECOGNIZED(Int)
  878. init() {
  879. self = .unknown
  880. }
  881. init?(rawValue: Int) {
  882. switch rawValue {
  883. case 0: self = .unknown
  884. case 1: self = .first
  885. case 2: self = .second
  886. case 3: self = .third
  887. case 4: self = .reflexivePerson
  888. default: self = .UNRECOGNIZED(rawValue)
  889. }
  890. }
  891. var rawValue: Int {
  892. switch self {
  893. case .unknown: return 0
  894. case .first: return 1
  895. case .second: return 2
  896. case .third: return 3
  897. case .reflexivePerson: return 4
  898. case .UNRECOGNIZED(let i): return i
  899. }
  900. }
  901. }
  902. /// This category shows if the token is part of a proper name.
  903. enum Proper: SwiftProtobuf.Enum {
  904. typealias RawValue = Int
  905. /// Proper is not applicable in the analyzed language or is not predicted.
  906. case unknown // = 0
  907. /// Proper
  908. case proper // = 1
  909. /// Not proper
  910. case notProper // = 2
  911. case UNRECOGNIZED(Int)
  912. init() {
  913. self = .unknown
  914. }
  915. init?(rawValue: Int) {
  916. switch rawValue {
  917. case 0: self = .unknown
  918. case 1: self = .proper
  919. case 2: self = .notProper
  920. default: self = .UNRECOGNIZED(rawValue)
  921. }
  922. }
  923. var rawValue: Int {
  924. switch self {
  925. case .unknown: return 0
  926. case .proper: return 1
  927. case .notProper: return 2
  928. case .UNRECOGNIZED(let i): return i
  929. }
  930. }
  931. }
  932. /// Reciprocal features of a pronoun.
  933. enum Reciprocity: SwiftProtobuf.Enum {
  934. typealias RawValue = Int
  935. /// Reciprocity is not applicable in the analyzed language or is not
  936. /// predicted.
  937. case unknown // = 0
  938. /// Reciprocal
  939. case reciprocal // = 1
  940. /// Non-reciprocal
  941. case nonReciprocal // = 2
  942. case UNRECOGNIZED(Int)
  943. init() {
  944. self = .unknown
  945. }
  946. init?(rawValue: Int) {
  947. switch rawValue {
  948. case 0: self = .unknown
  949. case 1: self = .reciprocal
  950. case 2: self = .nonReciprocal
  951. default: self = .UNRECOGNIZED(rawValue)
  952. }
  953. }
  954. var rawValue: Int {
  955. switch self {
  956. case .unknown: return 0
  957. case .reciprocal: return 1
  958. case .nonReciprocal: return 2
  959. case .UNRECOGNIZED(let i): return i
  960. }
  961. }
  962. }
  963. /// Time reference.
  964. enum Tense: SwiftProtobuf.Enum {
  965. typealias RawValue = Int
  966. /// Tense is not applicable in the analyzed language or is not predicted.
  967. case unknown // = 0
  968. /// Conditional
  969. case conditionalTense // = 1
  970. /// Future
  971. case future // = 2
  972. /// Past
  973. case past // = 3
  974. /// Present
  975. case present // = 4
  976. /// Imperfect
  977. case imperfect // = 5
  978. /// Pluperfect
  979. case pluperfect // = 6
  980. case UNRECOGNIZED(Int)
  981. init() {
  982. self = .unknown
  983. }
  984. init?(rawValue: Int) {
  985. switch rawValue {
  986. case 0: self = .unknown
  987. case 1: self = .conditionalTense
  988. case 2: self = .future
  989. case 3: self = .past
  990. case 4: self = .present
  991. case 5: self = .imperfect
  992. case 6: self = .pluperfect
  993. default: self = .UNRECOGNIZED(rawValue)
  994. }
  995. }
  996. var rawValue: Int {
  997. switch self {
  998. case .unknown: return 0
  999. case .conditionalTense: return 1
  1000. case .future: return 2
  1001. case .past: return 3
  1002. case .present: return 4
  1003. case .imperfect: return 5
  1004. case .pluperfect: return 6
  1005. case .UNRECOGNIZED(let i): return i
  1006. }
  1007. }
  1008. }
  1009. /// The relationship between the action that a verb expresses and the
  1010. /// participants identified by its arguments.
  1011. enum Voice: SwiftProtobuf.Enum {
  1012. typealias RawValue = Int
  1013. /// Voice is not applicable in the analyzed language or is not predicted.
  1014. case unknown // = 0
  1015. /// Active
  1016. case active // = 1
  1017. /// Causative
  1018. case causative // = 2
  1019. /// Passive
  1020. case passive // = 3
  1021. case UNRECOGNIZED(Int)
  1022. init() {
  1023. self = .unknown
  1024. }
  1025. init?(rawValue: Int) {
  1026. switch rawValue {
  1027. case 0: self = .unknown
  1028. case 1: self = .active
  1029. case 2: self = .causative
  1030. case 3: self = .passive
  1031. default: self = .UNRECOGNIZED(rawValue)
  1032. }
  1033. }
  1034. var rawValue: Int {
  1035. switch self {
  1036. case .unknown: return 0
  1037. case .active: return 1
  1038. case .causative: return 2
  1039. case .passive: return 3
  1040. case .UNRECOGNIZED(let i): return i
  1041. }
  1042. }
  1043. }
  1044. init() {}
  1045. }
  1046. #if swift(>=4.2)
  1047. extension Google_Cloud_Language_V1_PartOfSpeech.Tag: CaseIterable {
  1048. // The compiler won't synthesize support with the UNRECOGNIZED case.
  1049. static var allCases: [Google_Cloud_Language_V1_PartOfSpeech.Tag] = [
  1050. .unknown,
  1051. .adj,
  1052. .adp,
  1053. .adv,
  1054. .conj,
  1055. .det,
  1056. .noun,
  1057. .num,
  1058. .pron,
  1059. .prt,
  1060. .punct,
  1061. .verb,
  1062. .x,
  1063. .affix,
  1064. ]
  1065. }
  1066. extension Google_Cloud_Language_V1_PartOfSpeech.Aspect: CaseIterable {
  1067. // The compiler won't synthesize support with the UNRECOGNIZED case.
  1068. static var allCases: [Google_Cloud_Language_V1_PartOfSpeech.Aspect] = [
  1069. .unknown,
  1070. .perfective,
  1071. .imperfective,
  1072. .progressive,
  1073. ]
  1074. }
  1075. extension Google_Cloud_Language_V1_PartOfSpeech.Case: CaseIterable {
  1076. // The compiler won't synthesize support with the UNRECOGNIZED case.
  1077. static var allCases: [Google_Cloud_Language_V1_PartOfSpeech.Case] = [
  1078. .unknown,
  1079. .accusative,
  1080. .adverbial,
  1081. .complementive,
  1082. .dative,
  1083. .genitive,
  1084. .instrumental,
  1085. .locative,
  1086. .nominative,
  1087. .oblique,
  1088. .partitive,
  1089. .prepositional,
  1090. .reflexiveCase,
  1091. .relativeCase,
  1092. .vocative,
  1093. ]
  1094. }
  1095. extension Google_Cloud_Language_V1_PartOfSpeech.Form: CaseIterable {
  1096. // The compiler won't synthesize support with the UNRECOGNIZED case.
  1097. static var allCases: [Google_Cloud_Language_V1_PartOfSpeech.Form] = [
  1098. .unknown,
  1099. .adnomial,
  1100. .auxiliary,
  1101. .complementizer,
  1102. .finalEnding,
  1103. .gerund,
  1104. .realis,
  1105. .irrealis,
  1106. .short,
  1107. .long,
  1108. .order,
  1109. .specific,
  1110. ]
  1111. }
  1112. extension Google_Cloud_Language_V1_PartOfSpeech.Gender: CaseIterable {
  1113. // The compiler won't synthesize support with the UNRECOGNIZED case.
  1114. static var allCases: [Google_Cloud_Language_V1_PartOfSpeech.Gender] = [
  1115. .unknown,
  1116. .feminine,
  1117. .masculine,
  1118. .neuter,
  1119. ]
  1120. }
  1121. extension Google_Cloud_Language_V1_PartOfSpeech.Mood: CaseIterable {
  1122. // The compiler won't synthesize support with the UNRECOGNIZED case.
  1123. static var allCases: [Google_Cloud_Language_V1_PartOfSpeech.Mood] = [
  1124. .unknown,
  1125. .conditionalMood,
  1126. .imperative,
  1127. .indicative,
  1128. .interrogative,
  1129. .jussive,
  1130. .subjunctive,
  1131. ]
  1132. }
  1133. extension Google_Cloud_Language_V1_PartOfSpeech.Number: CaseIterable {
  1134. // The compiler won't synthesize support with the UNRECOGNIZED case.
  1135. static var allCases: [Google_Cloud_Language_V1_PartOfSpeech.Number] = [
  1136. .unknown,
  1137. .singular,
  1138. .plural,
  1139. .dual,
  1140. ]
  1141. }
  1142. extension Google_Cloud_Language_V1_PartOfSpeech.Person: CaseIterable {
  1143. // The compiler won't synthesize support with the UNRECOGNIZED case.
  1144. static var allCases: [Google_Cloud_Language_V1_PartOfSpeech.Person] = [
  1145. .unknown,
  1146. .first,
  1147. .second,
  1148. .third,
  1149. .reflexivePerson,
  1150. ]
  1151. }
  1152. extension Google_Cloud_Language_V1_PartOfSpeech.Proper: CaseIterable {
  1153. // The compiler won't synthesize support with the UNRECOGNIZED case.
  1154. static var allCases: [Google_Cloud_Language_V1_PartOfSpeech.Proper] = [
  1155. .unknown,
  1156. .proper,
  1157. .notProper,
  1158. ]
  1159. }
  1160. extension Google_Cloud_Language_V1_PartOfSpeech.Reciprocity: CaseIterable {
  1161. // The compiler won't synthesize support with the UNRECOGNIZED case.
  1162. static var allCases: [Google_Cloud_Language_V1_PartOfSpeech.Reciprocity] = [
  1163. .unknown,
  1164. .reciprocal,
  1165. .nonReciprocal,
  1166. ]
  1167. }
  1168. extension Google_Cloud_Language_V1_PartOfSpeech.Tense: CaseIterable {
  1169. // The compiler won't synthesize support with the UNRECOGNIZED case.
  1170. static var allCases: [Google_Cloud_Language_V1_PartOfSpeech.Tense] = [
  1171. .unknown,
  1172. .conditionalTense,
  1173. .future,
  1174. .past,
  1175. .present,
  1176. .imperfect,
  1177. .pluperfect,
  1178. ]
  1179. }
  1180. extension Google_Cloud_Language_V1_PartOfSpeech.Voice: CaseIterable {
  1181. // The compiler won't synthesize support with the UNRECOGNIZED case.
  1182. static var allCases: [Google_Cloud_Language_V1_PartOfSpeech.Voice] = [
  1183. .unknown,
  1184. .active,
  1185. .causative,
  1186. .passive,
  1187. ]
  1188. }
  1189. #endif // swift(>=4.2)
  1190. /// Represents dependency parse tree information for a token. (For more
  1191. /// information on dependency labels, see
  1192. /// http://www.aclweb.org/anthology/P13-2017
  1193. struct Google_Cloud_Language_V1_DependencyEdge {
  1194. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1195. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1196. // methods supported on all messages.
  1197. /// Represents the head of this token in the dependency tree.
  1198. /// This is the index of the token which has an arc going to this token.
  1199. /// The index is the position of the token in the array of tokens returned
  1200. /// by the API method. If this token is a root token, then the
  1201. /// `head_token_index` is its own index.
  1202. var headTokenIndex: Int32 = 0
  1203. /// The parse label for the token.
  1204. var label: Google_Cloud_Language_V1_DependencyEdge.Label = .unknown
  1205. var unknownFields = SwiftProtobuf.UnknownStorage()
  1206. /// The parse label enum for the token.
  1207. enum Label: SwiftProtobuf.Enum {
  1208. typealias RawValue = Int
  1209. /// Unknown
  1210. case unknown // = 0
  1211. /// Abbreviation modifier
  1212. case abbrev // = 1
  1213. /// Adjectival complement
  1214. case acomp // = 2
  1215. /// Adverbial clause modifier
  1216. case advcl // = 3
  1217. /// Adverbial modifier
  1218. case advmod // = 4
  1219. /// Adjectival modifier of an NP
  1220. case amod // = 5
  1221. /// Appositional modifier of an NP
  1222. case appos // = 6
  1223. /// Attribute dependent of a copular verb
  1224. case attr // = 7
  1225. /// Auxiliary (non-main) verb
  1226. case aux // = 8
  1227. /// Passive auxiliary
  1228. case auxpass // = 9
  1229. /// Coordinating conjunction
  1230. case cc // = 10
  1231. /// Clausal complement of a verb or adjective
  1232. case ccomp // = 11
  1233. /// Conjunct
  1234. case conj // = 12
  1235. /// Clausal subject
  1236. case csubj // = 13
  1237. /// Clausal passive subject
  1238. case csubjpass // = 14
  1239. /// Dependency (unable to determine)
  1240. case dep // = 15
  1241. /// Determiner
  1242. case det // = 16
  1243. /// Discourse
  1244. case discourse // = 17
  1245. /// Direct object
  1246. case dobj // = 18
  1247. /// Expletive
  1248. case expl // = 19
  1249. /// Goes with (part of a word in a text not well edited)
  1250. case goeswith // = 20
  1251. /// Indirect object
  1252. case iobj // = 21
  1253. /// Marker (word introducing a subordinate clause)
  1254. case mark // = 22
  1255. /// Multi-word expression
  1256. case mwe // = 23
  1257. /// Multi-word verbal expression
  1258. case mwv // = 24
  1259. /// Negation modifier
  1260. case neg // = 25
  1261. /// Noun compound modifier
  1262. case nn // = 26
  1263. /// Noun phrase used as an adverbial modifier
  1264. case npadvmod // = 27
  1265. /// Nominal subject
  1266. case nsubj // = 28
  1267. /// Passive nominal subject
  1268. case nsubjpass // = 29
  1269. /// Numeric modifier of a noun
  1270. case num // = 30
  1271. /// Element of compound number
  1272. case number // = 31
  1273. /// Punctuation mark
  1274. case p // = 32
  1275. /// Parataxis relation
  1276. case parataxis // = 33
  1277. /// Participial modifier
  1278. case partmod // = 34
  1279. /// The complement of a preposition is a clause
  1280. case pcomp // = 35
  1281. /// Object of a preposition
  1282. case pobj // = 36
  1283. /// Possession modifier
  1284. case poss // = 37
  1285. /// Postverbal negative particle
  1286. case postneg // = 38
  1287. /// Predicate complement
  1288. case precomp // = 39
  1289. /// Preconjunt
  1290. case preconj // = 40
  1291. /// Predeterminer
  1292. case predet // = 41
  1293. /// Prefix
  1294. case pref // = 42
  1295. /// Prepositional modifier
  1296. case prep // = 43
  1297. /// The relationship between a verb and verbal morpheme
  1298. case pronl // = 44
  1299. /// Particle
  1300. case prt // = 45
  1301. /// Associative or possessive marker
  1302. case ps // = 46
  1303. /// Quantifier phrase modifier
  1304. case quantmod // = 47
  1305. /// Relative clause modifier
  1306. case rcmod // = 48
  1307. /// Complementizer in relative clause
  1308. case rcmodrel // = 49
  1309. /// Ellipsis without a preceding predicate
  1310. case rdrop // = 50
  1311. /// Referent
  1312. case ref // = 51
  1313. /// Remnant
  1314. case remnant // = 52
  1315. /// Reparandum
  1316. case reparandum // = 53
  1317. /// Root
  1318. case root // = 54
  1319. /// Suffix specifying a unit of number
  1320. case snum // = 55
  1321. /// Suffix
  1322. case suff // = 56
  1323. /// Temporal modifier
  1324. case tmod // = 57
  1325. /// Topic marker
  1326. case topic // = 58
  1327. /// Clause headed by an infinite form of the verb that modifies a noun
  1328. case vmod // = 59
  1329. /// Vocative
  1330. case vocative // = 60
  1331. /// Open clausal complement
  1332. case xcomp // = 61
  1333. /// Name suffix
  1334. case suffix // = 62
  1335. /// Name title
  1336. case title // = 63
  1337. /// Adverbial phrase modifier
  1338. case advphmod // = 64
  1339. /// Causative auxiliary
  1340. case auxcaus // = 65
  1341. /// Helper auxiliary
  1342. case auxvv // = 66
  1343. /// Rentaishi (Prenominal modifier)
  1344. case dtmod // = 67
  1345. /// Foreign words
  1346. case foreign // = 68
  1347. /// Keyword
  1348. case kw // = 69
  1349. /// List for chains of comparable items
  1350. case list // = 70
  1351. /// Nominalized clause
  1352. case nomc // = 71
  1353. /// Nominalized clausal subject
  1354. case nomcsubj // = 72
  1355. /// Nominalized clausal passive
  1356. case nomcsubjpass // = 73
  1357. /// Compound of numeric modifier
  1358. case numc // = 74
  1359. /// Copula
  1360. case cop // = 75
  1361. /// Dislocated relation (for fronted/topicalized elements)
  1362. case dislocated // = 76
  1363. /// Aspect marker
  1364. case asp // = 77
  1365. /// Genitive modifier
  1366. case gmod // = 78
  1367. /// Genitive object
  1368. case gobj // = 79
  1369. /// Infinitival modifier
  1370. case infmod // = 80
  1371. /// Measure
  1372. case mes // = 81
  1373. /// Nominal complement of a noun
  1374. case ncomp // = 82
  1375. case UNRECOGNIZED(Int)
  1376. init() {
  1377. self = .unknown
  1378. }
  1379. init?(rawValue: Int) {
  1380. switch rawValue {
  1381. case 0: self = .unknown
  1382. case 1: self = .abbrev
  1383. case 2: self = .acomp
  1384. case 3: self = .advcl
  1385. case 4: self = .advmod
  1386. case 5: self = .amod
  1387. case 6: self = .appos
  1388. case 7: self = .attr
  1389. case 8: self = .aux
  1390. case 9: self = .auxpass
  1391. case 10: self = .cc
  1392. case 11: self = .ccomp
  1393. case 12: self = .conj
  1394. case 13: self = .csubj
  1395. case 14: self = .csubjpass
  1396. case 15: self = .dep
  1397. case 16: self = .det
  1398. case 17: self = .discourse
  1399. case 18: self = .dobj
  1400. case 19: self = .expl
  1401. case 20: self = .goeswith
  1402. case 21: self = .iobj
  1403. case 22: self = .mark
  1404. case 23: self = .mwe
  1405. case 24: self = .mwv
  1406. case 25: self = .neg
  1407. case 26: self = .nn
  1408. case 27: self = .npadvmod
  1409. case 28: self = .nsubj
  1410. case 29: self = .nsubjpass
  1411. case 30: self = .num
  1412. case 31: self = .number
  1413. case 32: self = .p
  1414. case 33: self = .parataxis
  1415. case 34: self = .partmod
  1416. case 35: self = .pcomp
  1417. case 36: self = .pobj
  1418. case 37: self = .poss
  1419. case 38: self = .postneg
  1420. case 39: self = .precomp
  1421. case 40: self = .preconj
  1422. case 41: self = .predet
  1423. case 42: self = .pref
  1424. case 43: self = .prep
  1425. case 44: self = .pronl
  1426. case 45: self = .prt
  1427. case 46: self = .ps
  1428. case 47: self = .quantmod
  1429. case 48: self = .rcmod
  1430. case 49: self = .rcmodrel
  1431. case 50: self = .rdrop
  1432. case 51: self = .ref
  1433. case 52: self = .remnant
  1434. case 53: self = .reparandum
  1435. case 54: self = .root
  1436. case 55: self = .snum
  1437. case 56: self = .suff
  1438. case 57: self = .tmod
  1439. case 58: self = .topic
  1440. case 59: self = .vmod
  1441. case 60: self = .vocative
  1442. case 61: self = .xcomp
  1443. case 62: self = .suffix
  1444. case 63: self = .title
  1445. case 64: self = .advphmod
  1446. case 65: self = .auxcaus
  1447. case 66: self = .auxvv
  1448. case 67: self = .dtmod
  1449. case 68: self = .foreign
  1450. case 69: self = .kw
  1451. case 70: self = .list
  1452. case 71: self = .nomc
  1453. case 72: self = .nomcsubj
  1454. case 73: self = .nomcsubjpass
  1455. case 74: self = .numc
  1456. case 75: self = .cop
  1457. case 76: self = .dislocated
  1458. case 77: self = .asp
  1459. case 78: self = .gmod
  1460. case 79: self = .gobj
  1461. case 80: self = .infmod
  1462. case 81: self = .mes
  1463. case 82: self = .ncomp
  1464. default: self = .UNRECOGNIZED(rawValue)
  1465. }
  1466. }
  1467. var rawValue: Int {
  1468. switch self {
  1469. case .unknown: return 0
  1470. case .abbrev: return 1
  1471. case .acomp: return 2
  1472. case .advcl: return 3
  1473. case .advmod: return 4
  1474. case .amod: return 5
  1475. case .appos: return 6
  1476. case .attr: return 7
  1477. case .aux: return 8
  1478. case .auxpass: return 9
  1479. case .cc: return 10
  1480. case .ccomp: return 11
  1481. case .conj: return 12
  1482. case .csubj: return 13
  1483. case .csubjpass: return 14
  1484. case .dep: return 15
  1485. case .det: return 16
  1486. case .discourse: return 17
  1487. case .dobj: return 18
  1488. case .expl: return 19
  1489. case .goeswith: return 20
  1490. case .iobj: return 21
  1491. case .mark: return 22
  1492. case .mwe: return 23
  1493. case .mwv: return 24
  1494. case .neg: return 25
  1495. case .nn: return 26
  1496. case .npadvmod: return 27
  1497. case .nsubj: return 28
  1498. case .nsubjpass: return 29
  1499. case .num: return 30
  1500. case .number: return 31
  1501. case .p: return 32
  1502. case .parataxis: return 33
  1503. case .partmod: return 34
  1504. case .pcomp: return 35
  1505. case .pobj: return 36
  1506. case .poss: return 37
  1507. case .postneg: return 38
  1508. case .precomp: return 39
  1509. case .preconj: return 40
  1510. case .predet: return 41
  1511. case .pref: return 42
  1512. case .prep: return 43
  1513. case .pronl: return 44
  1514. case .prt: return 45
  1515. case .ps: return 46
  1516. case .quantmod: return 47
  1517. case .rcmod: return 48
  1518. case .rcmodrel: return 49
  1519. case .rdrop: return 50
  1520. case .ref: return 51
  1521. case .remnant: return 52
  1522. case .reparandum: return 53
  1523. case .root: return 54
  1524. case .snum: return 55
  1525. case .suff: return 56
  1526. case .tmod: return 57
  1527. case .topic: return 58
  1528. case .vmod: return 59
  1529. case .vocative: return 60
  1530. case .xcomp: return 61
  1531. case .suffix: return 62
  1532. case .title: return 63
  1533. case .advphmod: return 64
  1534. case .auxcaus: return 65
  1535. case .auxvv: return 66
  1536. case .dtmod: return 67
  1537. case .foreign: return 68
  1538. case .kw: return 69
  1539. case .list: return 70
  1540. case .nomc: return 71
  1541. case .nomcsubj: return 72
  1542. case .nomcsubjpass: return 73
  1543. case .numc: return 74
  1544. case .cop: return 75
  1545. case .dislocated: return 76
  1546. case .asp: return 77
  1547. case .gmod: return 78
  1548. case .gobj: return 79
  1549. case .infmod: return 80
  1550. case .mes: return 81
  1551. case .ncomp: return 82
  1552. case .UNRECOGNIZED(let i): return i
  1553. }
  1554. }
  1555. }
  1556. init() {}
  1557. }
  1558. #if swift(>=4.2)
  1559. extension Google_Cloud_Language_V1_DependencyEdge.Label: CaseIterable {
  1560. // The compiler won't synthesize support with the UNRECOGNIZED case.
  1561. static var allCases: [Google_Cloud_Language_V1_DependencyEdge.Label] = [
  1562. .unknown,
  1563. .abbrev,
  1564. .acomp,
  1565. .advcl,
  1566. .advmod,
  1567. .amod,
  1568. .appos,
  1569. .attr,
  1570. .aux,
  1571. .auxpass,
  1572. .cc,
  1573. .ccomp,
  1574. .conj,
  1575. .csubj,
  1576. .csubjpass,
  1577. .dep,
  1578. .det,
  1579. .discourse,
  1580. .dobj,
  1581. .expl,
  1582. .goeswith,
  1583. .iobj,
  1584. .mark,
  1585. .mwe,
  1586. .mwv,
  1587. .neg,
  1588. .nn,
  1589. .npadvmod,
  1590. .nsubj,
  1591. .nsubjpass,
  1592. .num,
  1593. .number,
  1594. .p,
  1595. .parataxis,
  1596. .partmod,
  1597. .pcomp,
  1598. .pobj,
  1599. .poss,
  1600. .postneg,
  1601. .precomp,
  1602. .preconj,
  1603. .predet,
  1604. .pref,
  1605. .prep,
  1606. .pronl,
  1607. .prt,
  1608. .ps,
  1609. .quantmod,
  1610. .rcmod,
  1611. .rcmodrel,
  1612. .rdrop,
  1613. .ref,
  1614. .remnant,
  1615. .reparandum,
  1616. .root,
  1617. .snum,
  1618. .suff,
  1619. .tmod,
  1620. .topic,
  1621. .vmod,
  1622. .vocative,
  1623. .xcomp,
  1624. .suffix,
  1625. .title,
  1626. .advphmod,
  1627. .auxcaus,
  1628. .auxvv,
  1629. .dtmod,
  1630. .foreign,
  1631. .kw,
  1632. .list,
  1633. .nomc,
  1634. .nomcsubj,
  1635. .nomcsubjpass,
  1636. .numc,
  1637. .cop,
  1638. .dislocated,
  1639. .asp,
  1640. .gmod,
  1641. .gobj,
  1642. .infmod,
  1643. .mes,
  1644. .ncomp,
  1645. ]
  1646. }
  1647. #endif // swift(>=4.2)
  1648. /// Represents a mention for an entity in the text. Currently, proper noun
  1649. /// mentions are supported.
  1650. struct Google_Cloud_Language_V1_EntityMention {
  1651. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1652. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1653. // methods supported on all messages.
  1654. /// The mention text.
  1655. var text: Google_Cloud_Language_V1_TextSpan {
  1656. get {return _text ?? Google_Cloud_Language_V1_TextSpan()}
  1657. set {_text = newValue}
  1658. }
  1659. /// Returns true if `text` has been explicitly set.
  1660. var hasText: Bool {return self._text != nil}
  1661. /// Clears the value of `text`. Subsequent reads from it will return its default value.
  1662. mutating func clearText() {self._text = nil}
  1663. /// The type of the entity mention.
  1664. var type: Google_Cloud_Language_V1_EntityMention.TypeEnum = .unknown
  1665. /// For calls to [AnalyzeEntitySentiment][] or if
  1666. /// [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
  1667. /// is set to true, this field will contain the sentiment expressed for this
  1668. /// mention of the entity in the provided document.
  1669. var sentiment: Google_Cloud_Language_V1_Sentiment {
  1670. get {return _sentiment ?? Google_Cloud_Language_V1_Sentiment()}
  1671. set {_sentiment = newValue}
  1672. }
  1673. /// Returns true if `sentiment` has been explicitly set.
  1674. var hasSentiment: Bool {return self._sentiment != nil}
  1675. /// Clears the value of `sentiment`. Subsequent reads from it will return its default value.
  1676. mutating func clearSentiment() {self._sentiment = nil}
  1677. var unknownFields = SwiftProtobuf.UnknownStorage()
  1678. /// The supported types of mentions.
  1679. enum TypeEnum: SwiftProtobuf.Enum {
  1680. typealias RawValue = Int
  1681. /// Unknown
  1682. case unknown // = 0
  1683. /// Proper name
  1684. case proper // = 1
  1685. /// Common noun (or noun compound)
  1686. case common // = 2
  1687. case UNRECOGNIZED(Int)
  1688. init() {
  1689. self = .unknown
  1690. }
  1691. init?(rawValue: Int) {
  1692. switch rawValue {
  1693. case 0: self = .unknown
  1694. case 1: self = .proper
  1695. case 2: self = .common
  1696. default: self = .UNRECOGNIZED(rawValue)
  1697. }
  1698. }
  1699. var rawValue: Int {
  1700. switch self {
  1701. case .unknown: return 0
  1702. case .proper: return 1
  1703. case .common: return 2
  1704. case .UNRECOGNIZED(let i): return i
  1705. }
  1706. }
  1707. }
  1708. init() {}
  1709. fileprivate var _text: Google_Cloud_Language_V1_TextSpan? = nil
  1710. fileprivate var _sentiment: Google_Cloud_Language_V1_Sentiment? = nil
  1711. }
  1712. #if swift(>=4.2)
  1713. extension Google_Cloud_Language_V1_EntityMention.TypeEnum: CaseIterable {
  1714. // The compiler won't synthesize support with the UNRECOGNIZED case.
  1715. static var allCases: [Google_Cloud_Language_V1_EntityMention.TypeEnum] = [
  1716. .unknown,
  1717. .proper,
  1718. .common,
  1719. ]
  1720. }
  1721. #endif // swift(>=4.2)
  1722. /// Represents an output piece of text.
  1723. struct Google_Cloud_Language_V1_TextSpan {
  1724. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1725. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1726. // methods supported on all messages.
  1727. /// The content of the output text.
  1728. var content: String = String()
  1729. /// The API calculates the beginning offset of the content in the original
  1730. /// document according to the
  1731. /// [EncodingType][google.cloud.language.v1.EncodingType] specified in the API
  1732. /// request.
  1733. var beginOffset: Int32 = 0
  1734. var unknownFields = SwiftProtobuf.UnknownStorage()
  1735. init() {}
  1736. }
  1737. /// Represents a category returned from the text classifier.
  1738. struct Google_Cloud_Language_V1_ClassificationCategory {
  1739. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1740. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1741. // methods supported on all messages.
  1742. /// The name of the category representing the document, from the [predefined
  1743. /// taxonomy](https://cloud.google.com/natural-language/docs/categories).
  1744. var name: String = String()
  1745. /// The classifier's confidence of the category. Number represents how certain
  1746. /// the classifier is that this category represents the given text.
  1747. var confidence: Float = 0
  1748. var unknownFields = SwiftProtobuf.UnknownStorage()
  1749. init() {}
  1750. }
  1751. /// Model options available for classification requests.
  1752. struct Google_Cloud_Language_V1_ClassificationModelOptions {
  1753. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1754. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1755. // methods supported on all messages.
  1756. /// If this field is not set, then the `v1_model` will be used by default.
  1757. var modelType: Google_Cloud_Language_V1_ClassificationModelOptions.OneOf_ModelType? = nil
  1758. /// Setting this field will use the V1 model and V1 content categories
  1759. /// version. The V1 model is a legacy model; support for this will be
  1760. /// discontinued in the future.
  1761. var v1Model: Google_Cloud_Language_V1_ClassificationModelOptions.V1Model {
  1762. get {
  1763. if case .v1Model(let v)? = modelType {return v}
  1764. return Google_Cloud_Language_V1_ClassificationModelOptions.V1Model()
  1765. }
  1766. set {modelType = .v1Model(newValue)}
  1767. }
  1768. /// Setting this field will use the V2 model with the appropriate content
  1769. /// categories version. The V2 model is a better performing model.
  1770. var v2Model: Google_Cloud_Language_V1_ClassificationModelOptions.V2Model {
  1771. get {
  1772. if case .v2Model(let v)? = modelType {return v}
  1773. return Google_Cloud_Language_V1_ClassificationModelOptions.V2Model()
  1774. }
  1775. set {modelType = .v2Model(newValue)}
  1776. }
  1777. var unknownFields = SwiftProtobuf.UnknownStorage()
  1778. /// If this field is not set, then the `v1_model` will be used by default.
  1779. enum OneOf_ModelType: Equatable {
  1780. /// Setting this field will use the V1 model and V1 content categories
  1781. /// version. The V1 model is a legacy model; support for this will be
  1782. /// discontinued in the future.
  1783. case v1Model(Google_Cloud_Language_V1_ClassificationModelOptions.V1Model)
  1784. /// Setting this field will use the V2 model with the appropriate content
  1785. /// categories version. The V2 model is a better performing model.
  1786. case v2Model(Google_Cloud_Language_V1_ClassificationModelOptions.V2Model)
  1787. #if !swift(>=4.1)
  1788. static func ==(lhs: Google_Cloud_Language_V1_ClassificationModelOptions.OneOf_ModelType, rhs: Google_Cloud_Language_V1_ClassificationModelOptions.OneOf_ModelType) -> Bool {
  1789. // The use of inline closures is to circumvent an issue where the compiler
  1790. // allocates stack space for every case branch when no optimizations are
  1791. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  1792. switch (lhs, rhs) {
  1793. case (.v1Model, .v1Model): return {
  1794. guard case .v1Model(let l) = lhs, case .v1Model(let r) = rhs else { preconditionFailure() }
  1795. return l == r
  1796. }()
  1797. case (.v2Model, .v2Model): return {
  1798. guard case .v2Model(let l) = lhs, case .v2Model(let r) = rhs else { preconditionFailure() }
  1799. return l == r
  1800. }()
  1801. default: return false
  1802. }
  1803. }
  1804. #endif
  1805. }
  1806. /// Options for the V1 model.
  1807. struct V1Model {
  1808. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1809. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1810. // methods supported on all messages.
  1811. var unknownFields = SwiftProtobuf.UnknownStorage()
  1812. init() {}
  1813. }
  1814. /// Options for the V2 model.
  1815. struct V2Model {
  1816. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1817. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1818. // methods supported on all messages.
  1819. /// The content categories used for classification.
  1820. var contentCategoriesVersion: Google_Cloud_Language_V1_ClassificationModelOptions.V2Model.ContentCategoriesVersion = .unspecified
  1821. var unknownFields = SwiftProtobuf.UnknownStorage()
  1822. /// The content categories used for classification.
  1823. enum ContentCategoriesVersion: SwiftProtobuf.Enum {
  1824. typealias RawValue = Int
  1825. /// If `ContentCategoriesVersion` is not specified, this option will
  1826. /// default to `V1`.
  1827. case unspecified // = 0
  1828. /// Legacy content categories of our initial launch in 2017.
  1829. case v1 // = 1
  1830. /// Updated content categories in 2022.
  1831. case v2 // = 2
  1832. case UNRECOGNIZED(Int)
  1833. init() {
  1834. self = .unspecified
  1835. }
  1836. init?(rawValue: Int) {
  1837. switch rawValue {
  1838. case 0: self = .unspecified
  1839. case 1: self = .v1
  1840. case 2: self = .v2
  1841. default: self = .UNRECOGNIZED(rawValue)
  1842. }
  1843. }
  1844. var rawValue: Int {
  1845. switch self {
  1846. case .unspecified: return 0
  1847. case .v1: return 1
  1848. case .v2: return 2
  1849. case .UNRECOGNIZED(let i): return i
  1850. }
  1851. }
  1852. }
  1853. init() {}
  1854. }
  1855. init() {}
  1856. }
  1857. #if swift(>=4.2)
  1858. extension Google_Cloud_Language_V1_ClassificationModelOptions.V2Model.ContentCategoriesVersion: CaseIterable {
  1859. // The compiler won't synthesize support with the UNRECOGNIZED case.
  1860. static var allCases: [Google_Cloud_Language_V1_ClassificationModelOptions.V2Model.ContentCategoriesVersion] = [
  1861. .unspecified,
  1862. .v1,
  1863. .v2,
  1864. ]
  1865. }
  1866. #endif // swift(>=4.2)
  1867. /// The sentiment analysis request message.
  1868. struct Google_Cloud_Language_V1_AnalyzeSentimentRequest {
  1869. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1870. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1871. // methods supported on all messages.
  1872. /// Required. Input document.
  1873. var document: Google_Cloud_Language_V1_Document {
  1874. get {return _document ?? Google_Cloud_Language_V1_Document()}
  1875. set {_document = newValue}
  1876. }
  1877. /// Returns true if `document` has been explicitly set.
  1878. var hasDocument: Bool {return self._document != nil}
  1879. /// Clears the value of `document`. Subsequent reads from it will return its default value.
  1880. mutating func clearDocument() {self._document = nil}
  1881. /// The encoding type used by the API to calculate sentence offsets.
  1882. var encodingType: Google_Cloud_Language_V1_EncodingType = .none
  1883. var unknownFields = SwiftProtobuf.UnknownStorage()
  1884. init() {}
  1885. fileprivate var _document: Google_Cloud_Language_V1_Document? = nil
  1886. }
  1887. /// The sentiment analysis response message.
  1888. struct Google_Cloud_Language_V1_AnalyzeSentimentResponse {
  1889. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1890. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1891. // methods supported on all messages.
  1892. /// The overall sentiment of the input document.
  1893. var documentSentiment: Google_Cloud_Language_V1_Sentiment {
  1894. get {return _documentSentiment ?? Google_Cloud_Language_V1_Sentiment()}
  1895. set {_documentSentiment = newValue}
  1896. }
  1897. /// Returns true if `documentSentiment` has been explicitly set.
  1898. var hasDocumentSentiment: Bool {return self._documentSentiment != nil}
  1899. /// Clears the value of `documentSentiment`. Subsequent reads from it will return its default value.
  1900. mutating func clearDocumentSentiment() {self._documentSentiment = nil}
  1901. /// The language of the text, which will be the same as the language specified
  1902. /// in the request or, if not specified, the automatically-detected language.
  1903. /// See [Document.language][google.cloud.language.v1.Document.language] field
  1904. /// for more details.
  1905. var language: String = String()
  1906. /// The sentiment for all the sentences in the document.
  1907. var sentences: [Google_Cloud_Language_V1_Sentence] = []
  1908. var unknownFields = SwiftProtobuf.UnknownStorage()
  1909. init() {}
  1910. fileprivate var _documentSentiment: Google_Cloud_Language_V1_Sentiment? = nil
  1911. }
  1912. /// The entity-level sentiment analysis request message.
  1913. struct Google_Cloud_Language_V1_AnalyzeEntitySentimentRequest {
  1914. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1915. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1916. // methods supported on all messages.
  1917. /// Required. Input document.
  1918. var document: Google_Cloud_Language_V1_Document {
  1919. get {return _document ?? Google_Cloud_Language_V1_Document()}
  1920. set {_document = newValue}
  1921. }
  1922. /// Returns true if `document` has been explicitly set.
  1923. var hasDocument: Bool {return self._document != nil}
  1924. /// Clears the value of `document`. Subsequent reads from it will return its default value.
  1925. mutating func clearDocument() {self._document = nil}
  1926. /// The encoding type used by the API to calculate offsets.
  1927. var encodingType: Google_Cloud_Language_V1_EncodingType = .none
  1928. var unknownFields = SwiftProtobuf.UnknownStorage()
  1929. init() {}
  1930. fileprivate var _document: Google_Cloud_Language_V1_Document? = nil
  1931. }
  1932. /// The entity-level sentiment analysis response message.
  1933. struct Google_Cloud_Language_V1_AnalyzeEntitySentimentResponse {
  1934. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1935. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1936. // methods supported on all messages.
  1937. /// The recognized entities in the input document with associated sentiments.
  1938. var entities: [Google_Cloud_Language_V1_Entity] = []
  1939. /// The language of the text, which will be the same as the language specified
  1940. /// in the request or, if not specified, the automatically-detected language.
  1941. /// See [Document.language][google.cloud.language.v1.Document.language] field
  1942. /// for more details.
  1943. var language: String = String()
  1944. var unknownFields = SwiftProtobuf.UnknownStorage()
  1945. init() {}
  1946. }
  1947. /// The entity analysis request message.
  1948. struct Google_Cloud_Language_V1_AnalyzeEntitiesRequest {
  1949. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1950. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1951. // methods supported on all messages.
  1952. /// Required. Input document.
  1953. var document: Google_Cloud_Language_V1_Document {
  1954. get {return _document ?? Google_Cloud_Language_V1_Document()}
  1955. set {_document = newValue}
  1956. }
  1957. /// Returns true if `document` has been explicitly set.
  1958. var hasDocument: Bool {return self._document != nil}
  1959. /// Clears the value of `document`. Subsequent reads from it will return its default value.
  1960. mutating func clearDocument() {self._document = nil}
  1961. /// The encoding type used by the API to calculate offsets.
  1962. var encodingType: Google_Cloud_Language_V1_EncodingType = .none
  1963. var unknownFields = SwiftProtobuf.UnknownStorage()
  1964. init() {}
  1965. fileprivate var _document: Google_Cloud_Language_V1_Document? = nil
  1966. }
  1967. /// The entity analysis response message.
  1968. struct Google_Cloud_Language_V1_AnalyzeEntitiesResponse {
  1969. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1970. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1971. // methods supported on all messages.
  1972. /// The recognized entities in the input document.
  1973. var entities: [Google_Cloud_Language_V1_Entity] = []
  1974. /// The language of the text, which will be the same as the language specified
  1975. /// in the request or, if not specified, the automatically-detected language.
  1976. /// See [Document.language][google.cloud.language.v1.Document.language] field
  1977. /// for more details.
  1978. var language: String = String()
  1979. var unknownFields = SwiftProtobuf.UnknownStorage()
  1980. init() {}
  1981. }
  1982. /// The syntax analysis request message.
  1983. struct Google_Cloud_Language_V1_AnalyzeSyntaxRequest {
  1984. // SwiftProtobuf.Message conformance is added in an extension below. See the
  1985. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  1986. // methods supported on all messages.
  1987. /// Required. Input document.
  1988. var document: Google_Cloud_Language_V1_Document {
  1989. get {return _document ?? Google_Cloud_Language_V1_Document()}
  1990. set {_document = newValue}
  1991. }
  1992. /// Returns true if `document` has been explicitly set.
  1993. var hasDocument: Bool {return self._document != nil}
  1994. /// Clears the value of `document`. Subsequent reads from it will return its default value.
  1995. mutating func clearDocument() {self._document = nil}
  1996. /// The encoding type used by the API to calculate offsets.
  1997. var encodingType: Google_Cloud_Language_V1_EncodingType = .none
  1998. var unknownFields = SwiftProtobuf.UnknownStorage()
  1999. init() {}
  2000. fileprivate var _document: Google_Cloud_Language_V1_Document? = nil
  2001. }
  2002. /// The syntax analysis response message.
  2003. struct Google_Cloud_Language_V1_AnalyzeSyntaxResponse {
  2004. // SwiftProtobuf.Message conformance is added in an extension below. See the
  2005. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  2006. // methods supported on all messages.
  2007. /// Sentences in the input document.
  2008. var sentences: [Google_Cloud_Language_V1_Sentence] = []
  2009. /// Tokens, along with their syntactic information, in the input document.
  2010. var tokens: [Google_Cloud_Language_V1_Token] = []
  2011. /// The language of the text, which will be the same as the language specified
  2012. /// in the request or, if not specified, the automatically-detected language.
  2013. /// See [Document.language][google.cloud.language.v1.Document.language] field
  2014. /// for more details.
  2015. var language: String = String()
  2016. var unknownFields = SwiftProtobuf.UnknownStorage()
  2017. init() {}
  2018. }
  2019. /// The document classification request message.
  2020. struct Google_Cloud_Language_V1_ClassifyTextRequest {
  2021. // SwiftProtobuf.Message conformance is added in an extension below. See the
  2022. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  2023. // methods supported on all messages.
  2024. /// Required. Input document.
  2025. var document: Google_Cloud_Language_V1_Document {
  2026. get {return _document ?? Google_Cloud_Language_V1_Document()}
  2027. set {_document = newValue}
  2028. }
  2029. /// Returns true if `document` has been explicitly set.
  2030. var hasDocument: Bool {return self._document != nil}
  2031. /// Clears the value of `document`. Subsequent reads from it will return its default value.
  2032. mutating func clearDocument() {self._document = nil}
  2033. /// Model options to use for classification. Defaults to v1 options if not
  2034. /// specified.
  2035. var classificationModelOptions: Google_Cloud_Language_V1_ClassificationModelOptions {
  2036. get {return _classificationModelOptions ?? Google_Cloud_Language_V1_ClassificationModelOptions()}
  2037. set {_classificationModelOptions = newValue}
  2038. }
  2039. /// Returns true if `classificationModelOptions` has been explicitly set.
  2040. var hasClassificationModelOptions: Bool {return self._classificationModelOptions != nil}
  2041. /// Clears the value of `classificationModelOptions`. Subsequent reads from it will return its default value.
  2042. mutating func clearClassificationModelOptions() {self._classificationModelOptions = nil}
  2043. var unknownFields = SwiftProtobuf.UnknownStorage()
  2044. init() {}
  2045. fileprivate var _document: Google_Cloud_Language_V1_Document? = nil
  2046. fileprivate var _classificationModelOptions: Google_Cloud_Language_V1_ClassificationModelOptions? = nil
  2047. }
  2048. /// The document classification response message.
  2049. struct Google_Cloud_Language_V1_ClassifyTextResponse {
  2050. // SwiftProtobuf.Message conformance is added in an extension below. See the
  2051. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  2052. // methods supported on all messages.
  2053. /// Categories representing the input document.
  2054. var categories: [Google_Cloud_Language_V1_ClassificationCategory] = []
  2055. var unknownFields = SwiftProtobuf.UnknownStorage()
  2056. init() {}
  2057. }
  2058. /// The request message for the text annotation API, which can perform multiple
  2059. /// analysis types (sentiment, entities, and syntax) in one call.
  2060. struct Google_Cloud_Language_V1_AnnotateTextRequest {
  2061. // SwiftProtobuf.Message conformance is added in an extension below. See the
  2062. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  2063. // methods supported on all messages.
  2064. /// Required. Input document.
  2065. var document: Google_Cloud_Language_V1_Document {
  2066. get {return _document ?? Google_Cloud_Language_V1_Document()}
  2067. set {_document = newValue}
  2068. }
  2069. /// Returns true if `document` has been explicitly set.
  2070. var hasDocument: Bool {return self._document != nil}
  2071. /// Clears the value of `document`. Subsequent reads from it will return its default value.
  2072. mutating func clearDocument() {self._document = nil}
  2073. /// Required. The enabled features.
  2074. var features: Google_Cloud_Language_V1_AnnotateTextRequest.Features {
  2075. get {return _features ?? Google_Cloud_Language_V1_AnnotateTextRequest.Features()}
  2076. set {_features = newValue}
  2077. }
  2078. /// Returns true if `features` has been explicitly set.
  2079. var hasFeatures: Bool {return self._features != nil}
  2080. /// Clears the value of `features`. Subsequent reads from it will return its default value.
  2081. mutating func clearFeatures() {self._features = nil}
  2082. /// The encoding type used by the API to calculate offsets.
  2083. var encodingType: Google_Cloud_Language_V1_EncodingType = .none
  2084. var unknownFields = SwiftProtobuf.UnknownStorage()
  2085. /// All available features for sentiment, syntax, and semantic analysis.
  2086. /// Setting each one to true will enable that specific analysis for the input.
  2087. struct Features {
  2088. // SwiftProtobuf.Message conformance is added in an extension below. See the
  2089. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  2090. // methods supported on all messages.
  2091. /// Extract syntax information.
  2092. var extractSyntax: Bool = false
  2093. /// Extract entities.
  2094. var extractEntities: Bool = false
  2095. /// Extract document-level sentiment.
  2096. var extractDocumentSentiment: Bool = false
  2097. /// Extract entities and their associated sentiment.
  2098. var extractEntitySentiment: Bool = false
  2099. /// Classify the full document into categories.
  2100. var classifyText: Bool = false
  2101. /// The model options to use for classification. Defaults to v1 options
  2102. /// if not specified. Only used if `classify_text` is set to true.
  2103. var classificationModelOptions: Google_Cloud_Language_V1_ClassificationModelOptions {
  2104. get {return _classificationModelOptions ?? Google_Cloud_Language_V1_ClassificationModelOptions()}
  2105. set {_classificationModelOptions = newValue}
  2106. }
  2107. /// Returns true if `classificationModelOptions` has been explicitly set.
  2108. var hasClassificationModelOptions: Bool {return self._classificationModelOptions != nil}
  2109. /// Clears the value of `classificationModelOptions`. Subsequent reads from it will return its default value.
  2110. mutating func clearClassificationModelOptions() {self._classificationModelOptions = nil}
  2111. var unknownFields = SwiftProtobuf.UnknownStorage()
  2112. init() {}
  2113. fileprivate var _classificationModelOptions: Google_Cloud_Language_V1_ClassificationModelOptions? = nil
  2114. }
  2115. init() {}
  2116. fileprivate var _document: Google_Cloud_Language_V1_Document? = nil
  2117. fileprivate var _features: Google_Cloud_Language_V1_AnnotateTextRequest.Features? = nil
  2118. }
  2119. /// The text annotations response message.
  2120. struct Google_Cloud_Language_V1_AnnotateTextResponse {
  2121. // SwiftProtobuf.Message conformance is added in an extension below. See the
  2122. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  2123. // methods supported on all messages.
  2124. /// Sentences in the input document. Populated if the user enables
  2125. /// [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
  2126. var sentences: [Google_Cloud_Language_V1_Sentence] = []
  2127. /// Tokens, along with their syntactic information, in the input document.
  2128. /// Populated if the user enables
  2129. /// [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
  2130. var tokens: [Google_Cloud_Language_V1_Token] = []
  2131. /// Entities, along with their semantic information, in the input document.
  2132. /// Populated if the user enables
  2133. /// [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entities].
  2134. var entities: [Google_Cloud_Language_V1_Entity] = []
  2135. /// The overall sentiment for the document. Populated if the user enables
  2136. /// [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment].
  2137. var documentSentiment: Google_Cloud_Language_V1_Sentiment {
  2138. get {return _documentSentiment ?? Google_Cloud_Language_V1_Sentiment()}
  2139. set {_documentSentiment = newValue}
  2140. }
  2141. /// Returns true if `documentSentiment` has been explicitly set.
  2142. var hasDocumentSentiment: Bool {return self._documentSentiment != nil}
  2143. /// Clears the value of `documentSentiment`. Subsequent reads from it will return its default value.
  2144. mutating func clearDocumentSentiment() {self._documentSentiment = nil}
  2145. /// The language of the text, which will be the same as the language specified
  2146. /// in the request or, if not specified, the automatically-detected language.
  2147. /// See [Document.language][google.cloud.language.v1.Document.language] field
  2148. /// for more details.
  2149. var language: String = String()
  2150. /// Categories identified in the input document.
  2151. var categories: [Google_Cloud_Language_V1_ClassificationCategory] = []
  2152. var unknownFields = SwiftProtobuf.UnknownStorage()
  2153. init() {}
  2154. fileprivate var _documentSentiment: Google_Cloud_Language_V1_Sentiment? = nil
  2155. }
  2156. #if swift(>=5.5) && canImport(_Concurrency)
  2157. extension Google_Cloud_Language_V1_EncodingType: @unchecked Sendable {}
  2158. extension Google_Cloud_Language_V1_Document: @unchecked Sendable {}
  2159. extension Google_Cloud_Language_V1_Document.OneOf_Source: @unchecked Sendable {}
  2160. extension Google_Cloud_Language_V1_Document.TypeEnum: @unchecked Sendable {}
  2161. extension Google_Cloud_Language_V1_Sentence: @unchecked Sendable {}
  2162. extension Google_Cloud_Language_V1_Entity: @unchecked Sendable {}
  2163. extension Google_Cloud_Language_V1_Entity.TypeEnum: @unchecked Sendable {}
  2164. extension Google_Cloud_Language_V1_Token: @unchecked Sendable {}
  2165. extension Google_Cloud_Language_V1_Sentiment: @unchecked Sendable {}
  2166. extension Google_Cloud_Language_V1_PartOfSpeech: @unchecked Sendable {}
  2167. extension Google_Cloud_Language_V1_PartOfSpeech.Tag: @unchecked Sendable {}
  2168. extension Google_Cloud_Language_V1_PartOfSpeech.Aspect: @unchecked Sendable {}
  2169. extension Google_Cloud_Language_V1_PartOfSpeech.Case: @unchecked Sendable {}
  2170. extension Google_Cloud_Language_V1_PartOfSpeech.Form: @unchecked Sendable {}
  2171. extension Google_Cloud_Language_V1_PartOfSpeech.Gender: @unchecked Sendable {}
  2172. extension Google_Cloud_Language_V1_PartOfSpeech.Mood: @unchecked Sendable {}
  2173. extension Google_Cloud_Language_V1_PartOfSpeech.Number: @unchecked Sendable {}
  2174. extension Google_Cloud_Language_V1_PartOfSpeech.Person: @unchecked Sendable {}
  2175. extension Google_Cloud_Language_V1_PartOfSpeech.Proper: @unchecked Sendable {}
  2176. extension Google_Cloud_Language_V1_PartOfSpeech.Reciprocity: @unchecked Sendable {}
  2177. extension Google_Cloud_Language_V1_PartOfSpeech.Tense: @unchecked Sendable {}
  2178. extension Google_Cloud_Language_V1_PartOfSpeech.Voice: @unchecked Sendable {}
  2179. extension Google_Cloud_Language_V1_DependencyEdge: @unchecked Sendable {}
  2180. extension Google_Cloud_Language_V1_DependencyEdge.Label: @unchecked Sendable {}
  2181. extension Google_Cloud_Language_V1_EntityMention: @unchecked Sendable {}
  2182. extension Google_Cloud_Language_V1_EntityMention.TypeEnum: @unchecked Sendable {}
  2183. extension Google_Cloud_Language_V1_TextSpan: @unchecked Sendable {}
  2184. extension Google_Cloud_Language_V1_ClassificationCategory: @unchecked Sendable {}
  2185. extension Google_Cloud_Language_V1_ClassificationModelOptions: @unchecked Sendable {}
  2186. extension Google_Cloud_Language_V1_ClassificationModelOptions.OneOf_ModelType: @unchecked Sendable {}
  2187. extension Google_Cloud_Language_V1_ClassificationModelOptions.V1Model: @unchecked Sendable {}
  2188. extension Google_Cloud_Language_V1_ClassificationModelOptions.V2Model: @unchecked Sendable {}
  2189. extension Google_Cloud_Language_V1_ClassificationModelOptions.V2Model.ContentCategoriesVersion: @unchecked Sendable {}
  2190. extension Google_Cloud_Language_V1_AnalyzeSentimentRequest: @unchecked Sendable {}
  2191. extension Google_Cloud_Language_V1_AnalyzeSentimentResponse: @unchecked Sendable {}
  2192. extension Google_Cloud_Language_V1_AnalyzeEntitySentimentRequest: @unchecked Sendable {}
  2193. extension Google_Cloud_Language_V1_AnalyzeEntitySentimentResponse: @unchecked Sendable {}
  2194. extension Google_Cloud_Language_V1_AnalyzeEntitiesRequest: @unchecked Sendable {}
  2195. extension Google_Cloud_Language_V1_AnalyzeEntitiesResponse: @unchecked Sendable {}
  2196. extension Google_Cloud_Language_V1_AnalyzeSyntaxRequest: @unchecked Sendable {}
  2197. extension Google_Cloud_Language_V1_AnalyzeSyntaxResponse: @unchecked Sendable {}
  2198. extension Google_Cloud_Language_V1_ClassifyTextRequest: @unchecked Sendable {}
  2199. extension Google_Cloud_Language_V1_ClassifyTextResponse: @unchecked Sendable {}
  2200. extension Google_Cloud_Language_V1_AnnotateTextRequest: @unchecked Sendable {}
  2201. extension Google_Cloud_Language_V1_AnnotateTextRequest.Features: @unchecked Sendable {}
  2202. extension Google_Cloud_Language_V1_AnnotateTextResponse: @unchecked Sendable {}
  2203. #endif // swift(>=5.5) && canImport(_Concurrency)
  2204. // MARK: - Code below here is support for the SwiftProtobuf runtime.
  2205. fileprivate let _protobuf_package = "google.cloud.language.v1"
  2206. extension Google_Cloud_Language_V1_EncodingType: SwiftProtobuf._ProtoNameProviding {
  2207. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2208. 0: .same(proto: "NONE"),
  2209. 1: .same(proto: "UTF8"),
  2210. 2: .same(proto: "UTF16"),
  2211. 3: .same(proto: "UTF32"),
  2212. ]
  2213. }
  2214. extension Google_Cloud_Language_V1_Document: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2215. static let protoMessageName: String = _protobuf_package + ".Document"
  2216. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2217. 1: .same(proto: "type"),
  2218. 2: .same(proto: "content"),
  2219. 3: .standard(proto: "gcs_content_uri"),
  2220. 4: .same(proto: "language"),
  2221. ]
  2222. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2223. while let fieldNumber = try decoder.nextFieldNumber() {
  2224. // The use of inline closures is to circumvent an issue where the compiler
  2225. // allocates stack space for every case branch when no optimizations are
  2226. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2227. switch fieldNumber {
  2228. case 1: try { try decoder.decodeSingularEnumField(value: &self.type) }()
  2229. case 2: try {
  2230. var v: String?
  2231. try decoder.decodeSingularStringField(value: &v)
  2232. if let v = v {
  2233. if self.source != nil {try decoder.handleConflictingOneOf()}
  2234. self.source = .content(v)
  2235. }
  2236. }()
  2237. case 3: try {
  2238. var v: String?
  2239. try decoder.decodeSingularStringField(value: &v)
  2240. if let v = v {
  2241. if self.source != nil {try decoder.handleConflictingOneOf()}
  2242. self.source = .gcsContentUri(v)
  2243. }
  2244. }()
  2245. case 4: try { try decoder.decodeSingularStringField(value: &self.language) }()
  2246. default: break
  2247. }
  2248. }
  2249. }
  2250. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2251. // The use of inline closures is to circumvent an issue where the compiler
  2252. // allocates stack space for every if/case branch local when no optimizations
  2253. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  2254. // https://github.com/apple/swift-protobuf/issues/1182
  2255. if self.type != .unspecified {
  2256. try visitor.visitSingularEnumField(value: self.type, fieldNumber: 1)
  2257. }
  2258. switch self.source {
  2259. case .content?: try {
  2260. guard case .content(let v)? = self.source else { preconditionFailure() }
  2261. try visitor.visitSingularStringField(value: v, fieldNumber: 2)
  2262. }()
  2263. case .gcsContentUri?: try {
  2264. guard case .gcsContentUri(let v)? = self.source else { preconditionFailure() }
  2265. try visitor.visitSingularStringField(value: v, fieldNumber: 3)
  2266. }()
  2267. case nil: break
  2268. }
  2269. if !self.language.isEmpty {
  2270. try visitor.visitSingularStringField(value: self.language, fieldNumber: 4)
  2271. }
  2272. try unknownFields.traverse(visitor: &visitor)
  2273. }
  2274. static func ==(lhs: Google_Cloud_Language_V1_Document, rhs: Google_Cloud_Language_V1_Document) -> Bool {
  2275. if lhs.type != rhs.type {return false}
  2276. if lhs.source != rhs.source {return false}
  2277. if lhs.language != rhs.language {return false}
  2278. if lhs.unknownFields != rhs.unknownFields {return false}
  2279. return true
  2280. }
  2281. }
  2282. extension Google_Cloud_Language_V1_Document.TypeEnum: SwiftProtobuf._ProtoNameProviding {
  2283. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2284. 0: .same(proto: "TYPE_UNSPECIFIED"),
  2285. 1: .same(proto: "PLAIN_TEXT"),
  2286. 2: .same(proto: "HTML"),
  2287. ]
  2288. }
  2289. extension Google_Cloud_Language_V1_Sentence: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2290. static let protoMessageName: String = _protobuf_package + ".Sentence"
  2291. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2292. 1: .same(proto: "text"),
  2293. 2: .same(proto: "sentiment"),
  2294. ]
  2295. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2296. while let fieldNumber = try decoder.nextFieldNumber() {
  2297. // The use of inline closures is to circumvent an issue where the compiler
  2298. // allocates stack space for every case branch when no optimizations are
  2299. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2300. switch fieldNumber {
  2301. case 1: try { try decoder.decodeSingularMessageField(value: &self._text) }()
  2302. case 2: try { try decoder.decodeSingularMessageField(value: &self._sentiment) }()
  2303. default: break
  2304. }
  2305. }
  2306. }
  2307. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2308. // The use of inline closures is to circumvent an issue where the compiler
  2309. // allocates stack space for every if/case branch local when no optimizations
  2310. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  2311. // https://github.com/apple/swift-protobuf/issues/1182
  2312. try { if let v = self._text {
  2313. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  2314. } }()
  2315. try { if let v = self._sentiment {
  2316. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  2317. } }()
  2318. try unknownFields.traverse(visitor: &visitor)
  2319. }
  2320. static func ==(lhs: Google_Cloud_Language_V1_Sentence, rhs: Google_Cloud_Language_V1_Sentence) -> Bool {
  2321. if lhs._text != rhs._text {return false}
  2322. if lhs._sentiment != rhs._sentiment {return false}
  2323. if lhs.unknownFields != rhs.unknownFields {return false}
  2324. return true
  2325. }
  2326. }
  2327. extension Google_Cloud_Language_V1_Entity: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2328. static let protoMessageName: String = _protobuf_package + ".Entity"
  2329. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2330. 1: .same(proto: "name"),
  2331. 2: .same(proto: "type"),
  2332. 3: .same(proto: "metadata"),
  2333. 4: .same(proto: "salience"),
  2334. 5: .same(proto: "mentions"),
  2335. 6: .same(proto: "sentiment"),
  2336. ]
  2337. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2338. while let fieldNumber = try decoder.nextFieldNumber() {
  2339. // The use of inline closures is to circumvent an issue where the compiler
  2340. // allocates stack space for every case branch when no optimizations are
  2341. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2342. switch fieldNumber {
  2343. case 1: try { try decoder.decodeSingularStringField(value: &self.name) }()
  2344. case 2: try { try decoder.decodeSingularEnumField(value: &self.type) }()
  2345. case 3: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: &self.metadata) }()
  2346. case 4: try { try decoder.decodeSingularFloatField(value: &self.salience) }()
  2347. case 5: try { try decoder.decodeRepeatedMessageField(value: &self.mentions) }()
  2348. case 6: try { try decoder.decodeSingularMessageField(value: &self._sentiment) }()
  2349. default: break
  2350. }
  2351. }
  2352. }
  2353. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2354. // The use of inline closures is to circumvent an issue where the compiler
  2355. // allocates stack space for every if/case branch local when no optimizations
  2356. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  2357. // https://github.com/apple/swift-protobuf/issues/1182
  2358. if !self.name.isEmpty {
  2359. try visitor.visitSingularStringField(value: self.name, fieldNumber: 1)
  2360. }
  2361. if self.type != .unknown {
  2362. try visitor.visitSingularEnumField(value: self.type, fieldNumber: 2)
  2363. }
  2364. if !self.metadata.isEmpty {
  2365. try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: self.metadata, fieldNumber: 3)
  2366. }
  2367. if self.salience != 0 {
  2368. try visitor.visitSingularFloatField(value: self.salience, fieldNumber: 4)
  2369. }
  2370. if !self.mentions.isEmpty {
  2371. try visitor.visitRepeatedMessageField(value: self.mentions, fieldNumber: 5)
  2372. }
  2373. try { if let v = self._sentiment {
  2374. try visitor.visitSingularMessageField(value: v, fieldNumber: 6)
  2375. } }()
  2376. try unknownFields.traverse(visitor: &visitor)
  2377. }
  2378. static func ==(lhs: Google_Cloud_Language_V1_Entity, rhs: Google_Cloud_Language_V1_Entity) -> Bool {
  2379. if lhs.name != rhs.name {return false}
  2380. if lhs.type != rhs.type {return false}
  2381. if lhs.metadata != rhs.metadata {return false}
  2382. if lhs.salience != rhs.salience {return false}
  2383. if lhs.mentions != rhs.mentions {return false}
  2384. if lhs._sentiment != rhs._sentiment {return false}
  2385. if lhs.unknownFields != rhs.unknownFields {return false}
  2386. return true
  2387. }
  2388. }
  2389. extension Google_Cloud_Language_V1_Entity.TypeEnum: SwiftProtobuf._ProtoNameProviding {
  2390. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2391. 0: .same(proto: "UNKNOWN"),
  2392. 1: .same(proto: "PERSON"),
  2393. 2: .same(proto: "LOCATION"),
  2394. 3: .same(proto: "ORGANIZATION"),
  2395. 4: .same(proto: "EVENT"),
  2396. 5: .same(proto: "WORK_OF_ART"),
  2397. 6: .same(proto: "CONSUMER_GOOD"),
  2398. 7: .same(proto: "OTHER"),
  2399. 9: .same(proto: "PHONE_NUMBER"),
  2400. 10: .same(proto: "ADDRESS"),
  2401. 11: .same(proto: "DATE"),
  2402. 12: .same(proto: "NUMBER"),
  2403. 13: .same(proto: "PRICE"),
  2404. ]
  2405. }
  2406. extension Google_Cloud_Language_V1_Token: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2407. static let protoMessageName: String = _protobuf_package + ".Token"
  2408. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2409. 1: .same(proto: "text"),
  2410. 2: .standard(proto: "part_of_speech"),
  2411. 3: .standard(proto: "dependency_edge"),
  2412. 4: .same(proto: "lemma"),
  2413. ]
  2414. fileprivate class _StorageClass {
  2415. var _text: Google_Cloud_Language_V1_TextSpan? = nil
  2416. var _partOfSpeech: Google_Cloud_Language_V1_PartOfSpeech? = nil
  2417. var _dependencyEdge: Google_Cloud_Language_V1_DependencyEdge? = nil
  2418. var _lemma: String = String()
  2419. static let defaultInstance = _StorageClass()
  2420. private init() {}
  2421. init(copying source: _StorageClass) {
  2422. _text = source._text
  2423. _partOfSpeech = source._partOfSpeech
  2424. _dependencyEdge = source._dependencyEdge
  2425. _lemma = source._lemma
  2426. }
  2427. }
  2428. fileprivate mutating func _uniqueStorage() -> _StorageClass {
  2429. if !isKnownUniquelyReferenced(&_storage) {
  2430. _storage = _StorageClass(copying: _storage)
  2431. }
  2432. return _storage
  2433. }
  2434. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2435. _ = _uniqueStorage()
  2436. try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
  2437. while let fieldNumber = try decoder.nextFieldNumber() {
  2438. // The use of inline closures is to circumvent an issue where the compiler
  2439. // allocates stack space for every case branch when no optimizations are
  2440. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2441. switch fieldNumber {
  2442. case 1: try { try decoder.decodeSingularMessageField(value: &_storage._text) }()
  2443. case 2: try { try decoder.decodeSingularMessageField(value: &_storage._partOfSpeech) }()
  2444. case 3: try { try decoder.decodeSingularMessageField(value: &_storage._dependencyEdge) }()
  2445. case 4: try { try decoder.decodeSingularStringField(value: &_storage._lemma) }()
  2446. default: break
  2447. }
  2448. }
  2449. }
  2450. }
  2451. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2452. try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
  2453. // The use of inline closures is to circumvent an issue where the compiler
  2454. // allocates stack space for every if/case branch local when no optimizations
  2455. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  2456. // https://github.com/apple/swift-protobuf/issues/1182
  2457. try { if let v = _storage._text {
  2458. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  2459. } }()
  2460. try { if let v = _storage._partOfSpeech {
  2461. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  2462. } }()
  2463. try { if let v = _storage._dependencyEdge {
  2464. try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
  2465. } }()
  2466. if !_storage._lemma.isEmpty {
  2467. try visitor.visitSingularStringField(value: _storage._lemma, fieldNumber: 4)
  2468. }
  2469. }
  2470. try unknownFields.traverse(visitor: &visitor)
  2471. }
  2472. static func ==(lhs: Google_Cloud_Language_V1_Token, rhs: Google_Cloud_Language_V1_Token) -> Bool {
  2473. if lhs._storage !== rhs._storage {
  2474. let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
  2475. let _storage = _args.0
  2476. let rhs_storage = _args.1
  2477. if _storage._text != rhs_storage._text {return false}
  2478. if _storage._partOfSpeech != rhs_storage._partOfSpeech {return false}
  2479. if _storage._dependencyEdge != rhs_storage._dependencyEdge {return false}
  2480. if _storage._lemma != rhs_storage._lemma {return false}
  2481. return true
  2482. }
  2483. if !storagesAreEqual {return false}
  2484. }
  2485. if lhs.unknownFields != rhs.unknownFields {return false}
  2486. return true
  2487. }
  2488. }
  2489. extension Google_Cloud_Language_V1_Sentiment: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2490. static let protoMessageName: String = _protobuf_package + ".Sentiment"
  2491. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2492. 2: .same(proto: "magnitude"),
  2493. 3: .same(proto: "score"),
  2494. ]
  2495. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2496. while let fieldNumber = try decoder.nextFieldNumber() {
  2497. // The use of inline closures is to circumvent an issue where the compiler
  2498. // allocates stack space for every case branch when no optimizations are
  2499. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2500. switch fieldNumber {
  2501. case 2: try { try decoder.decodeSingularFloatField(value: &self.magnitude) }()
  2502. case 3: try { try decoder.decodeSingularFloatField(value: &self.score) }()
  2503. default: break
  2504. }
  2505. }
  2506. }
  2507. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2508. if self.magnitude != 0 {
  2509. try visitor.visitSingularFloatField(value: self.magnitude, fieldNumber: 2)
  2510. }
  2511. if self.score != 0 {
  2512. try visitor.visitSingularFloatField(value: self.score, fieldNumber: 3)
  2513. }
  2514. try unknownFields.traverse(visitor: &visitor)
  2515. }
  2516. static func ==(lhs: Google_Cloud_Language_V1_Sentiment, rhs: Google_Cloud_Language_V1_Sentiment) -> Bool {
  2517. if lhs.magnitude != rhs.magnitude {return false}
  2518. if lhs.score != rhs.score {return false}
  2519. if lhs.unknownFields != rhs.unknownFields {return false}
  2520. return true
  2521. }
  2522. }
  2523. extension Google_Cloud_Language_V1_PartOfSpeech: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2524. static let protoMessageName: String = _protobuf_package + ".PartOfSpeech"
  2525. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2526. 1: .same(proto: "tag"),
  2527. 2: .same(proto: "aspect"),
  2528. 3: .same(proto: "case"),
  2529. 4: .same(proto: "form"),
  2530. 5: .same(proto: "gender"),
  2531. 6: .same(proto: "mood"),
  2532. 7: .same(proto: "number"),
  2533. 8: .same(proto: "person"),
  2534. 9: .same(proto: "proper"),
  2535. 10: .same(proto: "reciprocity"),
  2536. 11: .same(proto: "tense"),
  2537. 12: .same(proto: "voice"),
  2538. ]
  2539. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2540. while let fieldNumber = try decoder.nextFieldNumber() {
  2541. // The use of inline closures is to circumvent an issue where the compiler
  2542. // allocates stack space for every case branch when no optimizations are
  2543. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2544. switch fieldNumber {
  2545. case 1: try { try decoder.decodeSingularEnumField(value: &self.tag) }()
  2546. case 2: try { try decoder.decodeSingularEnumField(value: &self.aspect) }()
  2547. case 3: try { try decoder.decodeSingularEnumField(value: &self.`case`) }()
  2548. case 4: try { try decoder.decodeSingularEnumField(value: &self.form) }()
  2549. case 5: try { try decoder.decodeSingularEnumField(value: &self.gender) }()
  2550. case 6: try { try decoder.decodeSingularEnumField(value: &self.mood) }()
  2551. case 7: try { try decoder.decodeSingularEnumField(value: &self.number) }()
  2552. case 8: try { try decoder.decodeSingularEnumField(value: &self.person) }()
  2553. case 9: try { try decoder.decodeSingularEnumField(value: &self.proper) }()
  2554. case 10: try { try decoder.decodeSingularEnumField(value: &self.reciprocity) }()
  2555. case 11: try { try decoder.decodeSingularEnumField(value: &self.tense) }()
  2556. case 12: try { try decoder.decodeSingularEnumField(value: &self.voice) }()
  2557. default: break
  2558. }
  2559. }
  2560. }
  2561. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2562. if self.tag != .unknown {
  2563. try visitor.visitSingularEnumField(value: self.tag, fieldNumber: 1)
  2564. }
  2565. if self.aspect != .unknown {
  2566. try visitor.visitSingularEnumField(value: self.aspect, fieldNumber: 2)
  2567. }
  2568. if self.`case` != .unknown {
  2569. try visitor.visitSingularEnumField(value: self.`case`, fieldNumber: 3)
  2570. }
  2571. if self.form != .unknown {
  2572. try visitor.visitSingularEnumField(value: self.form, fieldNumber: 4)
  2573. }
  2574. if self.gender != .unknown {
  2575. try visitor.visitSingularEnumField(value: self.gender, fieldNumber: 5)
  2576. }
  2577. if self.mood != .unknown {
  2578. try visitor.visitSingularEnumField(value: self.mood, fieldNumber: 6)
  2579. }
  2580. if self.number != .unknown {
  2581. try visitor.visitSingularEnumField(value: self.number, fieldNumber: 7)
  2582. }
  2583. if self.person != .unknown {
  2584. try visitor.visitSingularEnumField(value: self.person, fieldNumber: 8)
  2585. }
  2586. if self.proper != .unknown {
  2587. try visitor.visitSingularEnumField(value: self.proper, fieldNumber: 9)
  2588. }
  2589. if self.reciprocity != .unknown {
  2590. try visitor.visitSingularEnumField(value: self.reciprocity, fieldNumber: 10)
  2591. }
  2592. if self.tense != .unknown {
  2593. try visitor.visitSingularEnumField(value: self.tense, fieldNumber: 11)
  2594. }
  2595. if self.voice != .unknown {
  2596. try visitor.visitSingularEnumField(value: self.voice, fieldNumber: 12)
  2597. }
  2598. try unknownFields.traverse(visitor: &visitor)
  2599. }
  2600. static func ==(lhs: Google_Cloud_Language_V1_PartOfSpeech, rhs: Google_Cloud_Language_V1_PartOfSpeech) -> Bool {
  2601. if lhs.tag != rhs.tag {return false}
  2602. if lhs.aspect != rhs.aspect {return false}
  2603. if lhs.`case` != rhs.`case` {return false}
  2604. if lhs.form != rhs.form {return false}
  2605. if lhs.gender != rhs.gender {return false}
  2606. if lhs.mood != rhs.mood {return false}
  2607. if lhs.number != rhs.number {return false}
  2608. if lhs.person != rhs.person {return false}
  2609. if lhs.proper != rhs.proper {return false}
  2610. if lhs.reciprocity != rhs.reciprocity {return false}
  2611. if lhs.tense != rhs.tense {return false}
  2612. if lhs.voice != rhs.voice {return false}
  2613. if lhs.unknownFields != rhs.unknownFields {return false}
  2614. return true
  2615. }
  2616. }
  2617. extension Google_Cloud_Language_V1_PartOfSpeech.Tag: SwiftProtobuf._ProtoNameProviding {
  2618. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2619. 0: .same(proto: "UNKNOWN"),
  2620. 1: .same(proto: "ADJ"),
  2621. 2: .same(proto: "ADP"),
  2622. 3: .same(proto: "ADV"),
  2623. 4: .same(proto: "CONJ"),
  2624. 5: .same(proto: "DET"),
  2625. 6: .same(proto: "NOUN"),
  2626. 7: .same(proto: "NUM"),
  2627. 8: .same(proto: "PRON"),
  2628. 9: .same(proto: "PRT"),
  2629. 10: .same(proto: "PUNCT"),
  2630. 11: .same(proto: "VERB"),
  2631. 12: .same(proto: "X"),
  2632. 13: .same(proto: "AFFIX"),
  2633. ]
  2634. }
  2635. extension Google_Cloud_Language_V1_PartOfSpeech.Aspect: SwiftProtobuf._ProtoNameProviding {
  2636. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2637. 0: .same(proto: "ASPECT_UNKNOWN"),
  2638. 1: .same(proto: "PERFECTIVE"),
  2639. 2: .same(proto: "IMPERFECTIVE"),
  2640. 3: .same(proto: "PROGRESSIVE"),
  2641. ]
  2642. }
  2643. extension Google_Cloud_Language_V1_PartOfSpeech.Case: SwiftProtobuf._ProtoNameProviding {
  2644. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2645. 0: .same(proto: "CASE_UNKNOWN"),
  2646. 1: .same(proto: "ACCUSATIVE"),
  2647. 2: .same(proto: "ADVERBIAL"),
  2648. 3: .same(proto: "COMPLEMENTIVE"),
  2649. 4: .same(proto: "DATIVE"),
  2650. 5: .same(proto: "GENITIVE"),
  2651. 6: .same(proto: "INSTRUMENTAL"),
  2652. 7: .same(proto: "LOCATIVE"),
  2653. 8: .same(proto: "NOMINATIVE"),
  2654. 9: .same(proto: "OBLIQUE"),
  2655. 10: .same(proto: "PARTITIVE"),
  2656. 11: .same(proto: "PREPOSITIONAL"),
  2657. 12: .same(proto: "REFLEXIVE_CASE"),
  2658. 13: .same(proto: "RELATIVE_CASE"),
  2659. 14: .same(proto: "VOCATIVE"),
  2660. ]
  2661. }
  2662. extension Google_Cloud_Language_V1_PartOfSpeech.Form: SwiftProtobuf._ProtoNameProviding {
  2663. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2664. 0: .same(proto: "FORM_UNKNOWN"),
  2665. 1: .same(proto: "ADNOMIAL"),
  2666. 2: .same(proto: "AUXILIARY"),
  2667. 3: .same(proto: "COMPLEMENTIZER"),
  2668. 4: .same(proto: "FINAL_ENDING"),
  2669. 5: .same(proto: "GERUND"),
  2670. 6: .same(proto: "REALIS"),
  2671. 7: .same(proto: "IRREALIS"),
  2672. 8: .same(proto: "SHORT"),
  2673. 9: .same(proto: "LONG"),
  2674. 10: .same(proto: "ORDER"),
  2675. 11: .same(proto: "SPECIFIC"),
  2676. ]
  2677. }
  2678. extension Google_Cloud_Language_V1_PartOfSpeech.Gender: SwiftProtobuf._ProtoNameProviding {
  2679. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2680. 0: .same(proto: "GENDER_UNKNOWN"),
  2681. 1: .same(proto: "FEMININE"),
  2682. 2: .same(proto: "MASCULINE"),
  2683. 3: .same(proto: "NEUTER"),
  2684. ]
  2685. }
  2686. extension Google_Cloud_Language_V1_PartOfSpeech.Mood: SwiftProtobuf._ProtoNameProviding {
  2687. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2688. 0: .same(proto: "MOOD_UNKNOWN"),
  2689. 1: .same(proto: "CONDITIONAL_MOOD"),
  2690. 2: .same(proto: "IMPERATIVE"),
  2691. 3: .same(proto: "INDICATIVE"),
  2692. 4: .same(proto: "INTERROGATIVE"),
  2693. 5: .same(proto: "JUSSIVE"),
  2694. 6: .same(proto: "SUBJUNCTIVE"),
  2695. ]
  2696. }
  2697. extension Google_Cloud_Language_V1_PartOfSpeech.Number: SwiftProtobuf._ProtoNameProviding {
  2698. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2699. 0: .same(proto: "NUMBER_UNKNOWN"),
  2700. 1: .same(proto: "SINGULAR"),
  2701. 2: .same(proto: "PLURAL"),
  2702. 3: .same(proto: "DUAL"),
  2703. ]
  2704. }
  2705. extension Google_Cloud_Language_V1_PartOfSpeech.Person: SwiftProtobuf._ProtoNameProviding {
  2706. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2707. 0: .same(proto: "PERSON_UNKNOWN"),
  2708. 1: .same(proto: "FIRST"),
  2709. 2: .same(proto: "SECOND"),
  2710. 3: .same(proto: "THIRD"),
  2711. 4: .same(proto: "REFLEXIVE_PERSON"),
  2712. ]
  2713. }
  2714. extension Google_Cloud_Language_V1_PartOfSpeech.Proper: SwiftProtobuf._ProtoNameProviding {
  2715. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2716. 0: .same(proto: "PROPER_UNKNOWN"),
  2717. 1: .same(proto: "PROPER"),
  2718. 2: .same(proto: "NOT_PROPER"),
  2719. ]
  2720. }
  2721. extension Google_Cloud_Language_V1_PartOfSpeech.Reciprocity: SwiftProtobuf._ProtoNameProviding {
  2722. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2723. 0: .same(proto: "RECIPROCITY_UNKNOWN"),
  2724. 1: .same(proto: "RECIPROCAL"),
  2725. 2: .same(proto: "NON_RECIPROCAL"),
  2726. ]
  2727. }
  2728. extension Google_Cloud_Language_V1_PartOfSpeech.Tense: SwiftProtobuf._ProtoNameProviding {
  2729. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2730. 0: .same(proto: "TENSE_UNKNOWN"),
  2731. 1: .same(proto: "CONDITIONAL_TENSE"),
  2732. 2: .same(proto: "FUTURE"),
  2733. 3: .same(proto: "PAST"),
  2734. 4: .same(proto: "PRESENT"),
  2735. 5: .same(proto: "IMPERFECT"),
  2736. 6: .same(proto: "PLUPERFECT"),
  2737. ]
  2738. }
  2739. extension Google_Cloud_Language_V1_PartOfSpeech.Voice: SwiftProtobuf._ProtoNameProviding {
  2740. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2741. 0: .same(proto: "VOICE_UNKNOWN"),
  2742. 1: .same(proto: "ACTIVE"),
  2743. 2: .same(proto: "CAUSATIVE"),
  2744. 3: .same(proto: "PASSIVE"),
  2745. ]
  2746. }
  2747. extension Google_Cloud_Language_V1_DependencyEdge: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2748. static let protoMessageName: String = _protobuf_package + ".DependencyEdge"
  2749. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2750. 1: .standard(proto: "head_token_index"),
  2751. 2: .same(proto: "label"),
  2752. ]
  2753. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2754. while let fieldNumber = try decoder.nextFieldNumber() {
  2755. // The use of inline closures is to circumvent an issue where the compiler
  2756. // allocates stack space for every case branch when no optimizations are
  2757. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2758. switch fieldNumber {
  2759. case 1: try { try decoder.decodeSingularInt32Field(value: &self.headTokenIndex) }()
  2760. case 2: try { try decoder.decodeSingularEnumField(value: &self.label) }()
  2761. default: break
  2762. }
  2763. }
  2764. }
  2765. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2766. if self.headTokenIndex != 0 {
  2767. try visitor.visitSingularInt32Field(value: self.headTokenIndex, fieldNumber: 1)
  2768. }
  2769. if self.label != .unknown {
  2770. try visitor.visitSingularEnumField(value: self.label, fieldNumber: 2)
  2771. }
  2772. try unknownFields.traverse(visitor: &visitor)
  2773. }
  2774. static func ==(lhs: Google_Cloud_Language_V1_DependencyEdge, rhs: Google_Cloud_Language_V1_DependencyEdge) -> Bool {
  2775. if lhs.headTokenIndex != rhs.headTokenIndex {return false}
  2776. if lhs.label != rhs.label {return false}
  2777. if lhs.unknownFields != rhs.unknownFields {return false}
  2778. return true
  2779. }
  2780. }
  2781. extension Google_Cloud_Language_V1_DependencyEdge.Label: SwiftProtobuf._ProtoNameProviding {
  2782. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2783. 0: .same(proto: "UNKNOWN"),
  2784. 1: .same(proto: "ABBREV"),
  2785. 2: .same(proto: "ACOMP"),
  2786. 3: .same(proto: "ADVCL"),
  2787. 4: .same(proto: "ADVMOD"),
  2788. 5: .same(proto: "AMOD"),
  2789. 6: .same(proto: "APPOS"),
  2790. 7: .same(proto: "ATTR"),
  2791. 8: .same(proto: "AUX"),
  2792. 9: .same(proto: "AUXPASS"),
  2793. 10: .same(proto: "CC"),
  2794. 11: .same(proto: "CCOMP"),
  2795. 12: .same(proto: "CONJ"),
  2796. 13: .same(proto: "CSUBJ"),
  2797. 14: .same(proto: "CSUBJPASS"),
  2798. 15: .same(proto: "DEP"),
  2799. 16: .same(proto: "DET"),
  2800. 17: .same(proto: "DISCOURSE"),
  2801. 18: .same(proto: "DOBJ"),
  2802. 19: .same(proto: "EXPL"),
  2803. 20: .same(proto: "GOESWITH"),
  2804. 21: .same(proto: "IOBJ"),
  2805. 22: .same(proto: "MARK"),
  2806. 23: .same(proto: "MWE"),
  2807. 24: .same(proto: "MWV"),
  2808. 25: .same(proto: "NEG"),
  2809. 26: .same(proto: "NN"),
  2810. 27: .same(proto: "NPADVMOD"),
  2811. 28: .same(proto: "NSUBJ"),
  2812. 29: .same(proto: "NSUBJPASS"),
  2813. 30: .same(proto: "NUM"),
  2814. 31: .same(proto: "NUMBER"),
  2815. 32: .same(proto: "P"),
  2816. 33: .same(proto: "PARATAXIS"),
  2817. 34: .same(proto: "PARTMOD"),
  2818. 35: .same(proto: "PCOMP"),
  2819. 36: .same(proto: "POBJ"),
  2820. 37: .same(proto: "POSS"),
  2821. 38: .same(proto: "POSTNEG"),
  2822. 39: .same(proto: "PRECOMP"),
  2823. 40: .same(proto: "PRECONJ"),
  2824. 41: .same(proto: "PREDET"),
  2825. 42: .same(proto: "PREF"),
  2826. 43: .same(proto: "PREP"),
  2827. 44: .same(proto: "PRONL"),
  2828. 45: .same(proto: "PRT"),
  2829. 46: .same(proto: "PS"),
  2830. 47: .same(proto: "QUANTMOD"),
  2831. 48: .same(proto: "RCMOD"),
  2832. 49: .same(proto: "RCMODREL"),
  2833. 50: .same(proto: "RDROP"),
  2834. 51: .same(proto: "REF"),
  2835. 52: .same(proto: "REMNANT"),
  2836. 53: .same(proto: "REPARANDUM"),
  2837. 54: .same(proto: "ROOT"),
  2838. 55: .same(proto: "SNUM"),
  2839. 56: .same(proto: "SUFF"),
  2840. 57: .same(proto: "TMOD"),
  2841. 58: .same(proto: "TOPIC"),
  2842. 59: .same(proto: "VMOD"),
  2843. 60: .same(proto: "VOCATIVE"),
  2844. 61: .same(proto: "XCOMP"),
  2845. 62: .same(proto: "SUFFIX"),
  2846. 63: .same(proto: "TITLE"),
  2847. 64: .same(proto: "ADVPHMOD"),
  2848. 65: .same(proto: "AUXCAUS"),
  2849. 66: .same(proto: "AUXVV"),
  2850. 67: .same(proto: "DTMOD"),
  2851. 68: .same(proto: "FOREIGN"),
  2852. 69: .same(proto: "KW"),
  2853. 70: .same(proto: "LIST"),
  2854. 71: .same(proto: "NOMC"),
  2855. 72: .same(proto: "NOMCSUBJ"),
  2856. 73: .same(proto: "NOMCSUBJPASS"),
  2857. 74: .same(proto: "NUMC"),
  2858. 75: .same(proto: "COP"),
  2859. 76: .same(proto: "DISLOCATED"),
  2860. 77: .same(proto: "ASP"),
  2861. 78: .same(proto: "GMOD"),
  2862. 79: .same(proto: "GOBJ"),
  2863. 80: .same(proto: "INFMOD"),
  2864. 81: .same(proto: "MES"),
  2865. 82: .same(proto: "NCOMP"),
  2866. ]
  2867. }
  2868. extension Google_Cloud_Language_V1_EntityMention: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2869. static let protoMessageName: String = _protobuf_package + ".EntityMention"
  2870. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2871. 1: .same(proto: "text"),
  2872. 2: .same(proto: "type"),
  2873. 3: .same(proto: "sentiment"),
  2874. ]
  2875. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2876. while let fieldNumber = try decoder.nextFieldNumber() {
  2877. // The use of inline closures is to circumvent an issue where the compiler
  2878. // allocates stack space for every case branch when no optimizations are
  2879. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2880. switch fieldNumber {
  2881. case 1: try { try decoder.decodeSingularMessageField(value: &self._text) }()
  2882. case 2: try { try decoder.decodeSingularEnumField(value: &self.type) }()
  2883. case 3: try { try decoder.decodeSingularMessageField(value: &self._sentiment) }()
  2884. default: break
  2885. }
  2886. }
  2887. }
  2888. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2889. // The use of inline closures is to circumvent an issue where the compiler
  2890. // allocates stack space for every if/case branch local when no optimizations
  2891. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  2892. // https://github.com/apple/swift-protobuf/issues/1182
  2893. try { if let v = self._text {
  2894. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  2895. } }()
  2896. if self.type != .unknown {
  2897. try visitor.visitSingularEnumField(value: self.type, fieldNumber: 2)
  2898. }
  2899. try { if let v = self._sentiment {
  2900. try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
  2901. } }()
  2902. try unknownFields.traverse(visitor: &visitor)
  2903. }
  2904. static func ==(lhs: Google_Cloud_Language_V1_EntityMention, rhs: Google_Cloud_Language_V1_EntityMention) -> Bool {
  2905. if lhs._text != rhs._text {return false}
  2906. if lhs.type != rhs.type {return false}
  2907. if lhs._sentiment != rhs._sentiment {return false}
  2908. if lhs.unknownFields != rhs.unknownFields {return false}
  2909. return true
  2910. }
  2911. }
  2912. extension Google_Cloud_Language_V1_EntityMention.TypeEnum: SwiftProtobuf._ProtoNameProviding {
  2913. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2914. 0: .same(proto: "TYPE_UNKNOWN"),
  2915. 1: .same(proto: "PROPER"),
  2916. 2: .same(proto: "COMMON"),
  2917. ]
  2918. }
  2919. extension Google_Cloud_Language_V1_TextSpan: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2920. static let protoMessageName: String = _protobuf_package + ".TextSpan"
  2921. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2922. 1: .same(proto: "content"),
  2923. 2: .standard(proto: "begin_offset"),
  2924. ]
  2925. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2926. while let fieldNumber = try decoder.nextFieldNumber() {
  2927. // The use of inline closures is to circumvent an issue where the compiler
  2928. // allocates stack space for every case branch when no optimizations are
  2929. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2930. switch fieldNumber {
  2931. case 1: try { try decoder.decodeSingularStringField(value: &self.content) }()
  2932. case 2: try { try decoder.decodeSingularInt32Field(value: &self.beginOffset) }()
  2933. default: break
  2934. }
  2935. }
  2936. }
  2937. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2938. if !self.content.isEmpty {
  2939. try visitor.visitSingularStringField(value: self.content, fieldNumber: 1)
  2940. }
  2941. if self.beginOffset != 0 {
  2942. try visitor.visitSingularInt32Field(value: self.beginOffset, fieldNumber: 2)
  2943. }
  2944. try unknownFields.traverse(visitor: &visitor)
  2945. }
  2946. static func ==(lhs: Google_Cloud_Language_V1_TextSpan, rhs: Google_Cloud_Language_V1_TextSpan) -> Bool {
  2947. if lhs.content != rhs.content {return false}
  2948. if lhs.beginOffset != rhs.beginOffset {return false}
  2949. if lhs.unknownFields != rhs.unknownFields {return false}
  2950. return true
  2951. }
  2952. }
  2953. extension Google_Cloud_Language_V1_ClassificationCategory: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2954. static let protoMessageName: String = _protobuf_package + ".ClassificationCategory"
  2955. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2956. 1: .same(proto: "name"),
  2957. 2: .same(proto: "confidence"),
  2958. ]
  2959. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2960. while let fieldNumber = try decoder.nextFieldNumber() {
  2961. // The use of inline closures is to circumvent an issue where the compiler
  2962. // allocates stack space for every case branch when no optimizations are
  2963. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2964. switch fieldNumber {
  2965. case 1: try { try decoder.decodeSingularStringField(value: &self.name) }()
  2966. case 2: try { try decoder.decodeSingularFloatField(value: &self.confidence) }()
  2967. default: break
  2968. }
  2969. }
  2970. }
  2971. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  2972. if !self.name.isEmpty {
  2973. try visitor.visitSingularStringField(value: self.name, fieldNumber: 1)
  2974. }
  2975. if self.confidence != 0 {
  2976. try visitor.visitSingularFloatField(value: self.confidence, fieldNumber: 2)
  2977. }
  2978. try unknownFields.traverse(visitor: &visitor)
  2979. }
  2980. static func ==(lhs: Google_Cloud_Language_V1_ClassificationCategory, rhs: Google_Cloud_Language_V1_ClassificationCategory) -> Bool {
  2981. if lhs.name != rhs.name {return false}
  2982. if lhs.confidence != rhs.confidence {return false}
  2983. if lhs.unknownFields != rhs.unknownFields {return false}
  2984. return true
  2985. }
  2986. }
  2987. extension Google_Cloud_Language_V1_ClassificationModelOptions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  2988. static let protoMessageName: String = _protobuf_package + ".ClassificationModelOptions"
  2989. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  2990. 1: .standard(proto: "v1_model"),
  2991. 2: .standard(proto: "v2_model"),
  2992. ]
  2993. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  2994. while let fieldNumber = try decoder.nextFieldNumber() {
  2995. // The use of inline closures is to circumvent an issue where the compiler
  2996. // allocates stack space for every case branch when no optimizations are
  2997. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  2998. switch fieldNumber {
  2999. case 1: try {
  3000. var v: Google_Cloud_Language_V1_ClassificationModelOptions.V1Model?
  3001. var hadOneofValue = false
  3002. if let current = self.modelType {
  3003. hadOneofValue = true
  3004. if case .v1Model(let m) = current {v = m}
  3005. }
  3006. try decoder.decodeSingularMessageField(value: &v)
  3007. if let v = v {
  3008. if hadOneofValue {try decoder.handleConflictingOneOf()}
  3009. self.modelType = .v1Model(v)
  3010. }
  3011. }()
  3012. case 2: try {
  3013. var v: Google_Cloud_Language_V1_ClassificationModelOptions.V2Model?
  3014. var hadOneofValue = false
  3015. if let current = self.modelType {
  3016. hadOneofValue = true
  3017. if case .v2Model(let m) = current {v = m}
  3018. }
  3019. try decoder.decodeSingularMessageField(value: &v)
  3020. if let v = v {
  3021. if hadOneofValue {try decoder.handleConflictingOneOf()}
  3022. self.modelType = .v2Model(v)
  3023. }
  3024. }()
  3025. default: break
  3026. }
  3027. }
  3028. }
  3029. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3030. // The use of inline closures is to circumvent an issue where the compiler
  3031. // allocates stack space for every if/case branch local when no optimizations
  3032. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  3033. // https://github.com/apple/swift-protobuf/issues/1182
  3034. switch self.modelType {
  3035. case .v1Model?: try {
  3036. guard case .v1Model(let v)? = self.modelType else { preconditionFailure() }
  3037. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  3038. }()
  3039. case .v2Model?: try {
  3040. guard case .v2Model(let v)? = self.modelType else { preconditionFailure() }
  3041. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  3042. }()
  3043. case nil: break
  3044. }
  3045. try unknownFields.traverse(visitor: &visitor)
  3046. }
  3047. static func ==(lhs: Google_Cloud_Language_V1_ClassificationModelOptions, rhs: Google_Cloud_Language_V1_ClassificationModelOptions) -> Bool {
  3048. if lhs.modelType != rhs.modelType {return false}
  3049. if lhs.unknownFields != rhs.unknownFields {return false}
  3050. return true
  3051. }
  3052. }
  3053. extension Google_Cloud_Language_V1_ClassificationModelOptions.V1Model: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3054. static let protoMessageName: String = Google_Cloud_Language_V1_ClassificationModelOptions.protoMessageName + ".V1Model"
  3055. static let _protobuf_nameMap = SwiftProtobuf._NameMap()
  3056. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3057. while let _ = try decoder.nextFieldNumber() {
  3058. }
  3059. }
  3060. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3061. try unknownFields.traverse(visitor: &visitor)
  3062. }
  3063. static func ==(lhs: Google_Cloud_Language_V1_ClassificationModelOptions.V1Model, rhs: Google_Cloud_Language_V1_ClassificationModelOptions.V1Model) -> Bool {
  3064. if lhs.unknownFields != rhs.unknownFields {return false}
  3065. return true
  3066. }
  3067. }
  3068. extension Google_Cloud_Language_V1_ClassificationModelOptions.V2Model: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3069. static let protoMessageName: String = Google_Cloud_Language_V1_ClassificationModelOptions.protoMessageName + ".V2Model"
  3070. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3071. 1: .standard(proto: "content_categories_version"),
  3072. ]
  3073. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3074. while let fieldNumber = try decoder.nextFieldNumber() {
  3075. // The use of inline closures is to circumvent an issue where the compiler
  3076. // allocates stack space for every case branch when no optimizations are
  3077. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  3078. switch fieldNumber {
  3079. case 1: try { try decoder.decodeSingularEnumField(value: &self.contentCategoriesVersion) }()
  3080. default: break
  3081. }
  3082. }
  3083. }
  3084. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3085. if self.contentCategoriesVersion != .unspecified {
  3086. try visitor.visitSingularEnumField(value: self.contentCategoriesVersion, fieldNumber: 1)
  3087. }
  3088. try unknownFields.traverse(visitor: &visitor)
  3089. }
  3090. static func ==(lhs: Google_Cloud_Language_V1_ClassificationModelOptions.V2Model, rhs: Google_Cloud_Language_V1_ClassificationModelOptions.V2Model) -> Bool {
  3091. if lhs.contentCategoriesVersion != rhs.contentCategoriesVersion {return false}
  3092. if lhs.unknownFields != rhs.unknownFields {return false}
  3093. return true
  3094. }
  3095. }
  3096. extension Google_Cloud_Language_V1_ClassificationModelOptions.V2Model.ContentCategoriesVersion: SwiftProtobuf._ProtoNameProviding {
  3097. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3098. 0: .same(proto: "CONTENT_CATEGORIES_VERSION_UNSPECIFIED"),
  3099. 1: .same(proto: "V1"),
  3100. 2: .same(proto: "V2"),
  3101. ]
  3102. }
  3103. extension Google_Cloud_Language_V1_AnalyzeSentimentRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3104. static let protoMessageName: String = _protobuf_package + ".AnalyzeSentimentRequest"
  3105. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3106. 1: .same(proto: "document"),
  3107. 2: .standard(proto: "encoding_type"),
  3108. ]
  3109. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3110. while let fieldNumber = try decoder.nextFieldNumber() {
  3111. // The use of inline closures is to circumvent an issue where the compiler
  3112. // allocates stack space for every case branch when no optimizations are
  3113. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  3114. switch fieldNumber {
  3115. case 1: try { try decoder.decodeSingularMessageField(value: &self._document) }()
  3116. case 2: try { try decoder.decodeSingularEnumField(value: &self.encodingType) }()
  3117. default: break
  3118. }
  3119. }
  3120. }
  3121. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3122. // The use of inline closures is to circumvent an issue where the compiler
  3123. // allocates stack space for every if/case branch local when no optimizations
  3124. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  3125. // https://github.com/apple/swift-protobuf/issues/1182
  3126. try { if let v = self._document {
  3127. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  3128. } }()
  3129. if self.encodingType != .none {
  3130. try visitor.visitSingularEnumField(value: self.encodingType, fieldNumber: 2)
  3131. }
  3132. try unknownFields.traverse(visitor: &visitor)
  3133. }
  3134. static func ==(lhs: Google_Cloud_Language_V1_AnalyzeSentimentRequest, rhs: Google_Cloud_Language_V1_AnalyzeSentimentRequest) -> Bool {
  3135. if lhs._document != rhs._document {return false}
  3136. if lhs.encodingType != rhs.encodingType {return false}
  3137. if lhs.unknownFields != rhs.unknownFields {return false}
  3138. return true
  3139. }
  3140. }
  3141. extension Google_Cloud_Language_V1_AnalyzeSentimentResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3142. static let protoMessageName: String = _protobuf_package + ".AnalyzeSentimentResponse"
  3143. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3144. 1: .standard(proto: "document_sentiment"),
  3145. 2: .same(proto: "language"),
  3146. 3: .same(proto: "sentences"),
  3147. ]
  3148. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3149. while let fieldNumber = try decoder.nextFieldNumber() {
  3150. // The use of inline closures is to circumvent an issue where the compiler
  3151. // allocates stack space for every case branch when no optimizations are
  3152. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  3153. switch fieldNumber {
  3154. case 1: try { try decoder.decodeSingularMessageField(value: &self._documentSentiment) }()
  3155. case 2: try { try decoder.decodeSingularStringField(value: &self.language) }()
  3156. case 3: try { try decoder.decodeRepeatedMessageField(value: &self.sentences) }()
  3157. default: break
  3158. }
  3159. }
  3160. }
  3161. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3162. // The use of inline closures is to circumvent an issue where the compiler
  3163. // allocates stack space for every if/case branch local when no optimizations
  3164. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  3165. // https://github.com/apple/swift-protobuf/issues/1182
  3166. try { if let v = self._documentSentiment {
  3167. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  3168. } }()
  3169. if !self.language.isEmpty {
  3170. try visitor.visitSingularStringField(value: self.language, fieldNumber: 2)
  3171. }
  3172. if !self.sentences.isEmpty {
  3173. try visitor.visitRepeatedMessageField(value: self.sentences, fieldNumber: 3)
  3174. }
  3175. try unknownFields.traverse(visitor: &visitor)
  3176. }
  3177. static func ==(lhs: Google_Cloud_Language_V1_AnalyzeSentimentResponse, rhs: Google_Cloud_Language_V1_AnalyzeSentimentResponse) -> Bool {
  3178. if lhs._documentSentiment != rhs._documentSentiment {return false}
  3179. if lhs.language != rhs.language {return false}
  3180. if lhs.sentences != rhs.sentences {return false}
  3181. if lhs.unknownFields != rhs.unknownFields {return false}
  3182. return true
  3183. }
  3184. }
  3185. extension Google_Cloud_Language_V1_AnalyzeEntitySentimentRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3186. static let protoMessageName: String = _protobuf_package + ".AnalyzeEntitySentimentRequest"
  3187. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3188. 1: .same(proto: "document"),
  3189. 2: .standard(proto: "encoding_type"),
  3190. ]
  3191. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3192. while let fieldNumber = try decoder.nextFieldNumber() {
  3193. // The use of inline closures is to circumvent an issue where the compiler
  3194. // allocates stack space for every case branch when no optimizations are
  3195. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  3196. switch fieldNumber {
  3197. case 1: try { try decoder.decodeSingularMessageField(value: &self._document) }()
  3198. case 2: try { try decoder.decodeSingularEnumField(value: &self.encodingType) }()
  3199. default: break
  3200. }
  3201. }
  3202. }
  3203. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3204. // The use of inline closures is to circumvent an issue where the compiler
  3205. // allocates stack space for every if/case branch local when no optimizations
  3206. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  3207. // https://github.com/apple/swift-protobuf/issues/1182
  3208. try { if let v = self._document {
  3209. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  3210. } }()
  3211. if self.encodingType != .none {
  3212. try visitor.visitSingularEnumField(value: self.encodingType, fieldNumber: 2)
  3213. }
  3214. try unknownFields.traverse(visitor: &visitor)
  3215. }
  3216. static func ==(lhs: Google_Cloud_Language_V1_AnalyzeEntitySentimentRequest, rhs: Google_Cloud_Language_V1_AnalyzeEntitySentimentRequest) -> Bool {
  3217. if lhs._document != rhs._document {return false}
  3218. if lhs.encodingType != rhs.encodingType {return false}
  3219. if lhs.unknownFields != rhs.unknownFields {return false}
  3220. return true
  3221. }
  3222. }
  3223. extension Google_Cloud_Language_V1_AnalyzeEntitySentimentResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3224. static let protoMessageName: String = _protobuf_package + ".AnalyzeEntitySentimentResponse"
  3225. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3226. 1: .same(proto: "entities"),
  3227. 2: .same(proto: "language"),
  3228. ]
  3229. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3230. while let fieldNumber = try decoder.nextFieldNumber() {
  3231. // The use of inline closures is to circumvent an issue where the compiler
  3232. // allocates stack space for every case branch when no optimizations are
  3233. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  3234. switch fieldNumber {
  3235. case 1: try { try decoder.decodeRepeatedMessageField(value: &self.entities) }()
  3236. case 2: try { try decoder.decodeSingularStringField(value: &self.language) }()
  3237. default: break
  3238. }
  3239. }
  3240. }
  3241. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3242. if !self.entities.isEmpty {
  3243. try visitor.visitRepeatedMessageField(value: self.entities, fieldNumber: 1)
  3244. }
  3245. if !self.language.isEmpty {
  3246. try visitor.visitSingularStringField(value: self.language, fieldNumber: 2)
  3247. }
  3248. try unknownFields.traverse(visitor: &visitor)
  3249. }
  3250. static func ==(lhs: Google_Cloud_Language_V1_AnalyzeEntitySentimentResponse, rhs: Google_Cloud_Language_V1_AnalyzeEntitySentimentResponse) -> Bool {
  3251. if lhs.entities != rhs.entities {return false}
  3252. if lhs.language != rhs.language {return false}
  3253. if lhs.unknownFields != rhs.unknownFields {return false}
  3254. return true
  3255. }
  3256. }
  3257. extension Google_Cloud_Language_V1_AnalyzeEntitiesRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3258. static let protoMessageName: String = _protobuf_package + ".AnalyzeEntitiesRequest"
  3259. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3260. 1: .same(proto: "document"),
  3261. 2: .standard(proto: "encoding_type"),
  3262. ]
  3263. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3264. while let fieldNumber = try decoder.nextFieldNumber() {
  3265. // The use of inline closures is to circumvent an issue where the compiler
  3266. // allocates stack space for every case branch when no optimizations are
  3267. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  3268. switch fieldNumber {
  3269. case 1: try { try decoder.decodeSingularMessageField(value: &self._document) }()
  3270. case 2: try { try decoder.decodeSingularEnumField(value: &self.encodingType) }()
  3271. default: break
  3272. }
  3273. }
  3274. }
  3275. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3276. // The use of inline closures is to circumvent an issue where the compiler
  3277. // allocates stack space for every if/case branch local when no optimizations
  3278. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  3279. // https://github.com/apple/swift-protobuf/issues/1182
  3280. try { if let v = self._document {
  3281. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  3282. } }()
  3283. if self.encodingType != .none {
  3284. try visitor.visitSingularEnumField(value: self.encodingType, fieldNumber: 2)
  3285. }
  3286. try unknownFields.traverse(visitor: &visitor)
  3287. }
  3288. static func ==(lhs: Google_Cloud_Language_V1_AnalyzeEntitiesRequest, rhs: Google_Cloud_Language_V1_AnalyzeEntitiesRequest) -> Bool {
  3289. if lhs._document != rhs._document {return false}
  3290. if lhs.encodingType != rhs.encodingType {return false}
  3291. if lhs.unknownFields != rhs.unknownFields {return false}
  3292. return true
  3293. }
  3294. }
  3295. extension Google_Cloud_Language_V1_AnalyzeEntitiesResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3296. static let protoMessageName: String = _protobuf_package + ".AnalyzeEntitiesResponse"
  3297. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3298. 1: .same(proto: "entities"),
  3299. 2: .same(proto: "language"),
  3300. ]
  3301. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3302. while let fieldNumber = try decoder.nextFieldNumber() {
  3303. // The use of inline closures is to circumvent an issue where the compiler
  3304. // allocates stack space for every case branch when no optimizations are
  3305. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  3306. switch fieldNumber {
  3307. case 1: try { try decoder.decodeRepeatedMessageField(value: &self.entities) }()
  3308. case 2: try { try decoder.decodeSingularStringField(value: &self.language) }()
  3309. default: break
  3310. }
  3311. }
  3312. }
  3313. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3314. if !self.entities.isEmpty {
  3315. try visitor.visitRepeatedMessageField(value: self.entities, fieldNumber: 1)
  3316. }
  3317. if !self.language.isEmpty {
  3318. try visitor.visitSingularStringField(value: self.language, fieldNumber: 2)
  3319. }
  3320. try unknownFields.traverse(visitor: &visitor)
  3321. }
  3322. static func ==(lhs: Google_Cloud_Language_V1_AnalyzeEntitiesResponse, rhs: Google_Cloud_Language_V1_AnalyzeEntitiesResponse) -> Bool {
  3323. if lhs.entities != rhs.entities {return false}
  3324. if lhs.language != rhs.language {return false}
  3325. if lhs.unknownFields != rhs.unknownFields {return false}
  3326. return true
  3327. }
  3328. }
  3329. extension Google_Cloud_Language_V1_AnalyzeSyntaxRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3330. static let protoMessageName: String = _protobuf_package + ".AnalyzeSyntaxRequest"
  3331. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3332. 1: .same(proto: "document"),
  3333. 2: .standard(proto: "encoding_type"),
  3334. ]
  3335. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3336. while let fieldNumber = try decoder.nextFieldNumber() {
  3337. // The use of inline closures is to circumvent an issue where the compiler
  3338. // allocates stack space for every case branch when no optimizations are
  3339. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  3340. switch fieldNumber {
  3341. case 1: try { try decoder.decodeSingularMessageField(value: &self._document) }()
  3342. case 2: try { try decoder.decodeSingularEnumField(value: &self.encodingType) }()
  3343. default: break
  3344. }
  3345. }
  3346. }
  3347. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3348. // The use of inline closures is to circumvent an issue where the compiler
  3349. // allocates stack space for every if/case branch local when no optimizations
  3350. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  3351. // https://github.com/apple/swift-protobuf/issues/1182
  3352. try { if let v = self._document {
  3353. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  3354. } }()
  3355. if self.encodingType != .none {
  3356. try visitor.visitSingularEnumField(value: self.encodingType, fieldNumber: 2)
  3357. }
  3358. try unknownFields.traverse(visitor: &visitor)
  3359. }
  3360. static func ==(lhs: Google_Cloud_Language_V1_AnalyzeSyntaxRequest, rhs: Google_Cloud_Language_V1_AnalyzeSyntaxRequest) -> Bool {
  3361. if lhs._document != rhs._document {return false}
  3362. if lhs.encodingType != rhs.encodingType {return false}
  3363. if lhs.unknownFields != rhs.unknownFields {return false}
  3364. return true
  3365. }
  3366. }
  3367. extension Google_Cloud_Language_V1_AnalyzeSyntaxResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3368. static let protoMessageName: String = _protobuf_package + ".AnalyzeSyntaxResponse"
  3369. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3370. 1: .same(proto: "sentences"),
  3371. 2: .same(proto: "tokens"),
  3372. 3: .same(proto: "language"),
  3373. ]
  3374. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3375. while let fieldNumber = try decoder.nextFieldNumber() {
  3376. // The use of inline closures is to circumvent an issue where the compiler
  3377. // allocates stack space for every case branch when no optimizations are
  3378. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  3379. switch fieldNumber {
  3380. case 1: try { try decoder.decodeRepeatedMessageField(value: &self.sentences) }()
  3381. case 2: try { try decoder.decodeRepeatedMessageField(value: &self.tokens) }()
  3382. case 3: try { try decoder.decodeSingularStringField(value: &self.language) }()
  3383. default: break
  3384. }
  3385. }
  3386. }
  3387. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3388. if !self.sentences.isEmpty {
  3389. try visitor.visitRepeatedMessageField(value: self.sentences, fieldNumber: 1)
  3390. }
  3391. if !self.tokens.isEmpty {
  3392. try visitor.visitRepeatedMessageField(value: self.tokens, fieldNumber: 2)
  3393. }
  3394. if !self.language.isEmpty {
  3395. try visitor.visitSingularStringField(value: self.language, fieldNumber: 3)
  3396. }
  3397. try unknownFields.traverse(visitor: &visitor)
  3398. }
  3399. static func ==(lhs: Google_Cloud_Language_V1_AnalyzeSyntaxResponse, rhs: Google_Cloud_Language_V1_AnalyzeSyntaxResponse) -> Bool {
  3400. if lhs.sentences != rhs.sentences {return false}
  3401. if lhs.tokens != rhs.tokens {return false}
  3402. if lhs.language != rhs.language {return false}
  3403. if lhs.unknownFields != rhs.unknownFields {return false}
  3404. return true
  3405. }
  3406. }
  3407. extension Google_Cloud_Language_V1_ClassifyTextRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3408. static let protoMessageName: String = _protobuf_package + ".ClassifyTextRequest"
  3409. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3410. 1: .same(proto: "document"),
  3411. 3: .standard(proto: "classification_model_options"),
  3412. ]
  3413. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3414. while let fieldNumber = try decoder.nextFieldNumber() {
  3415. // The use of inline closures is to circumvent an issue where the compiler
  3416. // allocates stack space for every case branch when no optimizations are
  3417. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  3418. switch fieldNumber {
  3419. case 1: try { try decoder.decodeSingularMessageField(value: &self._document) }()
  3420. case 3: try { try decoder.decodeSingularMessageField(value: &self._classificationModelOptions) }()
  3421. default: break
  3422. }
  3423. }
  3424. }
  3425. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3426. // The use of inline closures is to circumvent an issue where the compiler
  3427. // allocates stack space for every if/case branch local when no optimizations
  3428. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  3429. // https://github.com/apple/swift-protobuf/issues/1182
  3430. try { if let v = self._document {
  3431. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  3432. } }()
  3433. try { if let v = self._classificationModelOptions {
  3434. try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
  3435. } }()
  3436. try unknownFields.traverse(visitor: &visitor)
  3437. }
  3438. static func ==(lhs: Google_Cloud_Language_V1_ClassifyTextRequest, rhs: Google_Cloud_Language_V1_ClassifyTextRequest) -> Bool {
  3439. if lhs._document != rhs._document {return false}
  3440. if lhs._classificationModelOptions != rhs._classificationModelOptions {return false}
  3441. if lhs.unknownFields != rhs.unknownFields {return false}
  3442. return true
  3443. }
  3444. }
  3445. extension Google_Cloud_Language_V1_ClassifyTextResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3446. static let protoMessageName: String = _protobuf_package + ".ClassifyTextResponse"
  3447. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3448. 1: .same(proto: "categories"),
  3449. ]
  3450. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3451. while let fieldNumber = try decoder.nextFieldNumber() {
  3452. // The use of inline closures is to circumvent an issue where the compiler
  3453. // allocates stack space for every case branch when no optimizations are
  3454. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  3455. switch fieldNumber {
  3456. case 1: try { try decoder.decodeRepeatedMessageField(value: &self.categories) }()
  3457. default: break
  3458. }
  3459. }
  3460. }
  3461. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3462. if !self.categories.isEmpty {
  3463. try visitor.visitRepeatedMessageField(value: self.categories, fieldNumber: 1)
  3464. }
  3465. try unknownFields.traverse(visitor: &visitor)
  3466. }
  3467. static func ==(lhs: Google_Cloud_Language_V1_ClassifyTextResponse, rhs: Google_Cloud_Language_V1_ClassifyTextResponse) -> Bool {
  3468. if lhs.categories != rhs.categories {return false}
  3469. if lhs.unknownFields != rhs.unknownFields {return false}
  3470. return true
  3471. }
  3472. }
  3473. extension Google_Cloud_Language_V1_AnnotateTextRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3474. static let protoMessageName: String = _protobuf_package + ".AnnotateTextRequest"
  3475. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3476. 1: .same(proto: "document"),
  3477. 2: .same(proto: "features"),
  3478. 3: .standard(proto: "encoding_type"),
  3479. ]
  3480. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3481. while let fieldNumber = try decoder.nextFieldNumber() {
  3482. // The use of inline closures is to circumvent an issue where the compiler
  3483. // allocates stack space for every case branch when no optimizations are
  3484. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  3485. switch fieldNumber {
  3486. case 1: try { try decoder.decodeSingularMessageField(value: &self._document) }()
  3487. case 2: try { try decoder.decodeSingularMessageField(value: &self._features) }()
  3488. case 3: try { try decoder.decodeSingularEnumField(value: &self.encodingType) }()
  3489. default: break
  3490. }
  3491. }
  3492. }
  3493. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3494. // The use of inline closures is to circumvent an issue where the compiler
  3495. // allocates stack space for every if/case branch local when no optimizations
  3496. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  3497. // https://github.com/apple/swift-protobuf/issues/1182
  3498. try { if let v = self._document {
  3499. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  3500. } }()
  3501. try { if let v = self._features {
  3502. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  3503. } }()
  3504. if self.encodingType != .none {
  3505. try visitor.visitSingularEnumField(value: self.encodingType, fieldNumber: 3)
  3506. }
  3507. try unknownFields.traverse(visitor: &visitor)
  3508. }
  3509. static func ==(lhs: Google_Cloud_Language_V1_AnnotateTextRequest, rhs: Google_Cloud_Language_V1_AnnotateTextRequest) -> Bool {
  3510. if lhs._document != rhs._document {return false}
  3511. if lhs._features != rhs._features {return false}
  3512. if lhs.encodingType != rhs.encodingType {return false}
  3513. if lhs.unknownFields != rhs.unknownFields {return false}
  3514. return true
  3515. }
  3516. }
  3517. extension Google_Cloud_Language_V1_AnnotateTextRequest.Features: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3518. static let protoMessageName: String = Google_Cloud_Language_V1_AnnotateTextRequest.protoMessageName + ".Features"
  3519. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3520. 1: .standard(proto: "extract_syntax"),
  3521. 2: .standard(proto: "extract_entities"),
  3522. 3: .standard(proto: "extract_document_sentiment"),
  3523. 4: .standard(proto: "extract_entity_sentiment"),
  3524. 6: .standard(proto: "classify_text"),
  3525. 10: .standard(proto: "classification_model_options"),
  3526. ]
  3527. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3528. while let fieldNumber = try decoder.nextFieldNumber() {
  3529. // The use of inline closures is to circumvent an issue where the compiler
  3530. // allocates stack space for every case branch when no optimizations are
  3531. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  3532. switch fieldNumber {
  3533. case 1: try { try decoder.decodeSingularBoolField(value: &self.extractSyntax) }()
  3534. case 2: try { try decoder.decodeSingularBoolField(value: &self.extractEntities) }()
  3535. case 3: try { try decoder.decodeSingularBoolField(value: &self.extractDocumentSentiment) }()
  3536. case 4: try { try decoder.decodeSingularBoolField(value: &self.extractEntitySentiment) }()
  3537. case 6: try { try decoder.decodeSingularBoolField(value: &self.classifyText) }()
  3538. case 10: try { try decoder.decodeSingularMessageField(value: &self._classificationModelOptions) }()
  3539. default: break
  3540. }
  3541. }
  3542. }
  3543. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3544. // The use of inline closures is to circumvent an issue where the compiler
  3545. // allocates stack space for every if/case branch local when no optimizations
  3546. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  3547. // https://github.com/apple/swift-protobuf/issues/1182
  3548. if self.extractSyntax != false {
  3549. try visitor.visitSingularBoolField(value: self.extractSyntax, fieldNumber: 1)
  3550. }
  3551. if self.extractEntities != false {
  3552. try visitor.visitSingularBoolField(value: self.extractEntities, fieldNumber: 2)
  3553. }
  3554. if self.extractDocumentSentiment != false {
  3555. try visitor.visitSingularBoolField(value: self.extractDocumentSentiment, fieldNumber: 3)
  3556. }
  3557. if self.extractEntitySentiment != false {
  3558. try visitor.visitSingularBoolField(value: self.extractEntitySentiment, fieldNumber: 4)
  3559. }
  3560. if self.classifyText != false {
  3561. try visitor.visitSingularBoolField(value: self.classifyText, fieldNumber: 6)
  3562. }
  3563. try { if let v = self._classificationModelOptions {
  3564. try visitor.visitSingularMessageField(value: v, fieldNumber: 10)
  3565. } }()
  3566. try unknownFields.traverse(visitor: &visitor)
  3567. }
  3568. static func ==(lhs: Google_Cloud_Language_V1_AnnotateTextRequest.Features, rhs: Google_Cloud_Language_V1_AnnotateTextRequest.Features) -> Bool {
  3569. if lhs.extractSyntax != rhs.extractSyntax {return false}
  3570. if lhs.extractEntities != rhs.extractEntities {return false}
  3571. if lhs.extractDocumentSentiment != rhs.extractDocumentSentiment {return false}
  3572. if lhs.extractEntitySentiment != rhs.extractEntitySentiment {return false}
  3573. if lhs.classifyText != rhs.classifyText {return false}
  3574. if lhs._classificationModelOptions != rhs._classificationModelOptions {return false}
  3575. if lhs.unknownFields != rhs.unknownFields {return false}
  3576. return true
  3577. }
  3578. }
  3579. extension Google_Cloud_Language_V1_AnnotateTextResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  3580. static let protoMessageName: String = _protobuf_package + ".AnnotateTextResponse"
  3581. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  3582. 1: .same(proto: "sentences"),
  3583. 2: .same(proto: "tokens"),
  3584. 3: .same(proto: "entities"),
  3585. 4: .standard(proto: "document_sentiment"),
  3586. 5: .same(proto: "language"),
  3587. 6: .same(proto: "categories"),
  3588. ]
  3589. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  3590. while let fieldNumber = try decoder.nextFieldNumber() {
  3591. // The use of inline closures is to circumvent an issue where the compiler
  3592. // allocates stack space for every case branch when no optimizations are
  3593. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  3594. switch fieldNumber {
  3595. case 1: try { try decoder.decodeRepeatedMessageField(value: &self.sentences) }()
  3596. case 2: try { try decoder.decodeRepeatedMessageField(value: &self.tokens) }()
  3597. case 3: try { try decoder.decodeRepeatedMessageField(value: &self.entities) }()
  3598. case 4: try { try decoder.decodeSingularMessageField(value: &self._documentSentiment) }()
  3599. case 5: try { try decoder.decodeSingularStringField(value: &self.language) }()
  3600. case 6: try { try decoder.decodeRepeatedMessageField(value: &self.categories) }()
  3601. default: break
  3602. }
  3603. }
  3604. }
  3605. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  3606. // The use of inline closures is to circumvent an issue where the compiler
  3607. // allocates stack space for every if/case branch local when no optimizations
  3608. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  3609. // https://github.com/apple/swift-protobuf/issues/1182
  3610. if !self.sentences.isEmpty {
  3611. try visitor.visitRepeatedMessageField(value: self.sentences, fieldNumber: 1)
  3612. }
  3613. if !self.tokens.isEmpty {
  3614. try visitor.visitRepeatedMessageField(value: self.tokens, fieldNumber: 2)
  3615. }
  3616. if !self.entities.isEmpty {
  3617. try visitor.visitRepeatedMessageField(value: self.entities, fieldNumber: 3)
  3618. }
  3619. try { if let v = self._documentSentiment {
  3620. try visitor.visitSingularMessageField(value: v, fieldNumber: 4)
  3621. } }()
  3622. if !self.language.isEmpty {
  3623. try visitor.visitSingularStringField(value: self.language, fieldNumber: 5)
  3624. }
  3625. if !self.categories.isEmpty {
  3626. try visitor.visitRepeatedMessageField(value: self.categories, fieldNumber: 6)
  3627. }
  3628. try unknownFields.traverse(visitor: &visitor)
  3629. }
  3630. static func ==(lhs: Google_Cloud_Language_V1_AnnotateTextResponse, rhs: Google_Cloud_Language_V1_AnnotateTextResponse) -> Bool {
  3631. if lhs.sentences != rhs.sentences {return false}
  3632. if lhs.tokens != rhs.tokens {return false}
  3633. if lhs.entities != rhs.entities {return false}
  3634. if lhs._documentSentiment != rhs._documentSentiment {return false}
  3635. if lhs.language != rhs.language {return false}
  3636. if lhs.categories != rhs.categories {return false}
  3637. if lhs.unknownFields != rhs.unknownFields {return false}
  3638. return true
  3639. }
  3640. }