gogol-commentanalyzer (empty) → 0.5.0
raw patch · 11 files changed
+2238/−0 lines, 11 filesdep +basedep +gogol-coresetup-changed
Dependencies added: base, gogol-core
Files
- LICENSE +367/−0
- README.md +28/−0
- Setup.hs +2/−0
- gen/Network/Google/CommentAnalyzer.hs +168/−0
- gen/Network/Google/CommentAnalyzer/Types.hs +148/−0
- gen/Network/Google/CommentAnalyzer/Types/Product.hs +988/−0
- gen/Network/Google/CommentAnalyzer/Types/Sum.hs +183/−0
- gen/Network/Google/Resource/CommentAnalyzer/Comments/Analyze.hs +150/−0
- gen/Network/Google/Resource/CommentAnalyzer/Comments/Suggestscore.hs +151/−0
- gogol-commentanalyzer.cabal +53/−0
- src/.gitkeep +0/−0
+ LICENSE view
@@ -0,0 +1,367 @@+Mozilla Public License Version 2.0+==================================++1. Definitions+--------------++1.1. "Contributor"+ means each individual or legal entity that creates, contributes to+ the creation of, or owns Covered Software.++1.2. "Contributor Version"+ means the combination of the Contributions of others (if any) used+ by a Contributor and that particular Contributor's Contribution.++1.3. "Contribution"+ means Covered Software of a particular Contributor.++1.4. "Covered Software"+ means Source Code Form to which the initial Contributor has attached+ the notice in Exhibit A, the Executable Form of such Source Code+ Form, and Modifications of such Source Code Form, in each case+ including portions thereof.++1.5. "Incompatible With Secondary Licenses"+ means++ (a) that the initial Contributor has attached the notice described+ in Exhibit B to the Covered Software; or++ (b) that the Covered Software was made available under the terms of+ version 1.1 or earlier of the License, but not also under the+ terms of a Secondary License.++1.6. "Executable Form"+ means any form of the work other than Source Code Form.++1.7. "Larger Work"+ means a work that combines Covered Software with other material, in+ a separate file or files, that is not Covered Software.++1.8. "License"+ means this document.++1.9. "Licensable"+ means having the right to grant, to the maximum extent possible,+ whether at the time of the initial grant or subsequently, any and+ all of the rights conveyed by this License.++1.10. "Modifications"+ means any of the following:++ (a) any file in Source Code Form that results from an addition to,+ deletion from, or modification of the contents of Covered+ Software; or++ (b) any new file in Source Code Form that contains any Covered+ Software.++1.11. "Patent Claims" of a Contributor+ means any patent claim(s), including without limitation, method,+ process, and apparatus claims, in any patent Licensable by such+ Contributor that would be infringed, but for the grant of the+ License, by the making, using, selling, offering for sale, having+ made, import, or transfer of either its Contributions or its+ Contributor Version.++1.12. "Secondary License"+ means either the GNU General Public License, Version 2.0, the GNU+ Lesser General Public License, Version 2.1, the GNU Affero General+ Public License, Version 3.0, or any later versions of those+ licenses.++1.13. "Source Code Form"+ means the form of the work preferred for making modifications.++1.14. "You" (or "Your")+ means an individual or a legal entity exercising rights under this+ License. For legal entities, "You" includes any entity that+ controls, is controlled by, or is under common control with You. For+ purposes of this definition, "control" means (a) the power, direct+ or indirect, to cause the direction or management of such entity,+ whether by contract or otherwise, or (b) ownership of more than+ fifty percent (50%) of the outstanding shares or beneficial+ ownership of such entity.++2. License Grants and Conditions+--------------------------------++2.1. Grants++Each Contributor hereby grants You a world-wide, royalty-free,+non-exclusive license:++(a) under intellectual property rights (other than patent or trademark)+ Licensable by such Contributor to use, reproduce, make available,+ modify, display, perform, distribute, and otherwise exploit its+ Contributions, either on an unmodified basis, with Modifications, or+ as part of a Larger Work; and++(b) under Patent Claims of such Contributor to make, use, sell, offer+ for sale, have made, import, and otherwise transfer either its+ Contributions or its Contributor Version.++2.2. Effective Date++The licenses granted in Section 2.1 with respect to any Contribution+become effective for each Contribution on the date the Contributor first+distributes such Contribution.++2.3. Limitations on Grant Scope++The licenses granted in this Section 2 are the only rights granted under+this License. No additional rights or licenses will be implied from the+distribution or licensing of Covered Software under this License.+Notwithstanding Section 2.1(b) above, no patent license is granted by a+Contributor:++(a) for any code that a Contributor has removed from Covered Software;+ or++(b) for infringements caused by: (i) Your and any other third party's+ modifications of Covered Software, or (ii) the combination of its+ Contributions with other software (except as part of its Contributor+ Version); or++(c) under Patent Claims infringed by Covered Software in the absence of+ its Contributions.++This License does not grant any rights in the trademarks, service marks,+or logos of any Contributor (except as may be necessary to comply with+the notice requirements in Section 3.4).++2.4. Subsequent Licenses++No Contributor makes additional grants as a result of Your choice to+distribute the Covered Software under a subsequent version of this+License (see Section 10.2) or under the terms of a Secondary License (if+permitted under the terms of Section 3.3).++2.5. Representation++Each Contributor represents that the Contributor believes its+Contributions are its original creation(s) or it has sufficient rights+to grant the rights to its Contributions conveyed by this License.++2.6. Fair Use++This License is not intended to limit any rights You have under+applicable copyright doctrines of fair use, fair dealing, or other+equivalents.++2.7. Conditions++Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted+in Section 2.1.++3. Responsibilities+-------------------++3.1. Distribution of Source Form++All distribution of Covered Software in Source Code Form, including any+Modifications that You create or to which You contribute, must be under+the terms of this License. You must inform recipients that the Source+Code Form of the Covered Software is governed by the terms of this+License, and how they can obtain a copy of this License. You may not+attempt to alter or restrict the recipients' rights in the Source Code+Form.++3.2. Distribution of Executable Form++If You distribute Covered Software in Executable Form then:++(a) such Covered Software must also be made available in Source Code+ Form, as described in Section 3.1, and You must inform recipients of+ the Executable Form how they can obtain a copy of such Source Code+ Form by reasonable means in a timely manner, at a charge no more+ than the cost of distribution to the recipient; and++(b) You may distribute such Executable Form under the terms of this+ License, or sublicense it under different terms, provided that the+ license for the Executable Form does not attempt to limit or alter+ the recipients' rights in the Source Code Form under this License.++3.3. Distribution of a Larger Work++You may create and distribute a Larger Work under terms of Your choice,+provided that You also comply with the requirements of this License for+the Covered Software. If the Larger Work is a combination of Covered+Software with a work governed by one or more Secondary Licenses, and the+Covered Software is not Incompatible With Secondary Licenses, this+License permits You to additionally distribute such Covered Software+under the terms of such Secondary License(s), so that the recipient of+the Larger Work may, at their option, further distribute the Covered+Software under the terms of either this License or such Secondary+License(s).++3.4. Notices++You may not remove or alter the substance of any license notices+(including copyright notices, patent notices, disclaimers of warranty,+or limitations of liability) contained within the Source Code Form of+the Covered Software, except that You may alter any license notices to+the extent required to remedy known factual inaccuracies.++3.5. Application of Additional Terms++You may choose to offer, and to charge a fee for, warranty, support,+indemnity or liability obligations to one or more recipients of Covered+Software. However, You may do so only on Your own behalf, and not on+behalf of any Contributor. You must make it absolutely clear that any+such warranty, support, indemnity, or liability obligation is offered by+You alone, and You hereby agree to indemnify every Contributor for any+liability incurred by such Contributor as a result of warranty, support,+indemnity or liability terms You offer. You may include additional+disclaimers of warranty and limitations of liability specific to any+jurisdiction.++4. Inability to Comply Due to Statute or Regulation+---------------------------------------------------++If it is impossible for You to comply with any of the terms of this+License with respect to some or all of the Covered Software due to+statute, judicial order, or regulation then You must: (a) comply with+the terms of this License to the maximum extent possible; and (b)+describe the limitations and the code they affect. Such description must+be placed in a text file included with all distributions of the Covered+Software under this License. Except to the extent prohibited by statute+or regulation, such description must be sufficiently detailed for a+recipient of ordinary skill to be able to understand it.++5. Termination+--------------++5.1. The rights granted under this License will terminate automatically+if You fail to comply with any of its terms. However, if You become+compliant, then the rights granted under this License from a particular+Contributor are reinstated (a) provisionally, unless and until such+Contributor explicitly and finally terminates Your grants, and (b) on an+ongoing basis, if such Contributor fails to notify You of the+non-compliance by some reasonable means prior to 60 days after You have+come back into compliance. Moreover, Your grants from a particular+Contributor are reinstated on an ongoing basis if such Contributor+notifies You of the non-compliance by some reasonable means, this is the+first time You have received notice of non-compliance with this License+from such Contributor, and You become compliant prior to 30 days after+Your receipt of the notice.++5.2. If You initiate litigation against any entity by asserting a patent+infringement claim (excluding declaratory judgment actions,+counter-claims, and cross-claims) alleging that a Contributor Version+directly or indirectly infringes any patent, then the rights granted to+You by any and all Contributors for the Covered Software under Section+2.1 of this License shall terminate.++5.3. In the event of termination under Sections 5.1 or 5.2 above, all+end user license agreements (excluding distributors and resellers) which+have been validly granted by You or Your distributors under this License+prior to termination shall survive termination.++************************************************************************+* *+* 6. Disclaimer of Warranty *+* ------------------------- *+* *+* Covered Software is provided under this License on an "as is" *+* basis, without warranty of any kind, either expressed, implied, or *+* statutory, including, without limitation, warranties that the *+* Covered Software is free of defects, merchantable, fit for a *+* particular purpose or non-infringing. The entire risk as to the *+* quality and performance of the Covered Software is with You. *+* Should any Covered Software prove defective in any respect, You *+* (not any Contributor) assume the cost of any necessary servicing, *+* repair, or correction. This disclaimer of warranty constitutes an *+* essential part of this License. No use of any Covered Software is *+* authorized under this License except under this disclaimer. *+* *+************************************************************************++************************************************************************+* *+* 7. Limitation of Liability *+* -------------------------- *+* *+* Under no circumstances and under no legal theory, whether tort *+* (including negligence), contract, or otherwise, shall any *+* Contributor, or anyone who distributes Covered Software as *+* permitted above, be liable to You for any direct, indirect, *+* special, incidental, or consequential damages of any character *+* including, without limitation, damages for lost profits, loss of *+* goodwill, work stoppage, computer failure or malfunction, or any *+* and all other commercial damages or losses, even if such party *+* shall have been informed of the possibility of such damages. This *+* limitation of liability shall not apply to liability for death or *+* personal injury resulting from such party's negligence to the *+* extent applicable law prohibits such limitation. Some *+* jurisdictions do not allow the exclusion or limitation of *+* incidental or consequential damages, so this exclusion and *+* limitation may not apply to You. *+* *+************************************************************************++8. Litigation+-------------++Any litigation relating to this License may be brought only in the+courts of a jurisdiction where the defendant maintains its principal+place of business and such litigation shall be governed by laws of that+jurisdiction, without reference to its conflict-of-law provisions.+Nothing in this Section shall prevent a party's ability to bring+cross-claims or counter-claims.++9. Miscellaneous+----------------++This License represents the complete agreement concerning the subject+matter hereof. If any provision of this License is held to be+unenforceable, such provision shall be reformed only to the extent+necessary to make it enforceable. Any law or regulation which provides+that the language of a contract shall be construed against the drafter+shall not be used to construe this License against a Contributor.++10. Versions of the License+---------------------------++10.1. New Versions++Mozilla Foundation is the license steward. Except as provided in Section+10.3, no one other than the license steward has the right to modify or+publish new versions of this License. Each version will be given a+distinguishing version number.++10.2. Effect of New Versions++You may distribute the Covered Software under the terms of the version+of the License under which You originally received the Covered Software,+or under the terms of any subsequent version published by the license+steward.++10.3. Modified Versions++If you create software not governed by this License, and you want to+create a new license for such software, you may create and use a+modified version of this License if you rename the license and remove+any references to the name of the license steward (except to note that+such modified license differs from this License).++10.4. Distributing Source Code Form that is Incompatible With Secondary+Licenses++If You choose to distribute Source Code Form that is Incompatible With+Secondary Licenses under the terms of this version of the License, the+notice described in Exhibit B of this License must be attached.++Exhibit A - Source Code Form License Notice+-------------------------------------------++ This Source Code Form is subject to the terms of the Mozilla Public+ License, v. 2.0. If a copy of the MPL was not distributed with this+ file, You can obtain one at http://mozilla.org/MPL/2.0/.++If it is not possible or desirable to put the notice in a particular+file, then You may include the notice in a location (such as a LICENSE+file in a relevant directory) where a recipient would be likely to look+for such a notice.++You may add additional accurate notices of copyright ownership.
+ README.md view
@@ -0,0 +1,28 @@+# gogol-commentanalyzer++* [Version](#version)+* [Description](#description)+* [Contribute](#contribute)+* [Licence](#licence)+++## Version++`0.5.0`+++## Description++A client library for the Google Perspective Comment Analyzer.+++## Contribute++For any problems, comments, or feedback please create an issue [here on GitHub](https://github.com/brendanhay/gogol/issues).++> _Note:_ this library is an auto-generated Haskell package. Please see `gogol-gen` for more information.+++## Licence++`gogol-commentanalyzer` is released under the [Mozilla Public License Version 2.0](http://www.mozilla.org/MPL/).
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ gen/Network/Google/CommentAnalyzer.hs view
@@ -0,0 +1,168 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE TypeOperators #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}++-- |+-- Module : Network.Google.CommentAnalyzer+-- Copyright : (c) 2015-2016 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- The Perspective Comment Analyzer API provides information about the+-- potential impact of a comment on a conversation (e.g. it can provide a+-- score for the \"toxicity\" of a comment). Users can leverage the+-- \"SuggestCommentScore\" method to submit corrections to improve+-- Perspective over time. Users can set the \"doNotStore\" flag to ensure+-- that all submitted comments are automatically deleted after scores are+-- returned.+--+-- /See:/ <https://conversationai.github.io/ Perspective Comment Analyzer API Reference>+module Network.Google.CommentAnalyzer+ (+ -- * Service Configuration+ commentAnalyzerService++ -- * OAuth Scopes+ , userInfoEmailScope++ -- * API Declaration+ , CommentAnalyzerAPI++ -- * Resources++ -- ** commentanalyzer.comments.analyze+ , module Network.Google.Resource.CommentAnalyzer.Comments.Analyze++ -- ** commentanalyzer.comments.suggestscore+ , module Network.Google.Resource.CommentAnalyzer.Comments.Suggestscore++ -- * Types++ -- ** SpanScore+ , SpanScore+ , spanScore+ , ssBegin+ , ssScore+ , ssEnd++ -- ** AnalyzeCommentResponse+ , AnalyzeCommentResponse+ , analyzeCommentResponse+ , acrDetectedLanguages+ , acrClientToken+ , acrLanguages+ , acrAttributeScores++ -- ** SuggestCommentScoreResponse+ , SuggestCommentScoreResponse+ , suggestCommentScoreResponse+ , scsrDetectedLanguages+ , scsrClientToken+ , scsrRequestedLanguages++ -- ** Context+ , Context+ , context+ , cEntries+ , cArticleAndParentComment++ -- ** Score+ , Score+ , score+ , sValue+ , sType++ -- ** ArticleAndParentComment+ , ArticleAndParentComment+ , articleAndParentComment+ , aapcArticle+ , aapcParentComment++ -- ** AttributeParameters+ , AttributeParameters+ , attributeParameters+ , apScoreThreshold+ , apScoreType++ -- ** TextEntry+ , TextEntry+ , textEntry+ , teText+ , teType++ -- ** AttributeScores+ , AttributeScores+ , attributeScores+ , asSummaryScore+ , asSpanScores++ -- ** Xgafv+ , Xgafv (..)++ -- ** ScoreType+ , ScoreType (..)++ -- ** AnalyzeCommentResponseAttributeScores+ , AnalyzeCommentResponseAttributeScores+ , analyzeCommentResponseAttributeScores+ , acrasAddtional++ -- ** SuggestCommentScoreRequest+ , SuggestCommentScoreRequest+ , suggestCommentScoreRequest+ , sContext+ , sClientToken+ , sLanguages+ , sAttributeScores+ , sSessionId+ , sComment+ , sCommUnityId++ -- ** AttributeParametersScoreType+ , AttributeParametersScoreType (..)++ -- ** AnalyzeCommentRequest+ , AnalyzeCommentRequest+ , analyzeCommentRequest+ , aContext+ , aClientToken+ , aSpanAnnotations+ , aDoNotStore+ , aLanguages+ , aRequestedAttributes+ , aSessionId+ , aComment+ , aCommUnityId++ -- ** SuggestCommentScoreRequestAttributeScores+ , SuggestCommentScoreRequestAttributeScores+ , suggestCommentScoreRequestAttributeScores+ , scsrasAddtional++ -- ** AnalyzeCommentRequestRequestedAttributes+ , AnalyzeCommentRequestRequestedAttributes+ , analyzeCommentRequestRequestedAttributes+ , acrraAddtional++ -- ** TextEntryType+ , TextEntryType (..)+ ) where++import Network.Google.CommentAnalyzer.Types+import Network.Google.Prelude+import Network.Google.Resource.CommentAnalyzer.Comments.Analyze+import Network.Google.Resource.CommentAnalyzer.Comments.Suggestscore++{- $resources+TODO+-}++-- | Represents the entirety of the methods and resources available for the Perspective Comment Analyzer API service.+type CommentAnalyzerAPI =+ CommentsSuggestscoreResource :<|>+ CommentsAnalyzeResource
+ gen/Network/Google/CommentAnalyzer/Types.hs view
@@ -0,0 +1,148 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Network.Google.CommentAnalyzer.Types+-- Copyright : (c) 2015-2016 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+module Network.Google.CommentAnalyzer.Types+ (+ -- * Service Configuration+ commentAnalyzerService++ -- * OAuth Scopes+ , userInfoEmailScope++ -- * SpanScore+ , SpanScore+ , spanScore+ , ssBegin+ , ssScore+ , ssEnd++ -- * AnalyzeCommentResponse+ , AnalyzeCommentResponse+ , analyzeCommentResponse+ , acrDetectedLanguages+ , acrClientToken+ , acrLanguages+ , acrAttributeScores++ -- * SuggestCommentScoreResponse+ , SuggestCommentScoreResponse+ , suggestCommentScoreResponse+ , scsrDetectedLanguages+ , scsrClientToken+ , scsrRequestedLanguages++ -- * Context+ , Context+ , context+ , cEntries+ , cArticleAndParentComment++ -- * Score+ , Score+ , score+ , sValue+ , sType++ -- * ArticleAndParentComment+ , ArticleAndParentComment+ , articleAndParentComment+ , aapcArticle+ , aapcParentComment++ -- * AttributeParameters+ , AttributeParameters+ , attributeParameters+ , apScoreThreshold+ , apScoreType++ -- * TextEntry+ , TextEntry+ , textEntry+ , teText+ , teType++ -- * AttributeScores+ , AttributeScores+ , attributeScores+ , asSummaryScore+ , asSpanScores++ -- * Xgafv+ , Xgafv (..)++ -- * ScoreType+ , ScoreType (..)++ -- * AnalyzeCommentResponseAttributeScores+ , AnalyzeCommentResponseAttributeScores+ , analyzeCommentResponseAttributeScores+ , acrasAddtional++ -- * SuggestCommentScoreRequest+ , SuggestCommentScoreRequest+ , suggestCommentScoreRequest+ , sContext+ , sClientToken+ , sLanguages+ , sAttributeScores+ , sSessionId+ , sComment+ , sCommUnityId++ -- * AttributeParametersScoreType+ , AttributeParametersScoreType (..)++ -- * AnalyzeCommentRequest+ , AnalyzeCommentRequest+ , analyzeCommentRequest+ , aContext+ , aClientToken+ , aSpanAnnotations+ , aDoNotStore+ , aLanguages+ , aRequestedAttributes+ , aSessionId+ , aComment+ , aCommUnityId++ -- * SuggestCommentScoreRequestAttributeScores+ , SuggestCommentScoreRequestAttributeScores+ , suggestCommentScoreRequestAttributeScores+ , scsrasAddtional++ -- * AnalyzeCommentRequestRequestedAttributes+ , AnalyzeCommentRequestRequestedAttributes+ , analyzeCommentRequestRequestedAttributes+ , acrraAddtional++ -- * TextEntryType+ , TextEntryType (..)+ ) where++import Network.Google.CommentAnalyzer.Types.Product+import Network.Google.CommentAnalyzer.Types.Sum+import Network.Google.Prelude++-- | Default request referring to version 'v1alpha1' of the Perspective Comment Analyzer API. This contains the host and root path used as a starting point for constructing service requests.+commentAnalyzerService :: ServiceConfig+commentAnalyzerService+ = defaultService+ (ServiceId "commentanalyzer:v1alpha1")+ "commentanalyzer.googleapis.com"++-- | View your email address+userInfoEmailScope :: Proxy '["https://www.googleapis.com/auth/userinfo.email"]+userInfoEmailScope = Proxy
+ gen/Network/Google/CommentAnalyzer/Types/Product.hs view
@@ -0,0 +1,988 @@+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}++{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Network.Google.CommentAnalyzer.Types.Product+-- Copyright : (c) 2015-2016 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+module Network.Google.CommentAnalyzer.Types.Product where++import Network.Google.CommentAnalyzer.Types.Sum+import Network.Google.Prelude++-- | This is a single score for a given span of text.+--+-- /See:/ 'spanScore' smart constructor.+data SpanScore =+ SpanScore'+ { _ssBegin :: !(Maybe (Textual Int32))+ , _ssScore :: !(Maybe Score)+ , _ssEnd :: !(Maybe (Textual Int32))+ }+ deriving (Eq, Show, Data, Typeable, Generic)+++-- | Creates a value of 'SpanScore' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'ssBegin'+--+-- * 'ssScore'+--+-- * 'ssEnd'+spanScore+ :: SpanScore+spanScore =+ SpanScore' {_ssBegin = Nothing, _ssScore = Nothing, _ssEnd = Nothing}+++-- | \"begin\" and \"end\" describe the span of the original text that the+-- attribute score applies to. The values are the UTF-16 codepoint range.+-- \"end\" is exclusive. For example, with the text \"Hi there\", the+-- begin\/end pair (0,2) describes the text \"Hi\". If \"begin\" and+-- \"end\" are unset, the score applies to the full text.+ssBegin :: Lens' SpanScore (Maybe Int32)+ssBegin+ = lens _ssBegin (\ s a -> s{_ssBegin = a}) .+ mapping _Coerce++-- | The score value.+ssScore :: Lens' SpanScore (Maybe Score)+ssScore = lens _ssScore (\ s a -> s{_ssScore = a})++ssEnd :: Lens' SpanScore (Maybe Int32)+ssEnd+ = lens _ssEnd (\ s a -> s{_ssEnd = a}) .+ mapping _Coerce++instance FromJSON SpanScore where+ parseJSON+ = withObject "SpanScore"+ (\ o ->+ SpanScore' <$>+ (o .:? "begin") <*> (o .:? "score") <*>+ (o .:? "end"))++instance ToJSON SpanScore where+ toJSON SpanScore'{..}+ = object+ (catMaybes+ [("begin" .=) <$> _ssBegin,+ ("score" .=) <$> _ssScore, ("end" .=) <$> _ssEnd])++-- | The comment analysis response message.+--+-- /See:/ 'analyzeCommentResponse' smart constructor.+data AnalyzeCommentResponse =+ AnalyzeCommentResponse'+ { _acrDetectedLanguages :: !(Maybe [Text])+ , _acrClientToken :: !(Maybe Text)+ , _acrLanguages :: !(Maybe [Text])+ , _acrAttributeScores :: !(Maybe AnalyzeCommentResponseAttributeScores)+ }+ deriving (Eq, Show, Data, Typeable, Generic)+++-- | Creates a value of 'AnalyzeCommentResponse' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'acrDetectedLanguages'+--+-- * 'acrClientToken'+--+-- * 'acrLanguages'+--+-- * 'acrAttributeScores'+analyzeCommentResponse+ :: AnalyzeCommentResponse+analyzeCommentResponse =+ AnalyzeCommentResponse'+ { _acrDetectedLanguages = Nothing+ , _acrClientToken = Nothing+ , _acrLanguages = Nothing+ , _acrAttributeScores = Nothing+ }+++-- | Contains the language as detected from the text content. If no language+-- was specified in the request, the first (the most likely) language is+-- used to select an appropriate model. Sorted in order of likelihood.+acrDetectedLanguages :: Lens' AnalyzeCommentResponse [Text]+acrDetectedLanguages+ = lens _acrDetectedLanguages+ (\ s a -> s{_acrDetectedLanguages = a})+ . _Default+ . _Coerce++-- | Same token from the original AnalyzeCommentRequest.+acrClientToken :: Lens' AnalyzeCommentResponse (Maybe Text)+acrClientToken+ = lens _acrClientToken+ (\ s a -> s{_acrClientToken = a})++-- | The language(s) requested by the client, as specified in the request. If+-- the request did not specify any language, this will be empty and the+-- detected_languages field will be populated.+acrLanguages :: Lens' AnalyzeCommentResponse [Text]+acrLanguages+ = lens _acrLanguages (\ s a -> s{_acrLanguages = a})+ . _Default+ . _Coerce++-- | Scores for the requested attributes. The map keys are attribute names+-- (same as the requested_attribute field in AnalyzeCommentRequest, for+-- example \"ATTACK_ON_AUTHOR\", \"INFLAMMATORY\", etc).+acrAttributeScores :: Lens' AnalyzeCommentResponse (Maybe AnalyzeCommentResponseAttributeScores)+acrAttributeScores+ = lens _acrAttributeScores+ (\ s a -> s{_acrAttributeScores = a})++instance FromJSON AnalyzeCommentResponse where+ parseJSON+ = withObject "AnalyzeCommentResponse"+ (\ o ->+ AnalyzeCommentResponse' <$>+ (o .:? "detectedLanguages" .!= mempty) <*>+ (o .:? "clientToken")+ <*> (o .:? "languages" .!= mempty)+ <*> (o .:? "attributeScores"))++instance ToJSON AnalyzeCommentResponse where+ toJSON AnalyzeCommentResponse'{..}+ = object+ (catMaybes+ [("detectedLanguages" .=) <$> _acrDetectedLanguages,+ ("clientToken" .=) <$> _acrClientToken,+ ("languages" .=) <$> _acrLanguages,+ ("attributeScores" .=) <$> _acrAttributeScores])++-- | The comment score suggestion response message.+--+-- /See:/ 'suggestCommentScoreResponse' smart constructor.+data SuggestCommentScoreResponse =+ SuggestCommentScoreResponse'+ { _scsrDetectedLanguages :: !(Maybe [Text])+ , _scsrClientToken :: !(Maybe Text)+ , _scsrRequestedLanguages :: !(Maybe [Text])+ }+ deriving (Eq, Show, Data, Typeable, Generic)+++-- | Creates a value of 'SuggestCommentScoreResponse' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'scsrDetectedLanguages'+--+-- * 'scsrClientToken'+--+-- * 'scsrRequestedLanguages'+suggestCommentScoreResponse+ :: SuggestCommentScoreResponse+suggestCommentScoreResponse =+ SuggestCommentScoreResponse'+ { _scsrDetectedLanguages = Nothing+ , _scsrClientToken = Nothing+ , _scsrRequestedLanguages = Nothing+ }+++-- | The list of languages detected from the comment text.+scsrDetectedLanguages :: Lens' SuggestCommentScoreResponse [Text]+scsrDetectedLanguages+ = lens _scsrDetectedLanguages+ (\ s a -> s{_scsrDetectedLanguages = a})+ . _Default+ . _Coerce++-- | Same token from the original SuggestCommentScoreRequest.+scsrClientToken :: Lens' SuggestCommentScoreResponse (Maybe Text)+scsrClientToken+ = lens _scsrClientToken+ (\ s a -> s{_scsrClientToken = a})++-- | The list of languages provided in the request.+scsrRequestedLanguages :: Lens' SuggestCommentScoreResponse [Text]+scsrRequestedLanguages+ = lens _scsrRequestedLanguages+ (\ s a -> s{_scsrRequestedLanguages = a})+ . _Default+ . _Coerce++instance FromJSON SuggestCommentScoreResponse where+ parseJSON+ = withObject "SuggestCommentScoreResponse"+ (\ o ->+ SuggestCommentScoreResponse' <$>+ (o .:? "detectedLanguages" .!= mempty) <*>+ (o .:? "clientToken")+ <*> (o .:? "requestedLanguages" .!= mempty))++instance ToJSON SuggestCommentScoreResponse where+ toJSON SuggestCommentScoreResponse'{..}+ = object+ (catMaybes+ [("detectedLanguages" .=) <$> _scsrDetectedLanguages,+ ("clientToken" .=) <$> _scsrClientToken,+ ("requestedLanguages" .=) <$>+ _scsrRequestedLanguages])++-- | Context is typically something that a Comment is referencing or replying+-- to (such as an article, or previous comment). Note: Populate only ONE OF+-- the following fields. The oneof syntax cannot be used because that would+-- require nesting entries inside another message and breaking backwards+-- compatibility. The server will return an error if more than one of the+-- following fields is present.+--+-- /See:/ 'context' smart constructor.+data Context =+ Context'+ { _cEntries :: !(Maybe [TextEntry])+ , _cArticleAndParentComment :: !(Maybe ArticleAndParentComment)+ }+ deriving (Eq, Show, Data, Typeable, Generic)+++-- | Creates a value of 'Context' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'cEntries'+--+-- * 'cArticleAndParentComment'+context+ :: Context+context = Context' {_cEntries = Nothing, _cArticleAndParentComment = Nothing}+++-- | A list of messages. For example, a linear comments section or forum+-- thread.+cEntries :: Lens' Context [TextEntry]+cEntries+ = lens _cEntries (\ s a -> s{_cEntries = a}) .+ _Default+ . _Coerce++-- | Information about the source for which the original comment was made,+-- and any parent comment info.+cArticleAndParentComment :: Lens' Context (Maybe ArticleAndParentComment)+cArticleAndParentComment+ = lens _cArticleAndParentComment+ (\ s a -> s{_cArticleAndParentComment = a})++instance FromJSON Context where+ parseJSON+ = withObject "Context"+ (\ o ->+ Context' <$>+ (o .:? "entries" .!= mempty) <*>+ (o .:? "articleAndParentComment"))++instance ToJSON Context where+ toJSON Context'{..}+ = object+ (catMaybes+ [("entries" .=) <$> _cEntries,+ ("articleAndParentComment" .=) <$>+ _cArticleAndParentComment])++-- | Analysis scores are described by a value and a ScoreType.+--+-- /See:/ 'score' smart constructor.+data Score =+ Score'+ { _sValue :: !(Maybe (Textual Double))+ , _sType :: !(Maybe ScoreType)+ }+ deriving (Eq, Show, Data, Typeable, Generic)+++-- | Creates a value of 'Score' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'sValue'+--+-- * 'sType'+score+ :: Score+score = Score' {_sValue = Nothing, _sType = Nothing}+++-- | Score value. Semantics described by type below.+sValue :: Lens' Score (Maybe Double)+sValue+ = lens _sValue (\ s a -> s{_sValue = a}) .+ mapping _Coerce++-- | The type of the above value.+sType :: Lens' Score (Maybe ScoreType)+sType = lens _sType (\ s a -> s{_sType = a})++instance FromJSON Score where+ parseJSON+ = withObject "Score"+ (\ o ->+ Score' <$> (o .:? "value") <*> (o .:? "type"))++instance ToJSON Score where+ toJSON Score'{..}+ = object+ (catMaybes+ [("value" .=) <$> _sValue, ("type" .=) <$> _sType])++-- | A type of context specific to a comment left on a single-threaded+-- comment message board, where comments are either a top level comment or+-- the child of a top level comment.+--+-- /See:/ 'articleAndParentComment' smart constructor.+data ArticleAndParentComment =+ ArticleAndParentComment'+ { _aapcArticle :: !(Maybe TextEntry)+ , _aapcParentComment :: !(Maybe TextEntry)+ }+ deriving (Eq, Show, Data, Typeable, Generic)+++-- | Creates a value of 'ArticleAndParentComment' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'aapcArticle'+--+-- * 'aapcParentComment'+articleAndParentComment+ :: ArticleAndParentComment+articleAndParentComment =+ ArticleAndParentComment'+ {_aapcArticle = Nothing, _aapcParentComment = Nothing}+++-- | The source content about which the comment was made (article text,+-- article summary, video transcript, etc).+aapcArticle :: Lens' ArticleAndParentComment (Maybe TextEntry)+aapcArticle+ = lens _aapcArticle (\ s a -> s{_aapcArticle = a})++-- | Refers to text that is a direct parent of the source comment, such as in+-- a one-deep threaded message board. This field will only be present for+-- comments that are replies to other comments and will not be populated+-- for direct comments on the article_text.+aapcParentComment :: Lens' ArticleAndParentComment (Maybe TextEntry)+aapcParentComment+ = lens _aapcParentComment+ (\ s a -> s{_aapcParentComment = a})++instance FromJSON ArticleAndParentComment where+ parseJSON+ = withObject "ArticleAndParentComment"+ (\ o ->+ ArticleAndParentComment' <$>+ (o .:? "article") <*> (o .:? "parentComment"))++instance ToJSON ArticleAndParentComment where+ toJSON ArticleAndParentComment'{..}+ = object+ (catMaybes+ [("article" .=) <$> _aapcArticle,+ ("parentComment" .=) <$> _aapcParentComment])++-- | Configurable parameters for attribute scoring.+--+-- /See:/ 'attributeParameters' smart constructor.+data AttributeParameters =+ AttributeParameters'+ { _apScoreThreshold :: !(Maybe (Textual Double))+ , _apScoreType :: !(Maybe AttributeParametersScoreType)+ }+ deriving (Eq, Show, Data, Typeable, Generic)+++-- | Creates a value of 'AttributeParameters' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'apScoreThreshold'+--+-- * 'apScoreType'+attributeParameters+ :: AttributeParameters+attributeParameters =+ AttributeParameters' {_apScoreThreshold = Nothing, _apScoreType = Nothing}+++-- | Don\'t return scores for this attribute that are below this threshold.+-- If unset, a default threshold will be applied. A FloatValue wrapper is+-- used to distinguish between 0 vs. default\/unset.+apScoreThreshold :: Lens' AttributeParameters (Maybe Double)+apScoreThreshold+ = lens _apScoreThreshold+ (\ s a -> s{_apScoreThreshold = a})+ . mapping _Coerce++-- | What type of scores to return. If unset, defaults to probability scores.+apScoreType :: Lens' AttributeParameters (Maybe AttributeParametersScoreType)+apScoreType+ = lens _apScoreType (\ s a -> s{_apScoreType = a})++instance FromJSON AttributeParameters where+ parseJSON+ = withObject "AttributeParameters"+ (\ o ->+ AttributeParameters' <$>+ (o .:? "scoreThreshold") <*> (o .:? "scoreType"))++instance ToJSON AttributeParameters where+ toJSON AttributeParameters'{..}+ = object+ (catMaybes+ [("scoreThreshold" .=) <$> _apScoreThreshold,+ ("scoreType" .=) <$> _apScoreType])++-- | Represents a body of text.+--+-- /See:/ 'textEntry' smart constructor.+data TextEntry =+ TextEntry'+ { _teText :: !(Maybe Text)+ , _teType :: !(Maybe TextEntryType)+ }+ deriving (Eq, Show, Data, Typeable, Generic)+++-- | Creates a value of 'TextEntry' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'teText'+--+-- * 'teType'+textEntry+ :: TextEntry+textEntry = TextEntry' {_teText = Nothing, _teType = Nothing}+++-- | UTF-8 encoded text.+teText :: Lens' TextEntry (Maybe Text)+teText = lens _teText (\ s a -> s{_teText = a})++-- | Type of the text field.+teType :: Lens' TextEntry (Maybe TextEntryType)+teType = lens _teType (\ s a -> s{_teType = a})++instance FromJSON TextEntry where+ parseJSON+ = withObject "TextEntry"+ (\ o ->+ TextEntry' <$> (o .:? "text") <*> (o .:? "type"))++instance ToJSON TextEntry where+ toJSON TextEntry'{..}+ = object+ (catMaybes+ [("text" .=) <$> _teText, ("type" .=) <$> _teType])++-- | This holds score values for a single attribute. It contains both+-- per-span scores as well as an overall summary score..+--+-- /See:/ 'attributeScores' smart constructor.+data AttributeScores =+ AttributeScores'+ { _asSummaryScore :: !(Maybe Score)+ , _asSpanScores :: !(Maybe [SpanScore])+ }+ deriving (Eq, Show, Data, Typeable, Generic)+++-- | Creates a value of 'AttributeScores' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'asSummaryScore'+--+-- * 'asSpanScores'+attributeScores+ :: AttributeScores+attributeScores =+ AttributeScores' {_asSummaryScore = Nothing, _asSpanScores = Nothing}+++-- | Overall score for comment as a whole.+asSummaryScore :: Lens' AttributeScores (Maybe Score)+asSummaryScore+ = lens _asSummaryScore+ (\ s a -> s{_asSummaryScore = a})++-- | Per-span scores.+asSpanScores :: Lens' AttributeScores [SpanScore]+asSpanScores+ = lens _asSpanScores (\ s a -> s{_asSpanScores = a})+ . _Default+ . _Coerce++instance FromJSON AttributeScores where+ parseJSON+ = withObject "AttributeScores"+ (\ o ->+ AttributeScores' <$>+ (o .:? "summaryScore") <*>+ (o .:? "spanScores" .!= mempty))++instance ToJSON AttributeScores where+ toJSON AttributeScores'{..}+ = object+ (catMaybes+ [("summaryScore" .=) <$> _asSummaryScore,+ ("spanScores" .=) <$> _asSpanScores])++-- | Scores for the requested attributes. The map keys are attribute names+-- (same as the requested_attribute field in AnalyzeCommentRequest, for+-- example \"ATTACK_ON_AUTHOR\", \"INFLAMMATORY\", etc).+--+-- /See:/ 'analyzeCommentResponseAttributeScores' smart constructor.+newtype AnalyzeCommentResponseAttributeScores =+ AnalyzeCommentResponseAttributeScores'+ { _acrasAddtional :: HashMap Text AttributeScores+ }+ deriving (Eq, Show, Data, Typeable, Generic)+++-- | Creates a value of 'AnalyzeCommentResponseAttributeScores' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'acrasAddtional'+analyzeCommentResponseAttributeScores+ :: HashMap Text AttributeScores -- ^ 'acrasAddtional'+ -> AnalyzeCommentResponseAttributeScores+analyzeCommentResponseAttributeScores pAcrasAddtional_ =+ AnalyzeCommentResponseAttributeScores'+ {_acrasAddtional = _Coerce # pAcrasAddtional_}+++acrasAddtional :: Lens' AnalyzeCommentResponseAttributeScores (HashMap Text AttributeScores)+acrasAddtional+ = lens _acrasAddtional+ (\ s a -> s{_acrasAddtional = a})+ . _Coerce++instance FromJSON+ AnalyzeCommentResponseAttributeScores+ where+ parseJSON+ = withObject "AnalyzeCommentResponseAttributeScores"+ (\ o ->+ AnalyzeCommentResponseAttributeScores' <$>+ (parseJSONObject o))++instance ToJSON AnalyzeCommentResponseAttributeScores+ where+ toJSON = toJSON . _acrasAddtional++-- | The comment score suggestion request message.+--+-- /See:/ 'suggestCommentScoreRequest' smart constructor.+data SuggestCommentScoreRequest =+ SuggestCommentScoreRequest'+ { _sContext :: !(Maybe Context)+ , _sClientToken :: !(Maybe Text)+ , _sLanguages :: !(Maybe [Text])+ , _sAttributeScores :: !(Maybe SuggestCommentScoreRequestAttributeScores)+ , _sSessionId :: !(Maybe Text)+ , _sComment :: !(Maybe TextEntry)+ , _sCommUnityId :: !(Maybe Text)+ }+ deriving (Eq, Show, Data, Typeable, Generic)+++-- | Creates a value of 'SuggestCommentScoreRequest' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'sContext'+--+-- * 'sClientToken'+--+-- * 'sLanguages'+--+-- * 'sAttributeScores'+--+-- * 'sSessionId'+--+-- * 'sComment'+--+-- * 'sCommUnityId'+suggestCommentScoreRequest+ :: SuggestCommentScoreRequest+suggestCommentScoreRequest =+ SuggestCommentScoreRequest'+ { _sContext = Nothing+ , _sClientToken = Nothing+ , _sLanguages = Nothing+ , _sAttributeScores = Nothing+ , _sSessionId = Nothing+ , _sComment = Nothing+ , _sCommUnityId = Nothing+ }+++-- | The context of the comment.+sContext :: Lens' SuggestCommentScoreRequest (Maybe Context)+sContext = lens _sContext (\ s a -> s{_sContext = a})++-- | Opaque token that is echoed from the request to the response.+sClientToken :: Lens' SuggestCommentScoreRequest (Maybe Text)+sClientToken+ = lens _sClientToken (\ s a -> s{_sClientToken = a})++-- | The language(s) of the comment and context (if none are specified, the+-- language is automatically detected). If multiple languages are+-- specified, the text is checked in all of them that are supported. Both+-- ISO and BCP-47 language codes are accepted. Current Language+-- Restrictions: * Only English text (\"en\") is supported. If none of the+-- languages specified by the caller are supported, an \`UNIMPLEMENTED\`+-- error is returned.+sLanguages :: Lens' SuggestCommentScoreRequest [Text]+sLanguages+ = lens _sLanguages (\ s a -> s{_sLanguages = a}) .+ _Default+ . _Coerce++-- | Attribute scores for the comment. The map keys are attribute names, same+-- as the requested_attribute field in AnalyzeCommentRequest (for example+-- \"ATTACK_ON_AUTHOR\", \"INFLAMMATORY\", etc.). This field has the same+-- type as the \`attribute_scores\` field in AnalyzeCommentResponse. To+-- specify an overall attribute score for the entire comment as a whole,+-- use the \`summary_score\` field of the mapped AttributeScores object. To+-- specify scores on specific subparts of the comment, use the+-- \`span_scores\` field. All SpanScore objects must have begin and end+-- fields set. All Score objects must be explicitly set (for binary+-- classification, use the score values 0 and 1). If Score objects don\'t+-- include a ScoreType, \`PROBABILITY\` is assumed. \`attribute_scores\`+-- must not be empty. The mapped AttributeScores objects also must not be+-- empty. An \`INVALID_ARGUMENT\` error is returned for all malformed+-- requests.+sAttributeScores :: Lens' SuggestCommentScoreRequest (Maybe SuggestCommentScoreRequestAttributeScores)+sAttributeScores+ = lens _sAttributeScores+ (\ s a -> s{_sAttributeScores = a})++-- | Session ID. Used to join related RPCs into a single session. For+-- example, an interactive tool that calls both the AnalyzeComment and+-- SuggestCommentScore RPCs should set all invocations of both RPCs to the+-- same Session ID, typically a random 64-bit integer.+sSessionId :: Lens' SuggestCommentScoreRequest (Maybe Text)+sSessionId+ = lens _sSessionId (\ s a -> s{_sSessionId = a})++-- | The comment being scored.+sComment :: Lens' SuggestCommentScoreRequest (Maybe TextEntry)+sComment = lens _sComment (\ s a -> s{_sComment = a})++-- | Optional identifier associating this comment score suggestion with a+-- particular sub-community. Different communities may have different norms+-- and rules. Specifying this value enables training community-specific+-- models.+sCommUnityId :: Lens' SuggestCommentScoreRequest (Maybe Text)+sCommUnityId+ = lens _sCommUnityId (\ s a -> s{_sCommUnityId = a})++instance FromJSON SuggestCommentScoreRequest where+ parseJSON+ = withObject "SuggestCommentScoreRequest"+ (\ o ->+ SuggestCommentScoreRequest' <$>+ (o .:? "context") <*> (o .:? "clientToken") <*>+ (o .:? "languages" .!= mempty)+ <*> (o .:? "attributeScores")+ <*> (o .:? "sessionId")+ <*> (o .:? "comment")+ <*> (o .:? "communityId"))++instance ToJSON SuggestCommentScoreRequest where+ toJSON SuggestCommentScoreRequest'{..}+ = object+ (catMaybes+ [("context" .=) <$> _sContext,+ ("clientToken" .=) <$> _sClientToken,+ ("languages" .=) <$> _sLanguages,+ ("attributeScores" .=) <$> _sAttributeScores,+ ("sessionId" .=) <$> _sSessionId,+ ("comment" .=) <$> _sComment,+ ("communityId" .=) <$> _sCommUnityId])++-- | The comment analysis request message.+--+-- /See:/ 'analyzeCommentRequest' smart constructor.+data AnalyzeCommentRequest =+ AnalyzeCommentRequest'+ { _aContext :: !(Maybe Context)+ , _aClientToken :: !(Maybe Text)+ , _aSpanAnnotations :: !(Maybe Bool)+ , _aDoNotStore :: !(Maybe Bool)+ , _aLanguages :: !(Maybe [Text])+ , _aRequestedAttributes :: !(Maybe AnalyzeCommentRequestRequestedAttributes)+ , _aSessionId :: !(Maybe Text)+ , _aComment :: !(Maybe TextEntry)+ , _aCommUnityId :: !(Maybe Text)+ }+ deriving (Eq, Show, Data, Typeable, Generic)+++-- | Creates a value of 'AnalyzeCommentRequest' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'aContext'+--+-- * 'aClientToken'+--+-- * 'aSpanAnnotations'+--+-- * 'aDoNotStore'+--+-- * 'aLanguages'+--+-- * 'aRequestedAttributes'+--+-- * 'aSessionId'+--+-- * 'aComment'+--+-- * 'aCommUnityId'+analyzeCommentRequest+ :: AnalyzeCommentRequest+analyzeCommentRequest =+ AnalyzeCommentRequest'+ { _aContext = Nothing+ , _aClientToken = Nothing+ , _aSpanAnnotations = Nothing+ , _aDoNotStore = Nothing+ , _aLanguages = Nothing+ , _aRequestedAttributes = Nothing+ , _aSessionId = Nothing+ , _aComment = Nothing+ , _aCommUnityId = Nothing+ }+++-- | The context of the comment.+aContext :: Lens' AnalyzeCommentRequest (Maybe Context)+aContext = lens _aContext (\ s a -> s{_aContext = a})++-- | Opaque token that is echoed from the request to the response.+aClientToken :: Lens' AnalyzeCommentRequest (Maybe Text)+aClientToken+ = lens _aClientToken (\ s a -> s{_aClientToken = a})++-- | An advisory parameter that will return span annotations if the model is+-- capable of providing scores with sub-comment resolution. This will+-- likely increase the size of the returned message.+aSpanAnnotations :: Lens' AnalyzeCommentRequest (Maybe Bool)+aSpanAnnotations+ = lens _aSpanAnnotations+ (\ s a -> s{_aSpanAnnotations = a})++-- | Do not store the comment or context sent in this request. By default,+-- the service may store comments\/context for debugging purposes.+aDoNotStore :: Lens' AnalyzeCommentRequest (Maybe Bool)+aDoNotStore+ = lens _aDoNotStore (\ s a -> s{_aDoNotStore = a})++-- | The language(s) of the comment and context (if none are specified, the+-- language is automatically detected). If multiple languages are+-- specified, the text is checked in all of them that are supported. Both+-- ISO and BCP-47 language codes are accepted. Current Language+-- Restrictions: * Only English text (\"en\") is supported. If none of the+-- languages specified by the caller are supported, an \`UNIMPLEMENTED\`+-- error is returned.+aLanguages :: Lens' AnalyzeCommentRequest [Text]+aLanguages+ = lens _aLanguages (\ s a -> s{_aLanguages = a}) .+ _Default+ . _Coerce++-- | Specification of requested attributes. The AttributeParameters serve as+-- configuration for each associated attribute. The map keys are attribute+-- names. The following attributes are available: \"ATTACK_ON_AUTHOR\" -+-- Attack on author of original article or post. \"ATTACK_ON_COMMENTER\" -+-- Attack on fellow commenter. \"ATTACK_ON_PUBLISHER\" - Attack on+-- publisher of article\/post. \"INCOHERENT\" - Difficult to understand,+-- nonsensical. \"INFLAMMATORY\" - Intending to provoke or inflame.+-- \"OBSCENE\" - Obscene, such as cursing. \"OFF_TOPIC\" - Not related to+-- the original topic. \"SPAM\" - Commercial\/advertising spam content.+-- \"UNSUBSTANTIAL\" - Trivial.+aRequestedAttributes :: Lens' AnalyzeCommentRequest (Maybe AnalyzeCommentRequestRequestedAttributes)+aRequestedAttributes+ = lens _aRequestedAttributes+ (\ s a -> s{_aRequestedAttributes = a})++-- | Session ID. Used to join related RPCs into a single session. For+-- example, an interactive tool that calls both the AnalyzeComment and+-- SuggestCommentScore RPCs should set all invocations of both RPCs to the+-- same Session ID, typically a random 64-bit integer.+aSessionId :: Lens' AnalyzeCommentRequest (Maybe Text)+aSessionId+ = lens _aSessionId (\ s a -> s{_aSessionId = a})++-- | The comment to analyze.+aComment :: Lens' AnalyzeCommentRequest (Maybe TextEntry)+aComment = lens _aComment (\ s a -> s{_aComment = a})++-- | Optional identifier associating this AnalyzeCommentRequest with a+-- particular client\'s community. Different communities may have different+-- norms and rules. Specifying this value enables us to explore building+-- community-specific models for clients.+aCommUnityId :: Lens' AnalyzeCommentRequest (Maybe Text)+aCommUnityId+ = lens _aCommUnityId (\ s a -> s{_aCommUnityId = a})++instance FromJSON AnalyzeCommentRequest where+ parseJSON+ = withObject "AnalyzeCommentRequest"+ (\ o ->+ AnalyzeCommentRequest' <$>+ (o .:? "context") <*> (o .:? "clientToken") <*>+ (o .:? "spanAnnotations")+ <*> (o .:? "doNotStore")+ <*> (o .:? "languages" .!= mempty)+ <*> (o .:? "requestedAttributes")+ <*> (o .:? "sessionId")+ <*> (o .:? "comment")+ <*> (o .:? "communityId"))++instance ToJSON AnalyzeCommentRequest where+ toJSON AnalyzeCommentRequest'{..}+ = object+ (catMaybes+ [("context" .=) <$> _aContext,+ ("clientToken" .=) <$> _aClientToken,+ ("spanAnnotations" .=) <$> _aSpanAnnotations,+ ("doNotStore" .=) <$> _aDoNotStore,+ ("languages" .=) <$> _aLanguages,+ ("requestedAttributes" .=) <$> _aRequestedAttributes,+ ("sessionId" .=) <$> _aSessionId,+ ("comment" .=) <$> _aComment,+ ("communityId" .=) <$> _aCommUnityId])++-- | Attribute scores for the comment. The map keys are attribute names, same+-- as the requested_attribute field in AnalyzeCommentRequest (for example+-- \"ATTACK_ON_AUTHOR\", \"INFLAMMATORY\", etc.). This field has the same+-- type as the \`attribute_scores\` field in AnalyzeCommentResponse. To+-- specify an overall attribute score for the entire comment as a whole,+-- use the \`summary_score\` field of the mapped AttributeScores object. To+-- specify scores on specific subparts of the comment, use the+-- \`span_scores\` field. All SpanScore objects must have begin and end+-- fields set. All Score objects must be explicitly set (for binary+-- classification, use the score values 0 and 1). If Score objects don\'t+-- include a ScoreType, \`PROBABILITY\` is assumed. \`attribute_scores\`+-- must not be empty. The mapped AttributeScores objects also must not be+-- empty. An \`INVALID_ARGUMENT\` error is returned for all malformed+-- requests.+--+-- /See:/ 'suggestCommentScoreRequestAttributeScores' smart constructor.+newtype SuggestCommentScoreRequestAttributeScores =+ SuggestCommentScoreRequestAttributeScores'+ { _scsrasAddtional :: HashMap Text AttributeScores+ }+ deriving (Eq, Show, Data, Typeable, Generic)+++-- | Creates a value of 'SuggestCommentScoreRequestAttributeScores' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'scsrasAddtional'+suggestCommentScoreRequestAttributeScores+ :: HashMap Text AttributeScores -- ^ 'scsrasAddtional'+ -> SuggestCommentScoreRequestAttributeScores+suggestCommentScoreRequestAttributeScores pScsrasAddtional_ =+ SuggestCommentScoreRequestAttributeScores'+ {_scsrasAddtional = _Coerce # pScsrasAddtional_}+++scsrasAddtional :: Lens' SuggestCommentScoreRequestAttributeScores (HashMap Text AttributeScores)+scsrasAddtional+ = lens _scsrasAddtional+ (\ s a -> s{_scsrasAddtional = a})+ . _Coerce++instance FromJSON+ SuggestCommentScoreRequestAttributeScores+ where+ parseJSON+ = withObject+ "SuggestCommentScoreRequestAttributeScores"+ (\ o ->+ SuggestCommentScoreRequestAttributeScores' <$>+ (parseJSONObject o))++instance ToJSON+ SuggestCommentScoreRequestAttributeScores+ where+ toJSON = toJSON . _scsrasAddtional++-- | Specification of requested attributes. The AttributeParameters serve as+-- configuration for each associated attribute. The map keys are attribute+-- names. The following attributes are available: \"ATTACK_ON_AUTHOR\" -+-- Attack on author of original article or post. \"ATTACK_ON_COMMENTER\" -+-- Attack on fellow commenter. \"ATTACK_ON_PUBLISHER\" - Attack on+-- publisher of article\/post. \"INCOHERENT\" - Difficult to understand,+-- nonsensical. \"INFLAMMATORY\" - Intending to provoke or inflame.+-- \"OBSCENE\" - Obscene, such as cursing. \"OFF_TOPIC\" - Not related to+-- the original topic. \"SPAM\" - Commercial\/advertising spam content.+-- \"UNSUBSTANTIAL\" - Trivial.+--+-- /See:/ 'analyzeCommentRequestRequestedAttributes' smart constructor.+newtype AnalyzeCommentRequestRequestedAttributes =+ AnalyzeCommentRequestRequestedAttributes'+ { _acrraAddtional :: HashMap Text AttributeParameters+ }+ deriving (Eq, Show, Data, Typeable, Generic)+++-- | Creates a value of 'AnalyzeCommentRequestRequestedAttributes' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'acrraAddtional'+analyzeCommentRequestRequestedAttributes+ :: HashMap Text AttributeParameters -- ^ 'acrraAddtional'+ -> AnalyzeCommentRequestRequestedAttributes+analyzeCommentRequestRequestedAttributes pAcrraAddtional_ =+ AnalyzeCommentRequestRequestedAttributes'+ {_acrraAddtional = _Coerce # pAcrraAddtional_}+++acrraAddtional :: Lens' AnalyzeCommentRequestRequestedAttributes (HashMap Text AttributeParameters)+acrraAddtional+ = lens _acrraAddtional+ (\ s a -> s{_acrraAddtional = a})+ . _Coerce++instance FromJSON+ AnalyzeCommentRequestRequestedAttributes+ where+ parseJSON+ = withObject+ "AnalyzeCommentRequestRequestedAttributes"+ (\ o ->+ AnalyzeCommentRequestRequestedAttributes' <$>+ (parseJSONObject o))++instance ToJSON+ AnalyzeCommentRequestRequestedAttributes+ where+ toJSON = toJSON . _acrraAddtional
+ gen/Network/Google/CommentAnalyzer/Types/Sum.hs view
@@ -0,0 +1,183 @@+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Network.Google.CommentAnalyzer.Types.Sum+-- Copyright : (c) 2015-2016 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+module Network.Google.CommentAnalyzer.Types.Sum where++import Network.Google.Prelude hiding (Bytes)++-- | V1 error format.+data Xgafv+ = X1+ -- ^ @1@+ -- v1 error format+ | X2+ -- ^ @2@+ -- v2 error format+ deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)++instance Hashable Xgafv++instance FromHttpApiData Xgafv where+ parseQueryParam = \case+ "1" -> Right X1+ "2" -> Right X2+ x -> Left ("Unable to parse Xgafv from: " <> x)++instance ToHttpApiData Xgafv where+ toQueryParam = \case+ X1 -> "1"+ X2 -> "2"++instance FromJSON Xgafv where+ parseJSON = parseJSONText "Xgafv"++instance ToJSON Xgafv where+ toJSON = toJSONText++-- | The type of the above value.+data ScoreType+ = ScoreTypeUnspecified+ -- ^ @SCORE_TYPE_UNSPECIFIED@+ -- Unspecified. Defaults to PROBABILITY scores if available, and otherwise+ -- RAW. Every model has a RAW score.+ | Probability+ -- ^ @PROBABILITY@+ -- Probability scores are in the range [0, 1] and indicate level of+ -- confidence in the attribute label.+ | StdDevScore+ -- ^ @STD_DEV_SCORE@+ -- Standard deviation scores are in the range (-inf, +inf).+ | Percentile+ -- ^ @PERCENTILE@+ -- Percentile scores are in the range [0, 1] and indicate the percentile of+ -- the raw score, normalized with a test dataset. This is not generally+ -- recommended, as the normalization is dependent on the dataset used,+ -- which may not match other usecases.+ | Raw+ -- ^ @RAW@+ -- Raw scores are the raw values from the model, and may take any value.+ -- This is primarily for debugging\/testing, and not generally recommended.+ deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)++instance Hashable ScoreType++instance FromHttpApiData ScoreType where+ parseQueryParam = \case+ "SCORE_TYPE_UNSPECIFIED" -> Right ScoreTypeUnspecified+ "PROBABILITY" -> Right Probability+ "STD_DEV_SCORE" -> Right StdDevScore+ "PERCENTILE" -> Right Percentile+ "RAW" -> Right Raw+ x -> Left ("Unable to parse ScoreType from: " <> x)++instance ToHttpApiData ScoreType where+ toQueryParam = \case+ ScoreTypeUnspecified -> "SCORE_TYPE_UNSPECIFIED"+ Probability -> "PROBABILITY"+ StdDevScore -> "STD_DEV_SCORE"+ Percentile -> "PERCENTILE"+ Raw -> "RAW"++instance FromJSON ScoreType where+ parseJSON = parseJSONText "ScoreType"++instance ToJSON ScoreType where+ toJSON = toJSONText++-- | What type of scores to return. If unset, defaults to probability scores.+data AttributeParametersScoreType+ = APSTScoreTypeUnspecified+ -- ^ @SCORE_TYPE_UNSPECIFIED@+ -- Unspecified. Defaults to PROBABILITY scores if available, and otherwise+ -- RAW. Every model has a RAW score.+ | APSTProbability+ -- ^ @PROBABILITY@+ -- Probability scores are in the range [0, 1] and indicate level of+ -- confidence in the attribute label.+ | APSTStdDevScore+ -- ^ @STD_DEV_SCORE@+ -- Standard deviation scores are in the range (-inf, +inf).+ | APSTPercentile+ -- ^ @PERCENTILE@+ -- Percentile scores are in the range [0, 1] and indicate the percentile of+ -- the raw score, normalized with a test dataset. This is not generally+ -- recommended, as the normalization is dependent on the dataset used,+ -- which may not match other usecases.+ | APSTRaw+ -- ^ @RAW@+ -- Raw scores are the raw values from the model, and may take any value.+ -- This is primarily for debugging\/testing, and not generally recommended.+ deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)++instance Hashable AttributeParametersScoreType++instance FromHttpApiData AttributeParametersScoreType where+ parseQueryParam = \case+ "SCORE_TYPE_UNSPECIFIED" -> Right APSTScoreTypeUnspecified+ "PROBABILITY" -> Right APSTProbability+ "STD_DEV_SCORE" -> Right APSTStdDevScore+ "PERCENTILE" -> Right APSTPercentile+ "RAW" -> Right APSTRaw+ x -> Left ("Unable to parse AttributeParametersScoreType from: " <> x)++instance ToHttpApiData AttributeParametersScoreType where+ toQueryParam = \case+ APSTScoreTypeUnspecified -> "SCORE_TYPE_UNSPECIFIED"+ APSTProbability -> "PROBABILITY"+ APSTStdDevScore -> "STD_DEV_SCORE"+ APSTPercentile -> "PERCENTILE"+ APSTRaw -> "RAW"++instance FromJSON AttributeParametersScoreType where+ parseJSON = parseJSONText "AttributeParametersScoreType"++instance ToJSON AttributeParametersScoreType where+ toJSON = toJSONText++-- | Type of the text field.+data TextEntryType+ = TextTypeUnspecified+ -- ^ @TEXT_TYPE_UNSPECIFIED@+ -- The content type is not specified. Text will be interpreted as plain+ -- text by default.+ | PlainText+ -- ^ @PLAIN_TEXT@+ -- Plain text.+ | HTML+ -- ^ @HTML@+ -- HTML.+ deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)++instance Hashable TextEntryType++instance FromHttpApiData TextEntryType where+ parseQueryParam = \case+ "TEXT_TYPE_UNSPECIFIED" -> Right TextTypeUnspecified+ "PLAIN_TEXT" -> Right PlainText+ "HTML" -> Right HTML+ x -> Left ("Unable to parse TextEntryType from: " <> x)++instance ToHttpApiData TextEntryType where+ toQueryParam = \case+ TextTypeUnspecified -> "TEXT_TYPE_UNSPECIFIED"+ PlainText -> "PLAIN_TEXT"+ HTML -> "HTML"++instance FromJSON TextEntryType where+ parseJSON = parseJSONText "TextEntryType"++instance ToJSON TextEntryType where+ toJSON = toJSONText
+ gen/Network/Google/Resource/CommentAnalyzer/Comments/Analyze.hs view
@@ -0,0 +1,150 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-}++{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Network.Google.Resource.CommentAnalyzer.Comments.Analyze+-- Copyright : (c) 2015-2016 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Analyzes the provided text and returns scores for requested attributes.+--+-- /See:/ <https://conversationai.github.io/ Perspective Comment Analyzer API Reference> for @commentanalyzer.comments.analyze@.+module Network.Google.Resource.CommentAnalyzer.Comments.Analyze+ (+ -- * REST Resource+ CommentsAnalyzeResource++ -- * Creating a Request+ , commentsAnalyze+ , CommentsAnalyze++ -- * Request Lenses+ , caXgafv+ , caUploadProtocol+ , caAccessToken+ , caUploadType+ , caPayload+ , caCallback+ ) where++import Network.Google.CommentAnalyzer.Types+import Network.Google.Prelude++-- | A resource alias for @commentanalyzer.comments.analyze@ method which the+-- 'CommentsAnalyze' request conforms to.+type CommentsAnalyzeResource =+ "v1alpha1" :>+ "comments:analyze" :>+ QueryParam "$.xgafv" Xgafv :>+ QueryParam "upload_protocol" Text :>+ QueryParam "access_token" Text :>+ QueryParam "uploadType" Text :>+ QueryParam "callback" Text :>+ QueryParam "alt" AltJSON :>+ ReqBody '[JSON] AnalyzeCommentRequest :>+ Post '[JSON] AnalyzeCommentResponse++-- | Analyzes the provided text and returns scores for requested attributes.+--+-- /See:/ 'commentsAnalyze' smart constructor.+data CommentsAnalyze =+ CommentsAnalyze'+ { _caXgafv :: !(Maybe Xgafv)+ , _caUploadProtocol :: !(Maybe Text)+ , _caAccessToken :: !(Maybe Text)+ , _caUploadType :: !(Maybe Text)+ , _caPayload :: !AnalyzeCommentRequest+ , _caCallback :: !(Maybe Text)+ }+ deriving (Eq, Show, Data, Typeable, Generic)+++-- | Creates a value of 'CommentsAnalyze' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'caXgafv'+--+-- * 'caUploadProtocol'+--+-- * 'caAccessToken'+--+-- * 'caUploadType'+--+-- * 'caPayload'+--+-- * 'caCallback'+commentsAnalyze+ :: AnalyzeCommentRequest -- ^ 'caPayload'+ -> CommentsAnalyze+commentsAnalyze pCaPayload_ =+ CommentsAnalyze'+ { _caXgafv = Nothing+ , _caUploadProtocol = Nothing+ , _caAccessToken = Nothing+ , _caUploadType = Nothing+ , _caPayload = pCaPayload_+ , _caCallback = Nothing+ }+++-- | V1 error format.+caXgafv :: Lens' CommentsAnalyze (Maybe Xgafv)+caXgafv = lens _caXgafv (\ s a -> s{_caXgafv = a})++-- | Upload protocol for media (e.g. \"raw\", \"multipart\").+caUploadProtocol :: Lens' CommentsAnalyze (Maybe Text)+caUploadProtocol+ = lens _caUploadProtocol+ (\ s a -> s{_caUploadProtocol = a})++-- | OAuth access token.+caAccessToken :: Lens' CommentsAnalyze (Maybe Text)+caAccessToken+ = lens _caAccessToken+ (\ s a -> s{_caAccessToken = a})++-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").+caUploadType :: Lens' CommentsAnalyze (Maybe Text)+caUploadType+ = lens _caUploadType (\ s a -> s{_caUploadType = a})++-- | Multipart request metadata.+caPayload :: Lens' CommentsAnalyze AnalyzeCommentRequest+caPayload+ = lens _caPayload (\ s a -> s{_caPayload = a})++-- | JSONP+caCallback :: Lens' CommentsAnalyze (Maybe Text)+caCallback+ = lens _caCallback (\ s a -> s{_caCallback = a})++instance GoogleRequest CommentsAnalyze where+ type Rs CommentsAnalyze = AnalyzeCommentResponse+ type Scopes CommentsAnalyze =+ '["https://www.googleapis.com/auth/userinfo.email"]+ requestClient CommentsAnalyze'{..}+ = go _caXgafv _caUploadProtocol _caAccessToken+ _caUploadType+ _caCallback+ (Just AltJSON)+ _caPayload+ commentAnalyzerService+ where go+ = buildClient+ (Proxy :: Proxy CommentsAnalyzeResource)+ mempty
+ gen/Network/Google/Resource/CommentAnalyzer/Comments/Suggestscore.hs view
@@ -0,0 +1,151 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-}++{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Network.Google.Resource.CommentAnalyzer.Comments.Suggestscore+-- Copyright : (c) 2015-2016 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Suggest comment scores as training data.+--+-- /See:/ <https://conversationai.github.io/ Perspective Comment Analyzer API Reference> for @commentanalyzer.comments.suggestscore@.+module Network.Google.Resource.CommentAnalyzer.Comments.Suggestscore+ (+ -- * REST Resource+ CommentsSuggestscoreResource++ -- * Creating a Request+ , commentsSuggestscore+ , CommentsSuggestscore++ -- * Request Lenses+ , csXgafv+ , csUploadProtocol+ , csAccessToken+ , csUploadType+ , csPayload+ , csCallback+ ) where++import Network.Google.CommentAnalyzer.Types+import Network.Google.Prelude++-- | A resource alias for @commentanalyzer.comments.suggestscore@ method which the+-- 'CommentsSuggestscore' request conforms to.+type CommentsSuggestscoreResource =+ "v1alpha1" :>+ "comments:suggestscore" :>+ QueryParam "$.xgafv" Xgafv :>+ QueryParam "upload_protocol" Text :>+ QueryParam "access_token" Text :>+ QueryParam "uploadType" Text :>+ QueryParam "callback" Text :>+ QueryParam "alt" AltJSON :>+ ReqBody '[JSON] SuggestCommentScoreRequest :>+ Post '[JSON] SuggestCommentScoreResponse++-- | Suggest comment scores as training data.+--+-- /See:/ 'commentsSuggestscore' smart constructor.+data CommentsSuggestscore =+ CommentsSuggestscore'+ { _csXgafv :: !(Maybe Xgafv)+ , _csUploadProtocol :: !(Maybe Text)+ , _csAccessToken :: !(Maybe Text)+ , _csUploadType :: !(Maybe Text)+ , _csPayload :: !SuggestCommentScoreRequest+ , _csCallback :: !(Maybe Text)+ }+ deriving (Eq, Show, Data, Typeable, Generic)+++-- | Creates a value of 'CommentsSuggestscore' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'csXgafv'+--+-- * 'csUploadProtocol'+--+-- * 'csAccessToken'+--+-- * 'csUploadType'+--+-- * 'csPayload'+--+-- * 'csCallback'+commentsSuggestscore+ :: SuggestCommentScoreRequest -- ^ 'csPayload'+ -> CommentsSuggestscore+commentsSuggestscore pCsPayload_ =+ CommentsSuggestscore'+ { _csXgafv = Nothing+ , _csUploadProtocol = Nothing+ , _csAccessToken = Nothing+ , _csUploadType = Nothing+ , _csPayload = pCsPayload_+ , _csCallback = Nothing+ }+++-- | V1 error format.+csXgafv :: Lens' CommentsSuggestscore (Maybe Xgafv)+csXgafv = lens _csXgafv (\ s a -> s{_csXgafv = a})++-- | Upload protocol for media (e.g. \"raw\", \"multipart\").+csUploadProtocol :: Lens' CommentsSuggestscore (Maybe Text)+csUploadProtocol+ = lens _csUploadProtocol+ (\ s a -> s{_csUploadProtocol = a})++-- | OAuth access token.+csAccessToken :: Lens' CommentsSuggestscore (Maybe Text)+csAccessToken+ = lens _csAccessToken+ (\ s a -> s{_csAccessToken = a})++-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").+csUploadType :: Lens' CommentsSuggestscore (Maybe Text)+csUploadType+ = lens _csUploadType (\ s a -> s{_csUploadType = a})++-- | Multipart request metadata.+csPayload :: Lens' CommentsSuggestscore SuggestCommentScoreRequest+csPayload+ = lens _csPayload (\ s a -> s{_csPayload = a})++-- | JSONP+csCallback :: Lens' CommentsSuggestscore (Maybe Text)+csCallback+ = lens _csCallback (\ s a -> s{_csCallback = a})++instance GoogleRequest CommentsSuggestscore where+ type Rs CommentsSuggestscore =+ SuggestCommentScoreResponse+ type Scopes CommentsSuggestscore =+ '["https://www.googleapis.com/auth/userinfo.email"]+ requestClient CommentsSuggestscore'{..}+ = go _csXgafv _csUploadProtocol _csAccessToken+ _csUploadType+ _csCallback+ (Just AltJSON)+ _csPayload+ commentAnalyzerService+ where go+ = buildClient+ (Proxy :: Proxy CommentsSuggestscoreResource)+ mempty
+ gogol-commentanalyzer.cabal view
@@ -0,0 +1,53 @@+name: gogol-commentanalyzer+version: 0.5.0+synopsis: Google Perspective Comment Analyzer SDK.+homepage: https://github.com/brendanhay/gogol+bug-reports: https://github.com/brendanhay/gogol/issues+license: OtherLicense+license-file: LICENSE+author: Brendan Hay+maintainer: Brendan Hay <brendan.g.hay@gmail.com>+copyright: Copyright (c) 2015-2016 Brendan Hay+category: Network, Google, Cloud+build-type: Simple+cabal-version: >= 1.10+extra-source-files: README.md src/.gitkeep++description:+ The Perspective Comment Analyzer API provides information about the+ potential impact of a comment on a conversation (e.g. it can provide a+ score for the \"toxicity\" of a comment). Users can leverage the+ \"SuggestCommentScore\" method to submit corrections to improve+ Perspective over time. Users can set the \"doNotStore\" flag to ensure+ that all submitted comments are automatically deleted after scores are+ returned.+ .+ /Warning:/ This is an experimental prototype/preview release which is still+ under exploratory development and not intended for public use, caveat emptor!+ .+ This library is compatible with version @v1alpha1@+ of the API.++source-repository head+ type: git+ location: git://github.com/brendanhay/gogol.git++library+ default-language: Haskell2010+ hs-source-dirs: src gen++ ghc-options: -Wall++ exposed-modules:+ Network.Google.CommentAnalyzer+ , Network.Google.CommentAnalyzer.Types+ , Network.Google.Resource.CommentAnalyzer.Comments.Analyze+ , Network.Google.Resource.CommentAnalyzer.Comments.Suggestscore++ other-modules:+ Network.Google.CommentAnalyzer.Types.Product+ , Network.Google.CommentAnalyzer.Types.Sum++ build-depends:+ gogol-core == 0.5.0.*+ , base >= 4.7 && < 5
+ src/.gitkeep view