language_service.pb.swift 132 KB

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