on develop help sign in
Regenerating gogol-servicecontrol
commit3397f201ed76ffb46e542ebc4625396b485b5af8 authorBrendan Hay <brendan.g.hay@gmail.com> dateFri 28 Oct 2016, 08:23 (10 years ago) parent42dd3d7
12 files changed+2940
gogol-servicecontrol/LICENSE+367 gogol-servicecontrol/Makefile+1 gogol-servicecontrol/README.md+28 gogol-servicecontrol/Setup.hs+2 gogol-servicecontrol/gen/Network/Google/Resource/ServiceControl/Services/Check.hs+196 gogol-servicecontrol/gen/Network/Google/Resource/ServiceControl/Services/Report.hs+194 gogol-servicecontrol/gen/Network/Google/ServiceControl.hs+213 gogol-servicecontrol/gen/Network/Google/ServiceControl/Types.hs+202 gogol-servicecontrol/gen/Network/Google/ServiceControl/Types/Product.hs+1434 gogol-servicecontrol/gen/Network/Google/ServiceControl/Types/Sum.hs+255 gogol-servicecontrol/gogol-servicecontrol.cabal+48 gogol-servicecontrol/src/.gitkeep
gogol-servicecontrol/LICENSEnew file+367
@@ -0,0 +1,367 @@
1+Mozilla Public License Version 2.0
2+==================================
3+
4+1. Definitions
5+--------------
6+
7+1.1. "Contributor"
8+ means each individual or legal entity that creates, contributes to
9+ the creation of, or owns Covered Software.
10+
11+1.2. "Contributor Version"
12+ means the combination of the Contributions of others (if any) used
13+ by a Contributor and that particular Contributor's Contribution.
14+
15+1.3. "Contribution"
16+ means Covered Software of a particular Contributor.
17+
18+1.4. "Covered Software"
19+ means Source Code Form to which the initial Contributor has attached
20+ the notice in Exhibit A, the Executable Form of such Source Code
21+ Form, and Modifications of such Source Code Form, in each case
22+ including portions thereof.
23+
24+1.5. "Incompatible With Secondary Licenses"
25+ means
26+
27+ (a) that the initial Contributor has attached the notice described
28+ in Exhibit B to the Covered Software; or
29+
30+ (b) that the Covered Software was made available under the terms of
31+ version 1.1 or earlier of the License, but not also under the
32+ terms of a Secondary License.
33+
34+1.6. "Executable Form"
35+ means any form of the work other than Source Code Form.
36+
37+1.7. "Larger Work"
38+ means a work that combines Covered Software with other material, in
39+ a separate file or files, that is not Covered Software.
40+
41+1.8. "License"
42+ means this document.
43+
44+1.9. "Licensable"
45+ means having the right to grant, to the maximum extent possible,
46+ whether at the time of the initial grant or subsequently, any and
47+ all of the rights conveyed by this License.
48+
49+1.10. "Modifications"
50+ means any of the following:
51+
52+ (a) any file in Source Code Form that results from an addition to,
53+ deletion from, or modification of the contents of Covered
54+ Software; or
55+
56+ (b) any new file in Source Code Form that contains any Covered
57+ Software.
58+
59+1.11. "Patent Claims" of a Contributor
60+ means any patent claim(s), including without limitation, method,
61+ process, and apparatus claims, in any patent Licensable by such
62+ Contributor that would be infringed, but for the grant of the
63+ License, by the making, using, selling, offering for sale, having
64+ made, import, or transfer of either its Contributions or its
65+ Contributor Version.
66+
67+1.12. "Secondary License"
68+ means either the GNU General Public License, Version 2.0, the GNU
69+ Lesser General Public License, Version 2.1, the GNU Affero General
70+ Public License, Version 3.0, or any later versions of those
71+ licenses.
72+
73+1.13. "Source Code Form"
74+ means the form of the work preferred for making modifications.
75+
76+1.14. "You" (or "Your")
77+ means an individual or a legal entity exercising rights under this
78+ License. For legal entities, "You" includes any entity that
79+ controls, is controlled by, or is under common control with You. For
80+ purposes of this definition, "control" means (a) the power, direct
81+ or indirect, to cause the direction or management of such entity,
82+ whether by contract or otherwise, or (b) ownership of more than
83+ fifty percent (50%) of the outstanding shares or beneficial
84+ ownership of such entity.
85+
86+2. License Grants and Conditions
87+--------------------------------
88+
89+2.1. Grants
90+
91+Each Contributor hereby grants You a world-wide, royalty-free,
92+non-exclusive license:
93+
94+(a) under intellectual property rights (other than patent or trademark)
95+ Licensable by such Contributor to use, reproduce, make available,
96+ modify, display, perform, distribute, and otherwise exploit its
97+ Contributions, either on an unmodified basis, with Modifications, or
98+ as part of a Larger Work; and
99+
100+(b) under Patent Claims of such Contributor to make, use, sell, offer
101+ for sale, have made, import, and otherwise transfer either its
102+ Contributions or its Contributor Version.
103+
104+2.2. Effective Date
105+
106+The licenses granted in Section 2.1 with respect to any Contribution
107+become effective for each Contribution on the date the Contributor first
108+distributes such Contribution.
109+
110+2.3. Limitations on Grant Scope
111+
112+The licenses granted in this Section 2 are the only rights granted under
113+this License. No additional rights or licenses will be implied from the
114+distribution or licensing of Covered Software under this License.
115+Notwithstanding Section 2.1(b) above, no patent license is granted by a
116+Contributor:
117+
118+(a) for any code that a Contributor has removed from Covered Software;
119+ or
120+
121+(b) for infringements caused by: (i) Your and any other third party's
122+ modifications of Covered Software, or (ii) the combination of its
123+ Contributions with other software (except as part of its Contributor
124+ Version); or
125+
126+(c) under Patent Claims infringed by Covered Software in the absence of
127+ its Contributions.
128+
129+This License does not grant any rights in the trademarks, service marks,
130+or logos of any Contributor (except as may be necessary to comply with
131+the notice requirements in Section 3.4).
132+
133+2.4. Subsequent Licenses
134+
135+No Contributor makes additional grants as a result of Your choice to
136+distribute the Covered Software under a subsequent version of this
137+License (see Section 10.2) or under the terms of a Secondary License (if
138+permitted under the terms of Section 3.3).
139+
140+2.5. Representation
141+
142+Each Contributor represents that the Contributor believes its
143+Contributions are its original creation(s) or it has sufficient rights
144+to grant the rights to its Contributions conveyed by this License.
145+
146+2.6. Fair Use
147+
148+This License is not intended to limit any rights You have under
149+applicable copyright doctrines of fair use, fair dealing, or other
150+equivalents.
151+
152+2.7. Conditions
153+
154+Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
155+in Section 2.1.
156+
157+3. Responsibilities
158+-------------------
159+
160+3.1. Distribution of Source Form
161+
162+All distribution of Covered Software in Source Code Form, including any
163+Modifications that You create or to which You contribute, must be under
164+the terms of this License. You must inform recipients that the Source
165+Code Form of the Covered Software is governed by the terms of this
166+License, and how they can obtain a copy of this License. You may not
167+attempt to alter or restrict the recipients' rights in the Source Code
168+Form.
169+
170+3.2. Distribution of Executable Form
171+
172+If You distribute Covered Software in Executable Form then:
173+
174+(a) such Covered Software must also be made available in Source Code
175+ Form, as described in Section 3.1, and You must inform recipients of
176+ the Executable Form how they can obtain a copy of such Source Code
177+ Form by reasonable means in a timely manner, at a charge no more
178+ than the cost of distribution to the recipient; and
179+
180+(b) You may distribute such Executable Form under the terms of this
181+ License, or sublicense it under different terms, provided that the
182+ license for the Executable Form does not attempt to limit or alter
183+ the recipients' rights in the Source Code Form under this License.
184+
185+3.3. Distribution of a Larger Work
186+
187+You may create and distribute a Larger Work under terms of Your choice,
188+provided that You also comply with the requirements of this License for
189+the Covered Software. If the Larger Work is a combination of Covered
190+Software with a work governed by one or more Secondary Licenses, and the
191+Covered Software is not Incompatible With Secondary Licenses, this
192+License permits You to additionally distribute such Covered Software
193+under the terms of such Secondary License(s), so that the recipient of
194+the Larger Work may, at their option, further distribute the Covered
195+Software under the terms of either this License or such Secondary
196+License(s).
197+
198+3.4. Notices
199+
200+You may not remove or alter the substance of any license notices
201+(including copyright notices, patent notices, disclaimers of warranty,
202+or limitations of liability) contained within the Source Code Form of
203+the Covered Software, except that You may alter any license notices to
204+the extent required to remedy known factual inaccuracies.
205+
206+3.5. Application of Additional Terms
207+
208+You may choose to offer, and to charge a fee for, warranty, support,
209+indemnity or liability obligations to one or more recipients of Covered
210+Software. However, You may do so only on Your own behalf, and not on
211+behalf of any Contributor. You must make it absolutely clear that any
212+such warranty, support, indemnity, or liability obligation is offered by
213+You alone, and You hereby agree to indemnify every Contributor for any
214+liability incurred by such Contributor as a result of warranty, support,
215+indemnity or liability terms You offer. You may include additional
216+disclaimers of warranty and limitations of liability specific to any
217+jurisdiction.
218+
219+4. Inability to Comply Due to Statute or Regulation
220+---------------------------------------------------
221+
222+If it is impossible for You to comply with any of the terms of this
223+License with respect to some or all of the Covered Software due to
224+statute, judicial order, or regulation then You must: (a) comply with
225+the terms of this License to the maximum extent possible; and (b)
226+describe the limitations and the code they affect. Such description must
227+be placed in a text file included with all distributions of the Covered
228+Software under this License. Except to the extent prohibited by statute
229+or regulation, such description must be sufficiently detailed for a
230+recipient of ordinary skill to be able to understand it.
231+
232+5. Termination
233+--------------
234+
235+5.1. The rights granted under this License will terminate automatically
236+if You fail to comply with any of its terms. However, if You become
237+compliant, then the rights granted under this License from a particular
238+Contributor are reinstated (a) provisionally, unless and until such
239+Contributor explicitly and finally terminates Your grants, and (b) on an
240+ongoing basis, if such Contributor fails to notify You of the
241+non-compliance by some reasonable means prior to 60 days after You have
242+come back into compliance. Moreover, Your grants from a particular
243+Contributor are reinstated on an ongoing basis if such Contributor
244+notifies You of the non-compliance by some reasonable means, this is the
245+first time You have received notice of non-compliance with this License
246+from such Contributor, and You become compliant prior to 30 days after
247+Your receipt of the notice.
248+
249+5.2. If You initiate litigation against any entity by asserting a patent
250+infringement claim (excluding declaratory judgment actions,
251+counter-claims, and cross-claims) alleging that a Contributor Version
252+directly or indirectly infringes any patent, then the rights granted to
253+You by any and all Contributors for the Covered Software under Section
254+2.1 of this License shall terminate.
255+
256+5.3. In the event of termination under Sections 5.1 or 5.2 above, all
257+end user license agreements (excluding distributors and resellers) which
258+have been validly granted by You or Your distributors under this License
259+prior to termination shall survive termination.
260+
261+************************************************************************
262+* *
263+* 6. Disclaimer of Warranty *
264+* ------------------------- *
265+* *
266+* Covered Software is provided under this License on an "as is" *
267+* basis, without warranty of any kind, either expressed, implied, or *
268+* statutory, including, without limitation, warranties that the *
269+* Covered Software is free of defects, merchantable, fit for a *
270+* particular purpose or non-infringing. The entire risk as to the *
271+* quality and performance of the Covered Software is with You. *
272+* Should any Covered Software prove defective in any respect, You *
273+* (not any Contributor) assume the cost of any necessary servicing, *
274+* repair, or correction. This disclaimer of warranty constitutes an *
275+* essential part of this License. No use of any Covered Software is *
276+* authorized under this License except under this disclaimer. *
277+* *
278+************************************************************************
279+
280+************************************************************************
281+* *
282+* 7. Limitation of Liability *
283+* -------------------------- *
284+* *
285+* Under no circumstances and under no legal theory, whether tort *
286+* (including negligence), contract, or otherwise, shall any *
287+* Contributor, or anyone who distributes Covered Software as *
288+* permitted above, be liable to You for any direct, indirect, *
289+* special, incidental, or consequential damages of any character *
290+* including, without limitation, damages for lost profits, loss of *
291+* goodwill, work stoppage, computer failure or malfunction, or any *
292+* and all other commercial damages or losses, even if such party *
293+* shall have been informed of the possibility of such damages. This *
294+* limitation of liability shall not apply to liability for death or *
295+* personal injury resulting from such party's negligence to the *
296+* extent applicable law prohibits such limitation. Some *
297+* jurisdictions do not allow the exclusion or limitation of *
298+* incidental or consequential damages, so this exclusion and *
299+* limitation may not apply to You. *
300+* *
301+************************************************************************
302+
303+8. Litigation
304+-------------
305+
306+Any litigation relating to this License may be brought only in the
307+courts of a jurisdiction where the defendant maintains its principal
308+place of business and such litigation shall be governed by laws of that
309+jurisdiction, without reference to its conflict-of-law provisions.
310+Nothing in this Section shall prevent a party's ability to bring
311+cross-claims or counter-claims.
312+
313+9. Miscellaneous
314+----------------
315+
316+This License represents the complete agreement concerning the subject
317+matter hereof. If any provision of this License is held to be
318+unenforceable, such provision shall be reformed only to the extent
319+necessary to make it enforceable. Any law or regulation which provides
320+that the language of a contract shall be construed against the drafter
321+shall not be used to construe this License against a Contributor.
322+
323+10. Versions of the License
324+---------------------------
325+
326+10.1. New Versions
327+
328+Mozilla Foundation is the license steward. Except as provided in Section
329+10.3, no one other than the license steward has the right to modify or
330+publish new versions of this License. Each version will be given a
331+distinguishing version number.
332+
333+10.2. Effect of New Versions
334+
335+You may distribute the Covered Software under the terms of the version
336+of the License under which You originally received the Covered Software,
337+or under the terms of any subsequent version published by the license
338+steward.
339+
340+10.3. Modified Versions
341+
342+If you create software not governed by this License, and you want to
343+create a new license for such software, you may create and use a
344+modified version of this License if you rename the license and remove
345+any references to the name of the license steward (except to note that
346+such modified license differs from this License).
347+
348+10.4. Distributing Source Code Form that is Incompatible With Secondary
349+Licenses
350+
351+If You choose to distribute Source Code Form that is Incompatible With
352+Secondary Licenses under the terms of this version of the License, the
353+notice described in Exhibit B of this License must be attached.
354+
355+Exhibit A - Source Code Form License Notice
356+-------------------------------------------
357+
358+ This Source Code Form is subject to the terms of the Mozilla Public
359+ License, v. 2.0. If a copy of the MPL was not distributed with this
360+ file, You can obtain one at http://mozilla.org/MPL/2.0/.
361+
362+If it is not possible or desirable to put the notice in a particular
363+file, then You may include the notice in a location (such as a LICENSE
364+file in a relevant directory) where a recipient would be likely to look
365+for such a notice.
366+
367+You may add additional accurate notices of copyright ownership.
gogol-servicecontrol/Makefilenew file+1
@@ -0,0 +1 @@
1+include ../share/library.mk
gogol-servicecontrol/README.mdnew file+28
@@ -0,0 +1,28 @@
1+# gogol-servicecontrol
2+
3+* [Version](#version)
4+* [Description](#description)
5+* [Contribute](#contribute)
6+* [Licence](#licence)
7+
8+
9+## Version
10+
11+`0.1.0`
12+
13+
14+## Description
15+
16+A client library for the Google Service Control.
17+
18+
19+## Contribute
20+
21+For any problems, comments, or feedback please create an issue [here on GitHub](https://github.com/brendanhay/gogol/issues).
22+
23+> _Note:_ this library is an auto-generated Haskell package. Please see `gogol-gen` for more information.
24+
25+
26+## Licence
27+
28+`gogol-servicecontrol` is released under the [Mozilla Public License Version 2.0](http://www.mozilla.org/MPL/).
gogol-servicecontrol/Setup.hsnew file+2
@@ -0,0 +1,2 @@
1+import Distribution.Simple
2+main = defaultMain
gogol-servicecontrol/gen/Network/Google/Resource/ServiceControl/Services/Check.hsnew file+196
@@ -0,0 +1,196 @@
1+{-# LANGUAGE DataKinds #-}
2+{-# LANGUAGE DeriveDataTypeable #-}
3+{-# LANGUAGE DeriveGeneric #-}
4+{-# LANGUAGE FlexibleInstances #-}
5+{-# LANGUAGE NoImplicitPrelude #-}
6+{-# LANGUAGE OverloadedStrings #-}
7+{-# LANGUAGE RecordWildCards #-}
8+{-# LANGUAGE TypeFamilies #-}
9+{-# LANGUAGE TypeOperators #-}
10+
11+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
12+{-# OPTIONS_GHC -fno-warn-unused-binds #-}
13+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
14+
15+-- |
16+-- Module : Network.Google.Resource.ServiceControl.Services.Check
17+-- Copyright : (c) 2015-2016 Brendan Hay
18+-- License : Mozilla Public License, v. 2.0.
19+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
20+-- Stability : auto-generated
21+-- Portability : non-portable (GHC extensions)
22+--
23+-- Checks an operation with Google Service Control to decide whether the
24+-- given operation should proceed. It should be called before the operation
25+-- is executed. This method requires the
26+-- \`servicemanagement.services.check\` permission on the specified
27+-- service. For more information, see [Google Cloud
28+-- IAM](https:\/\/cloud.google.com\/iam).
29+--
30+-- /See:/ <https://cloud.google.com/service-control/ Google Service Control API Reference> for @servicecontrol.services.check@.
31+module Network.Google.Resource.ServiceControl.Services.Check
32+ (
33+ -- * REST Resource
34+ ServicesCheckResource
35+
36+ -- * Creating a Request
37+ , servicesCheck
38+ , ServicesCheck
39+
40+ -- * Request Lenses
41+ , scXgafv
42+ , scUploadProtocol
43+ , scPp
44+ , scAccessToken
45+ , scUploadType
46+ , scPayload
47+ , scBearerToken
48+ , scServiceName
49+ , scCallback
50+ ) where
51+
52+import Network.Google.Prelude
53+import Network.Google.ServiceControl.Types
54+
55+-- | A resource alias for @servicecontrol.services.check@ method which the
56+-- 'ServicesCheck' request conforms to.
57+type ServicesCheckResource =
58+ "v1" :>
59+ "services" :>
60+ CaptureMode "serviceName" "check" Text :>
61+ QueryParam "$.xgafv" Xgafv :>
62+ QueryParam "upload_protocol" Text :>
63+ QueryParam "pp" Bool :>
64+ QueryParam "access_token" Text :>
65+ QueryParam "uploadType" Text :>
66+ QueryParam "bearer_token" Text :>
67+ QueryParam "callback" Text :>
68+ QueryParam "alt" AltJSON :>
69+ ReqBody '[JSON] CheckRequest :>
70+ Post '[JSON] CheckResponse
71+
72+-- | Checks an operation with Google Service Control to decide whether the
73+-- given operation should proceed. It should be called before the operation
74+-- is executed. This method requires the
75+-- \`servicemanagement.services.check\` permission on the specified
76+-- service. For more information, see [Google Cloud
77+-- IAM](https:\/\/cloud.google.com\/iam).
78+--
79+-- /See:/ 'servicesCheck' smart constructor.
80+data ServicesCheck = ServicesCheck'
81+ { _scXgafv :: !(Maybe Xgafv)
82+ , _scUploadProtocol :: !(Maybe Text)
83+ , _scPp :: !Bool
84+ , _scAccessToken :: !(Maybe Text)
85+ , _scUploadType :: !(Maybe Text)
86+ , _scPayload :: !CheckRequest
87+ , _scBearerToken :: !(Maybe Text)
88+ , _scServiceName :: !Text
89+ , _scCallback :: !(Maybe Text)
90+ } deriving (Eq,Show,Data,Typeable,Generic)
91+
92+-- | Creates a value of 'ServicesCheck' with the minimum fields required to make a request.
93+--
94+-- Use one of the following lenses to modify other fields as desired:
95+--
96+-- * 'scXgafv'
97+--
98+-- * 'scUploadProtocol'
99+--
100+-- * 'scPp'
101+--
102+-- * 'scAccessToken'
103+--
104+-- * 'scUploadType'
105+--
106+-- * 'scPayload'
107+--
108+-- * 'scBearerToken'
109+--
110+-- * 'scServiceName'
111+--
112+-- * 'scCallback'
113+servicesCheck
114+ :: CheckRequest -- ^ 'scPayload'
115+ -> Text -- ^ 'scServiceName'
116+ -> ServicesCheck
117+servicesCheck pScPayload_ pScServiceName_ =
118+ ServicesCheck'
119+ { _scXgafv = Nothing
120+ , _scUploadProtocol = Nothing
121+ , _scPp = True
122+ , _scAccessToken = Nothing
123+ , _scUploadType = Nothing
124+ , _scPayload = pScPayload_
125+ , _scBearerToken = Nothing
126+ , _scServiceName = pScServiceName_
127+ , _scCallback = Nothing
128+ }
129+
130+-- | V1 error format.
131+scXgafv :: Lens' ServicesCheck (Maybe Xgafv)
132+scXgafv = lens _scXgafv (\ s a -> s{_scXgafv = a})
133+
134+-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
135+scUploadProtocol :: Lens' ServicesCheck (Maybe Text)
136+scUploadProtocol
137+ = lens _scUploadProtocol
138+ (\ s a -> s{_scUploadProtocol = a})
139+
140+-- | Pretty-print response.
141+scPp :: Lens' ServicesCheck Bool
142+scPp = lens _scPp (\ s a -> s{_scPp = a})
143+
144+-- | OAuth access token.
145+scAccessToken :: Lens' ServicesCheck (Maybe Text)
146+scAccessToken
147+ = lens _scAccessToken
148+ (\ s a -> s{_scAccessToken = a})
149+
150+-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
151+scUploadType :: Lens' ServicesCheck (Maybe Text)
152+scUploadType
153+ = lens _scUploadType (\ s a -> s{_scUploadType = a})
154+
155+-- | Multipart request metadata.
156+scPayload :: Lens' ServicesCheck CheckRequest
157+scPayload
158+ = lens _scPayload (\ s a -> s{_scPayload = a})
159+
160+-- | OAuth bearer token.
161+scBearerToken :: Lens' ServicesCheck (Maybe Text)
162+scBearerToken
163+ = lens _scBearerToken
164+ (\ s a -> s{_scBearerToken = a})
165+
166+-- | The service name as specified in its service configuration. For example,
167+-- \`\"pubsub.googleapis.com\"\`. See google.api.Service for the definition
168+-- of a service name.
169+scServiceName :: Lens' ServicesCheck Text
170+scServiceName
171+ = lens _scServiceName
172+ (\ s a -> s{_scServiceName = a})
173+
174+-- | JSONP
175+scCallback :: Lens' ServicesCheck (Maybe Text)
176+scCallback
177+ = lens _scCallback (\ s a -> s{_scCallback = a})
178+
179+instance GoogleRequest ServicesCheck where
180+ type Rs ServicesCheck = CheckResponse
181+ type Scopes ServicesCheck =
182+ '["https://www.googleapis.com/auth/cloud-platform",
183+ "https://www.googleapis.com/auth/servicecontrol"]
184+ requestClient ServicesCheck'{..}
185+ = go _scServiceName _scXgafv _scUploadProtocol
186+ (Just _scPp)
187+ _scAccessToken
188+ _scUploadType
189+ _scBearerToken
190+ _scCallback
191+ (Just AltJSON)
192+ _scPayload
193+ serviceControlService
194+ where go
195+ = buildClient (Proxy :: Proxy ServicesCheckResource)
196+ mempty
gogol-servicecontrol/gen/Network/Google/Resource/ServiceControl/Services/Report.hsnew file+194
@@ -0,0 +1,194 @@
1+{-# LANGUAGE DataKinds #-}
2+{-# LANGUAGE DeriveDataTypeable #-}
3+{-# LANGUAGE DeriveGeneric #-}
4+{-# LANGUAGE FlexibleInstances #-}
5+{-# LANGUAGE NoImplicitPrelude #-}
6+{-# LANGUAGE OverloadedStrings #-}
7+{-# LANGUAGE RecordWildCards #-}
8+{-# LANGUAGE TypeFamilies #-}
9+{-# LANGUAGE TypeOperators #-}
10+
11+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
12+{-# OPTIONS_GHC -fno-warn-unused-binds #-}
13+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
14+
15+-- |
16+-- Module : Network.Google.Resource.ServiceControl.Services.Report
17+-- Copyright : (c) 2015-2016 Brendan Hay
18+-- License : Mozilla Public License, v. 2.0.
19+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
20+-- Stability : auto-generated
21+-- Portability : non-portable (GHC extensions)
22+--
23+-- Reports operations to Google Service Control. It should be called after
24+-- the operation is completed. This method requires the
25+-- \`servicemanagement.services.report\` permission on the specified
26+-- service. For more information, see [Google Cloud
27+-- IAM](https:\/\/cloud.google.com\/iam).
28+--
29+-- /See:/ <https://cloud.google.com/service-control/ Google Service Control API Reference> for @servicecontrol.services.report@.
30+module Network.Google.Resource.ServiceControl.Services.Report
31+ (
32+ -- * REST Resource
33+ ServicesReportResource
34+
35+ -- * Creating a Request
36+ , servicesReport
37+ , ServicesReport
38+
39+ -- * Request Lenses
40+ , srXgafv
41+ , srUploadProtocol
42+ , srPp
43+ , srAccessToken
44+ , srUploadType
45+ , srPayload
46+ , srBearerToken
47+ , srServiceName
48+ , srCallback
49+ ) where
50+
51+import Network.Google.Prelude
52+import Network.Google.ServiceControl.Types
53+
54+-- | A resource alias for @servicecontrol.services.report@ method which the
55+-- 'ServicesReport' request conforms to.
56+type ServicesReportResource =
57+ "v1" :>
58+ "services" :>
59+ CaptureMode "serviceName" "report" Text :>
60+ QueryParam "$.xgafv" Xgafv :>
61+ QueryParam "upload_protocol" Text :>
62+ QueryParam "pp" Bool :>
63+ QueryParam "access_token" Text :>
64+ QueryParam "uploadType" Text :>
65+ QueryParam "bearer_token" Text :>
66+ QueryParam "callback" Text :>
67+ QueryParam "alt" AltJSON :>
68+ ReqBody '[JSON] ReportRequest :>
69+ Post '[JSON] ReportResponse
70+
71+-- | Reports operations to Google Service Control. It should be called after
72+-- the operation is completed. This method requires the
73+-- \`servicemanagement.services.report\` permission on the specified
74+-- service. For more information, see [Google Cloud
75+-- IAM](https:\/\/cloud.google.com\/iam).
76+--
77+-- /See:/ 'servicesReport' smart constructor.
78+data ServicesReport = ServicesReport'
79+ { _srXgafv :: !(Maybe Xgafv)
80+ , _srUploadProtocol :: !(Maybe Text)
81+ , _srPp :: !Bool
82+ , _srAccessToken :: !(Maybe Text)
83+ , _srUploadType :: !(Maybe Text)
84+ , _srPayload :: !ReportRequest
85+ , _srBearerToken :: !(Maybe Text)
86+ , _srServiceName :: !Text
87+ , _srCallback :: !(Maybe Text)
88+ } deriving (Eq,Show,Data,Typeable,Generic)
89+
90+-- | Creates a value of 'ServicesReport' with the minimum fields required to make a request.
91+--
92+-- Use one of the following lenses to modify other fields as desired:
93+--
94+-- * 'srXgafv'
95+--
96+-- * 'srUploadProtocol'
97+--
98+-- * 'srPp'
99+--
100+-- * 'srAccessToken'
101+--
102+-- * 'srUploadType'
103+--
104+-- * 'srPayload'
105+--
106+-- * 'srBearerToken'
107+--
108+-- * 'srServiceName'
109+--
110+-- * 'srCallback'
111+servicesReport
112+ :: ReportRequest -- ^ 'srPayload'
113+ -> Text -- ^ 'srServiceName'
114+ -> ServicesReport
115+servicesReport pSrPayload_ pSrServiceName_ =
116+ ServicesReport'
117+ { _srXgafv = Nothing
118+ , _srUploadProtocol = Nothing
119+ , _srPp = True
120+ , _srAccessToken = Nothing
121+ , _srUploadType = Nothing
122+ , _srPayload = pSrPayload_
123+ , _srBearerToken = Nothing
124+ , _srServiceName = pSrServiceName_
125+ , _srCallback = Nothing
126+ }
127+
128+-- | V1 error format.
129+srXgafv :: Lens' ServicesReport (Maybe Xgafv)
130+srXgafv = lens _srXgafv (\ s a -> s{_srXgafv = a})
131+
132+-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
133+srUploadProtocol :: Lens' ServicesReport (Maybe Text)
134+srUploadProtocol
135+ = lens _srUploadProtocol
136+ (\ s a -> s{_srUploadProtocol = a})
137+
138+-- | Pretty-print response.
139+srPp :: Lens' ServicesReport Bool
140+srPp = lens _srPp (\ s a -> s{_srPp = a})
141+
142+-- | OAuth access token.
143+srAccessToken :: Lens' ServicesReport (Maybe Text)
144+srAccessToken
145+ = lens _srAccessToken
146+ (\ s a -> s{_srAccessToken = a})
147+
148+-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
149+srUploadType :: Lens' ServicesReport (Maybe Text)
150+srUploadType
151+ = lens _srUploadType (\ s a -> s{_srUploadType = a})
152+
153+-- | Multipart request metadata.
154+srPayload :: Lens' ServicesReport ReportRequest
155+srPayload
156+ = lens _srPayload (\ s a -> s{_srPayload = a})
157+
158+-- | OAuth bearer token.
159+srBearerToken :: Lens' ServicesReport (Maybe Text)
160+srBearerToken
161+ = lens _srBearerToken
162+ (\ s a -> s{_srBearerToken = a})
163+
164+-- | The service name as specified in its service configuration. For example,
165+-- \`\"pubsub.googleapis.com\"\`. See google.api.Service for the definition
166+-- of a service name.
167+srServiceName :: Lens' ServicesReport Text
168+srServiceName
169+ = lens _srServiceName
170+ (\ s a -> s{_srServiceName = a})
171+
172+-- | JSONP
173+srCallback :: Lens' ServicesReport (Maybe Text)
174+srCallback
175+ = lens _srCallback (\ s a -> s{_srCallback = a})
176+
177+instance GoogleRequest ServicesReport where
178+ type Rs ServicesReport = ReportResponse
179+ type Scopes ServicesReport =
180+ '["https://www.googleapis.com/auth/cloud-platform",
181+ "https://www.googleapis.com/auth/servicecontrol"]
182+ requestClient ServicesReport'{..}
183+ = go _srServiceName _srXgafv _srUploadProtocol
184+ (Just _srPp)
185+ _srAccessToken
186+ _srUploadType
187+ _srBearerToken
188+ _srCallback
189+ (Just AltJSON)
190+ _srPayload
191+ serviceControlService
192+ where go
193+ = buildClient (Proxy :: Proxy ServicesReportResource)
194+ mempty
gogol-servicecontrol/gen/Network/Google/ServiceControl.hsnew file+213
@@ -0,0 +1,213 @@
1+{-# LANGUAGE DataKinds #-}
2+{-# LANGUAGE NoImplicitPrelude #-}
3+{-# LANGUAGE TypeOperators #-}
4+
5+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
6+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
7+
8+-- |
9+-- Module : Network.Google.ServiceControl
10+-- Copyright : (c) 2015-2016 Brendan Hay
11+-- License : Mozilla Public License, v. 2.0.
12+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
13+-- Stability : auto-generated
14+-- Portability : non-portable (GHC extensions)
15+--
16+-- Google Service Control provides control plane functionality to managed
17+-- services, such as logging, monitoring, and status checks.
18+--
19+-- /See:/ <https://cloud.google.com/service-control/ Google Service Control API Reference>
20+module Network.Google.ServiceControl
21+ (
22+ -- * Service Configuration
23+ serviceControlService
24+
25+ -- * OAuth Scopes
26+ , serviceControlScope
27+ , cloudPlatformScope
28+
29+ -- * API Declaration
30+ , ServiceControlAPI
31+
32+ -- * Resources
33+
34+ -- ** servicecontrol.services.check
35+ , module Network.Google.Resource.ServiceControl.Services.Check
36+
37+ -- ** servicecontrol.services.report
38+ , module Network.Google.Resource.ServiceControl.Services.Report
39+
40+ -- * Types
41+
42+ -- ** Status
43+ , Status
44+ , status
45+ , sDetails
46+ , sCode
47+ , sMessage
48+
49+ -- ** ReportRequest
50+ , ReportRequest
51+ , reportRequest
52+ , rrOperations
53+
54+ -- ** CheckRequest
55+ , CheckRequest
56+ , checkRequest
57+ , crOperation
58+
59+ -- ** MetricValueLabels
60+ , MetricValueLabels
61+ , metricValueLabels
62+ , mvlAddtional
63+
64+ -- ** Distribution
65+ , Distribution
66+ , distribution
67+ , dSumOfSquaredDeviation
68+ , dMean
69+ , dExponentialBuckets
70+ , dMaximum
71+ , dLinearBuckets
72+ , dCount
73+ , dMinimum
74+ , dBucketCounts
75+ , dExplicitBuckets
76+
77+ -- ** ExponentialBuckets
78+ , ExponentialBuckets
79+ , exponentialBuckets
80+ , ebGrowthFactor
81+ , ebScale
82+ , ebNumFiniteBuckets
83+
84+ -- ** Operation
85+ , Operation
86+ , operation
87+ , oImportance
88+ , oStartTime
89+ , oEndTime
90+ , oOperationName
91+ , oLabels
92+ , oOperationId
93+ , oConsumerId
94+ , oMetricValueSets
95+ , oLogEntries
96+
97+ -- ** MetricValueSet
98+ , MetricValueSet
99+ , metricValueSet
100+ , mvsMetricName
101+ , mvsMetricValues
102+
103+ -- ** LogEntryLabels
104+ , LogEntryLabels
105+ , logEntryLabels
106+ , lelAddtional
107+
108+ -- ** LogEntryProtoPayload
109+ , LogEntryProtoPayload
110+ , logEntryProtoPayload
111+ , leppAddtional
112+
113+ -- ** LinearBuckets
114+ , LinearBuckets
115+ , linearBuckets
116+ , lbOffSet
117+ , lbWidth
118+ , lbNumFiniteBuckets
119+
120+ -- ** CheckErrorCode
121+ , CheckErrorCode (..)
122+
123+ -- ** StatusDetailsItem
124+ , StatusDetailsItem
125+ , statusDetailsItem
126+ , sdiAddtional
127+
128+ -- ** CheckError
129+ , CheckError
130+ , checkError
131+ , ceCode
132+ , ceDetail
133+
134+ -- ** ReportError
135+ , ReportError
136+ , reportError
137+ , reStatus
138+ , reOperationId
139+
140+ -- ** OperationImportance
141+ , OperationImportance (..)
142+
143+ -- ** MetricValue
144+ , MetricValue
145+ , metricValue
146+ , mvBoolValue
147+ , mvStartTime
148+ , mvDoubleValue
149+ , mvStringValue
150+ , mvDistributionValue
151+ , mvEndTime
152+ , mvInt64Value
153+ , mvLabels
154+
155+ -- ** Xgafv
156+ , Xgafv (..)
157+
158+ -- ** CheckResponse
159+ , CheckResponse
160+ , checkResponse
161+ , crCheckErrors
162+ , crServiceConfigId
163+ , crOperationId
164+
165+ -- ** ReportResponse
166+ , ReportResponse
167+ , reportResponse
168+ , rrReportErrors
169+ , rrServiceConfigId
170+
171+ -- ** LogEntry
172+ , LogEntry
173+ , logEntry
174+ , leSeverity
175+ , leTextPayload
176+ , leStructPayload
177+ , leName
178+ , leInsertId
179+ , leLabels
180+ , leProtoPayload
181+ , leTimestamp
182+
183+ -- ** OperationLabels
184+ , OperationLabels
185+ , operationLabels
186+ , olAddtional
187+
188+ -- ** LogEntrySeverity
189+ , LogEntrySeverity (..)
190+
191+ -- ** ExplicitBuckets
192+ , ExplicitBuckets
193+ , explicitBuckets
194+ , ebBounds
195+
196+ -- ** LogEntryStructPayload
197+ , LogEntryStructPayload
198+ , logEntryStructPayload
199+ , lespAddtional
200+ ) where
201+
202+import Network.Google.Prelude
203+import Network.Google.Resource.ServiceControl.Services.Check
204+import Network.Google.Resource.ServiceControl.Services.Report
205+import Network.Google.ServiceControl.Types
206+
207+{- $resources
208+TODO
209+-}
210+
211+-- | Represents the entirety of the methods and resources available for the Google Service Control API service.
212+type ServiceControlAPI =
213+ ServicesReportResource :<|> ServicesCheckResource
gogol-servicecontrol/gen/Network/Google/ServiceControl/Types.hsnew file+202
@@ -0,0 +1,202 @@
1+{-# LANGUAGE DataKinds #-}
2+{-# LANGUAGE DeriveDataTypeable #-}
3+{-# LANGUAGE DeriveGeneric #-}
4+{-# LANGUAGE NoImplicitPrelude #-}
5+{-# LANGUAGE OverloadedStrings #-}
6+
7+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
8+
9+-- |
10+-- Module : Network.Google.ServiceControl.Types
11+-- Copyright : (c) 2015-2016 Brendan Hay
12+-- License : Mozilla Public License, v. 2.0.
13+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
14+-- Stability : auto-generated
15+-- Portability : non-portable (GHC extensions)
16+--
17+module Network.Google.ServiceControl.Types
18+ (
19+ -- * Service Configuration
20+ serviceControlService
21+
22+ -- * OAuth Scopes
23+ , serviceControlScope
24+ , cloudPlatformScope
25+
26+ -- * Status
27+ , Status
28+ , status
29+ , sDetails
30+ , sCode
31+ , sMessage
32+
33+ -- * ReportRequest
34+ , ReportRequest
35+ , reportRequest
36+ , rrOperations
37+
38+ -- * CheckRequest
39+ , CheckRequest
40+ , checkRequest
41+ , crOperation
42+
43+ -- * MetricValueLabels
44+ , MetricValueLabels
45+ , metricValueLabels
46+ , mvlAddtional
47+
48+ -- * Distribution
49+ , Distribution
50+ , distribution
51+ , dSumOfSquaredDeviation
52+ , dMean
53+ , dExponentialBuckets
54+ , dMaximum
55+ , dLinearBuckets
56+ , dCount
57+ , dMinimum
58+ , dBucketCounts
59+ , dExplicitBuckets
60+
61+ -- * ExponentialBuckets
62+ , ExponentialBuckets
63+ , exponentialBuckets
64+ , ebGrowthFactor
65+ , ebScale
66+ , ebNumFiniteBuckets
67+
68+ -- * Operation
69+ , Operation
70+ , operation
71+ , oImportance
72+ , oStartTime
73+ , oEndTime
74+ , oOperationName
75+ , oLabels
76+ , oOperationId
77+ , oConsumerId
78+ , oMetricValueSets
79+ , oLogEntries
80+
81+ -- * MetricValueSet
82+ , MetricValueSet
83+ , metricValueSet
84+ , mvsMetricName
85+ , mvsMetricValues
86+
87+ -- * LogEntryLabels
88+ , LogEntryLabels
89+ , logEntryLabels
90+ , lelAddtional
91+
92+ -- * LogEntryProtoPayload
93+ , LogEntryProtoPayload
94+ , logEntryProtoPayload
95+ , leppAddtional
96+
97+ -- * LinearBuckets
98+ , LinearBuckets
99+ , linearBuckets
100+ , lbOffSet
101+ , lbWidth
102+ , lbNumFiniteBuckets
103+
104+ -- * CheckErrorCode
105+ , CheckErrorCode (..)
106+
107+ -- * StatusDetailsItem
108+ , StatusDetailsItem
109+ , statusDetailsItem
110+ , sdiAddtional
111+
112+ -- * CheckError
113+ , CheckError
114+ , checkError
115+ , ceCode
116+ , ceDetail
117+
118+ -- * ReportError
119+ , ReportError
120+ , reportError
121+ , reStatus
122+ , reOperationId
123+
124+ -- * OperationImportance
125+ , OperationImportance (..)
126+
127+ -- * MetricValue
128+ , MetricValue
129+ , metricValue
130+ , mvBoolValue
131+ , mvStartTime
132+ , mvDoubleValue
133+ , mvStringValue
134+ , mvDistributionValue
135+ , mvEndTime
136+ , mvInt64Value
137+ , mvLabels
138+
139+ -- * Xgafv
140+ , Xgafv (..)
141+
142+ -- * CheckResponse
143+ , CheckResponse
144+ , checkResponse
145+ , crCheckErrors
146+ , crServiceConfigId
147+ , crOperationId
148+
149+ -- * ReportResponse
150+ , ReportResponse
151+ , reportResponse
152+ , rrReportErrors
153+ , rrServiceConfigId
154+
155+ -- * LogEntry
156+ , LogEntry
157+ , logEntry
158+ , leSeverity
159+ , leTextPayload
160+ , leStructPayload
161+ , leName
162+ , leInsertId
163+ , leLabels
164+ , leProtoPayload
165+ , leTimestamp
166+
167+ -- * OperationLabels
168+ , OperationLabels
169+ , operationLabels
170+ , olAddtional
171+
172+ -- * LogEntrySeverity
173+ , LogEntrySeverity (..)
174+
175+ -- * ExplicitBuckets
176+ , ExplicitBuckets
177+ , explicitBuckets
178+ , ebBounds
179+
180+ -- * LogEntryStructPayload
181+ , LogEntryStructPayload
182+ , logEntryStructPayload
183+ , lespAddtional
184+ ) where
185+
186+import Network.Google.Prelude
187+import Network.Google.ServiceControl.Types.Product
188+import Network.Google.ServiceControl.Types.Sum
189+
190+-- | Default request referring to version 'v1' of the Google Service Control API. This contains the host and root path used as a starting point for constructing service requests.
191+serviceControlService :: ServiceConfig
192+serviceControlService
193+ = defaultService (ServiceId "servicecontrol:v1")
194+ "servicecontrol.googleapis.com"
195+
196+-- | Manage your Google Service Control data
197+serviceControlScope :: Proxy '["https://www.googleapis.com/auth/servicecontrol"]
198+serviceControlScope = Proxy;
199+
200+-- | View and manage your data across Google Cloud Platform services
201+cloudPlatformScope :: Proxy '["https://www.googleapis.com/auth/cloud-platform"]
202+cloudPlatformScope = Proxy;
gogol-servicecontrol/gen/Network/Google/ServiceControl/Types/Product.hsnew file+1434
@@ -0,0 +1,1434 @@
1+{-# LANGUAGE DeriveDataTypeable #-}
2+{-# LANGUAGE DeriveGeneric #-}
3+{-# LANGUAGE NoImplicitPrelude #-}
4+{-# LANGUAGE OverloadedStrings #-}
5+{-# LANGUAGE RecordWildCards #-}
6+
7+{-# OPTIONS_GHC -fno-warn-unused-binds #-}
8+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
9+
10+-- |
11+-- Module : Network.Google.ServiceControl.Types.Product
12+-- Copyright : (c) 2015-2016 Brendan Hay
13+-- License : Mozilla Public License, v. 2.0.
14+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
15+-- Stability : auto-generated
16+-- Portability : non-portable (GHC extensions)
17+--
18+module Network.Google.ServiceControl.Types.Product where
19+
20+import Network.Google.Prelude
21+import Network.Google.ServiceControl.Types.Sum
22+
23+-- | The \`Status\` type defines a logical error model that is suitable for
24+-- different programming environments, including REST APIs and RPC APIs. It
25+-- is used by [gRPC](https:\/\/github.com\/grpc). The error model is
26+-- designed to be: - Simple to use and understand for most users - Flexible
27+-- enough to meet unexpected needs # Overview The \`Status\` message
28+-- contains three pieces of data: error code, error message, and error
29+-- details. The error code should be an enum value of google.rpc.Code, but
30+-- it may accept additional error codes if needed. The error message should
31+-- be a developer-facing English message that helps developers *understand*
32+-- and *resolve* the error. If a localized user-facing error message is
33+-- needed, put the localized message in the error details or localize it in
34+-- the client. The optional error details may contain arbitrary information
35+-- about the error. There is a predefined set of error detail types in the
36+-- package \`google.rpc\` which can be used for common error conditions. #
37+-- Language mapping The \`Status\` message is the logical representation of
38+-- the error model, but it is not necessarily the actual wire format. When
39+-- the \`Status\` message is exposed in different client libraries and
40+-- different wire protocols, it can be mapped differently. For example, it
41+-- will likely be mapped to some exceptions in Java, but more likely mapped
42+-- to some error codes in C. # Other uses The error model and the
43+-- \`Status\` message can be used in a variety of environments, either with
44+-- or without APIs, to provide a consistent developer experience across
45+-- different environments. Example uses of this error model include: -
46+-- Partial errors. If a service needs to return partial errors to the
47+-- client, it may embed the \`Status\` in the normal response to indicate
48+-- the partial errors. - Workflow errors. A typical workflow has multiple
49+-- steps. Each step may have a \`Status\` message for error reporting
50+-- purpose. - Batch operations. If a client uses batch request and batch
51+-- response, the \`Status\` message should be used directly inside batch
52+-- response, one for each error sub-response. - Asynchronous operations. If
53+-- an API call embeds asynchronous operation results in its response, the
54+-- status of those operations should be represented directly using the
55+-- \`Status\` message. - Logging. If some API errors are stored in logs,
56+-- the message \`Status\` could be used directly after any stripping needed
57+-- for security\/privacy reasons.
58+--
59+-- /See:/ 'status' smart constructor.
60+data Status = Status'
61+ { _sDetails :: !(Maybe [StatusDetailsItem])
62+ , _sCode :: !(Maybe (Textual Int32))
63+ , _sMessage :: !(Maybe Text)
64+ } deriving (Eq,Show,Data,Typeable,Generic)
65+
66+-- | Creates a value of 'Status' with the minimum fields required to make a request.
67+--
68+-- Use one of the following lenses to modify other fields as desired:
69+--
70+-- * 'sDetails'
71+--
72+-- * 'sCode'
73+--
74+-- * 'sMessage'
75+status
76+ :: Status
77+status =
78+ Status'
79+ { _sDetails = Nothing
80+ , _sCode = Nothing
81+ , _sMessage = Nothing
82+ }
83+
84+-- | A list of messages that carry the error details. There will be a common
85+-- set of message types for APIs to use.
86+sDetails :: Lens' Status [StatusDetailsItem]
87+sDetails
88+ = lens _sDetails (\ s a -> s{_sDetails = a}) .
89+ _Default
90+ . _Coerce
91+
92+-- | The status code, which should be an enum value of google.rpc.Code.
93+sCode :: Lens' Status (Maybe Int32)
94+sCode
95+ = lens _sCode (\ s a -> s{_sCode = a}) .
96+ mapping _Coerce
97+
98+-- | A developer-facing error message, which should be in English. Any
99+-- user-facing error message should be localized and sent in the
100+-- google.rpc.Status.details field, or localized by the client.
101+sMessage :: Lens' Status (Maybe Text)
102+sMessage = lens _sMessage (\ s a -> s{_sMessage = a})
103+
104+instance FromJSON Status where
105+ parseJSON
106+ = withObject "Status"
107+ (\ o ->
108+ Status' <$>
109+ (o .:? "details" .!= mempty) <*> (o .:? "code") <*>
110+ (o .:? "message"))
111+
112+instance ToJSON Status where
113+ toJSON Status'{..}
114+ = object
115+ (catMaybes
116+ [("details" .=) <$> _sDetails,
117+ ("code" .=) <$> _sCode,
118+ ("message" .=) <$> _sMessage])
119+
120+-- | Request message for the Report method.
121+--
122+-- /See:/ 'reportRequest' smart constructor.
123+newtype ReportRequest = ReportRequest'
124+ { _rrOperations :: Maybe [Operation]
125+ } deriving (Eq,Show,Data,Typeable,Generic)
126+
127+-- | Creates a value of 'ReportRequest' with the minimum fields required to make a request.
128+--
129+-- Use one of the following lenses to modify other fields as desired:
130+--
131+-- * 'rrOperations'
132+reportRequest
133+ :: ReportRequest
134+reportRequest =
135+ ReportRequest'
136+ { _rrOperations = Nothing
137+ }
138+
139+-- | Operations to be reported. Typically the service should report one
140+-- operation per request. Putting multiple operations into a single request
141+-- is allowed, but should be used only when multiple operations are
142+-- natually available at the time of the report. If multiple operations are
143+-- in a single request, the total request size should be no larger than
144+-- 1MB. See ReportResponse.report_errors for partial failure behavior.
145+rrOperations :: Lens' ReportRequest [Operation]
146+rrOperations
147+ = lens _rrOperations (\ s a -> s{_rrOperations = a})
148+ . _Default
149+ . _Coerce
150+
151+instance FromJSON ReportRequest where
152+ parseJSON
153+ = withObject "ReportRequest"
154+ (\ o ->
155+ ReportRequest' <$> (o .:? "operations" .!= mempty))
156+
157+instance ToJSON ReportRequest where
158+ toJSON ReportRequest'{..}
159+ = object
160+ (catMaybes [("operations" .=) <$> _rrOperations])
161+
162+-- | Request message for the Check method.
163+--
164+-- /See:/ 'checkRequest' smart constructor.
165+newtype CheckRequest = CheckRequest'
166+ { _crOperation :: Maybe Operation
167+ } deriving (Eq,Show,Data,Typeable,Generic)
168+
169+-- | Creates a value of 'CheckRequest' with the minimum fields required to make a request.
170+--
171+-- Use one of the following lenses to modify other fields as desired:
172+--
173+-- * 'crOperation'
174+checkRequest
175+ :: CheckRequest
176+checkRequest =
177+ CheckRequest'
178+ { _crOperation = Nothing
179+ }
180+
181+-- | The operation to be checked.
182+crOperation :: Lens' CheckRequest (Maybe Operation)
183+crOperation
184+ = lens _crOperation (\ s a -> s{_crOperation = a})
185+
186+instance FromJSON CheckRequest where
187+ parseJSON
188+ = withObject "CheckRequest"
189+ (\ o -> CheckRequest' <$> (o .:? "operation"))
190+
191+instance ToJSON CheckRequest where
192+ toJSON CheckRequest'{..}
193+ = object
194+ (catMaybes [("operation" .=) <$> _crOperation])
195+
196+-- | The labels describing the metric value. See comments on
197+-- google.api.servicecontrol.v1.Operation.labels for the overriding
198+-- relationship.
199+--
200+-- /See:/ 'metricValueLabels' smart constructor.
201+newtype MetricValueLabels = MetricValueLabels'
202+ { _mvlAddtional :: HashMap Text Text
203+ } deriving (Eq,Show,Data,Typeable,Generic)
204+
205+-- | Creates a value of 'MetricValueLabels' with the minimum fields required to make a request.
206+--
207+-- Use one of the following lenses to modify other fields as desired:
208+--
209+-- * 'mvlAddtional'
210+metricValueLabels
211+ :: HashMap Text Text -- ^ 'mvlAddtional'
212+ -> MetricValueLabels
213+metricValueLabels pMvlAddtional_ =
214+ MetricValueLabels'
215+ { _mvlAddtional = _Coerce # pMvlAddtional_
216+ }
217+
218+mvlAddtional :: Lens' MetricValueLabels (HashMap Text Text)
219+mvlAddtional
220+ = lens _mvlAddtional (\ s a -> s{_mvlAddtional = a})
221+ . _Coerce
222+
223+instance FromJSON MetricValueLabels where
224+ parseJSON
225+ = withObject "MetricValueLabels"
226+ (\ o -> MetricValueLabels' <$> (parseJSONObject o))
227+
228+instance ToJSON MetricValueLabels where
229+ toJSON = toJSON . _mvlAddtional
230+
231+-- | Distribution represents a frequency distribution of double-valued sample
232+-- points. It contains the size of the population of sample points plus
233+-- additional optional information: - the arithmetic mean of the samples -
234+-- the minimum and maximum of the samples - the sum-squared-deviation of
235+-- the samples, used to compute variance - a histogram of the values of the
236+-- sample points
237+--
238+-- /See:/ 'distribution' smart constructor.
239+data Distribution = Distribution'
240+ { _dSumOfSquaredDeviation :: !(Maybe (Textual Double))
241+ , _dMean :: !(Maybe (Textual Double))
242+ , _dExponentialBuckets :: !(Maybe ExponentialBuckets)
243+ , _dMaximum :: !(Maybe (Textual Double))
244+ , _dLinearBuckets :: !(Maybe LinearBuckets)
245+ , _dCount :: !(Maybe (Textual Int64))
246+ , _dMinimum :: !(Maybe (Textual Double))
247+ , _dBucketCounts :: !(Maybe [Textual Int64])
248+ , _dExplicitBuckets :: !(Maybe ExplicitBuckets)
249+ } deriving (Eq,Show,Data,Typeable,Generic)
250+
251+-- | Creates a value of 'Distribution' with the minimum fields required to make a request.
252+--
253+-- Use one of the following lenses to modify other fields as desired:
254+--
255+-- * 'dSumOfSquaredDeviation'
256+--
257+-- * 'dMean'
258+--
259+-- * 'dExponentialBuckets'
260+--
261+-- * 'dMaximum'
262+--
263+-- * 'dLinearBuckets'
264+--
265+-- * 'dCount'
266+--
267+-- * 'dMinimum'
268+--
269+-- * 'dBucketCounts'
270+--
271+-- * 'dExplicitBuckets'
272+distribution
273+ :: Distribution
274+distribution =
275+ Distribution'
276+ { _dSumOfSquaredDeviation = Nothing
277+ , _dMean = Nothing
278+ , _dExponentialBuckets = Nothing
279+ , _dMaximum = Nothing
280+ , _dLinearBuckets = Nothing
281+ , _dCount = Nothing
282+ , _dMinimum = Nothing
283+ , _dBucketCounts = Nothing
284+ , _dExplicitBuckets = Nothing
285+ }
286+
287+-- | The sum of squared deviations from the mean: Sum[i=1..count]((x_i -
288+-- mean)^2) where each x_i is a sample values. If \`count\` is zero then
289+-- this field must be zero, otherwise validation of the request fails.
290+dSumOfSquaredDeviation :: Lens' Distribution (Maybe Double)
291+dSumOfSquaredDeviation
292+ = lens _dSumOfSquaredDeviation
293+ (\ s a -> s{_dSumOfSquaredDeviation = a})
294+ . mapping _Coerce
295+
296+-- | The arithmetic mean of the samples in the distribution. If \`count\` is
297+-- zero then this field must be zero.
298+dMean :: Lens' Distribution (Maybe Double)
299+dMean
300+ = lens _dMean (\ s a -> s{_dMean = a}) .
301+ mapping _Coerce
302+
303+-- | Buckets with exponentially growing width.
304+dExponentialBuckets :: Lens' Distribution (Maybe ExponentialBuckets)
305+dExponentialBuckets
306+ = lens _dExponentialBuckets
307+ (\ s a -> s{_dExponentialBuckets = a})
308+
309+-- | The maximum of the population of values. Ignored if \`count\` is zero.
310+dMaximum :: Lens' Distribution (Maybe Double)
311+dMaximum
312+ = lens _dMaximum (\ s a -> s{_dMaximum = a}) .
313+ mapping _Coerce
314+
315+-- | Buckets with constant width.
316+dLinearBuckets :: Lens' Distribution (Maybe LinearBuckets)
317+dLinearBuckets
318+ = lens _dLinearBuckets
319+ (\ s a -> s{_dLinearBuckets = a})
320+
321+-- | The total number of samples in the distribution. Must be >= 0.
322+dCount :: Lens' Distribution (Maybe Int64)
323+dCount
324+ = lens _dCount (\ s a -> s{_dCount = a}) .
325+ mapping _Coerce
326+
327+-- | The minimum of the population of values. Ignored if \`count\` is zero.
328+dMinimum :: Lens' Distribution (Maybe Double)
329+dMinimum
330+ = lens _dMinimum (\ s a -> s{_dMinimum = a}) .
331+ mapping _Coerce
332+
333+-- | The number of samples in each histogram bucket. \`bucket_counts\` are
334+-- optional. If present, they must sum to the \`count\` value. The buckets
335+-- are defined below in \`bucket_option\`. There are N buckets.
336+-- \`bucket_counts[0]\` is the number of samples in the underflow bucket.
337+-- \`bucket_counts[1]\` to \`bucket_counts[N-1]\` are the numbers of
338+-- samples in each of the finite buckets. And \`bucket_counts[N] is the
339+-- number of samples in the overflow bucket. See the comments of
340+-- \`bucket_option\` below for more details. Any suffix of trailing zeros
341+-- may be omitted.
342+dBucketCounts :: Lens' Distribution [Int64]
343+dBucketCounts
344+ = lens _dBucketCounts
345+ (\ s a -> s{_dBucketCounts = a})
346+ . _Default
347+ . _Coerce
348+
349+-- | Buckets with arbitrary user-provided width.
350+dExplicitBuckets :: Lens' Distribution (Maybe ExplicitBuckets)
351+dExplicitBuckets
352+ = lens _dExplicitBuckets
353+ (\ s a -> s{_dExplicitBuckets = a})
354+
355+instance FromJSON Distribution where
356+ parseJSON
357+ = withObject "Distribution"
358+ (\ o ->
359+ Distribution' <$>
360+ (o .:? "sumOfSquaredDeviation") <*> (o .:? "mean")
361+ <*> (o .:? "exponentialBuckets")
362+ <*> (o .:? "maximum")
363+ <*> (o .:? "linearBuckets")
364+ <*> (o .:? "count")
365+ <*> (o .:? "minimum")
366+ <*> (o .:? "bucketCounts" .!= mempty)
367+ <*> (o .:? "explicitBuckets"))
368+
369+instance ToJSON Distribution where
370+ toJSON Distribution'{..}
371+ = object
372+ (catMaybes
373+ [("sumOfSquaredDeviation" .=) <$>
374+ _dSumOfSquaredDeviation,
375+ ("mean" .=) <$> _dMean,
376+ ("exponentialBuckets" .=) <$> _dExponentialBuckets,
377+ ("maximum" .=) <$> _dMaximum,
378+ ("linearBuckets" .=) <$> _dLinearBuckets,
379+ ("count" .=) <$> _dCount,
380+ ("minimum" .=) <$> _dMinimum,
381+ ("bucketCounts" .=) <$> _dBucketCounts,
382+ ("explicitBuckets" .=) <$> _dExplicitBuckets])
383+
384+-- | Describing buckets with exponentially growing width.
385+--
386+-- /See:/ 'exponentialBuckets' smart constructor.
387+data ExponentialBuckets = ExponentialBuckets'
388+ { _ebGrowthFactor :: !(Maybe (Textual Double))
389+ , _ebScale :: !(Maybe (Textual Double))
390+ , _ebNumFiniteBuckets :: !(Maybe (Textual Int32))
391+ } deriving (Eq,Show,Data,Typeable,Generic)
392+
393+-- | Creates a value of 'ExponentialBuckets' with the minimum fields required to make a request.
394+--
395+-- Use one of the following lenses to modify other fields as desired:
396+--
397+-- * 'ebGrowthFactor'
398+--
399+-- * 'ebScale'
400+--
401+-- * 'ebNumFiniteBuckets'
402+exponentialBuckets
403+ :: ExponentialBuckets
404+exponentialBuckets =
405+ ExponentialBuckets'
406+ { _ebGrowthFactor = Nothing
407+ , _ebScale = Nothing
408+ , _ebNumFiniteBuckets = Nothing
409+ }
410+
411+-- | The i\'th exponential bucket covers the interval [scale *
412+-- growth_factor^(i-1), scale * growth_factor^i) where i ranges from 1 to
413+-- num_finite_buckets inclusive. Must be larger than 1.0.
414+ebGrowthFactor :: Lens' ExponentialBuckets (Maybe Double)
415+ebGrowthFactor
416+ = lens _ebGrowthFactor
417+ (\ s a -> s{_ebGrowthFactor = a})
418+ . mapping _Coerce
419+
420+-- | The i\'th exponential bucket covers the interval [scale *
421+-- growth_factor^(i-1), scale * growth_factor^i) where i ranges from 1 to
422+-- num_finite_buckets inclusive. Must be > 0.
423+ebScale :: Lens' ExponentialBuckets (Maybe Double)
424+ebScale
425+ = lens _ebScale (\ s a -> s{_ebScale = a}) .
426+ mapping _Coerce
427+
428+-- | The number of finite buckets. With the underflow and overflow buckets,
429+-- the total number of buckets is \`num_finite_buckets\` + 2. See comments
430+-- on \`bucket_options\` for details.
431+ebNumFiniteBuckets :: Lens' ExponentialBuckets (Maybe Int32)
432+ebNumFiniteBuckets
433+ = lens _ebNumFiniteBuckets
434+ (\ s a -> s{_ebNumFiniteBuckets = a})
435+ . mapping _Coerce
436+
437+instance FromJSON ExponentialBuckets where
438+ parseJSON
439+ = withObject "ExponentialBuckets"
440+ (\ o ->
441+ ExponentialBuckets' <$>
442+ (o .:? "growthFactor") <*> (o .:? "scale") <*>
443+ (o .:? "numFiniteBuckets"))
444+
445+instance ToJSON ExponentialBuckets where
446+ toJSON ExponentialBuckets'{..}
447+ = object
448+ (catMaybes
449+ [("growthFactor" .=) <$> _ebGrowthFactor,
450+ ("scale" .=) <$> _ebScale,
451+ ("numFiniteBuckets" .=) <$> _ebNumFiniteBuckets])
452+
453+-- | Represents information regarding an operation.
454+--
455+-- /See:/ 'operation' smart constructor.
456+data Operation = Operation'
457+ { _oImportance :: !(Maybe OperationImportance)
458+ , _oStartTime :: !(Maybe DateTime')
459+ , _oEndTime :: !(Maybe DateTime')
460+ , _oOperationName :: !(Maybe Text)
461+ , _oLabels :: !(Maybe OperationLabels)
462+ , _oOperationId :: !(Maybe Text)
463+ , _oConsumerId :: !(Maybe Text)
464+ , _oMetricValueSets :: !(Maybe [MetricValueSet])
465+ , _oLogEntries :: !(Maybe [LogEntry])
466+ } deriving (Eq,Show,Data,Typeable,Generic)
467+
468+-- | Creates a value of 'Operation' with the minimum fields required to make a request.
469+--
470+-- Use one of the following lenses to modify other fields as desired:
471+--
472+-- * 'oImportance'
473+--
474+-- * 'oStartTime'
475+--
476+-- * 'oEndTime'
477+--
478+-- * 'oOperationName'
479+--
480+-- * 'oLabels'
481+--
482+-- * 'oOperationId'
483+--
484+-- * 'oConsumerId'
485+--
486+-- * 'oMetricValueSets'
487+--
488+-- * 'oLogEntries'
489+operation
490+ :: Operation
491+operation =
492+ Operation'
493+ { _oImportance = Nothing
494+ , _oStartTime = Nothing
495+ , _oEndTime = Nothing
496+ , _oOperationName = Nothing
497+ , _oLabels = Nothing
498+ , _oOperationId = Nothing
499+ , _oConsumerId = Nothing
500+ , _oMetricValueSets = Nothing
501+ , _oLogEntries = Nothing
502+ }
503+
504+-- | DO NOT USE. This is an experimental field.
505+oImportance :: Lens' Operation (Maybe OperationImportance)
506+oImportance
507+ = lens _oImportance (\ s a -> s{_oImportance = a})
508+
509+-- | Required. Start time of the operation.
510+oStartTime :: Lens' Operation (Maybe UTCTime)
511+oStartTime
512+ = lens _oStartTime (\ s a -> s{_oStartTime = a}) .
513+ mapping _DateTime
514+
515+-- | End time of the operation. Required when the operation is used in
516+-- ServiceController.Report, but optional when the operation is used in
517+-- ServiceController.Check.
518+oEndTime :: Lens' Operation (Maybe UTCTime)
519+oEndTime
520+ = lens _oEndTime (\ s a -> s{_oEndTime = a}) .
521+ mapping _DateTime
522+
523+-- | Fully qualified name of the operation. Reserved for future use.
524+oOperationName :: Lens' Operation (Maybe Text)
525+oOperationName
526+ = lens _oOperationName
527+ (\ s a -> s{_oOperationName = a})
528+
529+-- | Labels describing the operation. Only the following labels are allowed:
530+-- - Labels describing monitored resources as defined in the service
531+-- configuration. - Default labels of metric values. When specified, labels
532+-- defined in the metric value override these default. - The following
533+-- labels defined by Google Cloud Platform: -
534+-- \`cloud.googleapis.com\/location\` describing the location where the
535+-- operation happened, - \`servicecontrol.googleapis.com\/user_agent\`
536+-- describing the user agent of the API request, -
537+-- \`servicecontrol.googleapis.com\/service_agent\` describing the service
538+-- used to handle the API request (e.g. ESP), -
539+-- \`servicecontrol.googleapis.com\/platform\` describing the platform
540+-- where the API is served (e.g. GAE, GCE, GKE).
541+oLabels :: Lens' Operation (Maybe OperationLabels)
542+oLabels = lens _oLabels (\ s a -> s{_oLabels = a})
543+
544+-- | Identity of the operation. This must be unique within the scope of the
545+-- service that generated the operation. If the service calls Check() and
546+-- Report() on the same operation, the two calls should carry the same id.
547+-- UUID version 4 is recommended, though not required. In scenarios where
548+-- an operation is computed from existing information and an idempotent id
549+-- is desirable for deduplication purpose, UUID version 5 is recommended.
550+-- See RFC 4122 for details.
551+oOperationId :: Lens' Operation (Maybe Text)
552+oOperationId
553+ = lens _oOperationId (\ s a -> s{_oOperationId = a})
554+
555+-- | Identity of the consumer who is using the service. This field should be
556+-- filled in for the operations initiated by a consumer, but not for
557+-- service-initiated operations that are not related to a specific
558+-- consumer. This can be in one of the following formats: project:,
559+-- project_number:, api_key:.
560+oConsumerId :: Lens' Operation (Maybe Text)
561+oConsumerId
562+ = lens _oConsumerId (\ s a -> s{_oConsumerId = a})
563+
564+-- | Represents information about this operation. Each MetricValueSet
565+-- corresponds to a metric defined in the service configuration. The data
566+-- type used in the MetricValueSet must agree with the data type specified
567+-- in the metric definition. Within a single operation, it is not allowed
568+-- to have more than one MetricValue instances that have the same metric
569+-- names and identical label value combinations. If a request has such
570+-- duplicated MetricValue instances, the entire request is rejected with an
571+-- invalid argument error.
572+oMetricValueSets :: Lens' Operation [MetricValueSet]
573+oMetricValueSets
574+ = lens _oMetricValueSets
575+ (\ s a -> s{_oMetricValueSets = a})
576+ . _Default
577+ . _Coerce
578+
579+-- | Represents information to be logged.
580+oLogEntries :: Lens' Operation [LogEntry]
581+oLogEntries
582+ = lens _oLogEntries (\ s a -> s{_oLogEntries = a}) .
583+ _Default
584+ . _Coerce
585+
586+instance FromJSON Operation where
587+ parseJSON
588+ = withObject "Operation"
589+ (\ o ->
590+ Operation' <$>
591+ (o .:? "importance") <*> (o .:? "startTime") <*>
592+ (o .:? "endTime")
593+ <*> (o .:? "operationName")
594+ <*> (o .:? "labels")
595+ <*> (o .:? "operationId")
596+ <*> (o .:? "consumerId")
597+ <*> (o .:? "metricValueSets" .!= mempty)
598+ <*> (o .:? "logEntries" .!= mempty))
599+
600+instance ToJSON Operation where
601+ toJSON Operation'{..}
602+ = object
603+ (catMaybes
604+ [("importance" .=) <$> _oImportance,
605+ ("startTime" .=) <$> _oStartTime,
606+ ("endTime" .=) <$> _oEndTime,
607+ ("operationName" .=) <$> _oOperationName,
608+ ("labels" .=) <$> _oLabels,
609+ ("operationId" .=) <$> _oOperationId,
610+ ("consumerId" .=) <$> _oConsumerId,
611+ ("metricValueSets" .=) <$> _oMetricValueSets,
612+ ("logEntries" .=) <$> _oLogEntries])
613+
614+-- | Represents a set of metric values in the same metric. Each metric value
615+-- in the set should have a unique combination of start time, end time, and
616+-- label values.
617+--
618+-- /See:/ 'metricValueSet' smart constructor.
619+data MetricValueSet = MetricValueSet'
620+ { _mvsMetricName :: !(Maybe Text)
621+ , _mvsMetricValues :: !(Maybe [MetricValue])
622+ } deriving (Eq,Show,Data,Typeable,Generic)
623+
624+-- | Creates a value of 'MetricValueSet' with the minimum fields required to make a request.
625+--
626+-- Use one of the following lenses to modify other fields as desired:
627+--
628+-- * 'mvsMetricName'
629+--
630+-- * 'mvsMetricValues'
631+metricValueSet
632+ :: MetricValueSet
633+metricValueSet =
634+ MetricValueSet'
635+ { _mvsMetricName = Nothing
636+ , _mvsMetricValues = Nothing
637+ }
638+
639+-- | The metric name defined in the service configuration.
640+mvsMetricName :: Lens' MetricValueSet (Maybe Text)
641+mvsMetricName
642+ = lens _mvsMetricName
643+ (\ s a -> s{_mvsMetricName = a})
644+
645+-- | The values in this metric.
646+mvsMetricValues :: Lens' MetricValueSet [MetricValue]
647+mvsMetricValues
648+ = lens _mvsMetricValues
649+ (\ s a -> s{_mvsMetricValues = a})
650+ . _Default
651+ . _Coerce
652+
653+instance FromJSON MetricValueSet where
654+ parseJSON
655+ = withObject "MetricValueSet"
656+ (\ o ->
657+ MetricValueSet' <$>
658+ (o .:? "metricName") <*>
659+ (o .:? "metricValues" .!= mempty))
660+
661+instance ToJSON MetricValueSet where
662+ toJSON MetricValueSet'{..}
663+ = object
664+ (catMaybes
665+ [("metricName" .=) <$> _mvsMetricName,
666+ ("metricValues" .=) <$> _mvsMetricValues])
667+
668+-- | A set of user-defined (key, value) data that provides additional
669+-- information about the log entry.
670+--
671+-- /See:/ 'logEntryLabels' smart constructor.
672+newtype LogEntryLabels = LogEntryLabels'
673+ { _lelAddtional :: HashMap Text Text
674+ } deriving (Eq,Show,Data,Typeable,Generic)
675+
676+-- | Creates a value of 'LogEntryLabels' with the minimum fields required to make a request.
677+--
678+-- Use one of the following lenses to modify other fields as desired:
679+--
680+-- * 'lelAddtional'
681+logEntryLabels
682+ :: HashMap Text Text -- ^ 'lelAddtional'
683+ -> LogEntryLabels
684+logEntryLabels pLelAddtional_ =
685+ LogEntryLabels'
686+ { _lelAddtional = _Coerce # pLelAddtional_
687+ }
688+
689+lelAddtional :: Lens' LogEntryLabels (HashMap Text Text)
690+lelAddtional
691+ = lens _lelAddtional (\ s a -> s{_lelAddtional = a})
692+ . _Coerce
693+
694+instance FromJSON LogEntryLabels where
695+ parseJSON
696+ = withObject "LogEntryLabels"
697+ (\ o -> LogEntryLabels' <$> (parseJSONObject o))
698+
699+instance ToJSON LogEntryLabels where
700+ toJSON = toJSON . _lelAddtional
701+
702+-- | The log entry payload, represented as a protocol buffer that is
703+-- expressed as a JSON object. You can only pass \`protoPayload\` values
704+-- that belong to a set of approved types.
705+--
706+-- /See:/ 'logEntryProtoPayload' smart constructor.
707+newtype LogEntryProtoPayload = LogEntryProtoPayload'
708+ { _leppAddtional :: HashMap Text JSONValue
709+ } deriving (Eq,Show,Data,Typeable,Generic)
710+
711+-- | Creates a value of 'LogEntryProtoPayload' with the minimum fields required to make a request.
712+--
713+-- Use one of the following lenses to modify other fields as desired:
714+--
715+-- * 'leppAddtional'
716+logEntryProtoPayload
717+ :: HashMap Text JSONValue -- ^ 'leppAddtional'
718+ -> LogEntryProtoPayload
719+logEntryProtoPayload pLeppAddtional_ =
720+ LogEntryProtoPayload'
721+ { _leppAddtional = _Coerce # pLeppAddtional_
722+ }
723+
724+-- | Properties of the object. Contains field \'type with type URL.
725+leppAddtional :: Lens' LogEntryProtoPayload (HashMap Text JSONValue)
726+leppAddtional
727+ = lens _leppAddtional
728+ (\ s a -> s{_leppAddtional = a})
729+ . _Coerce
730+
731+instance FromJSON LogEntryProtoPayload where
732+ parseJSON
733+ = withObject "LogEntryProtoPayload"
734+ (\ o ->
735+ LogEntryProtoPayload' <$> (parseJSONObject o))
736+
737+instance ToJSON LogEntryProtoPayload where
738+ toJSON = toJSON . _leppAddtional
739+
740+-- | Describing buckets with constant width.
741+--
742+-- /See:/ 'linearBuckets' smart constructor.
743+data LinearBuckets = LinearBuckets'
744+ { _lbOffSet :: !(Maybe (Textual Double))
745+ , _lbWidth :: !(Maybe (Textual Double))
746+ , _lbNumFiniteBuckets :: !(Maybe (Textual Int32))
747+ } deriving (Eq,Show,Data,Typeable,Generic)
748+
749+-- | Creates a value of 'LinearBuckets' with the minimum fields required to make a request.
750+--
751+-- Use one of the following lenses to modify other fields as desired:
752+--
753+-- * 'lbOffSet'
754+--
755+-- * 'lbWidth'
756+--
757+-- * 'lbNumFiniteBuckets'
758+linearBuckets
759+ :: LinearBuckets
760+linearBuckets =
761+ LinearBuckets'
762+ { _lbOffSet = Nothing
763+ , _lbWidth = Nothing
764+ , _lbNumFiniteBuckets = Nothing
765+ }
766+
767+-- | The i\'th linear bucket covers the interval [offset + (i-1) * width,
768+-- offset + i * width) where i ranges from 1 to num_finite_buckets,
769+-- inclusive.
770+lbOffSet :: Lens' LinearBuckets (Maybe Double)
771+lbOffSet
772+ = lens _lbOffSet (\ s a -> s{_lbOffSet = a}) .
773+ mapping _Coerce
774+
775+-- | The i\'th linear bucket covers the interval [offset + (i-1) * width,
776+-- offset + i * width) where i ranges from 1 to num_finite_buckets,
777+-- inclusive. Must be strictly positive.
778+lbWidth :: Lens' LinearBuckets (Maybe Double)
779+lbWidth
780+ = lens _lbWidth (\ s a -> s{_lbWidth = a}) .
781+ mapping _Coerce
782+
783+-- | The number of finite buckets. With the underflow and overflow buckets,
784+-- the total number of buckets is \`num_finite_buckets\` + 2. See comments
785+-- on \`bucket_options\` for details.
786+lbNumFiniteBuckets :: Lens' LinearBuckets (Maybe Int32)
787+lbNumFiniteBuckets
788+ = lens _lbNumFiniteBuckets
789+ (\ s a -> s{_lbNumFiniteBuckets = a})
790+ . mapping _Coerce
791+
792+instance FromJSON LinearBuckets where
793+ parseJSON
794+ = withObject "LinearBuckets"
795+ (\ o ->
796+ LinearBuckets' <$>
797+ (o .:? "offset") <*> (o .:? "width") <*>
798+ (o .:? "numFiniteBuckets"))
799+
800+instance ToJSON LinearBuckets where
801+ toJSON LinearBuckets'{..}
802+ = object
803+ (catMaybes
804+ [("offset" .=) <$> _lbOffSet,
805+ ("width" .=) <$> _lbWidth,
806+ ("numFiniteBuckets" .=) <$> _lbNumFiniteBuckets])
807+
808+--
809+-- /See:/ 'statusDetailsItem' smart constructor.
810+newtype StatusDetailsItem = StatusDetailsItem'
811+ { _sdiAddtional :: HashMap Text JSONValue
812+ } deriving (Eq,Show,Data,Typeable,Generic)
813+
814+-- | Creates a value of 'StatusDetailsItem' with the minimum fields required to make a request.
815+--
816+-- Use one of the following lenses to modify other fields as desired:
817+--
818+-- * 'sdiAddtional'
819+statusDetailsItem
820+ :: HashMap Text JSONValue -- ^ 'sdiAddtional'
821+ -> StatusDetailsItem
822+statusDetailsItem pSdiAddtional_ =
823+ StatusDetailsItem'
824+ { _sdiAddtional = _Coerce # pSdiAddtional_
825+ }
826+
827+-- | Properties of the object. Contains field \'type with type URL.
828+sdiAddtional :: Lens' StatusDetailsItem (HashMap Text JSONValue)
829+sdiAddtional
830+ = lens _sdiAddtional (\ s a -> s{_sdiAddtional = a})
831+ . _Coerce
832+
833+instance FromJSON StatusDetailsItem where
834+ parseJSON
835+ = withObject "StatusDetailsItem"
836+ (\ o -> StatusDetailsItem' <$> (parseJSONObject o))
837+
838+instance ToJSON StatusDetailsItem where
839+ toJSON = toJSON . _sdiAddtional
840+
841+-- | Defines the errors to be returned in
842+-- google.api.servicecontrol.v1.CheckResponse.check_errors.
843+--
844+-- /See:/ 'checkError' smart constructor.
845+data CheckError = CheckError'
846+ { _ceCode :: !(Maybe CheckErrorCode)
847+ , _ceDetail :: !(Maybe Text)
848+ } deriving (Eq,Show,Data,Typeable,Generic)
849+
850+-- | Creates a value of 'CheckError' with the minimum fields required to make a request.
851+--
852+-- Use one of the following lenses to modify other fields as desired:
853+--
854+-- * 'ceCode'
855+--
856+-- * 'ceDetail'
857+checkError
858+ :: CheckError
859+checkError =
860+ CheckError'
861+ { _ceCode = Nothing
862+ , _ceDetail = Nothing
863+ }
864+
865+-- | The error code.
866+ceCode :: Lens' CheckError (Maybe CheckErrorCode)
867+ceCode = lens _ceCode (\ s a -> s{_ceCode = a})
868+
869+-- | Free-form text providing details on the error cause of the error.
870+ceDetail :: Lens' CheckError (Maybe Text)
871+ceDetail = lens _ceDetail (\ s a -> s{_ceDetail = a})
872+
873+instance FromJSON CheckError where
874+ parseJSON
875+ = withObject "CheckError"
876+ (\ o ->
877+ CheckError' <$> (o .:? "code") <*> (o .:? "detail"))
878+
879+instance ToJSON CheckError where
880+ toJSON CheckError'{..}
881+ = object
882+ (catMaybes
883+ [("code" .=) <$> _ceCode,
884+ ("detail" .=) <$> _ceDetail])
885+
886+-- | Represents the processing error of one \`Operation\` in the request.
887+--
888+-- /See:/ 'reportError' smart constructor.
889+data ReportError = ReportError'
890+ { _reStatus :: !(Maybe Status)
891+ , _reOperationId :: !(Maybe Text)
892+ } deriving (Eq,Show,Data,Typeable,Generic)
893+
894+-- | Creates a value of 'ReportError' with the minimum fields required to make a request.
895+--
896+-- Use one of the following lenses to modify other fields as desired:
897+--
898+-- * 'reStatus'
899+--
900+-- * 'reOperationId'
901+reportError
902+ :: ReportError
903+reportError =
904+ ReportError'
905+ { _reStatus = Nothing
906+ , _reOperationId = Nothing
907+ }
908+
909+-- | Details of the error when processing the \`Operation\`.
910+reStatus :: Lens' ReportError (Maybe Status)
911+reStatus = lens _reStatus (\ s a -> s{_reStatus = a})
912+
913+-- | The Operation.operation_id value from the request.
914+reOperationId :: Lens' ReportError (Maybe Text)
915+reOperationId
916+ = lens _reOperationId
917+ (\ s a -> s{_reOperationId = a})
918+
919+instance FromJSON ReportError where
920+ parseJSON
921+ = withObject "ReportError"
922+ (\ o ->
923+ ReportError' <$>
924+ (o .:? "status") <*> (o .:? "operationId"))
925+
926+instance ToJSON ReportError where
927+ toJSON ReportError'{..}
928+ = object
929+ (catMaybes
930+ [("status" .=) <$> _reStatus,
931+ ("operationId" .=) <$> _reOperationId])
932+
933+-- | Represents a single metric value.
934+--
935+-- /See:/ 'metricValue' smart constructor.
936+data MetricValue = MetricValue'
937+ { _mvBoolValue :: !(Maybe Bool)
938+ , _mvStartTime :: !(Maybe DateTime')
939+ , _mvDoubleValue :: !(Maybe (Textual Double))
940+ , _mvStringValue :: !(Maybe Text)
941+ , _mvDistributionValue :: !(Maybe Distribution)
942+ , _mvEndTime :: !(Maybe DateTime')
943+ , _mvInt64Value :: !(Maybe (Textual Int64))
944+ , _mvLabels :: !(Maybe MetricValueLabels)
945+ } deriving (Eq,Show,Data,Typeable,Generic)
946+
947+-- | Creates a value of 'MetricValue' with the minimum fields required to make a request.
948+--
949+-- Use one of the following lenses to modify other fields as desired:
950+--
951+-- * 'mvBoolValue'
952+--
953+-- * 'mvStartTime'
954+--
955+-- * 'mvDoubleValue'
956+--
957+-- * 'mvStringValue'
958+--
959+-- * 'mvDistributionValue'
960+--
961+-- * 'mvEndTime'
962+--
963+-- * 'mvInt64Value'
964+--
965+-- * 'mvLabels'
966+metricValue
967+ :: MetricValue
968+metricValue =
969+ MetricValue'
970+ { _mvBoolValue = Nothing
971+ , _mvStartTime = Nothing
972+ , _mvDoubleValue = Nothing
973+ , _mvStringValue = Nothing
974+ , _mvDistributionValue = Nothing
975+ , _mvEndTime = Nothing
976+ , _mvInt64Value = Nothing
977+ , _mvLabels = Nothing
978+ }
979+
980+-- | A boolean value.
981+mvBoolValue :: Lens' MetricValue (Maybe Bool)
982+mvBoolValue
983+ = lens _mvBoolValue (\ s a -> s{_mvBoolValue = a})
984+
985+-- | The start of the time period over which this metric value\'s measurement
986+-- applies. The time period has different semantics for different metric
987+-- types (cumulative, delta, and gauge). See the metric definition
988+-- documentation in the service configuration for details.
989+mvStartTime :: Lens' MetricValue (Maybe UTCTime)
990+mvStartTime
991+ = lens _mvStartTime (\ s a -> s{_mvStartTime = a}) .
992+ mapping _DateTime
993+
994+-- | A double precision floating point value.
995+mvDoubleValue :: Lens' MetricValue (Maybe Double)
996+mvDoubleValue
997+ = lens _mvDoubleValue
998+ (\ s a -> s{_mvDoubleValue = a})
999+ . mapping _Coerce
1000+
1001+-- | A text string value.
1002+mvStringValue :: Lens' MetricValue (Maybe Text)
1003+mvStringValue
1004+ = lens _mvStringValue
1005+ (\ s a -> s{_mvStringValue = a})
1006+
1007+-- | A distribution value.
1008+mvDistributionValue :: Lens' MetricValue (Maybe Distribution)
1009+mvDistributionValue
1010+ = lens _mvDistributionValue
1011+ (\ s a -> s{_mvDistributionValue = a})
1012+
1013+-- | The end of the time period over which this metric value\'s measurement
1014+-- applies.
1015+mvEndTime :: Lens' MetricValue (Maybe UTCTime)
1016+mvEndTime
1017+ = lens _mvEndTime (\ s a -> s{_mvEndTime = a}) .
1018+ mapping _DateTime
1019+
1020+-- | A signed 64-bit integer value.
1021+mvInt64Value :: Lens' MetricValue (Maybe Int64)
1022+mvInt64Value
1023+ = lens _mvInt64Value (\ s a -> s{_mvInt64Value = a})
1024+ . mapping _Coerce
1025+
1026+-- | The labels describing the metric value. See comments on
1027+-- google.api.servicecontrol.v1.Operation.labels for the overriding
1028+-- relationship.
1029+mvLabels :: Lens' MetricValue (Maybe MetricValueLabels)
1030+mvLabels = lens _mvLabels (\ s a -> s{_mvLabels = a})
1031+
1032+instance FromJSON MetricValue where
1033+ parseJSON
1034+ = withObject "MetricValue"
1035+ (\ o ->
1036+ MetricValue' <$>
1037+ (o .:? "boolValue") <*> (o .:? "startTime") <*>
1038+ (o .:? "doubleValue")
1039+ <*> (o .:? "stringValue")
1040+ <*> (o .:? "distributionValue")
1041+ <*> (o .:? "endTime")
1042+ <*> (o .:? "int64Value")
1043+ <*> (o .:? "labels"))
1044+
1045+instance ToJSON MetricValue where
1046+ toJSON MetricValue'{..}
1047+ = object
1048+ (catMaybes
1049+ [("boolValue" .=) <$> _mvBoolValue,
1050+ ("startTime" .=) <$> _mvStartTime,
1051+ ("doubleValue" .=) <$> _mvDoubleValue,
1052+ ("stringValue" .=) <$> _mvStringValue,
1053+ ("distributionValue" .=) <$> _mvDistributionValue,
1054+ ("endTime" .=) <$> _mvEndTime,
1055+ ("int64Value" .=) <$> _mvInt64Value,
1056+ ("labels" .=) <$> _mvLabels])
1057+
1058+-- | Response message for the Check method.
1059+--
1060+-- /See:/ 'checkResponse' smart constructor.
1061+data CheckResponse = CheckResponse'
1062+ { _crCheckErrors :: !(Maybe [CheckError])
1063+ , _crServiceConfigId :: !(Maybe Text)
1064+ , _crOperationId :: !(Maybe Text)
1065+ } deriving (Eq,Show,Data,Typeable,Generic)
1066+
1067+-- | Creates a value of 'CheckResponse' with the minimum fields required to make a request.
1068+--
1069+-- Use one of the following lenses to modify other fields as desired:
1070+--
1071+-- * 'crCheckErrors'
1072+--
1073+-- * 'crServiceConfigId'
1074+--
1075+-- * 'crOperationId'
1076+checkResponse
1077+ :: CheckResponse
1078+checkResponse =
1079+ CheckResponse'
1080+ { _crCheckErrors = Nothing
1081+ , _crServiceConfigId = Nothing
1082+ , _crOperationId = Nothing
1083+ }
1084+
1085+-- | Indicate the decision of the check. If no check errors are present, the
1086+-- service should process the operation. Otherwise the service should use
1087+-- the list of errors to determine the appropriate action.
1088+crCheckErrors :: Lens' CheckResponse [CheckError]
1089+crCheckErrors
1090+ = lens _crCheckErrors
1091+ (\ s a -> s{_crCheckErrors = a})
1092+ . _Default
1093+ . _Coerce
1094+
1095+-- | The actual config id used to process the request.
1096+crServiceConfigId :: Lens' CheckResponse (Maybe Text)
1097+crServiceConfigId
1098+ = lens _crServiceConfigId
1099+ (\ s a -> s{_crServiceConfigId = a})
1100+
1101+-- | The same operation_id value used in the CheckRequest. Used for logging
1102+-- and diagnostics purposes.
1103+crOperationId :: Lens' CheckResponse (Maybe Text)
1104+crOperationId
1105+ = lens _crOperationId
1106+ (\ s a -> s{_crOperationId = a})
1107+
1108+instance FromJSON CheckResponse where
1109+ parseJSON
1110+ = withObject "CheckResponse"
1111+ (\ o ->
1112+ CheckResponse' <$>
1113+ (o .:? "checkErrors" .!= mempty) <*>
1114+ (o .:? "serviceConfigId")
1115+ <*> (o .:? "operationId"))
1116+
1117+instance ToJSON CheckResponse where
1118+ toJSON CheckResponse'{..}
1119+ = object
1120+ (catMaybes
1121+ [("checkErrors" .=) <$> _crCheckErrors,
1122+ ("serviceConfigId" .=) <$> _crServiceConfigId,
1123+ ("operationId" .=) <$> _crOperationId])
1124+
1125+-- | Response message for the Report method.
1126+--
1127+-- /See:/ 'reportResponse' smart constructor.
1128+data ReportResponse = ReportResponse'
1129+ { _rrReportErrors :: !(Maybe [ReportError])
1130+ , _rrServiceConfigId :: !(Maybe Text)
1131+ } deriving (Eq,Show,Data,Typeable,Generic)
1132+
1133+-- | Creates a value of 'ReportResponse' with the minimum fields required to make a request.
1134+--
1135+-- Use one of the following lenses to modify other fields as desired:
1136+--
1137+-- * 'rrReportErrors'
1138+--
1139+-- * 'rrServiceConfigId'
1140+reportResponse
1141+ :: ReportResponse
1142+reportResponse =
1143+ ReportResponse'
1144+ { _rrReportErrors = Nothing
1145+ , _rrServiceConfigId = Nothing
1146+ }
1147+
1148+-- | Partial failures, one for each \`Operation\` in the request that failed
1149+-- processing. There are three possible combinations of the RPC status: 1.
1150+-- The combination of a successful RPC status and an empty
1151+-- \`report_errors\` list indicates a complete success where all
1152+-- \`Operations\` in the request are processed successfully. 2. The
1153+-- combination of a successful RPC status and a non-empty \`report_errors\`
1154+-- list indicates a partial success where some \`Operations\` in the
1155+-- request succeeded. Each \`Operation\` that failed processing has a
1156+-- corresponding item in this list. 3. A failed RPC status indicates a
1157+-- complete failure where none of the \`Operations\` in the request
1158+-- succeeded.
1159+rrReportErrors :: Lens' ReportResponse [ReportError]
1160+rrReportErrors
1161+ = lens _rrReportErrors
1162+ (\ s a -> s{_rrReportErrors = a})
1163+ . _Default
1164+ . _Coerce
1165+
1166+-- | The actual config id used to process the request.
1167+rrServiceConfigId :: Lens' ReportResponse (Maybe Text)
1168+rrServiceConfigId
1169+ = lens _rrServiceConfigId
1170+ (\ s a -> s{_rrServiceConfigId = a})
1171+
1172+instance FromJSON ReportResponse where
1173+ parseJSON
1174+ = withObject "ReportResponse"
1175+ (\ o ->
1176+ ReportResponse' <$>
1177+ (o .:? "reportErrors" .!= mempty) <*>
1178+ (o .:? "serviceConfigId"))
1179+
1180+instance ToJSON ReportResponse where
1181+ toJSON ReportResponse'{..}
1182+ = object
1183+ (catMaybes
1184+ [("reportErrors" .=) <$> _rrReportErrors,
1185+ ("serviceConfigId" .=) <$> _rrServiceConfigId])
1186+
1187+-- | An individual log entry.
1188+--
1189+-- /See:/ 'logEntry' smart constructor.
1190+data LogEntry = LogEntry'
1191+ { _leSeverity :: !(Maybe LogEntrySeverity)
1192+ , _leTextPayload :: !(Maybe Text)
1193+ , _leStructPayload :: !(Maybe LogEntryStructPayload)
1194+ , _leName :: !(Maybe Text)
1195+ , _leInsertId :: !(Maybe Text)
1196+ , _leLabels :: !(Maybe LogEntryLabels)
1197+ , _leProtoPayload :: !(Maybe LogEntryProtoPayload)
1198+ , _leTimestamp :: !(Maybe DateTime')
1199+ } deriving (Eq,Show,Data,Typeable,Generic)
1200+
1201+-- | Creates a value of 'LogEntry' with the minimum fields required to make a request.
1202+--
1203+-- Use one of the following lenses to modify other fields as desired:
1204+--
1205+-- * 'leSeverity'
1206+--
1207+-- * 'leTextPayload'
1208+--
1209+-- * 'leStructPayload'
1210+--
1211+-- * 'leName'
1212+--
1213+-- * 'leInsertId'
1214+--
1215+-- * 'leLabels'
1216+--
1217+-- * 'leProtoPayload'
1218+--
1219+-- * 'leTimestamp'
1220+logEntry
1221+ :: LogEntry
1222+logEntry =
1223+ LogEntry'
1224+ { _leSeverity = Nothing
1225+ , _leTextPayload = Nothing
1226+ , _leStructPayload = Nothing
1227+ , _leName = Nothing
1228+ , _leInsertId = Nothing
1229+ , _leLabels = Nothing
1230+ , _leProtoPayload = Nothing
1231+ , _leTimestamp = Nothing
1232+ }
1233+
1234+-- | The severity of the log entry. The default value is
1235+-- \`LogSeverity.DEFAULT\`.
1236+leSeverity :: Lens' LogEntry (Maybe LogEntrySeverity)
1237+leSeverity
1238+ = lens _leSeverity (\ s a -> s{_leSeverity = a})
1239+
1240+-- | The log entry payload, represented as a Unicode string (UTF-8).
1241+leTextPayload :: Lens' LogEntry (Maybe Text)
1242+leTextPayload
1243+ = lens _leTextPayload
1244+ (\ s a -> s{_leTextPayload = a})
1245+
1246+-- | The log entry payload, represented as a structure that is expressed as a
1247+-- JSON object.
1248+leStructPayload :: Lens' LogEntry (Maybe LogEntryStructPayload)
1249+leStructPayload
1250+ = lens _leStructPayload
1251+ (\ s a -> s{_leStructPayload = a})
1252+
1253+-- | Required. The log to which this log entry belongs. Examples:
1254+-- \`\"syslog\"\`, \`\"book_log\"\`.
1255+leName :: Lens' LogEntry (Maybe Text)
1256+leName = lens _leName (\ s a -> s{_leName = a})
1257+
1258+-- | A unique ID for the log entry used for deduplication. If omitted, the
1259+-- implementation will generate one based on operation_id.
1260+leInsertId :: Lens' LogEntry (Maybe Text)
1261+leInsertId
1262+ = lens _leInsertId (\ s a -> s{_leInsertId = a})
1263+
1264+-- | A set of user-defined (key, value) data that provides additional
1265+-- information about the log entry.
1266+leLabels :: Lens' LogEntry (Maybe LogEntryLabels)
1267+leLabels = lens _leLabels (\ s a -> s{_leLabels = a})
1268+
1269+-- | The log entry payload, represented as a protocol buffer that is
1270+-- expressed as a JSON object. You can only pass \`protoPayload\` values
1271+-- that belong to a set of approved types.
1272+leProtoPayload :: Lens' LogEntry (Maybe LogEntryProtoPayload)
1273+leProtoPayload
1274+ = lens _leProtoPayload
1275+ (\ s a -> s{_leProtoPayload = a})
1276+
1277+-- | The time the event described by the log entry occurred. If omitted,
1278+-- defaults to operation start time.
1279+leTimestamp :: Lens' LogEntry (Maybe UTCTime)
1280+leTimestamp
1281+ = lens _leTimestamp (\ s a -> s{_leTimestamp = a}) .
1282+ mapping _DateTime
1283+
1284+instance FromJSON LogEntry where
1285+ parseJSON
1286+ = withObject "LogEntry"
1287+ (\ o ->
1288+ LogEntry' <$>
1289+ (o .:? "severity") <*> (o .:? "textPayload") <*>
1290+ (o .:? "structPayload")
1291+ <*> (o .:? "name")
1292+ <*> (o .:? "insertId")
1293+ <*> (o .:? "labels")
1294+ <*> (o .:? "protoPayload")
1295+ <*> (o .:? "timestamp"))
1296+
1297+instance ToJSON LogEntry where
1298+ toJSON LogEntry'{..}
1299+ = object
1300+ (catMaybes
1301+ [("severity" .=) <$> _leSeverity,
1302+ ("textPayload" .=) <$> _leTextPayload,
1303+ ("structPayload" .=) <$> _leStructPayload,
1304+ ("name" .=) <$> _leName,
1305+ ("insertId" .=) <$> _leInsertId,
1306+ ("labels" .=) <$> _leLabels,
1307+ ("protoPayload" .=) <$> _leProtoPayload,
1308+ ("timestamp" .=) <$> _leTimestamp])
1309+
1310+-- | Labels describing the operation. Only the following labels are allowed:
1311+-- - Labels describing monitored resources as defined in the service
1312+-- configuration. - Default labels of metric values. When specified, labels
1313+-- defined in the metric value override these default. - The following
1314+-- labels defined by Google Cloud Platform: -
1315+-- \`cloud.googleapis.com\/location\` describing the location where the
1316+-- operation happened, - \`servicecontrol.googleapis.com\/user_agent\`
1317+-- describing the user agent of the API request, -
1318+-- \`servicecontrol.googleapis.com\/service_agent\` describing the service
1319+-- used to handle the API request (e.g. ESP), -
1320+-- \`servicecontrol.googleapis.com\/platform\` describing the platform
1321+-- where the API is served (e.g. GAE, GCE, GKE).
1322+--
1323+-- /See:/ 'operationLabels' smart constructor.
1324+newtype OperationLabels = OperationLabels'
1325+ { _olAddtional :: HashMap Text Text
1326+ } deriving (Eq,Show,Data,Typeable,Generic)
1327+
1328+-- | Creates a value of 'OperationLabels' with the minimum fields required to make a request.
1329+--
1330+-- Use one of the following lenses to modify other fields as desired:
1331+--
1332+-- * 'olAddtional'
1333+operationLabels
1334+ :: HashMap Text Text -- ^ 'olAddtional'
1335+ -> OperationLabels
1336+operationLabels pOlAddtional_ =
1337+ OperationLabels'
1338+ { _olAddtional = _Coerce # pOlAddtional_
1339+ }
1340+
1341+olAddtional :: Lens' OperationLabels (HashMap Text Text)
1342+olAddtional
1343+ = lens _olAddtional (\ s a -> s{_olAddtional = a}) .
1344+ _Coerce
1345+
1346+instance FromJSON OperationLabels where
1347+ parseJSON
1348+ = withObject "OperationLabels"
1349+ (\ o -> OperationLabels' <$> (parseJSONObject o))
1350+
1351+instance ToJSON OperationLabels where
1352+ toJSON = toJSON . _olAddtional
1353+
1354+-- | Describing buckets with arbitrary user-provided width.
1355+--
1356+-- /See:/ 'explicitBuckets' smart constructor.
1357+newtype ExplicitBuckets = ExplicitBuckets'
1358+ { _ebBounds :: Maybe [Textual Double]
1359+ } deriving (Eq,Show,Data,Typeable,Generic)
1360+
1361+-- | Creates a value of 'ExplicitBuckets' with the minimum fields required to make a request.
1362+--
1363+-- Use one of the following lenses to modify other fields as desired:
1364+--
1365+-- * 'ebBounds'
1366+explicitBuckets
1367+ :: ExplicitBuckets
1368+explicitBuckets =
1369+ ExplicitBuckets'
1370+ { _ebBounds = Nothing
1371+ }
1372+
1373+-- | \'bound\' is a list of strictly increasing boundaries between buckets.
1374+-- Note that a list of length N-1 defines N buckets because of
1375+-- fenceposting. See comments on \`bucket_options\` for details. The i\'th
1376+-- finite bucket covers the interval [bound[i-1], bound[i]) where i ranges
1377+-- from 1 to bound_size() - 1. Note that there are no finite buckets at all
1378+-- if \'bound\' only contains a single element; in that special case the
1379+-- single bound defines the boundary between the underflow and overflow
1380+-- buckets. bucket number lower bound upper bound i == 0 (underflow) -inf
1381+-- bound[i] 0 \< i \< bound_size() bound[i-1] bound[i] i == bound_size()
1382+-- (overflow) bound[i-1] +inf
1383+ebBounds :: Lens' ExplicitBuckets [Double]
1384+ebBounds
1385+ = lens _ebBounds (\ s a -> s{_ebBounds = a}) .
1386+ _Default
1387+ . _Coerce
1388+
1389+instance FromJSON ExplicitBuckets where
1390+ parseJSON
1391+ = withObject "ExplicitBuckets"
1392+ (\ o ->
1393+ ExplicitBuckets' <$> (o .:? "bounds" .!= mempty))
1394+
1395+instance ToJSON ExplicitBuckets where
1396+ toJSON ExplicitBuckets'{..}
1397+ = object (catMaybes [("bounds" .=) <$> _ebBounds])
1398+
1399+-- | The log entry payload, represented as a structure that is expressed as a
1400+-- JSON object.
1401+--
1402+-- /See:/ 'logEntryStructPayload' smart constructor.
1403+newtype LogEntryStructPayload = LogEntryStructPayload'
1404+ { _lespAddtional :: HashMap Text JSONValue
1405+ } deriving (Eq,Show,Data,Typeable,Generic)
1406+
1407+-- | Creates a value of 'LogEntryStructPayload' with the minimum fields required to make a request.
1408+--
1409+-- Use one of the following lenses to modify other fields as desired:
1410+--
1411+-- * 'lespAddtional'
1412+logEntryStructPayload
1413+ :: HashMap Text JSONValue -- ^ 'lespAddtional'
1414+ -> LogEntryStructPayload
1415+logEntryStructPayload pLespAddtional_ =
1416+ LogEntryStructPayload'
1417+ { _lespAddtional = _Coerce # pLespAddtional_
1418+ }
1419+
1420+-- | Properties of the object.
1421+lespAddtional :: Lens' LogEntryStructPayload (HashMap Text JSONValue)
1422+lespAddtional
1423+ = lens _lespAddtional
1424+ (\ s a -> s{_lespAddtional = a})
1425+ . _Coerce
1426+
1427+instance FromJSON LogEntryStructPayload where
1428+ parseJSON
1429+ = withObject "LogEntryStructPayload"
1430+ (\ o ->
1431+ LogEntryStructPayload' <$> (parseJSONObject o))
1432+
1433+instance ToJSON LogEntryStructPayload where
1434+ toJSON = toJSON . _lespAddtional
gogol-servicecontrol/gen/Network/Google/ServiceControl/Types/Sum.hsnew file+255
@@ -0,0 +1,255 @@
1+{-# LANGUAGE DeriveDataTypeable #-}
2+{-# LANGUAGE DeriveGeneric #-}
3+{-# LANGUAGE LambdaCase #-}
4+{-# LANGUAGE NoImplicitPrelude #-}
5+{-# LANGUAGE OverloadedStrings #-}
6+
7+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
8+
9+-- |
10+-- Module : Network.Google.ServiceControl.Types.Sum
11+-- Copyright : (c) 2015-2016 Brendan Hay
12+-- License : Mozilla Public License, v. 2.0.
13+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
14+-- Stability : auto-generated
15+-- Portability : non-portable (GHC extensions)
16+--
17+module Network.Google.ServiceControl.Types.Sum where
18+
19+import Network.Google.Prelude
20+
21+-- | The error code.
22+data CheckErrorCode
23+ = ErrorCodeUnspecified
24+ -- ^ @ERROR_CODE_UNSPECIFIED@
25+ -- This is never used in \`CheckResponse\`.
26+ | NotFound
27+ -- ^ @NOT_FOUND@
28+ -- The consumer\'s project id was not found. Same as
29+ -- google.rpc.Code.NOT_FOUND.
30+ | PermissionDenied
31+ -- ^ @PERMISSION_DENIED@
32+ -- The consumer doesn\'t have access to the specified resource. Same as
33+ -- google.rpc.Code.PERMISSION_DENIED.
34+ | ResourceExhausted
35+ -- ^ @RESOURCE_EXHAUSTED@
36+ -- Quota check failed. Same as google.rpc.Code.RESOURCE_EXHAUSTED.
37+ | ServiceNotActivated
38+ -- ^ @SERVICE_NOT_ACTIVATED@
39+ -- The consumer hasn\'t activated the service.
40+ | BillingDisabled
41+ -- ^ @BILLING_DISABLED@
42+ -- The consumer cannot access the service because billing is disabled.
43+ | ProjectDeleted
44+ -- ^ @PROJECT_DELETED@
45+ -- The consumer\'s project has been marked as deleted (soft deletion).
46+ | ProjectInvalid
47+ -- ^ @PROJECT_INVALID@
48+ -- The consumer\'s project number or id does not represent a valid project.
49+ | IPAddressBlocked
50+ -- ^ @IP_ADDRESS_BLOCKED@
51+ -- The IP address of the consumer is invalid for the specific consumer
52+ -- project.
53+ | RefererBlocked
54+ -- ^ @REFERER_BLOCKED@
55+ -- The referer address of the consumer request is invalid for the specific
56+ -- consumer project.
57+ | ClientAppBlocked
58+ -- ^ @CLIENT_APP_BLOCKED@
59+ -- The client application of the consumer request is invalid for the
60+ -- specific consumer project.
61+ | APIKeyInvalid
62+ -- ^ @API_KEY_INVALID@
63+ -- The consumer\'s API key is invalid.
64+ | APIKeyExpired
65+ -- ^ @API_KEY_EXPIRED@
66+ -- The consumer\'s API Key has expired.
67+ | APIKeyNotFound
68+ -- ^ @API_KEY_NOT_FOUND@
69+ -- The consumer\'s API Key was not found in config record.
70+ | NamespaceLookupUnavailable
71+ -- ^ @NAMESPACE_LOOKUP_UNAVAILABLE@
72+ -- The backend server for looking up project id\/number is unavailable.
73+ | ServiceStatusUnavailable
74+ -- ^ @SERVICE_STATUS_UNAVAILABLE@
75+ -- The backend server for checking service status is unavailable.
76+ | BillingStatusUnavailable
77+ -- ^ @BILLING_STATUS_UNAVAILABLE@
78+ -- The backend server for checking billing status is unavailable.
79+ deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
80+
81+instance Hashable CheckErrorCode
82+
83+instance FromHttpApiData CheckErrorCode where
84+ parseQueryParam = \case
85+ "ERROR_CODE_UNSPECIFIED" -> Right ErrorCodeUnspecified
86+ "NOT_FOUND" -> Right NotFound
87+ "PERMISSION_DENIED" -> Right PermissionDenied
88+ "RESOURCE_EXHAUSTED" -> Right ResourceExhausted
89+ "SERVICE_NOT_ACTIVATED" -> Right ServiceNotActivated
90+ "BILLING_DISABLED" -> Right BillingDisabled
91+ "PROJECT_DELETED" -> Right ProjectDeleted
92+ "PROJECT_INVALID" -> Right ProjectInvalid
93+ "IP_ADDRESS_BLOCKED" -> Right IPAddressBlocked
94+ "REFERER_BLOCKED" -> Right RefererBlocked
95+ "CLIENT_APP_BLOCKED" -> Right ClientAppBlocked
96+ "API_KEY_INVALID" -> Right APIKeyInvalid
97+ "API_KEY_EXPIRED" -> Right APIKeyExpired
98+ "API_KEY_NOT_FOUND" -> Right APIKeyNotFound
99+ "NAMESPACE_LOOKUP_UNAVAILABLE" -> Right NamespaceLookupUnavailable
100+ "SERVICE_STATUS_UNAVAILABLE" -> Right ServiceStatusUnavailable
101+ "BILLING_STATUS_UNAVAILABLE" -> Right BillingStatusUnavailable
102+ x -> Left ("Unable to parse CheckErrorCode from: " <> x)
103+
104+instance ToHttpApiData CheckErrorCode where
105+ toQueryParam = \case
106+ ErrorCodeUnspecified -> "ERROR_CODE_UNSPECIFIED"
107+ NotFound -> "NOT_FOUND"
108+ PermissionDenied -> "PERMISSION_DENIED"
109+ ResourceExhausted -> "RESOURCE_EXHAUSTED"
110+ ServiceNotActivated -> "SERVICE_NOT_ACTIVATED"
111+ BillingDisabled -> "BILLING_DISABLED"
112+ ProjectDeleted -> "PROJECT_DELETED"
113+ ProjectInvalid -> "PROJECT_INVALID"
114+ IPAddressBlocked -> "IP_ADDRESS_BLOCKED"
115+ RefererBlocked -> "REFERER_BLOCKED"
116+ ClientAppBlocked -> "CLIENT_APP_BLOCKED"
117+ APIKeyInvalid -> "API_KEY_INVALID"
118+ APIKeyExpired -> "API_KEY_EXPIRED"
119+ APIKeyNotFound -> "API_KEY_NOT_FOUND"
120+ NamespaceLookupUnavailable -> "NAMESPACE_LOOKUP_UNAVAILABLE"
121+ ServiceStatusUnavailable -> "SERVICE_STATUS_UNAVAILABLE"
122+ BillingStatusUnavailable -> "BILLING_STATUS_UNAVAILABLE"
123+
124+instance FromJSON CheckErrorCode where
125+ parseJSON = parseJSONText "CheckErrorCode"
126+
127+instance ToJSON CheckErrorCode where
128+ toJSON = toJSONText
129+
130+-- | DO NOT USE. This is an experimental field.
131+data OperationImportance
132+ = Low
133+ -- ^ @LOW@
134+ -- The API implementation may cache and aggregate the data. The data may be
135+ -- lost when rare and unexpected system failures occur.
136+ | High
137+ -- ^ @HIGH@
138+ -- The API implementation doesn\'t cache and aggregate the data. If the
139+ -- method returns successfully, it\'s guaranteed that the data has been
140+ -- persisted in durable storage.
141+ deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
142+
143+instance Hashable OperationImportance
144+
145+instance FromHttpApiData OperationImportance where
146+ parseQueryParam = \case
147+ "LOW" -> Right Low
148+ "HIGH" -> Right High
149+ x -> Left ("Unable to parse OperationImportance from: " <> x)
150+
151+instance ToHttpApiData OperationImportance where
152+ toQueryParam = \case
153+ Low -> "LOW"
154+ High -> "HIGH"
155+
156+instance FromJSON OperationImportance where
157+ parseJSON = parseJSONText "OperationImportance"
158+
159+instance ToJSON OperationImportance where
160+ toJSON = toJSONText
161+
162+-- | V1 error format.
163+data Xgafv
164+ = X1
165+ -- ^ @1@
166+ -- v1 error format
167+ | X2
168+ -- ^ @2@
169+ -- v2 error format
170+ deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
171+
172+instance Hashable Xgafv
173+
174+instance FromHttpApiData Xgafv where
175+ parseQueryParam = \case
176+ "1" -> Right X1
177+ "2" -> Right X2
178+ x -> Left ("Unable to parse Xgafv from: " <> x)
179+
180+instance ToHttpApiData Xgafv where
181+ toQueryParam = \case
182+ X1 -> "1"
183+ X2 -> "2"
184+
185+instance FromJSON Xgafv where
186+ parseJSON = parseJSONText "Xgafv"
187+
188+instance ToJSON Xgafv where
189+ toJSON = toJSONText
190+
191+-- | The severity of the log entry. The default value is
192+-- \`LogSeverity.DEFAULT\`.
193+data LogEntrySeverity
194+ = Default
195+ -- ^ @DEFAULT@
196+ -- (0) The log entry has no assigned severity level.
197+ | Debug
198+ -- ^ @DEBUG@
199+ -- (100) Debug or trace information.
200+ | Info
201+ -- ^ @INFO@
202+ -- (200) Routine information, such as ongoing status or performance.
203+ | Notice
204+ -- ^ @NOTICE@
205+ -- (300) Normal but significant events, such as start up, shut down, or a
206+ -- configuration change.
207+ | Warning
208+ -- ^ @WARNING@
209+ -- (400) Warning events might cause problems.
210+ | Error'
211+ -- ^ @ERROR@
212+ -- (500) Error events are likely to cause problems.
213+ | Critical
214+ -- ^ @CRITICAL@
215+ -- (600) Critical events cause more severe problems or outages.
216+ | Alert
217+ -- ^ @ALERT@
218+ -- (700) A person must take an action immediately.
219+ | Emergency
220+ -- ^ @EMERGENCY@
221+ -- (800) One or more systems are unusable.
222+ deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
223+
224+instance Hashable LogEntrySeverity
225+
226+instance FromHttpApiData LogEntrySeverity where
227+ parseQueryParam = \case
228+ "DEFAULT" -> Right Default
229+ "DEBUG" -> Right Debug
230+ "INFO" -> Right Info
231+ "NOTICE" -> Right Notice
232+ "WARNING" -> Right Warning
233+ "ERROR" -> Right Error'
234+ "CRITICAL" -> Right Critical
235+ "ALERT" -> Right Alert
236+ "EMERGENCY" -> Right Emergency
237+ x -> Left ("Unable to parse LogEntrySeverity from: " <> x)
238+
239+instance ToHttpApiData LogEntrySeverity where
240+ toQueryParam = \case
241+ Default -> "DEFAULT"
242+ Debug -> "DEBUG"
243+ Info -> "INFO"
244+ Notice -> "NOTICE"
245+ Warning -> "WARNING"
246+ Error' -> "ERROR"
247+ Critical -> "CRITICAL"
248+ Alert -> "ALERT"
249+ Emergency -> "EMERGENCY"
250+
251+instance FromJSON LogEntrySeverity where
252+ parseJSON = parseJSONText "LogEntrySeverity"
253+
254+instance ToJSON LogEntrySeverity where
255+ toJSON = toJSONText
gogol-servicecontrol/gogol-servicecontrol.cabalnew file+48
@@ -0,0 +1,48 @@
1+name: gogol-servicecontrol
2+version: 0.1.0
3+synopsis: Google Service Control SDK.
4+homepage: https://github.com/brendanhay/gogol
5+bug-reports: https://github.com/brendanhay/gogol/issues
6+license: OtherLicense
7+license-file: LICENSE
8+author: Brendan Hay
9+maintainer: Brendan Hay <brendan.g.hay@gmail.com>
10+copyright: Copyright (c) 2015-2016 Brendan Hay
11+category: Network, Google, Cloud
12+build-type: Simple
13+cabal-version: >= 1.10
14+extra-source-files: README.md
15+
16+description:
17+ Google Service Control provides control plane functionality to managed
18+ services, such as logging, monitoring, and status checks.
19+ .
20+ /Warning:/ This is an experimental prototype/preview release which is still
21+ under exploratory development and not intended for public use, caveat emptor!
22+ .
23+ This library is compatible with version @v1@
24+ of the API.
25+
26+source-repository head
27+ type: git
28+ location: git://github.com/brendanhay/gogol.git
29+
30+library
31+ default-language: Haskell2010
32+ hs-source-dirs: src gen
33+
34+ ghc-options: -Wall
35+
36+ exposed-modules:
37+ Network.Google.Resource.ServiceControl.Services.Check
38+ , Network.Google.Resource.ServiceControl.Services.Report
39+ , Network.Google.ServiceControl
40+ , Network.Google.ServiceControl.Types
41+
42+ other-modules:
43+ Network.Google.ServiceControl.Types.Product
44+ , Network.Google.ServiceControl.Types.Sum
45+
46+ build-depends:
47+ gogol-core == 0.1.0.*
48+ , base >= 4.7 && < 5
gogol-servicecontrol/src/.gitkeepnew file

No changes to the content.